All the corner and edge controls are working

This commit is contained in:
Lars Brubaker 2021-04-16 17:03:39 -07:00
parent b13b3ed056
commit fa80380c26
12 changed files with 162 additions and 86 deletions

View file

@ -55,7 +55,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
MoveInZ = 1,
RotateXYZ = 2,
RotateZ = 4,
ScaleCornersXY = 8,
ScaleWidthDepth = 8,
ScaleMatrixXY = 16,
Shadow = 32,
SnappingIndicators = 64,
@ -190,11 +190,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
if (selectedItem is IObjectWithWidthAndDepth widthAndDepth)
{
for (int i = 0; i < 4; i++)
{
Object3DControls.Add(new ScaleWidthDepthCornerControl(this, i));
Object3DControls.Add(new ScaleWidthDepthEdgeControl(this, i));
}
AddControls(ControlTypes.ScaleWidthDepth);
}
else
{
@ -213,9 +209,10 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
{
if (controls.HasFlag(ControlTypes.RotateXYZ))
{
Object3DControls.Add(new RotateCornerControl(this, 0));
Object3DControls.Add(new RotateCornerControl(this, 1));
Object3DControls.Add(new RotateCornerControl(this, 2));
for (int i = 0; i < 3; i++)
{
Object3DControls.Add(new RotateCornerControl(this, i));
}
}
if (controls.HasFlag(ControlTypes.RotateZ))
@ -235,15 +232,20 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
if (controls.HasFlag(ControlTypes.ScaleMatrixXY))
{
Object3DControls.Add(new ScaleMatrixCornerControl(this, 0));
Object3DControls.Add(new ScaleMatrixCornerControl(this, 1));
Object3DControls.Add(new ScaleMatrixCornerControl(this, 2));
Object3DControls.Add(new ScaleMatrixCornerControl(this, 3));
for (int i = 0; i < 4; i++)
{
Object3DControls.Add(new ScaleMatrixCornerControl(this, i));
Object3DControls.Add(new ScaleMatrixEdgeControl(this, i));
}
}
Object3DControls.Add(new ScaleMatrixEdgeControl(this, 0));
Object3DControls.Add(new ScaleMatrixEdgeControl(this, 1));
Object3DControls.Add(new ScaleMatrixEdgeControl(this, 2));
Object3DControls.Add(new ScaleMatrixEdgeControl(this, 3));
if (controls.HasFlag(ControlTypes.ScaleWidthDepth))
{
for (int i = 0; i < 4; i++)
{
Object3DControls.Add(new ScaleWidthDepthCornerControl(this, i));
Object3DControls.Add(new ScaleWidthDepthEdgeControl(this, i));
}
}
if (controls.HasFlag(ControlTypes.Shadow))