From 159f9d0c0f975660ba6aa655d24a8dcbc10a79e6 Mon Sep 17 00:00:00 2001 From: cignoni Date: Thu, 9 Feb 2012 17:54:25 +0000 Subject: [PATCH] added an assertion to block the use of VEiterators in case of unitialized VEadjacency --- vcg/simplex/edge/pos.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vcg/simplex/edge/pos.h b/vcg/simplex/edge/pos.h index 2505142d..d3c291cc 100644 --- a/vcg/simplex/edge/pos.h +++ b/vcg/simplex/edge/pos.h @@ -269,7 +269,10 @@ public: VEIterator(EdgeType * _e, const int & _z){e = _e; z = _z;} /// Constructor which takes a pointer to vertex - VEIterator(VertexType * _v){e = _v->VEp(); z = _v->VEi();} + VEIterator(VertexType * _v){ + e = _v->VEp(); z = _v->VEi(); + assert(z>=0 && "VE adjacency not initialized"); + } VFIEdgeType * &E() { return e;} int & I() { return z;}