Isis Developer Reference
DemShape.h
Go to the documentation of this file.
1#ifndef DemShape_h
2#define DemShape_h
7
8/* SPDX-License-Identifier: CC0-1.0 */
9
10#include "ShapeModel.h"
11
12template<class T> class QVector;
13
14namespace Isis {
15 class Cube;
16 class Interpolator;
17 class Portal;
18 class Projection;
19
52 class DemShape : public ShapeModel {
53 public:
54 // Constructor
55 DemShape(Target *target, Pvl &pvl);
56
57 // Constructor
58 DemShape();
59
60 // Destructor
61 ~DemShape();
62
63 // Make parent functions visible
65
66 // Intersect the shape model
67 bool intersectSurface(std::vector<double> observerPos,
68 std::vector<double> lookDirection);
69
70 Distance localRadius(const Latitude &lat, const Longitude &lon);
71
72 // Return dem scale in pixels/degree
73 double demScale();
74
75 // implement pure virtual method from ShapeModel class
76 bool isDEM() const;
77
78 // To compute the surface normal, you must call setLocalAreaPoint on top,
79 // bottom, left, and right surrounding points in the image. Then call
80 // calculateSurfaceNormal and directSurfaceNormal to calculate the normal.
81 // Use removeLOcalAreaPoints to clean up as needed. See Camera for an
82 // example, or use its GetLocalNormal method.
83
84 // Calculate the surface normal of the current intersection point
85 void calculateLocalNormal(QVector<double *> cornerNeighborPoints);
86
87 protected:
88 Cube *demCube();
89
90 private:
91
92 // Given a position along a ray, compute the difference between the radius
93 // at that position and the surface radius at that lon-lat location.
94 // Update the intersection point in the class based on the input
95 // parameters. All lengths are in km.
96 double calcDemErrUpdateIntersection(std::vector<double> const& observerPos,
97 std::vector<double> const& lookDirection,
98 double t,
99 double * intersectionPoint,
100 bool & success);
101
102 // Find a value in the DEM. Used when intersecting a ray with the DEM.
103 // Returned value is in km.
104 double findDemValue();
105
106 Cube *m_demCube;
107 Projection *m_demProj;
108 double m_pixPerDegree;
109 Portal *m_portal;
110 Interpolator *m_interp;
111 double m_demValue;
112 bool m_demValueFound;
113 };
114}
115
116#endif
IO Handler for Isis Cubes.
Definition Cube.h:168
~DemShape()
Destroys the DemShape.
Definition DemShape.cpp:116
DemShape(Target *target, Pvl &pvl)
Construct a DemShape object.
Definition DemShape.cpp:73
Distance localRadius(const Latitude &lat, const Longitude &lon)
Gets the radius from the DEM, if we have one.
Definition DemShape.cpp:395
double demScale()
Return the scale of the DEM shape, in pixels per degree.
Definition DemShape.cpp:425
DemShape()
Construct a DemShape object.
Definition DemShape.cpp:54
Cube * demCube()
Returns the cube defining the shape model.
Definition DemShape.cpp:434
bool isDEM() const
Indicates that this shape model is from a DEM.
Definition DemShape.cpp:448
void calculateLocalNormal(QVector< double * > cornerNeighborPoints)
This method calculates the local surface normal of the current intersection point.
Definition DemShape.cpp:459
bool intersectSurface(std::vector< double > observerPos, std::vector< double > lookDirection)
Find the intersection point with the DEM.
Definition DemShape.cpp:200
Distance measurement, usually in meters.
Definition Distance.h:34
Pixel interpolator.
Definition Interpolator.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
Buffer for containing a two dimensional section of an image.
Definition Portal.h:36
Base class for Map Projections.
Definition Projection.h:155
Container for cube-like labels.
Definition Pvl.h:122
virtual bool intersectSurface(std::vector< double > observerPos, std::vector< double > lookDirection)=0
ShapeModel()
Default constructor creates ShapeModel object, initializing name to an empty string,...
Definition ShapeModel.cpp:40
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 Calculator.h:18
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16