From 2b8a829099692905b807bd56d97315fb02955e1d Mon Sep 17 00:00:00 2001 From: nicopietroni Date: Sun, 24 May 2015 14:51:22 +0000 Subject: [PATCH] added NextCrease function to follows creases --- vcg/simplex/face/pos.h | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/vcg/simplex/face/pos.h b/vcg/simplex/face/pos.h index 891eb863..2fe02e11 100644 --- a/vcg/simplex/face/pos.h +++ b/vcg/simplex/face/pos.h @@ -285,13 +285,41 @@ public: //assert(f->FFp(z)==f); // f is border along j } + /// Finds the next Crease half-edge border + /// TODO change crease flag with something more generic (per edge) + void NextCrease( ) + { + assert(f->V(f->Prev(z))!=v && (f->V(f->Next(z))==v || f->V(z)==v)); + assert(IsCrease()); // f is border along j + // Si deve cambiare faccia intorno allo stesso vertice v + //finche' non si trova una faccia di bordo. + do + { + FlipE(); + if (!IsCrease()) FlipF(); + } + while(!IsCrease()); + + // L'edge j e' di bordo e deve contenere v + assert(IsCrease() &&( f->V(z)==v || f->V(f->Next(z))==v )); + + FlipV(); + assert(f->V(f->Prev(z))!=v && (f->V(f->Next(z))==v || f->V(z)==v)); + } + /// Checks if the half-edge is of border - bool IsBorder() + bool IsBorder()const { return face::IsBorder(*f,z); } - bool IsFaux() + /// Checks if the half-edge is of crease + bool IsCrease() const + { + return f->IsCrease(z); + } + + bool IsFaux() const { return (f->IsF(z)); }