//--------------------------------------------------------------------------------------------------

        void _FinishPivotPoint(ToolAction toolAction)
        {
            if (!(toolAction is PointAction pointAction))
            {
                return;
            }

            _Point = pointAction.Point.Round();
            pointAction.Stop();

            var axisValueAction = new AxisValueAction(this, new Ax1(_Point, Dir.DZ));

            if (!WorkspaceController.StartToolAction(axisValueAction))
            {
                return;
            }
            axisValueAction.Previewed += _PreviewRadius;
            axisValueAction.Finished  += _FinishRadius;

            _CurrentPhase = Phase.Radius;
            StatusText    = "Select Radius.";

            WorkspaceController.HudManager?.RemoveElement(_Coord2DHudElement);
            _ValueHudElement = WorkspaceController.HudManager?.CreateElement <ValueHudElement>(this);
            if (_ValueHudElement != null)
            {
                _ValueHudElement.Label         = "Radius:";
                _ValueHudElement.Units         = ValueUnits.Length;
                _ValueHudElement.ValueEntered += _ValueEntered;
            }

            WorkspaceController.HudManager?.SetCursor(Cursors.SetRadius);
        }
示例#2
0
        //--------------------------------------------------------------------------------------------------

        void _FinishBaseRect(ToolAction toolAction)
        {
            toolAction?.Stop();

            var axisPosition    = ElSLib.Value(_PointPlane2.X, _PointPlane2.Y, _Plane);
            var axisValueAction = new AxisValueAction(this, new Ax1(axisPosition, _Plane.Axis.Direction));

            axisValueAction.Previewed += _PreviewHeight;
            axisValueAction.Finished  += _FinishHeight;

            if (!WorkspaceController.StartToolAction(axisValueAction))
            {
                return;
            }

            WorkspaceController.HudManager?.RemoveElement(_Coord2DHudElement);
            _CurrentPhase = Phase.Height;
            StatusText    = "Select height.";

            WorkspaceController.HudManager?.RemoveElement(_MultiValueHudElement);
            _ValueHudElement = WorkspaceController.HudManager?.CreateElement <ValueHudElement>(this);
            if (_ValueHudElement != null)
            {
                _ValueHudElement.Label         = "Height:";
                _ValueHudElement.ValueEntered += _ValueEntered;
                _ValueHudElement.Units         = ValueUnits.Length;
            }

            WorkspaceController.HudManager?.SetCursor(Cursors.SetHeight);

            _PreviewHeight(axisValueAction);
        }
        //--------------------------------------------------------------------------------------------------

        void _FinishRadius(ToolAction toolAction)
        {
            toolAction?.Stop();
            var axisValueAction = new AxisValueAction(this, new Ax1(_PivotPoint.Round(), _Plane.Axis.Direction));

            if (!WorkspaceController.StartToolAction(axisValueAction))
            {
                return;
            }
            axisValueAction.Previewed += _PreviewHeight;
            axisValueAction.Finished  += _FinishHeight;

            _CurrentPhase = Phase.Height;
            StatusText    = "Select height.";

            if (_ValueHudElement != null)
            {
                _ValueHudElement.Label = "Height:";
                _ValueHudElement.Value = 0;
            }

            WorkspaceController.HudManager?.RemoveElement(_Coord2DHudElement);
            WorkspaceController.HudManager?.SetCursor(Cursors.SetHeight);

            _PreviewHeight(axisValueAction);
        }