/// <summary>
        /// Overrides <see cref="CADability.Actions.ConstructAction.OnSetAction ()"/>
        /// </summary>
        public override void OnSetAction()
        {
            base.TitleId = "Construct.IntersectPoint";

            gPoint = ActionFeedBack.FeedbackPoint(base.Frame);
            base.FeedBack.Add(gPoint);

            firstCurveInput                             = new CurveInput("Construct.IntersectPoint.FirstCurve");
            firstCurveInput.Decomposed                  = true; // nur Einzelelemente, auch bei Polyline und Pfad
            firstCurveInput.MouseOverCurvesEvent       += new CADability.Actions.ConstructAction.CurveInput.MouseOverCurvesDelegate(firstCurve);
            firstCurveInput.CurveSelectionChangedEvent += new CADability.Actions.ConstructAction.CurveInput.CurveSelectionChangedDelegate(firstCurveChanged);

            secondCurveInput                             = new CurveInput("Construct.IntersectPoint.SecondCurve");
            secondCurveInput.Decomposed                  = true; // nur Einzelelemente, auch bei Polyline und Pfad
            secondCurveInput.MouseOverCurvesEvent       += new CADability.Actions.ConstructAction.CurveInput.MouseOverCurvesDelegate(secondCurve);
            secondCurveInput.CurveSelectionChangedEvent += new CADability.Actions.ConstructAction.CurveInput.CurveSelectionChangedDelegate(secondCurveChanged);

            GeoPointInput measureText = new GeoPointInput("MeasurePoint");

            measureText.GetGeoPointEvent += new CADability.Actions.ConstructAction.GeoPointInput.GetGeoPointDelegate(GetMeasureText);
            // geht nur mit readOnly, da sonst die Mausbewegung den angezeigten Wert überschreibt
            measureText.ReadOnly = true;
            if (measure)
            {
                base.SetInput(firstCurveInput, secondCurveInput, measureText);
            }
            else
            {
                base.SetInput(firstCurveInput, secondCurveInput);
            }
            base.OnSetAction();
        }
Esempio n. 2
0
        public override void OnSetAction()
        {
            circle = Ellipse.Construct();
            circle.SetCirclePlaneCenterRadius(base.ActiveDrawingPlane, new GeoPoint(0.0, 0.0, 0.0), base.WorldViewSize / 20);
            base.ActiveObject = circle;
            base.TitleId      = "Constr.Circle.3Points";

            gPoint1 = ActionFeedBack.FeedbackPoint(base.Frame);
            gPoint2 = ActionFeedBack.FeedbackPoint(base.Frame);
            base.FeedBack.Add(gPoint1);
            base.FeedBack.Add(gPoint2);

            arcPoint1Input = new GeoPointInput("Constr.Circle.Point1");
            arcPoint1Input.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(CirclePoint1);
            arcPoint2Input = new GeoPointInput("Constr.Circle.Point2");
            arcPoint2Input.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(CirclePoint2);
            arcPoint3Input = new GeoPointInput("Constr.Circle.3Points.Point3");
            arcPoint3Input.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(CirclePoint3);
            GeoPointInput arcCenterInput = new GeoPointInput("Constr.Circle.Center");

            arcCenterInput.GetGeoPointEvent += new ConstructAction.GeoPointInput.GetGeoPointDelegate(CircleCenter);
            arcCenterInput.Optional          = true;
            arcCenterInput.ReadOnly          = true;
            LengthInput arcRadius = new LengthInput("Constr.Circle.Radius");

            arcRadius.GetLengthEvent += new ConstructAction.LengthInput.GetLengthDelegate(CircleRadius);
            arcRadius.Optional        = true;
            arcRadius.ReadOnly        = true;
            base.SetInput(arcPoint1Input, arcPoint2Input, arcPoint3Input, arcCenterInput, arcRadius);
            base.ShowAttributes = true;

            base.OnSetAction();
        }
