Isis 3 Programmer Reference
EmbreeShapeModel.h
1 #ifndef EmbreeShapeModel_h
2 #define EmbreeShapeModel_h
3 
8 /* SPDX-License-Identifier: CC0-1.0 */
9 #include "ShapeModel.h"
10 
11 #include <vector>
12 
13 #include <embree2/rtcore.h>
14 
15 #include <QMap>
16 #include <QVector>
17 
18 #include "Distance.h"
19 #include "EmbreeTargetShape.h"
20 #include "EmbreeTargetManager.h"
21 #include "SurfacePoint.h"
22 #include "Target.h"
23 
24 namespace Isis {
25  class Target;
26 
37  class EmbreeShapeModel : public ShapeModel {
38  public:
39  // Constructors
41  EmbreeShapeModel(Target *target, Pvl &pvl,
42  EmbreeTargetManager *targetManager);
43  EmbreeShapeModel(Target *target, const QString &shapefile,
44  EmbreeTargetManager *targetManager);
45 
46  // Destructor
47  virtual ~EmbreeShapeModel();
48 
49  // Intersect the shape model
50  virtual bool intersectSurface(std::vector<double> observerPos,
51  std::vector<double> lookDirection);
52  virtual bool intersectSurface(const Latitude &lat, const Longitude &lon,
53  const std::vector<double> &observerPos,
54  const bool &backCheck = true);
55  virtual bool intersectSurface(const SurfacePoint &surfpt,
56  const std::vector<double> &observerPos,
57  const bool &backCheck = true);
58 
59  virtual void clearSurfacePoint();
60 
61  virtual bool isDEM() const;
62 
63  double getTolerance() const;
64  void setTolerance(const double &tolerance);
65 
66  // Calculate the default normal of the current intersection point
67  virtual void calculateDefaultNormal();
68  // Calculate the surface normal of the current intersection point
69  virtual void calculateLocalNormal(QVector<double *> cornerNeighborPoints);
70  virtual void calculateSurfaceNormal();
72 
73  virtual double incidenceAngle(const std::vector<double> &uB);
74 
75  virtual Distance localRadius(const Latitude &lat, const Longitude &lon);
76 
77  // Determine if the internal intercept is occluded from the observer/lookdir
78  virtual bool isVisibleFrom(const std::vector<double> observerPos,
79  const std::vector<double> lookDirection);
80 
81  private:
82  // Disallow copying because ShapeModel is not copyable
83  Q_DISABLE_COPY(EmbreeShapeModel)
84 
85  void updateIntersection(const RayHitInformation hitInfo);
86  RTCMultiHitRay latlonToRay(const Latitude &lat, const Longitude &lon) const;
87  RTCMultiHitRay pointToRay(const SurfacePoint &point) const;
89  LinearAlgebra::Vector &observer);
90 
91  EmbreeTargetShape *m_targetShape;
99  double m_tolerance;
100  QString m_shapeFile;
102  };
103 };
104 
105 #endif
Isis::EmbreeShapeModel::getTolerance
double getTolerance() const
Get the tolerance used when checking if the stored surface point is visible.
Definition: EmbreeShapeModel.cpp:732
Isis::EmbreeShapeModel::latlonToRay
RTCMultiHitRay latlonToRay(const Latitude &lat, const Longitude &lon) const
Given a latitude and longitude, create a ray that goes from the origin of the target through that lat...
Definition: EmbreeShapeModel.cpp:632
Isis::Latitude
This class is designed to encapsulate the concept of a Latitude.
Definition: Latitude.h:51
Isis::EmbreeShapeModel::isDEM
virtual bool isDEM() const
Indicates that this shape model is not from a DEM.
Definition: EmbreeShapeModel.cpp:433
Isis::EmbreeShapeModel
General purpose Embree ray tracing model.
Definition: EmbreeShapeModel.h:37
Isis::EmbreeShapeModel::intersectSurface
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:161
Isis::Pvl
Container for cube-like labels.
Definition: Pvl.h:119
Isis::EmbreeShapeModel::isVisibleFrom
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:448
Isis::EmbreeShapeModel::ellipsoidNormal
QVector< double > ellipsoidNormal()
Compute the true surface normal vector of an ellipsoid.
Definition: EmbreeShapeModel.cpp:544
Isis::RayHitInformation
Container that holds the body fixed intersection point and unit surface normal for a hit.
Definition: EmbreeTargetShape.h:118
Isis::EmbreeShapeModel::m_targetManager
EmbreeTargetManager * m_targetManager
!< The target body and Embree objects for intersection.
Definition: EmbreeShapeModel.h:95
Isis::Distance
Distance measurement, usually in meters.
Definition: Distance.h:34
Isis::Longitude
This class is designed to encapsulate the concept of a Longitude.
Definition: Longitude.h:40
Isis::EmbreeShapeModel::localRadius
virtual Distance localRadius(const Latitude &lat, const Longitude &lon)
Determine radius at a given lat/lon grid point.
Definition: EmbreeShapeModel.cpp:402
Isis::EmbreeShapeModel::calculateSurfaceNormal
virtual void calculateSurfaceNormal()
Return the surface normal of the ellipsoid.
Definition: EmbreeShapeModel.cpp:523
Isis::LinearAlgebra::Vector
boost::numeric::ublas::vector< double > Vector
Definition for an Isis::LinearAlgebra::Vector of doubles.
Definition: LinearAlgebra.h:120
Isis::EmbreeTargetManager
Class for managing the construction and destruction of EmbreeTargetShapes.
Definition: EmbreeTargetManager.h:37
Isis::EmbreeShapeModel::calculateDefaultNormal
virtual void calculateDefaultNormal()
Return the surface normal of the ellipsoid as the default.
Definition: EmbreeShapeModel.cpp:514
Isis::RTCMultiHitRay
Struct for capturing multiple intersections when using embree::rtcintersectscene.
Definition: EmbreeTargetShape.h:44
Isis::EmbreeShapeModel::incidenceAngle
virtual double incidenceAngle(const std::vector< double > &uB)
Computes and returns incidence angle, in degrees, given the illuminator position.
Definition: EmbreeShapeModel.cpp:595
Isis::EmbreeShapeModel::~EmbreeShapeModel
virtual ~EmbreeShapeModel()
Destructor that notifies the target shape manager that the target shape is no longer in use.
Definition: EmbreeShapeModel.cpp:145
Isis::EmbreeShapeModel::sortHits
QVector< RayHitInformation > sortHits(RTCMultiHitRay &ray, LinearAlgebra::Vector &observer)
Sort all intersections by a ray based on distance to a point.
Definition: EmbreeShapeModel.cpp:708
Isis::EmbreeShapeModel::updateIntersection
void updateIntersection(const RayHitInformation hitInfo)
Update the ShapeModel given an intersection and normal.
Definition: EmbreeShapeModel.cpp:358
Isis::EmbreeShapeModel::clearSurfacePoint
virtual void clearSurfacePoint()
Flag that the ShapeModel does not have a surface point or normal.
Definition: EmbreeShapeModel.cpp:384
Isis::EmbreeShapeModel::m_tolerance
double m_tolerance
!< This manages EmbreeTargetShapes to allow for sharing of them between EmbreeShapeModels and deletes...
Definition: EmbreeShapeModel.h:99
Isis::EmbreeShapeModel::calculateLocalNormal
virtual void calculateLocalNormal(QVector< double * > cornerNeighborPoints)
Compute the normal for a local region of surface points.
Definition: EmbreeShapeModel.cpp:500
Isis::EmbreeTargetShape
Embree Target Shape for planetary bodies.
Definition: EmbreeTargetShape.h:139
Isis::EmbreeShapeModel::pointToRay
RTCMultiHitRay pointToRay(const SurfacePoint &point) const
Given a surface point, create a ray that goes from the origin of the target to the surface point.
Definition: EmbreeShapeModel.cpp:662
Isis::ShapeModel
Define shapes and provide utilities for Isis targets.
Definition: ShapeModel.h:62
Isis::EmbreeShapeModel::EmbreeShapeModel
EmbreeShapeModel()
Default constructor sets type to a TIN.
Definition: EmbreeShapeModel.cpp:32
Isis::EmbreeShapeModel::setTolerance
void setTolerance(const double &tolerance)
Set the tolerance used when checking if the stored surface point is visible.
Definition: EmbreeShapeModel.cpp:745
QVector
This is free and unencumbered software released into the public domain.
Definition: Calculator.h:18
Isis::EmbreeShapeModel::m_shapeFile
QString m_shapeFile
!< Tolerance for checking visibility.
Definition: EmbreeShapeModel.h:100
Isis::Target
This class is used to create and store valid Isis targets.
Definition: Target.h:63
Isis::SurfacePoint
This class defines a body-fixed surface point.
Definition: SurfacePoint.h:132
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16