VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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"
14 #include "geometry/point.h"
15 
17 {
21 };
22 
23 // class DtTree:
24 //
25 // Instances of DtTree are
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 
94  double myTrunkHeight;
95  double myTrunkWidth;
98  double myFoliageDensity; // a real between 0 and 1
99 
100 };
101 
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
virtual void setFoliageWidth(double w)
Definition: tree.h:157
virtual double foliageDensity() const
Definition: tree.h:162
Definition: gdbCulturalFeature.h:22
virtual bool applyTransform(const DtHomogeneousTransformMatrix &matrix, bool createNewVertices)
double myFoliageHeight
Definition: tree.h:96
virtual void setTrunkHeight(double h)
Definition: tree.h:127
DtPoint myLocation
Definition: tree.h:92
DtGdbCulturalFeature & operator=(const DtGdbCulturalFeature &orig)
DtTreeType myTreeType
Definition: tree.h:93
double myFoliageDensity
Definition: tree.h:98
Definition: tree.h:18
The DtExtent represents an axis-aligned 3d bounding box.
Definition: extent.h:43
Definition: tree.h:20
#define DT_DLL_gdb
Definition: gdbDefines.h:25
virtual double trunkHeight() const
Definition: tree.h:122
virtual void setTrunkWidth(double w)
Definition: tree.h:137
virtual double trunkWidth() const
Definition: tree.h:132
double myFoliageWidth
Definition: tree.h:97
virtual void setTreeType(DtTreeType newTreeType)
Definition: tree.h:107
virtual const DtPoint & location() const
Definition: tree.h:112
Definition: tree.h:26
virtual void setLocation(const DtPoint &p)
Definition: tree.h:117
DtExtent extent() const
Definition: group.h:239
virtual double foliageWidth() const
Definition: tree.h:152
virtual void expandExtent(DtExtent &extent) const
double myTrunkHeight
Definition: tree.h:94
virtual void setFoliageHeight(double h)
Definition: tree.h:147
virtual void dump(int indentLevel) const
DtTreeType
Definition: tree.h:16
virtual DtTreeType treeType() const
Definition: tree.h:102
double myTrunkWidth
Definition: tree.h:95
Definition: homogeneousTransformMatrix.h:25
virtual double foliageHeight() const
Definition: tree.h:142
Definition: tree.h:19
Definition: point.h:34
virtual void setFoliageDensity(double d)
Definition: tree.h:167

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)