public override void OnSetAction()
        {
            line = Polyline.Construct();
            line.SetRectangle(ConstrDefaults.DefaultStartPoint, new GeoVector(ConstrDefaults.DefaultRectWidth, 0.0, 0.0), new GeoVector(0.0, ConstrDefaults.DefaultRectHeight, 0.0));
            base.BasePoint    = ConstrDefaults.DefaultStartPoint;
            base.ActiveObject = line;
            base.TitleId      = "Constr.Rect.PointWidthHeightAngle";

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

            width = new LengthInput("Rect.Width");
            width.DefaultLength         = ConstrDefaults.DefaultRectWidth;
            width.SetLengthEvent       += new ConstructAction.LengthInput.SetLengthDelegate(Width);
            width.CalculateLengthEvent += new CADability.Actions.ConstructAction.LengthInput.CalculateLengthDelegate(WidthCalculate);
            width.ForwardMouseInputTo   = startPointInput;

            height = new LengthInput("Rect.Height");
            height.DefaultLength         = ConstrDefaults.DefaultRectHeight;
            height.SetLengthEvent       += new ConstructAction.LengthInput.SetLengthDelegate(Height);
            height.CalculateLengthEvent += new CADability.Actions.ConstructAction.LengthInput.CalculateLengthDelegate(HeightCalculate);
            height.ForwardMouseInputTo   = startPointInput;

            ang                     = new GeoVectorInput("Rect.Angle");
            ang.IsAngle             = true;
            ang.SetGeoVectorEvent  += new CADability.Actions.ConstructAction.GeoVectorInput.SetGeoVectorDelegate(RectAngle);
            ang.ForwardMouseInputTo = startPointInput;
            base.SetInput(startPointInput, width, height, ang);
            base.ShowAttributes = true;
            base.OnSetAction();
        }
Exemple #2
0
        /// <summary>
        /// Overrides <see cref="CADability.Actions.ConstructAction.OnSetAction ()"/>
        /// </summary>
        public override void OnSetAction()
        {
            plane            = base.ActiveDrawingPlane;
            feedBackPolyLine = Polyline.Construct();
            Rectangle rect = Frame.ActiveView.DisplayRectangle;

            width         = Frame.ActiveView.Projection.DeviceToWorldFactor * rect.Width / 2.0;
            height        = Frame.ActiveView.Projection.DeviceToWorldFactor * rect.Height / 2.0;
            feedBackplane = new FeedBackPlane(plane, width, height);
            RecalcFeedbackPolyLine();
            //base.FeedBack.Add(feedBackPolyLine);

            input1 = new GeoPointInput("Construct.Plane.Origin");
            input1.GetGeoPointEvent += new CADability.Actions.ConstructAction.GeoPointInput.GetGeoPointDelegate(OnGetOriginPoint);
            input1.SetGeoPointEvent += new CADability.Actions.ConstructAction.GeoPointInput.SetGeoPointDelegate(OnSetOriginPoint);
            input2 = new GeoPointInput("Construct.Plane.DircetionX");
            input2.GetGeoPointEvent += new CADability.Actions.ConstructAction.GeoPointInput.GetGeoPointDelegate(OnGetDircetionXPoint);
            input2.SetGeoPointEvent += new CADability.Actions.ConstructAction.GeoPointInput.SetGeoPointDelegate(OnSetDircetionXPoint);
            input3 = new GeoPointInput("Construct.Plane.DircetionY");
            input3.GetGeoPointEvent += new CADability.Actions.ConstructAction.GeoPointInput.GetGeoPointDelegate(OnGetDircetionYPoint);
            input3.SetGeoPointEvent += new CADability.Actions.ConstructAction.GeoPointInput.SetGeoPointDelegate(OnSetDircetionYPoint);
            base.SetInput(input1, input2, input3);
            //base.FeedBack.Add(feedBackPolyLine);
            base.FeedBack.Add(feedBackplane);
            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();
        }
Exemple #4
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();
        }
