Cleaned up the edge allocator and added two small wrapper for adding and initializing a single face or edge with the vertex pointers
This commit is contained in:
parent
f85ce4e334
commit
c5549f607a
|
@ -263,29 +263,22 @@ namespace tri {
|
|||
pu.newEnd = &m.edge.back()+1;
|
||||
if(pu.NeedUpdate())
|
||||
{
|
||||
FaceIterator fi;
|
||||
for (fi=m.face.begin(); fi!=m.face.end(); ++fi){
|
||||
//if(HasFHEAdjacency(m))
|
||||
// pu.Update((*fi).FHEp());
|
||||
if(HasFEAdjacency(m))
|
||||
for (FaceIterator fi=m.face.begin(); fi!=m.face.end(); ++fi){
|
||||
if(!(*fi).IsD())
|
||||
for(int i=0; i < (*fi).VN(); ++i)
|
||||
if ((*fi).cFEp(i)!=0) pu.Update((*fi).FEp(i));
|
||||
}
|
||||
|
||||
VertexIterator vi;
|
||||
if(HasVEAdjacency(m))
|
||||
for (vi=m.vert.begin(); vi!=m.vert.end(); ++vi)
|
||||
for (VertexIterator vi=m.vert.begin(); vi!=m.vert.end(); ++vi)
|
||||
if(!(*vi).IsD())
|
||||
if ((*vi).cVEp()!=0) pu.Update((*vi).VEp());
|
||||
|
||||
HEdgeIterator hi;
|
||||
if(HasHEAdjacency(m))
|
||||
for (hi=m.hedge.begin(); hi!=m.hedge.end(); ++hi)
|
||||
for (HEdgeIterator hi=m.hedge.begin(); hi!=m.hedge.end(); ++hi)
|
||||
if(!(*hi).IsD())
|
||||
if ((*hi).cHEp()!=0) pu.Update((*hi).HEp());
|
||||
|
||||
|
||||
|
||||
}
|
||||
unsigned int siz=(unsigned int)m.edge.size()-n;
|
||||
|
||||
|
@ -295,6 +288,17 @@ namespace tri {
|
|||
return last;// deve restituire l'iteratore alla prima faccia aggiunta;
|
||||
}
|
||||
|
||||
/** Function to add a single edge to the mesh. and initializing it with two VertexPointer
|
||||
*/
|
||||
static EdgeIterator AddEdge(MeshType &m, VertexPointer v0, VertexPointer v1)
|
||||
{
|
||||
EdgeIterator ei= AddEdges(m, 1);
|
||||
ei->V(0)=v0;
|
||||
ei->V(1)=v1;
|
||||
return ei;
|
||||
}
|
||||
|
||||
|
||||
/** Function to add n edges to the mesh.
|
||||
First wrapper, with no parameters
|
||||
*/
|
||||
|
@ -423,6 +427,19 @@ namespace tri {
|
|||
}
|
||||
|
||||
|
||||
/** Function to add a face to the mesh and initializing it with the three given VertexPointers
|
||||
First wrapper, with no parameters
|
||||
*/
|
||||
static FaceIterator AddFace(MeshType &m, VertexPointer v0, VertexPointer v1, VertexPointer v2)
|
||||
{
|
||||
PointerUpdater<FacePointer> pu;
|
||||
FaceIterator fi = AddFaces(m,1,pu);
|
||||
fi->V(0)=v0;
|
||||
fi->V(1)=v1;
|
||||
fi->V(2)=v2;
|
||||
return fi;
|
||||
}
|
||||
|
||||
/** Function to add n faces to the mesh.
|
||||
First wrapper, with no parameters
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue