VR-Forces Development_Version Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
include
vrvCore
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
19
#include <
vrvGraphicsUtils/DtMath.h
>
20
#include <boost/random.hpp>
21
#include <boost/unordered_map.hpp>
22
23
namespace
makVrv
24
{
25
class
DtMessage;
26
29
class
DT_DLL_VRVCORE
DtTreeRecord
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
101
DtUniqueID
myUniqueId
;
102
103
// An optional id to associate a tree record with a 'cell'
104
// Can be used to map trees to cells/pages/etc
105
DtUniqueID
myCellId
;
106
107
DtVector
myPosition
;
108
std::string
myModelDefinition
;
109
float
myScale
;
110
DtDegrees
myOrientation
;
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
119
DT_DLL_VRVCORE
DtMessage
&
operator<<
(
DtMessage
& msg,
const
DtTreeRecord
& record );
120
122
DT_DLL_VRVCORE
DtMessage
&
operator>>
(
DtMessage
& msg,
DtTreeRecord
& record );
123
}
124
125
#endif
126
Document ID: Generated on Tue Mar 8 22:13:38 EST 2016 from SVN revision 162938
Copyright © 2005-2015 VT MÄK. All Rights Reserved (
www.mak.com
)