Isis 3 Programmer Reference
NaifDskPlateModel.h
1 #ifndef NaifDskPlateModel_h
2 #define NaifDskPlateModel_h
3 
8 /* SPDX-License-Identifier: CC0-1.0 */
9 
10 #include <QMutex>
11 #include <QSharedPointer>
12 #include <QString>
13 
14 #include "NaifDskApi.h"
15 
16 namespace Isis {
17 
18  class Intercept;
19  class Latitude;
20  class Longitude;
21  class SurfacePoint;
22 
50 
51  public:
53  NaifDskPlateModel(const QString &dskfile);
54  virtual ~NaifDskPlateModel();
55 
56  bool isValid() const;
57  QString filename() const;
58 
59  int size() const;
60  SpiceInt numberPlates() const;
61  SpiceInt numberVertices() const;
62 
63  SurfacePoint *point(const Latitude &lat, const Longitude &lon) const;
64  Intercept *intercept(const NaifVertex &vertex, const NaifVector &raydir) const;
65  // Intercept *intercept(const SurfacePoint &pnt) const;
66 
67  // Lower level I/O
68  bool isPlateIdValid(const SpiceInt plateid) const;
69  SpiceInt plateIdOfIntercept(const NaifVertex &vertex,
70  const NaifVector &raydir,
71  NaifVertex &xpoint) const;
72  NaifTriangle plate(SpiceInt plateid) const;
73 
74  NaifDskPlateModel *clone() const;
75 
76  private:
81  enum ErrAction { Throw,
82  NoThrow
83  };
84 
97  public:
100 
101  QString m_dskfile;
102  SpiceInt m_handle;
103  SpiceDLADescr m_dladsc;
105  SpiceDSKDescr m_dskdsc;
106  SpiceInt m_plates;
107  SpiceInt m_vertices;
108  QMutex m_mutex;
109  };
110 
111  // Shared file descriptor supports copying of object
114 
115  NaifDskDescriptor *openDSK(const QString &dskfile);
116  bool verify(const bool &test, const QString &errmsg,
117  const ErrAction &action = Throw) const;
118  SurfacePoint *makePoint(const NaifVertex &v) const;
119  };
120 
121 } // namespace Isis
122 
123 #endif
Isis::NaifDskPlateModel::verify
bool verify(const bool &test, const QString &errmsg, const ErrAction &action=Throw) const
Convenience method for generalized error reporting.
Definition: NaifDskPlateModel.cpp:385
Isis::NaifDskPlateModel::NaifDskDescriptor::m_vertices
SpiceInt m_vertices
Number of vertices defining the plate.
Definition: NaifDskPlateModel.h:107
Isis::NaifVertex
TNT::Array1D< SpiceDouble > NaifVertex
1-D Buffer[3]
Definition: NaifDskApi.h:47
Isis::Latitude
This class is designed to encapsulate the concept of a Latitude.
Definition: Latitude.h:51
Isis::NaifDskPlateModel::NaifDskDescriptor
NAIF DSK file descriptor.
Definition: NaifDskPlateModel.h:96
Isis::NaifDskPlateModel::NaifDskDescriptor::m_dladsc
SpiceDLADescr m_dladsc
The DLA descriptor of the DSK segment representing the target surface.
Definition: NaifDskPlateModel.h:103
Isis::NaifDskPlateModel::plate
NaifTriangle plate(SpiceInt plateid) const
Retrieve the triangular plate identified by its ID.
Definition: NaifDskPlateModel.cpp:290
Isis::NaifDskPlateModel::numberVertices
SpiceInt numberVertices() const
Returns the number of vertices in the plate model.
Definition: NaifDskPlateModel.cpp:94
Isis::NaifDskPlateModel::plateIdOfIntercept
SpiceInt plateIdOfIntercept(const NaifVertex &vertex, const NaifVector &raydir, NaifVertex &xpoint) const
Primary API to determine ray intercept from observer/look direction.
Definition: NaifDskPlateModel.cpp:236
Isis::NaifDskPlateModel::NaifDskDescriptor::m_dskdsc
SpiceDSKDescr m_dskdsc
The DSK descriptor.
Definition: NaifDskPlateModel.h:105
QSharedPointer< NaifDskDescriptor >
Isis::NaifDskPlateModel::size
int size() const
Returns the number of plates in the DSK file - mostly for conformity.
Definition: NaifDskPlateModel.cpp:79
Isis::NaifDskPlateModel::NaifDskDescriptor::m_dskfile
QString m_dskfile
The NAIF DSK file representing this plate's shape model.
Definition: NaifDskPlateModel.h:101
Isis::Longitude
This class is designed to encapsulate the concept of a Longitude.
Definition: Longitude.h:40
Isis::NaifDskPlateModel::intercept
Intercept * intercept(const NaifVertex &vertex, const NaifVector &raydir) const
Determine a target body intercept point from an observer and look direction.
Definition: NaifDskPlateModel.cpp:179
Isis::NaifDskPlateModel::NaifDskPlateModel
NaifDskPlateModel()
Default empty constructor.
Definition: NaifDskPlateModel.cpp:44
Isis::NaifDskPlateModel::filename
QString filename() const
Returns the nane of the NAIF DSK file.
Definition: NaifDskPlateModel.cpp:71
Isis::NaifDskPlateModel::isValid
bool isValid() const
Checks validity of the object.
Definition: NaifDskPlateModel.cpp:64
Isis::NaifTriangle
TNT::Array2D< SpiceDouble > NaifTriangle
3-D triangle[3][3]
Definition: NaifDskApi.h:48
Isis::NaifDskPlateModel::NaifDskDescriptor::m_mutex
QMutex m_mutex
Mutex for thread saftey.
Definition: NaifDskPlateModel.h:108
Isis::NaifDskPlateModel::openDSK
NaifDskDescriptor * openDSK(const QString &dskfile)
Opens a valid NAIF DSK plate model file.
Definition: NaifDskPlateModel.cpp:345
Isis::NaifDskPlateModel::isPlateIdValid
bool isPlateIdValid(const SpiceInt plateid) const
Determines if the plate ID is valid.
Definition: NaifDskPlateModel.cpp:213
Isis::NaifDskPlateModel::m_dsk
SharedNaifDskDescriptor m_dsk
Shared pointer to the NaifDskDescriptor for this plate.
Definition: NaifDskPlateModel.h:113
Isis::NaifDskPlateModel::NoThrow
@ NoThrow
Do not throw an exception if an error occurs.
Definition: NaifDskPlateModel.h:82
Isis::NaifDskPlateModel::Throw
@ Throw
Throw an exception if an error occurs.
Definition: NaifDskPlateModel.h:81
Isis::Intercept
Container for a intercept condition.
Definition: Intercept.h:36
Isis::NaifDskPlateModel::ErrAction
ErrAction
Enumeration to indicate whether to throw an exception if an error occurs.
Definition: NaifDskPlateModel.h:81
Isis::NaifDskPlateModel::NaifDskDescriptor::m_plates
SpiceInt m_plates
Number of Plates in the model.
Definition: NaifDskPlateModel.h:106
Isis::NaifDskPlateModel::makePoint
SurfacePoint * makePoint(const NaifVertex &v) const
Construct and return a SurfacePoint pointer
Definition: NaifDskPlateModel.cpp:399
Isis::NaifDskPlateModel
Implementation interface API for NAIF's DSK plate model.
Definition: NaifDskPlateModel.h:49
Isis::NaifVector
TNT::Array1D< SpiceDouble > NaifVector
Namespace to contain type definitions of NAIF DSK fundamentals.
Definition: NaifDskApi.h:46
Isis::NaifDskPlateModel::NaifDskDescriptor::m_handle
SpiceInt m_handle
The DAS file handle of the DSK file.
Definition: NaifDskPlateModel.h:102
Isis::NaifDskPlateModel::point
SurfacePoint * point(const Latitude &lat, const Longitude &lon) const
Get surface intersection for a lat/lon grid point.
Definition: NaifDskPlateModel.cpp:121
Isis::SurfacePoint
This class defines a body-fixed surface point.
Definition: SurfacePoint.h:132
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::NaifDskPlateModel::numberPlates
SpiceInt numberPlates() const
Returns the number of plates in the model.
Definition: NaifDskPlateModel.cpp:86