USGS

Isis 3.0 Developer's Reference (API)

Home

Spice.h
Go to the documentation of this file.
1 #ifndef Spice_h
2 #define Spice_h
3 
24 #include <string>
25 #include <vector>
26 
27 #include <SpiceUsr.h>
28 #include <SpiceZfc.h>
29 #include <SpiceZmc.h>
30 
31 #include "Pvl.h"
32 #include "ShapeModel.h"
33 #include "SpicePosition.h"
34 #include "SpiceRotation.h"
35 
36 namespace Isis {
37  class Cube;
38  class iTime;
39  class Distance;
40  class EllipsoidShape;
41  class Longitude;
42  class Target;
43 
269  class Spice {
270  public:
271  // constructors
272  Spice(Cube &cube);
273  Spice(Cube &cube, bool noTables);
274 
275  // destructor
276  virtual ~Spice();
277 
278  // Methods
279  void setTime(const iTime &time);
280  void instrumentPosition(double p[3]) const;
281  void instrumentBodyFixedPosition(double p[3]) const;
282  void sunPosition(double p[3]) const;
283  double targetCenterDistance() const;
285  void instrumentBodyFixedVelocity(double v[3]) const;
286  iTime time() const;
287 
288  void radii(Distance r[3]) const;
289 
290  void createCache(iTime startTime, iTime endTime,
291  const int size, double tol);
292  iTime cacheStartTime() const;
293  iTime cacheEndTime() const;
294 
295  void subSpacecraftPoint(double &lat, double &lon);
296  void subSolarPoint(double &lat, double &lon);
297 
298  Target *target() const;
299  QString targetName() const;
300 
301  iTime getClockTime(QString clockValue,
302  int sclkCode = -1);
303  SpiceDouble getDouble(const QString &key, int index = 0);
304  SpiceInt getInteger(const QString &key, int index = 0);
305  QString getString(const QString &key, int index = 0);
306 
307  SpicePosition *sunPosition() const;
309  SpiceRotation *bodyRotation() const;
311 
312  bool hasKernels(Pvl &lab);
313 
314  SpiceInt naifBodyCode() const;
315  SpiceInt naifSpkCode() const;
316  SpiceInt naifCkCode() const;
317  SpiceInt naifIkCode() const;
318  SpiceInt naifSclkCode() const;
319  SpiceInt naifBodyFrameCode() const;
320 
322  virtual double resolution();
323 
324  protected:
334  };
335 
336  QVariant readValue(QString key, SpiceValueType type, int index = 0);
337 
338  void storeResult(QString name, SpiceValueType type, QVariant value);
339  QVariant getStoredResult(QString name, SpiceValueType type);
340 
341  void storeValue(QString key, int index, SpiceValueType type,
342  QVariant value);
343  QVariant readStoredValue(QString key, SpiceValueType type, int index);
344 
345  // Leave these protected so that inheriting classes don't
346  // have to convert between double and spicedouble
347  // None of the below data elements are usable (except
348  // m_radii) until SetEphemerisTime is invoked
349  SpiceDouble m_uB[3];
354  SpiceDouble m_BJ[3][3];
363  private:
364  void init(Pvl &lab, bool noTables);
365 
366  void load(PvlKeyword &key, bool notab);
367  void computeSolarLongitude(iTime et);
368 
369  Longitude *m_solarLongitude;
370  iTime *m_et;
371  QVector<QString> * m_kernels;
372  Target *m_target;
373 
374  // cache stuff
375  iTime *m_startTime;
376  iTime *m_endTime;
377  SpiceDouble *m_cacheSize;
378 
379  SpiceDouble *m_startTimePadding;
380  SpiceDouble *m_endTimePadding;
381 
382  SpicePosition *m_instrumentPosition;
383  SpiceRotation *m_instrumentRotation;
384  SpicePosition *m_sunPosition;
385  SpiceRotation *m_bodyRotation;
386 
387  bool m_allowDownsizing;
388 
389  // Constants
390  // SpiceInt *m_bodyCode; /**< The NaifBodyCode value, if it exists in the
391  // labels. Otherwise, if the target is sky,
392  // it's the SPK code and if not sky then it's
393  // calculated by the naifBodyCode() method.*/
394  SpiceInt *m_spkCode;
395  SpiceInt *m_ckCode;
396  SpiceInt *m_ikCode;
397  SpiceInt *m_sclkCode;
398  SpiceInt *m_spkBodyCode;
399  SpiceInt *m_bodyFrameCode;
403  PvlObject *m_naifKeywords;
404 
405  bool m_usingNaif;
406 
407  // Don't allow copies
408  Spice(const Spice &other);
409  Spice &operator=(const Spice &other);
410 
411  };
412 }
413 
414 #endif