CigiBaseRateCtrl.h

Go to the documentation of this file.
00001 
00066 #if !defined(_CIGI_BASE_RATE_CTRL_INCLUDED_)
00067 #define _CIGI_BASE_RATE_CTRL_INCLUDED_
00068 
00069 #include "CigiBasePacket.h"
00070 
00071 // ====================================================================
00072 // preprocessor definitions
00073 // ====================================================================
00074 
00075 #define CIGI_RATE_CTRL_PACKET_ID_V1 5
00076 #define CIGI_RATE_CTRL_PACKET_SIZE_V1 32
00077 
00078 #define CIGI_RATE_CTRL_PACKET_ID_V2 5
00079 #define CIGI_RATE_CTRL_PACKET_SIZE_V2 32
00080 
00081 #define CIGI_RATE_CTRL_PACKET_ID_V3 8
00082 #define CIGI_RATE_CTRL_PACKET_SIZE_V3 32
00083 
00084 #define CIGI_RATE_CTRL_PACKET_ID_V3_2 8
00085 #define CIGI_RATE_CTRL_PACKET_SIZE_V3_2 32
00086 
00087 
00088 class CigiRateCtrlV1;
00089 class CigiRateCtrlV2;
00090 class CigiRateCtrlV3;
00091 class CigiRateCtrlV3_2;
00092 
00093 
00094 class CIGI_SPEC CigiBaseRateCtrl : public CigiBasePacket
00095 {
00096 
00097 friend class CigiRateCtrlV1;
00098 friend class CigiRateCtrlV2;
00099 friend class CigiRateCtrlV3;
00100 friend class CigiRateCtrlV3_2;
00101 
00102 public:
00103 
00104 
00105    //=========================================================
00108    enum CoordSysGrp
00109    {
00110       World=0,
00111       Parent=0,
00112       Local=1
00113    };
00114 
00115 
00116    //==> Management
00117 
00118    //=========================================================
00121    CigiBaseRateCtrl() { };
00122 
00123    //=========================================================
00126    virtual ~CigiBaseRateCtrl() { };
00127 
00128 
00129    //==> Buffer Packing/Unpacking
00130 
00131    //=========================================================
00142    virtual int Pack(CigiBasePacket * Base, Cigi_uint8 * Buff, void *Spec) const=0;
00143 
00144    //=========================================================
00154    virtual int Unpack(Cigi_uint8 * Buff, bool Swap, void *Spec) =0;
00155 
00156    //=========================================================
00168         virtual int GetCnvt(CigiVersionID &CnvtVersion,
00169                        CigiCnvtInfoType::Type &CnvtInfo)
00170    {
00171       CnvtInfo.ProcID = CigiProcessType::ProcStd;
00172 
00173       // V1 & V2 use the same packet id number
00174       if(CnvtVersion.CigiMajorVersion < 3)
00175          CnvtInfo.CnvtPacketID = CIGI_RATE_CTRL_PACKET_ID_V2;
00176       else
00177          CnvtInfo.CnvtPacketID = CIGI_RATE_CTRL_PACKET_ID_V3;
00178 
00179       return(CIGI_SUCCESS);
00180    }
00181 
00182 
00183 
00184    //==> Accessing Member Variable Values functions
00185 
00186    //+> EntityID
00187 
00188    //=========================================================
00196    int SetEntityID(const Cigi_uint16 EntityIDIn, bool bndchk=true)
00197    {
00198       EntityID = EntityIDIn;
00199       return(CIGI_SUCCESS);
00200    }
00201 
00202    //=========================================================
00205    Cigi_uint16 GetEntityID(void) const { return(EntityID); }
00206 
00207 
00208    //+> XRate
00209 
00210    //=========================================================
00217    int SetXRate(const float XRateIn, bool bndchk=true)
00218    {
00219       XRate = XRateIn;
00220       return(CIGI_SUCCESS);
00221    }
00222 
00223    //=========================================================
00226    float GetXRate(void) const { return(XRate); }
00227 
00228 
00229    //+> YRate
00230 
00231    //=========================================================
00238    int SetYRate(const float YRateIn, bool bndchk=true)
00239    {
00240       YRate = YRateIn;
00241       return(CIGI_SUCCESS);
00242    }
00243 
00244    //=========================================================
00247    float GetYRate(void) const { return(YRate); }
00248 
00249 
00250    //+> ZRate
00251 
00252    //=========================================================
00259    int SetZRate(const float ZRateIn, bool bndchk=true)
00260    {
00261       ZRate = ZRateIn;
00262       return(CIGI_SUCCESS);
00263    }
00264 
00265    //=========================================================
00268    float GetZRate(void) const { return(ZRate); }
00269 
00270 
00271    //+> RollRate
00272 
00273    //=========================================================
00280    int SetRollRate(const float RollRateIn, bool bndchk=true)
00281    {
00282       RollRate = RollRateIn;
00283       return(CIGI_SUCCESS);
00284    }
00285 
00286    //=========================================================
00289    float GetRollRate(void) const { return(RollRate); }
00290 
00291 
00292    //+> PitchRate
00293 
00294    //=========================================================
00301    int SetPitchRate(const float PitchRateIn, bool bndchk=true)
00302    {
00303       PitchRate = PitchRateIn;
00304       return(CIGI_SUCCESS);
00305    }
00306 
00307    //=========================================================
00310    float GetPitchRate(void) const { return(PitchRate); }
00311 
00312 
00313    //+> YawRate
00314 
00315    //=========================================================
00322    int SetYawRate(const float YawRateIn, bool bndchk=true)
00323    {
00324       YawRate = YawRateIn;
00325       return(CIGI_SUCCESS);
00326    }
00327 
00328    //=========================================================
00331    float GetYawRate(void) const { return(YawRate); }
00332 
00333 
00334 
00335 protected:
00336 
00337    //==> Member variables
00338 
00339    //=========================================================
00343    Cigi_uint16 EntityID;
00344 
00345    //=========================================================
00351    Cigi_int8 ArtPartIDV1;
00352 
00353    //=========================================================
00357    Cigi_uint8 ArtPartIDV3;
00358 
00359    //=========================================================
00366    bool ApplyToArtPart;
00367 
00368    //=========================================================
00374    CoordSysGrp CoordSys;
00375 
00376    //=========================================================
00382    float XRate;
00383 
00384    //=========================================================
00390    float YRate;
00391 
00392    //=========================================================
00398    float ZRate;
00399 
00400    //=========================================================
00407    float RollRate;
00408 
00409    //=========================================================
00415    float PitchRate;
00416 
00417    //=========================================================
00423    float YawRate;
00424 
00425 
00426 };
00427 
00428 #endif // #if !defined(_CIGI_BASE_RATE_CTRL_INCLUDED_)

Generated on Wed Apr 29 08:59:55 2009 for CCL by  doxygen 1.4.7