Commit dd74a1f6 authored by Mike Kremer's avatar Mike Kremer

Implemented halfface normals.

git-svn-id: http://www.openvolumemesh.org/svnrepo/OpenVolumeMesh/trunk@200 66977474-1d4b-4f09-8fe9-267525286df2
parent 1cf557e7
......@@ -76,23 +76,32 @@ public:
void update_face_normals();
const typename GeomKernelT::PointT& operator[](const VertexHandle& _h) const {
assert((unsigned int)_h.idx() < v_normals_.size());
assert((unsigned int)_h.idx() < kernel_.n_vertices());
return v_normals_[_h.idx()];
}
const typename GeomKernelT::PointT& operator[](const FaceHandle& _h) const {
assert((unsigned int)_h.idx() < f_normals_.size());
assert((unsigned int)_h.idx() < kernel_.n_faces());
return f_normals_[_h.idx()];
}
const typename GeomKernelT::PointT& operator[](const HalfFaceHandle& _h) const {
assert((unsigned int)_h.idx() < kernel_.n_halffaces());
double mult = 1.0;
if(_h.idx() % 2 == 1) mult = -1.0;
return f_normals_[kernel_.face_handle(_h).idx()] * mult;
}
typename GeomKernelT::PointT& operator[](const VertexHandle& _h) {
assert((unsigned int)_h.idx() < kernel_.n_vertices());
return v_normals_[_h.idx()];
}
typename GeomKernelT::PointT& operator[](const FaceHandle& _h) {
assert((unsigned int)_h.idx() < kernel_.n_faces());
return f_normals_[_h.idx()];
typename GeomKernelT::PointT& operator[](const HalfFaceHandle& _h) {
assert((unsigned int)_h.idx() < kernel_.n_halffaces());
double mult = 1.0;
if(_h.idx() % 2 == 1) mult = -1.0;
return f_normals_[kernel_.face_handle(_h).idx()] * mult;
}
private:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment