00001 
00055 #if !defined(_CIGI_BASE_COLL_DET_SEG_DEF_INCLUDED_)
00056 #define _CIGI_BASE_COLL_DET_SEG_DEF_INCLUDED_
00057 
00058 #include "CigiBasePacket.h"
00059 
00060 
00061 
00062 
00063 
00064 #define CIGI_COLL_DET_SEG_DEF_PACKET_ID_V1 24
00065 #define CIGI_COLL_DET_SEG_DEF_PACKET_SIZE_V1 24
00066 
00067 #define CIGI_COLL_DET_SEG_DEF_PACKET_ID_V2 24
00068 #define CIGI_COLL_DET_SEG_DEF_PACKET_SIZE_V2 24
00069 
00070 #define CIGI_COLL_DET_SEG_DEF_PACKET_ID_V3 22
00071 #define CIGI_COLL_DET_SEG_DEF_PACKET_SIZE_V3 40
00072 
00073 
00074 class CigiCollDetSegDefV1;
00075 class CigiCollDetSegDefV2;
00076 class CigiCollDetSegDefV3;
00077 
00078 
00079 class CIGI_SPEC CigiBaseCollDetSegDef : public CigiBasePacket
00080 {
00081 
00082 friend class CigiCollDetSegDefV1;
00083 friend class CigiCollDetSegDefV2;
00084 friend class CigiCollDetSegDefV3;
00085 
00086 public:
00087 
00088    
00089 
00090    
00093    CigiBaseCollDetSegDef() { };
00094 
00095    
00098    virtual ~CigiBaseCollDetSegDef() { };
00099 
00100 
00101    
00102 
00103    
00114    virtual int Pack(CigiBasePacket * Base, Cigi_uint8 * Buff, void *Spec) const=0;
00115 
00116    
00126    virtual int Unpack(Cigi_uint8 * Buff, bool Swap, void *Spec) =0;
00127 
00128    
00140         virtual int GetCnvt(CigiVersionID &CnvtVersion,
00141                        CigiCnvtInfoType::Type &CnvtInfo)
00142    {
00143       CnvtInfo.ProcID = CigiProcessType::ProcStd;
00144 
00145       
00146       if(CnvtVersion.CigiMajorVersion < 3)
00147          CnvtInfo.CnvtPacketID = CIGI_COLL_DET_SEG_DEF_PACKET_ID_V2;
00148       else
00149          CnvtInfo.CnvtPacketID = CIGI_COLL_DET_SEG_DEF_PACKET_ID_V3;
00150 
00151       return(CIGI_SUCCESS);
00152    }
00153 
00154 
00155 
00156    
00157 
00158    
00159 
00160    
00167    int SetEntityID(const Cigi_uint16 EntityIDIn, bool bndchk=true)
00168    {
00169       EntityID = EntityIDIn;
00170       return(CIGI_SUCCESS);
00171    }
00172 
00173    
00176    Cigi_uint16 GetEntityID(void) const { return(EntityID); }
00177 
00178 
00179    
00180 
00181    
00188    int SetSegmentEn(const bool SegmentEnIn, bool bndchk=true)
00189    {
00190       SegmentEn = SegmentEnIn;
00191       return(CIGI_SUCCESS);
00192    }
00193 
00194    
00197    bool GetSegmentEn(void) const { return(SegmentEn); }
00198 
00199 
00200    
00201 
00202    
00209    int SetX1(const float X1In, bool bndchk=true)
00210    {
00211       X1 = X1In;
00212       return(CIGI_SUCCESS);
00213    }
00214 
00215    
00218    float GetX1(void) const { return(X1); }
00219 
00220 
00221    
00222 
00223    
00230    int SetY1(const float Y1In, bool bndchk=true)
00231    {
00232       Y1 = Y1In;
00233       return(CIGI_SUCCESS);
00234    }
00235 
00236    
00239    float GetY1(void) const { return(Y1); }
00240 
00241 
00242    
00243 
00244    
00251    int SetZ1(const float Z1In, bool bndchk=true)
00252    {
00253       Z1 = Z1In;
00254       return(CIGI_SUCCESS);
00255    }
00256 
00257    
00260    float GetZ1(void) const { return(Z1); }
00261 
00262 
00263    
00264 
00265    
00272    int SetX2(const float X2In, bool bndchk=true)
00273    {
00274       X2 = X2In;
00275       return(CIGI_SUCCESS);
00276    }
00277 
00278    
00281    float GetX2(void) const { return(X2); }
00282 
00283 
00284    
00285 
00286    
00293    int SetY2(const float Y2In, bool bndchk=true)
00294    {
00295       Y2 = Y2In;
00296       return(CIGI_SUCCESS);
00297    }
00298 
00299    
00302    float GetY2(void) const { return(Y2); }
00303 
00304 
00305    
00306 
00307    
00314    int SetZ2(const float Z2In, bool bndchk=true)
00315    {
00316       Z2 = Z2In;
00317       return(CIGI_SUCCESS);
00318    }
00319 
00320    
00323    float GetZ2(void) const { return(Z2); }
00324 
00325 
00326    
00327 
00328    
00336    int SetMask(const Cigi_uint32 MaskIn, bool bndchk=true)
00337    {
00338       Mask = MaskIn;
00339       return(CIGI_SUCCESS);
00340    }
00341 
00342    
00345    Cigi_uint32 GetMask(void) const { return(Mask); }
00346 
00347 
00348 
00349 protected:
00350 
00351    
00352 
00353    
00357    Cigi_uint16 EntityID;
00358 
00359    
00363    Cigi_uint8 SegmentID;
00364 
00365    
00369    bool SegmentEn;
00370 
00371    
00376    float X1;
00377 
00378    
00383    float Y1;
00384 
00385    
00390    float Z1;
00391 
00392    
00397    float X2;
00398 
00399    
00404    float Y2;
00405 
00406    
00411    float Z2;
00412 
00413    
00418    Cigi_uint32 Mask;
00419 
00420 
00421 };
00422 
00423 #endif // #if !defined(_CIGI_BASE_COLL_DET_SEG_DEF_INCLUDED_)