diff --git a/vcg/complex/edgemesh/allocate.h b/vcg/complex/edgemesh/allocate.h index bf16afb2..936b8b51 100644 --- a/vcg/complex/edgemesh/allocate.h +++ b/vcg/complex/edgemesh/allocate.h @@ -154,7 +154,7 @@ static EdgeIterator AddEdges(MeshType &m, int n, PointerUpdater &pu m.edges.back().ClearFlags(); } - m.fn+=n; + m.en+=n; pu.newBase = &*m.edges.begin(); @@ -166,16 +166,16 @@ static EdgeIterator AddEdges(MeshType &m, int n, PointerUpdater &pu { if(EdgeType::HasEEAdjacency()) { - pu.Update((*ei).E(0)); - pu.Update((*ei).E(1)); + pu.Update((*ei).EEp(0)); + pu.Update((*ei).EEp(1)); } } - VertexIterator ei; - for (ei=m.vert.begin(); ei!=m.vert.end(); ++ei) - if(!(*ei).IsD()) + VertexIterator vi; + for (vi=m.vert.begin(); vi!=m.vert.end(); ++vi) + if(!(*vi).IsD()) { if(VertexType::HasVEAdjacency()) - pu.Update((*ei).Ep()); + pu.Update((*vi).Ep()); } // e poiche' lo spazio e' cambiato si ricalcola anche last da zero unsigned int siz=m.edges.size()-n; diff --git a/vcg/complex/edgemesh/base.h b/vcg/complex/edgemesh/base.h index 2f0cd5ca..854c6e20 100644 --- a/vcg/complex/edgemesh/base.h +++ b/vcg/complex/edgemesh/base.h @@ -24,6 +24,9 @@ History $Log: not supported by cvs2svn $ +Revision 1.1 2004/04/26 19:10:04 ganovelli +created + ****************************************************************************/ @@ -33,8 +36,8 @@ $Log: not supported by cvs2svn $ People should subclass his vertex class from these one... */ -#ifndef __VCGLIB_POLYLINE -#define __VCGLIB_POLYLINE +#ifndef __VCGLIB_EDGEMESH +#define __VCGLIB_EDGEMESH namespace vcg { namespace edge { @@ -47,7 +50,7 @@ namespace edge { @param STL_FACE_CONT (Template Parameter) Specifies the type of the faces container any the face type. */ template < class VertContainerType, class EdgeContainerType > -class Polyline{ +class EdgeMesh{ public: typedef EdgeContainerType EdgeContainer; typedef VertContainerType VertContainer; @@ -61,7 +64,7 @@ class Polyline{ typedef typename EdgeContainerType::const_iterator ConstEdgeIterator; typedef VertexType * VertexPointer; typedef const VertexType * ConstVertexPointer; - typedef EdgeType * SrgmentPointer; + typedef EdgeType * EdgePointer; typedef const EdgeType * ConstEdgePointer; typedef Box3 BoxType; @@ -70,7 +73,7 @@ class Polyline{ /// Real number of vertices int vn; /// Set of faces - EdgeContainer segment; + EdgeContainer edges; /// Real number of faces int en; /// Bounding box of the mesh @@ -100,7 +103,7 @@ public: /// Default constructor - Polyline() + EdgeMesh() { en = vn = 0; imark = 0; @@ -108,7 +111,7 @@ public: inline int MemUsed() const { - return sizeof(Polyline)+sizeof(VertexType)*vert.size()+sizeof(EdgeType)*segment.size(); + return sizeof(Polyline)+sizeof(VertexType)*vert.size()+sizeof(EdgeType)*edges.size(); } inline int MemNeeded() const @@ -122,7 +125,7 @@ public: void Clear() { vert.clear(); - segment.clear(); + edges.clear(); // textures.clear(); // normalmaps.clear(); vn = 0; @@ -141,9 +144,9 @@ static bool HasPerEdgeNormal() { return EdgeType::HasEdgeNormal() ; } static bool HasPerEdgeMark() { return EdgeType::HasEdgeMark() ; } static bool HasPerEdgeQuality() { return EdgeType::HasEdgeQuality(); } -static bool HasSSTopology() { return EdgeType::HasSSAdjacency(); } -static bool HasVSTopology() { return FaceType::HasVSAdjacency(); } -static bool HasTopology() { return HasSSTopology() || HasVSTopology(); } +static bool HasEETopology() { return EdgeType::HasEEAdjacency(); } +static bool HasVETopology() { return FaceType::HasVEAdjacency(); } +static bool HasTopology() { return HasEETopology() || HasVETopology(); } /// Initialize the imark-system of the faces @@ -151,7 +154,7 @@ void InitEdgeIMark() { EdgeIterator f; - for(f=segment.begin();f!=segment.end();++f) + for(f=edges.begin();f!=edges.end();++f) if( !(*f).IsDeleted() && (*f).IsR() && (*f).IsW() ) (*f).InitIMark(); } diff --git a/vcg/simplex/edge/base.h b/vcg/simplex/edge/base.h index 102f4e84..b3748a55 100644 --- a/vcg/simplex/edge/base.h +++ b/vcg/simplex/edge/base.h @@ -24,6 +24,9 @@ History $Log: not supported by cvs2svn $ +Revision 1.2 2004/05/10 14:02:29 ganovelli +created + Revision 1.1 2004/04/26 19:04:23 ganovelli created @@ -350,7 +353,7 @@ const Color4b WC(const int i) const **/ //@{ -#if (defined(__VCGLIB_EDGE_EA) && defined(__VCGLIB_EDGE_SA)) +#if (defined(__VCGLIB_EDGE_AE) && defined(__VCGLIB_EDGE_SA)) #error Error: You cannot specify face-to-face and shared topology together #endif @@ -359,7 +362,7 @@ const Color4b WC(const int i) const #endif protected: -#if defined(__VCGLIB_EDGE_EA) +#if defined(__VCGLIB_EDGE_AE) /// Vector of face pointer, it's used to indicate the adjacency relations (defines if FACE_A is defined) EDGENAME *ee[3]; // Facce adiacenti /// Index of the face in the arrival face @@ -382,17 +385,17 @@ public: - /** Return the pointer to the j-th adjacent face. + /** Return the pointer to the j-th adjacent edge. @param j Index of the edge. */ - inline EDGENAME * & E( const int j ) + inline EDGENAME * & EEp( const int j ) { assert( (_flags & DELETED) == 0 ); assert( (_flags & NOTREAD) == 0 ); assert( (_flags & NOTWRITE) == 0 ); assert(j>=0); assert(j<2); -#if defined(__VCGLIB_EDGE_EA) +#if defined(__VCGLIB_EDGE_AE) return ee[j]; #elif defined(__VCGLIB_EDGE_SA) return es[j]; @@ -403,13 +406,13 @@ public: #endif } - inline const EDGENAME * const & E( const int j ) const + inline const EDGENAME * const & EEp( const int j ) const { assert( (_flags & DELETED) == 0 ); assert( (_flags & NOTREAD) == 0 ); assert(j>=0); assert(j<2); -#if defined(__VCGLIB_EDGE_EA) +#if defined(__VCGLIB_EDGE_AE) return ee[j]; #elif defined(__VCGLIB_EDGE_SA) return es[j]; @@ -418,17 +421,17 @@ public: return (EDGENAME *)this; #endif } - inline EDGENAME * & E1( const int j ) { return F((j+1)%2);} - inline const EDGENAME * const& E1( const int j ) const { return F((j+1)%2);} + inline EDGENAME * & EEp1( const int j ) { return EEp((j+1)%2);} + inline const EDGENAME * const& EEp1( const int j ) const { return EEp((j+1)%2);} /** Return the pointer to the j-th adjacent face. @param j Index of the edge. */ - inline EDGENAME * & UberE( const int j ) + inline EDGENAME * & UberEEp( const int j ) { assert(j>=0); assert(j<2); -#if defined(__VCGLIB_EDGE_EA) +#if defined(__VCGLIB_EDGE_AE) return ee[j]; #elif defined(__VCGLIB_EDGE_SA) return es[j]; @@ -438,11 +441,11 @@ public: #endif } - inline const EDGENAME * const & UberE( const int j ) const + inline const EDGENAME * const & UberEEp( const int j ) const { assert(j>=0); assert(j<2); -#if defined(__VCGLIB_EDGE_EA) +#if defined(__VCGLIB_EDGE_AE) return ee[j]; #elif defined(__VCGLIB_EDGE_SA) return es[j]; @@ -453,7 +456,7 @@ public: } - inline EDGENAME * & Ev( const int j ) + inline EDGENAME * & VEp( const int j ) { assert( (_flags & DELETED) == 0 ); assert( (_flags & NOTREAD) == 0 ); @@ -470,7 +473,7 @@ public: #endif } - inline const EDGENAME * const & Ev( const int j ) const + inline const EDGENAME * const & VEp( const int j ) const { assert( (_flags & DELETED) == 0 ); assert( (_flags & NOTREAD) == 0 ); @@ -490,14 +493,14 @@ public: /** Return the index that the face have in the j-th adjacent face. @param j Index of the edge. */ - inline char & Z( const int j ) + inline char & EEi( const int j ) { assert( (_flags & DELETED) == 0 ); assert( (_flags & NOTREAD) == 0 ); assert( (_flags & NOTWRITE) == 0 ); assert(j>=0); assert(j<2); -#if defined(__VCGLIB_EDGE_EA) +#if defined(__VCGLIB_EDGE_AE) return zs[j]; #elif defined(__VCGLIB_EDGE_SA) return zs[j]; @@ -507,13 +510,13 @@ public: #endif } - inline const char & Z( const int j ) const + inline const char & EEi( const int j ) const { assert( (_flags & DELETED) == 0 ); assert( (_flags & NOTREAD) == 0 ); assert(j>=0); assert(j<2); -#if defined(__VCGLIB_EDGE_EA) +#if defined(__VCGLIB_EDGE_AE) return zs[j]; #elif defined(__VCGLIB_EDGE_SA) return zs[j]; @@ -530,7 +533,7 @@ public: { assert(j>=0); assert(j<2); -#if defined(__VCGLIB_EDGE_EA) +#if defined(__VCGLIB_EDGE_AE) return zs[j]; #elif defined(__VCGLIB_EDGE_SA) return zs[j]; @@ -544,7 +547,7 @@ public: { assert(j>=0); assert(j<2); -#if defined(__VCGLIB_EDGE_EA) +#if defined(__VCGLIB_EDGE_AE) return zs[j]; #elif defined(__VCGLIB_EDGE_SA) return zs[j]; @@ -555,7 +558,7 @@ public: } - inline char & Zv( const int j ) + inline char & VEi( const int j ) { assert( (_flags & DELETED) == 0 ); assert( (_flags & NOTREAD) == 0 ); @@ -572,7 +575,7 @@ public: #endif } - inline const char & Zv( const int j ) const + inline const char & VEi( const int j ) const { assert( (_flags & DELETED) == 0 ); assert( (_flags & NOTREAD) == 0 ); @@ -796,21 +799,21 @@ static bool HasEdgeColor() { #endif } static bool HasEEAdjacency() { -#if (defined(__VCGLIB_EDGE_EA) || defined(__VCGLIB_EDGE_EA)) +#if (defined(__VCGLIB_EDGE_AE) || defined(__VCGLIB_EDGE_AE)) return true; #else return false; #endif } static bool HasVEAdjacency() { -#if (defined(__VCGLIB_EDGE_VA) || defined(__VCGLIB_EDGE_EA)) +#if (defined(__VCGLIB_EDGE_VA) || defined(__VCGLIB_EDGE_AE)) return true; #else return false; #endif } static bool HasSharedAdjacency() { -#if defined(__VCGLIB_EDGE_EA) +#if defined(__VCGLIB_EDGE_AE) return true; #else return false; diff --git a/vcg/simplex/edge/pos.h b/vcg/simplex/edge/pos.h index 861e3398..0223e2fc 100644 --- a/vcg/simplex/edge/pos.h +++ b/vcg/simplex/edge/pos.h @@ -24,6 +24,9 @@ History $Log: not supported by cvs2svn $ +Revision 1.1 2004/05/10 14:01:56 ganovelli +created + ****************************************************************************/ @@ -60,8 +63,8 @@ public: void NextF() { EDGETYPE * t = e; - e = (EDGETYPE *)t->Ev(z); - z = t->Zv(z); + e = (EDGETYPE *)t->VEp(z); + z = t->VEi(z); } }; @@ -156,7 +159,7 @@ public: void FlipE() { assert( (e->V(0)==v) ||(e->V(1)==v)); - e = (e->V(0)==v)?e->E(0):e->E(1); + e = (e->V(0)==v)?e->EEp(0):e->EEp(1); } int Z(){ return (e->V(0)==v)?0:1;