CigiLosRespV3 Class Reference

#include <CigiLosRespV3.h>

Inheritance diagram for CigiLosRespV3:

CigiBaseLosResp CigiBasePacket List of all members.

Public Member Functions

 CigiLosRespV3 ()
virtual ~CigiLosRespV3 ()
virtual int Pack (CigiBasePacket *Base, Cigi_uint8 *Buff, void *Spec) const
virtual int Unpack (Cigi_uint8 *Buff, bool Swap, void *Spec)
virtual int GetCnvt (CigiVersionID &CnvtVersion, CigiCnvtInfoType::Type &CnvtInfo)
int SetEntityIDValid (const bool EntityIDValidIn, bool bndchk=true)
bool GetEntityIDValid (void) const
int SetRespCount (const Cigi_uint8 RespCountIn, bool bndchk=true)
Cigi_uint8 GetRespCount (void) const
int SetEntityID (const Cigi_uint16 EntityIDIn, bool bndchk=true)
Cigi_uint16 GetEntityID (void) const

Detailed Description

Definition at line 62 of file CigiLosRespV3.h.


Constructor & Destructor Documentation

CigiLosRespV3::CigiLosRespV3 (  ) 

General Constructor

Definition at line 77 of file CigiLosRespV3.cpp.

References CigiBaseLosResp::Alpha, CigiBaseLosResp::AltOrZoff, CigiBaseLosResp::Blue, CIGI_LOS_RESP_PACKET_ID_V3, CIGI_LOS_RESP_PACKET_SIZE_V3, CigiBaseLosResp::EntityID, CigiBaseLosResp::EntityIDValid, CigiBaseLosResp::Geodetic, CigiBaseLosResp::Green, CigiBaseLosResp::HostFrame, CigiBaseLosResp::IntersectionCoordSys, CigiBaseLosResp::LatOrXoff, CigiBaseLosResp::LonOrYoff, CigiBaseLosResp::LosID, CigiBaseLosResp::Material, CigiBasePacket::MinorVersion, CigiBaseLosResp::NormalAz, CigiBaseLosResp::NormalEl, CigiBasePacket::PacketID, CigiBasePacket::PacketSize, CigiBaseLosResp::Range, CigiBaseLosResp::RangeValid, CigiBaseLosResp::Red, CigiBaseLosResp::RespCount, CigiBaseLosResp::Valid, CigiBaseLosResp::ValidV1or2, CigiBasePacket::Version, and CigiBaseLosResp::Visible.

00078 {
00079 
00080    PacketID = CIGI_LOS_RESP_PACKET_ID_V3;
00081    PacketSize = CIGI_LOS_RESP_PACKET_SIZE_V3;
00082    Version = 3;
00083    MinorVersion = 0;
00084 
00085    LosID = 0;
00086    Valid = false;
00087    EntityIDValid = false;
00088    RangeValid = false;
00089    Visible = false;
00090    IntersectionCoordSys = Geodetic;
00091    HostFrame = 0;
00092    RespCount = 0;
00093    EntityID = 0;
00094    Range = 0.0;
00095    LatOrXoff = 0.0;
00096    LonOrYoff = 0.0;
00097    AltOrZoff = 0.0;
00098    Red = 0;
00099    Green = 0;
00100    Blue = 0;
00101    Alpha = 0;
00102    Material = 0;
00103    NormalAz = 0.0;
00104    NormalEl = 0.0;
00105    ValidV1or2 = false;
00106 
00107 }

CigiLosRespV3::~CigiLosRespV3 (  )  [virtual]

General Destructor

Definition at line 112 of file CigiLosRespV3.cpp.

00113 {
00114 
00115 }


Member Function Documentation

int CigiLosRespV3::GetCnvt ( CigiVersionID CnvtVersion,
CigiCnvtInfoType::Type CnvtInfo 
) [virtual]

A virtual Conversion Information function. This function provides conversion information for this packet.

Parameters:
CnvtVersion - The CIGI version to which this packet is being converted.
CnvtInfo - The information needed for conversion
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Reimplemented from CigiBasePacket.

Definition at line 207 of file CigiLosRespV3.cpp.

References CIGI_LOS_RESP_PACKET_ID_V2, CIGI_LOS_RESP_PACKET_ID_V3, CIGI_SUCCESS, CigiVersionID::CigiMajorVersion, CigiCnvtInfoType::CigiCnvtInfoStruct::CnvtPacketID, CigiCnvtInfoType::CigiCnvtInfoStruct::ProcID, and CigiProcessType::ProcStd.

00209 {
00210    CnvtInfo.ProcID = CigiProcessType::ProcStd;
00211 
00212    // Note:
00213    // CIGI_LOS_RESP_PACKET_ID_V1 &
00214    // CIGI_LOS_RESP_PACKET_ID_V2 are the same
00215    // CIGI_LOS_RESP_PACKET_ID_V3 &
00216    // CIGI_LOS_RESP_PACKET_ID_V3_2 are the same
00217    if(CnvtVersion.CigiMajorVersion < 3)
00218       CnvtInfo.CnvtPacketID = CIGI_LOS_RESP_PACKET_ID_V2;
00219    else
00220       CnvtInfo.CnvtPacketID = CIGI_LOS_RESP_PACKET_ID_V3;
00221 
00222    return(CIGI_SUCCESS);
00223 }

Cigi_uint16 CigiLosRespV3::GetEntityID ( void   )  const [inline]

Gets the EntityID value.

Returns:
the current EntityID.

Definition at line 187 of file CigiLosRespV3.h.

00187 { return(EntityID); }

