Esempio n. 1
0
 private bool ratioCurve(CurveInput sender, ICurve[] Curves, bool up)
 {
     objectPoint1 = base.CurrentMousePosition;
     if (up)
     {
         if (Curves.Length == 0)
         {
             sender.SetCurves(Curves, null);                     // ...die werden jetzt im ControlCenter dargestellt (nur bei up)
         }
         else
         {
             sender.SetCurves(Curves, Curves[0]);
         }
     }
     if (Curves.Length > 0)
     {
         ratioCurveSel = Curves[0];
         Recalc();
         return(true);
     }
     using (Frame.Project.Undo.ContextFrame(this))
     {
         if (geoPointProperty != null)
         {
             geoPointProperty.SetGeoPoint(cancelPoint);
         }
     }
     actualPoint     = cancelPoint;
     gPoint.Location = objectPoint1;
     return(false);
 }
Esempio n. 2
0
        private bool inputPerpCurves(CurveInput sender, ICurve[] Curves, bool up)
        {
            objectPoint = base.CurrentMousePosition;
            selected    = 0;
            perpCurves  = Curves; // lokale Liste, damit showline immer die Daten hat
            bool s = false;

            if (inputStartPoint.Fixed)
            {
                s = (showLine());
            }
            else
            if (perpCurves.Length > 0)
            {
                s = true;
            }
            if (up)
            {
                if (perpCurves.Length == 0)
                {
                    sender.SetCurves(perpCurves, null);                         // ...die werden jetzt im ControlCenter dargestellt (nur bei up)
                }
                else
                {
                    sender.SetCurves(perpCurves, Curves[selected]);
                }
            }
            if (s)
            {
                return(true);
            }
            return(false);
        }
Esempio n. 3
0
        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.ThreeTangents";

            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);
            curve3Input                             = new CurveInput("Constr.Arc.Tangent.Object3");
            curve3Input.Decomposed                  = true; // nur Einzelelemente, auch bei Polyline und Pfad
            curve3Input.MouseOverCurvesEvent       += new CADability.Actions.ConstructAction.CurveInput.MouseOverCurvesDelegate(input3TangCurves);
            curve3Input.CurveSelectionChangedEvent += new CADability.Actions.ConstructAction.CurveInput.CurveSelectionChangedDelegate(input3TangCurvesChanged);
            LengthInput radCirc = new LengthInput("Constr.Arc.Radius");

            radCirc.ReadOnly        = true;
            radCirc.Optional        = true;
            radCirc.GetLengthEvent += new ConstructAction.LengthInput.GetLengthDelegate(CircRadius);
            base.SetInput(curve1Input, curve2Input, curve3Input, radCirc);
            base.ShowAttributes = true;
            base.OnSetAction();
        }
Esempio n. 4
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();
        }
Esempio n. 5
0
 private bool CutOffObject(CurveInput sender, ICurve[] Curves, bool up)
 {   // ... nur die sinnvolen Kurven verwenden
     objectPoint = base.CurrentMousePosition;
     if (up)
     {
         if (Curves.Length == 0)
         {
             sender.SetCurves(Curves, null);                     // ...die werden jetzt im ControlCenter dargestellt (nur bei up)
         }
         else
         {
             sender.SetCurves(Curves, Curves[0]);
         }
     }
     if (Curves.Length > 0)
     {
         iCurveSel = Curves[0];
         if (showCutOffOrg())
         {
             return(true);
         }
     }
     base.ActiveObject = null;
     base.FeedBack.ClearSelected();
     return(false);
 }
Esempio n. 6
0
        private void input2DimCurvesChanged(CurveInput sender, ICurve SelectedCurve)
        {
            Plane pl;

            line2 = SelectedCurve as Line;
            if (Curves.GetCommonPlane(line1, line2, out pl))
            {   // Schnittpunkt der Linien
                GeoPoint2D dimC2D;
                if (Geometry.IntersectLL(pl.Project(line1.StartPoint), pl.Project(line1.EndPoint), pl.Project(line2.StartPoint), pl.Project(line2.EndPoint), out dimC2D))
                {
                    GeoPoint dimC = pl.ToGlobal(dimC2D);
                    dim.SetPoint(0, dimC);
                    // wegen der Optik: Hilfslinien konstruieren
                    Line lineT = Line.Construct();
                    //					lineT.SetTwoPoints(dimC,line1.StartPoint);
                    lineT.SetTwoPoints(dimC, line1.PointAt(line1.PositionOf(objectPoint1)));
                    // wegen der Optik: Hilfspunkt nahe Mittelpunkt konstruieren
                    dim.SetPoint(1, lineT.PointAt(0.01));
                    //					lineT.SetTwoPoints(dimC,line2.StartPoint);
                    lineT.SetTwoPoints(dimC, line2.PointAt(line2.PositionOf(objectPoint2)));
                    dim.SetPoint(2, lineT.PointAt(0.01));
                    dim.DimLineRef        = base.CurrentMousePosition;
                    base.ShowActiveObject = true;
                }
            }
        }
Esempio n. 7
0
 private void inputDimCurvesChanged(CurveInput sender, ICurve SelectedCurve)
 {
     if (SelectedCurve is Ellipse)
     {
         elli = SelectedCurve as Ellipse;
         dim.SetPoint(0, elli.Center); // der Mittelpunkt der Winkelbemassung
         if (elli.CounterClockWise)
         {                             // die Winkelpunkte
             dim.SetPoint(1, elli.StartPoint);
             dim.SetPoint(2, elli.EndPoint);
         }
         else
         {
             dim.SetPoint(2, elli.StartPoint);
             dim.SetPoint(1, elli.EndPoint);
         }
         //				dim.DimLineRef = base.CurrentMousePosition;
         base.ShowActiveObject = true;
         // die anderen Inputs abschalten
         curve2Input.Fixed         = true;
         curve2Input.ReadOnly      = true;
         dimLocationInput.ReadOnly = true;
     }
     else
     {   // merken in line1 und raus
         line1 = SelectedCurve as Line;
     }
 }
Esempio n. 8
0
        public override void OnSetAction()
        {
            base.ActiveObject = null;
            base.TitleId      = "ToolsExpand";
            CurveInput curveInput = new CurveInput("ToolsExpand.Object");

            curveInput.HitCursor                   = CursorTable.GetCursor("Expand.cur");
            curveInput.MouseOverCurvesEvent       += new CurveInput.MouseOverCurvesDelegate(ExpandObject);
            curveInput.CurveSelectionChangedEvent += new CurveInput.CurveSelectionChangedDelegate(ExpandObjectChanged);
            curveInput.ModifiableOnly              = true;
            expandSourceObject                             = new CurveInput("ToolsExpand.SourceObject");
            expandSourceObject.Optional                    = true;
            expandSourceObject.Decomposed                  = true;
            expandSourceObject.MouseOverCurvesEvent       += new CurveInput.MouseOverCurvesDelegate(ExpandSourceObject);
            expandSourceObject.CurveSelectionChangedEvent += new CurveInput.CurveSelectionChangedDelegate(ExpandSourceObjectChanged);
            distToCurve                 = new LengthInput("ToolsExpand.Distance");
            distToCurve.Optional        = true;
            distToCurve.SetLengthEvent += new LengthInput.SetLengthDelegate(setDistToCurve);
            distToCurve.DefaultLength   = ConstrDefaults.DefaultExpandDist;

            base.SetInput(curveInput, expandSourceObject, distToCurve);
            base.OnSetAction();
            if (sourceCurve != null)
            {
                expandSourceObject.SetCurves(new ICurve[] { sourceCurveSave }, sourceCurveSave);
            }
            base.ShowActiveObject = false;
        }
