00001
00047 #define _EXPORT_CCL_
00048
00049 #include "CigiBaseEntityCtrl.h"
00050 #include "CigiExceptions.h"
00051
00052
00053 const CigiBaseEntityCtrl::AnimationStateGrp CigiBaseEntityCtrl::ToV1[10] =
00054 {
00055 DeactivateUnload,
00056 Deactivate,
00057 LoadActivate,
00058 Continue,
00059 NoAction,
00060 Load,
00061 LoadActivate,
00062 Activate,
00063 Deactivate,
00064 DeactivateUnload
00065 };
00066
00067 const CigiBaseEntityCtrl::AnimationStateGrp CigiBaseEntityCtrl::ToV3[10] =
00068 {
00069 Stop,
00070 Pause,
00071 Play,
00072 Continue,
00073 NoAction,
00074 Stop,
00075 Play,
00076 Play,
00077 Pause,
00078 Stop
00079 };
00080
00081
00082
00083
00084
00085
00086
00087
00088 CigiBaseEntityCtrl::CigiBaseEntityCtrl()
00089 {
00090
00091 }
00092
00093
00094
00095
00096 CigiBaseEntityCtrl::~CigiBaseEntityCtrl()
00097 {
00098
00099 }
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110 int CigiBaseEntityCtrl::GetCnvt(CigiVersionID &CnvtVersion,
00111 CigiCnvtInfoType::Type &CnvtInfo)
00112 {
00113 CnvtInfo.ProcID = CigiProcessType::ProcEntity;
00114
00115
00116 CnvtInfo.CnvtPacketID = CIGI_ENTITY_CTRL_PACKET_ID_V3;
00117
00118 return(CIGI_SUCCESS);
00119 }
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129 int CigiBaseEntityCtrl::SetPitch(const float PitchIn, bool bndchk)
00130 {
00131
00132 #ifndef CIGI_NO_BND_CHK
00133 if(bndchk && ((PitchIn < -90.0f)||(PitchIn > 90.0f)))
00134 {
00135 #ifndef CIGI_NO_EXCEPT
00136 throw CigiValueOutOfRangeException("Pitch",(double)PitchIn,-90.0,90.0);
00137 #endif
00138 return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00139 }
00140 #endif
00141
00142 Pitch = PitchIn;
00143
00144 return(CIGI_SUCCESS);
00145
00146 }
00147
00148
00149
00150
00151 int CigiBaseEntityCtrl::SetRoll(const float RollIn, bool bndchk)
00152 {
00153
00154 #ifndef CIGI_NO_BND_CHK
00155 if(bndchk && ((RollIn < -180.0f)||(RollIn > 180.0f)))
00156 {
00157 #ifndef CIGI_NO_EXCEPT
00158 throw CigiValueOutOfRangeException("Roll",(double)RollIn,-180.0,180.0);
00159 #endif
00160 return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00161 }
00162 #endif
00163
00164 Roll = RollIn;
00165
00166 return(CIGI_SUCCESS);
00167
00168 }
00169
00170
00171
00172
00173 int CigiBaseEntityCtrl::SetLat(const double Lat, bool bndchk)
00174 {
00175
00176 #ifndef CIGI_NO_BND_CHK
00177 if(bndchk && ((Lat < -90.0f)||(Lat > 90.0f)))
00178 {
00179 #ifndef CIGI_NO_EXCEPT
00180 throw CigiValueOutOfRangeException("Lat",Lat,-90.0,90.0);
00181 #endif
00182 return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00183 }
00184 #endif
00185
00186 LatOrXoff = Lat;
00187
00188 return(CIGI_SUCCESS);
00189
00190 }
00191
00192
00193
00194
00195 int CigiBaseEntityCtrl::SetLon(const double Lon, bool bndchk)
00196 {
00197
00198 #ifndef CIGI_NO_BND_CHK
00199 if(bndchk && ((Lon < -180.0f)||(Lon > 180.0f)))
00200 {
00201 #ifndef CIGI_NO_EXCEPT
00202 throw CigiValueOutOfRangeException("Lon",Lon,-180.0,180.0);
00203 #endif
00204 return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00205 }
00206 #endif
00207
00208 LonOrYoff = Lon;
00209
00210 return(CIGI_SUCCESS);
00211
00212 }
00213
00214
00215
00216
00217
00218 int CigiBaseEntityCtrl::SetAttachState(const AttachStateGrp AttachStateIn, bool bndchk)
00219 {
00220
00221 #ifndef CIGI_NO_BND_CHK
00222 if(bndchk && ((AttachStateIn < 0)||(AttachStateIn > 1)))
00223 {
00224 #ifndef CIGI_NO_EXCEPT
00225 throw CigiValueOutOfRangeException("AttachState",AttachStateIn,0,1);
00226 #endif
00227 return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00228 }
00229 #endif
00230
00231 AttachState = AttachStateIn;
00232
00233 return(CIGI_SUCCESS);
00234
00235 }
00236
00237
00238
00239
00240 int CigiBaseEntityCtrl::SetCollisionDetectEn(const CollisionDetectGrp CollisionDetectEnIn, bool bndchk)
00241 {
00242
00243 #ifndef CIGI_NO_BND_CHK
00244 if(bndchk && ((CollisionDetectEnIn < 0)||(CollisionDetectEnIn > 1)))
00245 {
00246 #ifndef CIGI_NO_EXCEPT
00247 throw CigiValueOutOfRangeException("CollisionDetectEn",CollisionDetectEnIn,0,1);
00248 #endif
00249 return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00250 }
00251 #endif
00252
00253 CollisionDetectEn = CollisionDetectEnIn;
00254
00255 return(CIGI_SUCCESS);
00256
00257 }
00258
00259