Exemple #5
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()
        {
            circ    = Ellipse.Construct();
            circRad = ConstrDefaults.DefaultArcRadius;
            circ.SetCirclePlaneCenterRadius(base.ActiveDrawingPlane, ConstrDefaults.DefaultArcCenter, ConstrDefaults.DefaultArcRadius);
            base.ActiveObject     = circ;
            base.ShowActiveObject = false;

            base.TitleId                            = "Constr.Circle.TwoTangentsPoint";
            curve1Input                             = new CurveInput("Constr.Arc.Tangent.Object");
            curve1Input.Decomposed                  = true; // nur Einzelelemente, auch bei Polyline und Pfad
            curve1Input.MouseOverCurvesEvent       += new CADability.Actions.ConstructAction.CurveInput.MouseOverCurvesDelegate(input1TangCurves);
            curve1Input.CurveSelectionChangedEvent += new CADability.Actions.ConstructAction.CurveInput.CurveSelectionChangedDelegate(input1TangCurvesChanged);
            curve2Input                             = new CurveInput("Constr.Arc.Tangent.Object2");
            curve2Input.Decomposed                  = true; // nur Einzelelemente, auch bei Polyline und Pfad
            curve2Input.MouseOverCurvesEvent       += new CADability.Actions.ConstructAction.CurveInput.MouseOverCurvesDelegate(input2TangCurves);
            curve2Input.CurveSelectionChangedEvent += new CADability.Actions.ConstructAction.CurveInput.CurveSelectionChangedDelegate(input2TangCurvesChanged);
            pointInput = new GeoPointInput("Constr.Circle.Point");
            pointInput.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(CirclePoint);
            LengthInput radCirc = new LengthInput("Constr.Arc.Radius");

            radCirc.ReadOnly        = true;
            radCirc.Optional        = true;
            radCirc.GetLengthEvent += new ConstructAction.LengthInput.GetLengthDelegate(CircRadius);
            base.SetInput(curve1Input, curve2Input, pointInput, radCirc);
            base.ShowAttributes = true;
            base.OnSetAction();
        }
        public override void OnSetAction()
        {
            line = Polyline.Construct();
            line.SetRectangle(ConstrDefaults.DefaultStartPoint, new GeoVector(ConstrDefaults.DefaultRectWidth, 0.0, 0.0), new GeoVector(0.0, ConstrDefaults.DefaultRectHeight, 0.0));

            base.ActiveObject = line;
            base.TitleId      = "Constr.Rect.Rect2PointsHeight";

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

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

            height = new LengthInput("Rect.Height");
            height.DefaultLength         = ConstrDefaults.DefaultRectHeight;
            height.SetLengthEvent       += new ConstructAction.LengthInput.SetLengthDelegate(Height);
            height.CalculateLengthEvent += new CADability.Actions.ConstructAction.LengthInput.CalculateLengthDelegate(HeightCalculate);
            height.ForwardMouseInputTo   = new object[] { startPointInput, secondPointInput };

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

            base.OnSetAction();
        }
        /// <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();
        }
        public override void OnSetAction()
        {
            base.TitleId = "Construct.DirectionOfSurface";

            dirOffsetSelect = ConstrDefaults.DefaultDirectionOffset;

            GeoPointInput facePoint = new GeoPointInput("Construct.DirectionOfSurface.Object");

            facePoint.SetGeoPointExEvent += new GeoPointInput.SetGeoPointExDelegate(SetFacePoint);

            MultipleChoiceInput dirOffset = new MultipleChoiceInput("Construct.DirectionOfSurface.DirOffset", "Construct.DirectionOfSurface.DirOffset.Values");

            dirOffset.DefaultChoice   = ConstrDefaults.DefaultDirectionOffset;
            dirOffset.SetChoiceEvent += new CADability.Actions.ConstructAction.MultipleChoiceInput.SetChoiceDelegate(SetDirOffset);

            GeoVectorInput measureText = new GeoVectorInput("MeasureDirection");

            measureText.CalculateGeoVectorEvent += new CADability.Actions.ConstructAction.GeoVectorInput.CalculateGeoVectorDelegate(CalculateMeasureText);
            measureText.GetGeoVectorEvent       += new CADability.Actions.ConstructAction.GeoVectorInput.GetGeoVectorDelegate(GetMeasureText);
            measureText.IsAngle = true;

            if (measure)
            {
                base.SetInput(facePoint, dirOffset, measureText);
            }
            else
            {
                base.SetInput(facePoint, dirOffset);
            }
            base.OnSetAction();
            snapModeSav         = base.Frame.SnapMode;
            base.Frame.SnapMode = SnapPointFinder.SnapModes.SnapToFaceSurface;
        }
        /// <summary>
        /// Overrides <see cref="CADability.Actions.ConstructAction.OnSetAction ()"/>
        /// </summary>
        public override void OnSetAction()
        {
            // die Titel Ids müssen sich unterscheiden, auch wg. der Hilfe
            string resSubId = "";

            switch (mode)
            {
            case HatchMode.simple:
                resSubId = "InnerPoint";
                break;

            case HatchMode.hull:
                resSubId = "Hull";
                break;

            case HatchMode.excludeHoles:
                resSubId = "ExcludeHoles";
                break;
            }
            base.TitleId = "Constr.Hatch." + resSubId;
            ConstructAction.GeoPointInput gpi = new GeoPointInput("Constr.Hatch.InnerPoint.Point");
            gpi.SetGeoPointEvent += new CADability.Actions.ConstructAction.GeoPointInput.SetGeoPointDelegate(OnPoint);
            gpi.MouseClickEvent  += new MouseClickDelegate(OnMouseClick);
            base.UseFilter        = true;
            base.ShowAttributes   = true;
            base.ShowActiveObject = false;
            base.ActiveObject     = Hatch.Construct();
            base.SetInput(gpi);
            base.OnSetAction();
        }
