#include <CigiViewDefV2.h>
Inheritance diagram for CigiViewDefV2:
Public Member Functions | |
CigiViewDefV2 () | |
virtual | ~CigiViewDefV2 () |
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_uint8 ViewIDIn, bool bndchk=true) |
Cigi_uint8 | GetViewID (void) const |
int | SetGroupID (const Cigi_uint8 GroupIDIn, bool bndchk=true) |
Cigi_uint8 | GetGroupID (void) const |
int | SetFOVNearEn (const bool FOVNearEnIn, bool bndchk=true) |
bool | GetFOVNearEn (void) const |
int | SetFOVFarEn (const bool FOVFarEnIn, bool bndchk=true) |
bool | GetFOVFarEn (void) const |
int | SetFOVLeftEn (const bool FOVLeftEnIn, bool bndchk=true) |
bool | GetFOVLeftEn (void) const |
int | SetFOVRightEn (const bool FOVRightEnIn, bool bndchk=true) |
bool | GetFOVRightEn (void) const |
int | SetFOVTopEn (const bool FOVTopEnIn, bool bndchk=true) |
bool | GetFOVTopEn (void) const |
int | SetFOVBottomEn (const bool FOVBottomEnIn, bool bndchk=true) |
bool | GetFOVBottomEn (void) const |
int | SetTrackerAssigned (const bool TrackerAssignedIn, bool bndchk=true) |
bool | GetTrackerAssigned (void) const |
Definition at line 67 of file CigiViewDefV2.h.
CigiViewDefV2::CigiViewDefV2 | ( | ) |
General Constructor
Definition at line 83 of file CigiViewDefV2.cpp.
References CIGI_VIEW_DEF_PACKET_ID_V2, CIGI_VIEW_DEF_PACKET_SIZE_V2, CigiBaseViewDef::FOVBottom, CigiBaseViewDef::FOVBottomEn, CigiBaseViewDef::FOVFar, CigiBaseViewDef::FOVFarEn, CigiBaseViewDef::FOVLeft, CigiBaseViewDef::FOVLeftEn, CigiBaseViewDef::FOVNear, CigiBaseViewDef::FOVNearEn, CigiBaseViewDef::FOVRight, CigiBaseViewDef::FOVRightEn, CigiBaseViewDef::FOVTop, CigiBaseViewDef::FOVTopEn, CigiBaseViewDef::GroupID, CigiBasePacket::MinorVersion, CigiBaseViewDef::MirrorMode, CigiBaseViewDef::MirrorNone, CigiBasePacket::PacketID, CigiBasePacket::PacketSize, CigiBaseViewDef::Perspective, CigiBaseViewDef::PixelReplicateMode, CigiBaseViewDef::ProjectionType, CigiBaseViewDef::Reorder, CigiBaseViewDef::ReplicateNone, CigiBaseViewDef::TrackerAssigned, CigiBasePacket::Version, CigiBaseViewDef::ViewID, and CigiBaseViewDef::ViewType.
00084 { 00085 00086 PacketID = CIGI_VIEW_DEF_PACKET_ID_V2; 00087 PacketSize = CIGI_VIEW_DEF_PACKET_SIZE_V2; 00088 Version = 2; 00089 MinorVersion = 0; 00090 00091 ViewID = 0; 00092 GroupID = 0; 00093 FOVNearEn = false; 00094 FOVFarEn = false; 00095 FOVLeftEn = false; 00096 FOVRightEn = false; 00097 FOVTopEn = false; 00098 FOVBottomEn = false; 00099 MirrorMode = MirrorNone; 00100 PixelReplicateMode = ReplicateNone; 00101 ProjectionType = Perspective; 00102 Reorder = false; 00103 ViewType = 0; 00104 TrackerAssigned = false; 00105 FOVNear = 0.0; 00106 FOVFar = 0.0; 00107 FOVLeft = 0.0; 00108 FOVRight = 0.0; 00109 FOVTop = 0.0; 00110 FOVBottom = 0.0; 00111 00112 }
CigiViewDefV2::~CigiViewDefV2 | ( | ) | [virtual] |
bool CigiViewDefV2::GetFOVBottomEn | ( | void | ) | const [inline] |
Gets the FOVBottomEn value.
Definition at line 284 of file CigiViewDefV2.h.
00284 { return(FOVBottomEn); }
bool CigiViewDefV2::GetFOVFarEn | ( | void | ) | const [inline] |
Gets the FOVFarEn value.
Definition at line 196 of file CigiViewDefV2.h.
00196 { return(FOVFarEn); }
bool CigiViewDefV2::GetFOVLeftEn | ( | void | ) | const [inline] |
Gets the FOVLeftEn value.
Definition at line 218 of file CigiViewDefV2.h.
00218 { return(FOVLeftEn); }
bool CigiViewDefV2::GetFOVNearEn | ( | void | ) | const [inline] |
Gets the FOVNearEn value.
Definition at line 174 of file CigiViewDefV2.h.
00174 { return(FOVNearEn); }
bool CigiViewDefV2::GetFOVRightEn | ( | void | ) | const [inline] |
Gets the FOVRightEn value.
Definition at line 240 of file CigiViewDefV2.h.
00240 { return(FOVRightEn); }
bool CigiViewDefV2::GetFOVTopEn | ( | void | ) | const [inline] |
Gets the FOVTopEn value.
Definition at line 262 of file CigiViewDefV2.h.
00262 { return(FOVTopEn); }
Cigi_uint8 CigiViewDefV2::GetGroupID | ( | void | ) | const [inline] |
Gets the GroupID value.
Definition at line 152 of file CigiViewDefV2.h.
00152 { return(GroupID); }
bool CigiViewDefV2::GetTrackerAssigned | ( | void | ) | const [inline] |
Gets the TrackerAssigned value.
Definition at line 306 of file CigiViewDefV2.h.
00306 { return(TrackerAssigned); }
Cigi_uint8 CigiViewDefV2::GetViewID | ( | void | ) | const [inline] |
Gets the ViewID value.
Definition at line 130 of file CigiViewDefV2.h.
00131 { 00132 if(ViewID < 31) 00133 return((Cigi_uint8)ViewID); 00134 else 00135 return((Cigi_uint8)0x1f); 00136 }
int CigiViewDefV2::Pack | ( | CigiBasePacket * | Base, | |
Cigi_uint8 * | Buff, | |||
void * | Spec | |||
) | const [virtual] |
The virtual Pack function for CIGI 2
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 CigiBaseViewDef.
Definition at line 129 of file CigiViewDefV2.cpp.
References PackPointerUnion::c, CIGI_SCOPY4, CIGI_VIEW_DEF_PACKET_SIZE_V2, PackPointerUnion::d, PackPointerUnion::f, CigiBaseViewDef::FOVBottom, CigiBaseViewDef::FOVBottomEn, CigiBaseViewDef::FOVFar, CigiBaseViewDef::FOVFarEn, CigiBaseViewDef::FOVLeft, CigiBaseViewDef::FOVLeftEn, CigiBaseViewDef::FOVNear, CigiBaseViewDef::FOVNearEn, CigiBaseViewDef::FOVRight, CigiBaseViewDef::FOVRightEn, CigiBaseViewDef::FOVTop, CigiBaseViewDef::FOVTopEn, CigiBaseViewDef::GroupID, CigiBaseViewDef::MirrorMode, CigiBasePacket::PacketID, CigiBasePacket::PacketSize, CigiBaseViewDef::PixelReplicateMode, CigiBaseViewDef::TrackerAssigned, CigiBaseViewDef::ViewID, and CigiBaseViewDef::ViewType.
00130 { 00131 double DBuf[6]; 00132 00133 Cigi_uint8 *tBuf = (Cigi_uint8 *)DBuf; 00134 00135 PackPointer CDta; 00136 00137 CigiBaseViewDef * Data = ( CigiBaseViewDef *)Base; 00138 00139 CDta.d = DBuf; 00140 00141 *CDta.c++ = PacketID; 00142 *CDta.c++ = PacketSize; 00143 00144 Cigi_uint8 HDta = 0; 00145 if(Data->ViewID < 32) 00146 HDta = (Cigi_uint8)(Data->ViewID << 3); 00147 else 00148 HDta = (Cigi_uint8)0xf8; 00149 00150 if(Data->GroupID < 8) 00151 HDta |= (Cigi_uint8)Data->GroupID; 00152 else 00153 HDta |= 7; 00154 00155 *CDta.c++ = HDta; 00156 00157 HDta = (Data->ViewType << 5) & 0xe0; 00158 HDta |= (Cigi_uint8)((Data->PixelReplicateMode << 2) & 0x1c); 00159 HDta |= (Cigi_uint8)(Data->MirrorMode & 0x03); 00160 00161 *CDta.c++ = HDta; 00162 00163 HDta = (Data->TrackerAssigned) ? 0x80 : 0; 00164 00165 if(Data->FOVNearEn) 00166 HDta |= 0x40; 00167 00168 if(Data->FOVFarEn) 00169 HDta |= 0x20; 00170 00171 if(Data->FOVLeftEn) 00172 HDta |= 0x10; 00173 00174 if(Data->FOVRightEn) 00175 HDta |= 0x08; 00176 00177 if(Data->FOVTopEn) 00178 HDta |= 0x04; 00179 00180 if(Data->FOVBottomEn) 00181 HDta |= 0x02; 00182 00183 *CDta.c++ = HDta; 00184 *CDta.c++ = 0; 00185 *CDta.c++ = 0; 00186 *CDta.c++ = 0; 00187 00188 CIGI_SCOPY4(CDta.f++, &Data->FOVNear); 00189 CIGI_SCOPY4(CDta.f++, &Data->FOVFar); 00190 CIGI_SCOPY4(CDta.f++, &Data->FOVLeft); 00191 CIGI_SCOPY4(CDta.f++, &Data->FOVRight); 00192 CIGI_SCOPY4(CDta.f++, &Data->FOVTop); 00193 CIGI_SCOPY4(CDta.f++, &Data->FOVBottom); 00194 00195 memcpy(Buff,tBuf,CIGI_VIEW_DEF_PACKET_SIZE_V2); 00196 00197 return(PacketSize); 00198 00199 }
int CigiViewDefV2::SetFOVBottomEn | ( | const bool | FOVBottomEnIn, | |
bool | bndchk = true | |||
) | [inline] |
Sets the FOVBottomEn with bound checking control
FOVBottomEnIn | - States the validity of the FOVBottom parameter true - valid data : false - data is not valid | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 275 of file CigiViewDefV2.h.
References CIGI_SUCCESS.
00276 { 00277 FOVBottomEn = FOVBottomEnIn; 00278 return(CIGI_SUCCESS); 00279 }
int CigiViewDefV2::SetFOVFarEn | ( | const bool | FOVFarEnIn, | |
bool | bndchk = true | |||
) | [inline] |
Sets the FOVFarEn with bound checking control
FOVFarEnIn | - States the validity of the FOVFar parameter true - valid data : false - data is not valid | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 187 of file CigiViewDefV2.h.
References CIGI_SUCCESS.
00188 { 00189 FOVFarEn = FOVFarEnIn; 00190 return(CIGI_SUCCESS); 00191 }
int CigiViewDefV2::SetFOVLeftEn | ( | const bool | FOVLeftEnIn, | |
bool | bndchk = true | |||
) | [inline] |
Sets the FOVLeftEn with bound checking control
FOVLeftEnIn | - States the validity of the FOVLeftEn parameter true - valid data : false - data is not valid | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 209 of file CigiViewDefV2.h.
References CIGI_SUCCESS.
00210 { 00211 FOVLeftEn = FOVLeftEnIn; 00212 return(CIGI_SUCCESS); 00213 }
int CigiViewDefV2::SetFOVNearEn | ( | const bool | FOVNearEnIn, | |
bool | bndchk = true | |||
) | [inline] |
Sets the FOVNearEn with bound checking control
FOVNearEnIn | - States the validity of the FOVNear parameter true - valid data : false - data is not valid | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 165 of file CigiViewDefV2.h.
References CIGI_SUCCESS.
00166 { 00167 FOVNearEn = FOVNearEnIn; 00168 return(CIGI_SUCCESS); 00169 }
int CigiViewDefV2::SetFOVRightEn | ( | const bool | FOVRightEnIn, | |
bool | bndchk = true | |||
) | [inline] |
Sets the FOVRightEn with bound checking control
FOVRightEnIn | - States the validity of the FOVRight parameter true - valid data : false - data is not valid | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 231 of file CigiViewDefV2.h.
References CIGI_SUCCESS.
00232 { 00233 FOVRightEn = FOVRightEnIn; 00234 return(CIGI_SUCCESS); 00235 }
int CigiViewDefV2::SetFOVTopEn | ( | const bool | FOVTopEnIn, | |
bool | bndchk = true | |||
) | [inline] |
Sets the FOVTopEn with bound checking control
FOVTopEnIn | - States the validity of the FOVTop parameter true - valid data : false - data is not valid | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 253 of file CigiViewDefV2.h.
References CIGI_SUCCESS.
00254 { 00255 FOVTopEn = FOVTopEnIn; 00256 return(CIGI_SUCCESS); 00257 }
int CigiViewDefV2::SetGroupID | ( | const Cigi_uint8 | GroupIDIn, | |
bool | bndchk = true | |||
) |
Sets the GroupID with bound checking control
GroupIDIn | - The group in which this view is place. | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 285 of file CigiViewDefV2.cpp.
References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseViewDef::GroupID.
00286 { 00287 00288 #ifndef CIGI_NO_BND_CHK 00289 if(bndchk && ((GroupIDIn < 0)||(GroupIDIn > 7))) 00290 { 00291 #ifndef CIGI_NO_EXCEPT 00292 throw CigiValueOutOfRangeException("GroupID",(Cigi_uint16)GroupIDIn,0,7); 00293 #endif 00294 return(CIGI_ERROR_VALUE_OUT_OF_RANGE); 00295 } 00296 #endif 00297 00298 GroupID = GroupIDIn; 00299 return(CIGI_SUCCESS); 00300 00301 }
int CigiViewDefV2::SetTrackerAssigned | ( | const bool | TrackerAssignedIn, | |
bool | bndchk = true | |||
) | [inline] |
Sets the TrackerAssigned with bound checking control
TrackerAssignedIn | - Specifies if there is a tracker assigned to this view. | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 297 of file CigiViewDefV2.h.
References CIGI_SUCCESS.
00298 { 00299 TrackerAssigned = TrackerAssignedIn; 00300 return(CIGI_SUCCESS); 00301 }
int CigiViewDefV2::SetViewID | ( | const Cigi_uint8 | ViewIDIn, | |
bool | bndchk = true | |||
) |
Sets the ViewID with bound checking control
ViewIDIn | - The View this packet to which this packet is applied. | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 263 of file CigiViewDefV2.cpp.
References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseViewDef::ViewID.
00264 { 00265 00266 #ifndef CIGI_NO_BND_CHK 00267 if(bndchk && ((ViewIDIn < 0)||(ViewIDIn > 31))) 00268 { 00269 #ifndef CIGI_NO_EXCEPT 00270 throw CigiValueOutOfRangeException("ViewID",(Cigi_uint16)ViewIDIn,0,31); 00271 #endif 00272 return(CIGI_ERROR_VALUE_OUT_OF_RANGE); 00273 } 00274 #endif 00275 00276 ViewID = (Cigi_uint16)ViewIDIn; 00277 return(CIGI_SUCCESS); 00278 00279 }
int CigiViewDefV2::Unpack | ( | Cigi_uint8 * | Buff, | |
bool | Swap, | |||
void * | Spec | |||
) | [virtual] |
The virtual Unpack function for CIGI 2
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 CigiBaseViewDef.
Definition at line 204 of file CigiViewDefV2.cpp.
References PackPointerUnion::c, CIGI_SCOPY4, CIGI_VIEW_DEF_PACKET_SIZE_V2, PackPointerUnion::d, PackPointerUnion::f, CigiBaseViewDef::FOVBottom, CigiBaseViewDef::FOVBottomEn, CigiBaseViewDef::FOVFar, CigiBaseViewDef::FOVFarEn, CigiBaseViewDef::FOVLeft, CigiBaseViewDef::FOVLeftEn, CigiBaseViewDef::FOVNear, CigiBaseViewDef::FOVNearEn, CigiBaseViewDef::FOVRight, CigiBaseViewDef::FOVRightEn, CigiBaseViewDef::FOVTop, CigiBaseViewDef::FOVTopEn, CigiBaseViewDef::GroupID, CigiBaseViewDef::MirrorMode, CigiBasePacket::PacketSize, CigiBaseViewDef::PixelReplicateMode, CigiBaseViewDef::TrackerAssigned, CigiBaseViewDef::ViewID, and CigiBaseViewDef::ViewType.
00205 { 00206 double DBuf[6]; 00207 00208 Cigi_uint8 *tBuf = (Cigi_uint8 *)DBuf; 00209 00210 PackPointer CDta; 00211 00212 memcpy(tBuf,Buff,CIGI_VIEW_DEF_PACKET_SIZE_V2); 00213 00214 CDta.d = DBuf; 00215 00216 CDta.c += 2; // Step over packet id and size 00217 00218 Cigi_uint8 HDta = *CDta.c++; 00219 00220 ViewID = (Cigi_uint8)((HDta >> 3) & 0x1f); 00221 GroupID = (Cigi_uint8)(HDta & 0x07); 00222 00223 HDta = *CDta.c++; 00224 00225 ViewType = (Cigi_uint8)((HDta >> 5) & 0x07); 00226 PixelReplicateMode = (PixelReplicateModeGrp)((HDta >> 2) & 0x07); 00227 MirrorMode = (MirrorModeGrp)(HDta & 0x03); 00228 00229 HDta = *CDta.c++; 00230 00231 TrackerAssigned = ((HDta & 0x80) != 0); 00232 FOVNearEn = ((HDta & 0x40) != 0); 00233 FOVFarEn = ((HDta & 0x20) != 0); 00234 FOVLeftEn = ((HDta & 0x10) != 0); 00235 FOVRightEn = ((HDta & 0x08) != 0); 00236 FOVTopEn = ((HDta & 0x04) != 0); 00237 FOVBottomEn = ((HDta & 0x02) != 0); 00238 00239 CDta.c += 3; 00240 00241 CIGI_SCOPY4(&FOVNear, CDta.f++); 00242 CIGI_SCOPY4(&FOVFar, CDta.f++); 00243 CIGI_SCOPY4(&FOVLeft, CDta.f++); 00244 CIGI_SCOPY4(&FOVRight, CDta.f++); 00245 CIGI_SCOPY4(&FOVTop, CDta.f++); 00246 CIGI_SCOPY4(&FOVBottom, CDta.f++); 00247 00248 return(PacketSize); 00249 00250 00251 }