#include <CigiLosRespV2.h>
Inheritance diagram for CigiLosRespV2:
Public Member Functions | |
CigiLosRespV2 () | |
virtual | ~CigiLosRespV2 () |
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 | SetMaterial (const Cigi_uint32 MaterialIn, bool bndchk=true) |
Cigi_uint32 | GetMaterial (void) const |
Definition at line 62 of file CigiLosRespV2.h.
CigiLosRespV2::CigiLosRespV2 | ( | ) |
General Constructor
Definition at line 89 of file CigiLosRespV2.cpp.
References CigiBaseLosResp::Alpha, CigiBaseLosResp::AltOrZoff, CigiBaseLosResp::Blue, CIGI_LOS_RESP_PACKET_ID_V2, CIGI_LOS_RESP_PACKET_SIZE_V2, 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.
00090 { 00091 00092 PacketID = CIGI_LOS_RESP_PACKET_ID_V2; 00093 PacketSize = CIGI_LOS_RESP_PACKET_SIZE_V2; 00094 Version = 2; 00095 MinorVersion = 0; 00096 00097 LosID = 0; 00098 Valid = false; 00099 EntityIDValid = false; 00100 RangeValid = false; 00101 Visible = false; 00102 IntersectionCoordSys = Geodetic; 00103 HostFrame = 0; 00104 RespCount = 0; 00105 EntityID = 0; 00106 Range = 0.0; 00107 LatOrXoff = 0.0; 00108 LonOrYoff = 0.0; 00109 AltOrZoff = 0.0; 00110 Red = 0; 00111 Green = 0; 00112 Blue = 0; 00113 Alpha = 0; 00114 Material = 0; 00115 NormalAz = 0.0; 00116 NormalEl = 0.0; 00117 ValidV1or2 = true; 00118 00119 }
CigiLosRespV2::~CigiLosRespV2 | ( | ) | [virtual] |
int CigiLosRespV2::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 229 of file CigiLosRespV2.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.
00231 { 00232 CnvtInfo.ProcID = CigiProcessType::ProcStd; 00233 00234 // Note: 00235 // CIGI_LOS_RESP_PACKET_ID_V1 & 00236 // CIGI_LOS_RESP_PACKET_ID_V2 are the same 00237 // CIGI_LOS_RESP_PACKET_ID_V3 & 00238 // CIGI_LOS_RESP_PACKET_ID_V3_2 are the same 00239 if(CnvtVersion.CigiMajorVersion < 3) 00240 CnvtInfo.CnvtPacketID = CIGI_LOS_RESP_PACKET_ID_V2; 00241 else 00242 CnvtInfo.CnvtPacketID = CIGI_LOS_RESP_PACKET_ID_V3; 00243 00244 return(CIGI_SUCCESS); 00245 }
Cigi_uint32 CigiLosRespV2::GetMaterial | ( | void | ) | const [inline] |
Gets the Material value.
Definition at line 145 of file CigiLosRespV2.h.
00145 { return(Material); }
int CigiLosRespV2::Pack | ( | CigiBasePacket * | Base, | |
Cigi_uint8 * | Buff, | |||
void * | Spec | |||
) | const [virtual] |
The virtual Pack function for CIGI 2
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 136 of file CigiLosRespV2.cpp.
References CigiBaseLosResp::AltOrZoff, PackPointerUnion::c, CIGI_LOS_RESP_PACKET_SIZE_V2, CIGI_SCOPY2, CIGI_SCOPY4, CIGI_SCOPY8, PackPointerUnion::d, PackPointerUnion::f, PackPointerUnion::l, CigiBaseLosResp::LatOrXoff, CigiBaseLosResp::LonOrYoff, CigiBaseLosResp::LosID, CigiBaseLosResp::Material, CigiBasePacket::PacketID, CigiBasePacket::PacketSize, CigiBaseLosResp::Range, PackPointerUnion::s, CigiBaseLosResp::Valid, CigiBaseLosResp::ValidV1or2, and CigiBaseLosResp::Visible.
00137 { 00138 double DBuf[6]; 00139 00140 Cigi_uint8 *tBuf = (Cigi_uint8 *)DBuf; 00141 00142 PackPointer CDta; 00143 00144 CigiBaseLosResp * Data = ( CigiBaseLosResp *)Base; 00145 00146 if(!Data->ValidV1or2) 00147 return(0); 00148 00149 CDta.d = DBuf; 00150 00151 *CDta.c++ = PacketID; 00152 *CDta.c++ = PacketSize; 00153 00154 CIGI_SCOPY2(CDta.s++, &Data->LosID); 00155 00156 Cigi_uint8 HDta = (Data->Valid) ? 0x80 : 0x00; 00157 HDta |= (Data->Visible) ? 0x40 : 0x00; 00158 *CDta.c++ = HDta; 00159 00160 *CDta.c++ = 0; 00161 *CDta.s++ = 0; 00162 00163 CIGI_SCOPY4(CDta.l++, &Data->Material); 00164 00165 float tflt = (float)Data->Range; 00166 CIGI_SCOPY4(CDta.f++, &tflt); 00167 00168 CIGI_SCOPY8(CDta.d++, &Data->AltOrZoff); 00169 00170 CIGI_SCOPY8(CDta.d++, &Data->LatOrXoff); 00171 CIGI_SCOPY8(CDta.d++, &Data->LonOrYoff); 00172 00173 memcpy(Buff,tBuf,CIGI_LOS_RESP_PACKET_SIZE_V2); 00174 00175 return(PacketSize); 00176 00177 }
int CigiLosRespV2::SetMaterial | ( | const Cigi_uint32 | MaterialIn, | |
bool | bndchk = true | |||
) | [inline] |
Sets the Material with bound checking control
MaterialIn | - The material code of the intersected surface. | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 136 of file CigiLosRespV2.h.
References CIGI_SUCCESS.
00137 { 00138 Material = MaterialIn; 00139 return(CIGI_SUCCESS); 00140 }
int CigiLosRespV2::Unpack | ( | Cigi_uint8 * | Buff, | |
bool | Swap, | |||
void * | Spec | |||
) | [virtual] |
The virtual Unpack function for CIGI 2
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 182 of file CigiLosRespV2.cpp.
References CigiBaseLosResp::AltOrZoff, PackPointerUnion::c, CIGI_LOS_RESP_PACKET_SIZE_V2, CIGI_SCOPY2, CIGI_SCOPY4, CIGI_SCOPY8, PackPointerUnion::d, PackPointerUnion::f, CigiBaseLosResp::HostFrame, PackPointerUnion::l, CigiBaseLosResp::LatOrXoff, CigiBaseLosResp::LonOrYoff, CigiBaseLosResp::LosID, CigiBaseLosResp::Material, CigiBasePacket::PacketSize, CigiBaseLosResp::Range, PackPointerUnion::s, CigiBaseLosResp::Valid, CigiBaseLosResp::ValidV1or2, and CigiBaseLosResp::Visible.
00183 { 00184 double DBuf[6]; 00185 00186 Cigi_uint8 *tBuf = (Cigi_uint8 *)DBuf; 00187 00188 PackPointer CDta; 00189 00190 memcpy(tBuf,Buff,CIGI_LOS_RESP_PACKET_SIZE_V2); 00191 00192 CDta.d = DBuf; 00193 00194 CDta.c += 2; // Step over packet id and size 00195 00196 CIGI_SCOPY2(&LosID, CDta.s++); 00197 00198 Cigi_uint8 HDta = *CDta.c++; 00199 Valid = ((HDta & 0x80) != 0); 00200 Visible = ((HDta & 0x40) != 0); 00201 00202 CDta.c += 3; 00203 00204 CIGI_SCOPY4(&Material, CDta.l++); 00205 00206 float tflt; 00207 00208 CIGI_SCOPY4(&tflt, CDta.f++); 00209 Range = (double)tflt; 00210 00211 CIGI_SCOPY8(&AltOrZoff, CDta.d++); 00212 00213 CIGI_SCOPY8(&LatOrXoff, CDta.d++); 00214 CIGI_SCOPY8(&LonOrYoff, CDta.d++); 00215 00216 00217 HostFrame = 0; 00218 00219 ValidV1or2 = true; 00220 00221 return(PacketSize); 00222 00223 }