Making controls more independent
This commit is contained in:
parent
95543966d3
commit
77ec3d5909
43 changed files with 532 additions and 562 deletions
|
|
@ -47,6 +47,12 @@ namespace MatterHackers.MeshVisualizer
|
|||
/// </summary>
|
||||
void CancelOperation();
|
||||
|
||||
void OnMouseDown(Mouse3DEventArgs mouseEvent3D);
|
||||
|
||||
void OnMouseMove(Mouse3DEventArgs mouseEvent3D);
|
||||
|
||||
void OnMouseUp(Mouse3DEventArgs mouseEvent3D);
|
||||
|
||||
void LostFocus();
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -35,9 +35,9 @@ namespace MatterHackers.MeshVisualizer
|
|||
{
|
||||
public interface IObject3DControlContext
|
||||
{
|
||||
Object3DControlBase HoveredObject3DControl { get; }
|
||||
IObject3DControl HoveredObject3DControl { get; }
|
||||
|
||||
Object3DControlBase SelectedObject3DControl { get; }
|
||||
IObject3DControl SelectedObject3DControl { get; }
|
||||
|
||||
InteractiveScene Scene { get; }
|
||||
|
||||
|
|
|
|||
|
|
@ -33,6 +33,6 @@ namespace MatterHackers.MeshVisualizer
|
|||
{
|
||||
public interface IObject3DControlProvider
|
||||
{
|
||||
IEnumerable<Object3DControlBase> Create(IObject3DControlContext context);
|
||||
IEnumerable<IObject3DControl> Create(IObject3DControlContext context);
|
||||
}
|
||||
}
|
||||
|
|
@ -35,15 +35,15 @@ using MatterHackers.VectorMath;
|
|||
|
||||
namespace MatterHackers.MeshVisualizer
|
||||
{
|
||||
public abstract class Object3DControlBase : IObject3DControl
|
||||
public abstract class Object3DControl : IObject3DControl
|
||||
{
|
||||
private bool _mouseIsOver = false;
|
||||
|
||||
public Matrix4X4 TotalTransform { get; set; } = Matrix4X4.Identity;
|
||||
|
||||
public Object3DControlBase(IObject3DControlContext meshViewerToDrawWith)
|
||||
public Object3DControl(IObject3DControlContext object3DControlContext)
|
||||
{
|
||||
this.Object3DControlContext = meshViewerToDrawWith;
|
||||
this.Object3DControlContext = object3DControlContext;
|
||||
}
|
||||
|
||||
public ITraceable CollisionVolume { get; set; }
|
||||
|
|
@ -122,7 +122,7 @@ namespace MatterHackers.MeshVisualizer
|
|||
if (mouseEvent3D.MouseEvent2D.Button == MouseButtons.Left)
|
||||
{
|
||||
MouseDownOnControl = true;
|
||||
Object3DControlContext.GuiSurface.Invalidate();
|
||||
this.Object3DControlContext.GuiSurface.Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue