diff --git a/MatterControlLib/PartPreviewWindow/View3D/InteractionLayer.cs b/MatterControlLib/PartPreviewWindow/View3D/InteractionLayer.cs index d919b1f14..d3db20e22 100644 --- a/MatterControlLib/PartPreviewWindow/View3D/InteractionLayer.cs +++ b/MatterControlLib/PartPreviewWindow/View3D/InteractionLayer.cs @@ -82,8 +82,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow floorDrawable = new FloorDrawable(editorType, sceneContext, this.BuildVolumeColor, theme); - ///////////////////////// this.interactionLayer.DrawGlTransparentContent += Draw_GlTransparentContent; - if (ViewOnlyTexture == null) { // TODO: What is the ViewOnlyTexture??? @@ -119,13 +117,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow } } - public override void OnDraw(Graphics2D graphics2D) - { - //RendereSceneTraceData(new DrawEventArgs(graphics2D)); - - base.OnDraw(graphics2D); - } - public static void RenderBounds(DrawEventArgs e, WorldView World, IEnumerable allResults) { foreach (var x in allResults) diff --git a/MatterControlLib/PartPreviewWindow/View3D/MeshViewerWidget.cs b/MatterControlLib/PartPreviewWindow/View3D/MeshViewerWidget.cs index 147d600e0..1cbd116fb 100644 --- a/MatterControlLib/PartPreviewWindow/View3D/MeshViewerWidget.cs +++ b/MatterControlLib/PartPreviewWindow/View3D/MeshViewerWidget.cs @@ -59,15 +59,14 @@ namespace MatterHackers.MatterControl.PartPreviewWindow private BedConfig sceneContext; - private Color debugBorderColor = Color.Green; - private ThemeConfig theme; private FloorDrawable floorDrawable; private ModelRenderStyle modelRenderStyle = ModelRenderStyle.Wireframe; private long lastSelectionChangedMs; - private List drawables = new List(); + private List drawables = new List(); + private List itemDrawables = new List(); public bool AllowBedRenderingWhenEmpty { get; set; } @@ -77,7 +76,11 @@ namespace MatterHackers.MatterControl.PartPreviewWindow { drawables.Add(new AxisIndicatorDrawable()); //drawables.Add(new TraceDataDrawable(sceneContext)); - drawables.Add(new AABBDrawable(sceneContext)); + //drawables.Add(new AABBDrawable(sceneContext)); + +#if DEBUG + itemDrawables.Add(new InspectedItemDrawable(sceneContext)); +#endif base.OnLoad(args); } @@ -308,6 +311,12 @@ namespace MatterHackers.MatterControl.PartPreviewWindow RenderSelection(item, frustum, selectionColor); } + // Invoke all item Drawables + foreach(var drawable in itemDrawables) + { + drawable.Draw(this, item, e, Matrix4X4.Identity, this.World); + } + // turn lighting back on after rendering selection outlines GL.Enable(EnableCap.Lighting); }