#include <CigiLosRespV3_2.h>
Inheritance diagram for CigiLosRespV3_2:
Public Member Functions | |
CigiLosRespV3_2 () | |
virtual | ~CigiLosRespV3_2 () |
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 | SetHostFrame (const Cigi_uint8 HostFrameIn, bool bndchk=true) |
Cigi_uint8 | GetHostFrame (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 |
Definition at line 56 of file CigiLosRespV3_2.h.
CigiLosRespV3_2::CigiLosRespV3_2 | ( | ) |
General Constructor
Definition at line 68 of file CigiLosRespV3_2.cpp.
References CigiBaseLosResp::Alpha, CigiBaseLosResp::AltOrZoff, CigiBaseLosResp::Blue, CIGI_LOS_RESP_PACKET_ID_V3_2, CIGI_LOS_RESP_PACKET_SIZE_V3_2, 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.
00069 { 00070 00071 PacketID = CIGI_LOS_RESP_PACKET_ID_V3_2; 00072 PacketSize = CIGI_LOS_RESP_PACKET_SIZE_V3_2; 00073 Version = 3; 00074 MinorVersion = 2; 00075 00076 LosID = 0; 00077 Valid = false; 00078 EntityIDValid = false; 00079 RangeValid = false; 00080 Visible = false; 00081 IntersectionCoordSys = Geodetic; 00082 HostFrame = 0; 00083 RespCount = 0; 00084 EntityID = 0; 00085 Range = 0.0; 00086 LatOrXoff = 0.0; 00087 LonOrYoff = 0.0; 00088 AltOrZoff = 0.0; 00089 Red = 0; 00090 Green = 0; 00091 Blue = 0; 00092 Alpha = 0; 00093 Material = 0; 00094 NormalAz = 0.0; 00095 NormalEl = 0.0; 00096 ValidV1or2 = false; 00097 00098 }
CigiLosRespV3_2::~CigiLosRespV3_2 | ( | ) | [virtual] |
int CigiLosRespV3_2::GetCnvt | ( | CigiVersionID & | CnvtVersion, | |
CigiCnvtInfoType::Type & | CnvtInfo | |||
) | [virtual] |
A virtual Conversion Information function. This function provides conversion information for this packet.
CnvtVersion | - The CIGI version to which this packet is being converted. | |
CnvtInfo | - The information needed for conversion |
Reimplemented from CigiBasePacket.
Definition at line 200 of file CigiLosRespV3_2.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.
00202 { 00203 CnvtInfo.ProcID = CigiProcessType::ProcStd; 00204 00205 // Note: 00206 // CIGI_LOS_RESP_PACKET_ID_V1 & 00207 // CIGI_LOS_RESP_PACKET_ID_V2 are the same 00208 // CIGI_LOS_RESP_PACKET_ID_V3 & 00209 // CIGI_LOS_RESP_PACKET_ID_V3_2 are the same 00210 if(CnvtVersion.CigiMajorVersion < 3) 00211 CnvtInfo.CnvtPacketID = CIGI_LOS_RESP_PACKET_ID_V2; 00212 else 00213 CnvtInfo.CnvtPacketID = CIGI_LOS_RESP_PACKET_ID_V3; 00214 00215 00216 00217 return(CIGI_SUCCESS); 00218 }
Cigi_uint16 CigiLosRespV3_2::GetEntityID | ( | void | ) | const [inline] |
Gets the EntityID value.
Definition at line 203 of file CigiLosRespV3_2.h.
00203 { return(EntityID); }
bool CigiLosRespV3_2::GetEntityIDValid | ( | void | ) | const [inline] |
Gets the EntityIDValid value.
Definition at line 139 of file CigiLosRespV3_2.h.
00139 { return(EntityIDValid); }
Cigi_uint8 CigiLosRespV3_2::GetHostFrame | ( | void | ) | const [inline] |
Gets the host frame value.
Definition at line 161 of file CigiLosRespV3_2.h.
00161 { return(HostFrame); }
Cigi_uint8 CigiLosRespV3_2::GetRespCount | ( | void | ) | const [inline] |
Gets the RespCount value.
Definition at line 182 of file CigiLosRespV3_2.h.
00182 { return(RespCount); }
int CigiLosRespV3_2::Pack | ( | CigiBasePacket * | Base, | |
Cigi_uint8 * | Buff, | |||
void * | Spec | |||
) | const [virtual] |
The virtual Pack function for CIGI 3
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. |
Implements CigiBaseLosResp.
Definition at line 115 of file CigiLosRespV3_2.cpp.
References PackPointerUnion::c, PackPointerUnion::d, CigiBaseLosResp::EntityID, CigiBaseLosResp::EntityIDValid, CigiBaseLosResp::HostFrame, CigiBaseLosResp::LosID, CigiBasePacket::PacketID, CigiBasePacket::PacketSize, CigiBaseLosResp::Range, CigiBaseLosResp::RespCount, PackPointerUnion::s, CigiBaseLosResp::Valid, and CigiBaseLosResp::Visible.
00116 { 00117 PackPointer CDta; 00118 00119 CigiBaseLosResp * Data = ( CigiBaseLosResp *)Base; 00120 00121 CDta.c = Buff; 00122 00123 *CDta.c++ = PacketID; 00124 *CDta.c++ = PacketSize; 00125 00126 *CDta.s++ = Data->LosID; 00127 00128 Cigi_uint8 HDta = (Data->Valid) ? 0x01 : 0x00; 00129 HDta |= (Data->EntityIDValid) ? 0x02 : 0x00; 00130 HDta |= (Data->Visible) ? 0x04 : 0x00; 00131 HDta |= (Data->HostFrame << 4) & 0xf0; 00132 *CDta.c++ = HDta; 00133 00134 *CDta.c++ = Data->RespCount; 00135 *CDta.s++ = Data->EntityID; 00136 *CDta.d++ = Data->Range; 00137 00138 return(PacketSize); 00139 00140 }
int CigiLosRespV3_2::SetEntityID | ( | const Cigi_uint16 | EntityIDIn, | |
bool | bndchk = true | |||
) | [inline] |
Sets the EntityID with bound checking control
EntityIDIn | - The ID of the entity intersected. | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 194 of file CigiLosRespV3_2.h.
References CIGI_SUCCESS.
00195 { 00196 EntityID = EntityIDIn; 00197 return(CIGI_SUCCESS); 00198 }
int CigiLosRespV3_2::SetEntityIDValid | ( | const bool | EntityIDValidIn, | |
bool | bndchk = true | |||
) | [inline] |
Sets the EntityIDValid with bound checking control
EntityIDValidIn | - intersection with an entity and the entity id is valid. | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 130 of file CigiLosRespV3_2.h.
References CIGI_SUCCESS.
00131 { 00132 EntityIDValid = EntityIDValidIn; 00133 return(CIGI_SUCCESS); 00134 }
int CigiLosRespV3_2::SetHostFrame | ( | const Cigi_uint8 | HostFrameIn, | |
bool | bndchk = true | |||
) | [inline] |
Sets the HostFrame with bound checking control
HostFrameIn | - The host frame when the hat/hot was calculated. | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 152 of file CigiLosRespV3_2.h.
References CIGI_SUCCESS.
00153 { 00154 HostFrame = HostFrameIn; 00155 return(CIGI_SUCCESS); 00156 }
int CigiLosRespV3_2::SetRespCount | ( | const Cigi_uint8 | RespCountIn, | |
bool | bndchk = true | |||
) | [inline] |
Sets the RespCount with bound checking control
RespCountIn | - The number of responses for this LOS operation. | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 173 of file CigiLosRespV3_2.h.
References CIGI_SUCCESS.
00174 { 00175 RespCount = RespCountIn; 00176 return(CIGI_SUCCESS); 00177 }
int CigiLosRespV3_2::Unpack | ( | Cigi_uint8 * | Buff, | |
bool | Swap, | |||
void * | Spec | |||
) | [virtual] |
The virtual Unpack function for CIGI 3
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. |
Implements CigiBaseLosResp.
Definition at line 145 of file CigiLosRespV3_2.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.
00146 { 00147 PackPointer CDta; 00148 00149 CDta.c = Buff; 00150 00151 CDta.c += 2; // Step over packet id and size 00152 00153 if(!Swap) 00154 { 00155 LosID = *CDta.s++; 00156 00157 Cigi_uint8 HDta = *CDta.c++; 00158 Valid = ((HDta & 0x01) != 0); 00159 EntityIDValid = ((HDta & 0x02) != 0); 00160 Visible = ((HDta & 0x04) != 0); 00161 HostFrame = (Cigi_uint8)((HDta >> 4) & 0x0f); 00162 00163 RespCount = *CDta.c++; 00164 EntityID = *CDta.s++; 00165 Range = *CDta.d++; 00166 00167 } 00168 else 00169 { 00170 CigiSwap2(&LosID, CDta.s++); 00171 00172 Cigi_uint8 HDta = *CDta.c++; 00173 Valid = ((HDta & 0x01) != 0); 00174 EntityIDValid = ((HDta & 0x02) != 0); 00175 Visible = ((HDta & 0x04) != 0); 00176 HostFrame = (Cigi_uint8)((HDta >> 4) & 0x0f); 00177 00178 RespCount = *CDta.c++; 00179 CigiSwap2(&EntityID, CDta.s++); 00180 CigiSwap8(&Range, CDta.d++); 00181 00182 } 00183 00184 00185 LatOrXoff = 0.0; 00186 LonOrYoff = 0.0; 00187 AltOrZoff = 0.0; 00188 Material = 0; 00189 00190 ValidV1or2 = false; 00191 00192 return(PacketSize); 00193 00194 }