Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS
A lock ( ) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

Isis 3 Programmer Reference
ShapeModel.h
1#ifndef ShapeModel_h
2#define ShapeModel_h
7
8/* SPDX-License-Identifier: CC0-1.0 */
9#include <vector>
10#include <QVector>
11
12class QString;
13
14namespace Isis {
15 class Distance;
16 class Latitude;
17 class Longitude;
18 class Pvl;
19 class Spice;
20 class SurfacePoint;
21 class Target;
22
65 class ShapeModel {
66 public:
67 // Constructors
68 ShapeModel();
69 ShapeModel(Target *target);
70
71 // Initialization
72 void Initialize();
73
74 // Destructor -- must be virtual in order to clean up properly because of
75 // virtual method below
76 virtual ~ShapeModel()=0;
77
78 // Intersect the shape model
79 virtual bool intersectSurface(std::vector<double> observerPos,
80 std::vector<double> lookDirection)=0;
81
82 // These two methods are for optional testing of occlusions when checking
83 // specific locations on the body from the observer. The first uses
84 // localRadius() by default and so may be OK as is.
85 virtual bool intersectSurface(const Latitude &lat, const Longitude &lon,
86 const std::vector<double> &observerPos,
87 const bool &backCheck = true);
88 virtual bool intersectSurface(const SurfacePoint &surfpt,
89 const std::vector<double> &observerPos,
90 const bool &backCheck = true);
91
92
93
94 // Return the surface intersection
95 virtual SurfacePoint *surfaceIntersection() const;
96
97 bool hasIntersection();
98 bool hasNormal() const;
99 bool hasLocalNormal() const;
100
101 // Calculate the default normal of the current intersection point
102 virtual void calculateDefaultNormal();
103
104 // Calculate the local normal of the current intersection point
105 // (relative to neighbor points)
106 virtual void calculateLocalNormal(QVector<double *> neighborPoints) = 0;
107
108 // Calculate the surface normal of the current intersection point
109 // (relative to ellipsoid)
110 virtual void calculateSurfaceNormal();
111
112 // Clear current point
113 virtual void clearSurfacePoint();
114
115 // Calculate the emission angle of the current intersection point
116 virtual double emissionAngle(const std::vector<double> & sB);
117
118 // Calculate the incidence angle of the current intersection point
119 virtual double incidenceAngle(const std::vector<double> &uB);
120
121 // Calculate the phase angle of the current intersection point
122 virtual double phaseAngle(const std::vector<double> &sB,
123 const std::vector<double> &uB);
124
125 // Return local radius from shape model
126 virtual Distance localRadius(const Latitude &lat, const Longitude &lon) = 0;
127
136 virtual bool isDEM() const = 0;
137
138 // Get shape name
139 QString name() const;
140
141 // Set m_hasIntersection
142 void setHasIntersection(bool b);
143
144 // Set current surface point
145 virtual void setSurfacePoint(const SurfacePoint &surfacePoint);
146
147 // Return the surface normal of the current intersection point
148 virtual std::vector<double> normal();
149
150 // Return the local normal of the current intersection point
151 virtual std::vector<double> localNormal();
152
153 // Determine if the internal intercept is occluded from the observer/lookdir
154 virtual bool isVisibleFrom(const std::vector<double> observerPos,
155 const std::vector<double> lookDirection);
156
157 protected:
158
159 // Set the surface normal of the current intersection point
160 void setNormal(const std::vector<double>);
161 void setNormal(const double a, const double b, const double c);
162
163 // Set the local normal of the current intersection point
164 void setLocalNormal(const std::vector<double>);
165 void setLocalNormal(const double a, const double b, const double c);
166
167 // Set shape name
168 void setName(QString name);
169
171
172 // Intersect ellipse
173 bool intersectEllipsoid(const std::vector<double> observerPosRelativeToTarget,
174 const std::vector<double> &observerLookVectorToTarget);
175 bool hasValidTarget() const;
176 std::vector<Distance> targetRadii() const;
177 void setHasNormal(bool status);
178 void setHasLocalNormal(bool status);
179 double resolution();
180
181 private:
186 std::vector<double> m_normal;
187 std::vector<double> m_localNormal;
188 QString *m_name;
190
191 Target *m_target;
192 };
193};
194
195#endif
Distance measurement, usually in meters.
Definition Distance.h:34
This class is designed to encapsulate the concept of a Latitude.
Definition Latitude.h:51
This class is designed to encapsulate the concept of a Longitude.
Definition Longitude.h:40
virtual bool isDEM() const =0
Indicates whether this shape model is from a DEM.
double resolution()
Convenience method to get pixel resolution (m/pix) at current intersection point.
virtual void clearSurfacePoint()
Clears or resets the current surface point.
void setHasNormal(bool status)
Sets the flag to indicate whether this ShapeModel has a surface normal.
bool hasIntersection()
Returns intersection status.
void Initialize()
Initializes the ShapeModel private variables.
bool m_hasNormal
indicates normal has been computed
Definition ShapeModel.h:184
virtual ~ShapeModel()=0
Virtual destructor to destroy the ShapeModel object.
bool hasLocalNormal() const
Returns surface point local normal status.
void setHasIntersection(bool b)
Sets the flag to indicate whether this ShapeModel has an intersection.
void setNormal(const std::vector< double >)
Sets the surface normal for the currect intersection point.
void setLocalNormal(const std::vector< double >)
Sets the local normal for the currect intersection point.
virtual SurfacePoint * surfaceIntersection() const
Returns the surface intersection for this ShapeModel.
SurfacePoint * m_surfacePoint
< Name of the shape
Definition ShapeModel.h:189
bool m_hasEllipsoidIntersection
Indicates the ellipsoid was successfully intersected.
Definition ShapeModel.h:182
bool hasValidTarget() const
Returns the status of the target.
virtual double emissionAngle(const std::vector< double > &sB)
Computes and returns emission angle, in degrees, given the observer position.
QString name() const
Gets the shape name.
virtual bool isVisibleFrom(const std::vector< double > observerPos, const std::vector< double > lookDirection)
Default occulsion implementation.
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...
bool m_hasIntersection
indicates good intersection exists
Definition ShapeModel.h:183
virtual double incidenceAngle(const std::vector< double > &uB)
Computes and returns incidence angle, in degrees, given the illuminator position.
virtual void calculateSurfaceNormal()
Calculate surface normal.
bool hasEllipsoidIntersection()
Returns the status of the ellipsoid model intersection.
virtual void setSurfacePoint(const SurfacePoint &surfacePoint)
Set surface intersection point.
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.
virtual std::vector< double > normal()
Returns the surface normal at the current intersection point.
virtual std::vector< double > localNormal()
Returns the local surface normal at the current intersection point.
std::vector< Distance > targetRadii() const
Returns the radii of the body in km.
void setHasLocalNormal(bool status)
Sets the flag to indicate whether this ShapeModel has a local normal.
ShapeModel()
Default constructor creates ShapeModel object, initializing name to an empty string,...
virtual void calculateDefaultNormal()
Compute the true surface normal vector of an ellipsoid.
bool m_hasLocalNormal
indicates local normal has been computed
Definition ShapeModel.h:185
std::vector< double > m_normal
Surface normal of current intersection point.
Definition ShapeModel.h:186
std::vector< double > m_localNormal
Local normal of current intersection point.
Definition ShapeModel.h:187
bool hasNormal() const
Returns surface point normal status.
void setName(QString name)
Sets the shape name.
Obtain SPICE information for a spacecraft.
Definition Spice.h:283
This class defines a body-fixed surface point.
This class is used to create and store valid Isis targets.
Definition Target.h:63
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16