VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtTreeRecord.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2015 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #ifndef DtTreeRecord_H_
11 #define DtTreeRecord_H_
12 
13 #include <vrvCore/vrvCore.h>
14 #include <vrvCore/DtUniqueID.h>
15 
16 #include <matrix/vlVector.h>
17 #include <matrix/vlQuaternion.h>
18 
19 #include <string>
20 
22 
23 
24 namespace makVrv
25 {
26  class DtMessage;
27 
31  {
32 
33  public:
34 
36  DtTreeRecord();
37 
39  DtTreeRecord(DtUniqueID id, const DtVector& pos, const std::string& modelDefinitionName);
40 
42  DtTreeRecord(const DtTreeRecord& orig);
43 
45  DtTreeRecord& operator=(const DtTreeRecord& orig);
46 
48  bool operator==(const DtTreeRecord& other) const;
49 
51  bool operator<(const DtTreeRecord& other) const;
52 
54  virtual ~DtTreeRecord();
55 
57  virtual void setUniqueId(DtUniqueID id);
58 
60  virtual DtUniqueID uniqueId() const;
61 
63  void setCellID(DtUniqueID id);
64 
66  DtUniqueID cellId(void) const;
67 
69  virtual void setPostion(const DtVector& pos);
70 
72  virtual const DtVector& position() const;
73 
75  virtual void setModelDefinition(const std::string& modelDef);
76 
78  virtual const std::string& modelDefinition() const;
79 
80  virtual void setScale(float fScale);
81  virtual float scale(void) const;
82 
83  virtual void setOrientationDegrees(const DtDegrees& orientation);
84  virtual DtDegrees orientationDegrees(void) const;
85 
86  // Get a deterministic randomized scale (between fMinScale and
87  // fMaxScale based upon unique id
88  static void getRandomizedScale(float& fScale, float fMinScale,
89  float fMaxScale, DtUniqueID id);
90 
91  // Get a deterministic randomized orientation based upon unique id
92  static void getRandomizedOrientation(DtDegrees& orientation,
93  DtUniqueID id);
94 
95  // Get the type of the tree resulted from the osg nodes extraction process
96  virtual const std::string& treeType() const;
97  // Set the type of the tree resulted from the osg nodes extraction process
98  virtual void setTreeType(const std::string& val);
99 
100  // VR-Vantage does not use these quaternion forms anywhere, but they are used by VR-Forces,
101  // so please do not remove them. TDL
102 
103  // Get the orientation of the tree represented as a quaternion
104  virtual const DtQuaternion& orientation() const;
105 
106  // Set the orientation of the tree represented as a quaternion
107  virtual void setOrientation(const DtQuaternion& val);
108 
109  protected:
110 
112  void copyHelper(const DtTreeRecord& orig);
113 
114  protected:
115 
117 
118  // An optional id to associate a tree record with a 'cell'
119  // Can be used to map trees to cells/pages/etc
121 
123  std::string myModelDefinition;
124  float myScale;
126 
127  // this attribute is set only for Props purpose
128  std::string myTreeType;
129 
130  DtQuaternion myOrientation;
131 
132 
133  //Rev 153241 in svn has #if'd out code for using the boost randomizer here. Might improve randomness at a possible performance cost
134 
135  };
136 
137  typedef std::vector<DtTreeRecord*> DtVectorTreeRecords;
138 
141 
144 }
145 
146 #endif
147 
std::string myTreeType
Definition: DtTreeRecord.h:128
The IGI Message. Is easily encoded and decoding using stream operators. It also provides validation d...
Definition: DtMessage.h:30
float myScale
Definition: DtTreeRecord.h:124
DT_DLL_VRFGUICORE makVrv::DtMessage & operator<<(DtMessage &msg, const makVrf::DtNetworkMessageAgentInterface &)
std::string myModelDefinition
Definition: DtTreeRecord.h:123
std::vector< DtTreeRecord * > DtVectorTreeRecords
Definition: DtTreeRecord.h:137
DtUniqueID myUniqueId
Definition: DtTreeRecord.h:116
DtQuaternion myOrientation
Definition: DtTreeRecord.h:130
DtUniqueID myCellId
Definition: DtTreeRecord.h:120
DtDegrees myOrientationDegrees
Definition: DtTreeRecord.h:125
A DtTreeRecord holds the requisite information needed to create a tree in a forest.
Definition: DtTreeRecord.h:30
#define DT_DLL_VRVCORE
Definition: vrvCore.h:20
DtVector myPosition
Definition: DtTreeRecord.h:122
Math utilities.
Definition: DtMath.h:25
bool operator==(const DtTextureAtlasIndexParser::StringOrFloatAttrib &lhs, const DtTextureAtlasIndexParser::StringOrFloatAttrib &rhs)
needed for search comparison code
Definition: DtTextureAtlasIndexParser.h:153
Contains makVrv::DtUniqueID type.
DT_DLL_VRFGUICORE makVrv::DtMessage & operator>>(DtMessage &msg, makVrf::DtNetworkMessageAgentInterface &)
Contains DLL export macros.

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)