Esempio n. 9
0
 public override void OnSetAction()
 {
     base.ActiveObject = null;
     //			line = new Line();
     base.TitleId = "ToolsCutOffMultiple";
     iCurve1      = null;
     iCurve2      = null;
     cutOffLen    = ConstrDefaults.DefaultCutOffLength;
     cutOffAng    = ConstrDefaults.DefaultCutOffAngle;
     methodSelect = ConstrDefaults.DefaultCutOffMethod;
     cutOffObject = new CurveInput("ToolsCutOff.Object");
     cutOffObject.MouseOverCurvesEvent       += new CurveInput.MouseOverCurvesDelegate(CutOffObject);
     cutOffObject.CurveSelectionChangedEvent += new CurveInput.CurveSelectionChangedDelegate(CutOffObjectChanged);
     cutOffObject.HitCursor      = CursorTable.GetCursor("CutOff.cur");
     cutOffObject.ModifiableOnly = true;
     cutOffLength = new LengthInput("ToolsCutOff.Length");
     //			cutOffLength.Optional = true;
     cutOffLength.ForwardMouseInputTo = cutOffObject;
     cutOffLength.DefaultLength       = ConstrDefaults.DefaultCutOffLength;
     cutOffLength.SetLengthEvent     += new CADability.Actions.ConstructAction.LengthInput.SetLengthDelegate(CutOffLength);
     cutOffAngle = new AngleInput("ToolsCutOff.Angle");
     cutOffAngle.DefaultAngle = ConstrDefaults.DefaultCutOffAngle;
     //			cutOffAngle.Optional = true;
     cutOffAngle.ForwardMouseInputTo = cutOffObject;
     cutOffAngle.SetAngleEvent      += new CADability.Actions.ConstructAction.AngleInput.SetAngleDelegate(cutOffSetAngle);
     cutOffMethod = new MultipleChoiceInput("ToolsCutOff.Method", "ToolsCutOff.Method.Values");
     cutOffMethod.DefaultChoice       = ConstrDefaults.DefaultCutOffMethod;
     cutOffMethod.ForwardMouseInputTo = cutOffObject;
     cutOffMethod.SetChoiceEvent     += new CADability.Actions.ConstructAction.MultipleChoiceInput.SetChoiceDelegate(SetMethod);
     base.SetInput(cutOffObject, cutOffLength, cutOffAngle, cutOffMethod);
     base.ShowActiveObject = false;
     base.OnSetAction();
 }
Esempio n. 10
0
 private bool DistCurve(CurveInput sender, ICurve[] Curves, bool up)
 {
     if (up)
     {
         if (Curves.Length == 0)
         {
             sender.SetCurves(Curves, null);                     // ...die werden jetzt im ControlCenter dargestellt (nur bei up)
         }
         else
         {
             sender.SetCurves(Curves, Curves[0]);
         }
     }
     if (Curves.Length > 0)
     {
         using (Frame.Project.Undo.ContextFrame(this))
         {
             if (lengthProperty != null)
             {
                 lengthProperty.SetLength(Curves[0].Length);
             }
         }
         actualLength = Curves[0].Length;
         return(true);
     }
     using (Frame.Project.Undo.ContextFrame(this))
     {
         if (lengthProperty != null)
         {
             lengthProperty.SetLength(cancelLength);
         }
     }
     actualLength = 0;
     return(false);
 }
Esempio n. 11
0
        //		private double RoundRadiusCalc(GeoPoint MousePosition)
        //		{
        //			radiusPoint = MousePosition;
        //			if (roundObject.Fixed)	{ if (showRound()) return roundRadCalc; }
        //			return roundRad;
        //		}


        /// <summary>
        /// Overrides <see cref="CADability.Actions.ConstructAction.OnSetAction ()"/>
        /// </summary>
        public override void OnSetAction()
        {
            base.ActiveObject = null;
            arc          = Ellipse.Construct();
            base.TitleId = "ToolsRoundIn";
            roundRad     = ConstrDefaults.DefaultRoundRadius;
            //			roundRadCalc = roundRad;
            roundObject = new CurveInput("ToolsRoundIn.Object");
            roundObject.MouseOverCurvesEvent       += new CurveInput.MouseOverCurvesDelegate(RoundObject);
            roundObject.CurveSelectionChangedEvent += new CurveInput.CurveSelectionChangedDelegate(RoundObjectChanged);
            roundObject.HitCursor      = CursorTable.GetCursor("RoundIn.cur");
            roundObject.ModifiableOnly = true;
            roundObject2                             = new CurveInput("ToolsRoundIn.Object2");
            roundObject2.ReadOnly                    = true;
            roundObject2.Optional                    = true;
            roundObject2.MouseOverCurvesEvent       += new CurveInput.MouseOverCurvesDelegate(RoundObject2);
            roundObject2.CurveSelectionChangedEvent += new CurveInput.CurveSelectionChangedDelegate(RoundObjectChanged2);
            roundObject2.HitCursor                   = CursorTable.GetCursor("RoundIn.cur");
            roundObject2.ModifiableOnly              = true;
            roundRadius = new LengthInput("ToolsRoundIn.Radius");
            //			roundRadius.Optional = true;
            roundRadius.ForwardMouseInputTo = roundObject;
            roundRadius.DefaultLength       = ConstrDefaults.DefaultRoundRadius;
            //			roundRadius.OnCalculateLength +=new Condor.Actions.ConstructAction.LengthInput.CalculateLength(RoundRadiusCalc);
            roundRadius.SetLengthEvent += new CADability.Actions.ConstructAction.LengthInput.SetLengthDelegate(RoundRadius);
            base.SetInput(roundObject, roundObject2, roundRadius);
            base.ShowActiveObject = false;
            base.OnSetAction();
        }
Esempio n. 12
0
        /// <summary>
        /// Overrides <see cref="CADability.Actions.ConstructAction.OnSetAction ()"/>
        /// </summary>
        public override void OnSetAction()
        {
            base.TitleId = "Construct.IntersectPoint";

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

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

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

            GeoPointInput measureText = new GeoPointInput("MeasurePoint");

            measureText.GetGeoPointEvent += new CADability.Actions.ConstructAction.GeoPointInput.GetGeoPointDelegate(GetMeasureText);
            // geht nur mit readOnly, da sonst die Mausbewegung den angezeigten Wert überschreibt
            measureText.ReadOnly = true;
            if (measure)
            {
                base.SetInput(firstCurveInput, secondCurveInput, measureText);
            }
            else
            {
                base.SetInput(firstCurveInput, secondCurveInput);
            }
            base.OnSetAction();
        }
Esempio n. 13
0
        private bool inputTangCurves(CurveInput sender, ICurve[] Curves, bool up)
        {
            objectPoint    = base.CurrentMousePosition;
            base.BasePoint = objectPoint;
            selected       = 0;
            tangCurves     = Curves; // lokale Liste, damit showline immer die Daten hat
            bool s = false;

            s = (showLine());
            if (up)
            {
                if (tangCurves.Length == 0)
                {
                    sender.SetCurves(tangCurves, null);                         // ...die werden jetzt im ControlCenter dargestellt (nur bei up)
                }
                else
                {
                    sender.SetCurves(tangCurves, tangCurves[selected]);
                }
            }
            if (s)
            {
                return(true);
            }
            return(false);
        }
Esempio n. 14
0
        private bool OnMouseOverCurves(CurveInput sender, ICurve[] Curves, bool up)
        {       // ... nur die sinnvolen Kurven verwenden
            ArrayList usableCurves = new ArrayList();

            for (int i = 0; i < Curves.Length; ++i)
            {
                Line l = Curves[i] as Line;
                if (l != null)
                {
                    usableCurves.Add(Curves[i]);
                }
            }
            // ...hier wird der ursprüngliche Parameter überschrieben. Hat ja keine Auswirkung nach außen.
            Curves = (ICurve[])usableCurves.ToArray(typeof(ICurve));
            if (up)
            {
                if (Curves.Length == 0)
                {
                    sender.SetCurves(Curves, null);                     // ...die werden jetzt im ControlCenter dargestellt (nur bei up)
                }
                else
                {
                    sender.SetCurves(Curves, Curves[0]);
                }
                lengthInput.ForwardMouseInputTo = null;
            }
            if (Curves.Length > 0)
            {
                iCurve = Curves[0];
                return(showLine());
            }
            base.ShowActiveObject = false;
            return(false);
        }
