updated to use pos instead explicit topology

This commit is contained in:
Paolo Cignoni 2011-05-24 09:42:10 +00:00
parent e2d800f89f
commit 7ff3b08e5f
1 changed files with 7 additions and 11 deletions

View File

@ -1,10 +1,12 @@
#ifndef GLU_TESSELLATOR_CAP_H #ifndef GLU_TESSELLATOR_CAP_H
#define GLU_TESSELLATOR_CAP_H #define GLU_TESSELLATOR_CAP_H
#include "glu_tesselator.h" #include "glu_tesselator.h"
#include <vcg/simplex/edge/pos.h>
namespace vcg { namespace vcg {
namespace tri { namespace tri {
// This function take a mesh with one or more boundary stored as edges, and fill another mesh with a triangulation of that boundaries. // This function take a mesh with one or more boundary stored as edges, and fill another mesh with a triangulation of that boundaries.
// it assumes that boundary are planar and exploits glutessellator for the triangulaiton // it assumes that boundary are planar and exploits glutessellator for the triangulaiton
template <class MeshType> template <class MeshType>
@ -20,19 +22,13 @@ void CapEdgeMesh(MeshType &em, MeshType &cm)
{ {
if (!em.edge[i].IsV()) if (!em.edge[i].IsV())
{ {
EdgeType* startE=&(em.edge[i]); edge::Pos<EdgeType> startE(&em.edge[i],0);
int startI = 0; edge::Pos<EdgeType> curE=startE;
int curI = startI;
EdgeType* curE = startE;
EdgeType* nextE; int nextI;
do do
{ {
curE->SetV(); curE.E()->SetV();
outline.push_back(curE->V(curI)->P()); outline.push_back(curE.V()->P());
nextE=curE->EEp((curI+1)%2); curE.NextE();
nextI=curE->EEi((curI+1)%2);
curE=nextE;
curI=nextI;
nv++; nv++;
} }
while(curE != startE); while(curE != startE);