From 3bd2eccf9ce6a788ae89e0f3e033afa9227a90f6 Mon Sep 17 00:00:00 2001 From: John Lewin Date: Mon, 20 May 2019 10:13:45 -0700 Subject: [PATCH] Add Visible property to IInteractionElement --- .../View3D/Interaction/IGLInteractionElement.cs | 2 ++ .../View3D/Interaction/InteractionVolume.cs | 2 ++ .../PartPreviewWindow/View3D/MeshViewerWidget.cs | 5 +++++ 3 files changed, 9 insertions(+) diff --git a/MatterControlLib/PartPreviewWindow/View3D/Interaction/IGLInteractionElement.cs b/MatterControlLib/PartPreviewWindow/View3D/Interaction/IGLInteractionElement.cs index 1c955553a..95feee0ab 100644 --- a/MatterControlLib/PartPreviewWindow/View3D/Interaction/IGLInteractionElement.cs +++ b/MatterControlLib/PartPreviewWindow/View3D/Interaction/IGLInteractionElement.cs @@ -34,6 +34,8 @@ namespace MatterHackers.MeshVisualizer /// public interface IGLInteractionElement : IInteractionElement { + bool Visible { get; set; } + bool DrawOnTop { get; } void DrawGlContent(DrawGlContentEventArgs e); diff --git a/MatterControlLib/PartPreviewWindow/View3D/Interaction/InteractionVolume.cs b/MatterControlLib/PartPreviewWindow/View3D/Interaction/InteractionVolume.cs index db9cb7cfc..57a4454c8 100644 --- a/MatterControlLib/PartPreviewWindow/View3D/Interaction/InteractionVolume.cs +++ b/MatterControlLib/PartPreviewWindow/View3D/Interaction/InteractionVolume.cs @@ -55,6 +55,8 @@ namespace MatterHackers.MeshVisualizer public bool DrawOnTop { get; protected set; } + public virtual bool Visible { get; set; } + protected bool MouseDownOnControl { get; set; } public IntersectInfo MouseMoveInfo { get; set; } diff --git a/MatterControlLib/PartPreviewWindow/View3D/MeshViewerWidget.cs b/MatterControlLib/PartPreviewWindow/View3D/MeshViewerWidget.cs index 11d560611..76830781f 100644 --- a/MatterControlLib/PartPreviewWindow/View3D/MeshViewerWidget.cs +++ b/MatterControlLib/PartPreviewWindow/View3D/MeshViewerWidget.cs @@ -603,6 +603,11 @@ namespace MatterHackers.MatterControl.PartPreviewWindow private void DrawInteractionVolumes(DrawEventArgs e) { + foreach (var item in this.InteractionVolumes.OfType()) + { + item.Visible = !SuppressUiVolumes; + } + if (SuppressUiVolumes) { return;