GraphicDataProvider
using Autodesk.DesignScript.Interfaces;
using System.Collections.Generic;
namespace Autodesk.DesignScript.Geometry
{
internal class GraphicDataProvider
{
public List<IGraphicItem> GetGraphicItems(object obj)
{
DesignScriptEntity designScriptEntity = obj as DesignScriptEntity;
if (designScriptEntity == null)
return null;
IGraphicItem item = new GeometryGraphicItem(designScriptEntity);
return new List<IGraphicItem> {
item
};
}
public void Tessellate(List<object> objects, IRenderPackage package, TessellationParameters parameters)
{
foreach (object object in objects) {
List<IGraphicItem> graphicItems = GetGraphicItems(object);
if (graphicItems != null && graphicItems.Count != 0) {
parameters.set_ScaleFactor(DesignScriptEntity.scaleFactor);
foreach (IGraphicItem item in graphicItems) {
item.Tessellate(package, parameters);
}
}
}
}
}
}