VR-Link API Documentation for DIS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pointObjectPublisherDIS.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2013 VT MAK
3  * All rights reserved.
4  ****************************************************************************/
5 
9 
10 #pragma once
11 
12 #if DtDIS
13 
14 #include <vl/pdu.h>
15 #include <vl/objectPublisherDIS.h>
19 #include <vlutil/vlPrint.h>
20 
22 {
23 public:
24 
26  typedef DtPointObjectRepository* (*DtStateRepCreator)();
27 
28 public:
29 
32  const DtObjectId& id = DtObjectId::defaultId() );
33 
36  DtExerciseConn* conn, const DtObjectId& id = DtObjectId::defaultId() );
37 
40  DtExerciseConn* conn, const DtObjectId& id = DtObjectId::defaultId() );
41 
43  virtual ~DtPointObjectPublisher();
44 
48  virtual void tick();
49 
52  virtual inline DtPointObjectRepository* pointObjectStateRep();
53 
55  virtual inline DtPointObjectRepository* posr();
56 
59  virtual inline DtPointObjectDecoder* decoder() { return myDecoder; }
60 
63  virtual inline DtPointObjectEncoder* encoder() { return myEncoder; }
64 
66  virtual const DtObjectId& id() const;
67 
69  virtual inline const DtObjectId& localId() const { return id(); }
70 
72  virtual inline const DtGlobalObjectDesignator& globalId() const { return id(); }
73 
76  virtual inline void sendFinalPduOnDestruction( bool onOff );
77 
80  virtual inline void forceUpdate();
81 
83  virtual void setLocThreshold( double val );
84  virtual double locThreshold() const;
85 
87  virtual void setOriThreshold( double val );
88  virtual double oriThreshold() const;
89 
91  static inline void setDfltLocThreshold( double val );
92  static inline double dfltLocThreshold();
93 
95  static inline void setDfltOriThreshold( double val );
96  static inline double dfltOriThreshold();
97 
99  static void setStateRepCreator( DtStateRepCreator creator );
100  static DtStateRepCreator stateRepCreator();
101 
102  static void setClassDfltTimeThreshold( DtTime threshold );
103 
104 protected:
105 
107  void init( const DtObjectId& );
108 
110  void sendFinalPdu();
111 
112 private:
113 
116 
119 
120 protected:
121 
122  static DtStateRepCreator theStateRepCreator;
123 
124  static double theDfltLocThreshold;
125  static double theDfltOriThreshold;
128 
133 
134 };
135 
137 {
138  return posr();
139 }
140 
142 {
143  return static_cast<DtPointObjectRepository*>(myStateRep);
144 }
145 
147 {
149 }
150 
152 {
153  mySendFinalInDtor = onOff;
154 }
155 
157 {
158  theDfltLocThreshold = val;
159 }
160 
162 {
163  return theDfltLocThreshold;
164 }
165 
167 {
168  theDfltOriThreshold = val;
169 }
170 
172 {
173  return theDfltOriThreshold;
174 }
175 
176 #endif // DtDIS
DtStateRepository * myStateRep
Definition: objectPublisherDIS.h:176
static double dfltLocThreshold()
Definition: pointObjectPublisherDIS.h:161
Instances of DtExerciseConn are used to provide an application&#39;s interface or connection to the netwo...
Definition: exerciseConnDIS.h:61
Contains the DtPointObjectRepository class declaration.
#define DT_DLL_VL
Definition: vlMachineTypes.h:108
static const DtEntityIdentifier & defaultId()
Returns a reference to an instance of -1:-1:-1.
static double theDfltLocThreshold
Definition: pointObjectPublisherDIS.h:124
virtual const DtObjectId & localId() const
Get the point object&#39;s localId - same as id for DIS.
Definition: pointObjectPublisherDIS.h:69
virtual DtPointObjectEncoder * encoder()
Returns a pointer to the Encoder being used to encode current state into an entity state PDU...
Definition: pointObjectPublisherDIS.h:63
static void setDfltLocThreshold(double val)
Get/Set default Location threshold.
Definition: pointObjectPublisherDIS.h:156
virtual const DtGlobalObjectDesignator & globalId() const
Get the global object designator - same as id for DIS.
Definition: pointObjectPublisherDIS.h:72
Instances of DtObjectPublisher are used for local or source simulations of objects, (i.e.
Definition: objectPublisherDIS.h:36
Functions in vlPrint.h provide an error and print facility for vrlink.
virtual void forceUpdate()=0
For publisher to send PDU on next tick.
static bool theClassDfltIsSetFlag
Definition: pointObjectPublisherDIS.h:127
DtPointObjectDecoder * myDecoder
Definition: pointObjectPublisherDIS.h:129
virtual DtPointObjectRepository * pointObjectStateRep()
Returns a pointer to the DtPointObjectRepository - through which you can set or inspect current state...
Definition: pointObjectPublisherDIS.h:136
virtual const DtObjectId & id() const =0
The id is the same as the globalId, a DtEntityIdentifier unique to this object.
virtual DtPointObjectDecoder * decoder()
Returns a pointer to the Decoder being used to decode PDUs that we send back into the asSeenByRemote ...
Definition: pointObjectPublisherDIS.h:59
virtual void forceUpdate()
Force a state update to be sent during the next call to tick, even if nothing would normally cause a ...
Definition: pointObjectPublisherDIS.h:146
DtSyntheticEnvironmentObjectType is a class which contains information identifying the type of a synt...
Definition: vlpi/syntheticEnvironmentObjectType.h:19
Contains the DIS DtPointObjectEncoder class declaration.
static double theDfltOriThreshold
Definition: pointObjectPublisherDIS.h:125
Contains the DIS DtPointObjectDecoder class declaration.
Definition: pointObjectPublisherDIS.h:21
Instances of DtPointObjectRepository are used to maintain state information needed by point environme...
Definition: pointObjectRepository.h:31
Provides encoding logic for the DtPointObjectStatePdu class.
Definition: pointObjectEncoderDIS.h:20
DtPointObjectEncoder * myEncoder
Definition: pointObjectPublisherDIS.h:130
Instances of DtEntityIdentifier are used as a unique ID for entities in DIS.
Definition: entityIdentifier.h:31
DtObjectPublisher & operator=(const DtObjectPublisher &orig)
assignment operator – not implemented
Provides decoding logic for the DtPointObjectStatePdu class.
Definition: pointObjectDecoderDIS.h:20
virtual void sendFinalPduOnDestruction(bool onOff)
Set flag indicating whether to send a final PDU with the &quot;FinalPdu&quot; appearance bit set...
Definition: pointObjectPublisherDIS.h:151
This class declares the DIS version of DtObjectPublisher.
static DtStateRepCreator theStateRepCreator
Definition: pointObjectPublisherDIS.h:122
static DtTime theClassDfltTimeThreshold
Definition: pointObjectPublisherDIS.h:126
virtual void tick()=0
Tick (update) this object.
bool myStateRepPassedFlag
Definition: pointObjectPublisherDIS.h:131
virtual DtPointObjectRepository * posr()
Synonym for pointObjectStateRep().
Definition: pointObjectPublisherDIS.h:141
static double dfltOriThreshold()
Definition: pointObjectPublisherDIS.h:171
bool mySendFinalInDtor
Definition: pointObjectPublisherDIS.h:132
virtual void setSendNeeded()
Sets myForceSendNeeded to true.
static void setDfltOriThreshold(double val)
Get/Set default Orientation threshold.
Definition: pointObjectPublisherDIS.h:166

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)