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

DomCR / ACadSharp / 13831678834

13 Mar 2025 09:49AM UTC coverage: 75.366% (-0.8%) from 76.2%
13831678834

Pull #457

github

web-flow
Merge 468aa5127 into e0bc2deb0
Pull Request #457: Geometric transform

5514 of 8039 branches covered (68.59%)

Branch coverage included in aggregate %.

259 of 660 new or added lines in 40 files covered. (39.24%)

295 existing lines in 15 files now uncovered.

21939 of 28387 relevant lines covered (77.29%)

73845.76 hits per line

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

78.95
/src/ACadSharp/Entities/UnderlayEntity.cs
1
using ACadSharp.Attributes;
2
using ACadSharp.Objects;
3
using CSMath;
4
using System;
5

6
namespace ACadSharp.Entities
7
{
8
        /// <summary>
9
        /// Common base class for all underlay entities, like <see cref="PdfUnderlay" />.
10
        /// </summary>
11
        [DxfSubClass(null, true)]
12
        public abstract class UnderlayEntity : Entity
13
        {
14
                /// <inheritdoc/>
15
                public override string SubclassMarker => DxfSubclassMarker.Underlay;
2✔
16

17
                /// <summary>
18
                /// Specifies the three-dimensional normal unit vector for the object.
19
                /// </summary>
20
                [DxfCodeValue(210, 220, 230)]
21
                public XYZ Normal { get; set; } = XYZ.AxisZ;
11✔
22

23
                /// <summary>
24
                /// Insertion point(in WCS)
25
                /// </summary>
26
                [DxfCodeValue(10, 20, 30)]
27
                public XYZ InsertPoint { get; set; }
5✔
28

29
                /// <summary>
30
                /// X scale factor 
31
                /// </summary>
32
                [DxfCodeValue(41)]
33
                public double XScale { get; set; } = 1;
11✔
34

35
                /// <summary>
36
                /// Y scale factor 
37
                /// </summary>
38
                [DxfCodeValue(42)]
39
                public double YScale { get; set; } = 1;
11✔
40

41
                /// <summary>
42
                /// Z scale factor 
43
                /// </summary>
44
                [DxfCodeValue(43)]
45
                public double ZScale { get; set; } = 1;
11✔
46

47
                /// <summary>
48
                /// Specifies the rotation angle for the object.
49
                /// </summary>
50
                /// <value>
51
                /// The rotation angle in radians.
52
                /// </value>
53
                [DxfCodeValue(DxfReferenceType.IsAngle, 50)]
54
                public double Rotation { get; set; } = 0.0;
11✔
55

56
                /// <summary>
57
                /// Underlay display options.
58
                /// </summary>
59
                [DxfCodeValue(280)]
60
                public UnderlayDisplayFlags Flags { get; set; }
×
61

62
                /// <summary>
63
                /// Contrast
64
                /// </summary>
65
                /// <remarks>
66
                /// 0-100; default = 50
67
                /// </remarks>
68
                [DxfCodeValue(281)]
69
                public byte Contrast
70
                {
71
                        get { return this._contrast; }
×
72
                        set
73
                        {
5✔
74
                                if (value < 0 || value > 100)
5!
75
                                {
2✔
76
                                        throw new ArgumentException($"Invalid Brightness value: {value}, must be in range 0-100");
2✔
77
                                }
78

79
                                this._contrast = value;
3✔
80
                        }
3✔
81
                }
82

83
                /// <summary>
84
                /// Fade
85
                /// </summary>
86
                /// <value>
87
                /// Range: 0 - 100 <br/>
88
                /// Default: 0
89
                /// </value>
90
                [DxfCodeValue(282)]
91
                public byte Fade
92
                {
93
                        get { return this._fade; }
×
94
                        set
95
                        {
5✔
96
                                if (value < 0 || value > 100)
5!
97
                                {
2✔
98
                                        throw new ArgumentException($"Invalid Brightness value: {value}, must be in range 0-100");
2✔
99
                                }
100

101
                                this._fade = value;
3✔
102
                        }
3✔
103
                }
104

105
                [DxfCodeValue(DxfReferenceType.Handle, 340)]
106
                public UnderlayDefinition Definition { get; set; }
×
107

108
                private byte _contrast = 50;
6✔
109
                private byte _fade = 0;
6✔
110

111
                /// <inheritdoc/>
112
                public override BoundingBox GetBoundingBox()
113
                {
1✔
114
                        return BoundingBox.Null;
1✔
115
                }
1✔
116

117
                public override void ApplyTransform(Transform transform)
NEW
118
                {
×
NEW
119
                        throw new NotImplementedException();
×
120
                }
121
        }
122
}
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