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();
        }
        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;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Called when the position input is changed
        /// </summary>
        /// <param name="p">The new location point</param>
        /// <param name="didSnap">Information on point snapping</param>
        /// <returns>true, if point is accepted</returns>
        bool OnSetPosition(GeoPoint p, SnapPointFinder.DidSnapModes didSnap)
        {
            location = p;
            // default vectors for the two sides of the bitmap
            GeoVector dirWidth  = ActiveDrawingPlane.DirectionX;
            GeoVector dirHeight = ActiveDrawingPlane.DirectionY;

            if (didSnap == SnapPointFinder.DidSnapModes.DidSnapToFaceSurface)
            {                                                                 // if there was a snap on the surface of a face we want to center the picture object
                // there. We also want to make it parallel to the surface at this point and stand upright.
                Face fc = base.LastSnapObject as Face;                        // this object was involved in the snapping
                if (fc != null)                                               // should always be the case
                {
                    GeoPoint2D pos        = fc.Surface.PositionOf(location);  // position in the surface u/v system
                    GeoVector  normal     = fc.Surface.GetNormal(pos);        // normal vector at this position
                    Projection projection = base.CurrentMouseView.Projection; // the projection of the view
                    if (projection != null)
                    {                                                         // make sure that the normal vector points away from the user.
                        // On faces not in a solid both sides of the face are displayed and you don't know
                        // on which side you are
                        if (projection.Direction * normal < 0.0)
                        {
                            normal = -normal;
                        }
                    }
                    location = location - 0.001 * normal.Normalized; // moves the location point a little bit
                    // in the direction of the normal vector to the user so
                    // that the bitmap hovers a little above the surface to avoid display artefacts
                    if (Precision.SameDirection(normal, GeoVector.ZAxis, false))
                    {   // the surface is parallel to the x/y plane: orient the bitmap to the x/y axis
                        dirWidth  = GeoVector.XAxis;
                        dirHeight = GeoVector.YAxis;
                    }
                    else
                    {   // some arbitrary surface direction: calculate the base direction of the bitmap to
                        // be parallel to the x/y plane and the up direction rectangular to the base and the normal.
                        // this makes the bitmap appear upright (in the sense of the z-axis)
                        dirWidth  = normal ^ GeoVector.ZAxis;
                        dirHeight = dirWidth ^ normal;
                        dirWidth.Norm(); // we need normalized vectors
                        dirHeight.Norm();
                    }
                    //                    picture.Location = location - 0.5 * widthValue * dirWidth - 0.5 * heightValue * dirHeight;
                    picture.Location = location;
                }
            }
            else
            {
                picture.Location = location;
            }
            // provide the picture object with proper aspect ratio and scaling according to the scaling factor
            picture.DirectionWidth  = widthValue * dirWidth;
            picture.DirectionHeight = heightValue * dirHeight;
            // set the location of the object so that the center of the bitmap occures at the position of location
            // Since picture.Location is the lower left point of the object we must move it left and down
            // with half of it's size
            // diagonalPointDist = Geometry.Dist(picture.Location, picture.Location + picture.DirectionWidth + picture.DirectionHeight);
            return(true); // this was OK
        }
Ejemplo n.º 4
0
        /// <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();
        }
Ejemplo n.º 5
0
        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();
        }
Ejemplo n.º 6
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;
            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();
        }
Ejemplo n.º 7
0
        public override void OnSetAction()
        {
            ellipse  = Ellipse.Construct();
            dir      = ConstrDefaults.DefaultArcDirection;
            point1   = ConstrDefaults.DefaultEllipseCenter;
            point2   = point1;
            point2.x = point1.x + ConstrDefaults.DefaultEllipseMajorRadius;
            point2.y = point1.y + ConstrDefaults.DefaultEllipseMinorRadius;
            vector1  = base.ActiveDrawingPlane.DirectionY;
            vector2  = base.ActiveDrawingPlane.DirectionX;
            showEllipse();


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

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

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

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

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

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

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

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

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

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

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

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

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

            base.SetInput(elliPoint1, elliDir1, elliPoint2, elliDir2, dirInput);
            base.ShowAttributes = true;
            base.OnSetAction();
        }
Ejemplo n.º 8
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();
        }
Ejemplo n.º 9
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();
        }