Exemple #11
0
        public override void OnSetAction()
        {
            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));
            base.ActiveObject     = dim;
            base.ShowActiveObject = false;


            base.TitleId = "Constr.Dimension.Direction.Objects";

            curveInput                             = new CurveInput("Constr.Dimension.Direction.Object1");
            curveInput.Decomposed                  = true; // nur Einzelelemente, auch bei Polyline und Pfad
            curveInput.MouseOverCurvesEvent       += new CADability.Actions.ConstructAction.CurveInput.MouseOverCurvesDelegate(inputDimCurves);
            curveInput.CurveSelectionChangedEvent += new CADability.Actions.ConstructAction.CurveInput.CurveSelectionChangedDelegate(inputDimCurvesChanged);

            curve2Input                             = new CurveInput("Constr.Dimension.Direction.Object2");
            curve2Input.Decomposed                  = true; // nur Einzelelemente, auch bei Polyline und Pfad
            curve2Input.MouseOverCurvesEvent       += new CADability.Actions.ConstructAction.CurveInput.MouseOverCurvesDelegate(input2DimCurves);
            curve2Input.CurveSelectionChangedEvent += new CADability.Actions.ConstructAction.CurveInput.CurveSelectionChangedDelegate(input2DimCurvesChanged);

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

            base.SetInput(curveInput, curve2Input, dimLocationInput);
            base.ShowAttributes = true;
            base.OnSetAction();
        }
        public override void OnSetAction()
        {
            useRadius = Frame.GetBooleanSetting("Formatting.Radius", true);

            arc    = Ellipse.Construct();
            arcRad = ConstrDefaults.DefaultArcRadius;
            arc.SetArcPlaneCenterRadiusAngles(base.ActiveDrawingPlane, new GeoPoint(0.0, 0.0, 0.0), arcRad, 0.0, 1.5 * Math.PI);

            base.ActiveObject = arc;
            base.TitleId      = "Constr.Arc.2PointsRadius";

            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);

            len = new LengthInput("Constr.Arc.Radius");
            len.DefaultLength   = ConstrDefaults.DefaultArcRadius;
            len.SetLengthEvent += new ConstructAction.LengthInput.SetLengthDelegate(ArcRadius);
            len.GetLengthEvent += new CADability.Actions.ConstructAction.LengthInput.GetLengthDelegate(GetRadius);
            if (!useRadius)
            {
                len.Optional = true;
            }
            // hier wird der Radius extern berechnet und zurückgeliefert
            len.CalculateLengthEvent += new CADability.Actions.ConstructAction.LengthInput.CalculateLengthDelegate(RadiusFromPoint);
            len.ForwardMouseInputTo   = new object[] { arcPoint1Input, arcPoint2Input };

            diamInput = new LengthInput("Constr.Circle.Diameter");
            diamInput.SetLengthEvent       += new ConstructAction.LengthInput.SetLengthDelegate(SetCircleDiameter);
            diamInput.GetLengthEvent       += new ConstructAction.LengthInput.GetLengthDelegate(GetCircleDiameter);
            diamInput.CalculateLengthEvent += new LengthInput.CalculateLengthDelegate(CalculateDiameter);
            if (useRadius)
            {
                diamInput.Optional = true;
            }
            diamInput.DefaultLength       = ConstrDefaults.DefaultArcDiameter;
            diamInput.ForwardMouseInputTo = new object[] { arcPoint1Input, arcPoint2Input };

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

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

            if (useRadius)
            {
                base.SetInput(arcPoint1Input, arcPoint2Input, len, diamInput, arcCenter);
            }
            else
            {
                base.SetInput(arcPoint1Input, arcPoint2Input, diamInput, len, arcCenter);
            }


            base.ShowAttributes = true;

            base.OnSetAction();
        }
        /// <summary>
        /// Overrides OnSetAction of ConstructAction. Here we create the new line
        /// and define the input for the construction
        /// </summary>
        public override void OnSetAction()
        {
            // Create the line and set it some default properties, so that it will
            // appear on the screen
            line            = Line.Construct();
            line.StartPoint = ConstrDefaults.DefaultStartPoint;
            GeoPoint p = ConstrDefaults.DefaultStartPoint;

            p.x           = p.x + ConstrDefaults.DefaultLineLength;
            line.EndPoint = p;

            // The line will be the active object during the construction. At the end
            // it will be added to the model.
            base.ActiveObject = line;
            // The title appears in the control center
            base.TitleId = "Constr.Line.PointLengthAngle";

            // The first input is a point, which defines the startpoint of the line
            // There is a default value for the startpoint (DefaultStartPoint) which
            // is updated at the end of the construction
            GeoPointInput startPointInput = new GeoPointInput("Line.StartPoint");

            startPointInput.DefaultGeoPoint = ConstrDefaults.DefaultStartPoint;
            // BasePoint is for ortho modus and direction input
            startPointInput.DefinesBasePoint = true;
            // registering a handler to react on the point input
            startPointInput.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(SetStartPoint);

            // the second input is a length.
            LengthInput len = new LengthInput("Line.Length");

            // the default length
            len.DefaultLength = ConstrDefaults.DefaultLineLength;
            // registering a handler for the change of the length
            len.SetLengthEvent += new ConstructAction.LengthInput.SetLengthDelegate(SetLength);
            // during length-input the mouseinput goes to startPointInput, if it isn´t fixed
            len.ForwardMouseInputTo = startPointInput;

            // the third input is the direction
            GeoVectorInput dir = new GeoVectorInput("Line.Direction");

            dir.DefaultGeoVector   = ConstrDefaults.DefaultLineDirection;
            dir.SetGeoVectorEvent += new CADability.Actions.ConstructAction.GeoVectorInput.SetGeoVectorDelegate(SetGeoVector);
            dir.IsAngle            = true;
            // during angle-input the mouseinput goes to startPointInput, if it isn´t fixed
            dir.ForwardMouseInputTo = startPointInput;

            // tell the ConstructAction which inputs there are
            base.SetInput(startPointInput, len, dir);


            // the new line gets the default attributes and shows them in the control center
            base.ShowAttributes = true;


            // be sure to call the default implementation
            base.OnSetAction();
        }
        public override void OnSetAction()
        {
            base.ActiveObject = Face.Construct();

            if (axisVector.IsNullVector())
            {
                axisVector = GeoVector.XAxis;
            }
            if (angleRotation == 0.0)
            {
                angleRotation = Math.PI;
            }

            base.TitleId = "Constr.Face.PathRotate";

            curveInput = new CurveInput("Constr.Face.PathRotate.Path");
            curveInput.MouseOverCurvesEvent       += new CurveInput.MouseOverCurvesDelegate(curveInputPath);
            curveInput.CurveSelectionChangedEvent += new CurveInput.CurveSelectionChangedDelegate(curveInputPathChanged);
            if (selectedMode)
            {
                curveInput.Fixed = true;
            }

            rotateLineInput                             = new CurveInput("Constr.Face.PathRotate.AxisLine");
            rotateLineInput.Decomposed                  = true; // nur Einzelelemente, auch bei Polyline und Pfad
            rotateLineInput.MouseOverCurvesEvent       += new CurveInput.MouseOverCurvesDelegate(RotateLine);
            rotateLineInput.CurveSelectionChangedEvent += new CurveInput.CurveSelectionChangedDelegate(RotateLineChanged);


            axisPointInput = new GeoPointInput("Constr.Face.PathRotate.AxisPoint", axisPoint);
            axisPointInput.SetGeoPointEvent   += new GeoPointInput.SetGeoPointDelegate(SetAxisPoint);
            axisPointInput.GetGeoPointEvent   += new GeoPointInput.GetGeoPointDelegate(GetAxisPoint);
            axisPointInput.ForwardMouseInputTo = curveInput;
            axisPointInput.DefinesBasePoint    = true;

            axisVectorInput = new GeoVectorInput("Constr.Face.PathRotate.AxisVector", axisVector);
            axisVectorInput.SetGeoVectorEvent += new GeoVectorInput.SetGeoVectorDelegate(SetAxisVector);
            axisVectorInput.GetGeoVectorEvent += new GeoVectorInput.GetGeoVectorDelegate(GetAxisVector);
            //            vectorInput.DefaultGeoVector = ConstrDefaults.DefaultExtrudeDirection;
            axisVectorInput.ForwardMouseInputTo = curveInput;
            optionalOrg();

            AngleInput angleInput = new AngleInput("Constr.Face.PathRotate.Angle", angleRotation);

            angleInput.SetAngleEvent += new AngleInput.SetAngleDelegate(SetAngleInput);
            angleInput.GetAngleEvent += new AngleInput.GetAngleDelegate(GetAngleInput);

            AngleInput angleOffsetInput = new AngleInput("Constr.Face.PathRotate.AngleOffset", angleOffsetRotation);

            angleOffsetInput.SetAngleEvent += new AngleInput.SetAngleDelegate(SetAngleOffsetInput);
            angleOffsetInput.GetAngleEvent += new AngleInput.GetAngleDelegate(GetAngleOffsetInput);
            angleOffsetInput.Optional       = true;

            base.SetInput(curveInput, rotateLineInput, axisPointInput, axisVectorInput, angleInput, angleOffsetInput);
            base.ShowAttributes = true;
            base.OnSetAction();
        }
