/// <summary> /// /// </summary> /// <param name="frame">Frame to gat access to the settings</param> /// <param name="pointSymbol">The icon, in which the point is beiing displayed</param> /// <returns>A <see cref="GeoObject.Point"/> as a feedback object</returns> static public CADability.GeoObject.Point FeedbackPoint(IFrame frame, PointSymbol pointSymbol) { CADability.GeoObject.Point gPoint = CADability.GeoObject.Point.Construct(); gPoint.Symbol = pointSymbol; Color backColor = frame.GetColorSetting("Colors.Feedback", Color.DarkGray); gPoint.ColorDef = new ColorDef("", backColor); return(gPoint); }
public override void OnSetAction() { ellipse = Ellipse.Construct(); dir = ConstrDefaults.DefaultArcDirection; point1 = ConstrDefaults.DefaultEllipseCenter; point2 = point1; point2.x = point1.x + ConstrDefaults.DefaultEllipseMajorRadius; point2.y = point1.y + ConstrDefaults.DefaultEllipseMinorRadius; vector1 = base.ActiveDrawingPlane.DirectionY; vector2 = base.ActiveDrawingPlane.DirectionX; showEllipse(); base.ActiveObject = ellipse; base.TitleId = "Constr.Ellipsearc.2PointsDirections"; gPoint1 = ActionFeedBack.FeedbackPoint(base.Frame); base.FeedBack.Add(gPoint1); gPoint2 = ActionFeedBack.FeedbackPoint(base.Frame); base.FeedBack.Add(gPoint2); feedBackLine = Line.Construct(); Color backColor = base.Frame.GetColorSetting("Colors.Feedback", Color.DarkGray); feedBackLine.ColorDef = new ColorDef("", backColor); base.FeedBack.Add(feedBackLine); GeoPointInput elliPoint1 = new GeoPointInput("Constr.Ellipse.2PointsDirections.Point1"); elliPoint1.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(SetPoint1); GeoVectorInput elliDir1 = new GeoVectorInput("Constr.Ellipse.2PointsDirections.Direction1"); elliDir1.SetGeoVectorEvent += new CADability.Actions.ConstructAction.GeoVectorInput.SetGeoVectorDelegate(SetElliDir1); elliDir1.GetGeoVectorEvent += new CADability.Actions.ConstructAction.GeoVectorInput.GetGeoVectorDelegate(GetElliDir1); GeoPointInput elliPoint2 = new GeoPointInput("Constr.Ellipse.2PointsDirections.Point2"); elliPoint2.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(SetPoint2); GeoVectorInput elliDir2 = new GeoVectorInput("Constr.Ellipse.2PointsDirections.Direction2"); elliDir2.SetGeoVectorEvent += new CADability.Actions.ConstructAction.GeoVectorInput.SetGeoVectorDelegate(SetElliDir2); elliDir2.GetGeoVectorEvent += new CADability.Actions.ConstructAction.GeoVectorInput.GetGeoVectorDelegate(GetElliDir2); BooleanInput dirInput = new BooleanInput("Constr.Arc.Direction", "Constr.Arc.Direction.Values"); dirInput.DefaultBoolean = ConstrDefaults.DefaultArcDirection; dirInput.SetBooleanEvent += new CADability.Actions.ConstructAction.BooleanInput.SetBooleanDelegate(SetDirection); dirInput.GetBooleanEvent += new BooleanInput.GetBooleanDelegate(GetDirection); base.SetInput(elliPoint1, elliDir1, elliPoint2, elliDir2, dirInput); base.ShowAttributes = true; base.OnSetAction(); }
/// <summary> /// Overrides <see cref="CADability.Actions.ConstructAction.OnSetAction ()"/> /// </summary> public override void OnSetAction() { base.TitleId = "Construct.MidPoint"; // da oben static private, werden diese Variablen gemerkt. Beim ersten Mal vorbesetzen: if (ratio == 0) { ratio = 0.5; } gPoint = ActionFeedBack.FeedbackPoint(base.Frame); base.FeedBack.Add(gPoint); 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.MidPoint.FirstPoint"); firstPointInput.DefinesBasePoint = true; firstPointInput.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(OnSetFirstPoint); secondPointInput = new GeoPointInput("Construct.MidPoint.SecondPoint"); secondPointInput.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(OnSetSecondPoint); ratioInput = new DoubleInput("Construct.MidPoint.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 = new object[] { firstPointInput, secondPointInput }; // ratio = 0.5; // immer Standardwert firstPointIsValid = false; secondPointIsValid = false; 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(firstPointInput, secondPointInput, ratioInput, measureText); } else { base.SetInput(firstPointInput, secondPointInput, ratioInput); } 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; point1 = ConstrDefaults.DefaultEllipseCenter; point2 = point1; point2.x = point1.x + ConstrDefaults.DefaultEllipseMajorRadius; vector1 = base.ActiveDrawingPlane.DirectionX; vector2 = base.ActiveDrawingPlane.DirectionY; // direction2 = direction1; base.ActiveObject = ellipse; base.TitleId = "Constr.Ellipse.2PointsDirections"; gPoint1 = ActionFeedBack.FeedbackPoint(base.Frame); gPoint2 = ActionFeedBack.FeedbackPoint(base.Frame); base.FeedBack.Add(gPoint1); base.FeedBack.Add(gPoint2); feedBackLine = Line.Construct(); Color backColor = base.Frame.GetColorSetting("Colors.Feedback", Color.DarkGray); feedBackLine.ColorDef = new ColorDef("", backColor); base.FeedBack.Add(feedBackLine); GeoPointInput elliPoint1 = new GeoPointInput("Constr.Ellipse.2PointsDirections.Point1"); elliPoint1.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(SetPoint1); GeoVectorInput elliDir1 = new GeoVectorInput("Constr.Ellipse.2PointsDirections.Direction1"); elliDir1.SetGeoVectorEvent += new CADability.Actions.ConstructAction.GeoVectorInput.SetGeoVectorDelegate(SetElliDir1); elliDir1.GetGeoVectorEvent += new CADability.Actions.ConstructAction.GeoVectorInput.GetGeoVectorDelegate(GetElliDir1); GeoPointInput elliPoint2 = new GeoPointInput("Constr.Ellipse.2PointsDirections.Point2"); elliPoint2.SetGeoPointEvent += new ConstructAction.GeoPointInput.SetGeoPointDelegate(SetPoint2); GeoVectorInput elliDir2 = new GeoVectorInput("Constr.Ellipse.2PointsDirections.Direction2"); elliDir2.SetGeoVectorEvent += new CADability.Actions.ConstructAction.GeoVectorInput.SetGeoVectorDelegate(SetElliDir2); elliDir2.GetGeoVectorEvent += new CADability.Actions.ConstructAction.GeoVectorInput.GetGeoVectorDelegate(GetElliDir2); base.SetInput(elliPoint1, elliDir1, elliPoint2, elliDir2); base.ShowAttributes = true; base.OnSetAction(); }