From c8e202738c4ae3dfa8f950328485143f6f76647d Mon Sep 17 00:00:00 2001 From: cignoni Date: Thu, 9 Feb 2012 17:53:08 +0000 Subject: [PATCH] added initialization of VE adjacency components to something that allows to discriminate between the uninitializated adjacency and a vertex with no edges --- vcg/simplex/vertex/component.h | 8 ++++---- vcg/simplex/vertex/component_ocf.h | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/vcg/simplex/vertex/component.h b/vcg/simplex/vertex/component.h index 9f33b809..add544d6 100644 --- a/vcg/simplex/vertex/component.h +++ b/vcg/simplex/vertex/component.h @@ -438,7 +438,7 @@ public: static void Name(std::vector & name){name.push_back(std::st template class VEAdj: public T { public: - VEAdj(){_ep=0;} + VEAdj(){_ep=0;_zp=-1;} typename T::EdgePointer &VEp() {return _ep; } typename T::EdgePointer const cVEp() const {return _ep; } int &VEi() {return _zp; } @@ -457,7 +457,7 @@ private: template class VFAdj: public T { public: - VFAdj(){_fp=0;} + VFAdj(){_fp=0;_zp=-1;} typename T::FacePointer &VFp() {return _fp; } typename T::FacePointer const cVFp() const {return _fp; } int &VFi() {return _zp; } @@ -476,7 +476,7 @@ private: template class VHAdj: public T { public: - VHAdj(){_hp=0;} + VHAdj(){_hp=0;_zp=-1;} typename T::HEdgePointer &VHp() {return _hp; } typename T::HEdgePointer cVHp() {return _hp; } int &VHi() {return _zp; } @@ -495,7 +495,7 @@ private: template class VTAdj: public T { public: - VTAdj() { _tp = 0; } + VTAdj() { _tp = 0; _zp=-1;} typename T::TetraPointer &VTp() { return _tp; } typename T::TetraPointer cVTp() { return _tp; } int &VTi() {return _zp; } diff --git a/vcg/simplex/vertex/component_ocf.h b/vcg/simplex/vertex/component_ocf.h index 74fb15cc..569ceb27 100644 --- a/vcg/simplex/vertex/component_ocf.h +++ b/vcg/simplex/vertex/component_ocf.h @@ -234,7 +234,8 @@ bool IsVFAdjacencyEnabled() const {return VFAdjacencyEnabled;} void EnableVFAdjacency() { assert(VALUE_TYPE::HasVFAdjacencyOcf()); VFAdjacencyEnabled=true; - AV.resize((*this).size()); + VFAdjType zero; zero._fp=0; zero._zp=-1; + AV.resize((*this).size(),zero); } void DisableVFAdjacency() {