VR-Forces 4.6.1 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
include
gdb
tree.h
Go to the documentation of this file.
1
/*********************************************************************
2
** Copyright (c) 1999 MaK Technologies, Inc.
3
** All rights reserved.
4
*********************************************************************/
5
/*********************************************************************
6
** $RCSfile: tree.h,v $ $Revision: 1.6 $ $State: Exp $
7
*********************************************************************/
8
#ifndef tree_H_
9
#define tree_H_
10
11
#include "
gdb/gdbDefines.h
"
12
#include "
gdb/gdbCulturalFeature.h
"
13
#include "
geometry/homogeneousTransformMatrix.h
"
14
#include "
geometry/point.h
"
15
16
enum
DtTreeType
17
{
18
DECIDUOUS
,
19
CONIFEROUS
,
20
BUSH_OR_SHRUB
21
};
22
23
// class DtTree:
24
//
25
// Instances of DtTree are
26
class
DT_DLL_gdb
DtTree
:
public
DtGdbCulturalFeature
27
{
28
public
:
29
30
// default constructor
31
DtTree
();
32
33
// destructor
34
virtual
~
DtTree
();
35
36
private
:
37
// copy constructor - unimplemented
38
DtTree
(
const
DtTree
& orig);
39
40
// assignment operator - unimplemented
41
DtTree
&
operator=
(
const
DtTree
& orig);
42
43
public
:
44
//accessors/mutators
45
46
//set/get functions for tree type
47
virtual
DtTreeType
treeType()
const
;
48
virtual
void
setTreeType(
DtTreeType
newTreeType);
49
50
// set/get the location of the tree
51
virtual
const
DtPoint
& location()
const
;
52
virtual
void
setLocation(
const
DtPoint
& p);
53
54
// set/get the height of trunk of the tree
55
virtual
double
trunkHeight()
const
;
56
virtual
void
setTrunkHeight(
double
h);
57
58
// set/get the width of trunk of the tree
59
virtual
double
trunkWidth()
const
;
60
virtual
void
setTrunkWidth(
double
w);
61
62
// set/get the height of foliage of the tree
63
virtual
double
foliageHeight()
const
;
64
virtual
void
setFoliageHeight(
double
h);
65
66
// set/get the width of foliage of the tree
67
virtual
double
foliageWidth()
const
;
68
virtual
void
setFoliageWidth(
double
w);
69
70
// set/get the foliage density of the tree
71
virtual
double
foliageDensity()
const
;
72
virtual
void
setFoliageDensity(
double
d);
73
74
// obtain the extent of the tree
75
virtual
DtExtent
extent
()
const
;
76
77
// redefine the input extent to include the tree
78
virtual
void
expandExtent
(
DtExtent
& extent)
const
;
79
80
// debugging aid
81
virtual
void
dump
(
int
indentLevel)
const
;
82
83
// Applies the specified transform to its location.
84
// Ignores the flag.
85
// NOTE: Does NOT transform ANY of the other parameters
86
// Returns false if the transformation fails for any reason.
87
virtual
bool
applyTransform
(
const
DtHomogeneousTransformMatrix
& matrix,
88
bool
createNewVertices);
89
90
protected
:
91
92
DtPoint
myLocation
;
93
DtTreeType
myTreeType
;
94
double
myTrunkHeight
;
95
double
myTrunkWidth
;
96
double
myFoliageHeight
;
97
double
myFoliageWidth
;
98
double
myFoliageDensity
;
// a real between 0 and 1
99
100
};
101
102
inline
DtTreeType
DtTree::treeType
()
const
103
{
104
return
myTreeType
;
105
}
106
107
inline
void
DtTree::setTreeType
(
DtTreeType
newTreeType)
108
{
109
myTreeType
= newTreeType;
110
}
111
112
inline
const
DtPoint
&
DtTree::location
()
const
113
{
114
return
(
myLocation
);
115
}
116
117
inline
void
DtTree::setLocation
(
const
DtPoint
& p)
118
{
119
myLocation
= p;
120
}
121
122
inline
double
DtTree::trunkHeight
()
const
123
{
124
return
myTrunkHeight
;
125
}
126
127
inline
void
DtTree::setTrunkHeight
(
double
h)
128
{
129
myTrunkHeight
= h;
130
}
131
132
inline
double
DtTree::trunkWidth
()
const
133
{
134
return
myTrunkWidth
;
135
}
136
137
inline
void
DtTree::setTrunkWidth
(
double
w)
138
{
139
myTrunkWidth
= w;
140
}
141
142
inline
double
DtTree::foliageHeight
()
const
143
{
144
return
myFoliageHeight
;
145
}
146
147
inline
void
DtTree::setFoliageHeight
(
double
h)
148
{
149
myFoliageHeight
= h;
150
}
151
152
inline
double
DtTree::foliageWidth
()
const
153
{
154
return
myFoliageWidth
;
155
}
156
157
inline
void
DtTree::setFoliageWidth
(
double
w)
158
{
159
myFoliageWidth
= w;
160
}
161
162
inline
double
DtTree::foliageDensity
()
const
163
{
164
return
myFoliageDensity
;
165
}
166
167
inline
void
DtTree::setFoliageDensity
(
double
d)
168
{
169
myFoliageDensity
= d;
170
}
171
#endif
Document ID: Generated on Wed Jul 25 16:57:45 EDT 2018 from SVN revision 190790
Copyright © 2005-2018 VT MÄK. All Rights Reserved (
www.mak.com
)