Exemple #1
0
 /// <summary>
 /// Initializes a new instance of the <c>Dimension</c> class.
 /// </summary>
 protected Dimension(DimensionType type)
     : base(EntityType.Dimension, DxfObjectCode.Dimension)
 {
     this.definitionPoint  = Vector3.Zero;
     this.midTextPoint     = Vector3.Zero;
     this.dimensionType    = type;
     this.attachmentPoint  = MTextAttachmentPoint.MiddleCenter;
     this.lineSpacingStyle = MTextLineSpacingStyle.AtLeast;
     this.lineSpacing      = 1.0;
     this.block            = null;
     this.style            = DimensionStyle.Default;
 }
Exemple #2
0
 /// <summary>
 /// Initializes a new instance of the <c>MTextParagraphOptions</c> class.
 /// </summary>
 public MTextParagraphOptions()
 {
     this.heightFactor      = 1.0;
     this.alignment         = MTextParagraphAlignment.Left;
     this.verticalAlignment = MTextParagraphVerticalAlignment.Center;
     this.spaceBefore       = 0.0;
     this.spaceAfter        = 0.0;
     this.firstLineIndent   = 0.0;
     this.leftIndent        = 0.0;
     this.rightIndent       = 0.0;
     this.lineSpacing       = 1.0;
     this.lineSpacingStyle  = MTextLineSpacingStyle.Default;
 }
Exemple #3
0
 /// <summary>
 /// Initializes a new instance of the <c>MTextParagraphOptions</c> class.
 /// </summary>
 public MTextParagraphOptions()
 {
     heightFactor      = 1.0;
     alignment         = MTextParagraphAlignment.Left;
     verticalAlignment = MTextParagraphVerticalAlignment.Center;
     spaceBefore       = 0.0;
     spaceAfter        = 0.0;
     firstLineIndent   = 0.0;
     leftIndent        = 0.0;
     rightIndent       = 0.0;
     lineSpacing       = 1.0;
     lineSpacingStyle  = MTextLineSpacingStyle.Default;
 }
Exemple #4
0
 /// <summary>
 /// Initializes a new instance of the <c>MText</c> class.
 /// </summary>
 /// <param name="text">Text string.</param>
 /// <param name="position">Text <see cref="Vector2">position</see> in world coordinates.</param>
 /// <param name="height">Text height.</param>
 /// <param name="rectangleWidth">Reference rectangle width.</param>
 /// <param name="style">Text <see cref="TextStyle">style</see>.</param>
 public MText(string text, Vector3 position, double height, double rectangleWidth, TextStyle style)
     : base(EntityType.MText, DxfObjectCode.MText)
 {
     this.value           = text;
     this.position        = position;
     this.attachmentPoint = MTextAttachmentPoint.TopLeft;
     if (style == null)
     {
         throw new ArgumentNullException("style", "The Text style cannot be null.");
     }
     this.style                 = style;
     this.rectangleWidth        = rectangleWidth;
     this.height                = height;
     this.lineSpacing           = 1.0;
     this.paragraphHeightFactor = 1.0;
     this.lineSpacingStyle      = MTextLineSpacingStyle.AtLeast;
     this.rotation              = 0.0;
 }
Exemple #5
0
 /// <summary>
 /// Initializes a new instance of the <c>MText</c> class.
 /// </summary>
 /// <param name="text">Text string.</param>
 /// <param name="position">Text <see cref="Vector2">position</see> in world coordinates.</param>
 /// <param name="height">Text height.</param>
 /// <param name="rectangleWidth">Reference rectangle width.</param>
 /// <param name="style">Text <see cref="TextStyle">style</see>.</param>
 public MText(string text, Vector3 position, double height, double rectangleWidth, TextStyle style)
     : base(EntityType.MText, DxfObjectCode.MText)
 {
     this.text            = text;
     this.position        = position;
     this.attachmentPoint = MTextAttachmentPoint.TopLeft;
     this.style           = style ?? throw new ArgumentNullException(nameof(style));
     this.rectangleWidth  = rectangleWidth;
     if (height <= 0.0)
     {
         throw new ArgumentOutOfRangeException(nameof(height), this.text, "The MText height must be greater than zero.");
     }
     this.height           = height;
     this.lineSpacing      = 1.0;
     this.lineSpacingStyle = MTextLineSpacingStyle.AtLeast;
     this.drawingDirection = MTextDrawingDirection.ByStyle;
     this.rotation         = 0.0;
 }
Exemple #6
0
 /// <summary>
 /// Initializes a new instance of the <c>Dimension</c> class.
 /// </summary>
 protected Dimension(DimensionType type)
     : base(EntityType.Dimension, DxfObjectCode.Dimension)
 {
     this.definitionPoint = Vector3.Zero;
     this.midTextPoint = Vector3.Zero;
     this.dimensionType = type;
     this.attachmentPoint = MTextAttachmentPoint.MiddleCenter;
     this.lineSpacingStyle = MTextLineSpacingStyle.AtLeast;
     this.lineSpacing = 1.0;
     this.block = null;
     this.style = DimensionStyle.Default;
     this.userText = null;
     this.elevation = 0.0;
     this.styleOverrides = new DimensionStyleOverrideDictionary();
     this.styleOverrides.BeforeAddItem += this.StyleOverrides_BeforeAddItem;
     this.styleOverrides.AddItem += this.StyleOverrides_AddItem;
     this.styleOverrides.BeforeRemoveItem += this.StyleOverrides_BeforeRemoveItem;
     this.styleOverrides.RemoveItem += this.StyleOverrides_RemoveItem;
 }
Exemple #7
0
 /// <summary>
 /// Initializes a new instance of the <c>Dimension</c> class.
 /// </summary>
 protected Dimension(DimensionType type)
     : base(EntityType.Dimension, DxfObjectCode.Dimension)
 {
     this.definitionPoint                  = Vector3.Zero;
     this.midTextPoint                     = Vector3.Zero;
     this.dimensionType                    = type;
     this.attachmentPoint                  = MTextAttachmentPoint.MiddleCenter;
     this.lineSpacingStyle                 = MTextLineSpacingStyle.AtLeast;
     this.lineSpacing                      = 1.0;
     this.block                            = null;
     this.style                            = DimensionStyle.Default;
     this.userText                         = null;
     this.elevation                        = 0.0;
     this.styleOverrides                   = new DimensionStyleOverrideDictionary();
     this.styleOverrides.BeforeAddItem    += this.StyleOverrides_BeforeAddItem;
     this.styleOverrides.AddItem          += this.StyleOverrides_AddItem;
     this.styleOverrides.BeforeRemoveItem += this.StyleOverrides_BeforeRemoveItem;
     this.styleOverrides.RemoveItem       += this.StyleOverrides_RemoveItem;
 }
Exemple #8
0
 /// <summary>
 /// Initializes a new instance of the <c>Dimension</c> class.
 /// </summary>
 protected Dimension(DimensionType type)
     : base(EntityType.Dimension, DxfObjectCode.Dimension)
 {
     defPoint                         = Vector2.Zero;
     textRefPoint                     = Vector2.Zero;
     dimensionType                    = type;
     attachmentPoint                  = MTextAttachmentPoint.MiddleCenter;
     lineSpacingStyle                 = MTextLineSpacingStyle.AtLeast;
     lineSpacing                      = 1.0;
     block                            = null;
     style                            = DimensionStyle.Default;
     textRotation                     = 0.0;
     userText                         = null;
     elevation                        = 0.0;
     styleOverrides                   = new DimensionStyleOverrideDictionary();
     styleOverrides.BeforeAddItem    += StyleOverrides_BeforeAddItem;
     styleOverrides.AddItem          += StyleOverrides_AddItem;
     styleOverrides.BeforeRemoveItem += StyleOverrides_BeforeRemoveItem;
     styleOverrides.RemoveItem       += StyleOverrides_RemoveItem;
 }
 /// <summary>
 /// Initializes a new instance of the <c>Dimension</c> class.
 /// </summary>
 protected Dimension(DimensionType type)
     : base(EntityType.Dimension, DxfObjectCode.Dimension)
 {
     this.definitionPoint = Vector3.Zero;
     this.midTextPoint = Vector3.Zero;
     this.dimensionType = type;
     this.attachmentPoint = MTextAttachmentPoint.MiddleCenter;
     this.lineSpacingStyle = MTextLineSpacingStyle.AtLeast;
     this.lineSpacing = 1.0;
     this.block = null;
     this.style = DimensionStyle.Default;
     this.userText = null;
 }
 /// <summary>
 /// Initializes a new instance of the <c>MText</c> class.
 /// </summary>
 /// <param name="text">Text string.</param>
 /// <param name="position">Text <see cref="Vector2">position</see> in world coordinates.</param>
 /// <param name="height">Text height.</param>
 /// <param name="rectangleWidth">Reference rectangle width.</param>
 /// <param name="style">Text <see cref="TextStyle">style</see>.</param>
 public MText(string text, Vector3 position, double height, double rectangleWidth, TextStyle style)
     : base(EntityType.MText, DxfObjectCode.MText)
 {
     this.value = text;
     this.position = position;
     this.attachmentPoint = MTextAttachmentPoint.TopLeft;
     if (style == null)
         throw new ArgumentNullException(nameof(style), "The Text style cannot be null.");
     this.style = style;
     this.rectangleWidth = rectangleWidth;
     if (height <= 0.0)
         throw new ArgumentOutOfRangeException(nameof(height), this.value, "The MText height must be greater than zero.");
     this.height = height;
     this.lineSpacing = 1.0;
     this.paragraphHeightFactor = 1.0;
     this.lineSpacingStyle = MTextLineSpacingStyle.AtLeast;
     this.rotation = 0.0;
 }