VR-Link API Documentation for HLA Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
entityPublisherDIS.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 1992-2010 MAK Technologies, Inc
3 ** All rights reserved.
4 *********************************************************************/
5 #pragma once
6 
9 #if DtDIS
10 
11 
12 #include "objectPublisherDIS.h"
13 #include "entityStateRepository.h"
14 #include "entityStateEncoder.h"
15 #include "entityStateDecoder.h"
16 #include "diGuyCustomPduDecoder.h"
17 #include "diGuyCustomPduEncoder.h"
18 #include "objectId.h"
19 #include "ownershipHandler.h"
20 
21 enum DtDiGuyDataSendMode
22 {
23  DtDiGuySendDisabled = 0,
24  DtDiGuySendPdu = 1,
25  DtDiGuySendAttributes = 2
26 };
27 
34 {
35 public:
36 
37  //g++ forces us to define this function before we define
38  //our constructors
39  static const DtEntityType& guiseSameAsType();
40 
41 public:
42 
44  typedef DtEntityStateRepository* (*DtStateRepCreator)();
45 
46 public:
47 
48 
58  DtEntityStateRepository *stateRepToUse,
59  DtExerciseConn* conn,
60  const DtObjectId& id = DtObjectId::defaultId());
61 
71  DtExerciseConn* conn,
72  const DtObjectId& id = DtObjectId::defaultId());
73 
83  const DtEntityType& type,
84  DtExerciseConn* conn,
85  const DtObjectId& id = DtObjectId::defaultId());
86 
96  const DtEntityType& type,
97  DtExerciseConn* conn,
98  DtDeadReckonTypes algorithm,
99  DtForceType forceId,
100  const DtEntityType& guise = guiseSameAsType(),
101  const DtObjectId& id = DtObjectId::defaultId());
102 
104  virtual ~DtEntityPublisher();
105 
106 private:
107 
110 
113 
114 public:
119  virtual bool tick();
120 
123  virtual DtEntityStateRepository* entityStateRep();
124 
126  virtual DtEntityStateRepository* esr();
127 
131  virtual DtEntityStateDecoder* decoder();
132 
135  virtual DtEntityStateEncoder* encoder();
136 
140  virtual DtOwnershipHandler* setOwnershipHandler( DtOwnershipHandler* handler );
141 
143  virtual const DtObjectId& id() const;
144 
146  virtual const DtObjectId& localId() const;
147 
149  virtual const DtGlobalObjectDesignator& globalId() const;
150 
154  virtual void sendFinalPduOnDestruction(bool on);
155 
158  virtual void forceUpdate();
159 
162  virtual void enableDiGuyInformation(DtDiGuyDataSendMode sendMode=DtDiGuySendPdu);
163 
165  virtual void setSendDiGuyAttributes(bool enableAttributes);
166 
168  virtual bool sendDiGuyAttributes() const;
169 
172  virtual void setSendDiGuyPdus(bool enablePdu);
173 
175  virtual bool sendDiGuyPdus() const;
176 
178  virtual void setSendSeesPdus(bool yesNo);
179 
181  virtual bool sendSeesPdus() const;
182 
184  virtual void setSeesTimeThreshold(DtTime time);
185 
187  virtual DtTime seesTimeThreshold() const;
188 
190  virtual void setDiGuyTypeTimeThreshold(DtTime time);
191 
193  virtual DtTime diGuyTypeTimeThreshold() const;
194 
196  virtual void setDiGuyAppearanceTimeThreshold(DtTime time);
197 
199  virtual DtTime diGuyAppearanceTimeThreshold() const;
200 
202  virtual void setDiGuyActionTimeThreshold(DtTime time);
203 
205  virtual DtTime diGuyActionTimeThreshold() const;
206 
208  DtTime entityTypeHeartbeat(int type, int domain);
209 
214  virtual void divestObject(DtU16 siteTarget, DtU16 applicationTarget);
215 
216 public:
217 
219  static void setStateRepCreator(DtStateRepCreator creator);
220  static DtStateRepCreator stateRepCreator(void);
221 
222  static void setClassDfltTimeThreshold(DtTime threshold);
223  static void setStationaryDfltTimeThreshold(DtTime threshold);
224  static void setEntityTypeDfltTimeThreshold(int type, int domain, DtTime threshold);
225 
227 
228  static void setDfltRotationThreshold(double r);
229  static double dfltRotationThreshold();
230  static void setDfltTranslationThreshold(double t);
231  static double dfltTranslationThreshold();
233 
235  virtual bool createAndSendDiGuy();
236 
237 protected:
238 
240  void sendFinalPdu();
241 
243  virtual void createAndSendSeesPdu();
244 
245  virtual bool sendSeesNeeded() const;
246 
248  void init(const DtObjectId& vehId);
249 
250 protected:
251  DtObjectId myId;
252  DtEntityStateDecoder* myEntityDecoder;
253  DtEntityStateEncoder* myEntityEncoder;
254  DtDIGuyCustomPduEncoder* myDiGuyEncoder;
255  bool mySendFinalInDtor;
256  DtDiGuyDataSendMode mySendDiGuyMode;
257  bool mySendSeesPdus;
258  DtTime mySeesPdusTimeThreshold;
259  DtTime myLastSeesPdusUpdate;
260  DtOwnershipHandler* myOwnershipHandler;
261  DtRelativeLocationPdu myLastSentRelLocPdu;
262  DtTime myLastSentRelLocPduTime;
263 
264 protected:
265  static DtStateRepCreator theStateRepCreator;
266  static DtTime theClassDfltTimeThreshold;
267  static bool theClassDfltIsSetFlag;
268  static DtTime theStationaryDfltTimeThreshold;
269  static bool theStationaryDfltIsSetFlag;
270  static std::map<std::pair<int,int>,DtTime> theEntityTypeHeartbeat;
271 };
272 
274 {
275  return esr();
276 }
277 
279 {
280  return (DtEntityStateRepository*) stateRep();
281 }
282 
283 inline DtEntityStateEncoder* DtEntityPublisher::encoder()
284 {
285  return myEntityEncoder;
286 }
287 
288 inline DtEntityStateDecoder* DtEntityPublisher::decoder()
289 {
290  return myEntityDecoder;
291 }
292 
293 inline void DtEntityPublisher::sendFinalPduOnDestruction(bool onOff)
294 {
295  mySendFinalInDtor = onOff;
296 }
297 
298 inline const DtObjectId& DtEntityPublisher::id() const
299 {
300  return myId;
301 }
302 
304 {
306 }
307 
309 {
311 }
312 
314 {
316 }
317 
319 {
321 }
322 
323 inline const DtObjectId& DtEntityPublisher::localId() const
324 {
325  return id();
326 }
327 
328 
329 
330 #endif
Contains the DtObjectId class declaration.
Instances of DtExerciseConn are used to provide an application&#39;s interface or connection to the netwo...
Definition: exerciseConnHLA.h:61
virtual DtHlaStateEncoder * encoder()
Returns a pointer to the Encoder being used to encode current state into an outgoing message...
virtual DtStateRepository * stateRep()
Returns a pointer to the DtStateRepository - through which you can set or inspect current state infor...
Definition: objectPublisherHLA.h:257
#define DT_DLL_VL
Definition: vlMachineTypes.h:108
static const DtObjectId & defaultId()
static double dfltRotationThreshold()
Definition: thresholder.h:151
virtual DtEntityStateRepository * esr()
Synonym for entityStateRep().
Definition: entityPublisherHLA.h:168
Instances of DtObjectPublisher are used for local or source simulations of objects, (i.e.
Definition: objectPublisherHLA.h:34
static void setDfltRotationThreshold(double thresh)
Set/Get default rotation threshold in radians.
Definition: thresholder.h:156
static void setDfltRotationThreshold(double r)
Instances of DtEntityPublisher are used for local or source simulations of entities (i...
Definition: entityPublisherHLA.h:28
Instances of DtEntityStateRepository are used to maintain attributes and state of entity objects in a...
Definition: entityStateRepository.h:41
virtual bool tick()
Tick (update) this object.
static void setDfltTranslationThreshold(double t)
virtual const DtGlobalObjectDesignator & globalId() const
Get the HLA object&#39;s global object designator - the object name in RTI1.3.3, but the objectId in RTI1...
virtual void forceUpdate()
Specify a set of attributes that should be included in the ahvps the next time tick is called...
static double dfltTranslationThreshold()
Definition: thresholder.h:146
Contains the DIS DtEntityStateEncoder class declaration.
DtObjectPublisher & operator=(const DtObjectPublisher &orig)
assignment operator – not implemented
Contains the DIS DtEntityStateDecoder class declaration.
Contains the DtEntityStateRepository class declaration.
virtual DtEntityStateRepository * entityStateRep()
Returns a pointer to the EntityStateRepository - through which you can set or inspect current state i...
Definition: entityPublisherHLA.h:163
static void setDfltTranslationThreshold(double thresh)
Set/Get default translation threshold in radians.
Definition: thresholder.h:141
This class declares the DIS version of DtObjectPublisher.
This is a base class meant to encapsulate user callbacks on ownership management services.
Definition: ownershipHandlerHLA.h:27
DtForceType
Section 4.
Definition: disEnums.h:199
unsigned short DtU16
A 16 bit unsigned integer value.
Definition: vlMachineTypes.h:140
DtObjectId instances are used to represent RTI::ObjectInstances in VR-Link.
Definition: objectId.h:38
DtDeadReckonTypes
Definition: disEnums.h:997
DtReal DtTime
A definition of DtTime.
Definition: vlTime.h:19
This file declares DtOwnershipHandler.
Instances of DtString are used to represent strings.
Definition: vlString.h:29
virtual const DtObjectId & id() const
Get the object&#39;s local identifier.
void init(RTI::ObjectClassHandle hand, DtStateRepository *stateRep, DtStateRepository *asSeenByRemote, DtHlaStateEncoder *encoder=0, DtHlaStateDecoder *decoder=0)
static double dfltRotationThreshold()
virtual const DtObjectId & localId() const
Get the object&#39;s local identifier.
Definition: objectPublisherHLA.h:277
DtEntityType is used to represent the type an entity object.
Definition: entityType.h:26
static double dfltTranslationThreshold()
virtual DtHlaStateDecoder * decoder()
Returns a pointer to the Decoder being used to decode state messages that we send back into the asSee...

Document ID: Generated on Thu Sep 19 02:12:35 EDT 2024 from SVN revision 269601
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)