CigiHatHotXRespV3 Class Reference

#include <CigiHatHotXRespV3.h>

Inheritance diagram for CigiHatHotXRespV3:

CigiBaseHatHotResp CigiBasePacket List of all members.

Public Member Functions

 CigiHatHotXRespV3 ()
virtual ~CigiHatHotXRespV3 ()
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 SetHat (const double HatIn, bool bndchk=true)
double GetHat (void) const
int SetHot (const double HotIn, bool bndchk=true)
double GetHot (void) const
int SetMaterial (const Cigi_uint32 MaterialIn, bool bndchk=true)
Cigi_uint32 GetMaterial (void) const
int SetNormAz (const float NormAzIn, bool bndchk=true)
float GetNormAz (void) const
int SetNormEl (const float NormElIn, bool bndchk=true)
float GetNormEl (void) const

Detailed Description

Definition at line 66 of file CigiHatHotXRespV3.h.


Constructor & Destructor Documentation

CigiHatHotXRespV3::CigiHatHotXRespV3 (  ) 

General Constructor

Definition at line 78 of file CigiHatHotXRespV3.cpp.

References CIGI_HAT_HOT_XRESP_PACKET_ID_V3, CIGI_HAT_HOT_XRESP_PACKET_SIZE_V3, CigiBaseHatHotResp::Hat, CigiBaseHatHotResp::HAT, CigiBaseHatHotResp::HatHotID, CigiBaseHatHotResp::HostFrame, CigiBaseHatHotResp::Hot, CigiBaseHatHotResp::Material, CigiBasePacket::MinorVersion, CigiBaseHatHotResp::NormAz, CigiBaseHatHotResp::NormEl, CigiBasePacket::PacketID, CigiBasePacket::PacketSize, CigiBaseHatHotResp::ReqType, CigiBaseHatHotResp::Valid, CigiBasePacket::Version, CigiBaseHatHotResp::VldHat, and CigiBaseHatHotResp::VldHot.

00079 {
00080 
00081    PacketID = CIGI_HAT_HOT_XRESP_PACKET_ID_V3;
00082    PacketSize = CIGI_HAT_HOT_XRESP_PACKET_SIZE_V3;
00083    Version = 3;
00084    MinorVersion = 0;
00085 
00086    HatHotID = 0;
00087    Valid = false;
00088    ReqType = HAT;
00089    HostFrame = 0;
00090    Hat = 0.0;
00091    Hot = 0.0;
00092    Material = 0;
00093    NormAz = 0.0;
00094    NormEl = 0.0;
00095    VldHat = false;
00096    VldHot = false;
00097 
00098 }

CigiHatHotXRespV3::~CigiHatHotXRespV3 (  )  [virtual]

General Destructor

Definition at line 103 of file CigiHatHotXRespV3.cpp.

00104 {
00105 
00106 }


Member Function Documentation

int CigiHatHotXRespV3::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 243 of file CigiHatHotXRespV3.cpp.

References CIGI_HAT_HOT_XRESP_PACKET_ID_V3, CIGI_HAT_RESP_PACKET_ID_V1, CIGI_HOT_RESP_PACKET_ID_V2, CIGI_SUCCESS, CigiVersionID::CigiMajorVersion, CigiCnvtInfoType::CigiCnvtInfoStruct::CnvtPacketID, CigiCnvtInfoType::CigiCnvtInfoStruct::ProcID, and CigiProcessType::ProcStd.

00245 {
00246    CnvtInfo.ProcID = CigiProcessType::ProcStd;
00247 
00248    switch(CnvtVersion.CigiMajorVersion)
00249    {
00250    case 1:
00251       CnvtInfo.CnvtPacketID = CIGI_HAT_RESP_PACKET_ID_V1;
00252       break;
00253    case 2:
00254       CnvtInfo.CnvtPacketID = CIGI_HOT_RESP_PACKET_ID_V2;
00255       break;
00256    default:
00257       // The Packet ID for all V3 HatHotXResp are the same ID
00258       CnvtInfo.CnvtPacketID = CIGI_HAT_HOT_XRESP_PACKET_ID_V3;
00259       break;
00260    }
00261 
00262    return(CIGI_SUCCESS);
00263 }

double CigiHatHotXRespV3::GetHat ( void   )  const [inline]

Gets the Hat value.

Returns:
the current Hat.

Definition at line 149 of file CigiHatHotXRespV3.h.

00149 { return(Hat); }

double CigiHatHotXRespV3::GetHot ( void   )  const [inline]

Gets the Hot value.

Returns:
the current Hot.

Definition at line 171 of file CigiHatHotXRespV3.h.

00171 { return(Hot); }

Cigi_uint32 CigiHatHotXRespV3::GetMaterial ( void   )  const [inline]

Gets the Material value.

Returns:
the current Material.

Definition at line 192 of file CigiHatHotXRespV3.h.

00192 { return(Material); }

float CigiHatHotXRespV3::GetNormAz ( void   )  const [inline]

Gets the NormAz value.

Returns:
the current NormAz.

Definition at line 210 of file CigiHatHotXRespV3.h.

00210 { return(NormAz); }

float CigiHatHotXRespV3::GetNormEl ( void   )  const [inline]

Gets the NormEl value.

Returns:
the current NormEl.

Definition at line 228 of file CigiHatHotXRespV3.h.

00228 { return(NormEl); }

int CigiHatHotXRespV3::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 CigiBaseHatHotResp.

Definition at line 115 of file CigiHatHotXRespV3.cpp.

References PackPointerUnion::c, PackPointerUnion::d, PackPointerUnion::f, CigiBaseHatHotResp::Hat, CigiBaseHatHotResp::HatHotID, CigiBaseHatHotResp::Hot, PackPointerUnion::l, CigiBaseHatHotResp::Material, CigiBaseHatHotResp::NormAz, CigiBaseHatHotResp::NormEl, CigiBasePacket::PacketID, CigiBasePacket::PacketSize, PackPointerUnion::s, CigiBaseHatHotResp::Valid, CigiBaseHatHotResp::VldHat, and CigiBaseHatHotResp::VldHot.

00116 {
00117    PackPointer CDta;
00118 
00119    CigiBaseHatHotResp * Data = ( CigiBaseHatHotResp *)Base;
00120 
00121    CDta.c = Buff;
00122 
00123    *CDta.c++ = PacketID;
00124    *CDta.c++ = PacketSize;
00125 
00126    *CDta.s++ = Data->HatHotID;
00127 
00128    bool tValid = Data->Valid;
00129    if(!Data->VldHat && !Data->VldHot)
00130       tValid = false;
00131    *CDta.c++ = (tValid) ? 0x01 : 0;
00132 
00133    *CDta.c++ = 0;
00134    *CDta.s++ = 0;
00135 
00136    if(tValid)
00137    {
00138       if(Data->VldHat)
00139          *CDta.d++ = Data->Hat;
00140       else
00141          *CDta.d++ = 0.0;
00142 
00143       if(Data->VldHot)
00144          *CDta.d++ = Data->Hot;
00145       else
00146          *CDta.d++ = 0.0;
00147 
00148       *CDta.l++ = Data->Material;
00149       *CDta.f++ = Data->NormAz;
00150       *CDta.f++ = Data->NormEl;
00151 
00152    }
00153    else
00154    {
00155       *CDta.d++ = 0.0;
00156       *CDta.d++ = 0.0;
00157       *CDta.l++ = 0;
00158       *CDta.f++ = 0.0f;
00159       *CDta.f++ = 0.0f;
00160    }
00161 
00162 
00163    *CDta.l++ = 0;
00164 
00165    return(PacketSize);
00166 
00167 }

int CigiHatHotXRespV3::SetHat ( const double  HatIn,
bool  bndchk = true 
) [inline]

Sets the Hat with bound checking control

Parameters:
HatIn - Height above terrain result
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 139 of file CigiHatHotXRespV3.h.

References CIGI_SUCCESS.

00140    {
00141       Hat = HatIn;
00142       VldHat = true;
00143       return(CIGI_SUCCESS);
00144    }

int CigiHatHotXRespV3::SetHot ( const double  HotIn,
bool  bndchk = true 
) [inline]

Sets the Hot with bound checking control

Parameters:
HotIn - Height of terrain result
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 161 of file CigiHatHotXRespV3.h.

References CIGI_SUCCESS.

00162    {
00163       Hot = HotIn;
00164       VldHot = true;
00165       return(CIGI_SUCCESS);
00166    }

int CigiHatHotXRespV3::SetMaterial ( const Cigi_uint32  MaterialIn,
bool  bndchk = true 
) [inline]

Sets the Material with bound checking control

Parameters:
MaterialIn - Material Code of the test point
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 183 of file CigiHatHotXRespV3.h.

References CIGI_SUCCESS.

