00001
00045 #define _EXPORT_CCL_
00046
00047 #include "CigiBasePositionResp.h"
00048 #include "CigiSwapping.h"
00049 #include "CigiExceptions.h"
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060 CigiBasePositionResp::CigiBasePositionResp()
00061 {
00062
00063 }
00064
00065
00066
00067
00068
00069
00070 CigiBasePositionResp::~CigiBasePositionResp()
00071 {
00072
00073 }
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084 int CigiBasePositionResp::GetCnvt(CigiVersionID &CnvtVersion,
00085 CigiCnvtInfoType::Type &CnvtInfo)
00086 {
00087 if(CnvtVersion.CigiMajorVersion < 3)
00088 {
00089 CnvtInfo.ProcID = CigiProcessType::ProcNone;
00090 CnvtInfo.CnvtPacketID = 0;
00091 }
00092 else
00093 {
00094 CnvtInfo.ProcID = CigiProcessType::ProcStd;
00095 CnvtInfo.CnvtPacketID = CIGI_POSITION_RESP_PACKET_ID_V3;
00096 }
00097
00098 return(CIGI_SUCCESS);
00099 }
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110 int CigiBasePositionResp::SetObjectClass(const ObjectClassGrp ObjectClassIn, bool bndchk)
00111 {
00112
00113 #ifndef CIGI_NO_BND_CHK
00114 if(bndchk && ((ObjectClassIn < 0)||(ObjectClassIn > 4)))
00115 {
00116 #ifndef CIGI_NO_EXCEPT
00117 throw CigiValueOutOfRangeException("ObjectClass",(ObjectClassGrp)ObjectClassIn,0,4);
00118 #endif
00119 return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00120 }
00121 #endif
00122
00123 ObjectClass = ObjectClassIn;
00124 return(CIGI_SUCCESS);
00125
00126 }
00127
00128
00129
00130
00131
00132 int CigiBasePositionResp::SetCoordSys(const CoordSysGrp CoordSysIn, bool bndchk)
00133 {
00134
00135 #ifndef CIGI_NO_BND_CHK
00136 if(bndchk && ((CoordSysIn < 0)||(CoordSysIn > 2)))
00137 {
00138 #ifndef CIGI_NO_EXCEPT
00139 throw CigiValueOutOfRangeException("CoordSys",(CoordSysGrp)CoordSysIn,0,2);
00140 #endif
00141 return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00142 }
00143 #endif
00144
00145 CoordSys = CoordSysIn;
00146 return(CIGI_SUCCESS);
00147
00148 }
00149
00150
00151
00152
00153
00154 int CigiBasePositionResp::SetRoll(const float RollIn, bool bndchk)
00155 {
00156
00157 #ifndef CIGI_NO_BND_CHK
00158 if(bndchk && ((RollIn < -180.0)||(RollIn > 180.0)))
00159 {
00160 #ifndef CIGI_NO_EXCEPT
00161 throw CigiValueOutOfRangeException("Roll",(float)RollIn,-180.0,180.0);
00162 #endif
00163 return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00164 }
00165 #endif
00166
00167 Roll = RollIn;
00168 return(CIGI_SUCCESS);
00169
00170 }
00171
00172
00173
00174
00175
00176 int CigiBasePositionResp::SetPitch(const float PitchIn, bool bndchk)
00177 {
00178
00179 #ifndef CIGI_NO_BND_CHK
00180 if(bndchk && ((PitchIn < -90.0)||(PitchIn > 90.0)))
00181 {
00182 #ifndef CIGI_NO_EXCEPT
00183 throw CigiValueOutOfRangeException("Pitch",(float)PitchIn,-90.0,90.0);
00184 #endif
00185 return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00186 }
00187 #endif
00188
00189 Pitch = PitchIn;
00190 return(CIGI_SUCCESS);
00191
00192 }
00193
00194
00195
00196
00197
00198 int CigiBasePositionResp::SetYaw(const float YawIn, bool bndchk)
00199 {
00200
00201 #ifndef CIGI_NO_BND_CHK
00202 if(bndchk && ((YawIn < 0.0)||(YawIn > 360.0)))
00203 {
00204 #ifndef CIGI_NO_EXCEPT
00205 throw CigiValueOutOfRangeException("Yaw",(float)YawIn,0.0,360.0);
00206 #endif
00207 return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00208 }
00209 #endif
00210
00211 Yaw = YawIn;
00212 return(CIGI_SUCCESS);
00213
00214 }
00215
00216