• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

DomCR / ACadSharp / 12905761471

22 Jan 2025 10:03AM UTC coverage: 2.0% (-74.0%) from 75.963%
12905761471

push

github

DomCR
version 1.0.6

104 of 7676 branches covered (1.35%)

Branch coverage included in aggregate %.

590 of 27024 relevant lines covered (2.18%)

5.13 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/ACadSharp/Entities/Shape.cs
1
using ACadSharp.Attributes;
2
using ACadSharp.Tables;
3
using CSMath;
4
using System;
5

6
namespace ACadSharp.Entities
7
{
8
        /// <summary>
9
        /// Represents a <see cref="Shape"/> entity.
10
        /// </summary>
11
        /// <remarks>
12
        /// Object name <see cref="DxfFileToken.EntityShape"/> <br/>
13
        /// Dxf class name <see cref="DxfSubclassMarker.Shape"/>
14
        /// </remarks>
15
        [DxfName(DxfFileToken.EntityShape)]
16
        [DxfSubClass(DxfSubclassMarker.Shape)]
17
        public class Shape : Entity
18
        {
19
                /// <inheritdoc/>
20
                public override ObjectType ObjectType => ObjectType.SHAPE;
×
21

22
                /// <inheritdoc/>
23
                public override string ObjectName => DxfFileToken.EntityShape;
×
24

25
                /// <inheritdoc/>
26
                public override string SubclassMarker => DxfSubclassMarker.Shape;
×
27

28
                /// <summary>
29
                /// Thickness.
30
                /// </summary>
31
                [DxfCodeValue(39)]
32
                public double Thickness { get; set; } = 0.0;
×
33

34
                /// <summary>
35
                /// Insertion point (in WCS).
36
                /// </summary>
37
                [DxfCodeValue(10, 20, 30)]
38
                public XYZ InsertionPoint { get; set; }
×
39

40
                /// <summary>
41
                /// Size.
42
                /// </summary>
43
                [DxfCodeValue(40)]
44
                public double Size { get; set; } = 1.0;
×
45

46
                /// <summary>
47
                /// Shape name.
48
                /// </summary>
49
                [DxfCodeValue(DxfReferenceType.Name, 2)]
50
                public TextStyle ShapeStyle
51
                {
52
                        get { return this._style; }
×
53
                        set
54
                        {
×
55
                                if (value == null || !value.IsShapeFile)
×
56
                                {
×
57
                                        throw new ArgumentNullException(nameof(value));
×
58
                                }
59

60
                                if (this.Document != null)
×
61
                                {
×
62
                                        this._style = this.updateTable(value, this.Document.TextStyles);
×
63
                                }
×
64
                                else
65
                                {
×
66
                                        this._style = value;
×
67
                                }
×
68
                        }
×
69
                }
70

71
                /// <summary>
72
                /// Rotation angle.
73
                /// </summary>
74
                [DxfCodeValue(DxfReferenceType.IsAngle, 50)]
75
                public double Rotation { get; set; } = 0;
×
76

77
                /// <summary>
78
                /// Relative X scale factor.
79
                /// </summary>
80
                [DxfCodeValue(41)]
81
                public double RelativeXScale { get; set; } = 1;
×
82

83
                /// <summary>
84
                /// Oblique angle.
85
                /// </summary>
86
                [DxfCodeValue(DxfReferenceType.IsAngle, 51)]
87
                public double ObliqueAngle { get; set; } = 0;
×
88

89
                /// <summary>
90
                /// Extrusion direction.
91
                /// </summary>
92
                [DxfCodeValue(210, 220, 230)]
93
                public XYZ Normal { get; set; } = XYZ.AxisZ;
×
94

95
                internal ushort ShapeIndex { get; set; }
×
96

97
                private TextStyle _style;
98

99
                internal Shape() : base() { }
×
100

101
                /// <summary>
102
                /// Initializes a shape by the <see cref="TextStyle"/>
103
                /// </summary>
104
                /// <param name="textStyle">Text style with the flag <see cref="TextStyle.IsShapeFile"/></param>
105
                public Shape(TextStyle textStyle)
×
106
                {
×
107
                        this.ShapeStyle = textStyle;
×
108
                }
×
109

110
                /// <inheritdoc/>
111
                public override CadObject Clone()
112
                {
×
113
                        Shape clone = (Shape)base.Clone();
×
114

115
                        clone.ShapeStyle = (TextStyle)(this.ShapeStyle?.Clone());
×
116

117
                        return clone;
×
118
                }
×
119

120
                /// <inheritdoc/>
121
                public override BoundingBox GetBoundingBox()
122
                {
×
123
                        return new BoundingBox(this.InsertionPoint);
×
124
                }
×
125
        }
126
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc