VR-Forces 4.6 Class Documentation
 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 #include <boost/random.hpp>
23 #include <boost/unordered_map.hpp>
24 
25 
26 
27 namespace makVrv
28 {
29  class DtMessage;
30 
34  {
35 
36  public:
37 
39  DtTreeRecord();
40 
42  DtTreeRecord(DtUniqueID id, const DtVector& pos, const std::string& modelDefinitionName);
43 
45  DtTreeRecord(const DtTreeRecord& orig);
46 
48  DtTreeRecord& operator=(const DtTreeRecord& orig);
49 
51  bool operator==(const DtTreeRecord& other) const;
52 
54  bool operator<(const DtTreeRecord& other) const;
55 
57  virtual ~DtTreeRecord();
58 
60  virtual void setUniqueId(DtUniqueID id);
61 
63  virtual DtUniqueID uniqueId() const;
64 
66  void setCellID(DtUniqueID id);
67 
69  DtUniqueID cellId(void) const;
70 
72  virtual void setPostion(const DtVector& pos);
73 
75  virtual const DtVector& position() const;
76 
78  virtual void setModelDefinition(const std::string& modelDef);
79 
81  virtual const std::string& modelDefinition() const;
82 
83  virtual void setScale(float fScale);
84  virtual float scale(void) const;
85 
86  virtual void setOrientationDegrees(const DtDegrees& orientation);
87  virtual DtDegrees orientationDegrees(void) const;
88 
89  // Get a deterministic randomized scale (between fMinScale and
90  // fMaxScale based upon unique id
91  static void getRandomizedScale(float& fScale, float fMinScale,
92  float fMaxScale, DtUniqueID id);
93 
94  // Get a deterministic randomized orientation based upon unique id
95  static void getRandomizedOrientation(DtDegrees& orientation,
96  DtUniqueID id);
97 
98  // Get the type of the tree resulted from the osg nodes extraction process
99  virtual const std::string& treeType() const;
100  // Set the type of the tree resulted from the osg nodes extraction process
101  virtual void setTreeType(const std::string& val);
102 
103  // Get the orientation of the tree represented as a quaternion
104  virtual const DtQuaternion& orientation() const;
105  // Set the orientation of the tree represented as a quaternion
106  virtual void setOrientation(const DtQuaternion& val);
107 
108  protected:
109 
111  void copyHelper(const DtTreeRecord& orig);
112 
113  protected:
114 
116 
117  // An optional id to associate a tree record with a 'cell'
118  // Can be used to map trees to cells/pages/etc
120 
122  std::string myModelDefinition;
123  float myScale;
125 
126  // this attribute is set only for Props purpose
127  std::string myTreeType;
128 
129  DtQuaternion myOrientation;
130 
131 
132  //Rev 153241 in svn has #if'd out code for using the boost randomizer here. Might improve randomness at a possible performance cost
133 
134  };
135 
136  typedef std::vector<DtTreeRecord> DtVectorTreeRecords;
137 
140 
143 }
144 
145 #endif
146 

Document ID: Generated on Thu Apr 12 03:15:37 EDT 2018 from SVN revision 187986
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)