VR-Exchange 2.2 API Documentation
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>
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.
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
45 
46  // Process updates from DIS
47  virtual void receiveDisUpdate(const DtReflectedEntity &obj);
48  // Process updates from the Portal
50 
51  // process removal messages from DIS
52  virtual void processDisRemoval(const DtReflectedEntity &obj);
53  // process removal messages from the Portal
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;
80 
81  // Pointers to reflected lists, or containers of reflected objects.
82  DtReflectedEntityList *myDisReflectedList;
84 
85  DtEntityPublisher *myDisEntityPublisher;
87 
88 
89 };

Document ID: Generated on Mon Apr 15 17:15:50 EDT 2013 from SVN revision 126154
Copyright © 2005-2012 VT MÄK. All Rights Reserved (www.mak.com)