Esempio n. 15
0
 private void inputDimCurvesChanged(CurveInput sender, ICurve SelectedCurve)
 {   // kommt nie dran, da nur eine Aktion in base.SetInput angemeldet! Funkioniert aber!
     elli = SelectedCurve as Ellipse;
     dim.SetPoint(0, elli.Center);
     dim.Radius     = elli.Radius;
     dim.DimLineRef = elli.Plane.ToGlobal(elli.Plane.Project(base.CurrentMousePosition));
 }
Esempio n. 16
0
        private bool BisectObject2(CurveInput sender, ICurve[] Curves, bool up)
        {
            objectPoint2 = base.CurrentMousePosition;
            if (up) // ...die werden jetzt im ControlCenter dargestellt (nur bei up)
            {
                if (Curves.Length == 0)
                {
                    sender.SetCurves(Curves, null);                     // ...die werden jetzt im ControlCenter dargestellt (nur bei up)
                }
                else
                {
                    sender.SetCurves(Curves, Curves[0]);
                }
            }

            if (Curves.Length > 0)
            {
                tangCurve2 = Curves[0];
                if (curveInput1.Fixed)
                {
                    if (tangCurve1 != tangCurve2)
                    {
                        return(showLine());
                    }
                }
                else
                {
                    return(true);
                }
            }
            return(false);
        }
Esempio n. 17
0
        public override void OnSetAction()
        {
            lineLength            = ConstrDefaults.DefaultLineLength;
            line                  = Line.Construct();
            base.ActiveObject     = line;
            base.ShowActiveObject = false;
            base.TitleId          = "Constr.Line.BisectAngle";
            line.Length           = ConstrDefaults.DefaultLineLength;

            curveInput1                             = new CurveInput("Constr.Line.Bisect.Object");
            curveInput1.Decomposed                  = true; // nur Einzelelemente, auch bei Polyline und Pfad
            curveInput1.MouseOverCurvesEvent       += new CurveInput.MouseOverCurvesDelegate(BisectObject1);
            curveInput1.CurveSelectionChangedEvent += new CurveInput.CurveSelectionChangedDelegate(BisectObject1Changed);
            curveInput2                             = new CurveInput("Constr.Line.Bisect.Object");
            curveInput2.Decomposed                  = true; // nur Einzelelemente, auch bei Polyline und Pfad
            curveInput2.MouseOverCurvesEvent       += new CurveInput.MouseOverCurvesDelegate(BisectObject2);
            curveInput2.CurveSelectionChangedEvent += new CurveInput.CurveSelectionChangedDelegate(BisectObject2Changed);
            lengthInput                             = new LengthInput("Line.Length");
            lengthInput.defaultLength               = ConstrDefaults.DefaultLineLength;
            lengthInput.SetLengthEvent             += new ConstructAction.LengthInput.SetLengthDelegate(OnSetLength);
            lengthInput.GetLengthEvent             += new ConstructAction.LengthInput.GetLengthDelegate(OnGetLength);
            lengthInput.ForwardMouseInputTo         = new object[] { curveInput1, curveInput2 };
            base.SetInput(curveInput1, curveInput2, lengthInput);
            base.ShowAttributes = true;
            base.OnSetAction();
        }
Esempio n. 18
0
 private bool DirCurve(CurveInput sender, ICurve[] Curves, bool up)
 {
     objectPoint = base.CurrentMousePosition;
     if (up)
     {
         if (Curves.Length == 0)
         {
             sender.SetCurves(Curves, null);                     // ...die werden jetzt im ControlCenter dargestellt (nur bei up)
         }
         else
         {
             sender.SetCurves(Curves, Curves[0]);
         }
     }
     if (Curves.Length > 0)
     {
         dirCurve = Curves[0];
         selectDir();
         return(true);
     }
     using (Frame.Project.Undo.ContextFrame(this))
     {
         if (vectorProperty != null)
         {
             vectorProperty.SetGeoVector(cancelVector);
         }
     }
     actualVector = cancelVector;
     return(false);
 }
Esempio n. 19
0
        private bool input1TangCurves(CurveInput sender, ICurve[] Curves, bool up)
        {
            object1Point = base.CurrentMousePosition;
            selected1    = 0;
            tang1Curves  = Curves; // lokale Liste, damit showline immer die Daten hat
            bool s = false;

            if (tang1Curves.Length > 0)
            {
                s = true; // es ist mind. ein Objekt gefunden
                if (curve2Input.Fixed || curve3Input.Fixed)
                {
                    s = showLine();
                }
            }
            if (up)
            {
                if (tang1Curves.Length == 0)
                {
                    sender.SetCurves(tang1Curves, null);                          // ...die werden jetzt im ControlCenter dargestellt (nur bei up)
                }
                else
                {
                    sender.SetCurves(tang1Curves, tang1Curves[selected1]);
                }
            }
            if (s)
            {
                return(true);
            }
            base.ShowActiveObject   = false;
            base.MultiSolutionCount = 0;
            //            base.MultiSolution = false;
            return(false);
        }
Esempio n. 20
0
 private bool ExpandObject2(CurveInput sender, ICurve[] Curves, bool up)
 {       // ... nur die sinnvolen Kurven verwenden
     objectPoint2 = base.CurrentMousePosition;
     if (up)
     {
         if (Curves.Length == 0)
         {
             sender.SetCurves(Curves, null);                     // ...die werden jetzt im ControlCenter dargestellt (nur bei up)
         }
         else
         {
             sender.SetCurves(Curves, Curves[0]);
         }
     }
     if (Curves.Length > 0)
     {
         iCurve2 = Curves[0];
         if (curve1Input.Fixed)
         {
             return(showObject());
         }
         else
         {
             return(true);
         }
     }
     else
     {
         iCurve2 = null;
     }
     base.FeedBack.ClearSelected();
     param1 = 0.0;
     param2 = 0.0;
     return(false);
 }
        private bool inputTangCurves(CurveInput sender, ICurve[] Curves, bool up)
        {
            objectPoint = base.CurrentMousePosition;
            selected    = 0;
            tangCurves  = Curves; // lokale Liste, damit showline immer die Daten hat
            bool s = false;

            if (!pointInput.Fixed)
            {
                s = (tangCurves.Length > 0);
            }
            else
            {
                s = (showLine());
            }
            if (up)
            {
                if (tangCurves.Length == 0)
                {
                    sender.SetCurves(tangCurves, null);                         // ...die werden jetzt im ControlCenter dargestellt (nur bei up)
                }
                else
                {
                    sender.SetCurves(tangCurves, tangCurves[selected]);
                }
            }
            if (s)
            {
                return(true);
            }
            //            base.MultiSolution = false;
            base.MultiSolutionCount = 0;
            base.ShowActiveObject   = false;
            return(false);
        }
        /// <summary>
        /// Overrides <see cref="CADability.Actions.ConstructAction.OnSetAction ()"/>
        /// </summary>
        public override void OnSetAction()
        {
            base.TitleId = "Construct.DistanceTwoCurves";
            feedBackLine = Line.Construct();
            Color backColor = base.Frame.GetColorSetting("Colors.Feedback", Color.DarkGray);

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

            curve1Input                             = new CurveInput("Construct.DistanceTwoCurves.Object1");
            curve1Input.Decomposed                  = true; // nur Einzelelemente, auch bei Polyline und Pfad
            curve1Input.MouseOverCurvesEvent       += new CADability.Actions.ConstructAction.CurveInput.MouseOverCurvesDelegate(DistCurve1);
            curve1Input.CurveSelectionChangedEvent += new CADability.Actions.ConstructAction.CurveInput.CurveSelectionChangedDelegate(DistCurve1Changed);

            curve2Input                             = new CurveInput("Construct.DistanceTwoCurves.Object2");
            curve2Input.Decomposed                  = true; // nur Einzelelemente, auch bei Polyline und Pfad
            curve2Input.MouseOverCurvesEvent       += new CADability.Actions.ConstructAction.CurveInput.MouseOverCurvesDelegate(DistCurve2);
            curve2Input.CurveSelectionChangedEvent += new CADability.Actions.ConstructAction.CurveInput.CurveSelectionChangedDelegate(DistCurve2Changed);

            LengthInput measureText = new LengthInput("MeasureLength");

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

            if (measure)
            {
                base.SetInput(curve1Input, curve2Input, measureText);
            }
            else
            {
                base.SetInput(curve1Input, curve2Input);
            }
            base.OnSetAction();
        }
 private void DistCurveChanged(CurveInput sender, ICurve SelectedCurve)
 {
     distCurve = SelectedCurve;
     if (pointInput.Fixed)
     {
         Recalc();
     }
 }
 private void DistCurve2Changed(CurveInput sender, ICurve SelectedCurve)
 {
     distCurve2 = SelectedCurve;
     if (curve1Input.Fixed)
     {
         Recalc();
     }
 }
 private void inputTangCurvesChanged(CurveInput sender, ICurve SelectedCurve)
 {
     tangCurves = new ICurve[] { SelectedCurve };
     if (pointInput.Fixed)
     {
         showLine();
     }
 }
