CigiViewCtrlV3 Class Reference

#include <CigiViewCtrlV3.h>

Inheritance diagram for CigiViewCtrlV3:

CigiBaseViewCtrl CigiBasePacket List of all members.

Public Member Functions

 CigiViewCtrlV3 ()
virtual ~CigiViewCtrlV3 ()
virtual int Pack (CigiBasePacket *Base, Cigi_uint8 *Buff, void *Spec) const
virtual int Unpack (Cigi_uint8 *Buff, bool Swap, void *Spec)
int SetViewID (const Cigi_uint16 ViewIDIn, bool bndchk=true)
Cigi_uint16 GetViewID (void) const
int SetGroupID (const Cigi_uint8 GroupIDIn, bool bndchk=true)
Cigi_uint8 GetGroupID (void) const
int SetXOffEn (const bool XOffEnIn, bool bndchk=true)
bool GetXOffEn (void) const
int SetYOffEn (const bool YOffEnIn, bool bndchk=true)
bool GetYOffEn (void) const
int SetZOffEn (const bool ZOffEnIn, bool bndchk=true)
bool GetZOffEn (void) const
int SetRollEn (const bool RollEnIn, bool bndchk=true)
bool GetRollEn (void) const
int SetPitchEn (const bool PitchEnIn, bool bndchk=true)
bool GetPitchEn (void) const
int SetYawEn (const bool YawEnIn, bool bndchk=true)
bool GetYawEn (void) const

Detailed Description

Definition at line 61 of file CigiViewCtrlV3.h.


Constructor & Destructor Documentation

CigiViewCtrlV3::CigiViewCtrlV3 (  ) 

General Constructor

Definition at line 67 of file CigiViewCtrlV3.cpp.

References CIGI_VIEW_CTRL_PACKET_ID_V3, CIGI_VIEW_CTRL_PACKET_SIZE_V3, CigiBaseViewCtrl::EntityID, CigiBaseViewCtrl::GroupID, CigiBasePacket::MinorVersion, CigiBasePacket::PacketID, CigiBasePacket::PacketSize, CigiBaseViewCtrl::Pitch, CigiBaseViewCtrl::PitchEn, CigiBaseViewCtrl::Roll, CigiBaseViewCtrl::RollEn, CigiBasePacket::Version, CigiBaseViewCtrl::ViewID, CigiBaseViewCtrl::XOff, CigiBaseViewCtrl::XOffEn, CigiBaseViewCtrl::Yaw, CigiBaseViewCtrl::YawEn, CigiBaseViewCtrl::YOff, CigiBaseViewCtrl::YOffEn, CigiBaseViewCtrl::ZOff, and CigiBaseViewCtrl::ZOffEn.

00068 {
00069 
00070    PacketID = CIGI_VIEW_CTRL_PACKET_ID_V3;
00071    PacketSize = CIGI_VIEW_CTRL_PACKET_SIZE_V3;
00072    Version = 3;
00073    MinorVersion = 0;
00074 
00075    EntityID = 0;
00076    ViewID = 0;
00077    GroupID = 0;
00078    XOffEn = false;
00079    YOffEn = false;
00080    ZOffEn = false;
00081    RollEn = false;
00082    PitchEn = false;
00083    YawEn = false;
00084    XOff = 0.0;
00085    YOff = 0.0;
00086    ZOff = 0.0;
00087    Roll = 0.0;
00088    Pitch = 0.0;
00089    Yaw = 0.0;
00090 
00091 }

CigiViewCtrlV3::~CigiViewCtrlV3 (  )  [virtual]

General Destructor

Definition at line 96 of file CigiViewCtrlV3.cpp.

00097 {
00098 
00099 }


Member Function Documentation

Cigi_uint8 CigiViewCtrlV3::GetGroupID ( void   )  const [inline]

Gets the GroupID value.

Returns:
the current GroupID.

Definition at line 151 of file CigiViewCtrlV3.h.

00151 { return(GroupID); }

bool CigiViewCtrlV3::GetPitchEn ( void   )  const [inline]

Gets the PitchEn value.

Returns:
the current PitchEn.

Definition at line 261 of file CigiViewCtrlV3.h.

00261 { return(PitchEn); }

bool CigiViewCtrlV3::GetRollEn ( void   )  const [inline]

Gets the RollEn value.

Returns:
the current RollEn.

Definition at line 239 of file CigiViewCtrlV3.h.

00239 { return(RollEn); }

Cigi_uint16 CigiViewCtrlV3::GetViewID ( void   )  const [inline]

Gets the ViewID value.

Returns:
the current ViewID.

Definition at line 130 of file CigiViewCtrlV3.h.

00130 { return(ViewID); }

bool CigiViewCtrlV3::GetXOffEn ( void   )  const [inline]

Gets the XOffEn value.

Returns:
the current XOffEn.

Definition at line 173 of file CigiViewCtrlV3.h.

00173 { return(XOffEn); }

bool CigiViewCtrlV3::GetYawEn ( void   )  const [inline]

