VR-Forces 4.3 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) 2010 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 /******************************************************************************
6 ** $RCSfile: DtTreeRecord.h,v $ $Revision: 1.9 $ $State: Exp $
7 ******************************************************************************/
8 
12 
13 #ifndef DtTreeRecord_H_
14 #define DtTreeRecord_H_
15 
16 #include <vrvCore/vrvCore.h>
17 #include <vrvCore/DtUniqueID.h>
18 
19 #include <matrix/vlVector.h>
20 #include <string>
21 
23 #include <boost/random.hpp>
24 
25 namespace makVrv
26 {
27  class DtMessage;
28 
32  {
33 
34  public:
35 
37  DtTreeRecord();
38 
40  DtTreeRecord(DtUniqueID id, const DtVector& pos, const std::string& modelDefinitionName);
41 
43  DtTreeRecord(const DtTreeRecord& orig);
44 
46  const DtTreeRecord& operator=(const DtTreeRecord& orig);
47 
49  bool operator==(const DtTreeRecord& other) const;
50 
52  bool operator<(const DtTreeRecord& other) const;
53 
55  virtual ~DtTreeRecord();
56 
58  virtual void setUniqueId(DtUniqueID id);
59 
61  virtual DtUniqueID uniqueId() const;
62 
64  virtual void setPostion(const DtVector& pos);
65 
67  virtual const DtVector& position() const;
68 
70  virtual void setModelDefinition(const std::string& modelDef);
71 
73  virtual const std::string& modelDefinition() const;
74 
75  virtual void setScale(float fScale);
76  virtual float scale(void) const;
77 
78  virtual void setOrientation(const DtDegrees& orientation);
79  virtual DtDegrees orientation(void) const;
80 
81  // Get a deterministic randomized scale, orientation based upon unique id
82  static void getRandomizedScaleAndOrientation(float& fScale, DtDegrees& orientation, DtUniqueID id);
83  protected:
84 
86  void copyHelper(const DtTreeRecord& orig);
87 
88  protected:
89 
92  std::string myModelDefinition;
93  float myScale;
95 
96  typedef boost::mt19937 RandomGenEngine; // Mersenne Twister
98 
99  typedef boost::uniform_real<> RandomDistributionTypeForScale; // Normal Distribution
100  typedef boost::variate_generator<RandomGenEngine,RandomDistributionTypeForScale> RandomGeneratorForScale; // Variate generator
101 
104 
105  typedef boost::uniform_int<> RandomDistributionTypeForOrientation; // Normal Distribution
106  typedef boost::variate_generator<RandomGenEngine,RandomDistributionTypeForOrientation> RandomGeneratorForOrientation; // Variate generator
107 
110  };
111 
114 
117 }
118 
119 #endif
120 

Document ID: Generated on Wed Mar 11 21:20:57 EDT 2015 from SVN revision 150940
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)