VR-Link API Documentation for DIS
Home
Namespaces
Classes
Files
Examples
Libraries
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
include
vl
linearObjectEncoderDIS.h
Go to the documentation of this file.
1
/****************************************************************************
2
* Copyright (c) 2014 VT MAK
3
* All rights reserved.
4
****************************************************************************/
5
9
10
#pragma once
11
12
#if DtDIS
13
14
#include <
vl/stateEncoder.h
>
15
#include <
vl/linearObjectStatePdu.h
>
16
#include <
vl/linearObjectRepository.h
>
17
20
class
DT_DLL_VL
DtLinearObjectEncoder
:
public
DtStateEncoder
21
{
22
public
:
23
25
DtLinearObjectEncoder
(
double
locThresh = 1.0,
double
oriThresh = 1.0 );
26
28
DtLinearObjectEncoder
(
const
DtLinearObjectEncoder
& orig );
29
31
virtual
~
DtLinearObjectEncoder
();
32
34
DtLinearObjectEncoder
&
operator =
(
const
DtLinearObjectEncoder
& orig );
35
40
virtual
DtLinearObjectStatePdu
* stateMsg(
41
const
DtLinearObjectRepository
& stateRep,
42
const
DtLinearObjectRepository
& asSeenByRemote );
43
46
47
virtual
inline
void
setLocThreshold(
double
val );
48
virtual
inline
double
locThreshold()
const
;
49
51
54
55
virtual
inline
void
setOriThreshold(
double
val );
56
virtual
inline
double
oriThreshold()
const
;
57
59
60
DtCLONE_ENCODER
(
DtLinearObjectEncoder
);
61
62
protected
:
63
65
virtual
bool
sendNeeded(
const
DtLinearObjectRepository
& stateRep,
66
const
DtLinearObjectRepository
& asSeenByRemote );
67
69
virtual
void
updateModifications(
const
DtLinearObjectRepository
& lclRep,
70
const
DtLinearObjectRepository
& remRep );
71
72
protected
:
73
74
DtLinearObjectStatePdu
myPdu
;
75
double
myLocThresholdSquared
;
76
double
myOriThresholdSquared
;
77
78
};
79
80
81
inline
void
DtLinearObjectEncoder::setLocThreshold
(
double
val )
82
{
83
myLocThresholdSquared
= val*val;
84
}
85
86
inline
double
DtLinearObjectEncoder::locThreshold
()
const
87
{
88
return
sqrt(
myLocThresholdSquared
);
89
}
90
91
inline
void
DtLinearObjectEncoder::setOriThreshold
(
double
val )
92
{
93
myOriThresholdSquared
= val*val;
94
}
95
96
inline
double
DtLinearObjectEncoder::oriThreshold
()
const
97
{
98
return
sqrt(
myOriThresholdSquared
);
99
}
100
101
#endif // DtDIS
Document ID: Generated on Wed Jan 7 13:31:29 EST 2015 from SVN revision 149162
Copyright © 2005-2014 VT MÄK. All Rights Reserved (
www.mak.com
)