VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
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 
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];
53  char MaintenanceDate[4];
54  char MatchMergeDate[4];
55  char MaintenanceDesc[4];
56  char ProducerCode[8];
57  char Reserved3[16];
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];
77  char LatInterval[4];
78  char LonInterval[4];
79  char NumLatLines[4];
80  char NumLonLines[4];
82  char Reserved5[101];
83  char Reserved6[100];
84  char Reserved7[156];
85 };
86 
87 
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];
98  char Reserved2[2643]; // ???
99 };
100 
101 
103 {
104 public:
105  char Id[1];
106  char BlockCount[3];
107  char LonCount[2];
108  char LatCount[2];
109 };
110 
111 
113 {
114 public:
116 };
117 
118 
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 
138  long NumPoints;
139 
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.
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:
266 
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
char Id[3]
Definition: dtedCell.h:24
char MultipleAccOutline[2]
Definition: dtedCell.h:97
double LonInterval
Definition: dtedCell.h:134
char MaintenanceDesc[4]
Definition: dtedCell.h:55
char MatchMergeDate[4]
Definition: dtedCell.h:54
char LonInterval[4]
Definition: dtedCell.h:78
Definition: group.h:28
Definition: triangleIndirect.h:31
char AbsVerticalAcc[4]
Definition: dtedCell.h:30
double SELat
Definition: dtedCell.h:122
char NumLonLines[4]
Definition: dtedCell.h:80
Definition: dtedReader.h:22
char LatSWCorner[7]
Definition: dtedCell.h:68
char NumLatLines[4]
Definition: dtedCell.h:79
double NWLat
Definition: dtedCell.h:128
int myGridpostListWidth
Definition: dtedCell.h:267
char UniqueRef[12]
Definition: dtedCell.h:32
Definition: gdbNode.h:44
char UniqueRef[15]
Definition: dtedCell.h:49
char Reserved2[8]
Definition: dtedCell.h:50
Definition: dtedCell.h:119
char DMASeries[5]
Definition: dtedCell.h:48
long NumLonPoints
Definition: dtedCell.h:137
char NumLonLines[4]
Definition: dtedCell.h:33
long NumPoints
Definition: dtedCell.h:138
char Reserved1[36]
Definition: dtedCell.h:96
char LonSWCorner[8]
Definition: dtedCell.h:69
DtDtedCellData myHeader
Definition: dtedCell.h:264
char LatOrigin[8]
Definition: dtedCell.h:27
char Reserved7[156]
Definition: dtedCell.h:84
static const int theGridPatchSizeThreshold
Definition: dtedCell.h:272
char SecurityHandling[27]
Definition: dtedCell.h:46
char MaintenanceDate[4]
Definition: dtedCell.h:53
char ProducerCode[8]
Definition: dtedCell.h:56
Definition: dtedCell.h:154
char MultAcc[1]
Definition: dtedCell.h:35
char LonDataInterval[4]
Definition: dtedCell.h:28
char Reserved1[1]
Definition: dtedCell.h:25
char Reserved2[24]
Definition: dtedCell.h:36
char LonNWCorner[8]
Definition: dtedCell.h:71
char LonDataOrigin[10]
Definition: dtedCell.h:67
double SELon
Definition: dtedCell.h:123
char MatchMergeVersion[1]
Definition: dtedCell.h:52
char LatDataInterval[4]
Definition: dtedCell.h:29
char SecurityControl[2]
Definition: dtedCell.h:45
short AbsVertAcc
Definition: dtedCell.h:146
char NumLatLines[4]
Definition: dtedCell.h:34
#define DT_DLL_dted
Definition: dtedDefines.h:23
double CenterLon
Definition: dtedCell.h:131
char HorizontalDatum[5]
Definition: dtedCell.h:62
char LonOrigin[8]
Definition: dtedCell.h:26
char LonCount[2]
Definition: dtedCell.h:107
char Reserved4[22]
Definition: dtedCell.h:65
double CenterLat
Definition: dtedCell.h:130
char Id[1]
Definition: dtedCell.h:105
char Reserved3[16]
Definition: dtedCell.h:57
char LonNECorner[8]
Definition: dtedCell.h:73
double SWLon
Definition: dtedCell.h:125
char SecurityCode[1]
Definition: dtedCell.h:44
Definition: dtedCell.h:88
short RelHorzAcc
Definition: dtedCell.h:147
char Reserved1[26]
Definition: dtedCell.h:47
char LatInterval[4]
Definition: dtedCell.h:77
double NWLon
Definition: dtedCell.h:129
char AbsVertAcc[4]
Definition: dtedCell.h:93
char Id[3]
Definition: dtedCell.h:91
char FreeText[10]
Definition: dtedCell.h:63
short MaxElevation
Definition: dtedCell.h:141
short RelVertAcc
Definition: dtedCell.h:148
char LatNWCorner[7]
Definition: dtedCell.h:70
double LatInterval
Definition: dtedCell.h:133
char PartialCellIndicator[2]
Definition: dtedCell.h:81
char DataEditionNumber[2]
Definition: dtedCell.h:51
char LatDataOrigin[9]
Definition: dtedCell.h:66
char VerticalDatum[3]
Definition: dtedCell.h:61
Definition: dtedCell.h:21
Definition: dtedCell.h:102
char ProductSpecification[9]
Definition: dtedCell.h:58
char LatSECorner[7]
Definition: dtedCell.h:74
char Id[3]
Definition: dtedCell.h:43
char ProductSpecificationDate[4]
Definition: dtedCell.h:60
short MinElevation
Definition: dtedCell.h:140
char BlockCount[3]
Definition: dtedCell.h:106
int myGridpostListHeight
Definition: dtedCell.h:268
Definition: dtedCell.h:40
double NELon
Definition: dtedCell.h:127
double NELat
Definition: dtedCell.h:126
char SecurityCode[3]
Definition: dtedCell.h:31
char RelVertAcc[4]
Definition: dtedCell.h:95
Definition: dtedCell.h:112
char ProductSpecificationAmendment[2]
Definition: dtedCell.h:59
char RelHorzAcc[4]
Definition: dtedCell.h:94
DtMapData * myMapData
Definition: dtedCell.h:265
double SWLat
Definition: dtedCell.h:124
short ** myElevationGrid
Definition: dtedCell.h:115
char ClockWiseOrientation[9]
Definition: dtedCell.h:76
char Reserved5[101]
Definition: dtedCell.h:82
char CompilationDate[4]
Definition: dtedCell.h:64
char Reserved6[100]
Definition: dtedCell.h:83
char AbsHorzAcc[4]
Definition: dtedCell.h:92
char LatCount[2]
Definition: dtedCell.h:108
char LonSECorner[8]
Definition: dtedCell.h:75
char LatNECorner[7]
Definition: dtedCell.h:72
short AbsHorzAcc
Definition: dtedCell.h:145
char Reserved2[2643]
Definition: dtedCell.h:98
long NumLatPoints
Definition: dtedCell.h:136

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)