VR-Link API Documentation for DIS
 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 VT MAK
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 
22 {
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:
118  virtual void tick();
119 
122  virtual DtEntityStateRepository* entityStateRep();
123 
125  virtual DtEntityStateRepository* esr();
126 
130  virtual DtEntityStateDecoder* decoder();
131 
134  virtual DtEntityStateEncoder* encoder();
135 
139  virtual DtOwnershipHandler* setOwnershipHandler( DtOwnershipHandler* handler );
140 
142  virtual const DtObjectId& id() const;
143 
145  virtual const DtObjectId& localId() const;
146 
148  virtual const DtGlobalObjectDesignator& globalId() const;
149 
153  virtual void sendFinalPduOnDestruction(bool on);
154 
157  virtual void forceUpdate();
158 
161  virtual void enableDiGuyInformation(DtDiGuyDataSendMode sendMode=DtDiGuySendPdu);
162 
164  virtual void setSendDiGuyAttributes(bool enableAttributes);
165 
167  virtual bool sendDiGuyAttributes() const;
168 
171  virtual void setSendDiGuyPdus(bool enablePdu);
172 
174  virtual bool sendDiGuyPdus() const;
175 
177  virtual void setSendSeesPdus(bool yesNo);
178 
180  virtual bool sendSeesPdus() const;
181 
183  virtual void setSeesTimeThreshold(DtTime time);
184 
186  virtual DtTime seesTimeThreshold() const;
187 
189  virtual void setDiGuyTypeTimeThreshold(DtTime time);
190 
192  virtual DtTime diGuyTypeTimeThreshold() const;
193 
195  virtual void setDiGuyAppearanceTimeThreshold(DtTime time);
196 
198  virtual DtTime diGuyAppearanceTimeThreshold() const;
199 
201  virtual void setDiGuyActionTimeThreshold(DtTime time);
202 
204  virtual DtTime diGuyActionTimeThreshold() const;
205 
207  DtTime entityTypeHeartbeat(int type, int domain);
208 
213  virtual void divestObject(DtU16 siteTarget, DtU16 applicationTarget);
214 
215 public:
216 
218  static void setStateRepCreator(DtStateRepCreator creator);
219  static DtStateRepCreator stateRepCreator(void);
220 
221  static void setClassDfltTimeThreshold(DtTime threshold);
222  static void setStationaryDfltTimeThreshold(DtTime threshold);
223  static void setEntityTypeDfltTimeThreshold(int type, int domain, DtTime threshold);
224 
226 
227  static void setDfltRotationThreshold(double r);
228  static double dfltRotationThreshold();
229  static void setDfltTranslationThreshold(double t);
230  static double dfltTranslationThreshold();
232 
234  virtual void createAndSendDiGuy();
235 
236 protected:
237 
239  void sendFinalPdu();
240 
242  virtual void createAndSendSeesPdu();
243 
244  virtual bool sendSeesNeeded() const;
245 
247  void init(const DtObjectId& vehId);
248 
249 protected:
262 
263 protected:
264  static DtStateRepCreator theStateRepCreator;
269  static std::map<std::pair<int,int>,DtTime> theEntityTypeHeartbeat;
270 };
271 
273 {
274  return esr();
275 }
276 
278 {
279  return (DtEntityStateRepository*) stateRep();
280 }
281 
283 {
284  return myEntityEncoder;
285 }
286 
288 {
289  return myEntityDecoder;
290 }
291 
293 {
294  mySendFinalInDtor = onOff;
295 }
296 
297 inline const DtObjectId& DtEntityPublisher::id() const
298 {
299  return myId;
300 }
301 
303 {
305 }
306 
308 {
310 }
311 
313 {
315 }
316 
318 {
320 }
321 
323 {
324  return id();
325 }
326 
327 
328 
329 #endif
Contains the DtObjectId class declaration.
Instances of DtEntityStateDecoder are objects capable of decoding EntityState PDUs into a DtEntitySta...
Definition: entityStateDecoder.h:23
DtDIGuyCustomPduEncoder * myDiGuyEncoder
Definition: entityPublisherDIS.h:253
static void setDfltRotationThreshold(double r)
Definition: entityPublisherDIS.h:317
Instances of DtExerciseConn are used to provide an application&#39;s interface or connection to the netwo...
Definition: exerciseConnDIS.h:61
virtual void sendFinalPduOnDestruction(bool on)
Set flag indicating whether to send a final PDU with the &quot;FinalPdu&quot; appearance bit set...
Definition: entityPublisherDIS.h:292
virtual DtStateRepository * stateRep()
Returns a pointer to the DtStateRepository - through which you can set or inspect current state infor...
Definition: objectPublisherDIS.h:215
#define DT_DLL_VL
Definition: vlMachineTypes.h:108
DtOwnershipHandler * myOwnershipHandler
Definition: entityPublisherDIS.h:259
static double dfltRotationThreshold()
Definition: thresholder.h:151
static const DtEntityIdentifier & defaultId()
Returns a reference to an instance of -1:-1:-1.
bool mySendFinalInDtor
Definition: entityPublisherDIS.h:254
static DtTime theStationaryDfltTimeThreshold
Definition: entityPublisherDIS.h:267
static void setDfltTranslationThreshold(double t)
Definition: entityPublisherDIS.h:312
virtual DtEntityStateRepository * esr()
Synonym for entityStateRep().
Definition: entityPublisherDIS.h:277
DtDiGuyDataSendMode
Definition: entityPublisherDIS.h:21
DtDiGuyDataSendMode mySendDiGuyMode
Definition: entityPublisherDIS.h:255
Instances of DtObjectPublisher are used for local or source simulations of objects, (i.e.
Definition: objectPublisherDIS.h:36
virtual void forceUpdate()=0
For publisher to send PDU on next tick.
static void setDfltRotationThreshold(double thresh)
Set/Get default rotation threshold in radians.
Definition: thresholder.h:156
Instances of DtEntityStateEncoder are used to take state information from a DtEntityStateRepository a...
Definition: entityStateEncoder.h:31
virtual DtEntityStateDecoder * decoder()
Returns a pointer to the Decoder being used to decode PDUs that we send back into the asSeenByRemote ...
Definition: entityPublisherDIS.h:287
Definition: entityPublisherDIS.h:23
virtual const DtObjectId & id() const =0
The id is the same as the globalId, a DtEntityIdentifier unique to this object.
virtual const DtObjectId & localId() const
Get the entity&#39;s localId - same as id for DIS.
Definition: entityPublisherDIS.h:322
DtObjectId myId
Definition: entityPublisherDIS.h:250
DtEntityStateEncoder * myEntityEncoder
Definition: entityPublisherDIS.h:252
virtual DtEntityStateEncoder * encoder()
Returns a pointer to the Encoder being used to encode current state into an entity state PDU...
Definition: entityPublisherDIS.h:282
static double dfltTranslationThreshold()
Definition: entityPublisherDIS.h:307
Instances of DtRelativeLocationPdu are used to convey the fact that one unit is located at a position...
Definition: relativeLocationPdu.h:29
Instances of DtEntityPublisher are used for local or source simulations of entities, (i.e.
Definition: entityPublisherDIS.h:33
Instances of DtEntityStateRepository are used to maintain attributes and state of entity objects in a...
Definition: entityStateRepository.h:37
DtRelativeLocationPdu myLastSentRelLocPdu
Definition: entityPublisherDIS.h:260
static DtTime theClassDfltTimeThreshold
Definition: entityPublisherDIS.h:265
static bool theStationaryDfltIsSetFlag
Definition: entityPublisherDIS.h:268
static double dfltTranslationThreshold()
Definition: thresholder.h:146
virtual const DtGlobalObjectDesignator & globalId() const =0
The entityIdentifier unique to this object.
Instances of DtEntityIdentifier are used as a unique ID for entities in DIS.
Definition: entityIdentifier.h:31
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: entityPublisherDIS.h:272
static bool theClassDfltIsSetFlag
Definition: entityPublisherDIS.h:266
Definition: entityPublisherDIS.h:24
DtTime mySeesPdusTimeThreshold
Definition: entityPublisherDIS.h:257
static DtStateRepCreator theStateRepCreator
Definition: entityPublisherDIS.h:264
DtTime myLastSeesPdusUpdate
Definition: entityPublisherDIS.h:258
Definition: diGuyCustomPduEncoder.h:23
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: ownershipHandlerDIS.h:39
DtForceType
Section 4.
Definition: disEnums.h:199
static std::map< std::pair< int, int >, DtTime > theEntityTypeHeartbeat
Definition: entityPublisherDIS.h:269
DtTime myLastSentRelLocPduTime
Definition: entityPublisherDIS.h:261
unsigned short DtU16
A 16 bit unsigned integer value.
Definition: vlMachineTypes.h:140
Definition: entityPublisherDIS.h:25
static double dfltRotationThreshold()
Definition: entityPublisherDIS.h:302
virtual void tick()=0
Tick (update) this object.
bool mySendSeesPdus
Definition: entityPublisherDIS.h:256
DtDeadReckonTypes
Definition: disEnums.h:993
This file declares DtOwnershipHandler.
virtual const DtObjectId & id() const
Get the entity&#39;s identifier.
Definition: entityPublisherDIS.h:297
virtual const DtObjectId & localId() const =0
The localId is the same as the globalId, a DtEntityIdentifier unique to this object.
DtEntityType is used to represent the type an entity object.
Definition: entityType.h:26
DtEntityStateDecoder * myEntityDecoder
Definition: entityPublisherDIS.h:251

Document ID: Generated on Mon Apr 25 03:39:01 EDT 2022 from SVN revision 242502
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)