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 Developer Reference
ShapeModel.h
Go to the documentation of this file.
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:
182 bool m_hasEllipsoidIntersection;
183 bool m_hasIntersection;
184 bool m_hasNormal;
185 bool m_hasLocalNormal;
186 std::vector<double> m_normal;
187 std::vector<double> m_localNormal;
188 QString *m_name;
189 SurfacePoint *m_surfacePoint;
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.
Definition ShapeModel.cpp:708
virtual void clearSurfacePoint()
Clears or resets the current surface point.
Definition ShapeModel.cpp:425
void setHasNormal(bool status)
Sets the flag to indicate whether this ShapeModel has a surface normal.
Definition ShapeModel.cpp:687
bool hasIntersection()
Returns intersection status.
Definition ShapeModel.cpp:397
void Initialize()
Initializes the ShapeModel private variables.
Definition ShapeModel.cpp:65
virtual ~ShapeModel()=0
Virtual destructor to destroy the ShapeModel object.
Definition ShapeModel.cpp:78
bool hasLocalNormal() const
Returns surface point local normal status.
Definition ShapeModel.cpp:417
void setHasIntersection(bool b)
Sets the flag to indicate whether this ShapeModel has an intersection.
Definition ShapeModel.cpp:658
void setNormal(const std::vector< double >)
Sets the surface normal for the currect intersection point.
Definition ShapeModel.cpp:544
void setLocalNormal(const std::vector< double >)
Sets the local normal for the currect intersection point.
Definition ShapeModel.cpp:566
virtual SurfacePoint * surfaceIntersection() const
Returns the surface intersection for this ShapeModel.
Definition ShapeModel.cpp:387
bool hasValidTarget() const
Returns the status of the target.
Definition ShapeModel.cpp:506
virtual double emissionAngle(const std::vector< double > &sB)
Computes and returns emission angle, in degrees, given the observer position.
Definition ShapeModel.cpp:214
QString name() const
Gets the shape name.
Definition ShapeModel.cpp:647
virtual Distance localRadius(const Latitude &lat, const Longitude &lon)=0
virtual bool isVisibleFrom(const std::vector< double > observerPos, const std::vector< double > lookDirection)
Default occulsion implementation.
Definition ShapeModel.cpp:488
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:296
virtual double incidenceAngle(const std::vector< double > &uB)
Computes and returns incidence angle, in degrees, given the illuminator position.
Definition ShapeModel.cpp:261
virtual void calculateSurfaceNormal()
Calculate surface normal.
Definition ShapeModel.cpp:142
bool hasEllipsoidIntersection()
Returns the status of the ellipsoid model intersection.
Definition ShapeModel.cpp:242
virtual void setSurfacePoint(const SurfacePoint &surfacePoint)
Set surface intersection point.
Definition ShapeModel.cpp:670
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:353
virtual std::vector< double > normal()
Returns the surface normal at the current intersection point.
Definition ShapeModel.cpp:440
virtual bool intersectSurface(std::vector< double > observerPos, std::vector< double > lookDirection)=0
virtual std::vector< double > localNormal()
Returns the local surface normal at the current intersection point.
Definition ShapeModel.cpp:459
std::vector< Distance > targetRadii() const
Returns the radii of the body in km.
Definition ShapeModel.cpp:522
void setHasLocalNormal(bool status)
Sets the flag to indicate whether this ShapeModel has a local normal.
Definition ShapeModel.cpp:697
ShapeModel()
Default constructor creates ShapeModel object, initializing name to an empty string,...
Definition ShapeModel.cpp:40
virtual void calculateDefaultNormal()
Compute the true surface normal vector of an ellipsoid.
Definition ShapeModel.cpp:160
virtual void calculateLocalNormal(QVector< double * > neighborPoints)=0
bool hasNormal() const
Returns surface point normal status.
Definition ShapeModel.cpp:407
void setName(QString name)
Sets the shape name.
Definition ShapeModel.cpp:636
Obtain SPICE information for a spacecraft.
Definition Spice.h:283
This class defines a body-fixed surface point.
Definition SurfacePoint.h:132
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