Isis 3 Developer Reference
EmbreeShapeModel.h
Go to the documentation of this file.
1 #ifndef EmbreeShapeModel_h
2 #define EmbreeShapeModel_h
3 
25 #include "ShapeModel.h"
26 
27 #include <vector>
28 
29 #include <embree2/rtcore.h>
30 
31 #include <QMap>
32 #include <QVector>
33 
34 #include "Distance.h"
35 #include "EmbreeTargetShape.h"
36 #include "EmbreeTargetManager.h"
37 #include "SurfacePoint.h"
38 #include "Target.h"
39 
40 namespace Isis {
41  class Target;
42 
53  class EmbreeShapeModel : public ShapeModel {
54  public:
55  // Constructors
57  EmbreeShapeModel(Target *target, Pvl &pvl,
58  EmbreeTargetManager *targetManager);
59  EmbreeShapeModel(Target *target, const QString &shapefile,
60  EmbreeTargetManager *targetManager);
61 
62  // Destructor
63  virtual ~EmbreeShapeModel();
64 
65  // Intersect the shape model
66  virtual bool intersectSurface(std::vector<double> observerPos,
67  std::vector<double> lookDirection);
68  virtual bool intersectSurface(const Latitude &lat, const Longitude &lon,
69  const std::vector<double> &observerPos,
70  const bool &backCheck = true);
71  virtual bool intersectSurface(const SurfacePoint &surfpt,
72  const std::vector<double> &observerPos,
73  const bool &backCheck = true);
74 
75  virtual void clearSurfacePoint();
76 
77  virtual bool isDEM() const;
78 
79  double getTolerance() const;
80  void setTolerance(const double &tolerance);
81 
82  // Calculate the default normal of the current intersection point
83  virtual void calculateDefaultNormal();
84  // Calculate the surface normal of the current intersection point
85  virtual void calculateLocalNormal(QVector<double *> cornerNeighborPoints);
86  virtual void calculateSurfaceNormal();
88 
89  virtual double incidenceAngle(const std::vector<double> &uB);
90 
91  virtual Distance localRadius(const Latitude &lat, const Longitude &lon);
92 
93  // Determine if the internal intercept is occluded from the observer/lookdir
94  virtual bool isVisibleFrom(const std::vector<double> observerPos,
95  const std::vector<double> lookDirection);
96 
97  private:
98  // Disallow copying because ShapeModel is not copyable
99  Q_DISABLE_COPY(EmbreeShapeModel)
100 
101  void updateIntersection(const RayHitInformation hitInfo);
102  RTCMultiHitRay latlonToRay(const Latitude &lat, const Longitude &lon) const;
103  RTCMultiHitRay pointToRay(const SurfacePoint &point) const;
105  LinearAlgebra::Vector &observer);
106 
107  EmbreeTargetShape *m_targetShape;
111  EmbreeTargetManager *m_targetManager;
115  double m_tolerance;
116  QString m_shapeFile;
118  };
119 };
120 
121 #endif
This class defines a body-fixed surface point.
Definition: SurfacePoint.h:148
Container that holds the body fixed intersection point and unit surface normal for a hit...
Definition: EmbreeTargetShape.h:134
virtual Distance localRadius(const Latitude &lat, const Longitude &lon)
Determine radius at a given lat/lon grid point.
Definition: EmbreeShapeModel.cpp:419
virtual void clearSurfacePoint()
Flag that the ShapeModel does not have a surface point or normal.
Definition: EmbreeShapeModel.cpp:401
virtual void calculateSurfaceNormal()
Return the surface normal of the ellipsoid.
Definition: EmbreeShapeModel.cpp:540
virtual void calculateLocalNormal(QVector< double *> cornerNeighborPoints)
Compute the normal for a local region of surface points.
Definition: EmbreeShapeModel.cpp:517
virtual ~EmbreeShapeModel()
Destructor that notifies the target shape manager that the target shape is no longer in use...
Definition: EmbreeShapeModel.cpp:162
void setTolerance(const double &tolerance)
Set the tolerance used when checking if the stored surface point is visible.
Definition: EmbreeShapeModel.cpp:762
Struct for capturing multiple intersections when using embree::rtcintersectscene. ...
Definition: EmbreeTargetShape.h:60
This class is designed to encapsulate the concept of a Latitude.
Definition: Latitude.h:63
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
EmbreeShapeModel()
Default constructor sets type to a TIN.
Definition: EmbreeShapeModel.cpp:49
Distance measurement, usually in meters.
Definition: Distance.h:47
double getTolerance() const
Get the tolerance used when checking if the stored surface point is visible.
Definition: EmbreeShapeModel.cpp:749
Class for managing the construction and destruction of EmbreeTargetShapes.
Definition: EmbreeTargetManager.h:53
This class is designed to encapsulate the concept of a Longitude.
Definition: Longitude.h:52
boost::numeric::ublas::vector< double > Vector
Definition for an Isis::LinearAlgebra::Vector of doubles.
Definition: LinearAlgebra.h:135
virtual bool intersectSurface(std::vector< double > observerPos, std::vector< double > lookDirection)
This method computes an intercept point given an observer location and look direction using the Embre...
Definition: EmbreeShapeModel.cpp:178
Embree Target Shape for planetary bodies.
Definition: EmbreeTargetShape.h:155
Container for cube-like labels.
Definition: Pvl.h:135
This class is used to create and store valid Isis3 targets.
Definition: Target.h:76
Define shapes and provide utilities for Isis3 targets.
Definition: ShapeModel.h:78
Definition: Calculator.h:33
virtual bool isDEM() const
Indicates that this shape model is not from a DEM.
Definition: EmbreeShapeModel.cpp:450
virtual bool isVisibleFrom(const std::vector< double > observerPos, const std::vector< double > lookDirection)
Check if the current internalized surface point is visible from an observer position and look directi...
Definition: EmbreeShapeModel.cpp:465
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
virtual void calculateDefaultNormal()
Return the surface normal of the ellipsoid as the default.
Definition: EmbreeShapeModel.cpp:531
QVector< double > ellipsoidNormal()
Compute the true surface normal vector of an ellipsoid.
Definition: EmbreeShapeModel.cpp:561
virtual double incidenceAngle(const std::vector< double > &uB)
Computes and returns incidence angle, in degrees, given the illuminator position. ...
Definition: EmbreeShapeModel.cpp:612
General purpose Embree ray tracing model.
Definition: EmbreeShapeModel.h:53