Пример #1
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);
        }
Пример #3
0
        //--------------------------------------------------------------------------------------------------

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

            var body = Body.Create(_PreviewShape);

            body.Position = _Position;
            body.Rotation = _Rotation;
            InteractiveContext.Current.Document.AddChild(body);
            InteractiveContext.Current.UndoHandler.Commit();

            ((Tool)this).Stop();
            InteractiveContext.Current.WorkspaceController.Selection.SelectEntity(body);
            WorkspaceController.Invalidate();
        }
        //--------------------------------------------------------------------------------------------------

        void _FinishRadius(ToolAction toolAction)
        {
            _ClearPreviews();

            toolAction?.Stop();

            var body = Body.Create(_PreviewShape);

            body.Position = _Point;
            InteractiveContext.Current.Document.AddChild(body);
            InteractiveContext.Current.UndoHandler.Commit();

            ((Tool)this).Stop();

            InteractiveContext.Current.WorkspaceController.Selection.SelectEntity(body);
        }
Пример #5
0
        //--------------------------------------------------------------------------------------------------

        void _FinishHeight(ToolAction toolAction)
        {
            _ClearPreviews();

            toolAction?.Stop();

            var body = Body.Create(_PreviewShape);

            body.Position = _Position;
            body.Rotation = _Rotation;

            InteractiveContext.Current.Document.Add(body);
            InteractiveContext.Current.UndoHandler.Commit();

            Stop();

            InteractiveContext.Current.WorkspaceController.Selection.SelectEntity(body);
        }