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

DomCR / ACadSharp / 13115488098

03 Feb 2025 02:16PM UTC coverage: 75.824% (-0.4%) from 76.226%
13115488098

push

github

web-flow
Merge pull request #546 from DomCR/issue-529_geodata

Issue 529 geodata

5407 of 7857 branches covered (68.82%)

Branch coverage included in aggregate %.

178 of 394 new or added lines in 14 files covered. (45.18%)

2 existing lines in 1 file now uncovered.

21455 of 27570 relevant lines covered (77.82%)

39131.95 hits per line

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

72.92
/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
        /// <summary>
11
        /// Represents a <see cref="GeoData"/> object
12
        /// </summary>
13
        /// <remarks>
14
        /// Object name <see cref="DxfFileToken.ObjectGeoData"/> <br/>
15
        /// Dxf class name <see cref="DxfSubclassMarker.GeoData"/>
16
        /// </remarks>
17
        [DxfName(DxfFileToken.ObjectGeoData)]
18
        [DxfSubClass(DxfSubclassMarker.GeoData)]
19
        public partial class GeoData : NonGraphicalObject
20
        {
21
                /// <inheritdoc/>
NEW
22
                public override ObjectType ObjectType { get { return ObjectType.UNLISTED; } }
×
23

24
                /// <inheritdoc/>
NEW
25
                public override string ObjectName => DxfFileToken.ObjectGeoData;
×
26

27
                /// <inheritdoc/>
28
                public override string SubclassMarker => DxfSubclassMarker.GeoData;
60✔
29

30
                /// <summary>
31
                /// AcDbGeoData Object version.
32
                /// </summary>
33
                /// <remarks>
34
                /// 1 - 2009 <br/>
35
                /// 2 - 2010 <br/>
36
                /// 3 - 2013
37
                /// </remarks>
38
                [DxfCodeValue(90)]
39
                public GeoDataVersion Version { get; set; } = GeoDataVersion.R2013;
14✔
40

41
                /// <summary>
42
                /// Type of design coordinates.
43
                /// </summary>
44
                [DxfCodeValue(70)]
45
                public DesignCoordinatesType CoordinatesType { get; set; } = DesignCoordinatesType.LocalGrid;
6✔
46

47
                /// <summary>
48
                /// Host block table record.
49
                /// </summary>
50
                public BlockRecord HostBlock
51
                {
NEW
52
                        get { return this._hostBlock; }
×
53
                        set
54
                        {
1✔
55
                                if (value == null)
1!
NEW
56
                                {
×
NEW
57
                                        throw new ArgumentNullException(nameof(value));
×
58
                                }
59

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

71
                /// <summary>
72
                /// Design point, reference point in WCS coordinates.
73
                /// </summary>
74
                [DxfCodeValue(10, 20, 30)]
75
                public XYZ DesignPoint { get; set; }
13✔
76

77
                /// <summary>
78
                /// Reference point in coordinate system coordinates, valid only when coordinate type is Local Grid.
79
                /// </summary>
80
                [DxfCodeValue(11, 21, 31)]
81
                public XYZ ReferencePoint { get; set; }
22✔
82

83
                /// <summary>
84
                /// North direction vector.
85
                /// </summary>
86
                [DxfCodeValue(12, 22)]
87
                public XY NorthDirection { get; set; } = XY.AxisY;
9✔
88

89
                /// <summary>
90
                /// Horizontal unit scale, factor which converts horizontal design coordinates to meters by multiplication.
91
                /// </summary>
92
                [DxfCodeValue(41)]
93
                public double HorizontalUnitScale { get; set; } = 1;
6✔
94

95
                /// <summary>
96
                /// Vertical unit scale, factor which converts vertical design coordinates to meters by multiplication.
97
                /// </summary>
98
                [DxfCodeValue(40)]
99
                public double VerticalUnitScale { get; set; } = 1;
5✔
100

101
                /// <summary>
102
                /// Horizontal units.
103
                /// </summary>
104
                [DxfCodeValue(91)]
105
                public UnitsType HorizontalUnits { get; set; } = UnitsType.Meters;
7✔
106

107
                /// <summary>
108
                /// Vertical units.
109
                /// </summary>
110
                [DxfCodeValue(92)]
111
                public UnitsType VerticalUnits { get; set; } = UnitsType.Meters;
4✔
112

113
                /// <summary>
114
                /// Up direction.
115
                /// </summary>
116
                [DxfCodeValue(210, 220, 230)]
117
                public XYZ UpDirection { get; set; } = XYZ.AxisZ;
16✔
118

119
                /// <summary>
120
                /// Scale estimation method.
121
                /// </summary>
122
                [DxfCodeValue(95)]
123
                public ScaleEstimationType ScaleEstimationMethod { get; set; } = ScaleEstimationType.None;
6✔
124

125
                /// <summary>
126
                /// Bool flag specifying whether to do sea level correction.
127
                /// </summary>
128
                [DxfCodeValue(294)]
129
                public bool EnableSeaLevelCorrection { get; set; }
3✔
130

131
                /// <summary>
132
                /// User specified scale factor.
133
                /// </summary>
134
                [DxfCodeValue(141)]
135
                public double UserSpecifiedScaleFactor { get; set; }
3✔
136

137
                /// <summary>
138
                /// Sea level elevation.
139
                /// </summary>
140
                [DxfCodeValue(142)]
141
                public double SeaLevelElevation { get; set; }
3✔
142

143
                /// <summary>
144
                /// Coordinate projection radius.
145
                /// </summary>
146
                [DxfCodeValue(143)]
147
                public double CoordinateProjectionRadius { get; set; }
3✔
148

149
                /// <summary>
150
                /// Coordinate system definition string.
151
                /// </summary>
152
                [DxfCodeValue(301)]
153
                public string CoordinateSystemDefinition { get; set; } = string.Empty;
32✔
154

155
                /// <summary>
156
                /// GeoRSS tag.
157
                /// </summary>
158
                [DxfCodeValue(302)]
159
                public string GeoRssTag { get; set; } = string.Empty;
6✔
160

161
                /// <summary>
162
                /// Observation from tag.
163
                /// </summary>
164
                [DxfCodeValue(305)]
165
                public string ObservationFromTag { get; set; } = string.Empty;
6✔
166

167
                /// <summary>
168
                /// Observation to tag.
169
                /// </summary>
170
                [DxfCodeValue(306)]
171
                public string ObservationToTag { get; set; } = string.Empty;
6✔
172

173
                /// <summary>
174
                /// Observation coverage tag.
175
                /// </summary>
176
                [DxfCodeValue(307)]
177
                public string ObservationCoverageTag { get; set; } = string.Empty;
6✔
178

179
                /// <summary>
180
                /// Geo-Mesh points.
181
                /// </summary>
182
                [DxfCodeValue(DxfReferenceType.Count, 93)]
183
                public List<GeoMeshPoint> Points { get; } = new();
39✔
184

185
                /// <summary>
186
                /// Faces.
187
                /// </summary>
188
                [DxfCodeValue(DxfReferenceType.Count, 96)]
189
                public List<GeoMeshFace> Faces { get; } = new();
3✔
190

191
                private BlockRecord _hostBlock;
192

193
                internal override void AssignDocument(CadDocument doc)
194
                {
3✔
195
                        //TODO: the assigned block is always the owner of the dictionary??
196
                        base.AssignDocument(doc);
3✔
197
                }
3✔
198

199
                internal override void UnassignDocument()
NEW
200
                {
×
NEW
201
                        base.UnassignDocument();
×
NEW
202
                }
×
203
        }
204
}
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