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

DomCR / ACadSharp / 13724323339

07 Mar 2025 03:53PM UTC coverage: 75.232% (-0.9%) from 76.11%
13724323339

Pull #457

github

web-flow
Merge af0c8b917 into a1ba04cda
Pull Request #457: Geometric transform

5481 of 8007 branches covered (68.45%)

Branch coverage included in aggregate %.

221 of 620 new or added lines in 40 files covered. (35.65%)

305 existing lines in 16 files now uncovered.

21808 of 28266 relevant lines covered (77.15%)

74119.66 hits per line

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

85.11
/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;
1✔
21

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

25
                /// <inheritdoc/>
26
                public override string SubclassMarker => DxfSubclassMarker.Shape;
2,042✔
27

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

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

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

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

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

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

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

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

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

95
                internal ushort ShapeIndex { get; set; }
133✔
96

97
                private TextStyle _style;
98

99
                internal Shape() : base() { }
1,113✔
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)
5✔
106
                {
5✔
107
                        this.ShapeStyle = textStyle;
5✔
108
                }
5✔
109

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

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

117
                        return clone;
2✔
118
                }
2✔
119

120
                /// <inheritdoc/>
121
                public override BoundingBox GetBoundingBox()
122
                {
1✔
123
                        return new BoundingBox(this.InsertionPoint);
1✔
124
                }
1✔
125

126
                public override void ApplyTransform(Transform transform)
NEW
127
                {
×
NEW
128
                        throw new NotImplementedException();
×
129
                }
130
        }
131
}
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