#include <CigiLosRespV1.h>
Inheritance diagram for CigiLosRespV1:
Public Member Functions | |
CigiLosRespV1 () | |
virtual | ~CigiLosRespV1 () |
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 61 of file CigiLosRespV1.h.
CigiLosRespV1::CigiLosRespV1 | ( | ) |
General Constructor
Definition at line 89 of file CigiLosRespV1.cpp.
References CigiBaseLosResp::Alpha, CigiBaseLosResp::AltOrZoff, CigiBaseLosResp::Blue, CIGI_LOS_RESP_PACKET_ID_V1, CIGI_LOS_RESP_PACKET_SIZE_V1, 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_V1; 00093 PacketSize = CIGI_LOS_RESP_PACKET_SIZE_V1; 00094 Version = 1; 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 }
CigiLosRespV1::~CigiLosRespV1 | ( | ) | [virtual] |
int CigiLosRespV1::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 232 of file CigiLosRespV1.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.
00234 { 00235 CnvtInfo.ProcID = CigiProcessType::ProcStd; 00236 00237 // Note: 00238 // CIGI_LOS_RESP_PACKET_ID_V1 & 00239 // CIGI_LOS_RESP_PACKET_ID_V2 are the same 00240 // CIGI_LOS_RESP_PACKET_ID_V3 & 00241 // CIGI_LOS_RESP_PACKET_ID_V3_2 are the same 00242 if(CnvtVersion.CigiMajorVersion < 3) 00243 CnvtInfo.CnvtPacketID = CIGI_LOS_RESP_PACKET_ID_V2; 00244 else 00245 CnvtInfo.CnvtPacketID = CIGI_LOS_RESP_PACKET_ID_V3; 00246 00247 return(CIGI_SUCCESS); 00248 }
Cigi_uint32 CigiLosRespV1::GetMaterial | ( | void | ) | const [inline] |
Gets the Material value.
Definition at line 144 of file CigiLosRespV1.h.
00144 { return(Material); }
int CigiLosRespV1::Pack | ( | CigiBasePacket * | Base, | |
Cigi_uint8 * | Buff, | |||
void * | Spec | |||
) | const [virtual] |
The virtual Pack function for CIGI 1
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 CigiLosRespV1.cpp.
References CigiBaseLosResp::AltOrZoff, PackPointerUnion::c, CIGI_LOS_RESP_PACKET_SIZE_V1, 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 *CDta.l++ = 0; 00164 00165 CIGI_SCOPY4(CDta.l++, &Data->Material); 00166 00167 float tflt = (float)Data->Range; 00168 CIGI_SCOPY4(CDta.f++, &tflt); 00169 00170 tflt = (float)Data->AltOrZoff; 00171 CIGI_SCOPY4(CDta.f++, &tflt); 00172 00173 CIGI_SCOPY8(CDta.d++, &Data->LatOrXoff); 00174 CIGI_SCOPY8(CDta.d++, &Data->LonOrYoff); 00175 00176 memcpy(Buff,tBuf,CIGI_LOS_RESP_PACKET_SIZE_V1); 00177 00178 return(PacketSize); 00179 00180 }
int CigiLosRespV1::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 135 of file CigiLosRespV1.h.
References CIGI_SUCCESS.
00136 { 00137 Material = MaterialIn; 00138 return(CIGI_SUCCESS); 00139 }
int CigiLosRespV1::Unpack | ( | Cigi_uint8 * | Buff, | |
bool | Swap, | |||
void * | Spec | |||
) | [virtual] |
The virtual Unpack function for CIGI 1
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 185 of file CigiLosRespV1.cpp.
References CigiBaseLosResp::AltOrZoff, PackPointerUnion::c, CIGI_LOS_RESP_PACKET_SIZE_V1, 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.
00186 { 00187 double DBuf[6]; 00188 00189 Cigi_uint8 *tBuf = (Cigi_uint8 *)DBuf; 00190 00191 PackPointer CDta; 00192 00193 memcpy(tBuf,Buff,CIGI_LOS_RESP_PACKET_SIZE_V1); 00194 00195 CDta.d = DBuf; 00196 00197 CDta.c += 2; // Step over packet id and size 00198 00199 CIGI_SCOPY2(&LosID, CDta.s++); 00200 00201 Cigi_uint8 HDta = *CDta.c++; 00202 Valid = ((HDta & 0x80) != 0); 00203 Visible = ((HDta & 0x40) != 0); 00204 00205 CDta.c += 7; 00206 00207 CIGI_SCOPY4(&Material, CDta.l++); 00208 00209 float tflt; 00210 00211 CIGI_SCOPY4(&tflt, CDta.f++); 00212 Range = (double)tflt; 00213 00214 CIGI_SCOPY4(&tflt, CDta.f++); 00215 AltOrZoff = (double)tflt; 00216 00217 CIGI_SCOPY8(&LatOrXoff, CDta.d++); 00218 CIGI_SCOPY8(&LonOrYoff, CDta.d++); 00219 00220 HostFrame = 0; 00221 00222 ValidV1or2 = true; 00223 00224 return(PacketSize); 00225 00226 }