VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtEntityStateInterceptor.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2025 MAK Technologies
3  * All rights reserved.
4  ****************************************************************************/
5 
9 
10 #pragma once
11 
14 
16 #include <vl/diGuyObjectStateRepository.h>
17 
18 #include <vlutil/vlTime.h>
19 #include <vl/globalObjectDesignator.h>
20 
21 #include <matrix/vlVector.h>
22 #include <matrix/vlTaitBryan.h>
23 
24 #include <vlpi/disEnums.h>
25 #include <vlpi/entityType.h>
26 
27 class DtStateRepository;
30 class DtDIGuyObjectStateRepository;
31 
32 namespace makVrv
33 {
34  namespace DT_PROTOCOL_NAMESPACE
35  {
36  class DtVrlinkConnection;
38 
42  template <typename StateRepClass>
44  {
45  public:
46 
50 
52  virtual ~DtEntityStateInterceptor();
53 
55  DtEntityStateInterceptor() = delete;
56 
59 
62 
63  private:
64 
66  //\throws DtCorrutedState this class is not copyable.
67  virtual DtStateRepository* clone( bool copy = false ) const override;
68 
69  public:
70 
73 
76  virtual void setAll(
77  const DtVector& loc,
78  const DtVector32& vel,
79  const DtTaitBryan& ori,
80  const DtVector32& acc,
81  const DtVector32& rotVel,
82  DtTime curTime) override;
83 
86  virtual void setLocation(const DtVector & location, DtTime aTime) override;
87 
89  virtual void setVelocity(const DtVector32 & Velocity, DtTime aTime) override;
90 
92  virtual void setAcceleration(const DtVector32 & Acceleration, DtTime aTime) override;
93 
95  virtual void setOrientation(const DtTaitBryan& orient, DtTime aTime) override;
96 
98  virtual void setRotationalVelocity(const DtVector32 & BodyRates, DtTime aTime) override;
99 
101  virtual void setAlgorithm(DtDeadReckonTypes alg) override;
102 
108  virtual void setHostGlobalId( const DtGlobalObjectDesignator& id ) override;
109 
110  virtual void clearHostGlobalId() override;
111 
113  virtual void setRelativeLocation(const DtVector & location, DtTime aTime) override;
114 
117  virtual void setRelativeVelocity(const DtVector32 & Velocity, DtTime aTime) override;
118 
121  virtual void setRelativeAcceleration(const DtVector32 & Acceleration, DtTime aTime) override;
122 
124  virtual void setRelativeOrientation(const DtTaitBryan& orient, DtTime aTime) override;
125 
127  virtual void setRelativeRotationalVelocity(const DtVector32 & BodyRates, DtTime aTime) override;
128 
130  virtual void setRelativeFrozen(bool onOff) override;
131 
133  virtual void setRelativeAlgorithm(DtDeadReckonTypes alg) override;
134 
136  virtual void setRelativePosition( const DtVector & newVal ) override;
137 
139  virtual void setStationName( const DtStationName newVal ) override;
140 
142  virtual void setStationNumber(const DtU16 newVal) override;
143 
145  virtual void setEntityType(const DtEntityType& type) override;
146 
147 #ifdef DtHLA
148  virtual void setEntityId(const DtEntityIdentifier& id) override;
153 #endif
154  virtual void setForceId(DtForceType force) override;
156 
159  virtual void setMarkingText(const char* text) override;
160 
161  //We need this for DIS as individual functions are not called.
162  #if DtDIS
163  virtual void setAppearance(DtU32 app);
167  #endif
168 
173  virtual void setAppearanceAttribute(const DtAppearAttribute attr,
174  const DtAppearAttrVal val) override;
175 
177 
178  virtual void setDiGuyType( const DtString& newType ) override;
179  virtual void setDiGuyType( const DtString& newType, const DtString& newAppearance ) override;
180 
181  virtual void setDiGuyAppearance( const DtString& val ) override;
182  virtual void setDiGuyHeadAppearance( const DtString& val ) override;
183  virtual void setDiGuyItemAppearance( const DtString& val ) override;
184 
186  virtual void setDiGuyCharacterScale( const DtVector& scale ) override;
187 
188  virtual void setDiGuyBodyWeight( double val ) override;
189 
190  virtual void setDiGuyAction( const DtString& val ) override;
191 
196  virtual void setDiGuyAction( const DtString& val, bool paused, double speed = 0.0,
197  bool usePositioning = false, const DtVector& offset = DtVector(0,0,0), double transitionSpeed = 1.0 );
198 
199  virtual void addDiGuyShapeVariation( unsigned int linkIndex, unsigned int shapeIndex, const DtDiGuyPixelData& pixelData ) override;
200  virtual void removeDiGuyShapeVariation( unsigned int linkIndex, unsigned int shapeIndex ) override;
201  virtual void setDiGuyShapeVariations( const DtDiGuyLinkShapeMap& shapeVariations ) override;
202 
203  virtual void setDiGuyUnit( const DtPatchIdentifier& val ) override;
204  virtual void setDiGuyPersonalUnit( const DtPatchIdentifier& val ) override;
205  virtual void setDiGuyRank( const DtPatchIdentifier& val ) override;
206  virtual void setDiGuyName( const DtString & val ) override;
207 
212 
213  virtual void setDiGuyTypeNoPropagation( const DtString& newType );
214  virtual void setDiGuyTypeNoPropagation( const DtString& newType, const DtString& newAppearance );
215 
216  virtual void setDiGuyAppearanceNoPropagation( const DtString& val );
217  virtual void setDiGuyHeadAppearanceNoPropagation( const DtString& val );
218  virtual void setDiGuyItemAppearanceNoPropagation( const DtString& val );
219  virtual void setDiGuyEquipmentNoPropagation( const DtString& val );
220 
221  virtual void setDiGuyCharacterScaleNoPropagation( const DtVector& val );
222  virtual void setDiGuyBodyWeightNoPropagation( DtFloat64 val );
223 
224  virtual void setDiGuyActionNoPropagation( const DtString& val, bool paused,
225  double speed, bool usePositioning, const DtVector& offset, double transitionSpeed );
226 
227  virtual void setDiGuyCharacterUnitNoPropagation( const DtPatchIdentifier& val );
228  virtual void setDiGuyCharacterPersonalUnitNoPropagation( const DtPatchIdentifier& val );
229  virtual void setDiGuyCharacterRankNoPropagation( const DtPatchIdentifier& val );
230  virtual void setDiGuyCharacterNameNoPropagation( const DtString& val );
231 
233 
234  virtual void setDiGuyArc( const std::vector<char>& val ) override;
235  virtual void setDiGuyParent( const DtEntityIdentifier& val ) override;
236 
239 
242  virtual void setDiGuyStateRepository( DtDIGuyObjectStateRepository* diGuyStateRep );
243 
245  virtual void setHduLightsOn(const bool& status) override;
246 
247  virtual void setEmergencyLightsOn(bool val) override;
248 
249  virtual void setLeftIndicatorLightsOn(bool val) override;
250 
251  virtual void setRightIndicatorLightsOn(bool val) override;
252 
253  virtual void setTaxiwayLightsOn(const bool& status) override;
254 
255  virtual void setFormationLightsLuminance(DtU8 s) override;
256 
257  protected:
258 
261  bool fuzzyCompare(double a, double b, double e) const;
262 
265  virtual bool isOrientationDifferent(const DtTaitBryan& orientA, const DtTaitBryan& orientB,
266  const double epsilon) const;
267 
268  protected:
269 
271  };
272 
273  }
274 }
virtual void setDiGuyCharacterNameNoPropagation(const DtString &val)
These are to support HLAevolved without causing infinite loops, they call the listener for data repli...
virtual void setRelativeOrientation(const DtTaitBryan &orient, DtTime aTime) override
Set the relative orientation of the entity with respect to the host.
virtual void setAll(const DtVector &loc, const DtVector32 &vel, const DtTaitBryan &ori, const DtVector32 &acc, const DtVector32 &rotVel, DtTime curTime) override
Coherently set all DR parameters, thus avoiding DR computations associated with a partial set...
virtual void setFormationLightsLuminance(DtU8 s) override
virtual void setDiGuyCharacterScaleNoPropagation(const DtVector &val)
These are to support HLAevolved without causing infinite loops, they call the listener for data repli...
DtEntityStateInterceptor()=delete
not allowed - default constructor
virtual void setLocation(const DtVector &location, DtTime aTime) override
Set the location of the center of mass in geocentric world coordinates at aTime.
virtual void setDiGuyItemAppearanceNoPropagation(const DtString &val)
These are to support HLAevolved without causing infinite loops, they call the listener for data repli...
virtual void clearHostGlobalId() override
Coherently set all DR parameters, thus avoiding DR computations associated with a partial set...
virtual void setDiGuyCharacterScale(const DtVector &scale) override
Sets the character scaling factor.
virtual void addDiGuyShapeVariation(unsigned int linkIndex, unsigned int shapeIndex, const DtDiGuyPixelData &pixelData) override
virtual void setDiGuyActionNoPropagation(const DtString &val, bool paused, double speed, bool usePositioning, const DtVector &offset, double transitionSpeed)
These are to support HLAevolved without causing infinite loops, they call the listener for data repli...
virtual void setStationNumber(const DtU16 newVal) override
Sets the station number this entity is assigned to on the host.
virtual void setDiGuyParent(const DtEntityIdentifier &val) override
virtual void setDiGuyHeadAppearanceNoPropagation(const DtString &val)
These are to support HLAevolved without causing infinite loops, they call the listener for data repli...
virtual void setDiGuyEquipmentNoPropagation(const DtString &val)
These are to support HLAevolved without causing infinite loops, they call the listener for data repli...
virtual void setDiGuyRank(const DtPatchIdentifier &val) override
virtual void setHostGlobalId(const DtGlobalObjectDesignator &id) override
Sets the globalId of the attached host. This function should only be used to attach this entity to an...
virtual void setDiGuyPersonalUnit(const DtPatchIdentifier &val) override
virtual void setAppearanceAttribute(const DtAppearAttribute attr, const DtAppearAttrVal val) override
Set an appearance attribute. attr is the appearance bitfield mask val is the hex number to be or&#39;ed i...
virtual void setDiGuyItemAppearance(const DtString &val) override
virtual void setDiGuyCharacterPersonalUnitNoPropagation(const DtPatchIdentifier &val)
These are to support HLAevolved without causing infinite loops, they call the listener for data repli...
#define DT_PROTOCOL_NAMESPACE
Contains defines and includes header files for protocols.
Definition: vrfProtocol.h:13
virtual void setAppearance(DtU32 app)
Set the appearance bit field, use with care.
virtual void setRelativePosition(const DtVector &newVal) override
Set the relative position on the host.
Contains the makVrv::DtPartCollectionInterceptor class declaration.
Contains makVrv::DtVirtualBaseClass class.
virtual void setDiGuyUnit(const DtPatchIdentifier &val) override
virtual void setDiGuyTypeNoPropagation(const DtString &newType)
These are to support HLAevolved without causing infinite loops, they call the listener for data repli...
virtual void setForceId(DtForceType force) override
Set the force type.
virtual void setDiGuyCharacterRankNoPropagation(const DtPatchIdentifier &val)
These are to support HLAevolved without causing infinite loops, they call the listener for data repli...
virtual void setAlgorithm(DtDeadReckonTypes alg) override
Set the dead reckoning algorithm.
virtual void setHduLightsOn(const bool &status) override
Set the HDULightsOn.
bool fuzzyCompare(double a, double b, double e) const
Return true if two doubles are within e of each other. non-virtual for performance reasons...
virtual void setDiGuyBodyWeight(double val) override
virtual void setRelativeAlgorithm(DtDeadReckonTypes alg) override
Set the dead reckoning algorithm.
virtual void setTaxiwayLightsOn(const bool &status) override
virtual void removeDiGuyShapeVariation(unsigned int linkIndex, unsigned int shapeIndex) override
virtual void setDiGuyBodyWeightNoPropagation(DtFloat64 val)
These are to support HLAevolved without causing infinite loops, they call the listener for data repli...
virtual void setRelativeFrozen(bool onOff) override
Set relative frozen.
virtual void setDiGuyShapeVariations(const DtDiGuyLinkShapeMap &shapeVariations) override
virtual void setVelocity(const DtVector32 &Velocity, DtTime aTime) override
Set the velocity in meters per second at aTime.
double DtFloat64
Definition: vrvControlStructTypes.h:36
virtual void setRelativeRotationalVelocity(const DtVector32 &BodyRates, DtTime aTime) override
Set the relative rotational velocity.
virtual bool isOrientationDifferent(const DtTaitBryan &orientA, const DtTaitBryan &orientB, const double epsilon) const
Return true if the given orientations are different beyond the given epsilon. Internally uses fuzzyCo...
virtual DtStateRepository * clone(bool copy=false) const override
Return a copy/empty object of the same type as this.
Contains makVrv::DtBaseEntityStateInterceptor class.
virtual void setEntityType(const DtEntityType &type) override
Set the entity type.
virtual void setDiGuyAction(const DtString &val) override
Base class for EntityState Interceptors, this allows all entity ESI&#39;s to have an HLA13 entity...
Definition: DtBaseEntityStateInterceptor.h:28
virtual void setRelativeLocation(const DtVector &location, DtTime aTime) override
Set the location of the center of mass in world coordinates at the given time.
virtual void setRotationalVelocity(const DtVector32 &BodyRates, DtTime aTime) override
Set the rotational velocity of an entity at aTime.
DtEntityStateInterceptor & operator=(const DtEntityStateInterceptor &)=delete
not allowed - equals operator
virtual void setDiGuyName(const DtString &val) override
DtVrlinkEntityStateListener * myVrlinkEntityStateListener
Definition: DtEntityStateInterceptor.h:270
virtual void setDiGuyStateRepository(DtDIGuyObjectStateRepository *diGuyStateRep)
Sets the related DI-Guy state repository (see DtDiGuyStateRepositoryInterceptoy.h) that...
virtual void setDiGuyAppearance(const DtString &val) override
virtual void setEntityId(const DtEntityIdentifier &id) override
Set the entity&#39;s identifier. In DIS, this comes as part of the reflected entity constructor. In DIS, this is the GlobalObjectDesignator; in HLA/RPR, it&#39;s just another data element.
virtual void setDiGuyAppearanceNoPropagation(const DtString &val)
These are to support HLAevolved without causing infinite loops, they call the listener for data repli...
virtual void setRelativeAcceleration(const DtVector32 &Acceleration, DtTime aTime) override
Set the relative acceleration of the entity with respect to the host at aTime.
virtual void setAcceleration(const DtVector32 &Acceleration, DtTime aTime) override
Sets the acceleration at aTime.
virtual DtArticulatedPartCollection * artPartList()
Get the art part list.
virtual void setRightIndicatorLightsOn(bool val) override
voidpf uLong offset
Definition: ioapi.h:42
virtual void setStationName(const DtStationName newVal) override
Sets the station name this entity is assigned to on the host.
virtual void setMarkingText(const char *text) override
Set the marking text attribute. This is typically used as the vehicle bumper number, though some applications may use it as a unique identifier.
virtual void setDiGuyType(const DtString &newType) override
virtual void setEmergencyLightsOn(bool val) override
virtual void setOrientation(const DtTaitBryan &orient, DtTime aTime) override
Set the orientation at aTime.
virtual void setDiGuyArc(const std::vector< char > &val) override
virtual void setDiGuyHeadAppearance(const DtString &val) override
virtual void setRelativeVelocity(const DtVector32 &Velocity, DtTime aTime) override
Set the relative velocity of the entity in meters per second with respect to the host at aTime...
The state interceptor interface extends DtStateRepository, via the StateRepClass template parameter...
Definition: DtEntityStateInterceptor.h:43
virtual void setLeftIndicatorLightsOn(bool val) override
virtual void setDiGuyCharacterUnitNoPropagation(const DtPatchIdentifier &val)
These are to support HLAevolved without causing infinite loops, they call the listener for data repli...

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)