00184    {
00185       Material = MaterialIn;
00186       return(CIGI_SUCCESS);
00187    }

int CigiHatHotXRespV3::SetNormAz ( const float  NormAzIn,
bool  bndchk = true 
)

Sets the NormAz with bound checking control

Parameters:
NormAzIn - The Azimuth from true north of the normal vector of the polygon which contains the test point.
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 275 of file CigiHatHotXRespV3.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseHatHotResp::NormAz.

00276 {
00277 
00278 #ifndef CIGI_NO_BND_CHK
00279    if(bndchk && ((NormAzIn < -180.0)||(NormAzIn > 180.0)))
00280    {
00281 #ifndef CIGI_NO_EXCEPT
00282       throw CigiValueOutOfRangeException("NormAz",(float)NormAzIn,-180.0,180.0);
00283 #endif
00284       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00285    }
00286 #endif
00287 
00288    NormAz = NormAzIn;
00289    return(CIGI_SUCCESS);
00290 
00291 }

int CigiHatHotXRespV3::SetNormEl ( const float  NormElIn,
bool  bndchk = true 
)

Sets the NormEl with bound checking control

Parameters:
NormElIn - The Elevation of the normal vector of the polygon which contains the test point.
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 297 of file CigiHatHotXRespV3.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseHatHotResp::NormEl.

00298 {
00299 
00300 #ifndef CIGI_NO_BND_CHK
00301    if(bndchk && ((NormElIn < -90.0)||(NormElIn > 90.0)))
00302    {
00303 #ifndef CIGI_NO_EXCEPT
00304       throw CigiValueOutOfRangeException("NormEl",(float)NormElIn,-90.0,90.0);
00305 #endif
00306       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00307    }
00308 #endif
00309 
00310    NormEl = NormElIn;
00311    return(CIGI_SUCCESS);
00312 
00313 }

int CigiHatHotXRespV3::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 CigiBaseHatHotResp.

Definition at line 172 of file CigiHatHotXRespV3.cpp.

References PackPointerUnion::c, CigiSwap2(), CigiSwap4(), CigiSwap8(), PackPointerUnion::d, PackPointerUnion::f, CigiBaseHatHotResp::HAT, CigiBaseHatHotResp::Hat, CigiBaseHatHotResp::HatHotID, CigiBaseHatHotResp::HostFrame, CigiBaseHatHotResp::Hot, PackPointerUnion::l, CigiBaseHatHotResp::Material, CigiBaseHatHotResp::NormAz, CigiBaseHatHotResp::NormEl, CigiBasePacket::PacketSize, CigiBaseHatHotResp::ReqType, PackPointerUnion::s, CigiBaseHatHotResp::Valid, CigiBaseHatHotResp::VldHat, and CigiBaseHatHotResp::VldHot.

00173 {
00174    PackPointer CDta;
00175 
00176    CDta.c = Buff;
00177 
00178    CDta.c += 2;  // Step over packet id and size
00179 
00180    if(!Swap)
00181    {
00182       HatHotID = *CDta.s++;
00183 
00184       Valid = (*CDta.c++ != 0);
00185 
00186       CDta.c += 3;
00187 
00188       Hat = *CDta.d++;
00189       Hot = *CDta.d++;
00190       Material = *CDta.l++;
00191       NormAz = *CDta.f++;
00192       NormEl = *CDta.f++;
00193 
00194       if(Valid)
00195       {
00196          VldHat = true;
00197          VldHot = true;
00198       }
00199       else
00200       {
00201          VldHat = false;
00202          VldHot = false;
00203       }
00204    }
00205    else
00206    {
00207       CigiSwap2(&HatHotID, CDta.s++);
00208 
00209       Valid = (*CDta.c++ != 0);
00210 
00211       CDta.c += 3;
00212 
00213       CigiSwap8(&Hat, CDta.d++);
00214       CigiSwap8(&Hot, CDta.d++);
00215       CigiSwap4(&Material, CDta.l++);
00216       CigiSwap4(&NormAz, CDta.f++);
00217       CigiSwap4(&NormEl, CDta.f++);
00218 
00219       if(Valid)
00220       {
00221          VldHat = true;
00222          VldHot = true;
00223       }
00224       else
00225       {
00226          VldHat = false;
00227          VldHot = false;
00228       }
00229    }
00230 
00231    ReqType = HAT;  // For Cigi Version 1 and 2 compatibility
00232 
00233    HostFrame = 0;
00234 
00235    return(PacketSize);
00236 
00237 }


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