VR-Forces 4.5 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator 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 <string>
18 
20 #include <boost/random.hpp>
21 #include <boost/unordered_map.hpp>
22 
23 namespace makVrv
24 {
25  class DtMessage;
26 
30  {
31 
32  public:
33 
35  DtTreeRecord();
36 
38  DtTreeRecord(DtUniqueID id, const DtVector& pos, const std::string& modelDefinitionName);
39 
41  DtTreeRecord(const DtTreeRecord& orig);
42 
44  DtTreeRecord& operator=(const DtTreeRecord& orig);
45 
47  bool operator==(const DtTreeRecord& other) const;
48 
50  bool operator<(const DtTreeRecord& other) const;
51 
53  virtual ~DtTreeRecord();
54 
56  virtual void setUniqueId(DtUniqueID id);
57 
59  virtual DtUniqueID uniqueId() const;
60 
62  void setCellID(DtUniqueID id);
63 
65  DtUniqueID cellId(void) const;
66 
68  virtual void setPostion(const DtVector& pos);
69 
71  virtual const DtVector& position() const;
72 
74  virtual void setModelDefinition(const std::string& modelDef);
75 
77  virtual const std::string& modelDefinition() const;
78 
79  virtual void setScale(float fScale);
80  virtual float scale(void) const;
81 
82  virtual void setOrientation(const DtDegrees& orientation);
83  virtual DtDegrees orientation(void) const;
84 
85  // Get a deterministic randomized scale (between fMinScale and
86  // fMaxScale based upon unique id
87  static void getRandomizedScale(float& fScale, float fMinScale,
88  float fMaxScale, DtUniqueID id);
89 
90  // Get a deterministic randomized orientation based upon unique id
91  static void getRandomizedOrientation(DtDegrees& orientation,
92  DtUniqueID id);
93 
94  protected:
95 
97  void copyHelper(const DtTreeRecord& orig);
98 
99  protected:
100 
102 
103  // An optional id to associate a tree record with a 'cell'
104  // Can be used to map trees to cells/pages/etc
106 
108  std::string myModelDefinition;
109  float myScale;
111 
112  //Rev 153241 in svn has #if'd out code for using the boost randomizer here. Might improve randomness at a possible performance cost
113 
114  };
115 
116  typedef std::vector<DtTreeRecord> DtVectorTreeRecords;
117 
120 
123 }
124 
125 #endif
126 

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)