VR-Forces 4.1.1 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
include
vrvVrl
DtVrlinkBoxVisualizers.h
Go to the documentation of this file.
1
/******************************************************************************
2
** Copyright (c) 2012 MAK Technologies, Inc.
3
** All rights reserved.
4
******************************************************************************/
5
11
12
#pragma once
13
14
#include <
vrvVrl/vrvVrl.h
>
15
#include <
vrvCore/Dt2DBoxVisualizer.h
>
16
17
#include <
vrvUtil/DtCoordinateSystem.h
>
18
#include <
vrvVrl/DtVrlinkConnection.h
>
19
20
#include <matrix/topoCoord.h>
21
22
namespace
makVrv
23
{
24
namespace
DT_PROTOCOL_NAMESPACE
25
{
26
template
<
typename
T>
27
class
DtVrlinkBoxVisualizer
:
public
T
28
{
29
public
:
30
DtVrlinkBoxVisualizer
(
DtBaseConnection
& simulation,
DtStateListener
& listener,
31
int
modelSet)
32
: T(simulation, listener, modelSet)
33
,
myVrlinkConnection
((dynamic_cast<
DtVrlinkConnection
&>(simulation)))
34
{
35
}
36
37
virtual
~DtVrlinkBoxVisualizer
()
38
{
39
}
40
42
virtual
void
setOrigin
(
const
DtVector
& v)
43
{
44
DtVector
local;
45
46
myVrlinkConnection
.
coordinateSystem
().
netToLocalPos
(v, local);
47
48
T::setOrigin
(local);
49
}
50
52
virtual
void
addPoint
(
int
index,
const
DtVector
& v)
53
{
54
DtVector
local;
55
56
myVrlinkConnection
.
coordinateSystem
().
netToLocalPos
(v, local);
57
58
T::addPoint
(index, local);
59
}
60
62
virtual
void
modifyPoint
(
int
index,
const
DtVector
& v)
63
{
64
DtVector
local;
65
66
myVrlinkConnection
.
coordinateSystem
().
netToLocalPos
(v, local);
67
68
T::modifyPoint
(index, local);
69
}
70
71
virtual
void
setPoints
(
72
const
DtEnvironmentalStateListener::ControlPointsList
& v)
73
{
74
DtEnvironmentalStateListener::ControlPointsList
locals(v);
75
DtEnvironmentalStateListener::ControlPointsList::iterator w = locals.begin();
76
77
DtEnvironmentalStateListener::ControlPointsList::const_iterator i = v.begin();
78
DtEnvironmentalStateListener::ControlPointsList::const_iterator e = v.end();
79
for
(;i != e;++i,++w)
80
{
81
myVrlinkConnection
.
coordinateSystem
().
netToLocalPos
(*i,*w);
82
}
83
T::setPoints
(locals);
84
}
85
86
protected
:
87
DtVrlinkConnection
&
myVrlinkConnection
;
88
};
89
90
typedef
DtStateVisualizerCreatorTemplate<DtVrlinkBoxVisualizer<Dt2DBoxVisualizer>
>
91
DtVrlink2DBoxVisualizerCreator
;
92
}
93
}
Document ID: Generated on Mon Apr 8 19:24:01 EDT 2013 from SVN revision 125877
Copyright © 2005-2013 VT MÄK. All Rights Reserved (
www.mak.com
)