Isis 3.0 Programmer Reference
Back | Home
ShapeModel.h
Go to the documentation of this file.
1 #ifndef ShapeModel_h
2 #define ShapeModel_h
3 
25 #include <vector>
26 
27 template<class T> class QVector;
28 
29 class QString;
30 
31 namespace Isis {
32  class Distance;
33  class Latitude;
34  class Longitude;
35  class Pvl;
36  class Spice;
37  class SurfacePoint;
38  class Target;
39 
68  class ShapeModel {
69  public:
70  // Constructors
71  ShapeModel();
72  ShapeModel(Target *target);
73 
74  // Initialization
75  void Initialize();
76 
77  // Destructor -- must be virtual in order to clean up properly because of
78  // virtual method below
79  virtual ~ShapeModel()=0;
80 
81  // Intersect the shape model
82  virtual bool intersectSurface(std::vector<double> observerPos,
83  std::vector<double> lookDirection)=0;
84 
85  // Return the surface intersection
87 
88  bool hasIntersection();
89  bool hasNormal() const;
90 
91  // Calculate the default normal of the current intersection point
92  virtual void calculateDefaultNormal() = 0;
93 
94  // Calculate the local normal of the current intersection point
95  // (relative to neighbor points)
96  virtual void calculateLocalNormal(QVector<double *> neighborPoints) = 0;
97 
98  // Calculate the surface normal of the current intersection point
99  // (relative to ellipsoid)
100  virtual void calculateSurfaceNormal() = 0;
101 
102  // Clear current point
103  void clearSurfacePoint();
104 
105  // Calculate the emission angle of the current intersection point
106  virtual double emissionAngle(const std::vector<double> & sB);
107 
108  // Calculate the incidence angle of the current intersection point
109  virtual double incidenceAngle(const std::vector<double> &uB);
110 
111  // Calculate the phase angle of the current intersection point
112  virtual double phaseAngle(const std::vector<double> &sB,
113  const std::vector<double> &uB);
114 
115  // Return local radius from shape model
116  virtual Distance localRadius(const Latitude &lat, const Longitude &lon) = 0;
117 
126  virtual bool isDEM() const = 0;
127 
128  // Get shape name
129  QString name() const;
130 
131  // Set m_hasIntersection
132  void setHasIntersection(bool b);
133 
134  // Set current surface point
135  void setSurfacePoint(const SurfacePoint &surfacePoint);
136 
137  // Return the normal (surface or local) of the current intersection point
138  std::vector<double> normal();
139 
140  protected:
141 
142  // Set the normal (surface or local) of the current intersection point
143  void setNormal(const std::vector<double>);
144  void setNormal(const double a, const double b, const double c);
145 
146  // Set shape name
147  void setName(QString name);
148 
151 
152  // Intersect ellipse
153  bool intersectEllipsoid(const std::vector<double> observerPosRelativeToTarget,
154  const std::vector<double> &observerLookVectorToTarget);
155  bool hasValidTarget() const;
156  std::vector<Distance> targetRadii() const;
157  void setHasNormal(bool status);
158  double resolution();
159 
160  private:
163  bool m_hasNormal;
164  std::vector<double> m_normal;
165  QString *m_name;
167 
168  Target *m_target;
169  };
170 };
171 
172 #endif
This class defines a body-fixed surface point.
Definition: SurfacePoint.h:86
void calculateEllipsoidalSurfaceNormal()
Calculates the ellipsoidal surface normal.
Definition: ShapeModel.cpp:81
std::vector< double > normal()
Returns the local surface normal at the current intersection point.
Definition: ShapeModel.cpp:342
ShapeModel()
Default constructor creates ShapeModel object, initializing name to an empty string, surface point to an empty surface point, has intersection to FALSE, has normal to FALSE, has ellipsoid intersection to FALSE, normal vector size to 3, and target to NULL.
Definition: ShapeModel.cpp:32
std::vector< double > m_normal
Local normal of current intersection point.
Definition: ShapeModel.h:164
QString name() const
Gets the shape name.
Definition: ShapeModel.cpp:454
void setNormal(const std::vector< double >)
Sets the normal for the currect intersection point.
Definition: ShapeModel.cpp:398
bool hasValidTarget() const
Returns the status of the target.
Definition: ShapeModel.cpp:360
bool hasIntersection()
Returns intersection status.
Definition: ShapeModel.cpp:309
This class is designed to encapsulate the concept of a Latitude.
Definition: Latitude.h:59
virtual double emissionAngle(const std::vector< double > &sB)
Computes and returns emission angle, in degrees, given the observer position.
Definition: ShapeModel.cpp:126
Distance measurement, usually in meters.
Definition: Distance.h:47
std::vector< Distance > targetRadii() const
Returns the radii of the body in km.
Definition: ShapeModel.cpp:376
void setHasIntersection(bool b)
Sets the flag to indicate whether this ShapeModel has an intersection.
Definition: ShapeModel.cpp:465
This class is designed to encapsulate the concept of a Longitude.
Definition: Longitude.h:52
virtual double phaseAngle(const std::vector< double > &sB, const std::vector< double > &uB)
Computes and returns phase angle, in degrees, given the positions of the observer and illuminator...
Definition: ShapeModel.cpp:265
bool intersectEllipsoid(const std::vector< double > observerPosRelativeToTarget, const std::vector< double > &observerLookVectorToTarget)
Finds the intersection point on the ellipsoid model using the given position of the observer (spacecr...
Definition: ShapeModel.cpp:208
bool m_hasIntersection
indicates good intersection exists
Definition: ShapeModel.h:162
double resolution()
Convenience method to get pixel resolution (m/pix) at current intersection point. ...
Definition: ShapeModel.cpp:503
bool hasNormal() const
Returns surface point normal status.
Definition: ShapeModel.cpp:319
SurfacePoint * m_surfacePoint
&lt; Name of the shape
Definition: ShapeModel.h:166
virtual double incidenceAngle(const std::vector< double > &uB)
Computes and returns incidence angle, in degrees, given the illuminator position. ...
Definition: ShapeModel.cpp:173
virtual bool isDEM() const =0
Indicates whether this shape model is from a DEM.
void clearSurfacePoint()
Clears or resets the current surface point.
Definition: ShapeModel.cpp:327
This class is used to create and store valid Isis3 targets.
Definition: Target.h:63
virtual ~ShapeModel()=0
Virtual destructor to destroy the ShapeModel object.
Definition: ShapeModel.cpp:68
Define shapes and provide utilities for Isis3 targets.
Definition: ShapeModel.h:68
bool m_hasEllipsoidIntersection
Indicates the ellipsoid was successfully intersected.
Definition: ShapeModel.h:161
void setSurfacePoint(const SurfacePoint &surfacePoint)
Set surface intersection point.
Definition: ShapeModel.cpp:476
void setName(QString name)
Sets the shape name.
Definition: ShapeModel.cpp:443
void setHasNormal(bool status)
Sets the flag to indicate whether this ShapeModel has a surface normal.
Definition: ShapeModel.cpp:492
bool hasEllipsoidIntersection()
Returns the status of the ellipsoid model intersection.
Definition: ShapeModel.cpp:154
SurfacePoint * surfaceIntersection() const
Returns the surface intersection for this ShapeModel.
Definition: ShapeModel.cpp:299
void Initialize()
Initializes the ShapeModel private variables.
Definition: ShapeModel.cpp:57
bool m_hasNormal
indicates normal has been computed
Definition: ShapeModel.h:163

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the ISIS Support Center
File Modified: 07/12/2023 23:29:09