#include <CigiTrajectoryDefV1.h>
Inheritance diagram for CigiTrajectoryDefV1:
Public Member Functions | |
CigiTrajectoryDefV1 () | |
virtual | ~CigiTrajectoryDefV1 () |
virtual int | Pack (CigiBasePacket *Base, Cigi_uint8 *Buff, void *Spec) const |
virtual int | Unpack (Cigi_uint8 *Buff, bool Swap, void *Spec) |
int | SetAccel (const float AccelIn, bool bndchk=true) |
float | GetAccel (void) const |
int | SetXoff (const float XoffIn, bool bndchk=true) |
float | GetXoff (void) const |
int | SetYoff (const float YoffIn, bool bndchk=true) |
float | GetYoff (void) const |
int | SetZoff (const float ZoffIn, bool bndchk=true) |
float | GetZoff (void) const |
Definition at line 57 of file CigiTrajectoryDefV1.h.
CigiTrajectoryDefV1::CigiTrajectoryDefV1 | ( | ) |
General Constructor
Definition at line 82 of file CigiTrajectoryDefV1.cpp.
References CigiBaseTrajectoryDef::Accel, CigiBaseTrajectoryDef::AccelX, CigiBaseTrajectoryDef::AccelY, CigiBaseTrajectoryDef::AccelZ, CIGI_TRAJECTORY_DEF_PACKET_ID_V1, CIGI_TRAJECTORY_DEF_PACKET_SIZE_V1, CigiBaseTrajectoryDef::EntityID, CigiBasePacket::MinorVersion, CigiBasePacket::PacketID, CigiBasePacket::PacketSize, CigiBaseTrajectoryDef::RetardationRate, CigiBaseTrajectoryDef::TermVel, CigiBasePacket::Version, CigiBaseTrajectoryDef::Xoff, CigiBaseTrajectoryDef::Yoff, and CigiBaseTrajectoryDef::Zoff.
00083 { 00084 00085 PacketID = CIGI_TRAJECTORY_DEF_PACKET_ID_V1; 00086 PacketSize = CIGI_TRAJECTORY_DEF_PACKET_SIZE_V1; 00087 Version = 1; 00088 MinorVersion = 0; 00089 00090 EntityID = 0; 00091 Accel = 0.0; 00092 RetardationRate = 0.0; 00093 TermVel = 0.0; 00094 Xoff = 0.0; 00095 Yoff = 0.0; 00096 Zoff = 0.0; 00097 AccelX = 0.0; 00098 AccelY = 0.0; 00099 AccelZ = 0.0; 00100 00101 }
CigiTrajectoryDefV1::~CigiTrajectoryDefV1 | ( | ) | [virtual] |
float CigiTrajectoryDefV1::GetAccel | ( | void | ) | const [inline] |
Gets the Accel value.
Definition at line 125 of file CigiTrajectoryDefV1.h.
00125 { return(Accel); }
float CigiTrajectoryDefV1::GetXoff | ( | void | ) | const [inline] |
Gets the Xoff value.
Definition at line 147 of file CigiTrajectoryDefV1.h.
00147 { return(Xoff); }
float CigiTrajectoryDefV1::GetYoff | ( | void | ) | const [inline] |
Gets the Yoff value.
Definition at line 169 of file CigiTrajectoryDefV1.h.
00169 { return(Yoff); }
float CigiTrajectoryDefV1::GetZoff | ( | void | ) | const [inline] |
Gets the Zoff value.
Definition at line 191 of file CigiTrajectoryDefV1.h.
00191 { return(Zoff); }
int CigiTrajectoryDefV1::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 CigiBaseTrajectoryDef.
Definition at line 118 of file CigiTrajectoryDefV1.cpp.
References CigiBaseTrajectoryDef::Accel, PackPointerUnion::c, CIGI_SCOPY2, CIGI_SCOPY4, CIGI_TRAJECTORY_DEF_PACKET_SIZE_V1, PackPointerUnion::d, CigiBaseTrajectoryDef::EntityID, PackPointerUnion::f, CigiBasePacket::PacketID, CigiBasePacket::PacketSize, CigiBaseTrajectoryDef::RetardationRate, PackPointerUnion::s, CigiBaseTrajectoryDef::TermVel, CigiBaseTrajectoryDef::Xoff, CigiBaseTrajectoryDef::Yoff, and CigiBaseTrajectoryDef::Zoff.
00119 { 00120 double DBuf[6]; 00121 00122 Cigi_uint8 *tBuf = (Cigi_uint8 *)DBuf; 00123 00124 PackPointer CDta; 00125 00126 CigiBaseTrajectoryDef * Data = ( CigiBaseTrajectoryDef *)Base; 00127 00128 CDta.d = DBuf; 00129 00130 *CDta.c++ = PacketID; 00131 *CDta.c++ = PacketSize; 00132 00133 CIGI_SCOPY2(CDta.s++, &Data->EntityID); 00134 CIGI_SCOPY4(CDta.f++, &Data->Accel); 00135 CIGI_SCOPY4(CDta.f++, &Data->RetardationRate); 00136 CIGI_SCOPY4(CDta.f++, &Data->TermVel); 00137 CIGI_SCOPY4(CDta.f++, &Data->Xoff); 00138 CIGI_SCOPY4(CDta.f++, &Data->Yoff); 00139 CIGI_SCOPY4(CDta.f++, &Data->Zoff); 00140 00141 memcpy(Buff,tBuf,CIGI_TRAJECTORY_DEF_PACKET_SIZE_V1); 00142 00143 return(PacketSize); 00144 00145 }
int CigiTrajectoryDefV1::SetAccel | ( | const float | AccelIn, | |
bool | bndchk = true | |||
) | [inline] |
Sets the Accel with bound checking control
AccelIn | - Acceleration value. | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 115 of file CigiTrajectoryDefV1.h.
References CIGI_SUCCESS.
00116 { 00117 Accel = AccelIn; 00118 AccelZ = Accel; 00119 return(CIGI_SUCCESS); 00120 }
int CigiTrajectoryDefV1::SetXoff | ( | const float | XoffIn, | |
bool | bndchk = true | |||
) | [inline] |
Sets the Xoff with bound checking control
XoffIn | - The offset along the entity's X axis from the entity's reference point from which the trajectory is started. | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 138 of file CigiTrajectoryDefV1.h.
References CIGI_SUCCESS.
00139 { 00140 Xoff = XoffIn; 00141 return(CIGI_SUCCESS); 00142 }
int CigiTrajectoryDefV1::SetYoff | ( | const float | YoffIn, | |
bool | bndchk = true | |||
) | [inline] |
Sets the Yoff with bound checking control
YoffIn | - The offset along the entity's Y axis from the entity's reference point from which the trajectory is started. | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 160 of file CigiTrajectoryDefV1.h.
References CIGI_SUCCESS.
00161 { 00162 Yoff = YoffIn; 00163 return(CIGI_SUCCESS); 00164 }
int CigiTrajectoryDefV1::SetZoff | ( | const float | ZoffIn, | |
bool | bndchk = true | |||
) | [inline] |
Sets the Zoff with bound checking control
ZoffIn | - The offset along the entity's Z axis from the entity's reference point from which the trajectory is started. | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 182 of file CigiTrajectoryDefV1.h.
References CIGI_SUCCESS.
00183 { 00184 Zoff = ZoffIn; 00185 return(CIGI_SUCCESS); 00186 }
int CigiTrajectoryDefV1::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 CigiBaseTrajectoryDef.
Definition at line 150 of file CigiTrajectoryDefV1.cpp.
References CigiBaseTrajectoryDef::Accel, CigiBaseTrajectoryDef::AccelX, CigiBaseTrajectoryDef::AccelY, CigiBaseTrajectoryDef::AccelZ, PackPointerUnion::c, CIGI_SCOPY2, CIGI_SCOPY4, CIGI_TRAJECTORY_DEF_PACKET_SIZE_V1, PackPointerUnion::d, CigiBaseTrajectoryDef::EntityID, PackPointerUnion::f, CigiBasePacket::PacketSize, CigiBaseTrajectoryDef::RetardationRate, PackPointerUnion::s, CigiBaseTrajectoryDef::TermVel, CigiBaseTrajectoryDef::Xoff, CigiBaseTrajectoryDef::Yoff, and CigiBaseTrajectoryDef::Zoff.
00151 { 00152 double DBuf[6]; 00153 00154 Cigi_uint8 *tBuf = (Cigi_uint8 *)DBuf; 00155 00156 PackPointer CDta; 00157 00158 memcpy(tBuf,Buff,CIGI_TRAJECTORY_DEF_PACKET_SIZE_V1); 00159 00160 CDta.d = DBuf; 00161 00162 CDta.c += 2; // Step over packet id and size 00163 00164 CIGI_SCOPY2(&EntityID, CDta.s++); 00165 CIGI_SCOPY4(&Accel, CDta.f++); 00166 CIGI_SCOPY4(&RetardationRate, CDta.f++); 00167 CIGI_SCOPY4(&TermVel, CDta.f++); 00168 CIGI_SCOPY4(&Xoff, CDta.f++); 00169 CIGI_SCOPY4(&Yoff, CDta.f++); 00170 CIGI_SCOPY4(&Zoff, CDta.f++); 00171 00172 AccelX = 0.0f; 00173 AccelY = 0.0f; 00174 AccelZ = Accel; 00175 00176 return(PacketSize); 00177 00178 }