Plane.hpp
Go to the documentation of this file.
1 
28 /*
29  * Plane.hpp
30  *
31  * @date 14.07.2017
32  * @author Johan M. von Behren <johan@vonbehren.eu>
33  */
34 
35 #ifndef LVR2_GEOMETRY_PLANE_H_
36 #define LVR2_GEOMETRY_PLANE_H_
37 
38 #include "Normal.hpp"
39 #include "Line.hpp"
40 
41 namespace lvr2
42 {
43 
49 template <typename BaseVecT>
50 struct Plane
51 {
52  Plane() : normal(0, 0, 1) {}
53 
55  BaseVecT pos;
56 
58  BaseVecT project(const BaseVecT& other) const;
59 
67  float distance(const BaseVecT& other) const;
68 
70  Line<BaseVecT> intersect(const Plane<BaseVecT>& other) const;
71 };
72 
73 template<typename BaseVecT>
74 inline std::ostream& operator<<(std::ostream& os, const Plane<BaseVecT>& p)
75 {
76  os << "Plane[" << p.normal << ", " << p.pos << "]";
77  return os;
78 }
79 
80 } // namespace lvr2
81 
82 #include "lvr2/geometry/Plane.tcc"
83 
84 #endif /* LVR2_GEOMETRY_PLANE_H_ */
BaseVecT project(const BaseVecT &other) const
Projects the given point onto the plane and returns the projection point.
A Line.
Definition: Line.hpp:49
float distance(const BaseVecT &other) const
Calculates the distance between the plane and the given point.
Line< BaseVecT > intersect(const Plane< BaseVecT > &other) const
Calculates the intersection between this and other.
SharedPointer p
BaseVecT pos
Definition: Plane.hpp:55
Normal< typename BaseVecT::CoordType > normal
Definition: Plane.hpp:54
A plane.
Definition: Plane.hpp:50


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:08