VR-Forces 4.1 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
include
gdb
terrainReader.h
Go to the documentation of this file.
1
/*********************************************************************
2
** Copyright (c) 1999 MAK Technologies, Inc.
3
** All rights reserved.
4
*******************************************************************************/
5
/*******************************************************************************
6
** $RCSfile: terrainReader.h,v $ $Revision: 1.21 $ $State: Exp $
7
*******************************************************************************/
8
#ifndef terrainReader_H_
9
#define terrainReader_H_
10
11
// \file terrainReader.h
12
// \brief Contains the DtTerrainReader class declaration.
13
14
#include "
gdb/gdbDefines.h
"
15
#include <vlutil/vlFilename.h>
16
17
enum
DtTerrainFileVersionNumber
18
{
19
OLD_TDB_FILE_FORMAT_VERSION
= 100,
20
TDB_FILE_FORMAT_VERSION
= 200,
21
TDB_FILENODE_VERSION
= 201,
22
TDB_DATA_FLAGS_VERSION
= 202,
23
TDB_VECTOR_DATA_VERSION
= 203,
24
TDB_204_VERSION
= 204,
25
TDB_205_VERSION
= 205,
26
TDB_206_VERSION
= 206,
27
TDB_207_VERSION
= 207,
28
TDB_208_VERSION
= 208,
29
TDB_209_VERSION
= 209,
30
TDB_210_VERSION
= 210
31
};
32
33
34
class
DtTerrainDatabase
;
35
class
DtTerrainInitializer
;
36
class
DtTerrainFileInitializer
;
37
class
Coordinate_System
;
38
39
//
40
// DtTerrainReader is an abstract class that represents a reader for any format
41
class
DT_DLL_gdb
DtTerrainReader
42
{
43
public
:
44
45
// default constructor
46
DtTerrainReader
();
47
48
// Loads terrain database file named filename, returning the data in
49
// terrain. The terrain pointer passed in must be initialized before calling
50
// loadTerrain.
51
virtual
bool
loadTerrain(
const
DtFilename& filename,
52
DtTerrainDatabase
* terrain) = 0;
53
54
// Loads terrain database file named filename, returning the data in
55
// terrain. The initializer object is used to pass in additional information
56
// about the terrain to be loaded. The terrain pointer passed in must be
57
// initialized before calling loadTerrain.
58
virtual
bool
loadTerrain(
const
DtFilename& filename,
59
DtTerrainDatabase
* terrain,
60
const
DtTerrainInitializer
* initializer) = 0;
61
62
// destructor
63
virtual
~
DtTerrainReader
();
64
65
virtual
DtTerrainDatabase
*terrainDb();
66
67
// Pre-processes the terrain if specified in any way in the initializer, such
68
// as preallocating the expected number of vertices and surfaces to hold.
69
virtual
bool
preprocessTerrain(
const
DtTerrainFileInitializer
& terrainInitializer,
70
DtTerrainDatabase
& terrainDb)
const
;
71
72
virtual
const
DtString
dataType()
const
= 0;
73
74
void
setTerrainInitializer(
const
DtTerrainInitializer
* initializer);
75
const
DtTerrainInitializer
* terrainInitializer()
const
;
76
77
// Returns only the coordinate system that would define this database. Should not load
78
// any polygonal or vector information
79
virtual
Coordinate_System
* coordinateSystem(
const
DtFilename& filename) = 0;
80
81
// Returns only optional file flags. Should not load
82
// any polygonal or vector information
83
virtual
int
optionalFileFlags(
const
DtFilename& filename) = 0;
84
85
protected
:
86
87
// initialize the reader when loading, is called inside of loadTerrain
88
virtual
void
init
(
const
DtFilename& filename,
DtTerrainDatabase
* terrain);
89
90
// copy constructor
91
DtTerrainReader
(
const
DtTerrainReader
& orig);
92
93
// assignment operator
94
DtTerrainReader
& operator=(
const
DtTerrainReader
& orig);
95
96
protected
:
97
98
DtTerrainDatabase
*
myTerrainDatabase
;
99
DtFilename
myFilename
;
100
101
const
DtTerrainInitializer
*
myTerrainInitializer
;
102
};
103
104
inline
DtTerrainDatabase
*
DtTerrainReader::terrainDb
()
105
{
106
return
myTerrainDatabase
;
107
}
108
109
inline
void
DtTerrainReader::setTerrainInitializer
(
110
const
DtTerrainInitializer
* initializer)
111
{
112
myTerrainInitializer
= initializer;
113
}
114
115
inline
const
DtTerrainInitializer
*
DtTerrainReader::terrainInitializer
()
const
116
{
117
return
myTerrainInitializer
;
118
}
119
120
#endif
Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (
www.mak.com
)