Ejemplo n.º 10
0
        public override void OnSetAction()
        {
            line               = Line.Construct();
            lineLength         = ConstrDefaults.DefaultLineLength;
            lineDir            = ConstrDefaults.DefaultLineDirection;
            linePositionMiddle = ConstrDefaults.DefaultLinePosition;
            startPoint         = new GeoPoint(0.0, 0.0, 0.0);
            endPoint           = startPoint + lineLength * lineDir;
            line.SetTwoPoints(startPoint, endPoint);
            base.ActiveObject = line;
            tangCurves        = new ICurve[0];

            base.TitleId = "Constr.Line.TangentAngle";

            curveInput                             = new CurveInput("Constr.Line.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);

            LengthInput len = new LengthInput("Line.Length");

            len.DefaultLength         = ConstrDefaults.DefaultLineLength;
            len.SetLengthEvent       += new ConstructAction.LengthInput.SetLengthDelegate(OnSetLength);
            len.CalculateLengthEvent += new LengthInput.CalculateLengthDelegate(CalculateLength);
            len.ForwardMouseInputTo   = curveInput;

            GeoVectorInput dir = new GeoVectorInput("Line.Direction");

            dir.DefaultGeoVector    = ConstrDefaults.DefaultLineDirection;
            dir.SetGeoVectorEvent  += new CADability.Actions.ConstructAction.GeoVectorInput.SetGeoVectorDelegate(SetGeoVector);
            dir.IsAngle             = true;
            dir.ForwardMouseInputTo = curveInput;

            BooleanInput position = new BooleanInput("Constr.Line.Tangent.Position", "Constr.Line.Tangent.Position.Values");

            position.DefaultBoolean   = ConstrDefaults.DefaultLinePosition;
            position.SetBooleanEvent += new BooleanInput.SetBooleanDelegate(SetPosition);
            //            position.GetBooleanEvent += new BooleanInput.GetBooleanDelegate(GetPosition);

            base.SetInput(curveInput, len, dir, position);
            base.ShowAttributes = true;

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

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

            vec = new GeoVectorInput("Construct.DirectionTwoPoints.Vector");
            vec.SetGeoVectorEvent += new CADability.Actions.ConstructAction.GeoVectorInput.SetGeoVectorDelegate(Vec_OnSetGeoVector);
            vec.MouseClickEvent   += new MouseClickDelegate(VecOnMouseClick);

            startPointInput                   = new GeoPointInput("Construct.DirectionTwoPoints.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("Construct.DirectionTwoPoints.EndPoint");
            endPointInput.Optional          = true;
            endPointInput.SetGeoPointEvent += new CADability.Actions.ConstructAction.GeoPointInput.SetGeoPointDelegate(SetEndPoint);
            endPointInput.GetGeoPointEvent += new CADability.Actions.ConstructAction.GeoPointInput.GetGeoPointDelegate(GetEndPoint);

            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(vec, startPointInput, endPointInput, measureText);
            }
            else
            {
                base.SetInput(vec, startPointInput, endPointInput);
            }

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

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

            vec = new GeoVectorInput("Construct.VectorPoint.Vector");
            vec.SetGeoVectorEvent += new CADability.Actions.ConstructAction.GeoVectorInput.SetGeoVectorDelegate(Vec_OnSetGeoVector);
            vec.MouseClickEvent   += new MouseClickDelegate(VecOnMouseClick);

            startPointInput                   = new GeoPointInput("Construct.VectorPoint.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("Construct.VectorPoint.EndPoint");
            endPointInput.Optional          = true;
            endPointInput.SetGeoPointEvent += new CADability.Actions.ConstructAction.GeoPointInput.SetGeoPointDelegate(SetEndPoint);
            endPointInput.GetGeoPointEvent += new CADability.Actions.ConstructAction.GeoPointInput.GetGeoPointDelegate(GetEndPoint);

            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(vec, startPointInput, endPointInput, measureText);
            }
            else
            {
                base.SetInput(vec, startPointInput, endPointInput);
            }
            base.OnSetAction();
            base.FeedBack.Add(feedBackLine);
        }
Ejemplo n.º 13
0
        /// <summary>
        /// Overrides <see cref="CADability.Actions.ConstructAction.OnSetAction ()"/>
        /// </summary>
        public override void OnSetAction()
        {
            base.TitleId = "Construct.DirectionOfCurve";

            dirPointSelect  = ConstrDefaults.DefaultDirectionPoint;
            dirOffsetSelect = ConstrDefaults.DefaultDirectionOffset;

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

            MultipleChoiceInput dirPoint = new MultipleChoiceInput("Construct.DirectionOfCurve.DirPoint", "Construct.DirectionOfCurve.DirPoint.Values");

            dirPoint.DefaultChoice   = ConstrDefaults.DefaultDirectionPoint;
            dirPoint.SetChoiceEvent += new CADability.Actions.ConstructAction.MultipleChoiceInput.SetChoiceDelegate(SetDirPoint);

            MultipleChoiceInput dirOffset = new MultipleChoiceInput("Construct.DirectionOfCurve.DirOffset", "Construct.DirectionOfCurve.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(curveInput, dirPoint, dirOffset, measureText);
            }
            else
            {
                base.SetInput(curveInput, dirPoint, dirOffset);
            }
            base.OnSetAction();
        }
Ejemplo n.º 14
0
        public override void OnSetAction()
        {
            line                  = Line.Construct();
            line.StartPoint       = ConstrDefaults.DefaultStartPoint;
            line.EndPoint         = line.StartPoint;
            base.ActiveObject     = line;
            base.ShowActiveObject = false;
            base.TitleId          = "Constr.Line.TwoPoints";

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

            endPointInput = new GeoPointInput("Line.EndPoint");
            endPointInput.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(OnSetEndPoint);
            endPointInput.GetGeoPointEvent += new ConstructAction.GeoPointInput.GetGeoPointDelegate(OnGetEndPoint);

            LengthInput len = new LengthInput("Line.Length");

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

            GeoVectorInput dir = new GeoVectorInput("Line.Direction");

            dir.Optional           = true;
            dir.ReadOnly           = true;
            dir.GetGeoVectorEvent += new CADability.Actions.ConstructAction.GeoVectorInput.GetGeoVectorDelegate(GetGeoVector);
            dir.IsAngle            = true;

            base.SetInput(startPointInput, endPointInput, len, dir);
            base.ShowAttributes = true;

            base.OnSetAction();
        }
Ejemplo n.º 15
0
        //		private void XPoint(GeoPoint p)
        //		{
        //			if (!Precision.IsEqual(line.ParallelogramLocation,p))
        //			{
        //				GeoVector dirX = new GeoVector(line.ParallelogramLocation,p);
        //				if (!Precision.SameDirection(dirX,line.ParallelogramSecondaryDirection,false))
        //					line.SetParallelogram(line.ParallelogramLocation,dirX,line.ParallelogramSecondaryDirection);
        //
        //			}
        //		}

        //		private void YPoint(GeoPoint p)
        //		{
        //			if (!Precision.IsEqual(line.ParallelogramLocation,p))
        //			{
        //				GeoVector dirY = new GeoVector(line.ParallelogramLocation,p);
        //				if (!Precision.SameDirection(dirY,line.ParallelogramMainDirection,false))
        //					line.SetParallelogram(line.ParallelogramLocation,line.ParallelogramMainDirection,dirY);
        //			}
        //		}

        public override void OnSetAction()
        {
            line = Polyline.Construct();
            line.SetParallelogram(ConstrDefaults.DefaultStartPoint, ConstrDefaults.DefaultRectWidth * base.ActiveDrawingPlane.DirectionX, ConstrDefaults.DefaultRectHeight * base.ActiveDrawingPlane.DirectionY);
            line.ParallelogramAngle = Math.PI / 3;
            base.BasePoint          = ConstrDefaults.DefaultStartPoint;

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

            GeoPointInput startPointInput = new GeoPointInput("Constr.Rect.Parallelogram.StartPoint");

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

            xVectorInput = new GeoVectorInput("Constr.Rect.Parallelogram.X-Direction");
            xVectorInput.SetGeoVectorEvent += new ConstructAction.GeoVectorInput.SetGeoVectorDelegate(XVector);
            //			xVectorInput.IsAngle = true;
            //			xVectorInput.ForwardMouseInputTo = startPointInput;

            yVectorInput = new GeoVectorInput("Constr.Rect.Parallelogram.Y-Direction");
            yVectorInput.SetGeoVectorEvent += new ConstructAction.GeoVectorInput.SetGeoVectorDelegate(YVector);
            //			yVectorInput.IsAngle = true;
            //			yVectorInput.ForwardMouseInputTo = startPointInput;

            //			GeoPointInput xPointInput = new GeoPointInput("Constr.Rect.Parallelogram.X-Direction");
            //			xPointInput.OnSetGeoPoint += new ConstructAction.GeoPointInput.SetGeoPointDelegate(XPoint);
            //			GeoPointInput yPointInput = new GeoPointInput("Constr.Rect.Parallelogram.Y-Direction");
            //			yPointInput.OnSetGeoPoint += new ConstructAction.GeoPointInput.SetGeoPointDelegate(YPoint);

            base.SetInput(startPointInput, xVectorInput, yVectorInput);
            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();
        }
Ejemplo n.º 17
0
        public override void OnSetAction()
        {
            base.ActiveObject = Face.Construct();
            DefaultLength l = new DefaultLength(ConstructAction.DefaultLength.StartValue.ViewWidth8);

            if (vector.IsNullVector())
            {
                vector = l * base.ActiveDrawingPlane.Normal;
            }
            if (height == 0.0)
            {
                height = l;
            }
            ;
            //           if (!VectorOrHeight)
            if (extrudeMode < 2)
            {
                vector = height * base.ActiveDrawingPlane.Normal;
            }
            base.TitleId = "Constr.Face.PathExtrude";

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

            heightInput = new LengthInput("Constr.Face.PathExtrude.Height");
            heightInput.SetLengthEvent     += new LengthInput.SetLengthDelegate(SetHeight);
            heightInput.GetLengthEvent     += new LengthInput.GetLengthDelegate(GetHeight);
            heightInput.ForwardMouseInputTo = curveInput;
            if (selectedMode)
            {
                extrudeOrg();               //schonmal berechnen und markieren!
            }
            planeInput = new BooleanInput("Constr.Face.PathExtrude.Plane", "Constr.Face.PathExtrude.Plane.Values", planeMode);
            planeInput.SetBooleanEvent += new BooleanInput.SetBooleanDelegate(SetPlaneMode);

            vectorInput = new GeoVectorInput("Constr.Face.PathExtrude.Vector", vector);
            vectorInput.SetGeoVectorEvent += new GeoVectorInput.SetGeoVectorDelegate(SetVector);
            vectorInput.GetGeoVectorEvent += new GeoVectorInput.GetGeoVectorDelegate(GetVector);
            //            vectorInput.DefaultGeoVector = ConstrDefaults.DefaultExtrudeDirection;
            vectorInput.ForwardMouseInputTo = curveInput;

            heightOffsetInput = new LengthInput("Constr.Face.PathExtrude.HeightOffset");
            heightOffsetInput.SetLengthEvent     += new LengthInput.SetLengthDelegate(SetHeightOffset);
            heightOffsetInput.GetLengthEvent     += new LengthInput.GetLengthDelegate(GetHeightOffset);
            heightOffsetInput.ForwardMouseInputTo = curveInput;
            heightOffsetInput.Optional            = true;

            vectorOffsetInput = new GeoVectorInput("Constr.Face.PathExtrude.VectorOffset", vectorOffset);
            vectorOffsetInput.SetGeoVectorEvent  += new GeoVectorInput.SetGeoVectorDelegate(SetVectorOffset);
            vectorOffsetInput.GetGeoVectorEvent  += new GeoVectorInput.GetGeoVectorDelegate(GetVectorOffset);
            vectorOffsetInput.ForwardMouseInputTo = curveInput;
            vectorOffsetInput.Optional            = true;

            pipeInput = new CurveInput("Constr.Face.PathExtrude.Pipe");
            pipeInput.MouseOverCurvesEvent       += new CurveInput.MouseOverCurvesDelegate(pipeInputCurves);
            pipeInput.CurveSelectionChangedEvent += new CurveInput.CurveSelectionChangedDelegate(pipeInputCurveChanged);

            optionalOrg();

            SeparatorInput separatorHeight = new SeparatorInput("Constr.Face.PathExtrude.SeparatorHeight");
            SeparatorInput separatorVector = new SeparatorInput("Constr.Face.PathExtrude.SeparatorVector");
            SeparatorInput separatorPipe   = new SeparatorInput("Constr.Face.PathExtrude.SeparatorPipe");

            //            if (selectedMode)
            //                base.SetInput( heightInput, heightOffsetInput, separatorVector, vectorInput, vectorOffsetInput, separatorPipe, pipeInput, planeInput);
            //             else base.SetInput(curveInput,separatorHeight, heightInput, heightOffsetInput,separatorVector,vectorInput, vectorOffsetInput,separatorPipe,pipeInput, planeInput);
            base.SetInput(curveInput, separatorHeight, heightInput, heightOffsetInput, planeInput, separatorVector, vectorInput, vectorOffsetInput, separatorPipe, pipeInput);
            base.ShowAttributes = true;
            base.OnSetAction();
        }
Ejemplo n.º 18
0
        /// <summary>
        /// Overrides <see cref="CADability.Actions.ConstructAction.OnSetAction ()"/>
        /// </summary>
        public override void OnSetAction()
        {
            base.TitleId = "CopyMatrixObjects";

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

            centerPoint = base.ActiveDrawingPlane.ToGlobal(result.GetCenter());
            distX       = result.Width;
            distY       = result.Height;
            // da oben static private, werden diese Variablen gemerkt. Beim ersten Mal vorbesetzen:
            if ((horRight == 0) & (horLeft == 0) & (verUp == 0) & (verDown == 0))
            {
                horRight = 3;
                verUp    = 2;
            }
            // da oben static private, wird diese Variable gemerkt. Beim ersten Mal vorbesetzen:
            if (dirV.IsNullVector())
            {
                dirV = new GeoVector(1.0, 0.0, 0.0);
            }

            IntInput horCountRight = new IntInput("CopyMatrixObjects.HorCountRight", horRight);

            horCountRight.SetMinMax(0, int.MaxValue, true);
            horCountRight.SetIntEvent += new CADability.Actions.ConstructAction.IntInput.SetIntDelegate(SetHorCountRight);
            //			horCountRight.CalculateIntEvent +=new CADability.Actions.ConstructAction.IntInput.CalculateIntDelegate(CalcHorCountRight);

            IntInput verCountUp = new IntInput("CopyMatrixObjects.VerCountUp", verUp);

            verCountUp.SetMinMax(0, int.MaxValue, true);
            verCountUp.SetIntEvent += new CADability.Actions.ConstructAction.IntInput.SetIntDelegate(SetVerCountUp);
            //			verCountUp.CalculateIntEvent +=new CADability.Actions.ConstructAction.IntInput.CalculateIntDelegate(CalcVerCountUp);

            horDist = new LengthInput("CopyMatrixObjects.HorDist", distX);
            horDist.SetDistanceFromLine(centerPoint, centerPoint + (dirV ^ base.ActiveDrawingPlane.Normal));
            horDist.SetLengthEvent += new CADability.Actions.ConstructAction.LengthInput.SetLengthDelegate(SetHorDist);

            verDist = new LengthInput("CopyMatrixObjects.VerDist", distY);
            verDist.SetDistanceFromLine(centerPoint, centerPoint + dirV);
            verDist.SetLengthEvent += new CADability.Actions.ConstructAction.LengthInput.SetLengthDelegate(SetVerDist);

            GeoVectorInput dir = new GeoVectorInput("CopyMatrixObjects.Direction", dirV);

            dir.Optional = true;
            dir.SetVectorFromPoint(centerPoint);
            dir.SetGeoVectorEvent += new CADability.Actions.ConstructAction.GeoVectorInput.SetGeoVectorDelegate(SetDir);
            dir.IsAngle            = true;

            IntInput horCountLeft = new IntInput("CopyMatrixObjects.HorCountLeft", horLeft);

            horCountLeft.SetMinMax(0, int.MaxValue, true);
            horCountLeft.Optional     = true;
            horCountLeft.SetIntEvent += new CADability.Actions.ConstructAction.IntInput.SetIntDelegate(SetHorCountLeft);
            //			horCountLeft.CalculateIntEvent +=new CADability.Actions.ConstructAction.IntInput.CalculateIntDelegate(CalcHorCountLeft);

            IntInput verCountDown = new IntInput("CopyMatrixObjects.VerCountDown", verDown);

            verCountDown.SetMinMax(0, int.MaxValue, true);
            verCountDown.Optional     = true;
            verCountDown.SetIntEvent += new CADability.Actions.ConstructAction.IntInput.SetIntDelegate(SetVerCountDown);
            //			verCountDown.CalculateIntEvent +=new CADability.Actions.ConstructAction.IntInput.CalculateIntDelegate(CalcVerCountDown);


            base.SetInput(horCountRight, verCountUp, horDist, verDist, dir, horCountLeft, verCountDown);

            base.OnSetAction();
            showMatrix();
        }
Ejemplo n.º 19
0
        public override void OnSetAction()
        {
            dim = Dimension.Construct();
            switch (dimDir)
            {
            case DimDirection.Horizontal:
                idString             = "Constr.Dimension.Horizontal";
                dim.DimLineDirection = base.ActiveDrawingPlane.DirectionX;
                break;

            case DimDirection.Vertical:
                idString             = "Constr.Dimension.Vertical";
                dim.DimLineDirection = base.ActiveDrawingPlane.DirectionY;
                break;

            case DimDirection.Sloping:
                idString             = "Constr.Dimension.Sloping";
                dim.DimLineDirection = base.ActiveDrawingPlane.DirectionX;
                break;
            }
            dim.DimLineRef = ConstrDefaults.DefaultDimPoint;
            dim.Normal     = base.ActiveDrawingPlane.Normal;
            methodSelect   = ConstrDefaults.DefaultDimensionMethod;
            if (methodSelect == 2) // Kordinatenbem. bezgl eines Punktes
            {
                dim.DimType = Dimension.EDimType.DimCoord;
            }
            else
            {
                dim.DimType = Dimension.EDimType.DimPoints;
            }


            base.ActiveObject = dim;

            base.TitleId = idString;

            mi            = new MultiPointInput(this);
            mi.ResourceId = "Constr.Dimension.Point";

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

            dimDirInput                    = new GeoVectorInput("Constr.Dimension.Direction");
            dimDirInput.Optional           = true;
            dimDirInput.SetGeoVectorEvent += new CADability.Actions.ConstructAction.GeoVectorInput.SetGeoVectorDelegate(DimDirectionInput);
            dimDirInput.IsAngle            = true;

            dimMethod                 = new MultipleChoiceInput("Constr.Dimension.Points.Method", "Constr.Dimension.Points.Method.Values");
            dimMethod.Optional        = true;
            dimMethod.DefaultChoice   = ConstrDefaults.DefaultDimensionMethod;
            dimMethod.SetChoiceEvent += new CADability.Actions.ConstructAction.MultipleChoiceInput.SetChoiceDelegate(SetMethod);
            if (dimDir == DimDirection.Sloping)
            {
                base.SetInput(mi, dimLocationInput, dimDirInput, dimMethod);
            }
            else
            {
                base.SetInput(mi, dimLocationInput, dimMethod);
            }
            base.ShowAttributes = true;
            base.OnSetAction();
        }
Ejemplo n.º 20
0
        /// <summary>
        /// Overrides <see cref="CADability.Actions.ConstructAction.OnSetAction ()"/>
        /// </summary>
        public override void OnSetAction()
        {
            base.ActiveObject = Face.Construct();
            DefaultLength l = new DefaultLength(ConstructAction.DefaultLength.StartValue.ViewWidth8);

            if (vector.IsNullVector())
            {
                vector = l * base.ActiveDrawingPlane.Normal;
            }
            if (height == 0.0)
            {
                height = l;
            }
            ;
            //           if (!VectorOrHeight)
            if (extrudeMode < 2)
            {
                vector = height * base.ActiveDrawingPlane.Normal;
            }
            base.TitleId = "Constr.Solid.FaceExtrude";

            geoObjectInput = new GeoObjectInput("Constr.Solid.FaceExtrude.Path");
            geoObjectInput.MouseOverGeoObjectsEvent       += new GeoObjectInput.MouseOverGeoObjectsDelegate(geoObjectInputFace);
            geoObjectInput.GeoObjectSelectionChangedEvent += new GeoObjectInput.GeoObjectSelectionChangedDelegate(geoObjectInputFaceChanged);
            if (selectedMode)
            {
                geoObjectInput.Fixed = true;               // schon fertig, da Werte reingekommen sind
            }
            //geoObjectInput.MultipleInput = true;
            //geoObjectInput.Optional = true;

            innerPointInput = new GeoPointInput("Constr.Solid.FaceExtrude.InnerPoint");
            innerPointInput.SetGeoPointEvent += new GeoPointInput.SetGeoPointDelegate(SetInnerPointInput);
            innerPointInput.MouseClickEvent  += new MouseClickDelegate(innerPointInputMouseClickEvent);
            innerPointInput.Optional          = true;

            heightInput = new LengthInput("Constr.Face.PathExtrude.Height");
            heightInput.SetLengthEvent       += new LengthInput.SetLengthDelegate(SetHeight);
            heightInput.GetLengthEvent       += new LengthInput.GetLengthDelegate(GetHeight);
            heightInput.CalculateLengthEvent += new LengthInput.CalculateLengthDelegate(CalculateHeight);
            heightInput.ForwardMouseInputTo   = geoObjectInput;

            planeInput = new BooleanInput("Constr.Face.PathExtrude.Plane", "Constr.Face.PathExtrude.Plane.Values", planeMode);
            planeInput.SetBooleanEvent += new BooleanInput.SetBooleanDelegate(SetPlaneMode);

            vectorInput = new GeoVectorInput("Constr.Face.PathExtrude.Vector", vector);
            vectorInput.SetGeoVectorEvent += new GeoVectorInput.SetGeoVectorDelegate(SetVector);
            vectorInput.GetGeoVectorEvent += new GeoVectorInput.GetGeoVectorDelegate(GetVector);
            //            vectorInput.DefaultGeoVector = ConstrDefaults.DefaultExtrudeDirection;
            vectorInput.ForwardMouseInputTo = geoObjectInput;

            heightOffsetInput = new LengthInput("Constr.Face.PathExtrude.HeightOffset");
            heightOffsetInput.SetLengthEvent     += new LengthInput.SetLengthDelegate(SetHeightOffset);
            heightOffsetInput.GetLengthEvent     += new LengthInput.GetLengthDelegate(GetHeightOffset);
            heightOffsetInput.ForwardMouseInputTo = geoObjectInput;
            heightOffsetInput.Optional            = true;

            vectorOffsetInput = new GeoVectorInput("Constr.Face.PathExtrude.VectorOffset", vectorOffset);
            vectorOffsetInput.SetGeoVectorEvent  += new GeoVectorInput.SetGeoVectorDelegate(SetVectorOffset);
            vectorOffsetInput.GetGeoVectorEvent  += new GeoVectorInput.GetGeoVectorDelegate(GetVectorOffset);
            vectorOffsetInput.ForwardMouseInputTo = geoObjectInput;
            vectorOffsetInput.Optional            = true;

            pipeInput = new CurveInput("Constr.Face.PathExtrude.Pipe");
            pipeInput.MouseOverCurvesEvent       += new CurveInput.MouseOverCurvesDelegate(pipeInputCurves);
            pipeInput.CurveSelectionChangedEvent += new CurveInput.CurveSelectionChangedDelegate(pipeInputCurveChanged);

            optionalOrg();

            MultipleChoiceInput insertMode = new MultipleChoiceInput("Constr.Solid.SolidInsertMode", "Constr.Solid.SolidInsertMode.Values");

            insertMode.GetChoiceEvent += new MultipleChoiceInput.GetChoiceDelegate(GetInsertMode);
            insertMode.SetChoiceEvent += new CADability.Actions.ConstructAction.MultipleChoiceInput.SetChoiceDelegate(SetInsertMode);

            SeparatorInput separatorHeight = new SeparatorInput("Constr.Face.PathExtrude.SeparatorHeight");
            SeparatorInput separatorVector = new SeparatorInput("Constr.Face.PathExtrude.SeparatorVector");
            SeparatorInput separatorPipe   = new SeparatorInput("Constr.Face.PathExtrude.SeparatorPipe");
            SeparatorInput separatorInsert = new SeparatorInput("Constr.Face.PathExtrude.SeparatorInsert");


            base.SetInput(geoObjectInput, innerPointInput, separatorHeight, heightInput, heightOffsetInput, planeInput, separatorVector, vectorInput, vectorOffsetInput, separatorPipe, pipeInput, separatorInsert, insertMode);
            base.ShowAttributes   = true;
            base.ShowActiveObject = false;
            base.OnSetAction();
            if (selectedMode)
            {
                extrudeOrg();               //schonmal berechnen und markieren!
            }
        }
Ejemplo n.º 21
0
        public override void OnSetAction()
        {
            box            = Solid.Construct();
            base.BasePoint = ConstrDefaults.DefaultStartPoint;
            boxLengthX     = ConstrDefaults.DefaultRectWidth;
            boxLengthY     = ConstrDefaults.DefaultRectHeight;
            boxLengthZ     = ConstrDefaults.DefaultBoxHeight;
            boxDirX        = boxLengthX * base.ActiveDrawingPlane.DirectionX;
            boxDirY        = boxLengthY * base.ActiveDrawingPlane.DirectionY;
            boxDirZ        = boxLengthZ * (base.ActiveDrawingPlane.DirectionX ^ base.ActiveDrawingPlane.DirectionY);
            box            = Make3D.MakeBox(ConstrDefaults.DefaultStartPoint, boxDirX, boxDirY, boxDirZ);

            base.ActiveObject = box;
            base.TitleId      = "Constr.Box";

            GeoPointInput startPointInput = new GeoPointInput("Constr.Box.StartPoint");

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

            length = new LengthInput("Constr.Box.Length");
            length.DefaultLength         = ConstrDefaults.DefaultRectWidth;
            length.SetLengthEvent       += new ConstructAction.LengthInput.SetLengthDelegate(Length);
            length.GetLengthEvent       += new LengthInput.GetLengthDelegate(GetLength);
            length.CalculateLengthEvent += new CADability.Actions.ConstructAction.LengthInput.CalculateLengthDelegate(LengthCalculate);
            length.ForwardMouseInputTo   = startPointInput;

            width = new LengthInput("Constr.Box.Width");
            width.DefaultLength         = ConstrDefaults.DefaultRectHeight;
            width.SetLengthEvent       += new ConstructAction.LengthInput.SetLengthDelegate(Width);
            width.GetLengthEvent       += new LengthInput.GetLengthDelegate(GetWidth);
            width.CalculateLengthEvent += new CADability.Actions.ConstructAction.LengthInput.CalculateLengthDelegate(WidthCalculate);
            width.ForwardMouseInputTo   = startPointInput;

            height = new LengthInput("Constr.Box.Height");
            height.DefaultLength         = ConstrDefaults.DefaultBoxHeight;
            height.SetLengthEvent       += new ConstructAction.LengthInput.SetLengthDelegate(Height);
            height.GetLengthEvent       += new LengthInput.GetLengthDelegate(GetHeight);
            height.CalculateLengthEvent += new CADability.Actions.ConstructAction.LengthInput.CalculateLengthDelegate(HeightCalculate);
            height.ForwardMouseInputTo   = startPointInput;


            xVectorInput = new GeoVectorInput("Constr.Box.X-Direction");
            xVectorInput.SetGeoVectorEvent  += new ConstructAction.GeoVectorInput.SetGeoVectorDelegate(XVector);
            xVectorInput.GetGeoVectorEvent  += new GeoVectorInput.GetGeoVectorDelegate(GetXVector);
            xVectorInput.ForwardMouseInputTo = startPointInput;
            xVectorInput.Optional            = true;

            yVectorInput = new GeoVectorInput("Constr.Box.Y-Direction");
            yVectorInput.SetGeoVectorEvent  += new ConstructAction.GeoVectorInput.SetGeoVectorDelegate(YVector);
            yVectorInput.GetGeoVectorEvent  += new GeoVectorInput.GetGeoVectorDelegate(GetYVector);
            yVectorInput.ForwardMouseInputTo = startPointInput;
            yVectorInput.Optional            = true;

            zVectorInput = new GeoVectorInput("Constr.Box.Z-Direction");
            zVectorInput.SetGeoVectorEvent  += new ConstructAction.GeoVectorInput.SetGeoVectorDelegate(ZVector);
            zVectorInput.GetGeoVectorEvent  += new GeoVectorInput.GetGeoVectorDelegate(GetZVector);
            zVectorInput.ForwardMouseInputTo = startPointInput;
            zVectorInput.Optional            = true;

            SeparatorInput separatorLengths    = new SeparatorInput("Constr.Box.SeparatorLengths");
            SeparatorInput separatorDirections = new SeparatorInput("Constr.Box.SeparatorDirections");


            base.SetInput(startPointInput, separatorLengths, length, width, height, separatorDirections, xVectorInput, yVectorInput, zVectorInput);
            base.ShowAttributes = true;

            base.OnSetAction();
        }
Ejemplo n.º 22
0
        /// <summary>
        /// Overrides ConstructAction.OnSetAction. Provides the input fields and some initialsation
        /// </summary>
        public override void OnSetAction()
        {
            base.TitleId         = "Constr.Picture";
            widthValue           = 1; // default value
            heightValue          = 1; // default value
            keepAspectRatioValue = true;
            rectangularValue     = true;

            // Create and initialize the filename input field
            fileNameInput = new StringInput("Picture.Object"); // Resource ID must be defined in StringTable
            fileNameInput.IsFileNameInput = true;              // to enable the openfile dialog
            fileNameInput.InitOpenFile    = true;
            fileNameInput.FileNameFilter  = StringTable.GetString("Picture.Open.Filter");
            // you may also wnat to set fileNameInput.FileNameFilter
            fileNameInput.GetStringEvent += new StringInput.GetStringDelegate(OnGetFileName);
            fileNameInput.SetStringEvent += new StringInput.SetStringDelegate(OnSetFileName);
            fileName = ""; // initial filename is empty

            // Create and initialize the position input field
            positionInput = new GeoPointInput("Picture.Location"); // Resource ID must be defined in StringTable
            positionInput.GetGeoPointEvent   += new GeoPointInput.GetGeoPointDelegate(OnGetPosition);
            positionInput.SetGeoPointExEvent += new GeoPointInput.SetGeoPointExDelegate(OnSetPosition);
            positionInput.DefinesBasePoint    = true;

            // Create and initialize the scaling factor input field
            scalingFactorInput = new DoubleInput("Picture.Scale"); // Resource ID must be defined in StringTable
            scalingFactorInput.GetDoubleEvent       += new DoubleInput.GetDoubleDelegate(OnGetScalingFactor);
            scalingFactorInput.SetDoubleEvent       += new DoubleInput.SetDoubleDelegate(OnSetScalingFactor);
            scalingFactorInput.CalculateDoubleEvent += new DoubleInput.CalculateDoubleDelegate(CalculateScalingFactorEvent);
            // scalingFactorInput.Optional = true; // optinal input
            // scalingFactorInput.ForwardMouseInputTo = positionInput; // no mouse input, forward to position input
            scalingFactor = 1.0; // default scaling factor


            width = new LengthInput("Picture.Width");
            width.GetLengthEvent     += new ConstructAction.LengthInput.GetLengthDelegate(OnGetWidth);
            width.SetLengthEvent     += new ConstructAction.LengthInput.SetLengthDelegate(OnSetWidth);
            width.Optional            = true;          // optinal input
            width.ForwardMouseInputTo = positionInput; // no mouse input, forward to position input


            height = new LengthInput("Picture.Height");
            height.GetLengthEvent     += new LengthInput.GetLengthDelegate(OnGetHeight);
            height.SetLengthEvent     += new LengthInput.SetLengthDelegate(OnSetHeight);
            height.Optional            = true;          // optinal input
            height.ForwardMouseInputTo = positionInput; // no mouse input, forward to position input

            GeoVectorInput dirWidth = new GeoVectorInput("Picture.DirWidth");

            dirWidth.GetGeoVectorEvent += new GeoVectorInput.GetGeoVectorDelegate(OnGetDirWidth);
            dirWidth.SetGeoVectorEvent += new GeoVectorInput.SetGeoVectorDelegate(OnSetDirWidth);
            dirWidth.Optional           = true;

            GeoVectorInput dirHeight = new GeoVectorInput("Picture.DirHeight");

            dirHeight.GetGeoVectorEvent += new GeoVectorInput.GetGeoVectorDelegate(OnGetDirHeight);
            dirHeight.SetGeoVectorEvent += new GeoVectorInput.SetGeoVectorDelegate(OnSetDirHeight);
            dirHeight.Optional           = true;

            BooleanInput keepAspectRatio = new BooleanInput("Picture.KeepAspectRatio", "YesNo.Values", keepAspectRatioValue);

            keepAspectRatio.SetBooleanEvent += new ConstructAction.BooleanInput.SetBooleanDelegate(OnKeepAspectRatioChanged);

            BooleanInput rectangular = new BooleanInput("Picture.Rectangular", "YesNo.Values", rectangularValue);

            rectangular.SetBooleanEvent += new ConstructAction.BooleanInput.SetBooleanDelegate(OnRectangularChanged);

            // picture must exist prior to SetInput
            // because picture.Location is required by positionInput
            picture = Picture.Construct();

            // Define the input fields for the ConstructAction
            base.SetInput(fileNameInput, positionInput, scalingFactorInput, width, height, dirWidth, dirHeight, keepAspectRatio, rectangular);
            base.OnSetAction(); // Default implementation must be called

            // force the snapmode to include SnapToFaceSurface
            base.Frame.SnapMode |= SnapPointFinder.SnapModes.SnapToFaceSurface;
        }
Ejemplo n.º 23
0
        public override void OnSetAction()
        {
            Boolean useRadius = Frame.GetBooleanSetting("Formatting.Radius", true);

            arc = Ellipse.Construct();
            double dir;

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

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

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

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

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

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


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

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

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

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

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


            base.ShowAttributes = true;
            base.OnSetAction();
        }
Ejemplo n.º 24
0
        public override void OnSetAction()
        {
            base.ActiveObject = Face.Construct();
            if (axisVector.IsNullVector())
            {
                axisVector = GeoVector.YAxis;
            }
            if (angleRotation == 0.0)
            {
                angleRotation = Math.PI;
            }

            base.TitleId = "Constr.Solid.FaceRotate";

            geoObjectInput = new GeoObjectInput("Constr.Solid.FaceRotate.Path");
            geoObjectInput.MouseOverGeoObjectsEvent       += new GeoObjectInput.MouseOverGeoObjectsDelegate(geoObjectInputFace);
            geoObjectInput.GeoObjectSelectionChangedEvent += new GeoObjectInput.GeoObjectSelectionChangedDelegate(geoObjectInputFaceChanged);
            if (selectedMode)
            {
                geoObjectInput.Fixed = true;
            }

            innerPointInput = new GeoPointInput("Constr.Solid.FaceRotate.InnerPoint");
            innerPointInput.SetGeoPointEvent += new GeoPointInput.SetGeoPointDelegate(SetInnerPointInput);
            innerPointInput.MouseClickEvent  += new MouseClickDelegate(innerPointInputMouseClickEvent);
            innerPointInput.Optional          = true;


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

            axisPointInput = new GeoPointInput("Constr.Face.PathRotate.AxisPoint", axisPoint);
            axisPointInput.SetGeoPointEvent   += new GeoPointInput.SetGeoPointDelegate(SetAxisPoint);
            axisPointInput.GetGeoPointEvent   += new GeoPointInput.GetGeoPointDelegate(GetAxisPoint);
            axisPointInput.ForwardMouseInputTo = geoObjectInput;
            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 = geoObjectInput;
            updateOptional();

            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;

            MultipleChoiceInput insertMode = new MultipleChoiceInput("Constr.Solid.SolidInsertMode", "Constr.Solid.SolidInsertMode.Values");

            insertMode.GetChoiceEvent += new MultipleChoiceInput.GetChoiceDelegate(GetInsertMode);
            insertMode.SetChoiceEvent += new CADability.Actions.ConstructAction.MultipleChoiceInput.SetChoiceDelegate(SetInsertMode);

            base.SetInput(geoObjectInput, innerPointInput, rotateLineInput, axisPointInput, axisVectorInput, angleInput, angleOffsetInput, insertMode);
            base.ShowAttributes   = true;
            base.ShowActiveObject = false;
            base.OnSetAction();
            if (selectedMode)
            {
                rotateOrg(false); // zum Zeichnen und organisieren
            }
        }
        /// <summary>
        /// Overrides ConstructAction.OnSetAction. Provides the input fields and some initialsation
        /// </summary>
        public override void OnSetAction()
        {
            base.TitleId         = "Constr.Picture.RefPointWidthHeight";
            widthValue           = 1; // default value
            heightValue          = 1; // default value
            keepAspectRatioValue = true;
            rectangularValue     = true;
            isOnPlane            = false;

            // Create and initialize the filename input field
            fileNameInput = new StringInput("Picture.Object"); // Resource ID must be defined in StringTable
            fileNameInput.IsFileNameInput = true;              // to enable the openfile dialog
            fileNameInput.InitOpenFile    = true;
            fileNameInput.FileNameFilter  = StringTable.GetString("Picture.Open.Filter");
            // you may also wnat to set fileNameInput.FileNameFilter
            fileNameInput.GetStringEvent += new StringInput.GetStringDelegate(OnGetFileName);
            fileNameInput.SetStringEvent += new StringInput.SetStringDelegate(OnSetFileName);
            fileName = ""; // initial filename is empty

            // Create and initialize the position input field
            positionInput = new GeoPointInput("Picture.Location"); // Resource ID must be defined in StringTable
            positionInput.GetGeoPointEvent   += new GeoPointInput.GetGeoPointDelegate(OnGetPosition);
            positionInput.SetGeoPointExEvent += new GeoPointInput.SetGeoPointExDelegate(OnSetPosition);
            positionInput.DefinesBasePoint    = true;

            width = new LengthInput("Picture.Width");
            width.GetLengthEvent += new ConstructAction.LengthInput.GetLengthDelegate(OnGetWidth);
            width.SetLengthEvent += new ConstructAction.LengthInput.SetLengthDelegate(OnSetWidth);
            //width.Optional = true; // optinal input
            //width.ReadOnly = true;
            // width.ForwardMouseInputTo = positionInput; // no mouse input, forward to position input


            height = new LengthInput("Picture.Height");
            height.GetLengthEvent += new LengthInput.GetLengthDelegate(OnGetHeight);
            height.Optional        = true; // optinal input
            //height.ReadOnly = true;
            height.SetLengthEvent       += new LengthInput.SetLengthDelegate(OnSetHeight);
            height.CalculateLengthEvent += new LengthInput.CalculateLengthDelegate(height_CalculateLengthEvent);
            // height.ForwardMouseInputTo = positionInput; // no mouse input, forward to position input

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

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



            BooleanInput keepAspectRatio = new BooleanInput("Picture.KeepAspectRatio", "YesNo.Values", keepAspectRatioValue);

            keepAspectRatio.SetBooleanEvent += new ConstructAction.BooleanInput.SetBooleanDelegate(OnKeepAspectRatioChanged);

            BooleanInput rectangular = new BooleanInput("Picture.Rectangular", "YesNo.Values", rectangularValue);

            rectangular.SetBooleanEvent += new ConstructAction.BooleanInput.SetBooleanDelegate(OnRectangularChanged);



            // picture must exist prior to SetInput
            // because picture.Location is required by positionInput
            picture = Picture.Construct();

            // Define the input fields for the ConstructAction
            base.SetInput(fileNameInput, positionInput, width, height, dir, keepAspectRatio, rectangular);
            base.OnSetAction(); // Default implementation must be called

            // force the snapmode to include SnapToFaceSurface
            // base.Frame.SnapMode |= SnapPointFinder.SnapModes.SnapToFaceSurface;
        }