CigiLosVectReqV3 Class Reference

#include <CigiLosVectReqV3.h>

Inheritance diagram for CigiLosVectReqV3:

CigiBaseLosVectReq CigiBasePacket List of all members.

Public Member Functions

 CigiLosVectReqV3 ()
virtual ~CigiLosVectReqV3 ()
virtual int Pack (CigiBasePacket *Base, Cigi_uint8 *Buff, void *Spec) const
virtual int Unpack (Cigi_uint8 *Buff, bool Swap, void *Spec)
int SetReqType (const ReqTypeGrp ReqTypeIn, bool bndchk=true)
ReqTypeGrp GetReqType (void) const
int SetSrcCoordSys (const CoordSysGrp SrcCoordSysIn, bool bndchk=true)
CoordSysGrp GetSrcCoordSys (void) const
int SetResponseCoordSys (const CoordSysGrp ResponseCoordSysIn, bool bndchk=true)
CoordSysGrp GetResponseCoordSys (void) const
int SetAlphaThresh (const Cigi_uint8 AlphaThreshIn, bool bndchk=true)
Cigi_uint8 GetAlphaThresh (void) const
int SetEntityID (const Cigi_uint16 EntityIDIn, bool bndchk=true)
Cigi_uint16 GetEntityID (void) const
int SetVectAz (const float VectAzIn, bool bndchk=true)
float GetVectAz (void)
int SetMinRange (const float MinRangeIn, bool bndchk=true)
float GetMinRange (void) const
int SetSrcXoff (const double SrcXoffIn, bool bndchk=true)
double GetSrcXoff (void) const
int SetSrcYoff (const double SrcYoffIn, bool bndchk=true)
double GetSrcYoff (void) const
int SetSrcZoff (const double SrcZoffIn, bool bndchk=true)
double GetSrcZoff (void) const
int SetMask (const Cigi_uint32 MaskIn, bool bndchk=true)
Cigi_uint32 GetMask (void) const

Detailed Description

Definition at line 61 of file CigiLosVectReqV3.h.


Constructor & Destructor Documentation

CigiLosVectReqV3::CigiLosVectReqV3 (  ) 

General Constructor

Definition at line 73 of file CigiLosVectReqV3.cpp.

References CigiBaseLosVectReq::AlphaThresh, CigiBaseLosVectReq::Basic, CIGI_LOS_VECT_REQ_PACKET_ID_V3, CIGI_LOS_VECT_REQ_PACKET_SIZE_V3, CigiBaseLosVectReq::EntityID, CigiBaseLosVectReq::Geodetic, CigiBaseLosVectReq::LosID, CigiBaseLosVectReq::Mask, CigiBaseLosVectReq::MaxRange, CigiBasePacket::MinorVersion, CigiBaseLosVectReq::MinRange, CigiBasePacket::PacketID, CigiBasePacket::PacketSize, CigiBaseLosVectReq::ReqType, CigiBaseLosVectReq::ResponseCoordSys, CigiBaseLosVectReq::SrcCoordSys, CigiBaseLosVectReq::SrcXLat, CigiBaseLosVectReq::SrcYLon, CigiBaseLosVectReq::SrcZAlt, CigiBaseLosVectReq::UpdatePeriod, CigiBaseLosVectReq::ValidV1or2, CigiBaseLosVectReq::VectAz, CigiBaseLosVectReq::VectEl, and CigiBasePacket::Version.

00074 {
00075 
00076    PacketID = CIGI_LOS_VECT_REQ_PACKET_ID_V3;
00077    PacketSize = CIGI_LOS_VECT_REQ_PACKET_SIZE_V3;
00078    Version = 3;
00079    MinorVersion = 0;
00080 
00081    LosID = 0;
00082    ReqType = Basic;
00083    SrcCoordSys = Geodetic;
00084    ResponseCoordSys = Geodetic;
00085    AlphaThresh = 0;
00086    EntityID = 0;
00087    VectAz = 0.0;
00088    VectEl = 0.0;
00089    MinRange = 0.0;
00090    MaxRange = 0.0;
00091    SrcXLat = 0.0;
00092    SrcYLon = 0.0;
00093    SrcZAlt = 0.0;
00094    Mask = 0;
00095    UpdatePeriod = 0;
00096    ValidV1or2 = true;
00097 
00098 }

CigiLosVectReqV3::~CigiLosVectReqV3 (  )  [virtual]

General Destructor

Definition at line 103 of file CigiLosVectReqV3.cpp.

00104 {
00105 
00106 }


Member Function Documentation

Cigi_uint8 CigiLosVectReqV3::GetAlphaThresh ( void   )  const [inline]

Gets the AlphaThresh value.

Returns:
the current AlphaThresh.

Definition at line 189 of file CigiLosVectReqV3.h.

00189 { return(AlphaThresh); }

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

Gets the EntityID value.

Returns:
the current EntityID.

Definition at line 210 of file CigiLosVectReqV3.h.

00210 { return(EntityID); }

Cigi_uint32 CigiLosVectReqV3::GetMask ( void   )  const [inline]

Gets the Mask value.

Returns:
the current Mask.

Definition at line 342 of file CigiLosVectReqV3.h.

00342 { return(Mask); }

float CigiLosVectReqV3::GetMinRange ( void   )  const [inline]

Gets the MinRange value.

Returns:
the current MinRange.

Definition at line 255 of file CigiLosVectReqV3.h.

00255 { return(MinRange); }

ReqTypeGrp CigiLosVectReqV3::GetReqType ( void   )  const [inline]

Gets the ReqType value.

Returns:
the current ReqType.

Definition at line 127 of file CigiLosVectReqV3.h.

00127 { return(ReqType); }

CoordSysGrp CigiLosVectReqV3::GetResponseCoordSys ( void   )  const [inline]

Gets the ResponseCoordSys value.

Returns:
the current ResponseCoordSys.

Definition at line 167 of file CigiLosVectReqV3.h.

00167 { return(ResponseCoordSys); }

CoordSysGrp CigiLosVectReqV3::GetSrcCoordSys ( void   )  const [inline]

Gets the SrcCoordSys value.

Returns:
the current SrcCoordSys.

Definition at line 147 of file CigiLosVectReqV3.h.

00147 { return(SrcCoordSys); }

double CigiLosVectReqV3::GetSrcXoff ( void   )  const [inline]

Gets the SrcXoff value.

Returns:
the current SrcXoff.

Definition at line 277 of file CigiLosVectReqV3.h.

00277 { return(SrcXLat); }

double CigiLosVectReqV3::GetSrcYoff ( void   )  const [inline]

Gets the SrcYoff value.

Returns:
the current SrcYoff.

Definition at line 299 of file CigiLosVectReqV3.h.

00299 { return(SrcYLon); }

double CigiLosVectReqV3::GetSrcZoff ( void   )  const [inline]

Gets the SrcZoff value.

Returns:
the current SrcZoff.

Definition at line 321 of file CigiLosVectReqV3.h.

00321 { return(SrcZAlt); }

float CigiLosVectReqV3::GetVectAz ( void   )  [inline]

Gets the VectAz value.

Returns:
the current VectAz.

Definition at line 227 of file CigiLosVectReqV3.h.

00228    {
00229       if(VectAz > 180.0f)
00230          VectAz -= 360.0f;
00231 
00232       return(VectAz);
00233    }

int CigiLosVectReqV3::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 CigiBaseLosVectReq.

Definition at line 115 of file CigiLosVectReqV3.cpp.

References CigiBaseLosVectReq::AlphaThresh, PackPointerUnion::c, PackPointerUnion::d, CigiBaseLosVectReq::EntityID, PackPointerUnion::f, PackPointerUnion::l, CigiBaseLosVectReq::LosID, CigiBaseLosVectReq::Mask, CigiBaseLosVectReq::MaxRange, CigiBaseLosVectReq::MinRange, CigiBasePacket::PacketID, CigiBasePacket::PacketSize, CigiBaseLosVectReq::ReqType, CigiBaseLosVectReq::ResponseCoordSys, PackPointerUnion::s, CigiBaseLosVectReq::SrcCoordSys, CigiBaseLosVectReq::SrcXLat, CigiBaseLosVectReq::SrcYLon, CigiBaseLosVectReq::SrcZAlt, CigiBaseLosVectReq::VectAz, and CigiBaseLosVectReq::VectEl.

