USGS

Isis 3.0 Object Programmers' Reference

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 
66  class ShapeModel {
67  public:
68  // Constructors
69  ShapeModel();
70  ShapeModel(Target *target, Isis::Pvl &pvl);
71  ShapeModel(Target *target);
72 
73  // Initialization
74  void Initialize();
75 
76  // Destructor -- must be virtual in order to clean up properly because of
77  // virtual method below
78  virtual ~ShapeModel()=0;
79 
80  // Intersect the shape model
81  virtual bool intersectSurface(std::vector<double> observerPos,
82  std::vector<double> lookDirection)=0;
83 
84  // Return the surface intersection
86 
87  bool hasIntersection();
88  bool hasNormal() const;
89 
90  // Calculate the default normal of the current intersection point
91  virtual void calculateDefaultNormal() = 0;
92 
93  // Calculate the local normal of the current intersection point
94  // (relative to neighbor points)
95  virtual void calculateLocalNormal(QVector<double *> neighborPoints) = 0;
96 
97  // Calculate the surface normal of the current intersection point
98  // (relative to ellipsoid)
99  virtual void calculateSurfaceNormal() = 0;
100 
101  // Clear current point
102  void clearSurfacePoint();
103 
104  // Calculate the emission angle of the current intersection point
105  virtual double emissionAngle(const std::vector<double> & sB);
106 
107  // Calculate the incidence angle of the current intersection point
108  virtual double incidenceAngle(const std::vector<double> &uB);
109 
110  // Calculate the phase angle of the current intersection point
111  virtual double phaseAngle(const std::vector<double> &sB,
112  const std::vector<double> &uB);
113 
114  // Return local radius from shape model
115  virtual Distance localRadius(const Latitude &lat, const Longitude &lon) = 0;
116 
125  virtual bool isDEM() const = 0;
126 
127  // Get shape name
128  QString name() const;
129 
130  // Set m_hasIntersection
131  void setHasIntersection(bool b);
132 
133  // Set current surface point
134  void setSurfacePoint(const SurfacePoint &surfacePoint);
135 
136  // Return the normal (surface or local) of the current intersection point
137  std::vector<double> normal();
138 
139  protected:
140 
141  // Set the normal (surface or local) of the current intersection point
142  void setNormal(const std::vector<double>);
143  void setNormal(const double a, const double b, const double c);
144 
145  // Set shape name
146  void setName(QString name);
147 
150 
151  // Intersect ellipse
152  bool intersectEllipsoid(const std::vector<double> observerPosRelativeToTarget,
153  const std::vector<double> &observerLookVectorToTarget);
154  bool hasValidTarget() const;
155  std::vector<Distance> targetRadii() const;
156  void setHasNormal(bool status);
157  double resolution();
158 
159  private:
162  bool m_hasNormal;
163  std::vector<double> m_normal;
164  QString *m_name;
166 
167  Target *m_target;
168  };
169 };
170 
171 #endif
172