Gets the YawEn value.

Returns:
the current YawEn.

Definition at line 283 of file CigiViewCtrlV3.h.

00283 { return(YawEn); }

bool CigiViewCtrlV3::GetYOffEn ( void   )  const [inline]

Gets the YOffEn value.

Returns:
the current YOffEn.

Definition at line 195 of file CigiViewCtrlV3.h.

00195 { return(YOffEn); }

bool CigiViewCtrlV3::GetZOffEn ( void   )  const [inline]

Gets the ZOffEn value.

Returns:
the current ZOffEn.

Definition at line 217 of file CigiViewCtrlV3.h.

00217 { return(ZOffEn); }

int CigiViewCtrlV3::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 CigiBaseViewCtrl.

Definition at line 108 of file CigiViewCtrlV3.cpp.

References PackPointerUnion::c, CigiBaseViewCtrl::EntityID, PackPointerUnion::f, CigiBaseViewCtrl::GroupID, CigiBasePacket::PacketID, CigiBasePacket::PacketSize, CigiBaseViewCtrl::Pitch, CigiBaseViewCtrl::PitchEn, CigiBaseViewCtrl::Roll, CigiBaseViewCtrl::RollEn, PackPointerUnion::s, CigiBaseViewCtrl::ViewID, CigiBaseViewCtrl::XOff, CigiBaseViewCtrl::XOffEn, CigiBaseViewCtrl::Yaw, CigiBaseViewCtrl::YawEn, CigiBaseViewCtrl::YOff, CigiBaseViewCtrl::YOffEn, CigiBaseViewCtrl::ZOff, and CigiBaseViewCtrl::ZOffEn.

00109 {
00110    PackPointer CDta;
00111 
00112    CigiBaseViewCtrl * Data = ( CigiBaseViewCtrl *)Base;
00113 
00114    CDta.c = Buff;
00115 
00116    *CDta.c++ = PacketID;
00117    *CDta.c++ = PacketSize;
00118 
00119    *CDta.s++ = Data->ViewID;
00120    *CDta.c++ = Data->GroupID;
00121 
00122    Cigi_uint8 HDta = 0;
00123 
00124    if(Data->XOffEn)
00125       HDta |= 0x01;
00126 
00127    if(Data->YOffEn)
00128       HDta |= 0x02;
00129 
00130    if(Data->ZOffEn)
00131       HDta |= 0x04;
00132 
00133    if(Data->RollEn)
00134       HDta |= 0x08;
00135 
00136    if(Data->PitchEn)
00137       HDta |= 0x10;
00138 
00139    if(Data->YawEn)
00140       HDta |= 0x20;
00141 
00142    *CDta.c++ = HDta;
00143 
00144    *CDta.s++ = Data->EntityID;
00145 
00146    *CDta.f++ = Data->XOff;
00147    *CDta.f++ = Data->YOff;
00148    *CDta.f++ = Data->ZOff;
00149    *CDta.f++ = Data->Roll;
00150    *CDta.f++ = Data->Pitch;
00151    *CDta.f++ = Data->Yaw;
00152 
00153    return(PacketSize);
00154 
00155 }

int CigiViewCtrlV3::SetGroupID ( const Cigi_uint8  GroupIDIn,
bool  bndchk = true 
) [inline]

Sets the GroupID with bound checking control

Parameters:
GroupIDIn - Specifies the view group that this packet controls.
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 142 of file CigiViewCtrlV3.h.

References CIGI_SUCCESS.

00143    {
00144       GroupID = GroupIDIn;
00145       return(CIGI_SUCCESS);
00146    }

int CigiViewCtrlV3::SetPitchEn ( const bool  PitchEnIn,
bool  bndchk = true 
) [inline]

Sets the PitchEn with bound checking control

Parameters:
PitchEnIn - Specifies if the pitch data is valid and to be used.
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 252 of file CigiViewCtrlV3.h.

References CIGI_SUCCESS.

00253    {
00254       PitchEn = PitchEnIn;
00255       return(CIGI_SUCCESS);
00256    }

int CigiViewCtrlV3::SetRollEn ( const bool  RollEnIn,
bool  bndchk = true 
) [inline]

Sets the RollEn with bound checking control

Parameters:
RollEnIn - Specifies if the roll data is valid and to be used.
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 230 of file CigiViewCtrlV3.h.

References CIGI_SUCCESS.

00231    {
00232       RollEn = RollEnIn;
00233       return(CIGI_SUCCESS);
00234    }

int CigiViewCtrlV3::SetViewID ( const Cigi_uint16  ViewIDIn,
bool  bndchk = true 
) [inline]

Sets the ViewID with bound checking control

Parameters:
ViewIDIn - Specifies the view that this packet controls.
If The Group ID is not 0, ViewID is ignored.
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 120 of file CigiViewCtrlV3.h.

References CIGI_SUCCESS.

00121    {
00122       ViewID = ViewIDIn;
00123       return(CIGI_SUCCESS);
00124    }

