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

DomCR / ACadSharp / 13096781795

02 Feb 2025 07:35AM UTC coverage: 76.229% (+0.003%) from 76.226%
13096781795

Pull #546

github

web-flow
Merge 88bffdf3e into da8587f47
Pull Request #546: Issue 529 geodata

5358 of 7752 branches covered (69.12%)

Branch coverage included in aggregate %.

129 of 181 new or added lines in 8 files covered. (71.27%)

3 existing lines in 1 file now uncovered.

21413 of 27367 relevant lines covered (78.24%)

39366.42 hits per line

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

76.19
/src/ACadSharp/Objects/GeoData.cs
1
using ACadSharp.Attributes;
2
using ACadSharp.Tables;
3
using ACadSharp.Types.Units;
4
using CSMath;
5
using System;
6
using System.Collections.Generic;
7

8
namespace ACadSharp.Objects
9
{
10
        public enum ScaleEstimationType
11
        {
12
                None = 1,
13
                UserSpecifiedScaleFactor = 2,
14
                GridScaleAtReferencePoint = 3,
15
                Prismodial = 4
16
        }
17

18
        /// <summary>
19
        /// Represents a <see cref="GeoData"/> object
20
        /// </summary>
21
        /// <remarks>
22
        /// Object name <see cref="DxfFileToken.ObjectGeoData"/> <br/>
23
        /// Dxf class name <see cref="DxfSubclassMarker.GeoData"/>
24
        /// </remarks>
25
        [DxfName(DxfFileToken.ObjectGeoData)]
26
        [DxfSubClass(DxfSubclassMarker.GeoData)]
27
        public partial class GeoData : NonGraphicalObject
28
        {
29
                /// <inheritdoc/>
NEW
30
                public override ObjectType ObjectType { get { return ObjectType.UNLISTED; } }
×
31

32
                /// <inheritdoc/>
NEW
33
                public override string ObjectName => DxfFileToken.ObjectGeoData;
×
34

35
                /// <inheritdoc/>
36
                public override string SubclassMarker => DxfSubclassMarker.GeoData;
32✔
37

38
                /// <summary>
39
                /// AcDbGeoData Object version.
40
                /// </summary>
41
                /// <remarks>
42
                /// 1 - 2009 <br/>
43
                /// 2 - 2010 <br/>
44
                /// 3 - 2013
45
                /// </remarks>
46
                [DxfCodeValue(90)]
47
                public GeoDataVersion Version { get; set; } = GeoDataVersion.R2013;
5✔
48

49
                /// <summary>
50
                /// Type of design coordinates.
51
                /// </summary>
52
                [DxfCodeValue(70)]
53
                public DesignCoordinatesType CoordinatesType { get; set; } = DesignCoordinatesType.LocalGrid;
4✔
54

55
                /// <summary>
56
                /// Host block table record.
57
                /// </summary>
58
                public BlockRecord HostBlock
59
                {
NEW
60
                        get { return this._hostBlock; }
×
61
                        set
62
                        {
1✔
63
                                if (value == null)
1!
NEW
64
                                {
×
NEW
65
                                        throw new ArgumentNullException(nameof(value));
×
66
                                }
67

68
                                if (this.Document != null)
1!
69
                                {
1✔
70
                                        this._hostBlock = this.updateTable(value, this.Document.BlockRecords);
1✔
71
                                }
1✔
72
                                else
NEW
73
                                {
×
NEW
74
                                        this._hostBlock = value;
×
NEW
75
                                }
×
76
                        }
1✔
77
                }
78

79
                /// <summary>
80
                /// Design point, reference point in WCS coordinates.
81
                /// </summary>
82
                [DxfCodeValue(10, 20, 30)]
83
                public XYZ DesignPoint { get; set; }
7✔
84

85
                /// <summary>
86
                /// Reference point in coordinate system coordinates, valid only when coordinate type is Local Grid.
87
                /// </summary>
88
                [DxfCodeValue(11, 21, 31)]
89
                public XYZ ReferencePoint { get; set; }
7✔
90

91
                /// <summary>
92
                /// North direction vector.
93
                /// </summary>
94
                [DxfCodeValue(12, 22)]
95
                public XY NorthDirection { get; set; } = XY.AxisY;
7✔
96

97
                /// <summary>
98
                /// Horizontal unit scale, factor which converts horizontal design coordinates to meters by multiplication.
99
                /// </summary>
100
                [DxfCodeValue(41)]
101
                public double HorizontalUnitScale { get; set; } = 1;
4✔
102

103
                /// <summary>
104
                /// Vertical unit scale, factor which converts vertical design coordinates to meters by multiplication.
105
                /// </summary>
106
                [DxfCodeValue(40)]
107
                public double VerticalUnitScale { get; set; } = 1;
4✔
108

109
                /// <summary>
110
                /// Horizontal units.
111
                /// </summary>
112
                [DxfCodeValue(91)]
113
                public UnitsType HorizontalUnits { get; set; } = UnitsType.Meters;
5✔
114

115
                /// <summary>
116
                /// Vertical units.
117
                /// </summary>
118
                [DxfCodeValue(92)]
119
                public UnitsType VerticalUnits { get; set; } = UnitsType.Meters;
3✔
120

121
                /// <summary>
122
                /// Up direction.
123
                /// </summary>
124
                [DxfCodeValue(210, 220, 230)]
125
                public XYZ UpDirection { get; set; } = XYZ.AxisZ;
9✔
126

127
                /// <summary>
128
                /// Scale estimation method.
129
                /// </summary>
130
                [DxfCodeValue(95)]
131
                public ScaleEstimationType ScaleEstimationMethod { get; set; } = ScaleEstimationType.None;
4✔
132

133
                /// <summary>
134
                /// Bool flag specifying whether to do sea level correction.
135
                /// </summary>
136
                [DxfCodeValue(294)]
137
                public bool EnableSeaLevelCorrection { get; set; }
2✔
138

139
                /// <summary>
140
                /// User specified scale factor.
141
                /// </summary>
142
                [DxfCodeValue(141)]
143
                public double UserSpecifiedScaleFactor { get; set; }
2✔
144

145
                /// <summary>
146
                /// Sea level elevation.
147
                /// </summary>
148
                [DxfCodeValue(142)]
149
                public double SeaLevelElevation { get; set; }
2✔
150

151
                /// <summary>
152
                /// Coordinate projection radius.
153
                /// </summary>
154
                [DxfCodeValue(143)]
155
                public double CoordinateProjectionRadius { get; set; }
2✔
156

157
                /// <summary>
158
                /// Coordinate system definition string.
159
                /// </summary>
160
                [DxfCodeValue(301)]
161
                public string CoordinateSystemDefinition { get; set; } = string.Empty;
28✔
162

163
                /// <summary>
164
                /// GeoRSS tag.
165
                /// </summary>
166
                [DxfCodeValue(302)]
167
                public string GeoRssTag { get; set; } = string.Empty;
4✔
168

169
                /// <summary>
170
                /// Observation from tag.
171
                /// </summary>
172
                [DxfCodeValue(305)]
173
                public string ObservationFromTag { get; set; } = string.Empty;
4✔
174

175
                /// <summary>
176
                /// Observation to tag.
177
                /// </summary>
178
                [DxfCodeValue(306)]
179
                public string ObservationToTag { get; set; } = string.Empty;
4✔
180

181
                /// <summary>
182
                /// Observation coverage tag.
183
                /// </summary>
184
                [DxfCodeValue(307)]
185
                public string ObservationCoverageTag { get; set; } = string.Empty;
4✔
186

187
                /// <summary>
188
                /// Geo-Mesh points.
189
                /// </summary>
190
                [DxfCodeValue(DxfReferenceType.Count, 93)]
191
                public List<GeoMeshPoint> Points { get; } = new();
26✔
192

193
                /// <summary>
194
                /// Faces.
195
                /// </summary>
196
                [DxfCodeValue(DxfReferenceType.Count, 96)]
197
                public List<GeoMeshFace> Faces { get; } = new();
2✔
198

199
                private BlockRecord _hostBlock;
200
        }
201
}
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