USGS

Isis 3.0 Object Programmers' Reference

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 
273  class Spice {
274  public:
275  // constructors
276  Spice(Cube &cube);
277  Spice(Cube &cube, bool noTables);
278 
279  // destructor
280  virtual ~Spice();
281 
282  // Methods
283  void setTime(const iTime &time);
284  void instrumentPosition(double p[3]) const;
285  void instrumentBodyFixedPosition(double p[3]) const;
286  void sunPosition(double p[3]) const;
287  double targetCenterDistance() const;
289  void instrumentBodyFixedVelocity(double v[3]) const;
290  iTime time() const;
291 
292  void radii(Distance r[3]) const;
293 
294  void createCache(iTime startTime, iTime endTime,
295  const int size, double tol);
296  iTime cacheStartTime() const;
297  iTime cacheEndTime() const;
298 
299  void subSpacecraftPoint(double &lat, double &lon);
300  void subSolarPoint(double &lat, double &lon);
301 
302  Target *target() const;
303  QString targetName() const;
304 
305  iTime getClockTime(QString clockValue,
306  int sclkCode = -1);
307  SpiceDouble getDouble(const QString &key, int index = 0);
308  SpiceInt getInteger(const QString &key, int index = 0);
309  QString getString(const QString &key, int index = 0);
310 
311  SpicePosition *sunPosition() const;
313  SpiceRotation *bodyRotation() const;
315 
316  bool hasKernels(Pvl &lab);
317 
318  SpiceInt naifBodyCode() const;
319  SpiceInt naifSpkCode() const;
320  SpiceInt naifCkCode() const;
321  SpiceInt naifIkCode() const;
322  SpiceInt naifSclkCode() const;
323  SpiceInt naifBodyFrameCode() const;
324 
326  virtual double resolution();
327 
328  protected:
338  };
339 
340  QVariant readValue(QString key, SpiceValueType type, int index = 0);
341 
342  void storeResult(QString name, SpiceValueType type, QVariant value);
343  QVariant getStoredResult(QString name, SpiceValueType type);
344 
345  void storeValue(QString key, int index, SpiceValueType type,
346  QVariant value);
347  QVariant readStoredValue(QString key, SpiceValueType type, int index);
348 
349  // Leave these protected so that inheriting classes don't
350  // have to convert between double and spicedouble
351  // None of the below data elements are usable (except
352  // m_radii) until SetEphemerisTime is invoked
353  SpiceDouble m_uB[3];
358  SpiceDouble m_BJ[3][3];
367  private:
368  void init(Pvl &lab, bool noTables);
369 
370  void load(PvlKeyword &key, bool notab);
371  void computeSolarLongitude(iTime et);
372 
375  QVector<QString> * m_kernels;
377 
378  // cache stuff
381  SpiceDouble *m_cacheSize;
382 
383  SpiceDouble *m_startTimePadding;
384  SpiceDouble *m_endTimePadding;
385 
390 
392 
393  // Constants
394  // SpiceInt *m_bodyCode; /**< The NaifBodyCode value, if it exists in the
395  // labels. Otherwise, if the target is sky,
396  // it's the SPK code and if not sky then it's
397  // calculated by the naifBodyCode() method.*/
398  SpiceInt *m_spkCode;
399  SpiceInt *m_ckCode;
400  SpiceInt *m_ikCode;
401  SpiceInt *m_sclkCode;
402  SpiceInt *m_spkBodyCode;
403  SpiceInt *m_bodyFrameCode;
407  PvlObject *m_naifKeywords;
408 
409  bool m_usingNaif;
410 
411  // Don't allow copies
412  Spice(const Spice &other);
413  Spice &operator=(const Spice &other);
414 
415  };
416 }
417 
418 #endif