Changed detach to FFdetach , compiled tested in manifold cases

This commit is contained in:
Nico Pietroni 2005-04-11 09:17:24 +00:00
parent a5becc1adc
commit 82240231a0
1 changed files with 19 additions and 11 deletions

View File

@ -24,6 +24,9 @@
History History
$Log: not supported by cvs2svn $ $Log: not supported by cvs2svn $
Revision 1.16 2005/03/18 16:35:53 fiorin
minor changes to comply gcc compiler
Revision 1.15 2004/10/22 13:41:06 fiorin Revision 1.15 2004/10/22 13:41:06 fiorin
Added CheckFlipEdge and FlipEdge Added CheckFlipEdge and FlipEdge
@ -138,29 +141,34 @@ if(FaceType::HasFFAdjacency())
@param e Index of the edge @param e Index of the edge
*/ */
template <class FaceType> template <class FaceType>
void Detach(FaceType & f, const int e) void FFDetach(FaceType & f, const int e)
{ {
assert(!IsBorder<FaceType>(e)); assert(!IsBorder<FaceType>(f,e));
Pos< FaceType > EPB(&f,e); // la faccia dall'altra parte Pos< FaceType > EPB(&f,e,f.V(e));//build the half edge
//vcg::face::Pos< FaceType > pos(&f, (z+2)%3, f.V2(z));
EPB.NextF(); EPB.NextF();
int cnt=0; int cnt=0;
///then in case of non manifold face continue to switch the
///set of faces that share the edge until I find the one that
///preceed the one I want to erase
while ( EPB.f->FFp(EPB.z) != &f) while ( EPB.f->FFp(EPB.z) != &f)
{ {
assert(!IsManifold<FaceType>(e)); // Si entra in questo loop solo se siamo in una situazione non manifold. assert(!IsManifold<FaceType>(f,e)); // Si entra in questo loop solo se siamo in una situazione non manifold.
assert(!EPB.f->IsBorder(EPB.z)); assert(!IsBorder<FaceType>(*EPB.f,e));
EPB.NextF(); EPB.NextF();
cnt++; cnt++;
} }
assert(EPB.f->FFp(EPB.z)==&f); assert(EPB.f->FFp(EPB.z)==&f);
EPB.f->FFp(EPB.z) = F(e); EPB.f->FFp(EPB.z) = f.FFp(e);
EPB.f->FFi(EPB.z) = Z(e); EPB.f->FFi(EPB.z) = f.FFi(e);
F(e) = &f; f.FFp(e) = &f;
Z(e) = e; f.FFi(e) = e;
EPB.f->SetM();
f.SetM();
} }