CigiCollDetVolDefV3 Class Reference

#include <CigiCollDetVolDefV3.h>

Inheritance diagram for CigiCollDetVolDefV3:

CigiBaseCollDetVolDef CigiBasePacket List of all members.

Public Member Functions

 CigiCollDetVolDefV3 ()
virtual ~CigiCollDetVolDefV3 ()
virtual int Pack (CigiBasePacket *Base, Cigi_uint8 *Buff, void *Spec) const
virtual int Unpack (Cigi_uint8 *Buff, bool Swap, void *Spec)
int SetVolType (const VolTypeGrp VolTypeIn, bool bndchk=true)
VolTypeGrp GetVolType (void) const
int SetRoll (const float RollIn, bool bndchk=true)
float GetRoll (void) const
int SetPitch (const float PitchIn, bool bndchk=true)
float GetPitch (void) const
int SetYaw (const float YawIn, bool bndchk=true)
float GetYaw (void) const

Detailed Description

Definition at line 58 of file CigiCollDetVolDefV3.h.


Constructor & Destructor Documentation

CigiCollDetVolDefV3::CigiCollDetVolDefV3 (  ) 

General Constructor

Definition at line 70 of file CigiCollDetVolDefV3.cpp.

References CIGI_COLL_DET_VOL_DEF_PACKET_ID_V3, CIGI_COLL_DET_VOL_DEF_PACKET_SIZE_V3, CigiBaseCollDetVolDef::Depth, CigiBaseCollDetVolDef::EntityID, CigiBaseCollDetVolDef::HeightOrRadius, CigiBasePacket::MinorVersion, CigiBasePacket::PacketID, CigiBasePacket::PacketSize, CigiBaseCollDetVolDef::Pitch, CigiBaseCollDetVolDef::Roll, CigiBaseCollDetVolDef::Sphere, CigiBasePacket::Version, CigiBaseCollDetVolDef::VolEn, CigiBaseCollDetVolDef::VolID, CigiBaseCollDetVolDef::VolType, CigiBaseCollDetVolDef::Width, CigiBaseCollDetVolDef::Xoff, CigiBaseCollDetVolDef::Yaw, CigiBaseCollDetVolDef::Yoff, and CigiBaseCollDetVolDef::Zoff.

00071 {
00072 
00073    PacketID = CIGI_COLL_DET_VOL_DEF_PACKET_ID_V3;
00074    PacketSize = CIGI_COLL_DET_VOL_DEF_PACKET_SIZE_V3;
00075    Version = 3;
00076    MinorVersion = 0;
00077 
00078    EntityID = 0;
00079    VolID = 0;
00080    VolEn = false;
00081    VolType = Sphere;
00082    Xoff = 0.0;
00083    Yoff = 0.0;
00084    Zoff = 0.0;
00085    HeightOrRadius = 0.0;
00086    Width = 0.0;
00087    Depth = 0.0;
00088    Roll = 0.0;
00089    Pitch = 0.0;
00090    Yaw = 0.0;
00091 
00092 }

CigiCollDetVolDefV3::~CigiCollDetVolDefV3 (  )  [virtual]

General Destructor

Definition at line 97 of file CigiCollDetVolDefV3.cpp.

00098 {
00099 
00100 }


Member Function Documentation

float CigiCollDetVolDefV3::GetPitch ( void   )  const [inline]

Gets the Pitch value.

Returns:
the current Pitch.

Definition at line 156 of file CigiCollDetVolDefV3.h.

00156 { return(Pitch); }

float CigiCollDetVolDefV3::GetRoll ( void   )  const [inline]

Gets the Roll value.

Returns:
the current Roll.

Definition at line 139 of file CigiCollDetVolDefV3.h.

00139 { return(Roll); }

VolTypeGrp CigiCollDetVolDefV3::GetVolType ( void   )  const [inline]

Gets the VolType value.

Returns:
the current VolType.

Definition at line 122 of file CigiCollDetVolDefV3.h.

00122 { return(VolType); }

float CigiCollDetVolDefV3::GetYaw ( void   )  const [inline]

Gets the Yaw value.

Returns:
the current Yaw.

Definition at line 173 of file CigiCollDetVolDefV3.h.

00173 { return(Yaw); }

int CigiCollDetVolDefV3::Pack ( CigiBasePacket Base,
Cigi_uint8 Buff,
void *  Spec 
) const [virtual]

The virtual Pack function for CIGI 3

Parameters:
Base - A pointer to the instance of the packet to be packed. (Downcast to CigiBasePacket)
Buff - A pointer to the current pack point.
Spec - A pointer to special data - This is not used in this class.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Implements CigiBaseCollDetVolDef.

