Extract drawing from PPE to InteractionLayer
- Eliminate event bindings, invoke DrawEditor directly
This commit is contained in:
parent
0d895258aa
commit
316c15a844
3 changed files with 8 additions and 14 deletions
|
|
@ -49,8 +49,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
|
||||
public InteractiveScene Scene { get; }
|
||||
|
||||
public event EventHandler<DrawEventArgs> DrawGlOpaqueContent;
|
||||
|
||||
public bool DoOpenGlDrawing { get; set; } = true;
|
||||
|
||||
// TODO: Collapse into auto-property
|
||||
|
|
@ -118,7 +116,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
GLHelper.SetGlContext(this.World, renderSource.TransformToScreenSpace(renderSource.LocalBounds), lighting);
|
||||
|
||||
// Draw Gl Content
|
||||
DrawGlOpaqueContent?.Invoke(this, e);
|
||||
this.DrawGlTransparentContent(e);
|
||||
|
||||
GLHelper.UnsetGlContext();
|
||||
|
|
|
|||
|
|
@ -442,6 +442,14 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
{
|
||||
DrawObject(object3D, transparentMeshes, e);
|
||||
}
|
||||
|
||||
// Invoke existing IEditorDraw when iterating items
|
||||
if (object3D is IEditorDraw editorDraw)
|
||||
{
|
||||
// TODO: Putting the drawing code in the IObject3D means almost certain bindings to MatterControl in IObject3D. If instead
|
||||
// we had a UI layer object that used binding to register scene drawing hooks for specific types, we could avoid the bindings
|
||||
editorDraw.DrawEditor(this, e);
|
||||
}
|
||||
}
|
||||
|
||||
transparentMeshes.Sort(BackToFrontXY);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue