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

DomCR / ACadSharp / 12984144099

27 Jan 2025 07:37AM UTC coverage: 76.222% (-0.06%) from 76.282%
12984144099

push

github

DomCR
submodules

5322 of 7712 branches covered (69.01%)

Branch coverage included in aggregate %.

21271 of 27177 relevant lines covered (78.27%)

39534.36 hits per line

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

75.0
/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;
9✔
22

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

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

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

41
                /// <summary>
42
                /// Z scale factor 
43
                /// </summary>
44
                [DxfCodeValue(43)]
45
                public double ZScale { get; set; } = 1;
9✔
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;
9✔
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
                        {
4✔
74
                                if (value < 0 || value > 100)
4!
75
                                {
3✔
76
                                        throw new ArgumentException($"Invalid Brightness value: {value}, must be in range 0-100");
3✔
77
                                }
78

79
                                this._contrast = value;
1✔
80
                        }
1✔
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
                        {
4✔
96
                                if (value < 0 || value > 100)
4!
97
                                {
4✔
98
                                        throw new ArgumentException($"Invalid Brightness value: {value}, must be in range 0-100");
4✔
99
                                }
100

101
                                this._fade = value;
×
102
                        }
×
103
                }
104

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

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

111
                /// <inheritdoc/>
112
                public override BoundingBox GetBoundingBox()
113
                {
1✔
114
                        return BoundingBox.Null;
1✔
115
                }
1✔
116
        }
117
}
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