VR-Vantage API Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Tutorials
File List
File Members
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
89
virtual
void
enableColorBlending(
bool
b );
90
91
//Utility function for reading a float from a definition.
92
static
float
readFloat(
const
std::string& paramName,
const
DtModelDefinition
& definition);
93
94
//Utility function for reading a Vec4 from a definition.
95
static
DtVector readVector(
const
std::string& paramName,
const
DtModelDefinition
& definition);
96
97
boost::signal<void (DtModelInstance*)>
signal_modelInstanceChanged
;
98
99
protected
:
100
101
DtDe
&
myDe
;
102
std::string
myRealizedModelDefinitionName
;
103
DtVector
myBoundingBoxCenter
;
104
DtVector
myBoundingBoxExtents
;
105
DtVector
myBoundingBoxMinimum
;
106
DtVector
myBoundingBoxMaximum
;
107
bool
myContributesToBound
;
108
bool
myColorBlendingEnabled
;
109
float
myBlendRed
;
110
float
myBlendBlue
;
111
float
myBlendGreen
;
112
float
myBlendAlpha
;
113
114
};
115
118
class
DT_DLL_VRVCORE
DtModelInstanceCreator
:
public
DtVirtualBaseClass
119
{
120
public
:
121
123
virtual
~
DtModelInstanceCreator
();
124
126
virtual
DtModelInstance
* create(
DtDe
& de) = 0;
127
128
protected
:
129
130
DtModelInstanceCreator
();
131
};
132
133
}
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (
www.mak.com
)