Definition at line 109 of file CigiCollDetVolDefV3.cpp.

References PackPointerUnion::c, CigiBaseCollDetVolDef::Depth, CigiBaseCollDetVolDef::EntityID, PackPointerUnion::f, CigiBaseCollDetVolDef::HeightOrRadius, PackPointerUnion::l, CigiBasePacket::PacketID, CigiBasePacket::PacketSize, CigiBaseCollDetVolDef::Pitch, CigiBaseCollDetVolDef::Roll, PackPointerUnion::s, CigiBaseCollDetVolDef::VolEn, CigiBaseCollDetVolDef::VolID, CigiBaseCollDetVolDef::VolType, CigiBaseCollDetVolDef::Width, CigiBaseCollDetVolDef::Xoff, CigiBaseCollDetVolDef::Yaw, CigiBaseCollDetVolDef::Yoff, and CigiBaseCollDetVolDef::Zoff.

00110 {
00111    PackPointer CDta;
00112 
00113    CigiBaseCollDetVolDef * Data = ( CigiBaseCollDetVolDef *)Base;
00114 
00115    CDta.c = Buff;
00116 
00117    *CDta.c++ = PacketID;
00118    *CDta.c++ = PacketSize;
00119 
00120    *CDta.s++ = Data->EntityID;
00121    *CDta.c++ = Data->VolID;
00122 
00123    Cigi_uint8 HDta = (Data->VolEn) ? 0x01 : 0;
00124    HDta |= (Data->VolType << 1) & 0x02;
00125    *CDta.c++ = HDta;
00126 
00127    *CDta.s++ = 0;
00128 
00129    *CDta.f++ = Data->Xoff;
00130    *CDta.f++ = Data->Yoff;
00131    *CDta.f++ = Data->Zoff;
00132    *CDta.f++ = Data->HeightOrRadius;
00133    *CDta.f++ = Data->Width;
00134    *CDta.f++ = Data->Depth;
00135    *CDta.f++ = Data->Roll;
00136    *CDta.f++ = Data->Pitch;
00137    *CDta.f++ = Data->Yaw;
00138 
00139    *CDta.l = 0;
00140 
00141    return(PacketSize);
00142 
00143 }

int CigiCollDetVolDefV3::SetPitch ( const float  PitchIn,
bool  bndchk = true 
)

Sets the Pitch with bound checking control

Parameters:
PitchIn - Volume's pitch relative to the referance entity
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 257 of file CigiCollDetVolDefV3.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseCollDetVolDef::Pitch.

00258 {
00259 
00260 #ifndef CIGI_NO_BND_CHK
00261    if(bndchk && ((PitchIn < -90.0)||(PitchIn > 90.0)))
00262    {
00263 #ifndef CIGI_NO_EXCEPT
00264       throw CigiValueOutOfRangeException("Pitch",(float)PitchIn,-90.0,90.0);
00265 #endif
00266       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00267    }
00268 #endif
00269 
00270    Pitch = PitchIn;
00271    return(CIGI_SUCCESS);
00272 
00273 }

int CigiCollDetVolDefV3::SetRoll ( const float  RollIn,
bool  bndchk = true 
)

Sets the Roll with bound checking control

Parameters:
RollIn - Volume's roll relative to the referance entity
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 235 of file CigiCollDetVolDefV3.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseCollDetVolDef::Roll.

00236 {
00237 
00238 #ifndef CIGI_NO_BND_CHK
00239    if(bndchk && ((RollIn < -180.0)||(RollIn > 180.0)))
00240    {
00241 #ifndef CIGI_NO_EXCEPT
00242       throw CigiValueOutOfRangeException("Roll",(float)RollIn,-180.0,180.0);
00243 #endif
00244       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00245    }
00246 #endif
00247 
00248    Roll = RollIn;
00249    return(CIGI_SUCCESS);
00250 
00251 }

int CigiCollDetVolDefV3::SetVolType ( const VolTypeGrp  VolTypeIn,
bool  bndchk = true 
)

Sets the VolType with bound checking control

Parameters:
VolTypeIn - Volume type or shape
Sphere=0
Cuboid=1
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 213 of file CigiCollDetVolDefV3.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseCollDetVolDef::VolType.