Exemple #15
0
        public override void OnSetAction()
        {
            Boolean useRadius = Frame.GetBooleanSetting("Formatting.Radius", true);

            radiusPoint = new GeoPoint(0, 0);
            circ        = Ellipse.Construct();
            circRad     = ConstrDefaults.DefaultArcRadius;
            circ.SetCirclePlaneCenterRadius(base.ActiveDrawingPlane, ConstrDefaults.DefaultArcCenter, ConstrDefaults.DefaultArcRadius);
            base.ActiveObject     = circ;
            base.ShowActiveObject = false;
            base.TitleId          = "Constr.Circle.TangentPointRadius";

            curveInput                             = new CurveInput("Constr.Arc.Tangent.Object");
            curveInput.Decomposed                  = true; // nur Einzelelemente, auch bei Polyline und Pfad
            curveInput.MouseOverCurvesEvent       += new CADability.Actions.ConstructAction.CurveInput.MouseOverCurvesDelegate(inputTangCurves);
            curveInput.CurveSelectionChangedEvent += new CADability.Actions.ConstructAction.CurveInput.CurveSelectionChangedDelegate(inputTangCurvesChanged);

            pointInput = new GeoPointInput("Constr.Circle.Point");
            pointInput.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(CirclePoint);

            radInput = new LengthInput("Constr.Arc.Radius");
            radInput.DefaultLength         = ConstrDefaults.DefaultArcRadius;
            radInput.CalculateLengthEvent += new CADability.Actions.ConstructAction.LengthInput.CalculateLengthDelegate(radInput_OnCalculateLength);
            radInput.SetLengthEvent       += new ConstructAction.LengthInput.SetLengthDelegate(CircRadius);
            radInput.GetLengthEvent       += new CADability.Actions.ConstructAction.LengthInput.GetLengthDelegate(GetRadius);
            radInput.ForwardMouseInputTo   = new object[] { curveInput, pointInput };
            if (!useRadius)
            {
                radInput.Optional = true;
            }


            diamInput = new LengthInput("Constr.Circle.Diameter");
            diamInput.DefaultLength         = ConstrDefaults.DefaultArcRadius;
            diamInput.CalculateLengthEvent += new CADability.Actions.ConstructAction.LengthInput.CalculateLengthDelegate(diamInput_OnCalculateLength);
            diamInput.SetLengthEvent       += new ConstructAction.LengthInput.SetLengthDelegate(SetCircleDiameter);
            diamInput.GetLengthEvent       += new CADability.Actions.ConstructAction.LengthInput.GetLengthDelegate(GetCircleDiameter);
            diamInput.ForwardMouseInputTo   = new object[] { curveInput, pointInput };
            if (useRadius)
            {
                diamInput.Optional = true;
            }

            if (useRadius)
            {
                base.SetInput(curveInput, pointInput, radInput, diamInput);
            }
            else
            {
                base.SetInput(curveInput, pointInput, diamInput, radInput);
            }


            base.ShowAttributes = true;
            base.OnSetAction();
        }
        public override void OnSetAction()
        {
            base.TitleId = "DrawingPlane.Constr.Offset";
            GeoPointInput geoPointInput = new GeoPointInput("DrawingPlane.Offset");

            geoPointInput.GetGeoPointEvent += new CADability.Actions.ConstructAction.GeoPointInput.GetGeoPointDelegate(OnGetThroughPoint);
            geoPointInput.SetGeoPointEvent += new CADability.Actions.ConstructAction.GeoPointInput.SetGeoPointDelegate(OnSetThroughPoint);
            base.SetInput(geoPointInput);
            base.OnSetAction();
        }
        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();
        }