Esempio n. 3
0
        public override void OnSetAction()
        {
            base.TitleId   = "Constr.Dimension.Direction.3Points";
            dim            = Dimension.Construct();
            dim.DimType    = Dimension.EDimType.DimAngle;
            dim.DimLineRef = ConstrDefaults.DefaultDimPoint;
            dim.Normal     = base.ActiveDrawingPlane.Normal;
            dim.AddPoint(new GeoPoint(0.0, 0.0, 0.0));
            dim.AddPoint(new GeoPoint(0.0, 0.0, 0.0));
            dim.AddPoint(new GeoPoint(0.0, 0.0, 0.0));

            gPoint1 = ActionFeedBack.FeedbackPoint(base.Frame);
            gPoint2 = ActionFeedBack.FeedbackPoint(base.Frame);
            gPoint3 = ActionFeedBack.FeedbackPoint(base.Frame);
            base.FeedBack.Add(gPoint1);
            base.FeedBack.Add(gPoint2);
            base.FeedBack.Add(gPoint3);

            base.ActiveObject = dim;

            dimPoint1Input = new GeoPointInput("Constr.Dimension.Direction.3Points.Point1");
            dimPoint1Input.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(SetDimPoint1);
            dimPoint2Input = new GeoPointInput("Constr.Dimension.Direction.3Points.Point2");
            dimPoint2Input.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(SetDimPoint2);
            dimPoint3Input = new GeoPointInput("Constr.Dimension.Direction.3Points.Point3");
            dimPoint3Input.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(SetDimPoint3);

            dimLocationInput = new GeoPointInput("Constr.Dimension.Location");
            dimLocationInput.DefaultGeoPoint   = ConstrDefaults.DefaultDimPoint;
            dimLocationInput.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(SetDimLocation);

            base.SetInput(dimPoint1Input, dimPoint2Input, dimPoint3Input, dimLocationInput);
            base.ShowAttributes = true;
            base.OnSetAction();
        }
        public override void OnSetAction()
        {
            circle = Ellipse.Construct();
            circle.SetCirclePlaneCenterRadius(base.ActiveDrawingPlane, ConstrDefaults.DefaultArcCenter, ConstrDefaults.DefaultArcRadius);

            gPoint1 = ActionFeedBack.FeedbackPoint(base.Frame);
            base.FeedBack.Add(gPoint1);

            base.ActiveObject = circle;
            base.TitleId      = "Constr.Circle.CenterPoint";

            circCenter = new GeoPointInput("Constr.Circle.Center");
            circCenter.DefaultGeoPoint   = ConstrDefaults.DefaultArcCenter;
            circCenter.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(Center);
            circPointInput = new GeoPointInput("Constr.Circle.CenterPoint.Point");
            circPointInput.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(CirclePoint);

            LengthInput len = new LengthInput("Constr.Circle.Radius");

            len.GetLengthEvent += new ConstructAction.LengthInput.GetLengthDelegate(CircleRadius);
            len.DefaultLength   = ConstrDefaults.DefaultArcRadius;
            len.Optional        = true;
            len.ReadOnly        = true;

            base.SetInput(circCenter, circPointInput, len);
            base.ShowAttributes = true;

            base.OnSetAction();
        }
Esempio n. 5
0
        public void InsertGeoPoint(int Index, GeoPoint ThePoint)
        {
            if (dim.PointCount >= 2)
            {   // nach dem 2.Punkt ist keine Änderung der Methode mehr möglich!
                dimMethod.ReadOnly = true;
                // Testen, ob eine Bemassung getroffen wurde
                GeoObjectList li = base.GetObjectsUnderCursor(base.CurrentMousePoint);
                if (Settings.GlobalSettings.GetBoolValue("Dimension.AutoExtend", true)) // eingeführt am 30.08.2016
                {
                    for (int i = 0; i < li.Count; ++i)
                    {
                        if (li[i] is Dimension)
                        { // die getroffene Bem. nutzen
                            Dimension dimTemp = (li[i] as Dimension);
                            // nur wenn die Typen stimmen!
                            if ((dimTemp.DimType == Dimension.EDimType.DimPoints) | (dimTemp.DimType == Dimension.EDimType.DimCoord))
                            {
                                int ind; // wo getroffen?
                                Dimension.HitPosition hi = dimTemp.GetHitPosition(base.Frame.ActiveView.Projection, base.ProjectedPoint(CurrentMousePoint), out ind);
                                if ((hi & Dimension.HitPosition.DimLine) != 0)
                                { // jetzt also: neuen Punkt einfügen, der kommt aus dim.
                                    dimTemp.AddPoint(dim.GetPoint(0));
                                    base.ActiveObject = null;
                                    base.OnDone();
                                    dimTemp.SortPoints();
                                    dimTemp.Recalc();
                                    return;
                                }
                            }
                        }
                    }
                }
            }
            if ((dim.PointCount == 2) & (methodSelect == 0))
            {   // ZweiPunktBemassung: Jetzt ist Schluss!
                mi.Fixed = true;
                if (!dimLocationInput.Fixed)
                {
                    CADability.GeoObject.Point gPoint1 = ActionFeedBack.FeedbackPoint(base.Frame, PointSymbol.Cross);
                    gPoint1.Location = ThePoint;
                    base.FeedBack.Add(gPoint1);
                    base.SetFocus(dimLocationInput, true);
                }
                else
                {
                    base.OnDone();
                }
                return;
            }
            dim.AddPoint(ThePoint);

            CADability.GeoObject.Point gPoint = ActionFeedBack.FeedbackPoint(base.Frame, PointSymbol.Cross);
            gPoint.Location = ThePoint;
            base.FeedBack.Add(gPoint);
        }
        public override void OnSetAction()
        {
            ellipse                = Ellipse.Construct();
            ellipse.Plane          = base.ActiveDrawingPlane;
            ellipse.Center         = ConstrDefaults.DefaultEllipseCenter;
            ellipse.MajorRadius    = ConstrDefaults.DefaultEllipseMajorRadius;
            ellipse.MinorRadius    = ConstrDefaults.DefaultEllipseMinorRadius;
            ellipse.StartParameter = 0;
            ellipse.SweepParameter = 2.0 * Math.PI;
            base.ActiveObject      = ellipse;
            base.TitleId           = "Constr.Ellipse.CenterRadius";

            gPoint1 = ActionFeedBack.FeedbackPoint(base.Frame);
            base.FeedBack.Add(gPoint1);

            GeoPointInput elliCenter = new GeoPointInput("Constr.Ellipse.CenterRadius.Center");

            elliCenter.DefaultGeoPoint   = ConstrDefaults.DefaultEllipseCenter;
            elliCenter.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(Center);

            elliPointInput = new GeoPointInput("Constr.Ellipse.CenterRadius.Point");
            elliPointInput.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(Point1);

            GeoPointInput elliPoint2 = new GeoPointInput("Constr.Ellipse.CenterRadius.Point2");

            elliPoint2.SetGeoPointEvent   += new ConstructAction.GeoPointInput.SetGeoPointDelegate(Point2);
            elliPoint2.ForwardMouseInputTo = elliCenter;

            LengthInput elliMaxRad = new LengthInput("Constr.Ellipse.CenterRadius.MajorRadius");

            elliMaxRad.SetLengthEvent     += new CADability.Actions.ConstructAction.LengthInput.SetLengthDelegate(SetMajorRadius);
            elliMaxRad.GetLengthEvent     += new ConstructAction.LengthInput.GetLengthDelegate(GetMajorRadius);
            elliMaxRad.DefaultLength       = ConstrDefaults.DefaultEllipseMajorRadius;
            elliMaxRad.Optional            = true;
            elliMaxRad.ForwardMouseInputTo = elliCenter;

            elliMinRad = new LengthInput("Constr.Ellipse.CenterRadius.MinorRadius");
            elliMinRad.DefaultLength       = ConstrDefaults.DefaultEllipseMinorRadius;
            elliMinRad.SetLengthEvent     += new ConstructAction.LengthInput.SetLengthDelegate(MinorRadius);
            elliMinRad.GetLengthEvent     += new ConstructAction.LengthInput.GetLengthDelegate(GetMinorRadius);
            elliMinRad.ForwardMouseInputTo = elliCenter;
            elliMinRad.Optional            = true;

            GeoVectorInput elliDir = new GeoVectorInput("Constr.Ellipse.CenterRadius.Angle");

            elliDir.SetGeoVectorEvent += new CADability.Actions.ConstructAction.GeoVectorInput.SetGeoVectorDelegate(ElliDir);
            elliDir.GetGeoVectorEvent += new CADability.Actions.ConstructAction.GeoVectorInput.GetGeoVectorDelegate(GetElliDir);
            elliDir.Optional           = true;
            elliDir.IsAngle            = true;


            base.SetInput(elliCenter, elliPointInput, elliPoint2, elliMaxRad, elliMinRad);
            base.ShowAttributes = true;
            base.OnSetAction();
        }
