43 #ifndef NORMALATTRIB_HH_
44 #define NORMALATTRIB_HH_
48 #include "../Core/OpenVolumeMeshHandle.hh"
49 #include "OpenVolumeMeshStatus.hh"
50 #include "../Core/PropertyDefines.hh"
52 namespace OpenVolumeMesh {
54 template <
class GeomKernelT>
78 const typename GeomKernelT::PointT& operator[](
const VertexHandle& _h)
const {
79 assert((
unsigned int)_h.idx() < kernel_.n_vertices());
80 return v_normals_[_h.idx()];
83 const typename GeomKernelT::PointT& operator[](
const FaceHandle& _h)
const {
84 assert((
unsigned int)_h.idx() < kernel_.n_faces());
85 return f_normals_[_h.idx()];
88 const typename GeomKernelT::PointT operator[](
const HalfFaceHandle& _h)
const {
89 assert((
unsigned int)_h.idx() < kernel_.n_halffaces());
91 if(_h.idx() % 2 == 1) mult = -1.0;
92 return f_normals_[kernel_.face_handle(_h).idx()] * mult;
95 typename GeomKernelT::PointT& operator[](
const VertexHandle& _h) {
96 assert((
unsigned int)_h.idx() < kernel_.n_vertices());
97 return v_normals_[_h.idx()];
100 typename GeomKernelT::PointT& operator[](
const FaceHandle& _h) {
101 assert((
unsigned int)_h.idx() < kernel_.n_faces());
102 return f_normals_[_h.idx()];
105 typename GeomKernelT::PointT operator[](
const HalfFaceHandle& _h) {
106 assert((
unsigned int)_h.idx() < kernel_.n_halffaces());
108 if(_h.idx() % 2 == 1) mult = -1.0;
109 return f_normals_[kernel_.face_handle(_h).idx()] * mult;
116 void compute_face_normal(
const FaceHandle& _fh);
118 GeomKernelT& kernel_;
126 #if defined(INCLUDE_TEMPLATES) && !defined(NORMALATTRIBT_CC)
127 #include "NormalAttribT.cc"