Exemple #18
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();
        }
        /// <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();
        }
Exemple #20
0
        /// <summary>
        /// Overrides <see cref="CADability.Actions.ConstructAction.OnSetAction ()"/>
        /// </summary>
        public override void OnSetAction()
        {
            base.TitleId = "CopyCircularObjects";

            BoundingRect result = originals.GetExtent(Frame.ActiveView.ProjectedModel.Projection, true, false);

            centerPoint = base.ActiveDrawingPlane.ToGlobal(result.GetCenter());
            //			rotationPoint =  base.ActiveDrawingPlane.ToGlobal(result.GetLowerLeft());
            rotationPoint = centerPoint;
            distX         = result.Width;
            if (copCount == 0)
            {
                copCount = 4;
                copAngle = Math.PI / 2.0;
            }

            GeoPointInput rotPoint = new GeoPointInput("CopyCircularObjects.RotationPoint");

            rotPoint.SetGeoPointEvent += new CADability.Actions.ConstructAction.GeoPointInput.SetGeoPointDelegate(SetRotPoint);
            rotPoint.GetGeoPointEvent += new CADability.Actions.ConstructAction.GeoPointInput.GetGeoPointDelegate(GetRotPoint);
            rotPoint.Optional          = true;
            rotPoint.DefinesHotSpot    = true;
            rotPoint.HotSpotSource     = "Hotspots.png:0";

            IntInput copiesCount = new IntInput("CopyCircularObjects.CopiesCount", copCount);

            copiesCount.SetMinMax(0, int.MaxValue, true);
            copiesCount.SetIntEvent += new CADability.Actions.ConstructAction.IntInput.SetIntDelegate(SetCopiesCount);
            //			copiesCount.CalculateIntEvent +=new CADability.Actions.ConstructAction.IntInput.CalculateIntDelegate(CalcCopiesCount);

            BooleanInput fullCircle = new BooleanInput("CopyCircularObjects.FullCircle", "CopyCircularObjects.FullCircle.Values");

            fullCircle.SetBooleanEvent += new CADability.Actions.ConstructAction.BooleanInput.SetBooleanDelegate(SetFullCircle);
            fullCircle.GetBooleanEvent += new CADability.Actions.ConstructAction.BooleanInput.GetBooleanDelegate(GetFullCircle);

            copiesAngle                      = new AngleInput("CopyCircularObjects.CopiesAngle", copAngle);
            copiesAngle.ReadOnly             = !partOfCircle;
            copiesAngle.Optional             = !partOfCircle;
            copiesAngle.SetAngleEvent       += new CADability.Actions.ConstructAction.AngleInput.SetAngleDelegate(SetCopAngle);
            copiesAngle.GetAngleEvent       += new CADability.Actions.ConstructAction.AngleInput.GetAngleDelegate(GetCopAngle);
            copiesAngle.CalculateAngleEvent += new CADability.Actions.ConstructAction.AngleInput.CalculateAngleDelegate(CalculateCopAngle);

            BooleanInput rotObject = new BooleanInput("CopyCircularObjects.ObjectsRotation", "CopyCircularObjects.ObjectsRotation.Values");

            rotObject.SetBooleanEvent += new CADability.Actions.ConstructAction.BooleanInput.SetBooleanDelegate(SetObjectsRotation);
            rotObject.GetBooleanEvent += new CADability.Actions.ConstructAction.BooleanInput.GetBooleanDelegate(GetObjectsRotation);

            base.SetInput(rotPoint, copiesCount, fullCircle, copiesAngle, rotObject);

            base.OnSetAction();
            showCirc();
        }