Esempio n. 7
0
        public override void OnSetAction()
        {
            ellipse  = Ellipse.Construct();
            dir      = ConstrDefaults.DefaultArcDirection;
            point1   = ConstrDefaults.DefaultEllipseCenter;
            point2   = point1;
            point2.x = point1.x + ConstrDefaults.DefaultEllipseMajorRadius;
            point2.y = point1.y + ConstrDefaults.DefaultEllipseMinorRadius;
            vector1  = base.ActiveDrawingPlane.DirectionY;
            vector2  = base.ActiveDrawingPlane.DirectionX;
            showEllipse();


            base.ActiveObject = ellipse;
            base.TitleId      = "Constr.Ellipsearc.2PointsDirections";

            gPoint1 = ActionFeedBack.FeedbackPoint(base.Frame);
            base.FeedBack.Add(gPoint1);
            gPoint2 = ActionFeedBack.FeedbackPoint(base.Frame);
            base.FeedBack.Add(gPoint2);
            feedBackLine = Line.Construct();
            Color backColor = base.Frame.GetColorSetting("Colors.Feedback", Color.DarkGray);

            feedBackLine.ColorDef = new ColorDef("", backColor);
            base.FeedBack.Add(feedBackLine);

            GeoPointInput elliPoint1 = new GeoPointInput("Constr.Ellipse.2PointsDirections.Point1");

            elliPoint1.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(SetPoint1);

            GeoVectorInput elliDir1 = new GeoVectorInput("Constr.Ellipse.2PointsDirections.Direction1");

            elliDir1.SetGeoVectorEvent += new CADability.Actions.ConstructAction.GeoVectorInput.SetGeoVectorDelegate(SetElliDir1);
            elliDir1.GetGeoVectorEvent += new CADability.Actions.ConstructAction.GeoVectorInput.GetGeoVectorDelegate(GetElliDir1);

            GeoPointInput elliPoint2 = new GeoPointInput("Constr.Ellipse.2PointsDirections.Point2");

            elliPoint2.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(SetPoint2);

            GeoVectorInput elliDir2 = new GeoVectorInput("Constr.Ellipse.2PointsDirections.Direction2");

            elliDir2.SetGeoVectorEvent += new CADability.Actions.ConstructAction.GeoVectorInput.SetGeoVectorDelegate(SetElliDir2);
            elliDir2.GetGeoVectorEvent += new CADability.Actions.ConstructAction.GeoVectorInput.GetGeoVectorDelegate(GetElliDir2);

            BooleanInput dirInput = new BooleanInput("Constr.Arc.Direction", "Constr.Arc.Direction.Values");

            dirInput.DefaultBoolean   = ConstrDefaults.DefaultArcDirection;
            dirInput.SetBooleanEvent += new CADability.Actions.ConstructAction.BooleanInput.SetBooleanDelegate(SetDirection);
            dirInput.GetBooleanEvent += new BooleanInput.GetBooleanDelegate(GetDirection);

            base.SetInput(elliPoint1, elliDir1, elliPoint2, elliDir2, dirInput);
            base.ShowAttributes = true;
            base.OnSetAction();
        }
