Beispiel #1
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();
        }
Beispiel #2
0
        public override void OnSetAction()
        {
            // The title appears in the control center
            base.TitleId = "Constr.SplitCurve";

            CurveInput curveInput = null;

            if (theCurve == null)
            {
                curveInput = new CurveInput("Constr.SplitCurve.Curve");
                curveInput.MouseOverCurvesEvent += new CurveInput.MouseOverCurvesDelegate(OnMouseOverCurves);
            }

            IntInput numberInput = new IntInput("Constr.SplitCurve.Count");

            numberInput.SetIntEvent += new IntInput.SetIntDelegate(OnSetNumber);
            numberInput.SetMinMax(2, 100, false);
            numberInput.GetIntEvent += new IntInput.GetIntDelegate(OnGetNumber);

            MultipleChoiceInput modeInput = new MultipleChoiceInput("Constr.SplitCurve.Mode", "Constr.SplitCurve.Mode.Values");

            // |prozentual|Längen
            modeInput.SetChoiceEvent += new MultipleChoiceInput.SetChoiceDelegate(OnSetMode);

            distances = new InputContainer("Constr.SplitCurve.Distances");
            RefreshDistances();

            if (theCurve == null)
            {
                base.SetInput(curveInput, numberInput, modeInput, distances);
            }
            else
            {
                base.SetInput(numberInput, modeInput, distances);
            }
            base.OnSetAction();
            Recalc();
        }
Beispiel #3
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();
        }