VR-Forces 4.6.1 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
include
vrvCore
DtModelInstance.h
Go to the documentation of this file.
1
/******************************************************************************
2
** Copyright (c) 2012 MAK Technologies, Inc.
3
** All rights reserved.
4
******************************************************************************/
5
9
10
#pragma once
11
12
#include <
vrvCore/vrvCore.h
>
13
#include <
vrvCore/DtUniqueID.h
>
14
#include <
vrvUtil/DtVirtualBaseClass.h
>
15
16
#include <string>
17
#include <vector>
18
19
#include <matrix/vlVector.h>
20
#include <matrix/vlTaitBryan.h>
21
22
#include <boost/signal.hpp>
23
24
namespace
makVrv
25
{
26
class
DtModelDefinition;
27
class
DtDe;
28
39
class
DT_DLL_VRVCORE
DtModelInstance
40
{
41
public
:
42
44
DtModelInstance
(
DtDe
& de);
45
47
virtual
~
DtModelInstance
();
48
51
virtual
bool
realize(
DtModelDefinition
& definition);
52
55
const
std::string& realizedDefinitionName()
const
;
56
58
virtual
bool
saveModelToFile(
const
std::string&
filename
)
const
;
59
61
const
DtVector
& boundingBoxExtents()
const
;
62
64
void
getBoundingBoxExtents(
double
& x,
double
& y,
double
& z)
const
;
65
67
const
DtVector
& boundingBoxCenter()
const
;
68
70
void
getBoundingBoxCenter(
double
& x,
double
& y,
double
& z)
const
;
71
72
void
getBoundingBoxComponents(
DtVector
& minimum,
DtVector
& maximum );
73
76
virtual
void
setContributesToBound(
bool
trueOrFalse );
77
80
bool
contributesToBound()
const
;
81
83
virtual
void
setVisible(
bool
isVisible) = 0;
84
86
virtual
void
setBlendColor(
float
r,
float
g,
float
b,
float
a);
87
91
virtual
void
enableColorBlending(
bool
b );
92
93
//Utility function for reading a float from a definition.
94
static
float
readFloat(
const
std::string& paramName,
const
DtModelDefinition
& definition);
95
96
//Utility function for reading a Vec4 from a definition.
97
static
DtVector
readVector(
const
std::string& paramName,
const
DtModelDefinition
& definition);
98
99
boost::signal<void (DtModelInstance*)>
signal_modelInstanceChanged
;
100
101
protected
:
102
103
DtDe
&
myDe
;
104
std::string
myRealizedModelDefinitionName
;
105
DtVector
myBoundingBoxCenter
;
106
DtVector
myBoundingBoxExtents
;
107
DtVector
myBoundingBoxMinimum
;
108
DtVector
myBoundingBoxMaximum
;
109
bool
myContributesToBound
;
110
111
//Note about myColorBlendingEnabled: If this particular model has instancing enabled then this flag is set to false
112
// and color blending is handled by the instance manager.
113
bool
myColorBlendingEnabled
;
114
float
myBlendRed
;
115
float
myBlendBlue
;
116
float
myBlendGreen
;
117
float
myBlendAlpha
;
118
119
};
120
123
class
DT_DLL_VRVCORE
DtModelInstanceCreator
:
public
DtVirtualBaseClass
124
{
125
public
:
126
128
virtual
~
DtModelInstanceCreator
();
129
131
virtual
DtModelInstance
* create(
DtDe
& de) = 0;
132
133
protected
:
134
135
DtModelInstanceCreator
();
136
};
137
138
}
Document ID: Generated on Wed Jul 25 16:57:45 EDT 2018 from SVN revision 190790
Copyright © 2005-2018 VT MÄK. All Rights Reserved (
www.mak.com
)