Esempio n. 8
0
        /// <summary>
        /// Overrides <see cref="CADability.Actions.ConstructAction.OnSetAction ()"/>
        /// </summary>
        public override void OnSetAction()
        {
            base.TitleId = "Construct.MidPoint";

            // da oben static private, werden diese Variablen gemerkt. Beim ersten Mal vorbesetzen:
            if (ratio == 0)
            {
                ratio = 0.5;
            }

            gPoint = ActionFeedBack.FeedbackPoint(base.Frame);
            base.FeedBack.Add(gPoint);

            feedBackLine = Line.Construct();
            Color backColor = base.Frame.GetColorSetting("Colors.Feedback", Color.DarkGray);

            feedBackLine.ColorDef = new ColorDef("", backColor);
            base.FeedBack.Add(feedBackLine);

            firstPointInput = new GeoPointInput("Construct.MidPoint.FirstPoint");
            firstPointInput.DefinesBasePoint  = true;
            firstPointInput.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(OnSetFirstPoint);

            secondPointInput = new GeoPointInput("Construct.MidPoint.SecondPoint");
            secondPointInput.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(OnSetSecondPoint);

            ratioInput = new DoubleInput("Construct.MidPoint.Ratio");
            ratioInput.SetDoubleEvent     += new CADability.Actions.ConstructAction.DoubleInput.SetDoubleDelegate(OnSetRatio);
            ratioInput.Fixed               = true; // muss nicht eingegeben werden
            ratioInput.GetDoubleEvent     += new CADability.Actions.ConstructAction.DoubleInput.GetDoubleDelegate(OnGetRatio);
            ratioInput.ForwardMouseInputTo = new object[] { firstPointInput, secondPointInput };
            //			ratio = 0.5; // immer Standardwert

            firstPointIsValid  = false;
            secondPointIsValid = false;

            GeoPointInput measureText = new GeoPointInput("MeasurePoint");

            measureText.GetGeoPointEvent += new CADability.Actions.ConstructAction.GeoPointInput.GetGeoPointDelegate(GetMeasureText);
            // geht nur mit readOnly, da sonst die Mausbewegung den angezeigten Wert überschreibt
            measureText.ReadOnly = true;

            if (measure)
            {
                base.SetInput(firstPointInput, secondPointInput, ratioInput, measureText);
            }
            else
            {
                base.SetInput(firstPointInput, secondPointInput, ratioInput);
            }

            base.OnSetAction();
        }
Esempio n. 9
0
        public override void OnSetAction()
        {
            ellipse                = Ellipse.Construct();
            ellipse.Plane          = base.ActiveDrawingPlane;
            ellipse.Center         = ConstrDefaults.DefaultEllipseCenter;
            ellipse.MajorRadius    = ConstrDefaults.DefaultEllipseMajorRadius;
            ellipse.MinorRadius    = ConstrDefaults.DefaultEllipseMinorRadius;
            ellipse.StartParameter = 0;
            ellipse.SweepParameter = 2.0 * Math.PI;
            point1   = ConstrDefaults.DefaultEllipseCenter;
            point2   = point1;
            point2.x = point1.x + ConstrDefaults.DefaultEllipseMajorRadius;
            vector1  = base.ActiveDrawingPlane.DirectionX;
            vector2  = base.ActiveDrawingPlane.DirectionY;
            //           direction2 = direction1;


            base.ActiveObject = ellipse;
            base.TitleId      = "Constr.Ellipse.2PointsDirections";

            gPoint1 = ActionFeedBack.FeedbackPoint(base.Frame);
            gPoint2 = ActionFeedBack.FeedbackPoint(base.Frame);
            base.FeedBack.Add(gPoint1);
            base.FeedBack.Add(gPoint2);
            feedBackLine = Line.Construct();
            Color backColor = base.Frame.GetColorSetting("Colors.Feedback", Color.DarkGray);

            feedBackLine.ColorDef = new ColorDef("", backColor);
            base.FeedBack.Add(feedBackLine);

            GeoPointInput elliPoint1 = new GeoPointInput("Constr.Ellipse.2PointsDirections.Point1");

            elliPoint1.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(SetPoint1);

            GeoVectorInput elliDir1 = new GeoVectorInput("Constr.Ellipse.2PointsDirections.Direction1");

            elliDir1.SetGeoVectorEvent += new CADability.Actions.ConstructAction.GeoVectorInput.SetGeoVectorDelegate(SetElliDir1);
            elliDir1.GetGeoVectorEvent += new CADability.Actions.ConstructAction.GeoVectorInput.GetGeoVectorDelegate(GetElliDir1);

            GeoPointInput elliPoint2 = new GeoPointInput("Constr.Ellipse.2PointsDirections.Point2");

            elliPoint2.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(SetPoint2);

            GeoVectorInput elliDir2 = new GeoVectorInput("Constr.Ellipse.2PointsDirections.Direction2");

            elliDir2.SetGeoVectorEvent += new CADability.Actions.ConstructAction.GeoVectorInput.SetGeoVectorDelegate(SetElliDir2);
            elliDir2.GetGeoVectorEvent += new CADability.Actions.ConstructAction.GeoVectorInput.GetGeoVectorDelegate(GetElliDir2);

            base.SetInput(elliPoint1, elliDir1, elliPoint2, elliDir2);
            base.ShowAttributes = true;
            base.OnSetAction();
        }