Exemple #21
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();
        }
Exemple #22
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 override void OnSetAction()
        {
            useRadius = Frame.GetBooleanSetting("Formatting.Radius", true);

            radiusPoint = new GeoPoint(0, 0);
            circ        = Ellipse.Construct();
            circRad     = ConstrDefaults.DefaultArcRadius;
            circ.SetCirclePlaneCenterRadius(base.ActiveDrawingPlane, ConstrDefaults.DefaultArcCenter, ConstrDefaults.DefaultArcRadius);
            base.ActiveObject             = circ;
            base.ShowActiveObject         = false;
            base.TitleId                  = "Constr.Circle.TwoPointsRadius";
            point1Input                   = new GeoPointInput("Constr.Circle.Point1");
            point1Input.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(CirclePoint1);
            point2Input                   = new GeoPointInput("Constr.Circle.Point2");
            point2Input.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(CirclePoint2);

            radInput = new LengthInput("Constr.Arc.Radius");
            radInput.DefaultLength         = ConstrDefaults.DefaultArcRadius;
            radInput.CalculateLengthEvent += new CADability.Actions.ConstructAction.LengthInput.CalculateLengthDelegate(radInput_OnCalculateLength);
            radInput.SetLengthEvent       += new ConstructAction.LengthInput.SetLengthDelegate(CircRadius);
            radInput.GetLengthEvent       += new CADability.Actions.ConstructAction.LengthInput.GetLengthDelegate(GetRadius);
            if (!useRadius)
            {
                radInput.Optional = true;
            }
            radInput.ForwardMouseInputTo = new object[] { point1Input, point2Input };

            diamInput = new LengthInput("Constr.Circle.Diameter");
            diamInput.SetLengthEvent       += new ConstructAction.LengthInput.SetLengthDelegate(SetCircleDiameter);
            diamInput.GetLengthEvent       += new ConstructAction.LengthInput.GetLengthDelegate(GetCircleDiameter);
            diamInput.CalculateLengthEvent += new LengthInput.CalculateLengthDelegate(CalculateDiameter);
            if (useRadius)
            {
                diamInput.Optional = true;
            }
            diamInput.DefaultLength       = ConstrDefaults.DefaultArcDiameter;
            diamInput.ForwardMouseInputTo = new object[] { point1Input, point2Input };


            if (useRadius)
            {
                base.SetInput(point1Input, point2Input, radInput, diamInput);
            }
            else
            {
                base.SetInput(point1Input, point2Input, diamInput, radInput);
            }
            base.ShowAttributes = true;
            base.OnSetAction();
        }
Exemple #24
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();
        }
