Commit 67552980 authored by Max Lyon's avatar Max Lyon

remove availability check for normals since it did not work as intended

git-svn-id: http://www.openvolumemesh.org/svnrepo/OpenVolumeMesh/trunk@253 66977474-1d4b-4f09-8fe9-267525286df2
parent 29f4a747
...@@ -94,27 +94,21 @@ public: ...@@ -94,27 +94,21 @@ public:
typename GeomKernelT::PointT& operator[](const VertexHandle& _h) { typename GeomKernelT::PointT& operator[](const VertexHandle& _h) {
assert((unsigned int)_h.idx() < kernel_.n_vertices()); assert((unsigned int)_h.idx() < kernel_.n_vertices());
vertex_normals_available_ = true;
return v_normals_[_h.idx()]; return v_normals_[_h.idx()];
} }
typename GeomKernelT::PointT& operator[](const FaceHandle& _h) { typename GeomKernelT::PointT& operator[](const FaceHandle& _h) {
assert((unsigned int)_h.idx() < kernel_.n_faces()); assert((unsigned int)_h.idx() < kernel_.n_faces());
face_normals_available_ = true;
return f_normals_[_h.idx()]; return f_normals_[_h.idx()];
} }
typename GeomKernelT::PointT operator[](const HalfFaceHandle& _h) { typename GeomKernelT::PointT operator[](const HalfFaceHandle& _h) {
assert((unsigned int)_h.idx() < kernel_.n_halffaces()); assert((unsigned int)_h.idx() < kernel_.n_halffaces());
face_normals_available_ = true;
double mult = 1.0; double mult = 1.0;
if(_h.idx() % 2 == 1) mult = -1.0; if(_h.idx() % 2 == 1) mult = -1.0;
return f_normals_[kernel_.face_handle(_h).idx()] * mult; return f_normals_[kernel_.face_handle(_h).idx()] * mult;
} }
bool vertex_normals_available() { return vertex_normals_available_; }
bool face_normals_available() { return face_normals_available_; }
private: private:
void compute_vertex_normal(const VertexHandle& _vh); void compute_vertex_normal(const VertexHandle& _vh);
...@@ -126,9 +120,6 @@ private: ...@@ -126,9 +120,6 @@ private:
VertexPropertyT<typename GeomKernelT::PointT> v_normals_; VertexPropertyT<typename GeomKernelT::PointT> v_normals_;
FacePropertyT<typename GeomKernelT::PointT> f_normals_; FacePropertyT<typename GeomKernelT::PointT> f_normals_;
bool vertex_normals_available_;
bool face_normals_available_;
}; };
} // Namespace OpenVolumeMesh } // Namespace OpenVolumeMesh
......
...@@ -54,9 +54,7 @@ template <class GeomKernelT> ...@@ -54,9 +54,7 @@ template <class GeomKernelT>
NormalAttrib<GeomKernelT>::NormalAttrib(GeomKernelT& _kernel) : NormalAttrib<GeomKernelT>::NormalAttrib(GeomKernelT& _kernel) :
kernel_(_kernel), kernel_(_kernel),
v_normals_(_kernel.template request_vertex_property<typename GeomKernelT::PointT>("vertex_normals")), v_normals_(_kernel.template request_vertex_property<typename GeomKernelT::PointT>("vertex_normals")),
f_normals_(_kernel.template request_face_property<typename GeomKernelT::PointT>("face_normals")), f_normals_(_kernel.template request_face_property<typename GeomKernelT::PointT>("face_normals"))
vertex_normals_available_(false),
face_normals_available_(false)
{ {
} }
...@@ -80,8 +78,6 @@ void NormalAttrib<GeomKernelT>::update_vertex_normals() { ...@@ -80,8 +78,6 @@ void NormalAttrib<GeomKernelT>::update_vertex_normals() {
for(VertexIter v_it = kernel_.v_iter(); v_it.valid(); ++v_it) { for(VertexIter v_it = kernel_.v_iter(); v_it.valid(); ++v_it) {
compute_vertex_normal(*v_it); compute_vertex_normal(*v_it);
} }
vertex_normals_available_ = true;
} }
template <class GeomKernelT> template <class GeomKernelT>
...@@ -97,7 +93,6 @@ void NormalAttrib<GeomKernelT>::update_face_normals() { ...@@ -97,7 +93,6 @@ void NormalAttrib<GeomKernelT>::update_face_normals() {
// first two edges // first two edges
compute_face_normal(*f_it); compute_face_normal(*f_it);
} }
face_normals_available_ = true;
} }
template <class GeomKernelT> template <class GeomKernelT>
......
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