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_ */
lvr2::Plane
A plane.
Definition: Plane.hpp:50
lvr2::operator<<
std::ostream & operator<<(std::ostream &os, const BaseVector< T > &v)
Definition: BaseVector.hpp:227
p
SharedPointer p
Definition: ConvertShared.hpp:42
lvr2::Normal< typename BaseVecT::CoordType >
lvr2::Plane::project
BaseVecT project(const BaseVecT &other) const
Projects the given point onto the plane and returns the projection point.
lvr2::Plane::normal
Normal< typename BaseVecT::CoordType > normal
Definition: Plane.hpp:54
lvr2::Plane::intersect
Line< BaseVecT > intersect(const Plane< BaseVecT > &other) const
Calculates the intersection between this and other.
lvr2::Plane::distance
float distance(const BaseVecT &other) const
Calculates the distance between the plane and the given point.
lvr2::Plane::Plane
Plane()
Definition: Plane.hpp:52
Line.hpp
lvr2
Definition: BaseBufferManipulators.hpp:39
lvr2::Plane::pos
BaseVecT pos
Definition: Plane.hpp:55
Normal.hpp
lvr2::Line
A Line.
Definition: Line.hpp:49


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 Wed Mar 2 2022 00:37:24