Isis Developer Reference
Target.h
Go to the documentation of this file.
1 #ifndef Target_h
2 #define Target_h
3 
8 /* SPDX-License-Identifier: CC0-1.0 */
9 
10 #include <QSharedPointer>
11 
12 #include <vector>
13 
14 #include <SpiceUsr.h>
15 #include <SpiceZfc.h>
16 #include <SpiceZmc.h>
17 
18 class QString;
19 
20 namespace Isis {
21  class Angle;
22  class Distance;
23  class Pvl;
24  class PvlGroup;
25  class ShapeModel;
26  class Spice;
27 
63  class Target {
64 
65  public:
66  // constructors
67  Target(Spice *spice, Pvl &label);
68  Target(Pvl &label);
69  Target();
70 
72  ~Target();
73 
74  void init();
75  bool isSky() const;
76  SpiceInt naifBodyCode() const;
77  SpiceInt naifPlanetSystemCode() const;
78  QString name() const;
79  QString systemName() const;
80  std::vector<Distance> radii() const;
81  void restoreShape();
82  void setShapeEllipsoid();
83  void setRadii(std::vector<Distance> radii);
84  void setName(QString name);
85  void setSpice(Spice *spice);
86 
87  ShapeModel *shape() const;
88  Spice *spice() const;
89 
90  int frameType();
91 
92  std::vector<Angle> poleRaCoefs();
93  std::vector<Angle> poleDecCoefs();
94  std::vector<Angle> pmCoefs();
95 
96  static SpiceInt lookupNaifBodyCode(QString name);
97  // Static conversion methods
98  static PvlGroup radiiGroup(QString target);
99  static PvlGroup radiiGroup(Pvl &cubeLab, const PvlGroup &mapGroup);
100 
101  std::vector<double> poleRaNutPrecCoefs();
102  std::vector<double> poleDecNutPrecCoefs();
103 
104  std::vector<double> pmNutPrecCoefs();
105 
106  std::vector<Angle> sysNutPrecConstants();
107  std::vector<Angle> sysNutPrecCoefs();
108 
109  private:
110  SpiceInt lookupNaifBodyCode(Pvl &lab) const;
111  static PvlGroup radiiGroup(int bodyFrameCode);
112  SpiceInt *m_bodyCode;
116  SpiceInt *m_systemCode;
118  QString *m_name;
119  QString *m_systemName;
120  std::vector<Distance> m_radii;
121  ShapeModel *m_originalShape;
122  ShapeModel *m_shape;
123  bool m_sky;
124 
125  // TODO should this be an enum(ring, sky, or naifBody), created Naif body for sky, or ???
126  // TODO should the target body kernels go in here too bodyRotation and position??? I don't
127  // think so. They are SPICE kernels and belong in the Spice class (DAC). What do others
128  // think.
129  Spice *m_spice;
131  };
132 
134 }
135 
136 #endif
Isis::Target::radiiGroup
static PvlGroup radiiGroup(QString target)
Creates a Pvl Group with keywords TargetName, EquitorialRadius, and PolarRadius.
Definition: Target.cpp:403
FileName.h
Isis::Target::setShapeEllipsoid
void setShapeEllipsoid()
Set the shape to the ellipsoid and save the original shape.
Definition: Target.cpp:603
Isis::Target::shape
ShapeModel * shape() const
Return the shape.
Definition: Target.cpp:655
Isis::PvlObject::findGroup
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
Definition: PvlObject.h:129
Isis::Target::poleDecCoefs
std::vector< Angle > poleDecCoefs()
Definition: Target.cpp:547
EllipsoidShape.h
Isis::PvlObject
Contains Pvl Groups and Pvl Objects.
Definition: PvlObject.h:61
Isis::TargetQsp
QSharedPointer< Target > TargetQsp
Definition: Target.h:133
Isis::PvlKeyword
A single keyword-value pair.
Definition: PvlKeyword.h:82
Isis::Target::isSky
bool isSky() const
Return if our target is the sky.
Definition: Target.cpp:190
Isis::Target::sysNutPrecConstants
std::vector< Angle > sysNutPrecConstants()
Definition: Target.cpp:572
Isis::Target::setRadii
void setRadii(std::vector< Distance > radii)
Sets the radii of the body.
Definition: Target.cpp:615
Isis::PvlContainer::addKeyword
void addKeyword(const PvlKeyword &keyword, const InsertMode mode=Append)
Add a keyword to the container.
Definition: PvlContainer.cpp:202
SpecialPixel.h
Isis::FileName
File name manipulation and expansion.
Definition: FileName.h:100
Isis::Target::setSpice
void setSpice(Spice *spice)
Set the Spice pointer for the Target.
Definition: Target.cpp:647
PvlGroup.h
Target.h
Isis::Target::setName
void setName(QString name)
Set the name for the Target.
Definition: Target.cpp:632
Spice.h
Isis::Target::frameType
int frameType()
Definition: Target.cpp:537
NaifStatus.h
Isis::PvlContainer::hasKeyword
bool hasKeyword(const QString &name) const
Check to see if a keyword exists.
Definition: PvlContainer.cpp:159
Isis::Pvl
Container for cube-like labels.
Definition: Pvl.h:119
Isis::Target::naifBodyCode
SpiceInt naifBodyCode() const
This returns the NAIF body code of the target.
Definition: Target.cpp:497
Isis::Target::pmCoefs
std::vector< Angle > pmCoefs()
Definition: Target.cpp:552
QSharedPointer< Target >
Isis::toString
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition: IString.cpp:211
Isis::Target::sysNutPrecCoefs
std::vector< Angle > sysNutPrecCoefs()
Definition: Target.cpp:577
Isis::IException::what
const char * what() const
Returns a string representation of this exception in its current state.
Definition: IException.cpp:375
Isis::EllipsoidShape
Define shapes and provide utilities for ISIS targets.
Definition: EllipsoidShape.h:46
Isis::Distance
Distance measurement, usually in meters.
Definition: Distance.h:34
Isis::Target::radii
std::vector< Distance > radii() const
Returns the radii of the body in km.
Definition: Target.cpp:532
Isis::Target::~Target
~Target()
Destroys the Target.
Definition: Target.cpp:162
Isis::PvlGroup
Contains multiple PvlContainers.
Definition: PvlGroup.h:41
Pvl.h
_FILEINFO_
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:24
Isis::Target::poleRaCoefs
std::vector< Angle > poleRaCoefs()
Definition: Target.cpp:542
Isis::toInt
int toInt(const QString &string)
Global function to convert from a string to an integer.
Definition: IString.cpp:93
ShapeModelFactory.h
Isis::PvlObject::hasKeyword
bool hasKeyword(const QString &kname, FindOptions opts) const
See if a keyword is in the current PvlObject, or deeper inside other PvlObjects and Pvlgroups within ...
Definition: PvlObject.cpp:236
Isis::PvlObject::findObject
PvlObjectIterator findObject(const QString &name, PvlObjectIterator beg, PvlObjectIterator end)
Find the index of object with a specified name, between two indexes.
Definition: PvlObject.h:274
Isis::Target::Target
Target()
Constructs an empty Target object.
Definition: Target.cpp:134
Isis::Target::restoreShape
void restoreShape()
Restores the shape to the original after setShapeEllipsoid has overridden it.
Definition: Target.cpp:585
Isis::IException
Isis exception class.
Definition: IException.h:91
Isis::Target::poleRaNutPrecCoefs
std::vector< double > poleRaNutPrecCoefs()
Definition: Target.cpp:557
Isis::Target::lookupNaifBodyCode
static SpiceInt lookupNaifBodyCode(QString name)
This returns the NAIF body code of the target indicated in the labels.
Definition: Target.cpp:244
Isis::Spice
Obtain SPICE information for a spacecraft.
Definition: Spice.h:283
Isis::PvlObject::hasObject
bool hasObject(const QString &name) const
Returns a boolean value based on whether the object exists in the current PvlObject or not.
Definition: PvlObject.h:323
IException.h
Isis::toDouble
double toDouble(const QString &string)
Global function to convert from a string to a double.
Definition: IString.cpp:149
std
Namespace for the standard library.
Isis::Target::naifPlanetSystemCode
SpiceInt naifPlanetSystemCode() const
This returns the NAIF planet system body code of the target.
Definition: Target.cpp:510
Isis::ShapeModel
Define shapes and provide utilities for Isis targets.
Definition: ShapeModel.h:62
Isis::Target::spice
Spice * spice() const
Return the spice object.
Definition: Target.cpp:663
Angle.h
QMap
This is free and unencumbered software released into the public domain.
Definition: CubeIoHandler.h:22
Isis::Target::poleDecNutPrecCoefs
std::vector< double > poleDecNutPrecCoefs()
Definition: Target.cpp:562
Isis::Target::pmNutPrecCoefs
std::vector< double > pmNutPrecCoefs()
Definition: Target.cpp:567
Isis::PvlObject::findKeyword
PvlKeyword & findKeyword(const QString &kname, FindOptions opts)
Finds a keyword in the current PvlObject, or deeper inside other PvlObjects and Pvlgroups within this...
Definition: PvlObject.cpp:177
Isis::Target::systemName
QString systemName() const
Return planet system name.
Definition: Target.cpp:522
Isis::PvlContainer::findKeyword
PvlKeyword & findKeyword(const QString &name)
Find a keyword with a specified name.
Definition: PvlContainer.cpp:62
Isis::Target::init
void init()
Initialize member variables.
Definition: Target.cpp:152
Distance.h
Isis::Target
This class is used to create and store valid Isis targets.
Definition: Target.h:63
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::Target::name
QString name() const
Return target name.
Definition: Target.cpp:516