Exemple #25
0
        public override void OnSetAction()
        {
            //			base.ActiveObject = block;
            base.TitleId = "PlaceObjects";

            positionPointInput = new GeoPointInput("Objects.Position");
            positionPointInput.SetGeoPointEvent += new CADability.Actions.ConstructAction.GeoPointInput.SetGeoPointDelegate(SetPositionPoint);
            positionPointInput.GetGeoPointEvent += new CADability.Actions.ConstructAction.GeoPointInput.GetGeoPointDelegate(GetPositionPoint);

            base.SetInput(positionPointInput);

            base.ActiveObject = block;

            base.OnSetAction();
        }
        /// <summary>
        /// Overrides <see cref="CADability.Actions.ConstructAction.OnSetAction ()"/>
        /// </summary>
        public override void OnSetAction()
        {
            base.TitleId = "Construct.DistancePointCurve";
            feedBackLine = Line.Construct();
            Color backColor = base.Frame.GetColorSetting("Colors.Feedback", Color.DarkGray);

            feedBackLine.ColorDef = new ColorDef("", backColor);
            feedBackAdd           = false;

            pointInput = new GeoPointInput("Construct.DistancePointCurve.Point");
            pointInput.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(DistPoint);

            curveInput                             = new CurveInput("Construct.DistancePointCurve.Object");
            curveInput.Decomposed                  = true; // nur Einzelelemente, auch bei Polyline und Pfad
            curveInput.MouseOverCurvesEvent       += new CADability.Actions.ConstructAction.CurveInput.MouseOverCurvesDelegate(DistCurve);
            curveInput.CurveSelectionChangedEvent += new CADability.Actions.ConstructAction.CurveInput.CurveSelectionChangedDelegate(DistCurveChanged);

            LengthInput measureText = new LengthInput("MeasureLength");

            measureText.CalculateLengthEvent += new CADability.Actions.ConstructAction.LengthInput.CalculateLengthDelegate(CalculateMeasureText);
            measureText.GetLengthEvent       += new CADability.Actions.ConstructAction.LengthInput.GetLengthDelegate(GetMeasureText);

            LengthInput measureTextx = new LengthInput("MeasureLengthx");

            measureTextx.CalculateLengthEvent += new CADability.Actions.ConstructAction.LengthInput.CalculateLengthDelegate(CalculateMeasureTextx);
            measureTextx.GetLengthEvent       += new CADability.Actions.ConstructAction.LengthInput.GetLengthDelegate(GetMeasureTextx);

            LengthInput measureTexty = new LengthInput("MeasureLengthy");

            measureTexty.CalculateLengthEvent += new CADability.Actions.ConstructAction.LengthInput.CalculateLengthDelegate(CalculateMeasureTexty);
            measureTexty.GetLengthEvent       += new CADability.Actions.ConstructAction.LengthInput.GetLengthDelegate(GetMeasureTexty);

            LengthInput measureTextz = new LengthInput("MeasureLengthz");

            measureTextz.CalculateLengthEvent += new CADability.Actions.ConstructAction.LengthInput.CalculateLengthDelegate(CalculateMeasureTextz);
            measureTextz.GetLengthEvent       += new CADability.Actions.ConstructAction.LengthInput.GetLengthDelegate(GetMeasureTextz);


            if (measure)
            {
                base.SetInput(pointInput, curveInput, measureText, measureTextx, measureTexty, measureTextz);
            }
            else
            {
                base.SetInput(pointInput, curveInput);
            }
            base.OnSetAction();
        }
Exemple #27
0
        public override void OnSetAction()
        {
            base.TitleId = "Construct.DistanceTwoPoints";
            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.DistanceTwoPoints.FirstPoint");
            firstPointInput.DefinesBasePoint  = true;
            firstPointInput.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(OnSetFirstPoint);

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

            LengthInput measureText = new LengthInput("MeasureLength");

            measureText.CalculateLengthEvent += new CADability.Actions.ConstructAction.LengthInput.CalculateLengthDelegate(CalculateMeasureText);
            measureText.GetLengthEvent       += new CADability.Actions.ConstructAction.LengthInput.GetLengthDelegate(GetMeasureText);

            LengthInput measureTextx = new LengthInput("MeasureLengthx");

            measureTextx.CalculateLengthEvent += new CADability.Actions.ConstructAction.LengthInput.CalculateLengthDelegate(CalculateMeasureTextx);
            measureTextx.GetLengthEvent       += new CADability.Actions.ConstructAction.LengthInput.GetLengthDelegate(GetMeasureTextx);

            LengthInput measureTexty = new LengthInput("MeasureLengthy");

            measureTexty.CalculateLengthEvent += new CADability.Actions.ConstructAction.LengthInput.CalculateLengthDelegate(CalculateMeasureTexty);
            measureTexty.GetLengthEvent       += new CADability.Actions.ConstructAction.LengthInput.GetLengthDelegate(GetMeasureTexty);

            LengthInput measureTextz = new LengthInput("MeasureLengthz");

            measureTextz.CalculateLengthEvent += new CADability.Actions.ConstructAction.LengthInput.CalculateLengthDelegate(CalculateMeasureTextz);
            measureTextz.GetLengthEvent       += new CADability.Actions.ConstructAction.LengthInput.GetLengthDelegate(GetMeasureTextz);

            firstPointIsValid  = false;
            secondPointIsValid = false;
            if (measure)
            {
                base.SetInput(firstPointInput, secondPointInput, measureText, measureTextx, measureTexty, measureTextz);
            }
            else
            {
                base.SetInput(firstPointInput, secondPointInput);
            }
            base.OnSetAction();
        }
