VR-Exchange 2.1 API Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Libraries
File List
File Members
examples
simpleBroker
sEntityTrans.h
Go to the documentation of this file.
1
/*********************************************************************
2
** Copyright (c) 2005 VT MAK
3
*********************************************************************/
4
#pragma once
5
6
// Classes can not be forward declared because they are templated
7
#include <
portal/pEntity.h
>
8
#include <
portal/pReflectedObjectManagerTypes.h
>
9
#include <
portal/pObjectPublisherTypes.h
>
10
11
// Class Forwards
12
class
DtExerciseConn;
13
class
DtReflectedObject;
14
class
DtReflectedEntityList;
15
class
DtReflectedEntity;
16
class
DtEntityPublisher;
17
18
namespace
MAKVrExchange
{
19
class
DtPortalConnection;
20
}
21
22
// A helper class responsible for the translation of Entity State PDUs to
23
// Entity Data Exchange (portal) objects. This is not the same class (or even
24
// close to) the same class in the HLA Broker. This simple class is provided
25
// to show the VR-Exchange API. It does not actually translate DIS entities
26
// in any useful way.
27
class
DtEntityTranslator
28
{
29
30
public
:
31
32
// Default CTOR, takes a reference to the disConn and the PortalConnection
33
DtEntityTranslator
(DtExerciseConn& disConn,
MAKVrExchange::DtPortalConnection
& portalConn);
34
35
// Default DTOR
36
virtual
~DtEntityTranslator
();
37
38
// Process any required updates
39
virtual
void
tick
();
40
41
// Process discover messages from DIS
42
virtual
void
discoverDisObject
(
const
DtReflectedEntity &obj);
43
// Process discover messages from the Portal
44
virtual
void
discoverPortalObject
(
const
MAKVrExchange::DtPortalReflectedEntity
&obj);
45
46
// Process updates from DIS
47
virtual
void
receiveDisUpdate
(
const
DtReflectedEntity &obj);
48
// Process updates from the Portal
49
virtual
void
receivePortalUpdate
(
const
MAKVrExchange::DtPortalReflectedEntity
&obj);
50
51
// process removal messages from DIS
52
virtual
void
processDisRemoval
(
const
DtReflectedEntity &obj);
53
// process removal messages from the Portal
54
virtual
void
processProtalRemoval
(
const
MAKVrExchange::DtPortalReflectedEntity
&obj);
55
56
protected
:
57
// A function which is called to find out if this DIS object is fit to be
58
// discovered, and hence published.
59
static
bool
disDiscoveryCriteria
(DtReflectedObject* obj,
void
*usr);
60
61
// A function which is called to find out if this Portal object is fit to be
62
// discovered, and hence published.
63
static
bool
portalDiscoveryCriteria
(
64
const
MAKVrExchange::DtPortalReflectedObject
*obj,
void
*usr);
65
66
static
void
disObjectAddedCb
(DtReflectedEntity *obj,
void
*usrData);
67
static
void
disObjectUpdatedCb
(DtReflectedEntity *obj,
void
*usrData);
68
static
void
disObjectDeletedCb
(DtReflectedEntity *obj,
void
*usrData);
69
70
static
void
portalObjectAddedCb
(
const
MAKVrExchange::DtPortalReflectedEntity
& obj,
void
*usrData);
71
static
void
portalObjectUpdatedCb
(
const
MAKVrExchange::DtPortalReflectedEntity
& obj,
void
*usrData);
72
static
void
portalObjectDeletedCb
(
const
MAKVrExchange::DtPortalReflectedEntity
& obj,
void
*usrData);
73
74
private
:
75
76
// A connection to the portal exercise connection and the DIS (VR-Link)
77
// exercise connection
78
DtExerciseConn &
myDisConn
;
79
MAKVrExchange::DtPortalConnection
&
myPortalConn
;
80
81
// Pointers to reflected lists, or containers of reflected objects.
82
DtReflectedEntityList *
myDisReflectedList
;
83
MAKVrExchange::DtPortalReflectedEntityManager
*
myPortalReflectedManager
;
84
85
DtEntityPublisher *
myDisEntityPublisher
;
86
MAKVrExchange::DtPortalEntityPublisher
*
myPortalEntityPublisher
;
87
88
89
};
Document ID: Generated on Tue Aug 7 22:07:13 EDT 2012 from SVN revision 117874
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (
www.mak.com
)