00116 {
00117    PackPointer CDta;
00118 
00119    CigiBaseLosVectReq * Data = ( CigiBaseLosVectReq *)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 = (Cigi_uint8)(Data->ReqType & 0x01);
00129    HDta |= (Cigi_uint8)((Data->SrcCoordSys << 1) & 0x02);
00130    HDta |= (Cigi_uint8)((Data->ResponseCoordSys << 2) & 0x04);
00131    *CDta.c++ = HDta;
00132 
00133    *CDta.c++ = Data->AlphaThresh;
00134    *CDta.s++ = Data->EntityID;
00135 
00136    if(Data->VectAz > 180.0f)
00137       Data->VectAz -= 360.0f;
00138    *CDta.f++ = Data->VectAz;
00139 
00140    *CDta.f++ = Data->VectEl;
00141    *CDta.f++ = Data->MinRange;
00142    *CDta.f++ = Data->MaxRange;
00143    *CDta.d++ = Data->SrcXLat;
00144    *CDta.d++ = Data->SrcYLon;
00145    *CDta.d++ = Data->SrcZAlt;
00146    *CDta.l++ = Data->Mask;
00147    *CDta.l++ = 0;
00148 
00149    return(PacketSize);
00150 
00151 }

int CigiLosVectReqV3::SetAlphaThresh ( const Cigi_uint8  AlphaThreshIn,
bool  bndchk = true 
) [inline]

Sets the AlphaThresh with bound checking control

Parameters:
AlphaThreshIn - The lowest alpha value that will cause a report to be generated when 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 180 of file CigiLosVectReqV3.h.

References CIGI_SUCCESS.

00181    {
00182       AlphaThresh = AlphaThreshIn;
00183       return(CIGI_SUCCESS);
00184    }

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

Sets the EntityID with bound checking control

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

Definition at line 201 of file CigiLosVectReqV3.h.

References CIGI_SUCCESS.

00202    {
00203       EntityID = EntityIDIn;
00204       return(CIGI_SUCCESS);
00205    }

int CigiLosVectReqV3::SetMask ( const Cigi_uint32  MaskIn,
bool  bndchk = true 
) [inline]

Sets the Mask with bound checking control

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

Definition at line 333 of file CigiLosVectReqV3.h.

References CIGI_SUCCESS.

00334    {
00335       Mask = MaskIn;
00336       return(CIGI_SUCCESS);
00337    }

int CigiLosVectReqV3::SetMinRange ( const float  MinRangeIn,
bool  bndchk = true 
) [inline]

Sets the MinRange with bound checking control

Parameters:
MinRangeIn - The minimum range from the starting or source point that will result in a report when 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 246 of file CigiLosVectReqV3.h.

References CIGI_SUCCESS.

00247    {
00248       MinRange = MinRangeIn;
00249       return(CIGI_SUCCESS);
00250    }

int CigiLosVectReqV3::SetReqType ( const ReqTypeGrp  ReqTypeIn,
bool  bndchk = true 
)

Sets the ReqType with bound checking control

Parameters:
ReqTypeIn - Specifies which type of response is desired.
Basic=0
Extended=1
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 223 of file CigiLosVectReqV3.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseLosVectReq::ReqType.

00224 {
00225 
00226 #ifndef CIGI_NO_BND_CHK
00227    if(bndchk && ((ReqTypeIn < 0)||(ReqTypeIn > 1)))
00228    {
00229 #ifndef CIGI_NO_EXCEPT
00230       throw CigiValueOutOfRangeException("ReqType",(ReqTypeGrp)ReqTypeIn,0,1);
00231 #endif
00232       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00233    }
00234 #endif
00235 
00236    ReqType = ReqTypeIn;
00237    return(CIGI_SUCCESS);
00238 
00239 }