Esempio n. 10
0
        public override void OnSetAction()
        {
            Boolean useRadius = Frame.GetBooleanSetting("Formatting.Radius", true);

            circle = Ellipse.Construct();
            circle.SetCirclePlaneCenterRadius(base.ActiveDrawingPlane, ConstrDefaults.DefaultArcCenter, ConstrDefaults.DefaultArcRadius);
            gPoint1 = ActionFeedBack.FeedbackPoint(base.Frame);
            base.FeedBack.Add(gPoint1);

            base.ActiveObject = circle;
            base.TitleId      = "Constr.Circle.CenterRadius";

            circCenter = new GeoPointInput("Constr.Circle.Center");
            circCenter.DefaultGeoPoint   = ConstrDefaults.DefaultArcCenter;
            circCenter.DefinesBasePoint  = true;
            circCenter.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(Center);

            rad = new LengthInput("Constr.Circle.Radius");
            rad.SetLengthEvent += new ConstructAction.LengthInput.SetLengthDelegate(SetCircleRadius);
            rad.GetLengthEvent += new ConstructAction.LengthInput.GetLengthDelegate(GetCircleRadius);
            if (!useRadius)
            {
                rad.Optional = true;
            }
            rad.DefaultLength       = ConstrDefaults.DefaultArcRadius;
            rad.ForwardMouseInputTo = circCenter;

            diam = new LengthInput("Constr.Circle.Diameter");
            diam.SetLengthEvent       += new ConstructAction.LengthInput.SetLengthDelegate(SetCircleDiameter);
            diam.GetLengthEvent       += new ConstructAction.LengthInput.GetLengthDelegate(GetCircleDiameter);
            diam.CalculateLengthEvent += new LengthInput.CalculateLengthDelegate(CalculateDiameter);
            if (useRadius)
            {
                diam.Optional = true;
            }
            diam.DefaultLength       = ConstrDefaults.DefaultArcDiameter;
            diam.ForwardMouseInputTo = circCenter;


            if (useRadius)
            {
                base.SetInput(circCenter, rad, diam);
            }
            else
            {
                base.SetInput(circCenter, diam, rad);
            }
            base.ShowAttributes = true;

            base.OnSetAction();
        }
Esempio n. 11
0
        /// <summary>
        /// Overrides <see cref="CADability.Actions.ConstructAction.OnSetAction ()"/>
        /// </summary>
        public override void OnSetAction()
        {
            base.TitleId = "Construct.ObjectPoint";
            // da oben static private, werden diese Variablen gemerkt. Beim ersten Mal vorbesetzen:
            if (ratio == 0)
            {
                ratio = 0.5;
            }
            if (ratioDist == 0)
            {
                ratioDist = 1;
            }

            gPoint = ActionFeedBack.FeedbackPoint(base.Frame);
            base.FeedBack.Add(gPoint);

            ratioCurveInput                             = new CurveInput("Construct.ObjectPoint.Curve");
            ratioCurveInput.Decomposed                  = true; // nur Einzelelemente, auch bei Polyline und Pfad
            ratioCurveInput.MouseOverCurvesEvent       += new CADability.Actions.ConstructAction.CurveInput.MouseOverCurvesDelegate(ratioCurve);
            ratioCurveInput.CurveSelectionChangedEvent += new CADability.Actions.ConstructAction.CurveInput.CurveSelectionChangedDelegate(ratioCurveChanged);

            ratioInput = new DoubleInput("Construct.ObjectPoint.Ratio");
            ratioInput.SetDoubleEvent     += new CADability.Actions.ConstructAction.DoubleInput.SetDoubleDelegate(OnSetRatio);
            ratioInput.Fixed               = true; // muss nicht eingegeben werden
            ratioInput.GetDoubleEvent     += new CADability.Actions.ConstructAction.DoubleInput.GetDoubleDelegate(OnGetRatio);
            ratioInput.ForwardMouseInputTo = ratioCurveInput;
            //			ratio = 0.5; // immer Standardwert

            ratioLength = new LengthInput("Construct.ObjectPoint.RatioLength");
            ratioLength.SetLengthEvent     += new LengthInput.SetLengthDelegate(OnSetRatioLength);
            ratioLength.GetLengthEvent     += new LengthInput.GetLengthDelegate(OnGetRatioLength);
            ratioLength.Fixed               = true; // muss nicht eingegeben werden
            ratioLength.ForwardMouseInputTo = ratioCurveInput;

            GeoPointInput measureText = new GeoPointInput("MeasurePoint");

            measureText.GetGeoPointEvent += new CADability.Actions.ConstructAction.GeoPointInput.GetGeoPointDelegate(GetMeasureText);
            // geht nur mit readOnly, da sonst die Mausbewegung den angezeigten Wert überschreibt
            measureText.ReadOnly = true;
            if (measure)
            {
                base.SetInput(ratioCurveInput, ratioInput, ratioLength, measureText);
            }
            else
            {
                base.SetInput(ratioCurveInput, ratioInput, ratioLength);
            }
            base.OnSetAction();
        }
