RaycasterBase.hpp
Go to the documentation of this file.
1 
28 /*
29  * RaycasterBase.hpp
30  *
31  * @date 25.01.2019
32  * @author Alexander Mock <amock@uos.de>
33  */
34 
35 #pragma once
36 #ifndef LVR_RAYCASTER_BASE_HPP
37 #define LVR_RAYCASTER_BASE_HPP
38 
39 #include <memory>
40 #include "lvr2/io/MeshBuffer.hpp"
42 
43 #include "Intersection.hpp"
44 
45 namespace lvr2
46 {
47 
52 template<typename IntT>
54 public:
59 
60  // PURE VIRTUALS
70  virtual bool castRay(
71  const Vector3f& origin,
72  const Vector3f& direction,
73  IntT& intersection
74  ) = 0;
75 
76  // VIRTUALS WITH DEFAULTS. overridable
77 
87  virtual void castRays(
88  const Vector3f& origin,
89  const std::vector<Vector3f>& directions,
90  std::vector<IntT>& intersections,
91  std::vector<uint8_t>& hits
92  );
93 
103  virtual void castRays(
104  const Vector3f& origin,
105  const std::vector<std::vector<Vector3f> >& directions,
106  std::vector< std::vector<IntT> >& intersections,
107  std::vector< std::vector<uint8_t> >& hits
108  );
109 
119  virtual void castRays(
120  const std::vector<Vector3f>& origins,
121  const std::vector<Vector3f>& directions,
122  std::vector<IntT>& intersections,
123  std::vector<uint8_t>& hits
124  );
125 
135  virtual void castRays(
136  const std::vector<Vector3f>& origins,
137  const std::vector<std::vector<Vector3f> >& directions,
138  std::vector<std::vector<IntT> >& intersections,
139  std::vector<std::vector<uint8_t> >& hits
140  );
141 
142 private:
144 };
145 
146 template<typename IntT>
147 using RaycasterBasePtr = std::shared_ptr<RaycasterBase<IntT> >;
148 
149 } // namespace lvr2
150 
151 #include "RaycasterBase.tcc"
152 
153 #endif // LVR_RAYCASTER_BASE_HPP
virtual void castRays(const Vector3f &origin, const std::vector< Vector3f > &directions, std::vector< IntT > &intersections, std::vector< uint8_t > &hits)
Cast a ray from single origin with multiple directions onto the mesh.
HalfEdgeMesh< Vec > mesh
std::shared_ptr< MeshBuffer > MeshBufferPtr
Definition: MeshBuffer.hpp:217
RaycasterBase interface.
RaycasterBase(const MeshBufferPtr mesh)
Constructor: Stores mesh as member.
Eigen::Vector3f Vector3f
Eigen 3D vector, single precision.
std::shared_ptr< RaycasterBase< IntT > > RaycasterBasePtr
const MeshBufferPtr m_mesh
virtual bool castRay(const Vector3f &origin, const Vector3f &direction, IntT &intersection)=0
Cast a single ray onto the mesh.


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Mon Feb 28 2022 22:46:09