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

        public void Stop()
        {
            _Element?.Remove();
            _PointAction.Stop();
            _SketchEditorTool.WorkspaceController.HudManager?.RemoveElement(_Coord2DHudElement);
            _Coord2DHudElement = null;
        }
Exemple #2
0
        //--------------------------------------------------------------------------------------------------

        public void Stop()
        {
            if (_PreviewLine != null)
            {
                _PreviewLine.Remove();
                _PreviewLine = null;
            }
            for (int i = 0; i < _HintLines.Length; i++)
            {
                if (_HintLines[i] != null)
                {
                    _HintLines[i].Remove();
                }
                _HintLines[i] = null;
            }
            _Element?.Remove();

            _PointAction.ConstraintPoint -= _PointActionOnConstraintPoint;

            _PointAction.Stop();

            _SketchEditorTool.WorkspaceController.HudManager?.RemoveElement(_Coord2DHudElement);
            _Coord2DHudElement = null;
            _SketchEditorTool.WorkspaceController.HudManager?.RemoveElement(_LabelHudElement);
            _LabelHudElement = null;
        }
        //--------------------------------------------------------------------------------------------------

        public void Stop()
        {
            if (_HintCircle != null)
            {
                _HintCircle.Remove();
                _HintCircle = null;
            }
            if (_HintLine != null)
            {
                _HintLine.Remove();
                _HintLine = null;
            }
            for (int i = 0; i < _Marker.Length; i++)
            {
                if (_Marker[i] != null)
                {
                    _Marker[i].Remove();
                }
                _Marker[i] = null;
            }

            _Element?.Remove();
            _PointAction?.Stop();

            _SketchEditorTool.WorkspaceController.HudManager?.RemoveElement(_Coord2DHudElement);
            _Coord2DHudElement = null;
            _SketchEditorTool.WorkspaceController.HudManager?.RemoveElement(_ValueHudElement);
            _ValueHudElement = null;
        }
Exemple #4
0
        //--------------------------------------------------------------------------------------------------

        void _OnActionPreview(ToolAction toolAction)
        {
            if (toolAction == _PointAction)
            {
                switch (_PointsCompleted)
                {
                case 1:
                    _HintLines[0] ??= new HintLine(_SketchEditorTool.WorkspaceController, HintStyle.ThinDashed | HintStyle.Topmost);
                    _HintLines[0].Set(_CenterPoint, _PointAction.Point, _SketchEditorTool.Sketch.Plane);
                    break;

                case 2:
                    _HintLines[1] ??= new HintLine(_SketchEditorTool.WorkspaceController, HintStyle.ThinDashed | HintStyle.Topmost);
                    _HintLines[1].Set(_CenterPoint, _PointAction.Point, _SketchEditorTool.Sketch.Plane);

                    if (_Segment != null)
                    {
                        if (_CalcArcRimPoints(_PointAction.Point))
                        {
                            _Element.OnPointsChanged(_Points, null);
                        }
                        else
                        {
                            _Element.Remove();
                        }
                    }
                    break;
                }

                _Coord2DHudElement?.SetValues(_PointAction.PointOnWorkingPlane.X, _PointAction.PointOnWorkingPlane.Y);
            }
        }
        //--------------------------------------------------------------------------------------------------

        void _OnActionPreview(ToolAction toolAction)
        {
            if (toolAction == _PointAction)
            {
                switch (_PointsCompleted)
                {
                case 1:
                    _PreviewLine ??= new HintCircle(_SketchEditorTool.WorkspaceController, HintStyle.ThinDashed | HintStyle.Topmost);
                    _HintLines[0] ??= new HintLine(_SketchEditorTool.WorkspaceController, HintStyle.ThinDashed | HintStyle.Topmost);
                    var circ = new gce_MakeCirc2d(_CenterPoint, _PointAction.Point).Value();
                    _PreviewLine.Set(circ, _SketchEditorTool.Sketch.Plane);
                    _HintLines[0].Set(_CenterPoint, _PointAction.Point, _SketchEditorTool.Sketch.Plane);

                    if (_ValueHudElement == null && _SketchEditorTool.WorkspaceController.HudManager != null)
                    {
                        _ValueHudElement               = _SketchEditorTool.WorkspaceController.HudManager?.CreateElement <ValueHudElement>(this);
                        _ValueHudElement.Label         = "Radius:";
                        _ValueHudElement.Units         = ValueUnits.Length;
                        _ValueHudElement.ValueEntered += _ValueHudElement_RadiusEntered;
                    }
                    _ValueHudElement?.SetValue(circ.Radius());
                    break;

                case 2:
                    _HintLines[1] ??= new HintLine(_SketchEditorTool.WorkspaceController, HintStyle.ThinDashed | HintStyle.Topmost);
                    _HintLines[1].Set(_CenterPoint, _PointAction.Point, _SketchEditorTool.Sketch.Plane);

                    if (_ValueHudElement == null && _SketchEditorTool.WorkspaceController.HudManager != null)
                    {
                        _ValueHudElement               = _SketchEditorTool.WorkspaceController.HudManager?.CreateElement <ValueHudElement>(this);
                        _ValueHudElement.Label         = "Angle:";
                        _ValueHudElement.Units         = ValueUnits.Degree;
                        _ValueHudElement.ValueEntered += _ValueHudElement_AngleEntered;
                    }

                    if (_Segment != null)
                    {
                        if (_CalcArcRimPoints(_PointAction.Point))
                        {
                            _Element.OnPointsChanged(_Points, null);
                            _ValueHudElement?.SetValue(_Segment.Angle(_Points).ToDeg());
                        }
                        else
                        {
                            _Element.Remove();
                            _ValueHudElement?.SetValue(0);
                        }
                    }
                    break;
                }

                _Coord2DHudElement?.SetValues(_PointAction.PointOnWorkingPlane.X, _PointAction.PointOnWorkingPlane.Y);
            }
        }
Exemple #6
0
        //--------------------------------------------------------------------------------------------------

        public void Stop()
        {
            for (int i = 0; i < _HintLines.Length; i++)
            {
                _HintLines[i]?.Remove();
                _HintLines[i] = null;
            }

            _Element?.Remove();
            _PointAction.Stop();
            _SketchEditorTool.WorkspaceController.HudManager?.RemoveElement(_Coord2DHudElement);
            _Coord2DHudElement = null;
        }