int CigiLosVectReqV3::SetResponseCoordSys ( const CoordSysGrp  ResponseCoordSysIn,
bool  bndchk = true 
)

Sets the ResponseCoordSys with bound checking control

Parameters:
ResponseCoordSysIn - Specifies which coordinate system is desired to define the intersection point.
Geodetic=0
Entity=1
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 267 of file CigiLosVectReqV3.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseLosVectReq::ResponseCoordSys.

00268 {
00269 
00270 #ifndef CIGI_NO_BND_CHK
00271    if(bndchk && ((ResponseCoordSysIn < 0)||(ResponseCoordSysIn > 1)))
00272    {
00273 #ifndef CIGI_NO_EXCEPT
00274       throw CigiValueOutOfRangeException("ResponseCoordSys",(CoordSysGrp)ResponseCoordSysIn,0,1);
00275 #endif
00276       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00277    }
00278 #endif
00279 
00280    ResponseCoordSys = ResponseCoordSysIn;
00281    return(CIGI_SUCCESS);
00282 
00283 }

int CigiLosVectReqV3::SetSrcCoordSys ( const CoordSysGrp  SrcCoordSysIn,
bool  bndchk = true 
)

Sets the SrcCoordSys with bound checking control

Parameters:
SrcCoordSysIn - Specifies which coordinate system is used to define the source or starting point.
Geodetic=0
Entity=1
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 245 of file CigiLosVectReqV3.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseLosVectReq::SrcCoordSys.

00246 {
00247 
00248 #ifndef CIGI_NO_BND_CHK
00249    if(bndchk && ((SrcCoordSysIn < 0)||(SrcCoordSysIn > 1)))
00250    {
00251 #ifndef CIGI_NO_EXCEPT
00252       throw CigiValueOutOfRangeException("SrcCoordSys",(CoordSysGrp)SrcCoordSysIn,0,1);
00253 #endif
00254       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00255    }
00256 #endif
00257 
00258    SrcCoordSys = SrcCoordSysIn;
00259    return(CIGI_SUCCESS);
00260 
00261 }

int CigiLosVectReqV3::SetSrcXoff ( const double  SrcXoffIn,
bool  bndchk = true 
) [inline]

Sets the SrcXoff with bound checking control

Parameters:
SrcXoffIn - The offset of the starting or source point along the X axis from the origin of the origin entity.
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 268 of file CigiLosVectReqV3.h.

References CIGI_SUCCESS.

00269    {
00270       SrcXLat = SrcXoffIn;
00271       return(CIGI_SUCCESS);
00272    }

int CigiLosVectReqV3::SetSrcYoff ( const double  SrcYoffIn,
bool  bndchk = true 
) [inline]

Sets the SrcYoff with bound checking control

Parameters:
SrcYoffIn - The offset of the starting or source point along the Y axis from the origin of the origin entity.
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 290 of file CigiLosVectReqV3.h.

References CIGI_SUCCESS.

00291    {
00292       SrcYLon = SrcYoffIn;
00293       return(CIGI_SUCCESS);
00294    }

int CigiLosVectReqV3::SetSrcZoff ( const double  SrcZoffIn,
bool  bndchk = true 
) [inline]

Sets the SrcZoff with bound checking control

Parameters:
SrcZoffIn - The offset of the starting or source point along the Z axis from the origin of the origin entity.
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 312 of file CigiLosVectReqV3.h.

References CIGI_SUCCESS.

00313    {
00314       SrcZAlt = SrcZoffIn;
00315       return(CIGI_SUCCESS);
00316    }

int CigiLosVectReqV3::SetVectAz ( const float  VectAzIn,
bool  bndchk = true 
)

Sets the VectAz with bound checking control

Parameters:
VectAzIn - The azimuth of the LOS vector
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 289 of file CigiLosVectReqV3.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseLosVectReq::VectAz.

