From 7ff3b08e5fb3fc7dd7efbcb3cf365fea8607bf8a Mon Sep 17 00:00:00 2001 From: cignoni Date: Tue, 24 May 2011 09:42:10 +0000 Subject: [PATCH] updated to use pos instead explicit topology --- wrap/gl/glu_tessellator_cap.h | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/wrap/gl/glu_tessellator_cap.h b/wrap/gl/glu_tessellator_cap.h index 3675e377..c28a1d60 100644 --- a/wrap/gl/glu_tessellator_cap.h +++ b/wrap/gl/glu_tessellator_cap.h @@ -1,10 +1,12 @@ #ifndef GLU_TESSELLATOR_CAP_H #define GLU_TESSELLATOR_CAP_H #include "glu_tesselator.h" +#include namespace vcg { 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. // it assumes that boundary are planar and exploits glutessellator for the triangulaiton template @@ -20,19 +22,13 @@ void CapEdgeMesh(MeshType &em, MeshType &cm) { if (!em.edge[i].IsV()) { - EdgeType* startE=&(em.edge[i]); - int startI = 0; - int curI = startI; - EdgeType* curE = startE; - EdgeType* nextE; int nextI; + edge::Pos startE(&em.edge[i],0); + edge::Pos curE=startE; do { - curE->SetV(); - outline.push_back(curE->V(curI)->P()); - nextE=curE->EEp((curI+1)%2); - nextI=curE->EEi((curI+1)%2); - curE=nextE; - curI=nextI; + curE.E()->SetV(); + outline.push_back(curE.V()->P()); + curE.NextE(); nv++; } while(curE != startE);