From c11adb316e1b09edc9ecbc51d2d1eed6daad6565 Mon Sep 17 00:00:00 2001 From: cignoni Date: Fri, 5 Mar 2004 21:49:21 +0000 Subject: [PATCH] First working version for face face --- vcg/complex/trimesh/update/topology.h | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/vcg/complex/trimesh/update/topology.h b/vcg/complex/trimesh/update/topology.h index 38c3e048..fa7c34fe 100644 --- a/vcg/complex/trimesh/update/topology.h +++ b/vcg/complex/trimesh/update/topology.h @@ -24,11 +24,14 @@ History $Log: not supported by cvs2svn $ +Revision 1.1 2004/03/04 00:53:24 cignoni +Initial commit + ****************************************************************************/ #ifndef __VCG_TRI_UPDATE_TOPOLOGY #define __VCG_TRI_UPDATE_TOPOLOGY - +#include namespace vcg { namespace tri { @@ -53,13 +56,13 @@ class PEdge { public: - VertexPointer * v[2]; // the two Vertex pointer are ordered! - FacePointer * f; // the face where this edge belong + VertexPointer v[2]; // the two Vertex pointer are ordered! + FacePointer f; // the face where this edge belong int z; // index in [0..2] of the edge of the face PEdge() {} -void Set( FacePointer * const pf, const int nz ) +void Set( FacePointer pf, const int nz ) { assert(pf!=0); assert(nz>=0); @@ -115,20 +118,20 @@ inline bool operator != ( const PEdge & pe ) const -void FaceFace(MeshType &m) +static void FaceFace(MeshType &m) { - if(!m.HasTopologyFF()) + if(!m.HasFFTopology()) return; { vector e; FaceIterator pf; vector::iterator p; - if( fn == 0 ) return; + if( m.fn == 0 ) return; - e.resize(fn*3); // Alloco il vettore ausiliario + e.resize(m.fn*3); // Alloco il vettore ausiliario p = e.begin(); - for(pf=face.begin();pf!=face.end();++pf) // Lo riempio con i dati delle facce - if( ! (*pf).IsDeleted() ) + for(pf=m.face.begin();pf!=m.face.end();++pf) // Lo riempio con i dati delle facce + if( ! (*pf).IsD() ) for(int j=0;j<3;++j) { (*p).Set(&(*pf),j); @@ -139,12 +142,12 @@ void FaceFace(MeshType &m) int ne = 0; // Numero di edge reali - vector::iterator pe,ps; + vector::iterator pe,ps; for(ps = e.begin(),pe=e.begin();pe<=e.end();++pe) // Scansione vettore ausiliario { if( pe==e.end() || *pe != *ps ) // Trovo blocco di edge uguali { - vector::iterator q,q_next; + vector::iterator q,q_next; for (q=ps;q=0);