![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /********************************************************************* 00002 ** Copyright (c) 1999 MaK Technologies, Inc. 00003 ** All rights reserved. 00004 *********************************************************************/ 00005 /********************************************************************* 00006 ** $RCSfile: tree.h,v $ $Revision: 1.6 $ $State: Exp $ 00007 *********************************************************************/ 00008 #ifndef tree_H_ 00009 #define tree_H_ 00010 00011 #include "gdb/gdbDefines.h" 00012 #include "gdb/cultFeat.h" 00013 #include "geometry/matrix4x4.h" 00014 #include "geometry/point.h" 00015 00016 enum DtTreeType 00017 { 00018 DECIDUOUS, 00019 CONIFEROUS, 00020 BUSH_OR_SHRUB 00021 }; 00022 00023 // class DtTree: 00024 // 00025 // Instances of DtTree are 00026 class DT_DLL_gdb DtTree : public DtGdbCulturalFeature 00027 { 00028 public: 00029 00030 // default constructor 00031 DtTree(); 00032 00033 // destructor 00034 virtual ~DtTree(); 00035 00036 private: 00037 // copy constructor - unimplemented 00038 DtTree(const DtTree& orig); 00039 00040 // assignment operator - unimplemented 00041 DtTree& operator=(const DtTree& orig); 00042 00043 public: 00044 //accessors/mutators 00045 00046 //set/get functions for tree type 00047 virtual DtTreeType treeType() const; 00048 virtual void setTreeType(DtTreeType newTreeType); 00049 00050 // set/get the location of the tree 00051 virtual const DtPoint& location() const; 00052 virtual void setLocation(const DtPoint& p); 00053 00054 // set/get the height of trunk of the tree 00055 virtual double trunkHeight() const; 00056 virtual void setTrunkHeight(double h); 00057 00058 // set/get the width of trunk of the tree 00059 virtual double trunkWidth() const; 00060 virtual void setTrunkWidth(double w); 00061 00062 // set/get the height of foliage of the tree 00063 virtual double foliageHeight() const; 00064 virtual void setFoliageHeight(double h); 00065 00066 // set/get the width of foliage of the tree 00067 virtual double foliageWidth() const; 00068 virtual void setFoliageWidth(double w); 00069 00070 // set/get the foliage density of the tree 00071 virtual double foliageDensity() const; 00072 virtual void setFoliageDensity(double d); 00073 00074 // obtain the extent of the tree 00075 virtual DtExtent extent() const; 00076 00077 // redefine the input extent to include the tree 00078 virtual void expandExtent(DtExtent& extent) const; 00079 00080 // debugging aid 00081 virtual void dump(int indentLevel) const; 00082 00083 // Applies the specified transform to its location. 00084 // Ignores the flag. 00085 // NOTE: Does NOT transform ANY of the other parameters 00086 // Returns false if the transformation fails for any reason. 00087 virtual bool applyTransform(const DtHomogeneousTransfMatrix& matrix, 00088 bool createNewVertices); 00089 00090 protected: 00091 00092 DtPoint myLocation; 00093 DtTreeType myTreeType; 00094 double myTrunkHeight; 00095 double myTrunkWidth; 00096 double myFoliageHeight; 00097 double myFoliageWidth; 00098 double myFoliageDensity; // a real between 0 and 1 00099 00100 }; 00101 00102 inline DtTreeType DtTree::treeType() const 00103 { 00104 return myTreeType; 00105 } 00106 00107 inline void DtTree::setTreeType(DtTreeType newTreeType) 00108 { 00109 myTreeType = newTreeType; 00110 } 00111 00112 inline const DtPoint& DtTree::location() const 00113 { 00114 return(myLocation); 00115 } 00116 00117 inline void DtTree::setLocation(const DtPoint& p) 00118 { 00119 myLocation = p; 00120 } 00121 00122 inline double DtTree::trunkHeight() const 00123 { 00124 return myTrunkHeight; 00125 } 00126 00127 inline void DtTree::setTrunkHeight(double h) 00128 { 00129 myTrunkHeight = h; 00130 } 00131 00132 inline double DtTree::trunkWidth() const 00133 { 00134 return myTrunkWidth; 00135 } 00136 00137 inline void DtTree::setTrunkWidth(double w) 00138 { 00139 myTrunkWidth = w; 00140 } 00141 00142 inline double DtTree::foliageHeight() const 00143 { 00144 return myFoliageHeight; 00145 } 00146 00147 inline void DtTree::setFoliageHeight(double h) 00148 { 00149 myFoliageHeight = h; 00150 } 00151 00152 inline double DtTree::foliageWidth() const 00153 { 00154 return myFoliageWidth; 00155 } 00156 00157 inline void DtTree::setFoliageWidth(double w) 00158 { 00159 myFoliageWidth = w; 00160 } 00161 00162 inline double DtTree::foliageDensity() const 00163 { 00164 return myFoliageDensity; 00165 } 00166 00167 inline void DtTree::setFoliageDensity(double d) 00168 { 00169 myFoliageDensity = d; 00170 } 00171 #endif