00290 {
00291 
00292 #ifndef CIGI_NO_BND_CHK
00293    if(bndchk && ((VectAzIn < -180.0f)||(VectAzIn > 180.0f)))
00294    {
00295 #ifndef CIGI_NO_EXCEPT
00296       throw CigiValueOutOfRangeException("VectAz",(float)VectAzIn,-180.0,180.0);
00297 #endif
00298       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00299    }
00300 #endif
00301 
00302    VectAz = VectAzIn;
00303    return(CIGI_SUCCESS);
00304 
00305 }

int CigiLosVectReqV3::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 CigiBaseLosVectReq.

Definition at line 156 of file CigiLosVectReqV3.cpp.

References CigiBaseLosVectReq::AlphaThresh, PackPointerUnion::c, CigiSwap2(), CigiSwap4(), CigiSwap8(), PackPointerUnion::d, CigiBaseLosVectReq::EntityID, PackPointerUnion::f, CigiBaseLosVectReq::Geodetic, PackPointerUnion::l, CigiBaseLosVectReq::LosID, CigiBaseLosVectReq::Mask, CigiBaseLosVectReq::MaxRange, CigiBaseLosVectReq::MinRange, CigiBasePacket::PacketSize, CigiBaseLosVectReq::ReqType, CigiBaseLosVectReq::ResponseCoordSys, PackPointerUnion::s, CigiBaseLosVectReq::SrcCoordSys, CigiBaseLosVectReq::SrcXLat, CigiBaseLosVectReq::SrcYLon, CigiBaseLosVectReq::SrcZAlt, CigiBaseLosVectReq::UpdatePeriod, CigiBaseLosVectReq::ValidV1or2, CigiBaseLosVectReq::VectAz, and CigiBaseLosVectReq::VectEl.

00157 {
00158    PackPointer CDta;
00159 
00160    CDta.c = Buff;
00161 
00162    CDta.c += 2;  // Step over packet id and size
00163 
00164    if(!Swap)
00165    {
00166       LosID = *CDta.s++;
00167 
00168       Cigi_uint16 HDta = *CDta.c++;
00169       ReqType = (ReqTypeGrp)(HDta & 0x01);
00170       SrcCoordSys = (CoordSysGrp)((HDta >> 1) & 0x01);
00171       ResponseCoordSys = (CoordSysGrp)((HDta >> 2) & 0x01);
00172 
00173       AlphaThresh = *CDta.c++;
00174       EntityID = *CDta.s++;
00175       VectAz = *CDta.f++;
00176       VectEl = *CDta.f++;
00177       MinRange = *CDta.f++;
00178       MaxRange = *CDta.f++;
00179       SrcXLat = *CDta.d++;
00180       SrcYLon = *CDta.d++;
00181       SrcZAlt = *CDta.d++;
00182       Mask = *CDta.l++;
00183    }
00184    else
00185    {
00186       CigiSwap2(&LosID, CDta.s++);
00187 
00188       Cigi_uint16 HDta = *CDta.c++;
00189       ReqType = (ReqTypeGrp)(HDta & 0x01);
00190       SrcCoordSys = (CoordSysGrp)((HDta >> 1) & 0x01);
00191       ResponseCoordSys = (CoordSysGrp)((HDta >> 2) & 0x01);
00192 
00193       AlphaThresh = *CDta.c++;
00194       CigiSwap2(&EntityID, CDta.s++);
00195       CigiSwap4(&VectAz, CDta.f++);
00196       CigiSwap4(&VectEl, CDta.f++);
00197       CigiSwap4(&MinRange, CDta.f++);
00198       CigiSwap4(&MaxRange, CDta.f++);
00199       CigiSwap8(&SrcXLat, CDta.d++);
00200       CigiSwap8(&SrcYLon, CDta.d++);
00201       CigiSwap8(&SrcZAlt, CDta.d++);
00202       CigiSwap4(&Mask, CDta.l++);
00203    }
00204 
00205    UpdatePeriod = 0;
00206 
00207    ValidV1or2 = (SrcCoordSys == Geodetic);
00208 
00209    return(PacketSize);
00210 
00211 }


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