Esempio n. 12
0
        public override void OnSetAction()
        {
            if (defaultText == null)
            {
                text                = Text.Construct();
                text.TextString     = StringTable.GetString("Text.Default");
                text.LineDirection  = base.ActiveDrawingPlane.DirectionX;
                text.GlyphDirection = base.ActiveDrawingPlane.DirectionY;
                text.TextSize       = ConstrDefaults.DefaultTextSize;
                text.Font           = "Arial";
            }
            else
            {
                text = defaultText.Clone() as Text;
            }
            text.LineAlignment = Text.LineAlignMode.Center;
            text.Location      = ConstrDefaults.DefaultStartPoint;
            Plane pl = new Plane(text.Location, text.LineDirection, text.GlyphDirection);

            textDir2D = pl.Project(text.GlyphDirection);
            textLen   = text.LineDirection.Length;

            base.ActiveObject = text;

            gPoint = ActionFeedBack.FeedbackPoint(base.Frame);
            base.FeedBack.Add(gPoint);

            base.TitleId = "Constr.Text.2Points";

            startPointInput = new GeoPointInput("Text.StartPoint");
            startPointInput.DefaultGeoPoint   = ConstrDefaults.DefaultStartPoint;
            startPointInput.DefinesBasePoint  = true;
            startPointInput.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(StartPoint);

            secondPointInput = new GeoPointInput("Text.SecondPoint");
            secondPointInput.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(SecondPoint);

            EditInput editInput = new EditInput(text);

            base.SetInput(startPointInput, secondPointInput, editInput);
            base.ShowAttributes = true;

            base.OnSetAction();
        }
Esempio n. 13
0
        public override void OnSetAction()
        {
            arc = Ellipse.Construct();
            arc.SetArcPlaneCenterRadiusAngles(base.ActiveDrawingPlane, new GeoPoint(0.0, 0.0, 0.0), base.WorldViewSize / 20, 0.0, 1.5 * Math.PI);
            base.ActiveObject = arc;
            base.TitleId      = "Constr.Arc.3Points";

            gPoint1 = ActionFeedBack.FeedbackPoint(base.Frame);
            gPoint2 = ActionFeedBack.FeedbackPoint(base.Frame);
            base.FeedBack.Add(gPoint1);
            base.FeedBack.Add(gPoint2);

            arcPoint1Input = new GeoPointInput("Constr.Arc.Point1");
            arcPoint1Input.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(ArcPoint1);
            arcPoint2Input = new GeoPointInput("Constr.Arc.Point2");
            arcPoint2Input.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(ArcPoint2);
            arcPoint3Input = new GeoPointInput("Constr.Arc.3Points.Point3");
            arcPoint3Input.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(ArcPoint3);

            GeoPointInput arcCenter = new GeoPointInput("Constr.Arc.Center");

            arcCenter.GetGeoPointEvent += new CADability.Actions.ConstructAction.GeoPointInput.GetGeoPointDelegate(ArcCenter);
            arcCenter.Optional          = true;
            arcCenter.ReadOnly          = true;

            LengthInput len = new LengthInput("Constr.Arc.Radius");

            len.GetLengthEvent += new ConstructAction.LengthInput.GetLengthDelegate(ArcRadius);
            len.Optional        = true;
            len.ReadOnly        = true;

            base.SetInput(arcPoint1Input, arcPoint2Input, arcPoint3Input, arcCenter, len);
            base.ShowAttributes = true;

            base.OnSetAction();
        }