int CigiViewCtrlV3::SetXOffEn ( const bool  XOffEnIn,
bool  bndchk = true 
) [inline]

Sets the XOffEn with bound checking control

Parameters:
XOffEnIn - Specifies if the X Offset data is valid and to be used.
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 164 of file CigiViewCtrlV3.h.

References CIGI_SUCCESS.

00165    {
00166       XOffEn = XOffEnIn;
00167       return(CIGI_SUCCESS);
00168    }

int CigiViewCtrlV3::SetYawEn ( const bool  YawEnIn,
bool  bndchk = true 
) [inline]

Sets the YawEn with bound checking control

Parameters:
YawEnIn - Specifies if the yaw data is valid and to be used.
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 274 of file CigiViewCtrlV3.h.

References CIGI_SUCCESS.

00275    {
00276       YawEn = YawEnIn;
00277       return(CIGI_SUCCESS);
00278    }

int CigiViewCtrlV3::SetYOffEn ( const bool  YOffEnIn,
bool  bndchk = true 
) [inline]

Sets the YOffEn with bound checking control

Parameters:
YOffEnIn - Specifies if the Y Offset data is valid and to be used.
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 186 of file CigiViewCtrlV3.h.

References CIGI_SUCCESS.

00187    {
00188       YOffEn = YOffEnIn;
00189       return(CIGI_SUCCESS);
00190    }

int CigiViewCtrlV3::SetZOffEn ( const bool  ZOffEnIn,
bool  bndchk = true 
) [inline]

Sets the ZOffEn with bound checking control

Parameters:
ZOffEnIn - Specifies if the Z Offset data is valid and to be used.
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 208 of file CigiViewCtrlV3.h.

References CIGI_SUCCESS.

00209    {
00210       ZOffEn = ZOffEnIn;
00211       return(CIGI_SUCCESS);
00212    }

int CigiViewCtrlV3::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 CigiBaseViewCtrl.

Definition at line 160 of file CigiViewCtrlV3.cpp.

References PackPointerUnion::c, CigiSwap2(), CigiSwap4(), CigiBaseViewCtrl::EntityID, PackPointerUnion::f, CigiBaseViewCtrl::GroupID, CigiBasePacket::PacketSize, CigiBaseViewCtrl::Pitch, CigiBaseViewCtrl::PitchEn, CigiBaseViewCtrl::Roll, CigiBaseViewCtrl::RollEn, PackPointerUnion::s, CigiBaseViewCtrl::ViewID, CigiBaseViewCtrl::XOff, CigiBaseViewCtrl::XOffEn, CigiBaseViewCtrl::Yaw, CigiBaseViewCtrl::YawEn, CigiBaseViewCtrl::YOff, CigiBaseViewCtrl::YOffEn, CigiBaseViewCtrl::ZOff, and CigiBaseViewCtrl::ZOffEn.

00161 {
00162    PackPointer CDta;
00163 
00164    CDta.c = Buff;
00165 
00166    CDta.c += 2;  // Step over packet id and size
00167 
00168    if(!Swap)
00169    {
00170       ViewID = *CDta.s++;
00171       GroupID = *CDta.c++;
00172 
00173       Cigi_uint8 HDta = *CDta.c++;
00174 
00175       XOffEn  = ((HDta & 0x01) != 0);
00176       YOffEn  = ((HDta & 0x02) != 0);
00177       ZOffEn  = ((HDta & 0x04) != 0);
00178       RollEn  = ((HDta & 0x08) != 0);
00179       PitchEn = ((HDta & 0x10) != 0);
00180       YawEn   = ((HDta & 0x20) != 0);
00181 
00182       EntityID = *CDta.s++;
00183 
00184       XOff = *CDta.f++;
00185       YOff = *CDta.f++;
00186       ZOff = *CDta.f++;
00187       Roll = *CDta.f++;
00188       Pitch = *CDta.f++;
00189       Yaw = *CDta.f++;
00190    }
00191    else
00192    {
00193       CigiSwap2(&ViewID, CDta.s++);
00194       GroupID = *CDta.c++;
00195 
00196       Cigi_uint8 HDta = *CDta.c++;
00197 
00198       XOffEn  = ((HDta & 0x01) != 0);
00199       YOffEn  = ((HDta & 0x02) != 0);
00200       ZOffEn  = ((HDta & 0x04) != 0);
00201       RollEn  = ((HDta & 0x08) != 0);
00202       PitchEn = ((HDta & 0x10) != 0);
00203       YawEn   = ((HDta & 0x20) != 0);
00204 
00205       CigiSwap2(&EntityID, CDta.s++);
00206 
00207       CigiSwap4(&XOff, CDta.f++);
00208       CigiSwap4(&YOff, CDta.f++);
00209       CigiSwap4(&ZOff, CDta.f++);
00210       CigiSwap4(&Roll, CDta.f++);
00211       CigiSwap4(&Pitch, CDta.f++);
00212       CigiSwap4(&Yaw, CDta.f++);
00213    }
00214 
00215    return(PacketSize);
00216 
00217 }


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