Fix widget ordering to restore layer view controls

- Less coupling to MeshViewerWidget
- Interaction layer concept/surface added for IA volumes
  - Holds most IA volume logic and controls
This commit is contained in:
John Lewin 2017-07-11 08:10:57 -07:00
parent 903347e5bd
commit dda6f89c2b
12 changed files with 309 additions and 237 deletions

View file

@ -43,11 +43,11 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
private View3DWidget view3DWidget;
public SnappingIndicators(View3DWidget view3DWidget)
: base(null, view3DWidget.meshViewerWidget)
: base(null, view3DWidget.InteractionLayer)
{
this.view3DWidget = view3DWidget;
this.DrawOnTop = true;
MeshViewerToDrawWith.ParentSurface.AfterDraw += MeshViewerToDrawWith_Draw;
InteractionContext.GuiSurface.AfterDraw += MeshViewerToDrawWith_Draw;
}
public override void SetPosition(IObject3D selectedItem)
@ -57,7 +57,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
MeshSelectInfo meshSelectInfo = view3DWidget.CurrentSelectInfo;
var world = MeshViewerToDrawWith.World;
var world = InteractionContext.World;
switch (meshSelectInfo.HitQuadrant)
{
@ -117,8 +117,8 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
private void MeshViewerToDrawWith_Draw(object drawingWidget, DrawEventArgs drawEvent)
{
if (MeshViewerToDrawWith.Scene.HasSelection
&& view3DWidget.meshViewerWidget.SnapGridDistance > 0
if (InteractionContext.Scene.HasSelection
&& InteractionContext.SnapGridDistance > 0
&& view3DWidget.CurrentSelectInfo.DownOnPart)
{
if (drawEvent != null)