Esempio n. 14
0
        public override void OnSetAction()
        {
            Boolean useRadius = Frame.GetBooleanSetting("Formatting.Radius", true);

            arc = Ellipse.Construct();
            double dir;

            if (ConstrDefaults.DefaultArcDirection)
            {
                dir = 1.5 * Math.PI;
            }
            else
            {
                dir = -1.5 * Math.PI;
            }
            arc.SetArcPlaneCenterRadiusAngles(base.ActiveDrawingPlane, ConstrDefaults.DefaultStartPoint, ConstrDefaults.DefaultArcRadius, 0.0, dir);

            base.ActiveObject = arc;
            base.TitleId      = "Constr.Arc.CenterRadius";

            gPoint1 = ActionFeedBack.FeedbackPoint(base.Frame);
            base.FeedBack.Add(gPoint1);

            centerInput = new GeoPointInput("Constr.Arc.Center");
            centerInput.DefaultGeoPoint   = ConstrDefaults.DefaultArcCenter;
            centerInput.DefinesBasePoint  = true;
            centerInput.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(Center);

            radInput = new LengthInput("Constr.Arc.Radius");
            radInput.SetLengthEvent += new ConstructAction.LengthInput.SetLengthDelegate(SetArcRadius);
            radInput.GetLengthEvent += new ConstructAction.LengthInput.GetLengthDelegate(GetArcRadius);
            if (!useRadius)
            {
                radInput.Optional = true;
            }
            radInput.DefaultLength       = ConstrDefaults.DefaultArcRadius;
            radInput.ForwardMouseInputTo = centerInput;

            diamInput = new LengthInput("Constr.Arc.Diameter");
            diamInput.SetLengthEvent       += new ConstructAction.LengthInput.SetLengthDelegate(SetArcDiameter);
            diamInput.GetLengthEvent       += new ConstructAction.LengthInput.GetLengthDelegate(GetArcDiameter);
            diamInput.CalculateLengthEvent += new LengthInput.CalculateLengthDelegate(CalculateDiameter);
            if (useRadius)
            {
                diamInput.Optional = true;
            }
            diamInput.DefaultLength       = ConstrDefaults.DefaultArcDiameter;
            diamInput.ForwardMouseInputTo = centerInput;


            startDirInput = new GeoVectorInput("Constr.Arc.CenterRadius.StartAngle");
            startDirInput.SetGeoVectorEvent += new CADability.Actions.ConstructAction.GeoVectorInput.SetGeoVectorDelegate(StartDir);
            startDirInput.IsAngle            = true;

            GeoVectorInput endDirInput = new GeoVectorInput("Constr.Arc.CenterRadius.EndAngle");

            endDirInput.GetGeoVectorEvent += new CADability.Actions.ConstructAction.GeoVectorInput.GetGeoVectorDelegate(GetEndDir);
            endDirInput.SetGeoVectorEvent += new CADability.Actions.ConstructAction.GeoVectorInput.SetGeoVectorDelegate(EndDir);
            endDirInput.IsAngle            = true;

            BooleanInput dirInput = new BooleanInput("Constr.Arc.Direction", "Constr.Arc.Direction.Values");

            dirInput.DefaultBoolean   = ConstrDefaults.DefaultArcDirection;
            dirInput.SetBooleanEvent += new CADability.Actions.ConstructAction.BooleanInput.SetBooleanDelegate(SetDirection);
            if (useRadius)
            {
                base.SetInput(centerInput, radInput, diamInput, startDirInput, endDirInput, dirInput);
            }
            else
            {
                base.SetInput(centerInput, diamInput, radInput, startDirInput, endDirInput, dirInput);
            }


            base.ShowAttributes = true;
            base.OnSetAction();
        }
        public override void OnSetAction()
        {
            ellipse        = Ellipse.Construct();
            ellipse.Plane  = base.ActiveDrawingPlane;
            ellipse.Center = ConstrDefaults.DefaultEllipseCenter;
            //            elliCenter = ellipse.Center;
            ellipse.MajorRadius = ConstrDefaults.DefaultEllipseMajorRadius;
            //            elliPoint1 = elliCenter + ellipse.MajorRadius * base.ActiveDrawingPlane.DirectionX;
            ellipse.MinorRadius = ConstrDefaults.DefaultEllipseMinorRadius;
            //            elliPoint2 = elliCenter + ellipse.MinorRadius * base.ActiveDrawingPlane.DirectionY;
            ellipse.StartParameter = 0.0;
            if (ConstrDefaults.DefaultArcDirection)
            {
                ellipse.SweepParameter = 1.5 * Math.PI;
            }
            else
            {
                ellipse.SweepParameter = -1.5 * Math.PI;
            }
            base.ActiveObject = ellipse;
            base.TitleId      = "Constr.EllipseArc.CenterRadius";

            gPoint1 = ActionFeedBack.FeedbackPoint(base.Frame);
            base.FeedBack.Add(gPoint1);

            GeoPointInput elliCenter = new GeoPointInput("Constr.Ellipse.CenterRadius.Center");

            elliCenter.DefaultGeoPoint   = ConstrDefaults.DefaultEllipseCenter;
            elliCenter.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(Center);

            GeoPointInput elliPointInput = new GeoPointInput("Constr.Ellipse.CenterRadius.Point");

            elliPointInput.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(Point1);

            GeoPointInput elliPoint2 = new GeoPointInput("Constr.Ellipse.CenterRadius.Point2");

            //			elliMinRad.DefaultLength = ConstrDefaults.DefaultEllipseMinorRadius;
            elliPoint2.SetGeoPointEvent   += new ConstructAction.GeoPointInput.SetGeoPointDelegate(Point2);
            elliPoint2.ForwardMouseInputTo = elliCenter;

            LengthInput elliMaxRad = new LengthInput("Constr.Ellipse.CenterRadius.MajorRadius");

            elliMaxRad.SetLengthEvent     += new CADability.Actions.ConstructAction.LengthInput.SetLengthDelegate(SetMajorRadius);
            elliMaxRad.GetLengthEvent     += new ConstructAction.LengthInput.GetLengthDelegate(GetMajorRadius);
            elliMaxRad.DefaultLength       = ConstrDefaults.DefaultEllipseMajorRadius;
            elliMaxRad.ForwardMouseInputTo = elliCenter;
            elliMaxRad.Optional            = true;

            elliMinRad = new LengthInput("Constr.Ellipse.CenterRadius.MinorRadius");
            elliMinRad.DefaultLength       = ConstrDefaults.DefaultEllipseMinorRadius;
            elliMinRad.SetLengthEvent     += new ConstructAction.LengthInput.SetLengthDelegate(MinorRadius);
            elliMinRad.GetLengthEvent     += new ConstructAction.LengthInput.GetLengthDelegate(GetMinorRadius);
            elliMinRad.ForwardMouseInputTo = elliCenter;
            elliMinRad.Optional            = true;

            GeoVectorInput elliDir = new GeoVectorInput("Constr.Ellipse.CenterRadius.Angle");

            elliDir.SetGeoVectorEvent += new CADability.Actions.ConstructAction.GeoVectorInput.SetGeoVectorDelegate(ElliDir);
            elliDir.GetGeoVectorEvent += new CADability.Actions.ConstructAction.GeoVectorInput.GetGeoVectorDelegate(GetElliDir);
            elliDir.Optional           = true;
            elliDir.IsAngle            = true;


            GeoVectorInput startDir = new GeoVectorInput("Constr.EllipseArc.StartAngle");

            startDir.SetGeoVectorEvent += new CADability.Actions.ConstructAction.GeoVectorInput.SetGeoVectorDelegate(StartDir);
            startDir.IsAngle            = true;

            GeoVectorInput endDir = new GeoVectorInput("Constr.EllipseArc.EndAngle");

            endDir.SetGeoVectorEvent += new CADability.Actions.ConstructAction.GeoVectorInput.SetGeoVectorDelegate(EndDir);
            endDir.GetGeoVectorEvent += new CADability.Actions.ConstructAction.GeoVectorInput.GetGeoVectorDelegate(GetEndDir);
            endDir.IsAngle            = true;

            BooleanInput dirInput = new BooleanInput("Constr.Arc.Direction", "Constr.Arc.Direction.Values");

            dirInput.DefaultBoolean   = ConstrDefaults.DefaultArcDirection;
            dirInput.SetBooleanEvent += new CADability.Actions.ConstructAction.BooleanInput.SetBooleanDelegate(SetDirection);

            base.SetInput(elliCenter, elliPointInput, elliPoint2, startDir, endDir, elliMaxRad, elliMinRad, dirInput);
            base.ShowAttributes = true;
            base.OnSetAction();
        }