00214 {
00215 
00216 #ifndef CIGI_NO_BND_CHK
00217    if(bndchk && ((VolTypeIn < 0)||(VolTypeIn > 1)))
00218    {
00219 #ifndef CIGI_NO_EXCEPT
00220       throw CigiValueOutOfRangeException("VolType",(VolTypeGrp)VolTypeIn,0,1);
00221 #endif
00222       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00223    }
00224 #endif
00225 
00226    VolType = VolTypeIn;
00227    return(CIGI_SUCCESS);
00228 
00229 }

int CigiCollDetVolDefV3::SetYaw ( const float  YawIn,
bool  bndchk = true 
)

Sets the Yaw with bound checking control

Parameters:
YawIn - Volume's yaw relative to the referance entity
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 279 of file CigiCollDetVolDefV3.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseCollDetVolDef::Yaw.

00280 {
00281 
00282 #ifndef CIGI_NO_BND_CHK
00283    if(bndchk && ((YawIn < 0.0)||(YawIn > 360.0)))
00284    {
00285 #ifndef CIGI_NO_EXCEPT
00286       throw CigiValueOutOfRangeException("Yaw",(float)YawIn,0.0,360.0);
00287 #endif
00288       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00289    }
00290 #endif
00291 
00292    Yaw = YawIn;
00293    return(CIGI_SUCCESS);
00294 
00295 }

int CigiCollDetVolDefV3::Unpack ( Cigi_uint8 Buff,
bool  Swap,
void *  Spec 
) [virtual]

The virtual Unpack function for CIGI 3

Parameters:
Buff - A pointer to the current pack point.
Swap - N/A for V1 & V2
Spec - A pointer to special data - This is not used in this class.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Implements CigiBaseCollDetVolDef.

Definition at line 148 of file CigiCollDetVolDefV3.cpp.

References PackPointerUnion::c, CigiSwap2(), CigiSwap4(), CigiBaseCollDetVolDef::Depth, CigiBaseCollDetVolDef::EntityID, PackPointerUnion::f, CigiBaseCollDetVolDef::HeightOrRadius, CigiBasePacket::PacketSize, CigiBaseCollDetVolDef::Pitch, CigiBaseCollDetVolDef::Roll, PackPointerUnion::s, CigiBaseCollDetVolDef::VolEn, CigiBaseCollDetVolDef::VolID, CigiBaseCollDetVolDef::VolType, CigiBaseCollDetVolDef::Width, CigiBaseCollDetVolDef::Xoff, CigiBaseCollDetVolDef::Yaw, CigiBaseCollDetVolDef::Yoff, and CigiBaseCollDetVolDef::Zoff.

00149 {
00150    PackPointer CDta;
00151 
00152    CDta.c = Buff;
00153 
00154    CDta.c += 2;  // Step over packet id and size
00155 
00156    if(!Swap)
00157    {
00158       EntityID = *CDta.s++;
00159       VolID = *CDta.c++;
00160 
00161       Cigi_uint16 HDta = *CDta.c++;
00162       VolEn = ((HDta & 0x01) != 0);
00163       VolType = (VolTypeGrp)((HDta >> 1) & 0x01);
00164 
00165       CDta.s++;
00166 
00167       Xoff = *CDta.f++;
00168       Yoff = *CDta.f++;
00169       Zoff = *CDta.f++;
00170       HeightOrRadius = *CDta.f++;
00171       Width = *CDta.f++;
00172       Depth = *CDta.f++;
00173       Roll = *CDta.f++;
00174       Pitch = *CDta.f++;
00175       Yaw = *CDta.f++;
00176    }
00177    else
00178    {
00179       CigiSwap2(&EntityID, CDta.s++);
00180       VolID = *CDta.c++;
00181 
00182       Cigi_uint16 HDta = *CDta.c++;
00183       VolEn = ((HDta & 0x01) != 0);
00184       VolType = (VolTypeGrp)((HDta >> 1) & 0x01);
00185 
00186       CDta.s++;
00187 
00188       CigiSwap4(&Xoff, CDta.f++);
00189       CigiSwap4(&Yoff, CDta.f++);
00190       CigiSwap4(&Zoff, CDta.f++);
00191       CigiSwap4(&HeightOrRadius, CDta.f++);
00192       CigiSwap4(&Width, CDta.f++);
00193       CigiSwap4(&Depth, CDta.f++);
00194       CigiSwap4(&Roll, CDta.f++);
00195       CigiSwap4(&Pitch, CDta.f++);
00196       CigiSwap4(&Yaw, CDta.f++);
00197    }
00198 
00199    return(PacketSize);
00200 
00201 }


The documentation for this class was generated from the following files:
Generated on Wed Apr 29 09:00:07 2009 for CCL by  doxygen 1.4.7