/// <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();
        }
Beispiel #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();
        }
Beispiel #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();
        }
        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();
        }
Beispiel #7
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();
        }
        public void Add(GeoPoint pnt, System.Drawing.Color color, int debugHint)
        {
            Point point = Point.Construct();

            point.Location = pnt;
            point.Symbol   = PointSymbol.Circle;
            ColorDef cd = new ColorDef(color.Name, color);

            point.ColorDef = cd;
            IntegerProperty ip = new IntegerProperty(debugHint, "Debug.Hint");

            point.UserData.Add("Debug", ip);
            toShow.Add(point);
        }
        public void Add(GeoPoint2D pnt, System.Drawing.Color color, string debugHint)
        {
            Point point = Point.Construct();

            point.Location = new GeoPoint(pnt);
            point.Symbol   = PointSymbol.Circle;
            ColorDef cd = new ColorDef(color.Name, color);

            point.ColorDef = cd;
            StringProperty sp = new StringProperty(debugHint, "Debug.Hint");

            point.UserData.Add("Debug", sp);
            toShow.Add(point);
        }
Beispiel #10
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();
        }
Beispiel #11
0
        protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
        {
            IDebugForm form = CF.DebugForm;
            Model      m    = form.Model;

            GeoPoint p   = (GeoPoint)objectProvider.GetObject();
            Point    pnt = Point.Construct();

            pnt.Location = p;
            pnt.Symbol   = PointSymbol.Cross;
            VisualizerHelper.AssertColor(pnt);
            m.Add(pnt);

            form.ShowDialog(windowService);
        }
Beispiel #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();
        }
Beispiel #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();
        }
        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();
        }
        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();
        }