Go to the documentation of this file.00001
00002
00003
00004
00005
00009
00010 #ifndef lgrDisEntity_H_
00011 #define lgrDisEntity_H_
00012
00013 #if DtDIS
00014
00015 #include "lgrPublisherInterface.h"
00016 #include "lgrSim.h"
00017 #include <vl/esPdu.h>
00018
00019 #include "absoluteTime.h"
00020 #include "virtualConstructor.h"
00021
00022 class DtClock;
00023 class DtDIGuyCustomPdu;
00024 class DtEntityStateRepository;
00025
00026 namespace MAKLogger
00027 {
00028
00029 class DtLgrDisSimulationManager;
00030 class DtLgrArtPartList;
00031
00034 class DT_DLL_LGRSIM DtLgrDisEntityPublisher : public DtLgrPublisherInterface
00035 {
00036 public:
00038 DT_VIRTUAL_CTR(DtLgrDisEntityPublisher,(const DtEntityStatePdu& pdu,
00039 DtLgrDisSimulationManager* simManager))
00040
00041
00042 virtual ~DtLgrDisEntityPublisher();
00043 protected:
00045 DtLgrDisEntityPublisher( const DtLgrDisEntityPublisher& src );
00047 DtLgrDisEntityPublisher& operator=( const DtLgrDisEntityPublisher& src );
00048
00049 public:
00052 virtual void update( const DtPdu& pdu,double scaling, bool isStatic, bool sendFlag );
00053
00057 virtual void sendUpdateAtScaleChangePoint(double oldScale, double newScale,
00058 bool wasStatic, bool isStatic);
00059
00061 virtual bool timeoutNow();
00062
00065 virtual void tick(double scale, bool isStatic);
00066
00068 virtual const DtEntityIdentifier& id();
00069
00070 virtual void processDIGuyPdu(const DtDIGuyCustomPdu& pdu);
00071
00072 protected:
00073
00074 virtual void doDDR(DtAbsoluteTime tm,double timescale);
00075
00080 virtual bool sendNow();
00081
00084 virtual void sendScaled( double timescale, bool isStatic, bool doSend );
00085
00087 virtual void sendCurrent( double timescale, bool isStatic);
00088
00090 virtual void sendPdu();
00091
00095 virtual bool getArtPartParamsFromPdu();
00096
00100 virtual bool setArtPartParamsToPdu();
00101
00104 virtual bool scaleArtPartRateParams( double ts );
00105
00108 virtual bool drArtPartParamsToScaleChangePoint( DtTime dt );
00109
00112 virtual void scaleVecs( double ts );
00113
00115 virtual void scaleVelocity( double ts );
00116
00117 protected:
00118 DtEntityStatePdu lastRead;
00119 DtEntityStatePdu toSend;
00120
00121 DtAbsoluteTime myLastScaledTime;
00122 DtAbsoluteTime myLastRealTime;
00123
00124 DtLgrDisSimulationManager* mySimManager;
00125 DtClock* myClock;
00126
00127 DtTaitBryan myExtrapEuler;
00128 DtVector myExtrapPos;
00129 DtVector myExtrapVel;
00130 DtVector myScaledVel;
00131 DtVector myScaledAcc;
00132 DtVector myScaledRotVel;
00133
00134 DtLgrArtPartList* myArtPartRecvList;
00135 DtLgrArtPartList* myArtPartSendList;
00136 int myNumAttParts;
00137 char* myPartBuffer;
00138 int myPartBufferSize;
00139 double myLastTimeScale;
00140
00141 DtEntityStateRepository* myEsr;
00142 };
00143 }
00144
00145 #endif //! DtDIS
00146 #endif //! disLgrEntityPublisher_H_