Include header cleaning and reordering.
This commit is contained in:
parent
ae18013dd2
commit
cbc36cf147
|
@ -26,7 +26,6 @@
|
|||
|
||||
#include<vcg/simplex/face/pos.h>
|
||||
#include<vcg/simplex/face/topology.h>
|
||||
#include<vcg/complex/allocate.h>
|
||||
|
||||
namespace vcg{
|
||||
namespace tri{
|
||||
|
@ -54,20 +53,20 @@ private:
|
|||
template <class TRI_MESH_TYPE, class VertexPair>
|
||||
class EdgeCollapser
|
||||
{
|
||||
public:
|
||||
public:
|
||||
/// The tetrahedral mesh type
|
||||
typedef TRI_MESH_TYPE TriMeshType;
|
||||
/// The face type
|
||||
typedef typename TriMeshType::FaceType FaceType;
|
||||
/// The vertex type
|
||||
typedef typename FaceType::VertexType VertexType;
|
||||
/// The vertex type
|
||||
typedef typename FaceType::VertexType VertexType;
|
||||
typedef typename FaceType::VertexPointer VertexPointer;
|
||||
/// The vertex iterator type
|
||||
typedef typename TriMeshType::VertexIterator VertexIterator;
|
||||
/// The tetra iterator type
|
||||
typedef typename TriMeshType::FaceIterator FaceIterator;
|
||||
/// The coordinate type
|
||||
typedef typename FaceType::VertexType::CoordType CoordType;
|
||||
typedef typename FaceType::VertexType::CoordType CoordType;
|
||||
/// The scalar type
|
||||
typedef typename TriMeshType::VertexType::ScalarType ScalarType;
|
||||
///the container of tetrahedron type
|
||||
|
@ -76,12 +75,12 @@ class EdgeCollapser
|
|||
typedef typename TriMeshType::VertContainer VertContainer;
|
||||
///half edge type
|
||||
//typedef typename TriMeshType::FaceType::EdgeType EdgeType;
|
||||
/// vector of pos
|
||||
/// vector of pos
|
||||
// typedef typename std::vector<EdgeType> EdgeVec;
|
||||
///of VFIterator
|
||||
typedef typename vcg::face::VFIterator<FaceType> VFI;
|
||||
/// vector of VFIterator
|
||||
typedef typename std::vector<vcg::face::VFIterator<FaceType> > VFIVec;
|
||||
///of VFIterator
|
||||
typedef typename vcg::face::VFIterator<FaceType> VFI;
|
||||
/// vector of VFIterator
|
||||
typedef typename std::vector<vcg::face::VFIterator<FaceType> > VFIVec;
|
||||
private:
|
||||
struct EdgeSet
|
||||
{
|
||||
|
@ -92,40 +91,40 @@ private:
|
|||
};
|
||||
|
||||
static void FindSets(VertexPair &p, EdgeSet &es)
|
||||
{
|
||||
VertexType * v0 = p.V(0);
|
||||
VertexType * v1 = p.V(1);
|
||||
{
|
||||
VertexType * v0 = p.V(0);
|
||||
VertexType * v1 = p.V(1);
|
||||
|
||||
es.AV0().clear(); // Facce incidenti in v0
|
||||
es.AV1().clear(); // Facce incidenti in v1
|
||||
es.AV01().clear(); // Facce incidenti in v0 e v1
|
||||
|
||||
VFI x;
|
||||
VFI x;
|
||||
|
||||
for( x.f = v0->VFp(), x.z = v0->VFi(); x.f!=0; ++x)
|
||||
{
|
||||
int zv1 = -1;
|
||||
for( x.f = v0->VFp(), x.z = v0->VFi(); x.f!=0; ++x)
|
||||
{
|
||||
int zv1 = -1;
|
||||
|
||||
for(int j=0;j<3;++j)
|
||||
if( x.f->V(j)==&*v1 ) {
|
||||
zv1 = j;
|
||||
break;
|
||||
}
|
||||
for(int j=0;j<3;++j)
|
||||
if( x.f->V(j)==&*v1 ) {
|
||||
zv1 = j;
|
||||
break;
|
||||
}
|
||||
if(zv1==-1) es.AV0().push_back( x ); // la faccia x.f non ha il vertice v1 => e' incidente solo in v0
|
||||
else es.AV01().push_back( x );
|
||||
}
|
||||
}
|
||||
|
||||
for( x.f = v1->VFp(), x.z = v1->VFi(); x.f!=0; ++x )
|
||||
{
|
||||
int zv0 = -1;
|
||||
for( x.f = v1->VFp(), x.z = v1->VFi(); x.f!=0; ++x )
|
||||
{
|
||||
int zv0 = -1;
|
||||
|
||||
for(int j=0;j<3;++j)
|
||||
if( x.f->V(j)==&*v0 ) {
|
||||
zv0 = j;
|
||||
break;
|
||||
}
|
||||
for(int j=0;j<3;++j)
|
||||
if( x.f->V(j)==&*v0 ) {
|
||||
zv0 = j;
|
||||
break;
|
||||
}
|
||||
if(zv0==-1) es.AV1().push_back( x ); // la faccia x.f non ha il vertice v1 => e' incidente solo in v0
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
Link Conditions test, as described in
|
||||
|
@ -233,36 +232,36 @@ public:
|
|||
// remember that v[0] will be deleted and v[1] will survive (eventually with a new position)
|
||||
// hint to do a 'collapse onto a vertex simply pass p as the position of the surviving vertex
|
||||
static int Do(TriMeshType &m, VertexPair & c, const Point3<ScalarType> &p)
|
||||
{
|
||||
{
|
||||
EdgeSet es;
|
||||
FindSets(c,es);
|
||||
typename VFIVec::iterator i;
|
||||
typename VFIVec::iterator i;
|
||||
int n_face_del =0 ;
|
||||
|
||||
for(i=es.AV01().begin();i!=es.AV01().end();++i)
|
||||
{
|
||||
FaceType & f = *((*i).f);
|
||||
assert(f.V((*i).z) == c.V(0));
|
||||
vcg::face::VFDetach(f,((*i).z+1)%3);
|
||||
vcg::face::VFDetach(f,((*i).z+2)%3);
|
||||
Allocator<TriMeshType>::DeleteFace(m,f);
|
||||
{
|
||||
FaceType & f = *((*i).f);
|
||||
assert(f.V((*i).z) == c.V(0));
|
||||
vcg::face::VFDetach(f,((*i).z+1)%3);
|
||||
vcg::face::VFDetach(f,((*i).z+2)%3);
|
||||
Allocator<TriMeshType>::DeleteFace(m,f);
|
||||
n_face_del++;
|
||||
}
|
||||
|
||||
//set Vertex Face topology
|
||||
//set Vertex Face topology
|
||||
for(i=es.AV0().begin();i!=es.AV0().end();++i)
|
||||
{
|
||||
(*i).f->V((*i).z) = c.V(1); // In tutte le facce incidenti in v0, si sostituisce v0 con v1
|
||||
(*i).f->VFp((*i).z) = (*i).f->V((*i).z)->VFp(); // e appendo la lista di facce incidenti in v1 a questa faccia
|
||||
(*i).f->VFi((*i).z) = (*i).f->V((*i).z)->VFi();
|
||||
(*i).f->V((*i).z)->VFp() = (*i).f;
|
||||
(*i).f->V((*i).z)->VFi() = (*i).z;
|
||||
}
|
||||
{
|
||||
(*i).f->V((*i).z) = c.V(1); // In tutte le facce incidenti in v0, si sostituisce v0 con v1
|
||||
(*i).f->VFp((*i).z) = (*i).f->V((*i).z)->VFp(); // e appendo la lista di facce incidenti in v1 a questa faccia
|
||||
(*i).f->VFi((*i).z) = (*i).f->V((*i).z)->VFi();
|
||||
(*i).f->V((*i).z)->VFp() = (*i).f;
|
||||
(*i).f->V((*i).z)->VFi() = (*i).z;
|
||||
}
|
||||
|
||||
Allocator<TriMeshType>::DeleteVertex(m,*(c.V(0)));
|
||||
c.V(1)->P()=p;
|
||||
return n_face_del;
|
||||
}
|
||||
Allocator<TriMeshType>::DeleteVertex(m,*(c.V(0)));
|
||||
c.V(1)->P()=p;
|
||||
return n_face_del;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -25,21 +25,19 @@
|
|||
****************************************************************************/
|
||||
|
||||
#include <vcg/simplex/face/jumping_pos.h>
|
||||
#include <vcg/complex/allocate.h>
|
||||
#include <vcg/complex/algorithms/update/flag.h>
|
||||
#include <vector>
|
||||
|
||||
namespace vcg
|
||||
{
|
||||
namespace tri
|
||||
{
|
||||
|
||||
/** \addtogroup trimesh */
|
||||
/*@{*/
|
||||
/*@{*/
|
||||
/** Class Mesh.
|
||||
This is class for extracting n-ring of vertexes or faces, starting from a vertex of a mesh.
|
||||
*/
|
||||
/** \addtogroup trimesh */
|
||||
/*@{*/
|
||||
/*@{*/
|
||||
/** Class Mesh.
|
||||
This is class for extracting n-ring of vertexes or faces, starting from a vertex of a mesh.
|
||||
*/
|
||||
template <class MeshType>
|
||||
class Nring
|
||||
{
|
||||
|
@ -70,7 +68,7 @@ public:
|
|||
|
||||
~Nring()
|
||||
{
|
||||
clear();
|
||||
clear();
|
||||
}
|
||||
|
||||
void insertAndFlag1Ring(VertexType* v)
|
||||
|
|
|
@ -19,20 +19,6 @@
|
|||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) *
|
||||
* for more details. *
|
||||
* *
|
||||
****************************************************************************/
|
||||
/****************************************************************************
|
||||
History
|
||||
|
||||
$Log: not supported by cvs2svn $
|
||||
Revision 1.3 2007/01/11 10:12:19 cignoni
|
||||
Removed useless and conflicting inclusion of face.h
|
||||
|
||||
Revision 1.2 2006/05/25 09:39:09 cignoni
|
||||
missing std and other gcc detected syntax errors
|
||||
|
||||
Revision 1.1 2006/05/21 06:59:13 cignoni
|
||||
Initial Commit
|
||||
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __VCGLIB_TRIMESH_STAT
|
||||
|
@ -44,11 +30,8 @@ Initial Commit
|
|||
#include <vcg/math/histogram.h>
|
||||
#include <vcg/simplex/face/pos.h>
|
||||
#include <vcg/simplex/face/topology.h>
|
||||
#include <vcg/complex/complex.h>
|
||||
#include <vcg/complex/algorithms/closest.h>
|
||||
#include <vcg/space/index/grid_static_ptr.h>
|
||||
#include <vcg/complex/allocate.h>
|
||||
#include <vcg/complex/algorithms/update/flag.h>
|
||||
|
||||
|
||||
namespace vcg {
|
||||
|
|
Loading…
Reference in New Issue