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

DomCR / ACadSharp / 13075286726

31 Jan 2025 03:02PM UTC coverage: 76.172% (-0.05%) from 76.226%
13075286726

Pull #546

github

web-flow
Merge 63345678f into da8587f47
Pull Request #546: Issue 529 geodata

5344 of 7740 branches covered (69.04%)

Branch coverage included in aggregate %.

37 of 94 new or added lines in 5 files covered. (39.36%)

213 existing lines in 3 files now uncovered.

21339 of 27290 relevant lines covered (78.19%)

39476.62 hits per line

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

52.5
/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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

186
                private BlockRecord _hostBlock;
187
        }
188
}
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

© 2025 Coveralls, Inc