Esempio n. 26
0
 private void inputPerpCurvesChanged(CurveInput sender, ICurve SelectedCurve)
 {
     perpCurves = new ICurve[] { SelectedCurve };
     if (inputStartPoint.Fixed)
     {
         showLine();
     }
 }
Esempio n. 27
0
 private void OnCurveSelectionChanged(CurveInput sender, ICurve SelectedCurve)
 {
     iCurve = SelectedCurve;
     if (inputThroughPoint.Fixed)
     {
         showLine();
     }
 }
Esempio n. 28
0
 private void input3TangCurvesChanged(CurveInput sender, ICurve SelectedCurve)
 {
     tang3Curves = new ICurve[] { SelectedCurve };
     if (curve1Input.Fixed & curve2Input.Fixed)
     {
         showLine();
     }
 }
Esempio n. 29
0
 private void input2DimCurvesChanged(CurveInput sender, ICurve SelectedCurve)
 {
     dim2Curve = SelectedCurve;
     if (curveInput.Fixed)
     {
         showDim();
     }
 }
Esempio n. 30
0
        private bool inputDimCurves(CurveInput sender, ICurve[] Curves, bool up)
        {
            bool ok = false;

            if (Curves.Length > 0)
            {   // zunächst: Nur alle Kreise ausfiltern
                ArrayList usableCurves = new ArrayList();
                for (int i = 0; i < Curves.Length; ++i)
                {
                    if (Curves[i] is Ellipse)
                    {
                        if ((Curves[i] as Ellipse).IsCircle)
                        {
                            usableCurves.Add(Curves[i]); // zur lokalen Liste zufügen
                        }
                    }
                }
                Curves = (ICurve[])usableCurves.ToArray(typeof(ICurve)); // überschreibt die eigentliche Liste und wird unten an den Sender zurückgeliefert
                if (Curves.Length > 0)
                {
                    elli = Curves[0] as Ellipse;
                    dim.SetPoint(0, elli.Center);
                    dim.Radius            = elli.Radius;
                    dim.DimLineRef        = elli.Plane.ToGlobal(elli.Plane.Project(base.CurrentMousePosition));
                    base.ShowActiveObject = true;
                    ok = true;
                }
                else
                {
                    base.ShowActiveObject = false;
                }
            }

            /*
             *          else
             *          {	// es gibt einen Kreis und damit eine Bemassung, ausserhalb des Fanbereichs des CurveInput nur die Lage ändern
             *              if (elli != null)
             *              {
             *                  dim.DimLineRef = base.CurrentMousePosition;
             *                  ok = true;
             *              }
             *
             *          }
             */
            if (up)
            {
                if (Curves.Length == 0)
                {
                    sender.SetCurves(Curves, null);                     // ...die werden jetzt im ControlCenter dargestellt (nur bei up)
                }
                else
                {
                    sender.SetCurves(Curves, Curves[0]);
                }
            }
            return(ok);
        }