#include <CigiViewDefV3.h>
Inheritance diagram for CigiViewDefV3:
Public Member Functions | |
CigiViewDefV3 () | |
virtual | ~CigiViewDefV3 () |
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 | 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 | SetProjectionType (const ProjectionTypeGrp ProjectionTypeIn, bool bndchk=true) |
ProjectionTypeGrp | GetProjectionType (void) const |
int | SetReorder (const bool ReorderIn, bool bndchk=true) |
bool | GetReorder (void) const |
Definition at line 61 of file CigiViewDefV3.h.
CigiViewDefV3::CigiViewDefV3 | ( | ) |
General Constructor
Definition at line 67 of file CigiViewDefV3.cpp.
References CIGI_VIEW_DEF_PACKET_ID_V3, CIGI_VIEW_DEF_PACKET_SIZE_V3, 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.
00068 { 00069 00070 PacketID = CIGI_VIEW_DEF_PACKET_ID_V3; 00071 PacketSize = CIGI_VIEW_DEF_PACKET_SIZE_V3; 00072 Version = 3; 00073 MinorVersion = 0; 00074 00075 ViewID = 0; 00076 GroupID = 0; 00077 FOVNearEn = false; 00078 FOVFarEn = false; 00079 FOVLeftEn = false; 00080 FOVRightEn = false; 00081 FOVTopEn = false; 00082 FOVBottomEn = false; 00083 MirrorMode = MirrorNone; 00084 PixelReplicateMode = ReplicateNone; 00085 ProjectionType = Perspective; 00086 Reorder = false; 00087 ViewType = 0; 00088 TrackerAssigned = false; 00089 FOVNear = 0.0; 00090 FOVFar = 0.0; 00091 FOVLeft = 0.0; 00092 FOVRight = 0.0; 00093 FOVTop = 0.0; 00094 FOVBottom = 0.0; 00095 00096 }
CigiViewDefV3::~CigiViewDefV3 | ( | ) | [virtual] |
bool CigiViewDefV3::GetFOVBottomEn | ( | void | ) | const [inline] |
Gets the FOVBottomEn value.
Definition at line 281 of file CigiViewDefV3.h.
00281 { return(FOVBottomEn); }
bool CigiViewDefV3::GetFOVFarEn | ( | void | ) | const [inline] |
Gets the FOVFarEn value.
Definition at line 193 of file CigiViewDefV3.h.
00193 { return(FOVFarEn); }
bool CigiViewDefV3::GetFOVLeftEn | ( | void | ) | const [inline] |
Gets the FOVLeftEn value.
Definition at line 215 of file CigiViewDefV3.h.
00215 { return(FOVLeftEn); }
bool CigiViewDefV3::GetFOVNearEn | ( | void | ) | const [inline] |
Gets the FOVNearEn value.
Definition at line 171 of file CigiViewDefV3.h.
00171 { return(FOVNearEn); }
bool CigiViewDefV3::GetFOVRightEn | ( | void | ) | const [inline] |
Gets the FOVRightEn value.
Definition at line 237 of file CigiViewDefV3.h.
00237 { return(FOVRightEn); }
bool CigiViewDefV3::GetFOVTopEn | ( | void | ) | const [inline] |
Gets the FOVTopEn value.
Definition at line 259 of file CigiViewDefV3.h.
00259 { return(FOVTopEn); }
Cigi_uint8 CigiViewDefV3::GetGroupID | ( | void | ) | const [inline] |
Gets the GroupID value.
Definition at line 149 of file CigiViewDefV3.h.
00149 { return(GroupID); }
ProjectionTypeGrp CigiViewDefV3::GetProjectionType | ( | void | ) | const [inline] |
Gets the ProjectionType value.
Definition at line 300 of file CigiViewDefV3.h.
00300 { return(ProjectionType); }
bool CigiViewDefV3::GetReorder | ( | void | ) | const [inline] |
Gets the Reorder value.
Definition at line 322 of file CigiViewDefV3.h.
00322 { return(Reorder); }
Cigi_uint16 CigiViewDefV3::GetViewID | ( | void | ) | const [inline] |
Gets the ViewID value.
Definition at line 128 of file CigiViewDefV3.h.
00128 { return(ViewID); }
int CigiViewDefV3::Pack | ( | CigiBasePacket * | Base, | |
Cigi_uint8 * | Buff, | |||
void * | Spec | |||
) | const [virtual] |
The virtual Pack function for CIGI 3
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 113 of file CigiViewDefV3.cpp.
References PackPointerUnion::c, CIGI_VIEW_DEF_PACKET_SIZE_V3, 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, CigiBaseViewDef::Orthographic, CigiBasePacket::PacketID, CigiBasePacket::PacketSize, CigiBaseViewDef::PixelReplicateMode, CigiBaseViewDef::ProjectionType, CigiBaseViewDef::Reorder, PackPointerUnion::s, CigiBaseViewDef::ViewID, and CigiBaseViewDef::ViewType.
00114 { 00115 PackPointer CDta; 00116 00117 CigiBaseViewDef * Data = ( CigiBaseViewDef *)Base; 00118 00119 CDta.c = Buff; 00120 00121 *CDta.c++ = PacketID; 00122 *CDta.c++ = PacketSize; 00123 00124 *CDta.s++ = Data->ViewID; 00125 *CDta.c++ = Data->GroupID; 00126 00127 Cigi_uint8 HDta = (Cigi_uint8)((Data->MirrorMode << 6) & 0xc0); 00128 00129 if(Data->FOVBottomEn) 00130 HDta |= 0x20; 00131 00132 if(Data->FOVTopEn) 00133 HDta |= 0x10; 00134 00135 if(Data->FOVRightEn) 00136 HDta |= 0x08; 00137 00138 if(Data->FOVLeftEn) 00139 HDta |= 0x04; 00140 00141 if(Data->FOVFarEn) 00142 HDta |= 0x02; 00143 00144 if(Data->FOVNearEn) 00145 HDta |= 0x01; 00146 00147 *CDta.c++ = HDta; 00148 00149 HDta = (Cigi_uint8)((Data->ViewType << 5) & 0xe0); 00150 00151 if(Data->Reorder) 00152 HDta |= 0x10; 00153 00154 if(Data->ProjectionType == Orthographic) 00155 HDta |= 0x08; 00156 00157 HDta |= (Cigi_uint8)(Data->PixelReplicateMode & 0x07); 00158 00159 *CDta.c++ = HDta; 00160 *CDta.c++ = 0; 00161 00162 *CDta.f++ = Data->FOVNear; 00163 *CDta.f++ = Data->FOVFar; 00164 *CDta.f++ = Data->FOVLeft; 00165 *CDta.f++ = Data->FOVRight; 00166 *CDta.f++ = Data->FOVTop; 00167 *CDta.f++ = Data->FOVBottom; 00168 00169 return(CIGI_VIEW_DEF_PACKET_SIZE_V3); 00170 00171 }
int CigiViewDefV3::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 272 of file CigiViewDefV3.h.
References CIGI_SUCCESS.
00273 { 00274 FOVBottomEn = FOVBottomEnIn; 00275 return(CIGI_SUCCESS); 00276 }
int CigiViewDefV3::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 184 of file CigiViewDefV3.h.
References CIGI_SUCCESS.
00185 { 00186 FOVFarEn = FOVFarEnIn; 00187 return(CIGI_SUCCESS); 00188 }
int CigiViewDefV3::SetFOVLeftEn | ( | const bool | FOVLeftEnIn, | |
bool | bndchk = true | |||
) | [inline] |
Sets the FOVLeftEn with bound checking control
FOVLeftEnIn | - States the validity of the FOVLeft parameter true - valid data : false - data is not valid | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 206 of file CigiViewDefV3.h.
References CIGI_SUCCESS.
00207 { 00208 FOVLeftEn = FOVLeftEnIn; 00209 return(CIGI_SUCCESS); 00210 }
int CigiViewDefV3::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 162 of file CigiViewDefV3.h.
References CIGI_SUCCESS.
00163 { 00164 FOVNearEn = FOVNearEnIn; 00165 return(CIGI_SUCCESS); 00166 }
int CigiViewDefV3::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 228 of file CigiViewDefV3.h.
References CIGI_SUCCESS.
00229 { 00230 FOVRightEn = FOVRightEnIn; 00231 return(CIGI_SUCCESS); 00232 }
int CigiViewDefV3::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 250 of file CigiViewDefV3.h.
References CIGI_SUCCESS.
00251 { 00252 FOVTopEn = FOVTopEnIn; 00253 return(CIGI_SUCCESS); 00254 }
int CigiViewDefV3::SetGroupID | ( | const Cigi_uint8 | GroupIDIn, | |
bool | bndchk = true | |||
) | [inline] |
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 140 of file CigiViewDefV3.h.
References CIGI_SUCCESS.
00141 { 00142 GroupID = GroupIDIn; 00143 return(CIGI_SUCCESS); 00144 }
int CigiViewDefV3::SetProjectionType | ( | const ProjectionTypeGrp | ProjectionTypeIn, | |
bool | bndchk = true | |||
) |
Sets the ProjectionType with bound checking control
ProjectionTypeIn | - The projection type (OpenGL compatible) Perspective=0 Orthographic=1 | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 245 of file CigiViewDefV3.cpp.
References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseViewDef::ProjectionType.
00246 { 00247 00248 #ifndef CIGI_NO_BND_CHK 00249 if(bndchk && ((ProjectionType < 0)||(ProjectionType > 1))) 00250 { 00251 #ifndef CIGI_NO_EXCEPT 00252 throw CigiValueOutOfRangeException("ProjectionType",(ProjectionTypeGrp)ProjectionTypeIn,0,1); 00253 #endif 00254 return(CIGI_ERROR_VALUE_OUT_OF_RANGE); 00255 } 00256 #endif 00257 00258 ProjectionType = ProjectionTypeIn; 00259 return(CIGI_SUCCESS); 00260 00261 }
int CigiViewDefV3::SetReorder | ( | const bool | ReorderIn, | |
bool | bndchk = true | |||
) | [inline] |
Sets the Reorder with bound checking control
ReorderIn | - Specifies whether the views should be reordered false - No Reordering : true - bring to front | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 313 of file CigiViewDefV3.h.
References CIGI_SUCCESS.
00314 { 00315 Reorder = ReorderIn; 00316 return(CIGI_SUCCESS); 00317 }
int CigiViewDefV3::SetViewID | ( | const Cigi_uint16 | ViewIDIn, | |
bool | bndchk = true | |||
) | [inline] |
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 119 of file CigiViewDefV3.h.
References CIGI_SUCCESS.
00120 { 00121 ViewID = ViewIDIn; 00122 return(CIGI_SUCCESS); 00123 }
int CigiViewDefV3::Unpack | ( | Cigi_uint8 * | Buff, | |
bool | Swap, | |||
void * | Spec | |||
) | [virtual] |
The virtual Unpack function for CIGI 3
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 176 of file CigiViewDefV3.cpp.
References PackPointerUnion::c, CIGI_VIEW_DEF_PACKET_SIZE_V3, CigiSwap2(), CigiSwap4(), 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, CigiBaseViewDef::PixelReplicateMode, CigiBaseViewDef::ProjectionType, CigiBaseViewDef::Reorder, PackPointerUnion::s, CigiBaseViewDef::ViewID, and CigiBaseViewDef::ViewType.
00177 { 00178 PackPointer CDta; 00179 00180 CDta.c = Buff; 00181 00182 CDta.c += 2; // Skip over packet id and size; 00183 00184 00185 if(!Swap) 00186 ViewID = *CDta.s++; 00187 else 00188 CigiSwap2(&ViewID, CDta.s++); 00189 00190 GroupID = *CDta.c++; 00191 00192 Cigi_uint8 HDta = *CDta.c++; 00193 00194 MirrorMode = (MirrorModeGrp)((HDta >> 6) & 0x03); 00195 FOVBottomEn = ((HDta & 0x20) != 0); 00196 FOVTopEn = ((HDta & 0x10) != 0); 00197 FOVRightEn = ((HDta & 0x08) != 0); 00198 FOVLeftEn = ((HDta & 0x04) != 0); 00199 FOVFarEn = ((HDta & 0x02) != 0); 00200 FOVNearEn = ((HDta & 0x01) != 0); 00201 00202 HDta = *CDta.c++; 00203 00204 ViewType = (HDta >> 5) & 0x07; 00205 Reorder = ((HDta & 0x10) != 0); 00206 ProjectionType = (ProjectionTypeGrp)((HDta >> 3) & 0x01); 00207 PixelReplicateMode = (PixelReplicateModeGrp)(HDta & 0x07); 00208 00209 CDta.c++; 00210 00211 if(!Swap) 00212 { 00213 FOVNear = *CDta.f++; 00214 FOVFar = *CDta.f++; 00215 FOVLeft = *CDta.f++; 00216 FOVRight = *CDta.f++; 00217 FOVTop = *CDta.f++; 00218 FOVBottom = *CDta.f++; 00219 } 00220 else 00221 { 00222 CigiSwap4(&FOVNear, CDta.f++); 00223 CigiSwap4(&FOVFar, CDta.f++); 00224 CigiSwap4(&FOVLeft, CDta.f++); 00225 CigiSwap4(&FOVRight, CDta.f++); 00226 CigiSwap4(&FOVTop, CDta.f++); 00227 CigiSwap4(&FOVBottom, CDta.f++); 00228 } 00229 00230 return(CIGI_VIEW_DEF_PACKET_SIZE_V3); 00231 00232 00233 }