Exemple #28
0
        public override void OnSetAction()
        {
            //			base.ActiveObject = block;
            base.TitleId = "MoveObjects";
            copyObject   = ConstrDefaults.DefaultCopyObjects;
            feedBackLine = Line.Construct();
            Color backColor = base.Frame.GetColorSetting("Colors.Feedback", Color.DarkGray);

            feedBackLine.ColorDef = new ColorDef("", backColor);
            base.SetCursor(SnapPointFinder.DidSnapModes.DidNotSnap, "Move");


            vec = new GeoVectorInput("MoveObjects.Vector");
            vec.SetGeoVectorEvent       += new CADability.Actions.ConstructAction.GeoVectorInput.SetGeoVectorDelegate(Vec_OnSetGeoVector);
            vec.MouseClickEvent         += new MouseClickDelegate(VecOnMouseClick);
            vec.CalculateGeoVectorEvent += new GeoVectorInput.CalculateGeoVectorDelegate(vecCalculateGeoVector);
            vec.GetGeoVectorEvent       += new GeoVectorInput.GetGeoVectorDelegate(vecGetGeoVector);

            startPointInput                   = new GeoPointInput("Objects.StartPoint");
            startPointInput.Optional          = true;
            startPointInput.SetGeoPointEvent += new CADability.Actions.ConstructAction.GeoPointInput.SetGeoPointDelegate(SetStartPoint);
            startPointInput.GetGeoPointEvent += new CADability.Actions.ConstructAction.GeoPointInput.GetGeoPointDelegate(GetStartPoint);

            endPointInput                   = new GeoPointInput("Objects.EndPoint");
            endPointInput.Optional          = true;
            endPointInput.SetGeoPointEvent += new CADability.Actions.ConstructAction.GeoPointInput.SetGeoPointDelegate(SetEndPoint);
            endPointInput.GetGeoPointEvent += new CADability.Actions.ConstructAction.GeoPointInput.GetGeoPointDelegate(GetEndPoint);

            BooleanInput copy = new BooleanInput("Modify.CopyObjects", "YesNo.Values");

            copy.DefaultBoolean   = ConstrDefaults.DefaultCopyObjects;
            copy.SetBooleanEvent += new CADability.Actions.ConstructAction.BooleanInput.SetBooleanDelegate(SetCopy);

            base.SetInput(vec, startPointInput, endPointInput, copy);

            BoundingCube result = BoundingCube.EmptyBoundingCube;

            foreach (IGeoObject go in originals)
            {
                result.MinMax(go.GetBoundingCube());
            }

            GeoPoint blockCenter = result.GetCenter();

            block.RefPoint = blockCenter;
            vec.SetVectorFromPoint(blockCenter);
            base.OnSetAction();
        }
Exemple #29
0
        public override void OnSetAction()
        {
            cone           = Solid.Construct();
            base.BasePoint = ConstrDefaults.DefaultStartPoint;
            coneStartPoint = base.BasePoint;
            coneRadius1    = ConstrDefaults.DefaultArcRadius;
            coneRadius2    = ConstrDefaults.DefaultArcRadius / 2;
            coneHeight     = ConstrDefaults.DefaultBoxHeight;
            coneDirX       = coneRadius1 * base.ActiveDrawingPlane.DirectionX;
            coneDirZ       = coneHeight * (base.ActiveDrawingPlane.DirectionX ^ base.ActiveDrawingPlane.DirectionY);
            cone           = Make3D.MakeCone(coneStartPoint, coneDirX, coneDirZ, coneRadius1, coneRadius2);

            base.ActiveObject = cone;
            base.TitleId      = "Constr.Cone";

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

            endPointInput = new GeoPointInput("Constr.Cone.EndPoint");
            //			endPointInput.DefaultGeoPoint = ConstrDefaults.DefaultStartPoint;
            endPointInput.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(EndPoint);

            radius1 = new LengthInput("Constr.Cone.Radius1");
            radius1.DefaultLength         = ConstrDefaults.DefaultArcRadius;
            radius1.SetLengthEvent       += new ConstructAction.LengthInput.SetLengthDelegate(Radius1);
            radius1.GetLengthEvent       += new LengthInput.GetLengthDelegate(GetRadius1);
            radius1.CalculateLengthEvent += new CADability.Actions.ConstructAction.LengthInput.CalculateLengthDelegate(Radius1Calculate);


            radius2 = new LengthInput("Constr.Cone.Radius2");
            radius2.SetLengthEvent       += new ConstructAction.LengthInput.SetLengthDelegate(Radius2);
            radius2.GetLengthEvent       += new LengthInput.GetLengthDelegate(GetRadius2);
            radius2.CalculateLengthEvent += new CADability.Actions.ConstructAction.LengthInput.CalculateLengthDelegate(Radius2Calculate);

            height = new LengthInput("Constr.Cone.Height");
            height.DefaultLength       = ConstrDefaults.DefaultBoxHeight;
            height.SetLengthEvent     += new ConstructAction.LengthInput.SetLengthDelegate(Height);
            height.GetLengthEvent     += new LengthInput.GetLengthDelegate(GetHeight);
            height.Optional            = true;
            height.ForwardMouseInputTo = endPointInput;

            base.SetInput(startPointInput, endPointInput, radius1, radius2, height);
            base.ShowAttributes = true;

            base.OnSetAction();
        }
        public override void OnSetAction()
        {
            base.TitleId = "MenuId.ViewFixPoint";
            ModelView mv = base.Frame.ActiveView as ModelView;

            if (mv != null)
            {
                current = mv.FixPoint;
            }
            ConstructAction.GeoPointInput gpi = new GeoPointInput("ViewFixPoint.Point");
            gpi.GetGeoPointEvent += new GeoPointInput.GetGeoPointDelegate(OnGetFixPoint);
            gpi.SetGeoPointEvent += new GeoPointInput.SetGeoPointDelegate(OnSetFixPoint);
            base.SetInput(gpi);
            base.OnSetAction();
            base.Frame.SnapMode |= SnapPointFinder.SnapModes.SnapToFaceSurface;
        }