Esempio n. 16
0
        public override void OnSetAction()
        {
            arc       = Ellipse.Construct();
            arcCenter = new GeoPoint(0.0, 0.0, 0.0);
            arcRad    = base.WorldViewSize / 20;
            startAng  = 0.0;
            arcDir    = ConstrDefaults.DefaultArcDirection;
            if (arcDir)
            {
                endAng = 1.5 * Math.PI;
            }
            else
            {
                endAng = -1.5 * Math.PI;
            }


            arcPlane = base.ActiveDrawingPlane;

            arc.SetArcPlaneCenterRadiusAngles(arcPlane, arcCenter, arcRad, startAng, endAng);

            gPoint1 = ActionFeedBack.FeedbackPoint(base.Frame);
            base.FeedBack.Add(gPoint1);

            base.ActiveObject = arc;
            base.TitleId      = "Constr.Arc.CenterStartEnd";

            arcCenterInput = new GeoPointInput("Constr.Arc.Center");
            arcCenterInput.DefaultGeoPoint   = ConstrDefaults.DefaultArcCenter;
            arcCenterInput.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(Center);
            arcStartPointInput = new GeoPointInput("Constr.Arc.StartPoint");
            arcStartPointInput.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(StartPoint);
            arcEndPointInput = new GeoPointInput("Constr.Arc.EndPoint");
            arcEndPointInput.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(EndPoint);
            BooleanInput dirInput = new BooleanInput("Constr.Arc.Direction", "Constr.Arc.Direction.Values");

            dirInput.DefaultBoolean   = ConstrDefaults.DefaultArcDirection;
            dirInput.SetBooleanEvent += new CADability.Actions.ConstructAction.BooleanInput.SetBooleanDelegate(SetDirection);

            LengthInput arcRadius = new LengthInput("Constr.Arc.Radius");

            arcRadius.GetLengthEvent += new ConstructAction.LengthInput.GetLengthDelegate(ArcRadius);
            arcRadius.Optional        = true;
            arcRadius.ReadOnly        = true;

            /*
             *          GeoVectorInput startDir = new GeoVectorInput("Constr.Arc.CenterRadius.StartAngle");
             *          startDir.Optional = true;
             *          startDir.ReadOnly = true;
             *          startDir.OnGetGeoVector +=new Condor.Actions.ConstructAction.GeoVectorInput.GetGeoVector(StartDir);
             *
             *          GeoVectorInput endDir = new GeoVectorInput("Constr.Arc.CenterRadius.EndAngle");
             *          endDir.Optional = true;
             *          endDir.ReadOnly = true;
             *          endDir.OnGetGeoVector +=new Condor.Actions.ConstructAction.GeoVectorInput.GetGeoVector(EndDir);
             *          base.SetInput(arcCenterInput,arcStartPointInput,arcEndPointInput,dirInput,arcRadius,startDir,endDir);
             */
            base.SetInput(arcCenterInput, arcStartPointInput, arcEndPointInput, dirInput, arcRadius);
            base.ShowAttributes = true;


            base.OnSetAction();
        }