VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
extentReader.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2005 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 /******************************************************************************
6 ** $RCSfile: extentReader.h,v $ $Revision: 1.5 $ $State: Exp $
7 ******************************************************************************/
8 #ifndef extentReader_H_
9 #define extentReader_H_
10 
11 //
12 // \file extentReader.h
13 // \brief Contains the DtExtentReader class declaration.
14 //
15 
16 #include "gdb/gdbDefines.h"
17 #include "gdb/terrainReader.h"
18 
21 class DtTerrainDatabase;
22 class DtFilename;
23 
24 
25 //
26 // The DtExtentReader class is responsible for creating a simple terrain with
27 // the coordinate system and extent specified in the initializer. Note that
28 // the default is to create a geodetic terrain with the maximum extents defined
29 // for the initializer.
31 {
32 public:
34 
35  virtual ~DtExtentReader();
36 
37 private:
38  // Copy constructor and Assignment operator not implemented. This class is
39  // not copyable or assignable
40  DtExtentReader(const DtExtentReader& original);
41  const DtExtentReader& operator=(const DtExtentReader& original);
42 
43 public:
44  // Loads terrain database file named filename, returning the data in
45  // terrain. The terrain pointer passed in must be initialized before calling
46  // loadTerrain.
47  virtual bool loadTerrain(const DtFilename& filename, DtTerrainDatabase* terrain);
48 
49  // Loads terrain database file named filename, returning the data in
50  // terrain. The initializer object is used to pass in additional information
51  // about the terrain to be loaded. The terrain pointer passed in must be
52  // initialized before calling loadTerrain.
53  virtual bool loadTerrain(const DtFilename& filename, DtTerrainDatabase* terrain,
54  const DtTerrainInitializer* initializer);
55 
56  bool loadTerrain(DtTerrainDatabase& terrainDb,
57  const DtExtentInitializer& extentInitializer);
58 
59  bool createCoordinateSystem(DtTerrainDatabase& terrainDb,
60  const DtExtentInitializer& extentInitializer);
61 
62  // Creates two terrain triangles formed from the specified extent. The
63  // altitude of the vertices is determined by the altitude of the left, back,
64  // bottom vertex and the right, front, upper vertex. These are used as the
65  // SW and NE vertices respectively. The altitude of the SE vertex matches
66  // the altitude of the SW vertex and the altitude of the NW vertex equals the
67  // altitude of the NE vertex.
68  //
69  // (NW) *----------* (NE)
70  // |\ |
71  // | \ |
72  // | \ |
73  // | \ |
74  // | \ |
75  // | \ |
76  // | \ |
77  // | \ |
78  // | \ |
79  // | \|
80  // (SW) *----------* (SE)
81  //
82  bool createTerrain(DtTerrainDatabase& terrainDb,
83  const DtExtentInitializer& extentInitializer);
84 
85  // Returns "extent"
86  virtual const DtString dataType() const;
87 
88  // Returns only the coordinate system that would define this database. Should not load
89  // any polygonal or vector information
90  virtual Coordinate_System* coordinateSystem(const DtFilename& filename);
91 
92  static DtTerrainReader* create();
93 
94  virtual int optionalFileFlags(const DtFilename& filename)
95  {
96  return 0;
97  }
98 
99 protected:
100  bool testInvariant() const;
101 
102 private:
103 };
104 
105 inline const DtString DtExtentReader::dataType() const
106 {
107  return "extent";
108 }
109 
110 
111 #endif
#define DT_DLL_gdb
Definition: gdbDefines.h:25
virtual const DtString dataType() const =0
virtual bool loadTerrain(const DtFilename &filename, DtTerrainDatabase *terrain)=0
Definition: coordSystem.h:54
Definition: terrainReader.h:41
Definition: extentReader.h:30
virtual int optionalFileFlags(const DtFilename &filename)
Definition: extentReader.h:94
Definition: terrainInitializer.h:16
virtual Coordinate_System * coordinateSystem(const DtFilename &filename)=0
Definition: extentInitializer.h:22
Definition: terrainDatabase.h:148
virtual const DtString dataType() const
Definition: extentReader.h:105
DtTerrainReader & operator=(const DtTerrainReader &orig)

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)