1#ifndef EmbreeTargetShape_h
2#define EmbreeTargetShape_h
13#include <embree3/rtcore.h>
14#include <embree3/rtcore_ray.h>
17#include <pcl/io/auto_io.h>
18#include <pcl/point_types.h>
19#include <pcl/PolygonMesh.h>
47 const std::vector<double> &direction);
86 const std::vector<double> &direction);
147 QString
name()
const;
160 static void multiHitFilter(
const RTCFilterFunctionNArguments *args);
166 void initMesh(pcl::PolygonMesh::Ptr mesh);
200 pcl::PolygonMesh::Ptr m_mesh;
203 pcl::PointCloud<pcl::PointXYZ> m_cloud;
Embree Target Shape for planetary bodies.
Definition EmbreeTargetShape.h:139
bool isOccluded(RTCOcclusionRay &ray)
Check if a ray intersects the target body.
Definition EmbreeTargetShape.cpp:674
void initMesh(pcl::PolygonMesh::Ptr mesh)
Internalize a PointCloudLibrary polygon mesh in the target shape.
Definition EmbreeTargetShape.cpp:450
pcl::PolygonMesh::Ptr readDSK(FileName file)
Read a NAIF type 2 DSK file into a PointCloudLibrary polygon mesh.
Definition EmbreeTargetShape.cpp:311
static void occlusionFilter(const RTCFilterFunctionNArguments *args)
Filter function for collecting multiple primitiveIDs This function is called by the Embree library du...
Definition EmbreeTargetShape.cpp:817
int numberOfPolygons() const
Return the number of polygons in the target shape.
Definition EmbreeTargetShape.cpp:563
int numberOfVertices() const
Return the number of vertices in the target shape.
Definition EmbreeTargetShape.cpp:577
virtual ~EmbreeTargetShape()
Desctructor.
Definition EmbreeTargetShape.cpp:551
bool isValid() const
Return if a valid mesh is internalized and ready for use.
Definition EmbreeTargetShape.cpp:764
void addVertices(int geomID)
Adds the vertices from the internalized vertex point cloud to the Embree scene.
Definition EmbreeTargetShape.cpp:506
static void multiHitFilter(const RTCFilterFunctionNArguments *args)
Filter function for collecting multiple hits during ray intersection.
Definition EmbreeTargetShape.cpp:778
pcl::PolygonMesh::Ptr readPC(FileName file)
Read a PointCloudLibrary file into a PointCloudLibrary polygon mesh.
Definition EmbreeTargetShape.cpp:421
void addIndices(int geomID)
Adds the polygon vertex indices from the internalized polygon mesh to the Embree scene.
Definition EmbreeTargetShape.cpp:531
RayHitInformation getHitInformation(RTCMultiHitRay &ray, int hitIndex)
Extract the intersection point and unit surface normal from an RTCMultiHitRay that has been intersect...
Definition EmbreeTargetShape.cpp:707
RTCBounds sceneBounds() const
Returns the bounds of the Embree scene.
Definition EmbreeTargetShape.cpp:595
void intersectRay(RTCMultiHitRay &ray)
Intersect a ray with the target shape.
Definition EmbreeTargetShape.cpp:657
EmbreeTargetShape()
Default empty constructor.
Definition EmbreeTargetShape.cpp:225
QString name() const
Return the name of the target shape.
Definition EmbreeTargetShape.cpp:754
double maximumSceneDistance() const
Return the maximum distance within the scene.
Definition EmbreeTargetShape.cpp:618
File name manipulation and expansion.
Definition FileName.h:100
boost::numeric::ublas::vector< double > Vector
Definition for an Isis::LinearAlgebra::Vector of doubles.
Definition LinearAlgebra.h:132
Container for cube-like labels.
Definition Pvl.h:119
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16
Struct for capturing multiple intersections when using embree::rtcintersectscene.
Definition EmbreeTargetShape.h:44
float hitUs[16]
Barycentric u coordinate of the hits.
Definition EmbreeTargetShape.h:69
unsigned hitGeomIDs[16]
IDs of the geometries (bodies) hit.
Definition EmbreeTargetShape.h:67
float hitVs[16]
Barycentric v coordinate of the hits.
Definition EmbreeTargetShape.h:70
unsigned hitPrimIDs[16]
IDs of the primitives (trinagles) hit.
Definition EmbreeTargetShape.h:68
RTCMultiHitRay()
Default constructor for RTCMultiHitRay.
Definition EmbreeTargetShape.cpp:28
int lastHit
Index of the last hit in the hit containers.
Definition EmbreeTargetShape.h:71
Struct for capturing occluded plates when using embree::rtcintersectscene.
Definition EmbreeTargetShape.h:83
RTCOcclusionRay()
Default constructor for RTCOcclussionRay.
Definition EmbreeTargetShape.cpp:112
unsigned ignorePrimID
IDs of the primitives (trinagles) which should be ignored.
Definition EmbreeTargetShape.h:106
int lastHit
Index of the last hit in the hit containers.
Definition EmbreeTargetShape.h:105