Add iterable list of Drawables to viewer

This commit is contained in:
John Lewin 2019-01-31 22:04:39 -08:00
parent c2fee997d2
commit 0f857acc96
3 changed files with 13 additions and 13 deletions

View file

@ -63,7 +63,11 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
private ThemeConfig theme;
private FloorDrawable floorDrawable;
private TraceDataDrawable traceDataDebugger;
private ModelRenderStyle modelRenderStyle = ModelRenderStyle.Wireframe;
private long lastSelectionChangedMs;
private List<IDrawable> drawables = new List<IDrawable>();
public bool AllowBedRenderingWhenEmpty { get; set; }
@ -84,6 +88,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
};
}
drawables.Add(new AxisIndicatorDrawable());
drawables.Add(new TraceDataDrawable(sceneContext));
base.OnLoad(args);
}
@ -373,7 +380,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
return drawColor;
}
private void RenderSelection(IObject3D item, Frustum frustum, Color selectionColor)
{
if (item.Mesh == null)
@ -477,8 +483,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
floorDrawable.Draw(this, e, Matrix4X4.Identity, this.World);
}
traceDataDebugger.Draw(this, e, Matrix4X4.Identity, this.World);
var wireColor = Color.Transparent;
switch(modelRenderStyle)
{
@ -517,6 +521,11 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
GLHelper.Render(debugItem.Mesh, debugBorderColor, debugItem.WorldMatrix(),
RenderTypes.Wireframe, debugItem.WorldMatrix() * World.ModelviewMatrix);
}
foreach(var drawable in drawables)
{
drawable.Draw(this, e, Matrix4X4.Identity, this.World);
}
}
@ -559,10 +568,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
None
}
private ModelRenderStyle modelRenderStyle = ModelRenderStyle.Wireframe;
private long lastSelectionChangedMs;
private class Object3DView
{
public Color Color { get; set; }