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() { circle = Ellipse.Construct(); circle.SetCirclePlaneCenterRadius(base.ActiveDrawingPlane, new GeoPoint(0.0, 0.0, 0.0), base.WorldViewSize / 20); base.ActiveObject = circle; base.TitleId = "Constr.Circle.3Points"; gPoint1 = ActionFeedBack.FeedbackPoint(base.Frame); gPoint2 = ActionFeedBack.FeedbackPoint(base.Frame); base.FeedBack.Add(gPoint1); base.FeedBack.Add(gPoint2); arcPoint1Input = new GeoPointInput("Constr.Circle.Point1"); arcPoint1Input.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(CirclePoint1); arcPoint2Input = new GeoPointInput("Constr.Circle.Point2"); arcPoint2Input.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(CirclePoint2); arcPoint3Input = new GeoPointInput("Constr.Circle.3Points.Point3"); arcPoint3Input.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(CirclePoint3); GeoPointInput arcCenterInput = new GeoPointInput("Constr.Circle.Center"); arcCenterInput.GetGeoPointEvent += new ConstructAction.GeoPointInput.GetGeoPointDelegate(CircleCenter); arcCenterInput.Optional = true; arcCenterInput.ReadOnly = true; LengthInput arcRadius = new LengthInput("Constr.Circle.Radius"); arcRadius.GetLengthEvent += new ConstructAction.LengthInput.GetLengthDelegate(CircleRadius); arcRadius.Optional = true; arcRadius.ReadOnly = true; base.SetInput(arcPoint1Input, arcPoint2Input, arcPoint3Input, arcCenterInput, arcRadius); base.ShowAttributes = true; base.OnSetAction(); }
/// <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(); }
public override void OnSetAction() { line = Polyline.Construct(); line.SetRectangle(ConstrDefaults.DefaultStartPoint, new GeoVector(ConstrDefaults.DefaultRectWidth, 0.0, 0.0), new GeoVector(0.0, ConstrDefaults.DefaultRectHeight, 0.0)); base.ActiveObject = line; base.TitleId = "Constr.Rect.Rect2PointsHeight"; startPointInput = new GeoPointInput("Rect.StartPoint"); startPointInput.DefaultGeoPoint = ConstrDefaults.DefaultStartPoint; startPointInput.DefinesBasePoint = true; startPointInput.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(StartPoint); secondPointInput = new GeoPointInput("Rect.SecondPoint"); secondPointInput.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(SecondPoint); height = new LengthInput("Rect.Height"); height.DefaultLength = ConstrDefaults.DefaultRectHeight; height.SetLengthEvent += new ConstructAction.LengthInput.SetLengthDelegate(Height); height.CalculateLengthEvent += new CADability.Actions.ConstructAction.LengthInput.CalculateLengthDelegate(HeightCalculate); height.ForwardMouseInputTo = new object[] { startPointInput, secondPointInput }; base.SetInput(startPointInput, secondPointInput, height); base.ShowAttributes = true; base.OnSetAction(); }
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(); }
public override void OnSetAction() { base.TitleId = "ConstructAequidist"; if (toShell == null) { //baseCurve = new CurveInput("ConstructAequidist.BaseCurve"); //baseCurve.MouseOverCurvesEvent += new CADability.Actions.ConstructAction.CurveInput.MouseOverCurvesDelegate(OnMouseOverCurves); //baseCurve.CurveSelectionChangedEvent += new CADability.Actions.ConstructAction.CurveInput.CurveSelectionChangedDelegate(OnCurveSelectionChanged); //baseCurve.HitCursor = CursorTable.GetCursor("RoundIn.cur"); //baseCurve.ModifiableOnly = false; //baseCurve.PreferPath = true; } distance1 = new LengthInput("ConstructAequidist.Distance1"); distance1.GetLengthEvent += new LengthInput.GetLengthDelegate(OnGetDistance1); distance1.SetLengthEvent += new LengthInput.SetLengthDelegate(OnSetDistance1); theDistance1 = 0.0; distance2 = new LengthInput("ConstructAequidist.Distance2"); distance2.GetLengthEvent += new LengthInput.GetLengthDelegate(OnGetDistance2); distance2.SetLengthEvent += new LengthInput.SetLengthDelegate(OnSetDistance2); distance2.DefaultLength = defaultDistance; theDistance2 = defaultDistance; SetInput(distance1, distance2); base.OnSetAction(); }
public override void OnSetAction() { base.TitleId = "Constr.Parametrics.DistanceTo"; FeedBack.AddSelected(frontSide); FeedBack.AddSelected(backSide); base.ActiveObject = shell.Clone(); if (shell.Layer != null) { shell.Layer.Transparency = 128; } distanceInput = new LengthInput("DistanceTo.Distance"); distanceInput.GetLengthEvent += DistanceInput_GetLengthEvent; distanceInput.SetLengthEvent += DistanceInput_SetLengthEvent; modeInput = new MultipleChoiceInput("DistanceTo.Mode", "DistanceTo.Mode.Values", 0); modeInput.SetChoiceEvent += ModeInput_SetChoiceEvent; //modeInput.GetChoiceEvent += ModeInput_GetChoiceEvent; SetInput(distanceInput, modeInput); base.OnSetAction(); FeedBack.SelectOutline = false; validResult = false; }
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() { circle = Ellipse.Construct(); circle.SetCirclePlaneCenterRadius(base.ActiveDrawingPlane, ConstrDefaults.DefaultArcCenter, ConstrDefaults.DefaultArcRadius); gPoint1 = ActionFeedBack.FeedbackPoint(base.Frame); base.FeedBack.Add(gPoint1); base.ActiveObject = circle; base.TitleId = "Constr.Circle.CenterPoint"; circCenter = new GeoPointInput("Constr.Circle.Center"); circCenter.DefaultGeoPoint = ConstrDefaults.DefaultArcCenter; circCenter.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(Center); circPointInput = new GeoPointInput("Constr.Circle.CenterPoint.Point"); circPointInput.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(CirclePoint); LengthInput len = new LengthInput("Constr.Circle.Radius"); len.GetLengthEvent += new ConstructAction.LengthInput.GetLengthDelegate(CircleRadius); len.DefaultLength = ConstrDefaults.DefaultArcRadius; len.Optional = true; len.ReadOnly = true; base.SetInput(circCenter, circPointInput, len); base.ShowAttributes = true; base.OnSetAction(); }
public override void OnSetAction() { base.TitleId = "Constr.Chamfer"; faceInput = new GeoObjectInput("Constr.Chamfer.Face"); faceInput.FacesOnly = true; faceInput.MultipleInput = false; faceInput.MouseOverGeoObjectsEvent += new GeoObjectInput.MouseOverGeoObjectsDelegate(OnMouseOverFace); edgesInput = new GeoObjectInput("Constr.Chamfer.Edges"); edgesInput.EdgesOnly = true; edgesInput.MultipleInput = true; edgesInput.MouseOverGeoObjectsEvent += new GeoObjectInput.MouseOverGeoObjectsDelegate(OnMouseOverEdges); edgesInput.Optional = true; // ein Face muss gegeben werden. Dann werden alle Kanten genommen // und man kann damit schon fertig machen. Wenn man einzelne kanten haben will, kann man immer noch // auf einzelne kanten klicken dist1Input = new LengthInput("Constr.Chamfer.Dist1"); dist1Input.SetLengthEvent += new LengthInput.SetLengthDelegate(OnSetDist1); dist1Input.GetLengthEvent += new LengthInput.GetLengthDelegate(OnGetDist1); dist1Input.DefaultLength = ConstrDefaults.DefaultCutOffLength; dist1Input.ForwardMouseInputTo = edgesInput; dist2Input = new LengthInput("Constr.Chamfer.Dist2"); dist2Input.SetLengthEvent += new LengthInput.SetLengthDelegate(OnSetDist2); dist2Input.GetLengthEvent += new LengthInput.GetLengthDelegate(OnGetDist2); base.SetInput(faceInput, edgesInput, dist1Input, dist2Input); base.OnSetAction(); firstClickClearsAll = false; }
public override void OnSetAction() { base.TitleId = "Constr.Fillet"; geoObjectInput = new GeoObjectInput("Constr.Fillet.Edges"); geoObjectInput.EdgesOnly = true; geoObjectInput.MultipleInput = true; geoObjectInput.MouseOverGeoObjectsEvent += new GeoObjectInput.MouseOverGeoObjectsDelegate(OnMouseOverEdges); // we would need a mass selection (rectangular selection) for GeoObjectInput faceInput = new GeoObjectInput("Constr.Fillet.Face"); faceInput.FacesOnly = true; faceInput.Optional = true; faceInput.MultipleInput = false; faceInput.MouseOverGeoObjectsEvent += new GeoObjectInput.MouseOverGeoObjectsDelegate(OnMouseOverFace); shellInput = new GeoObjectInput("Constr.Fillet.Shell"); shellInput.Optional = true; shellInput.MultipleInput = false; shellInput.MouseOverGeoObjectsEvent += new GeoObjectInput.MouseOverGeoObjectsDelegate(OnMouseOverShell); radiusInput = new LengthInput("Constr.Fillet.Radius"); radiusInput.SetLengthEvent += new LengthInput.SetLengthDelegate(OnSetRadius); radiusInput.GetLengthEvent += new LengthInput.GetLengthDelegate(OnGetRadius); radiusInput.DefaultLength = ConstrDefaults.DefaultRoundRadius; radiusInput.ForwardMouseInputTo = geoObjectInput; base.SetInput(geoObjectInput, faceInput, shellInput, radiusInput); base.OnSetAction(); }
// 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(); }
public override void OnSetAction() { base.TitleId = "Constr.Parametrics.Cylinder.Radius"; base.ActiveObject = shell.Clone(); if (useRadius) { radiusInput = new LengthInput("Parametrics.Cylinder.Radius"); radiusInput.GetLengthEvent += RadiusInput_GetLength; radiusInput.SetLengthEvent += RadiusInput_SetLength; radiusInput.Optional = diameter; base.SetInput(radiusInput); } else { diameterInput = new LengthInput("Parametrics.Cylinder.Diameter"); diameterInput.GetLengthEvent += DiameterInput_GetLength; diameterInput.SetLengthEvent += DiameterInput_SetLength; diameterInput.Optional = !diameter; base.SetInput(diameterInput); } base.OnSetAction(); validResult = 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(); }
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() { useRadius = Frame.GetBooleanSetting("Formatting.Radius", true); arc = Ellipse.Construct(); arcRad = ConstrDefaults.DefaultArcRadius; arc.SetArcPlaneCenterRadiusAngles(base.ActiveDrawingPlane, new GeoPoint(0.0, 0.0, 0.0), arcRad, 0.0, 1.5 * Math.PI); base.ActiveObject = arc; base.TitleId = "Constr.Arc.2PointsRadius"; arcPoint1Input = new GeoPointInput("Constr.Arc.Point1"); arcPoint1Input.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(ArcPoint1); arcPoint2Input = new GeoPointInput("Constr.Arc.Point2"); arcPoint2Input.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(ArcPoint2); len = new LengthInput("Constr.Arc.Radius"); len.DefaultLength = ConstrDefaults.DefaultArcRadius; len.SetLengthEvent += new ConstructAction.LengthInput.SetLengthDelegate(ArcRadius); len.GetLengthEvent += new CADability.Actions.ConstructAction.LengthInput.GetLengthDelegate(GetRadius); if (!useRadius) { len.Optional = true; } // hier wird der Radius extern berechnet und zurückgeliefert len.CalculateLengthEvent += new CADability.Actions.ConstructAction.LengthInput.CalculateLengthDelegate(RadiusFromPoint); len.ForwardMouseInputTo = new object[] { arcPoint1Input, arcPoint2Input }; diamInput = new LengthInput("Constr.Circle.Diameter"); diamInput.SetLengthEvent += new ConstructAction.LengthInput.SetLengthDelegate(SetCircleDiameter); diamInput.GetLengthEvent += new ConstructAction.LengthInput.GetLengthDelegate(GetCircleDiameter); diamInput.CalculateLengthEvent += new LengthInput.CalculateLengthDelegate(CalculateDiameter); if (useRadius) { diamInput.Optional = true; } diamInput.DefaultLength = ConstrDefaults.DefaultArcDiameter; diamInput.ForwardMouseInputTo = new object[] { arcPoint1Input, arcPoint2Input }; GeoPointInput arcCenter = new GeoPointInput("Constr.Arc.Center"); arcCenter.GetGeoPointEvent += new CADability.Actions.ConstructAction.GeoPointInput.GetGeoPointDelegate(ArcCenter); arcCenter.Optional = true; arcCenter.ReadOnly = true; if (useRadius) { base.SetInput(arcPoint1Input, arcPoint2Input, len, diamInput, arcCenter); } else { base.SetInput(arcPoint1Input, arcPoint2Input, diamInput, len, arcCenter); } base.ShowAttributes = true; base.OnSetAction(); }
/// <summary> /// Overrides OnSetAction of ConstructAction. Here we create the new line /// and define the input for the construction /// </summary> public override void OnSetAction() { // Create the line and set it some default properties, so that it will // appear on the screen line = Line.Construct(); line.StartPoint = ConstrDefaults.DefaultStartPoint; GeoPoint p = ConstrDefaults.DefaultStartPoint; p.x = p.x + ConstrDefaults.DefaultLineLength; line.EndPoint = p; // The line will be the active object during the construction. At the end // it will be added to the model. base.ActiveObject = line; // The title appears in the control center base.TitleId = "Constr.Line.PointLengthAngle"; // The first input is a point, which defines the startpoint of the line // There is a default value for the startpoint (DefaultStartPoint) which // is updated at the end of the construction GeoPointInput startPointInput = new GeoPointInput("Line.StartPoint"); startPointInput.DefaultGeoPoint = ConstrDefaults.DefaultStartPoint; // BasePoint is for ortho modus and direction input startPointInput.DefinesBasePoint = true; // registering a handler to react on the point input startPointInput.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(SetStartPoint); // the second input is a length. LengthInput len = new LengthInput("Line.Length"); // the default length len.DefaultLength = ConstrDefaults.DefaultLineLength; // registering a handler for the change of the length len.SetLengthEvent += new ConstructAction.LengthInput.SetLengthDelegate(SetLength); // during length-input the mouseinput goes to startPointInput, if it isn´t fixed len.ForwardMouseInputTo = startPointInput; // the third input is the direction GeoVectorInput dir = new GeoVectorInput("Line.Direction"); dir.DefaultGeoVector = ConstrDefaults.DefaultLineDirection; dir.SetGeoVectorEvent += new CADability.Actions.ConstructAction.GeoVectorInput.SetGeoVectorDelegate(SetGeoVector); dir.IsAngle = true; // during angle-input the mouseinput goes to startPointInput, if it isn´t fixed dir.ForwardMouseInputTo = startPointInput; // tell the ConstructAction which inputs there are base.SetInput(startPointInput, len, dir); // the new line gets the default attributes and shows them in the control center base.ShowAttributes = true; // be sure to call the default implementation base.OnSetAction(); }
public override void OnSetAction() { base.TitleId = "Constr.Parametrics.DistanceTo"; if (offsetFeedBack != null) { FeedBack.AddSelected(offsetFeedBack); } if (forwardFaces != null) { FeedBack.AddSelected(forwardFaces); } base.ActiveObject = shell.Clone(); if (shell.Layer != null) { shell.Layer.Transparency = 128; } List <InputObject> actionInputs = new List <InputObject>(); distance = point1 | point2; distanceInput = new LengthInput("DistanceTo.Distance"); distanceInput.GetLengthEvent += DistanceInput_GetLengthEvent; distanceInput.SetLengthEvent += DistanceInput_SetLengthEvent; actionInputs.Add(distanceInput); forwardFacesInput = new GeoObjectInput("DistanceTo.MoreForwardObjects"); forwardFacesInput.MultipleInput = true; forwardFacesInput.FacesOnly = true; forwardFacesInput.Optional = true; forwardFacesInput.MouseOverGeoObjectsEvent += new GeoObjectInput.MouseOverGeoObjectsDelegate(OnMouseOverForwardFaces); actionInputs.Add(forwardFacesInput); backwardFacesInput = new GeoObjectInput("DistanceTo.MoreBackwardObjects"); backwardFacesInput.MultipleInput = true; backwardFacesInput.FacesOnly = true; backwardFacesInput.Optional = true; backwardFacesInput.MouseOverGeoObjectsEvent += new GeoObjectInput.MouseOverGeoObjectsDelegate(OnMouseOverBackwardFaces); actionInputs.Add(backwardFacesInput); modeInput = new MultipleChoiceInput("DistanceTo.Mode", "DistanceTo.Mode.Values", 0); modeInput.SetChoiceEvent += ModeInput_SetChoiceEvent; actionInputs.Add(modeInput); //modeInput.GetChoiceEvent += ModeInput_GetChoiceEvent; SeparatorInput separator = new SeparatorInput("DistanceTo.AssociateParametric"); actionInputs.Add(separator); nameInput = new StringInput("DistanceTo.ParametricsName"); nameInput.SetStringEvent += NameInput_SetStringEvent; nameInput.GetStringEvent += NameInput_GetStringEvent; nameInput.Optional = true; actionInputs.Add(nameInput); SetInput(actionInputs.ToArray()); base.OnSetAction(); FeedBack.SelectOutline = false; validResult = false; }
public override void OnSetAction() { Boolean useRadius = Frame.GetBooleanSetting("Formatting.Radius", true); radiusPoint = new GeoPoint(0, 0); circ = Ellipse.Construct(); circRad = ConstrDefaults.DefaultArcRadius; circ.SetCirclePlaneCenterRadius(base.ActiveDrawingPlane, ConstrDefaults.DefaultArcCenter, ConstrDefaults.DefaultArcRadius); base.ActiveObject = circ; base.ShowActiveObject = false; base.TitleId = "Constr.Circle.TangentPointRadius"; curveInput = new CurveInput("Constr.Arc.Tangent.Object"); curveInput.Decomposed = true; // nur Einzelelemente, auch bei Polyline und Pfad curveInput.MouseOverCurvesEvent += new CADability.Actions.ConstructAction.CurveInput.MouseOverCurvesDelegate(inputTangCurves); curveInput.CurveSelectionChangedEvent += new CADability.Actions.ConstructAction.CurveInput.CurveSelectionChangedDelegate(inputTangCurvesChanged); pointInput = new GeoPointInput("Constr.Circle.Point"); pointInput.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(CirclePoint); radInput = new LengthInput("Constr.Arc.Radius"); radInput.DefaultLength = ConstrDefaults.DefaultArcRadius; radInput.CalculateLengthEvent += new CADability.Actions.ConstructAction.LengthInput.CalculateLengthDelegate(radInput_OnCalculateLength); radInput.SetLengthEvent += new ConstructAction.LengthInput.SetLengthDelegate(CircRadius); radInput.GetLengthEvent += new CADability.Actions.ConstructAction.LengthInput.GetLengthDelegate(GetRadius); radInput.ForwardMouseInputTo = new object[] { curveInput, pointInput }; if (!useRadius) { radInput.Optional = true; } diamInput = new LengthInput("Constr.Circle.Diameter"); diamInput.DefaultLength = ConstrDefaults.DefaultArcRadius; diamInput.CalculateLengthEvent += new CADability.Actions.ConstructAction.LengthInput.CalculateLengthDelegate(diamInput_OnCalculateLength); diamInput.SetLengthEvent += new ConstructAction.LengthInput.SetLengthDelegate(SetCircleDiameter); diamInput.GetLengthEvent += new CADability.Actions.ConstructAction.LengthInput.GetLengthDelegate(GetCircleDiameter); diamInput.ForwardMouseInputTo = new object[] { curveInput, pointInput }; if (useRadius) { diamInput.Optional = true; } if (useRadius) { base.SetInput(curveInput, pointInput, radInput, diamInput); } else { base.SetInput(curveInput, pointInput, diamInput, radInput); } base.ShowAttributes = true; base.OnSetAction(); }
public override void OnSetAction() { 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(); }
public override void OnSetAction() { Boolean useRadius = Frame.GetBooleanSetting("Formatting.Radius", true); circle = Ellipse.Construct(); circle.SetCirclePlaneCenterRadius(base.ActiveDrawingPlane, ConstrDefaults.DefaultArcCenter, ConstrDefaults.DefaultArcRadius); gPoint1 = ActionFeedBack.FeedbackPoint(base.Frame); base.FeedBack.Add(gPoint1); base.ActiveObject = circle; base.TitleId = "Constr.Circle.CenterRadius"; circCenter = new GeoPointInput("Constr.Circle.Center"); circCenter.DefaultGeoPoint = ConstrDefaults.DefaultArcCenter; circCenter.DefinesBasePoint = true; circCenter.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(Center); rad = new LengthInput("Constr.Circle.Radius"); rad.SetLengthEvent += new ConstructAction.LengthInput.SetLengthDelegate(SetCircleRadius); rad.GetLengthEvent += new ConstructAction.LengthInput.GetLengthDelegate(GetCircleRadius); if (!useRadius) { rad.Optional = true; } rad.DefaultLength = ConstrDefaults.DefaultArcRadius; rad.ForwardMouseInputTo = circCenter; diam = new LengthInput("Constr.Circle.Diameter"); diam.SetLengthEvent += new ConstructAction.LengthInput.SetLengthDelegate(SetCircleDiameter); diam.GetLengthEvent += new ConstructAction.LengthInput.GetLengthDelegate(GetCircleDiameter); diam.CalculateLengthEvent += new LengthInput.CalculateLengthDelegate(CalculateDiameter); if (useRadius) { diam.Optional = true; } diam.DefaultLength = ConstrDefaults.DefaultArcDiameter; diam.ForwardMouseInputTo = circCenter; if (useRadius) { base.SetInput(circCenter, rad, diam); } else { base.SetInput(circCenter, diam, rad); } base.ShowAttributes = true; base.OnSetAction(); }
public override void OnSetAction() { useRadius = Frame.GetBooleanSetting("Formatting.Radius", true); radiusPoint = new GeoPoint(0, 0); circ = Ellipse.Construct(); circRad = ConstrDefaults.DefaultArcRadius; circ.SetCirclePlaneCenterRadius(base.ActiveDrawingPlane, ConstrDefaults.DefaultArcCenter, ConstrDefaults.DefaultArcRadius); base.ActiveObject = circ; base.ShowActiveObject = false; base.TitleId = "Constr.Circle.TwoPointsRadius"; point1Input = new GeoPointInput("Constr.Circle.Point1"); point1Input.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(CirclePoint1); point2Input = new GeoPointInput("Constr.Circle.Point2"); point2Input.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(CirclePoint2); radInput = new LengthInput("Constr.Arc.Radius"); radInput.DefaultLength = ConstrDefaults.DefaultArcRadius; radInput.CalculateLengthEvent += new CADability.Actions.ConstructAction.LengthInput.CalculateLengthDelegate(radInput_OnCalculateLength); radInput.SetLengthEvent += new ConstructAction.LengthInput.SetLengthDelegate(CircRadius); radInput.GetLengthEvent += new CADability.Actions.ConstructAction.LengthInput.GetLengthDelegate(GetRadius); if (!useRadius) { radInput.Optional = true; } radInput.ForwardMouseInputTo = new object[] { point1Input, point2Input }; diamInput = new LengthInput("Constr.Circle.Diameter"); diamInput.SetLengthEvent += new ConstructAction.LengthInput.SetLengthDelegate(SetCircleDiameter); diamInput.GetLengthEvent += new ConstructAction.LengthInput.GetLengthDelegate(GetCircleDiameter); diamInput.CalculateLengthEvent += new LengthInput.CalculateLengthDelegate(CalculateDiameter); if (useRadius) { diamInput.Optional = true; } diamInput.DefaultLength = ConstrDefaults.DefaultArcDiameter; diamInput.ForwardMouseInputTo = new object[] { point1Input, point2Input }; if (useRadius) { base.SetInput(point1Input, point2Input, radInput, diamInput); } else { base.SetInput(point1Input, point2Input, diamInput, radInput); } base.ShowAttributes = true; base.OnSetAction(); }
/// <summary> /// Overrides <see cref="CADability.Actions.ConstructAction.OnSetAction ()"/> /// </summary> public override void OnSetAction() { base.TitleId = "Construct.ObjectPoint"; // da oben static private, werden diese Variablen gemerkt. Beim ersten Mal vorbesetzen: if (ratio == 0) { ratio = 0.5; } if (ratioDist == 0) { ratioDist = 1; } gPoint = ActionFeedBack.FeedbackPoint(base.Frame); base.FeedBack.Add(gPoint); ratioCurveInput = new CurveInput("Construct.ObjectPoint.Curve"); ratioCurveInput.Decomposed = true; // nur Einzelelemente, auch bei Polyline und Pfad ratioCurveInput.MouseOverCurvesEvent += new CADability.Actions.ConstructAction.CurveInput.MouseOverCurvesDelegate(ratioCurve); ratioCurveInput.CurveSelectionChangedEvent += new CADability.Actions.ConstructAction.CurveInput.CurveSelectionChangedDelegate(ratioCurveChanged); ratioInput = new DoubleInput("Construct.ObjectPoint.Ratio"); ratioInput.SetDoubleEvent += new CADability.Actions.ConstructAction.DoubleInput.SetDoubleDelegate(OnSetRatio); ratioInput.Fixed = true; // muss nicht eingegeben werden ratioInput.GetDoubleEvent += new CADability.Actions.ConstructAction.DoubleInput.GetDoubleDelegate(OnGetRatio); ratioInput.ForwardMouseInputTo = ratioCurveInput; // ratio = 0.5; // immer Standardwert ratioLength = new LengthInput("Construct.ObjectPoint.RatioLength"); ratioLength.SetLengthEvent += new LengthInput.SetLengthDelegate(OnSetRatioLength); ratioLength.GetLengthEvent += new LengthInput.GetLengthDelegate(OnGetRatioLength); ratioLength.Fixed = true; // muss nicht eingegeben werden ratioLength.ForwardMouseInputTo = ratioCurveInput; GeoPointInput measureText = new GeoPointInput("MeasurePoint"); measureText.GetGeoPointEvent += new CADability.Actions.ConstructAction.GeoPointInput.GetGeoPointDelegate(GetMeasureText); // geht nur mit readOnly, da sonst die Mausbewegung den angezeigten Wert überschreibt measureText.ReadOnly = true; if (measure) { base.SetInput(ratioCurveInput, ratioInput, ratioLength, measureText); } else { base.SetInput(ratioCurveInput, ratioInput, ratioLength); } base.OnSetAction(); }
/// <summary> /// Overrides <see cref="CADability.Actions.ConstructAction.OnSetAction ()"/> /// </summary> public override void OnSetAction() { base.TitleId = "Construct.DistancePointCurve"; feedBackLine = Line.Construct(); Color backColor = base.Frame.GetColorSetting("Colors.Feedback", Color.DarkGray); feedBackLine.ColorDef = new ColorDef("", backColor); feedBackAdd = false; pointInput = new GeoPointInput("Construct.DistancePointCurve.Point"); pointInput.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(DistPoint); curveInput = new CurveInput("Construct.DistancePointCurve.Object"); curveInput.Decomposed = true; // nur Einzelelemente, auch bei Polyline und Pfad curveInput.MouseOverCurvesEvent += new CADability.Actions.ConstructAction.CurveInput.MouseOverCurvesDelegate(DistCurve); curveInput.CurveSelectionChangedEvent += new CADability.Actions.ConstructAction.CurveInput.CurveSelectionChangedDelegate(DistCurveChanged); LengthInput measureText = new LengthInput("MeasureLength"); measureText.CalculateLengthEvent += new CADability.Actions.ConstructAction.LengthInput.CalculateLengthDelegate(CalculateMeasureText); measureText.GetLengthEvent += new CADability.Actions.ConstructAction.LengthInput.GetLengthDelegate(GetMeasureText); LengthInput measureTextx = new LengthInput("MeasureLengthx"); measureTextx.CalculateLengthEvent += new CADability.Actions.ConstructAction.LengthInput.CalculateLengthDelegate(CalculateMeasureTextx); measureTextx.GetLengthEvent += new CADability.Actions.ConstructAction.LengthInput.GetLengthDelegate(GetMeasureTextx); LengthInput measureTexty = new LengthInput("MeasureLengthy"); measureTexty.CalculateLengthEvent += new CADability.Actions.ConstructAction.LengthInput.CalculateLengthDelegate(CalculateMeasureTexty); measureTexty.GetLengthEvent += new CADability.Actions.ConstructAction.LengthInput.GetLengthDelegate(GetMeasureTexty); LengthInput measureTextz = new LengthInput("MeasureLengthz"); measureTextz.CalculateLengthEvent += new CADability.Actions.ConstructAction.LengthInput.CalculateLengthDelegate(CalculateMeasureTextz); measureTextz.GetLengthEvent += new CADability.Actions.ConstructAction.LengthInput.GetLengthDelegate(GetMeasureTextz); if (measure) { base.SetInput(pointInput, curveInput, measureText, measureTextx, measureTexty, measureTextz); } else { base.SetInput(pointInput, curveInput); } base.OnSetAction(); }
public override void OnSetAction() { base.TitleId = "Construct.DistanceTwoPoints"; feedBackLine = Line.Construct(); Color backColor = base.Frame.GetColorSetting("Colors.Feedback", Color.DarkGray); feedBackLine.ColorDef = new ColorDef("", backColor); base.FeedBack.Add(feedBackLine); firstPointInput = new GeoPointInput("Construct.DistanceTwoPoints.FirstPoint"); firstPointInput.DefinesBasePoint = true; firstPointInput.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(OnSetFirstPoint); secondPointInput = new GeoPointInput("Construct.DistanceTwoPoints.SecondPoint"); secondPointInput.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(OnSetSecondPoint); LengthInput measureText = new LengthInput("MeasureLength"); measureText.CalculateLengthEvent += new CADability.Actions.ConstructAction.LengthInput.CalculateLengthDelegate(CalculateMeasureText); measureText.GetLengthEvent += new CADability.Actions.ConstructAction.LengthInput.GetLengthDelegate(GetMeasureText); LengthInput measureTextx = new LengthInput("MeasureLengthx"); measureTextx.CalculateLengthEvent += new CADability.Actions.ConstructAction.LengthInput.CalculateLengthDelegate(CalculateMeasureTextx); measureTextx.GetLengthEvent += new CADability.Actions.ConstructAction.LengthInput.GetLengthDelegate(GetMeasureTextx); LengthInput measureTexty = new LengthInput("MeasureLengthy"); measureTexty.CalculateLengthEvent += new CADability.Actions.ConstructAction.LengthInput.CalculateLengthDelegate(CalculateMeasureTexty); measureTexty.GetLengthEvent += new CADability.Actions.ConstructAction.LengthInput.GetLengthDelegate(GetMeasureTexty); LengthInput measureTextz = new LengthInput("MeasureLengthz"); measureTextz.CalculateLengthEvent += new CADability.Actions.ConstructAction.LengthInput.CalculateLengthDelegate(CalculateMeasureTextz); measureTextz.GetLengthEvent += new CADability.Actions.ConstructAction.LengthInput.GetLengthDelegate(GetMeasureTextz); firstPointIsValid = false; secondPointIsValid = false; if (measure) { base.SetInput(firstPointInput, secondPointInput, measureText, measureTextx, measureTexty, measureTextz); } else { base.SetInput(firstPointInput, secondPointInput); } base.OnSetAction(); }
public override void OnSetAction() { cone = Solid.Construct(); base.BasePoint = ConstrDefaults.DefaultStartPoint; coneStartPoint = base.BasePoint; coneRadius1 = ConstrDefaults.DefaultArcRadius; coneRadius2 = ConstrDefaults.DefaultArcRadius / 2; coneHeight = ConstrDefaults.DefaultBoxHeight; coneDirX = coneRadius1 * base.ActiveDrawingPlane.DirectionX; coneDirZ = coneHeight * (base.ActiveDrawingPlane.DirectionX ^ base.ActiveDrawingPlane.DirectionY); cone = Make3D.MakeCone(coneStartPoint, coneDirX, coneDirZ, coneRadius1, coneRadius2); base.ActiveObject = cone; base.TitleId = "Constr.Cone"; startPointInput = new GeoPointInput("Constr.Cone.StartPoint"); startPointInput.DefaultGeoPoint = ConstrDefaults.DefaultStartPoint; startPointInput.DefinesBasePoint = true; startPointInput.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(StartPoint); endPointInput = new GeoPointInput("Constr.Cone.EndPoint"); // endPointInput.DefaultGeoPoint = ConstrDefaults.DefaultStartPoint; endPointInput.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(EndPoint); radius1 = new LengthInput("Constr.Cone.Radius1"); radius1.DefaultLength = ConstrDefaults.DefaultArcRadius; radius1.SetLengthEvent += new ConstructAction.LengthInput.SetLengthDelegate(Radius1); radius1.GetLengthEvent += new LengthInput.GetLengthDelegate(GetRadius1); radius1.CalculateLengthEvent += new CADability.Actions.ConstructAction.LengthInput.CalculateLengthDelegate(Radius1Calculate); radius2 = new LengthInput("Constr.Cone.Radius2"); radius2.SetLengthEvent += new ConstructAction.LengthInput.SetLengthDelegate(Radius2); radius2.GetLengthEvent += new LengthInput.GetLengthDelegate(GetRadius2); radius2.CalculateLengthEvent += new CADability.Actions.ConstructAction.LengthInput.CalculateLengthDelegate(Radius2Calculate); height = new LengthInput("Constr.Cone.Height"); height.DefaultLength = ConstrDefaults.DefaultBoxHeight; height.SetLengthEvent += new ConstructAction.LengthInput.SetLengthDelegate(Height); height.GetLengthEvent += new LengthInput.GetLengthDelegate(GetHeight); height.Optional = true; height.ForwardMouseInputTo = endPointInput; base.SetInput(startPointInput, endPointInput, radius1, radius2, height); base.ShowAttributes = true; base.OnSetAction(); }
public override void OnSetAction() { 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(); }
public override void OnSetAction() { line = Line.Construct(); base.ActiveObject = line; base.ShowActiveObject = false; parallelDist = ConstrDefaults.DefaultLineDist; base.TitleId = "Constr.Line.ParallelDist"; curveInput = new CurveInput("Constr.Line.Parallel.Object"); curveInput.MouseOverCurvesEvent += new CADability.Actions.ConstructAction.CurveInput.MouseOverCurvesDelegate(OnMouseOverCurves); curveInput.CurveSelectionChangedEvent += new CADability.Actions.ConstructAction.CurveInput.CurveSelectionChangedDelegate(OnCurveSelectionChanged); curveInput.Decomposed = true; // nur Einzellinien, auch bei Polyline lengthInput = new LengthInput("Constr.Line.Parallel.Dist"); lengthInput.SetLengthEvent += new CADability.Actions.ConstructAction.LengthInput.SetLengthDelegate(OnSetLength); lengthInput.DefaultLength = ConstrDefaults.DefaultLineDist; base.SetInput(curveInput, lengthInput); base.ShowAttributes = true; base.OnSetAction(); }
public override void OnSetAction() { line = Line.Construct(); lineLength = ConstrDefaults.DefaultLineLength; base.ActiveObject = line; base.ShowActiveObject = false; base.TitleId = "Constr.Line.MiddlePerp"; curveInput = new CurveInput("Constr.Line.MiddlePerp.Object"); curveInput.Decomposed = true; // nur Einzelelemente, auch bei Polyline und Pfad curveInput.MouseOverCurvesEvent += new CurveInput.MouseOverCurvesDelegate(PerpObject); curveInput.CurveSelectionChangedEvent += new CurveInput.CurveSelectionChangedDelegate(PerpObjectChanged); 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 = curveInput; base.SetInput(curveInput, lengthInput); base.ShowAttributes = true; base.OnSetAction(); }
/// <summary> /// Overrides <see cref="CADability.Actions.ConstructAction.OnSetAction ()"/> /// </summary> public override void OnSetAction() { base.TitleId = "Construct.PolarPoint"; feedBackLine = Line.Construct(); Color backColor = base.Frame.GetColorSetting("Colors.Feedback", Color.DarkGray); feedBackLine.ColorDef = new ColorDef("", backColor); lengthPolar = new DefaultLength(ConstructAction.DefaultLength.StartValue.ViewWidth4); startPointInput = new GeoPointInput("Construct.PolarPoint.StartPoint"); startPointInput.DefinesBasePoint = true; startPointInput.SetGeoPointEvent += new CADability.Actions.ConstructAction.GeoPointInput.SetGeoPointDelegate(SetStartPoint); startPointInput.GetGeoPointEvent += new CADability.Actions.ConstructAction.GeoPointInput.GetGeoPointDelegate(GetStartPoint); ang = new AngleInput("Construct.PolarPoint.Angle", 0.0); ang.SetAngleEvent += new CADability.Actions.ConstructAction.AngleInput.SetAngleDelegate(angSetAngle); ang.ForwardMouseInputTo = startPointInput; len = new LengthInput("Construct.PolarPoint.Length", lengthPolar); len.SetLengthEvent += new CADability.Actions.ConstructAction.LengthInput.SetLengthDelegate(lenSetLength); len.CalculateLengthEvent += new CADability.Actions.ConstructAction.LengthInput.CalculateLengthDelegate(lenOnCalculateLength); len.ForwardMouseInputTo = startPointInput; 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(startPointInput, ang, len, measureText); } else { base.SetInput(startPointInput, ang, len); } base.OnSetAction(); base.FeedBack.Add(feedBackLine); }