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
examples
rangeLine
rangeLineVisualizer.h
Go to the documentation of this file.
1
/*********************************************************************
2
** Copyright (c) 2013 MaK Technologies, Inc.
3
** All rights reserved.
4
*********************************************************************/
5
9
10
#pragma once
11
12
#include <
vrfGuiCore/vrfGuiCore.h
>
13
#include <
vrvCore/DtStateVisualizer.h
>
14
#include <vrvCore/DtSceneObjectAgent.hpp>
15
16
namespace
makVrv
17
{
18
class
DtModelAgent;
19
class
DtProjectedWidgetModelAgent;
20
class
DtWidgetLabelAgent;
21
}
22
23
class
DtAttachableRangeLineTextUpdaterAgent;
24
28
class
DtRangeLineTextVisualizer
:
public
makVrv::DtStateVisualizer
29
{
30
public
:
32
DtRangeLineTextVisualizer
(
makVrv::DtBaseConnection
&
simulation
,
33
makVrv::DtStateListener
&
listener
,
int
modelSet);
34
36
virtual
~DtRangeLineTextVisualizer
();
37
39
virtual
const
makVrv::DtStateVisualizer::TypeInfo
&
typeInfo
()
const
;
40
42
static
const
makVrv::DtStateVisualizer::TypeInfo
&
theTypeInfo
();
43
45
static
const
makVrv::DtVisualizerSchema
&
theRangeLineTextSchema
();
46
47
protected
:
49
virtual
void
createModelAgents
();
50
52
virtual
void
destroyModelAgents
();
53
56
virtual
void
setVisualizerDefinition
(
const
makVrv::DtVisualizerDefinition
& visDef);
57
60
virtual
void
setUniqueID
(
makVrv::DtUniqueID
);
61
63
virtual
void
setModelDefinitionForAgents
();
64
66
// Set / Get the text color. Can use 0.0-1.0 or 0-255
67
virtual
void
setTextColor
(
float
r,
float
g,
float
b,
float
a);
68
virtual
void
getTextColor
(
float
& r,
float
& g,
float
& b,
float
& a)
const
;
70
72
// Set / Get the size of the box the text is positioned in, in pixels.
73
virtual
void
setTextBoxSize
(
unsigned
int
textWidth,
unsigned
int
textHeight );
74
virtual
void
getTextBoxSize
(
unsigned
int
& textWidth,
unsigned
int
& textHeight )
const
;
76
78
// Set / Get a pixel offset from the top of the line for the text box.
79
virtual
void
setOriginOffset
(
int
offsetX,
int
offsetY );
80
virtual
void
getOriginOffset
(
int
& offsetX,
int
& offsetY )
const
;
82
84
// Set / Get the horizontal alignment of the text within the text box.
85
// Values come from DtWidgetLabel
86
virtual
void
setHorizontalAlignment
(
unsigned
int
horizontalAlignment
);
87
virtual
unsigned
int
horizontalAlignment
()
const
;
89
91
// Set / Get the name of the font to use for the height text.
92
virtual
void
setTextFont
( std::string
textFont
) ;
93
virtual
std::string
textFont
()
const
;
95
97
// Set / Get the point size of the font used for height text
98
virtual
void
setTextFontSize
(
unsigned
int
textFontSize
);
99
virtual
unsigned
int
textFontSize
()
const
;
101
103
// Set / Get whether or not to compute range to next point
104
virtual
void
setComputeToNextPoint
(
bool
) ;
105
virtual
bool
computeToNextPoint
()
const
;
107
108
protected
:
109
makVrv::DtProjectedWidgetModelAgent*
myRangeLineTextModelAgent
;
110
makVrv::DtWidgetLabelAgent*
myRangeLineTextWidgetAgent
;
111
DtAttachableRangeLineTextUpdaterAgent*
myRangeLineTextUpdaterAgent
;
112
makVrv::DtSceneObjectAgent*
myRangeLineTextObjectAgent
;
113
114
unsigned
int
myTextBoxSize
[2];
// default is 150 x 25 pixels
115
unsigned
int
myTextHorizontalAlignment
;
// default is center
116
std::string
myTextFont
;
// default is "FreeMono.otf"
117
unsigned
int
myTextFontSize
;
// default is 14
118
float
myTextColor
[4];
// default is 1., 1., 0., 1.
119
int
myOriginOffset
[2];
// default is 30, -30
120
bool
myComputeToNextPoint
;
121
};
122
123
typedef
makVrv::DtStateVisualizerCreatorTemplate<DtRangeLineTextVisualizer>
124
DtRangeLineTextVisualizerCreator
;
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
)