Isis 3.0 Developer's Reference (API) |
Home |
00001 #ifndef Spice_h 00002 #define Spice_h 00003 00024 #include <string> 00025 #include <vector> 00026 #include "naif/SpiceUsr.h" 00027 #include "naif/SpiceZfc.h" 00028 #include "naif/SpiceZmc.h" 00029 #include "Pvl.h" 00030 #include "SpicePosition.h" 00031 #include "SpiceRotation.h" 00032 00033 namespace Isis { 00034 class iTime; 00035 class Distance; 00036 class Longitude; 00037 00206 class Spice { 00207 public: 00208 // constructors 00209 Spice(Pvl &label); 00210 Spice(Pvl &label, bool noTables); 00211 00212 // destructor 00213 ~Spice(); 00214 00215 // Methods 00216 void SetTime(const iTime &time); 00217 void InstrumentPosition(double p[3]) const; 00218 void SunPosition(double p[3]) const; 00219 double TargetCenterDistance() const; 00220 Longitude SolarLongitude(); 00221 void InstrumentVelocity(double v[3]) const; 00222 00223 iTime Time() const; 00224 00225 void Radii(Distance r[3]) const; 00226 00227 void CreateCache(iTime startTime, iTime endTime, 00228 const int size, double tol); 00229 //NO CALL TO THIS METHOD IS FOUND IN ISIS. COMMENT OUT AND SAVE FOR AT LEAST 3 MONTHS 00230 //IF NO NEED IS FOUND FOR IT, DELETE METHOD. 00231 // 2011-02-08 JEANNIE WALLDREN 00232 // void CreateCache(const double time, double tol); 00233 iTime CacheStartTime() const; 00234 iTime CacheEndTime() const; 00235 00236 void SubSpacecraftPoint(double &lat, double &lon); 00237 void SubSolarPoint(double &lat, double &lon); 00238 00239 iString Target() const; 00240 00242 bool IsSky() const { 00243 return p_sky; 00244 }; 00245 00246 iTime getClockTime(iString clockValue, 00247 int sclkCode = -1); 00248 SpiceDouble GetDouble(const iString &key, int index = 0); 00249 SpiceInt GetInteger(const iString &key, int index = 0); 00250 iString GetString(const iString &key, int index = 0); 00251 00259 SpicePosition *SunPosition() const { 00260 return p_sunPosition; 00261 }; 00262 00270 SpicePosition *InstrumentPosition() const { 00271 return p_instrumentPosition; 00272 }; 00273 00281 SpiceRotation *BodyRotation() const { 00282 return p_bodyRotation; 00283 }; 00284 00292 SpiceRotation *InstrumentRotation() const { 00293 return p_instrumentRotation; 00294 }; 00295 00296 bool HasKernels(Pvl &lab); 00297 00298 SpiceInt NaifBodyCode() const; 00299 SpiceInt NaifSpkCode() const; 00300 SpiceInt NaifCkCode() const; 00301 SpiceInt NaifIkCode() const; 00302 SpiceInt NaifSclkCode() const; 00303 00304 PvlObject getStoredNaifKeywords() const; 00305 00306 protected: 00307 enum SpiceValueType { 00308 SpiceDoubleType, 00309 SpiceStringType, 00310 SpiceIntType, 00311 SpiceByteCodeType 00312 }; 00313 00314 QVariant readValue(iString key, SpiceValueType type, int index = 0); 00315 00316 void storeResult(iString name, SpiceValueType type, QVariant value); 00317 QVariant getStoredResult(iString name, SpiceValueType type); 00318 00319 void storeValue(iString key, int index, SpiceValueType type, 00320 QVariant value); 00321 QVariant readStoredValue(iString key, SpiceValueType type, int index); 00322 00323 // Leave these protected so that inheriting classes don't 00324 // have to convert between double and spicedouble 00325 // None of the below data elements are usable (except 00326 // p_radii) until SetEphemerisTime is invoked 00327 SpiceDouble p_uB[3]; 00332 SpiceDouble p_BJ[3][3]; 00339 Distance *p_radii; 00340 00341 00342 private: 00343 void Init(Pvl &lab, bool noTables); 00344 00345 void Load(PvlKeyword &key, bool notab); 00346 void ComputeSolarLongitude(iTime et); 00347 00348 Longitude *p_solarLongitude; 00349 iTime *p_et; 00350 QVector<iString> * p_kernels; 00351 iString *p_target; 00352 00353 // cache stuff 00354 iTime *p_startTime; 00355 iTime *p_endTime; 00356 SpiceDouble *p_cacheSize; 00357 00358 SpiceDouble *p_startTimePadding; 00359 SpiceDouble *p_endTimePadding; 00360 00361 SpicePosition *p_instrumentPosition; 00362 SpiceRotation *p_instrumentRotation; 00363 SpicePosition *p_sunPosition; 00364 SpiceRotation *p_bodyRotation; 00365 00366 bool p_allowDownsizing; 00367 00368 // Constants 00369 SpiceInt *p_bodyCode; 00373 SpiceInt *p_spkCode; 00374 SpiceInt *p_ckCode; 00375 SpiceInt *p_ikCode; 00376 SpiceInt *p_sclkCode; 00377 SpiceInt *p_spkBodyCode; 00378 00379 PvlObject *p_naifKeywords; 00380 00381 bool p_sky; 00382 bool p_usingNaif; 00383 00384 // Don't allow copies 00385 Spice(const Spice &other); 00386 Spice &operator=(const Spice &other); 00387 }; 00388 } 00389 00390 #endif