public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent) { RegularPolygon s = null != o ? (RegularPolygon)o : new RegularPolygon(info); info.GetBaseValueEmbedded(s, typeof(RegularPolygon).BaseType, parent); s._vertices = info.GetInt32("NumberOfVertices"); s._cornerRadius = info.GetDouble("CornerRadius"); return(s); }
protected override void FinishDrawing() { var rect = GetNormalRectangle(_Points[0].LayerCoordinates, _Points[1].LayerCoordinates); var go = new RegularPolygon(_grac.Doc.GetPropertyContext()); go.SetParentSize(_grac.ActiveLayer.Size, false); go.SetRelativeSizePositionFromAbsoluteValues(rect.Size, rect.LeftTop); // deselect the text tool _grac.SetGraphToolFromInternal(GraphToolType.ObjectPointer); _grac.ActiveLayer.GraphObjects.Add(go); }
public static RegularPolygon FromLTRB(double left, double top, double right, double bottom, Altaxo.Main.Properties.IReadOnlyPropertyBag context) { if (left > right) { Exchange(ref left, ref right); } if (top > bottom) { Exchange(ref top, ref bottom); } var result = new RegularPolygon(context); result._location.SizeX = RADouble.NewAbs(right - left); result._location.SizeY = RADouble.NewAbs(bottom - top); result._location.PositionX = RADouble.NewAbs(left); result._location.PositionY = RADouble.NewAbs(top); return(result); }
public RegularPolygon(RegularPolygon from) : base(from) // all is done here, since CopyFrom is virtual! { }
public static RegularPolygon FromLTRB(double left, double top, double right, double bottom, Altaxo.Main.Properties.IReadOnlyPropertyBag context) { if (left > right) Exchange(ref left, ref right); if (top > bottom) Exchange(ref top, ref bottom); var result = new RegularPolygon(context); result._location.SizeX = RADouble.NewAbs(right - left); result._location.SizeY = RADouble.NewAbs(bottom - top); result._location.PositionX = RADouble.NewAbs(left); result._location.PositionY = RADouble.NewAbs(top); return result; }