00001
00045 #define _EXPORT_CCL_
00046
00047 #include "CigiBaseEnvRgnCtrl.h"
00048 #include "CigiSwapping.h"
00049 #include "CigiExceptions.h"
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060 CigiBaseEnvRgnCtrl::CigiBaseEnvRgnCtrl()
00061 {
00062
00063 }
00064
00065
00066
00067
00068
00069
00070 CigiBaseEnvRgnCtrl::~CigiBaseEnvRgnCtrl()
00071 {
00072
00073 }
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084 int CigiBaseEnvRgnCtrl::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_ENV_RGN_CTRL_PACKET_ID_V3;
00096 }
00097
00098 return(CIGI_SUCCESS);
00099 }
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110 int CigiBaseEnvRgnCtrl::SetRgnState(const RgnStateGrp RgnStateIn, bool bndchk)
00111 {
00112
00113 #ifndef CIGI_NO_BND_CHK
00114 if(bndchk && ((RgnStateIn < 0)||(RgnStateIn > 2)))
00115 {
00116 #ifndef CIGI_NO_EXCEPT
00117 throw CigiValueOutOfRangeException("RgnState",(RgnStateGrp)RgnStateIn,0,2);
00118 #endif
00119 return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00120 }
00121 #endif
00122
00123 RgnState = RgnStateIn;
00124 return(CIGI_SUCCESS);
00125
00126 }
00127
00128
00129
00130
00131
00132 int CigiBaseEnvRgnCtrl::SetWeatherProp(const MergeCtrlGrp WeatherPropIn, bool bndchk)
00133 {
00134
00135 #ifndef CIGI_NO_BND_CHK
00136 if(bndchk && ((WeatherPropIn < 0)||(WeatherPropIn > 1)))
00137 {
00138 #ifndef CIGI_NO_EXCEPT
00139 throw CigiValueOutOfRangeException("WeatherProp",(MergeCtrlGrp)WeatherPropIn,0,1);
00140 #endif
00141 return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00142 }
00143 #endif
00144
00145 WeatherProp = WeatherPropIn;
00146 return(CIGI_SUCCESS);
00147
00148 }
00149
00150
00151
00152
00153
00154 int CigiBaseEnvRgnCtrl::SetAerosol(const MergeCtrlGrp AerosolIn, bool bndchk)
00155 {
00156
00157 #ifndef CIGI_NO_BND_CHK
00158 if(bndchk && ((AerosolIn < 0)||(AerosolIn > 1)))
00159 {
00160 #ifndef CIGI_NO_EXCEPT
00161 throw CigiValueOutOfRangeException("Aerosol",(MergeCtrlGrp)AerosolIn,0,1);
00162 #endif
00163 return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00164 }
00165 #endif
00166
00167 Aerosol = AerosolIn;
00168 return(CIGI_SUCCESS);
00169
00170 }
00171
00172
00173
00174
00175
00176 int CigiBaseEnvRgnCtrl::SetMaritimeSurface(const MergeCtrlGrp MaritimeSurfaceIn, bool bndchk)
00177 {
00178
00179 #ifndef CIGI_NO_BND_CHK
00180 if(bndchk && ((MaritimeSurfaceIn < 0)||(MaritimeSurfaceIn > 1)))
00181 {
00182 #ifndef CIGI_NO_EXCEPT
00183 throw CigiValueOutOfRangeException("MaritimeSurface",(MergeCtrlGrp)MaritimeSurfaceIn,0,1);
00184 #endif
00185 return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00186 }
00187 #endif
00188
00189 MaritimeSurface = MaritimeSurfaceIn;
00190 return(CIGI_SUCCESS);
00191
00192 }
00193
00194
00195
00196
00197
00198 int CigiBaseEnvRgnCtrl::SetTerrestrialSurface(const MergeCtrlGrp TerrestrialSurfaceIn, bool bndchk)
00199 {
00200
00201 #ifndef CIGI_NO_BND_CHK
00202 if(bndchk && ((TerrestrialSurfaceIn < 0)||(TerrestrialSurfaceIn > 1)))
00203 {
00204 #ifndef CIGI_NO_EXCEPT
00205 throw CigiValueOutOfRangeException("TerrestrialSurface",(MergeCtrlGrp)TerrestrialSurfaceIn,0,1);
00206 #endif
00207 return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00208 }
00209 #endif
00210
00211 TerrestrialSurface = TerrestrialSurfaceIn;
00212 return(CIGI_SUCCESS);
00213
00214 }
00215
00216
00217
00218
00219
00220 int CigiBaseEnvRgnCtrl::SetLat(const double LatIn, bool bndchk)
00221 {
00222
00223 #ifndef CIGI_NO_BND_CHK
00224 if(bndchk && ((LatIn < -90.0)||(LatIn > 90.0)))
00225 {
00226 #ifndef CIGI_NO_EXCEPT
00227 throw CigiValueOutOfRangeException("Lat",(double)LatIn,-90.0,90.0);
00228 #endif
00229 return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00230 }
00231 #endif
00232
00233 Lat = LatIn;
00234 return(CIGI_SUCCESS);
00235
00236 }
00237
00238
00239
00240
00241
00242 int CigiBaseEnvRgnCtrl::SetLon(const double LonIn, bool bndchk)
00243 {
00244
00245 #ifndef CIGI_NO_BND_CHK
00246 if(bndchk && ((LonIn < -180.0)||(LonIn > 180.0)))
00247 {
00248 #ifndef CIGI_NO_EXCEPT
00249 throw CigiValueOutOfRangeException("Lon",(double)LonIn,-180.0,180.0);
00250 #endif
00251 return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00252 }
00253 #endif
00254
00255 Lon = LonIn;
00256 return(CIGI_SUCCESS);
00257
00258 }
00259
00260
00261
00262
00263
00264 int CigiBaseEnvRgnCtrl::SetRotation(const float RotationIn, bool bndchk)
00265 {
00266
00267 #ifndef CIGI_NO_BND_CHK
00268 if(bndchk && ((RotationIn < -180.0)||(RotationIn > 180.0)))
00269 {
00270 #ifndef CIGI_NO_EXCEPT
00271 throw CigiValueOutOfRangeException("Rotation",(float)RotationIn,-180.0,180.0);
00272 #endif
00273 return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00274 }
00275 #endif
00276
00277 Rotation = RotationIn;
00278 return(CIGI_SUCCESS);
00279
00280 }
00281
00282