VR-Forces 4.5 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
include
dted
dtedCell.h
Go to the documentation of this file.
1
/*********************************************************************
2
** Copyright (c) 1998 MAK Technologies, Inc.
3
** All rights reserved.
4
*********************************************************************/
5
/*********************************************************************
6
** $RCSfile: dtedCell.h,v $ $Revision: 1.11 $ $State: Exp $
7
*********************************************************************/
8
#ifndef dtedCell_H_
9
#define dtedCell_H_
10
11
#include "
dted/dtedDefines.h
"
12
#include "
geometry/point.h
"
13
14
// Forward declarations
15
class
DtDtedReader
;
16
class
DtGroup
;
17
class
DtTriangleIndirect
;
18
class
DtGdbNode
;
19
class
DtUtmReferencePoint;
20
21
struct
DtUhlRecord
22
{
23
public
:
24
char
Id
[3];
25
char
Reserved1
[1];
26
char
LonOrigin
[8];
27
char
LatOrigin
[8];
28
char
LonDataInterval
[4];
29
char
LatDataInterval
[4];
30
char
AbsVerticalAcc
[4];
31
char
SecurityCode
[3];
32
char
UniqueRef
[12];
33
char
NumLonLines
[4];
34
char
NumLatLines
[4];
35
char
MultAcc
[1];
36
char
Reserved2
[24];
37
};
38
39
40
struct
DtDsiRecord
41
{
42
public
:
43
char
Id
[3];
44
char
SecurityCode
[1];
45
char
SecurityControl
[2];
46
char
SecurityHandling
[27];
47
char
Reserved1
[26];
48
char
DMASeries
[5];
49
char
UniqueRef
[15];
50
char
Reserved2
[8];
51
char
DataEditionNumber
[2];
52
char
MatchMergeVersion
[1];
53
char
MaintenanceDate
[4];
54
char
MatchMergeDate
[4];
55
char
MaintenanceDesc
[4];
56
char
ProducerCode
[8];
57
char
Reserved3
[16];
58
char
ProductSpecification
[9];
59
char
ProductSpecificationAmendment
[2];
60
char
ProductSpecificationDate
[4];
61
char
VerticalDatum
[3];
62
char
HorizontalDatum
[5];
63
char
FreeText
[10];
64
char
CompilationDate
[4];
65
char
Reserved4
[22];
66
char
LatDataOrigin
[9];
67
char
LonDataOrigin
[10];
68
char
LatSWCorner
[7];
69
char
LonSWCorner
[8];
70
char
LatNWCorner
[7];
71
char
LonNWCorner
[8];
72
char
LatNECorner
[7];
73
char
LonNECorner
[8];
74
char
LatSECorner
[7];
75
char
LonSECorner
[8];
76
char
ClockWiseOrientation
[9];
77
char
LatInterval
[4];
78
char
LonInterval
[4];
79
char
NumLatLines
[4];
80
char
NumLonLines
[4];
81
char
PartialCellIndicator
[2];
82
char
Reserved5
[101];
83
char
Reserved6
[100];
84
char
Reserved7
[156];
85
};
86
87
88
struct
DtAccRecord
89
{
90
public
:
91
char
Id
[3];
92
char
AbsHorzAcc
[4];
93
char
AbsVertAcc
[4];
94
char
RelHorzAcc
[4];
95
char
RelVertAcc
[4];
96
char
Reserved1
[36];
97
char
MultipleAccOutline
[2];
98
char
Reserved2
[2643];
// ???
99
};
100
101
102
struct
DtDmaDataRecord
103
{
104
public
:
105
char
Id
[1];
106
char
BlockCount
[3];
107
char
LonCount
[2];
108
char
LatCount
[2];
109
};
110
111
112
class
DT_DLL_dted
DtMapData
113
{
114
public
:
115
short
**
myElevationGrid
;
116
};
117
118
119
class
DT_DLL_dted
DtDtedCellData
120
{
121
public
:
122
double
SELat
;
123
double
SELon
;
124
double
SWLat
;
125
double
SWLon
;
126
double
NELat
;
127
double
NELon
;
128
double
NWLat
;
129
double
NWLon
;
130
double
CenterLat
;
131
double
CenterLon
;
132
133
double
LatInterval
;
134
double
LonInterval
;
135
136
long
NumLatPoints
;
137
long
NumLonPoints
;
138
long
NumPoints
;
139
140
short
MinElevation
;
141
short
MaxElevation
;
142
143
char
Series[6];
144
145
short
AbsHorzAcc
;
146
short
AbsVertAcc
;
147
short
RelHorzAcc
;
148
short
RelVertAcc
;
149
};
150
151
152
//
153
// Instances of DtDtedCell are individual dted files loaded into memory.
154
class
DT_DLL_dted
DtDtedCell
155
{
156
public
:
157
// constructor
158
DtDtedCell
();
159
160
// destructor
161
virtual
~
DtDtedCell
();
162
163
// Read the Defense Mapping Agency (DMA) terrain elevation file and build
164
// the data structures for a DtDtedCell file. Convert data to DtDtedCell
165
// form where necessary. Allocate memory appropriately, and free local
166
// structures upon completion.
167
virtual
bool
readDma(
const
char
* DMAFile);
168
169
// the following builds a triangle-based node and returns it. It is the
170
// responsibility of the receiver to delete the returned object.
171
virtual
DtGdbNode
* utmTriNode(
const
int
postSpacing,
double
lowColorHeight,
172
double
highColorHeight,
bool
reliefShading,
double
minLatitude,
173
double
maxLatitude,
double
minLongitude,
double
maxLongitude,
DtDtedReader
* reader);
174
175
// the following builds a geodetic triangle-based node and returns it.
176
// It is the responsibility of the receiver to delete the returned object.
177
virtual
DtGdbNode
* geoTriNode(
int
postSpacing,
double
lowColorHeight,
178
double
highColorHeight,
bool
reliefShading,
double
minLatitude,
179
double
maxLatitude,
double
minLongitude,
double
maxLongitude,
DtDtedReader
* reader);
180
181
// the following builds a flat earth triangle-based node and returns it.
182
// It is the responsibility of the receiver to delete the returned object.
183
virtual
DtGdbNode
* flatEarthTriNode(
int
postSpacing,
double
lowColorHeight,
184
double
highColorHeight,
bool
reliefShading,
double
minLatitude,
185
double
maxLatitude,
double
minLongitude,
double
maxLongitude,
DtDtedReader
* reader);
186
187
// get the south west latitude and longitude in degrees
188
virtual
double
swLat();
189
virtual
double
swLon();
190
191
protected
:
192
// copy constructor
193
DtDtedCell
(
const
DtDtedCell
& orig);
194
195
// assignment operator
196
DtDtedCell
& operator=(
const
DtDtedCell
& orig);
197
198
// Extract the DMA Accuracy figure from the ascii data which is in
199
// the DMA raw data.
200
virtual
short
cvDmaAccuracy(
char
DMAAccuracy[]);
201
202
// Extract the DMA Interval figure from the ascii data which is in
203
// the DMA raw data.
204
virtual
float
cvDmaInterval(
char
DMAInterval[]);
205
206
// Extract the DMA Latitude figure from the ascii data which is in
207
// the DMA raw data.
208
virtual
float
cvDmaLat(
char
DMALat[]);
209
210
// Extract the DMA Longitude figure from the ascii data which is in
211
// the DMA raw data.
212
virtual
float
cvDmaLon(
char
DMALon[]);
213
214
// allocate the lowest-level groups and fill each with two triangles
215
virtual
bool
fillGroupsWithTris(
DtGroup
**& groups,
int
gridWidth,
216
int
gridHeight,
double
lowColorHeight,
double
highColorHeight,
217
bool
reliefShading,
int
vertexIDOffset,
DtDtedReader
* reader);
218
219
// The following fills the reader's terrainDb's vertex manager with
220
// vertices in UTM coordinates based on the incoming dimensions and
221
// post spacing. It also calculates and returns the gridWidth
222
// and gridHeight.
223
virtual
bool
buildUTMVertexManager(
int
& gridWidth,
224
int
& gridHeight,
int
postSpacing,
double
minLatitude,
225
double
maxLatitude,
double
minLongitude,
double
maxLongitude,
226
DtDtedReader
* reader);
227
228
// The following fills the reader's terrainDb's vertex manager with
229
// vertices in Geodetic coordinates based on the incoming dimensions
230
// and post spacing. It also calculates and returns the gridWidth
231
// and gridHeight.
232
virtual
bool
buildGeodeticVertexManager(
int
& gridWidth,
233
int
& gridHeight,
int
postSpacing,
double
minLatitude,
234
double
maxLatitude,
double
minLongitude,
double
maxLongitude,
235
DtDtedReader
* reader);
236
237
// The following fills the reader's terrainDb's vertex manager with
238
// vertices in Geodetic coordinates based on the incoming dimensions
239
// and post spacing. It also calculates and returns the gridWidth
240
// and gridHeight.
241
virtual
bool
buildFlatEarthVertexManager(
int
& gridWidth,
242
int
& gridHeight,
int
postSpacing,
double
minLatitude,
243
double
maxLatitude,
double
minLongitude,
double
maxLongitude,
244
DtDtedReader
* reader);
245
246
// Set the surface for the triangle as a function of vertex heights
247
virtual
bool
setTriangleSurface(
DtTriangleIndirect
* tri,
248
unsigned
int
numSurfaces,
double
lowColorHeight,
double
highColorHeight,
249
bool
releifShading);
250
251
// builds a balanced tree. topGroup is the parent; groups is an array
252
// of pointers to all the low-level groups; numLonGroups is the total
253
// number of groups running west to east; numLatGroups is the total
254
// number of groups running south to north; westLonGroup is the west-most
255
// group number; eastLonGroup is the east-most group number; southLatGroup
256
// is the south-most group number; and northLatGroup is the north-most
257
// group number.
258
virtual
void
balance(
DtGroup
* topGroup,
DtGroup
** groups,
259
unsigned
int
numLatGroups,
unsigned
int
westLonGroup,
260
unsigned
int
eastLonGroup,
unsigned
int
southLatGroup,
261
unsigned
int
northLatGroup,
DtDtedReader
* reader);
262
263
protected
:
264
DtDtedCellData
myHeader
;
265
DtMapData
*
myMapData
;
266
267
int
myGridpostListWidth
;
268
int
myGridpostListHeight
;
269
270
// The minimum size (along both the width and height dimension) of
271
// a grid patch.
272
static
const
int
theGridPatchSizeThreshold
;
273
};
274
275
#endif
Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (
www.mak.com
)