39#include <OpenVolumeMesh/Core/Handles.hh>
40#include <OpenVolumeMesh/Attribs/OpenVolumeMeshStatus.hh>
41#include <OpenVolumeMesh/Core/Properties/PropertyPtr.hh>
43namespace OpenVolumeMesh {
45template <
class GeomKernelT>
69 const typename GeomKernelT::PointT& operator[](
const VertexHandle& _h)
const {
70 assert((
unsigned int)_h.idx() < kernel_->n_vertices());
71 return v_normals_[_h];
74 const typename GeomKernelT::PointT& operator[](
const FaceHandle& _h)
const {
75 assert((
unsigned int)_h.idx() < kernel_->n_faces());
76 return f_normals_[_h];
79 const typename GeomKernelT::PointT operator[](
const HalfFaceHandle& _h)
const {
80 assert((
unsigned int)_h.idx() < kernel_->n_halffaces());
82 if(_h.idx() % 2 == 1) mult = -1.0;
83 return f_normals_[kernel_->face_handle(_h)] * mult;
86 typename GeomKernelT::PointT& operator[](
const VertexHandle& _h) {
87 assert((
unsigned int)_h.idx() < kernel_->n_vertices());
88 return v_normals_[_h];
91 typename GeomKernelT::PointT& operator[](
const FaceHandle& _h) {
92 assert((
unsigned int)_h.idx() < kernel_->n_faces());
93 return f_normals_[_h];
96 typename GeomKernelT::PointT operator[](
const HalfFaceHandle& _h) {
97 assert((
unsigned int)_h.idx() < kernel_->n_halffaces());
99 if(_h.idx() % 2 == 1) mult = -1.0;
100 return f_normals_[kernel_->face_handle(_h)] * mult;
107 const GeomKernelT* kernel_;
117#include <OpenVolumeMesh/Attribs/NormalAttribT_impl.hh>
void update_face_normals()
Compute face normals.
void update_vertex_normals()
A simple heuristic to estimate the vertex normals.