35 #ifndef LVR2_GEOMETRY_NORMAL_H_ 36 #define LVR2_GEOMETRY_NORMAL_H_ 43 #include <Eigen/Dense> 59 template <
typename CoordType>
60 struct Normal :
public BaseVector<CoordType>
113 template<
typename CollectionT>
133 template<
typename T,
typename S>
135 #endif // ifndef __NVCC__ 139 template<
typename CoordType>
140 inline std::ostream& operator<<(std::ostream& os, const Normal<CoordType>& n)
142 os <<
"Normal[" << n.getX() <<
", " << n.getY() <<
", " << n.getZ() <<
"]";
161 template<
typename CoordType,
typename Scalar = CoordType>
165 CoordType x = mat(0, 0) * normal.x + mat(1, 0) * normal.y + mat(2, 0) * normal.z;
166 CoordType y = mat(0, 1) * normal.x + mat(1, 1) * normal.y + mat(2, 1) * normal.z;
167 CoordType z = mat(0, 2) * normal.x + mat(1, 2) * normal.y + mat(2, 2) * normal.z;
170 #endif // ifndef __NVCC__ 174 #include "lvr2/geometry/Normal.tcc" typename Vec::CoordType CoordType
Normal< CoordType > & operator=(const T &other)
Normal< CoordType > operator-() const
static Normal< CoordType > & average(const CollectionT &normals)
Returns the average of all normals in the given collection.
Normal< CoordType > operator+(const T &other) const
A vector guaranteed to be normalized (length = 1).
friend Normal< T > operator*(const Eigen::Matrix< S, 4, 4 > &mat, const Normal< T > &normal)