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); }
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); }
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(); }
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(); }
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); }
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; } } }
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; } }
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; }
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(); }
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); }
// 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(); }
/// <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(); }
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); }
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); }
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)); }
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); }
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(); }
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); }
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); }
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(); } }
private void inputPerpCurvesChanged(CurveInput sender, ICurve SelectedCurve) { perpCurves = new ICurve[] { SelectedCurve }; if (inputStartPoint.Fixed) { showLine(); } }
private void OnCurveSelectionChanged(CurveInput sender, ICurve SelectedCurve) { iCurve = SelectedCurve; if (inputThroughPoint.Fixed) { showLine(); } }
private void input3TangCurvesChanged(CurveInput sender, ICurve SelectedCurve) { tang3Curves = new ICurve[] { SelectedCurve }; if (curve1Input.Fixed & curve2Input.Fixed) { showLine(); } }
private void input2DimCurvesChanged(CurveInput sender, ICurve SelectedCurve) { dim2Curve = SelectedCurve; if (curveInput.Fixed) { showDim(); } }
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); }