bool CigiLosRespV3::GetEntityIDValid ( void   )  const [inline]

Gets the EntityIDValid value.

Returns:
the current EntityIDValid.

Definition at line 145 of file CigiLosRespV3.h.

00145 { return(EntityIDValid); }

Cigi_uint8 CigiLosRespV3::GetRespCount ( void   )  const [inline]

Gets the RespCount value.

Returns:
the current RespCount.

Definition at line 166 of file CigiLosRespV3.h.

00166 { return(RespCount); }

int CigiLosRespV3::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 CigiBaseLosResp.

Definition at line 124 of file CigiLosRespV3.cpp.

References PackPointerUnion::c, PackPointerUnion::d, CigiBaseLosResp::EntityID, CigiBaseLosResp::EntityIDValid, CigiBaseLosResp::LosID, CigiBasePacket::PacketID, CigiBasePacket::PacketSize, CigiBaseLosResp::Range, CigiBaseLosResp::RespCount, PackPointerUnion::s, CigiBaseLosResp::Valid, and CigiBaseLosResp::Visible.

00125 {
00126    PackPointer CDta;
00127 
00128    CigiBaseLosResp * Data = ( CigiBaseLosResp *)Base;
00129 
00130    CDta.c = Buff;
00131 
00132    *CDta.c++ = PacketID;
00133    *CDta.c++ = PacketSize;
00134 
00135    *CDta.s++ = Data->LosID;
00136 
00137    Cigi_uint8 HDta = (Data->Valid) ? 0x01 : 0x00;
00138    HDta |= (Data->EntityIDValid) ? 0x02 : 0x00;
00139    HDta |= (Data->Visible) ? 0x04 : 0x00;
00140    *CDta.c++ = HDta;
00141 
00142    *CDta.c++ = Data->RespCount;
00143    *CDta.s++ = Data->EntityID;
00144    *CDta.d++ = Data->Range;
00145 
00146    return(PacketSize);
00147 
00148 }

int CigiLosRespV3::SetEntityID ( const Cigi_uint16  EntityIDIn,
bool  bndchk = true 
) [inline]

Sets the EntityID with bound checking control

Parameters:
EntityIDIn - The ID of the entity intersected.
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 178 of file CigiLosRespV3.h.

References CIGI_SUCCESS.

00179    {
00180       EntityID = EntityIDIn;
00181       return(CIGI_SUCCESS);
00182    }

int CigiLosRespV3::SetEntityIDValid ( const bool  EntityIDValidIn,
bool  bndchk = true 
) [inline]

Sets the EntityIDValid with bound checking control

Parameters:
EntityIDValidIn - intersection with an entity and the entity id is valid.
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 136 of file CigiLosRespV3.h.

References CIGI_SUCCESS.

00137    {
00138       EntityIDValid = EntityIDValidIn;
00139       return(CIGI_SUCCESS);
00140    }

int CigiLosRespV3::SetRespCount ( const Cigi_uint8  RespCountIn,
bool  bndchk = true 
) [inline]

Sets the RespCount with bound checking control

Parameters:
RespCountIn - The number of responses for this LOS operation.
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 157 of file CigiLosRespV3.h.

References CIGI_SUCCESS.

00158    {
00159       RespCount = RespCountIn;
00160       return(CIGI_SUCCESS);
00161    }

int CigiLosRespV3::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 CigiBaseLosResp.

Definition at line 153 of file CigiLosRespV3.cpp.

References CigiBaseLosResp::AltOrZoff, PackPointerUnion::c, CigiSwap2(), CigiSwap8(), PackPointerUnion::d, CigiBaseLosResp::EntityID, CigiBaseLosResp::EntityIDValid, CigiBaseLosResp::HostFrame, CigiBaseLosResp::LatOrXoff, CigiBaseLosResp::LonOrYoff, CigiBaseLosResp::LosID, CigiBaseLosResp::Material, CigiBasePacket::PacketSize, CigiBaseLosResp::Range, CigiBaseLosResp::RespCount, PackPointerUnion::s, CigiBaseLosResp::Valid, CigiBaseLosResp::ValidV1or2, and CigiBaseLosResp::Visible.

00154 {
00155    PackPointer CDta;
00156 
00157    CDta.c = Buff;
00158 
00159    CDta.c += 2;  // Step over packet id and size
00160 
00161    if(!Swap)
00162    {
00163       LosID = *CDta.s++;
00164 
00165       Cigi_uint8 HDta = *CDta.c++;
00166       Valid = ((HDta & 0x01) != 0);
00167       EntityIDValid = ((HDta & 0x02) != 0);
00168       Visible = ((HDta & 0x04) != 0);
00169 
00170       RespCount = *CDta.c++;
00171       EntityID = *CDta.s++;
00172       Range = *CDta.d++;
00173 
00174    }
00175    else
00176    {
00177       CigiSwap2(&LosID, CDta.s++);
00178 
00179       Cigi_uint8 HDta = *CDta.c++;
00180       Valid = ((HDta & 0x01) != 0);
00181       EntityIDValid = ((HDta & 0x02) != 0);
00182       Visible = ((HDta & 0x04) != 0);
00183 
00184       RespCount = *CDta.c++;
00185       CigiSwap2(&EntityID, CDta.s++);
00186       CigiSwap8(&Range, CDta.d++);
00187 
00188    }
00189 
00190 
00191    HostFrame = 0;
00192    LatOrXoff = 0.0;
00193    LonOrYoff = 0.0;
00194    AltOrZoff = 0.0;
00195    Material = 0;
00196 
00197    ValidV1or2 = false;
00198 
00199    return(PacketSize);
00200 
00201 }


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