corrected vfdatach and added vf append
This commit is contained in:
parent
2cfbd024d8
commit
64c5cb56cf
|
|
@ -24,15 +24,6 @@
|
||||||
History
|
History
|
||||||
|
|
||||||
$Log: not supported by cvs2svn $
|
$Log: not supported by cvs2svn $
|
||||||
Revision 1.9 2004/07/15 12:03:07 ganovelli
|
|
||||||
minor changes
|
|
||||||
|
|
||||||
Revision 1.8 2004/07/15 11:26:48 ganovelli
|
|
||||||
VFDetach corrected
|
|
||||||
|
|
||||||
Revision 1.7 2004/05/12 12:23:23 cignoni
|
|
||||||
Conformed C++ syntax to GCC requirements
|
|
||||||
|
|
||||||
Revision 1.6 2004/05/11 16:03:18 ganovelli
|
Revision 1.6 2004/05/11 16:03:18 ganovelli
|
||||||
changed from "thi" to "&f" in Vfdetach
|
changed from "thi" to "&f" in Vfdetach
|
||||||
|
|
||||||
|
|
@ -169,8 +160,8 @@ void Attach(FaceType * &f, int z1, FaceType *&f2, int z2)
|
||||||
EPB.NextF();
|
EPB.NextF();
|
||||||
}
|
}
|
||||||
//Salvo i dati di f1 prima di sovrascrivere
|
//Salvo i dati di f1 prima di sovrascrivere
|
||||||
FaceType *f1prec = f.FFp(z1);
|
FaceType *f1prec = f->FFp(z1);
|
||||||
int z1prec = f.FFi(z1);
|
int z1prec = f->FFi(z1);
|
||||||
//Aggiorno f1
|
//Aggiorno f1
|
||||||
f->FFp(z1) = TEPB.f->FFp(TEPB.z);
|
f->FFp(z1) = TEPB.f->FFp(TEPB.z);
|
||||||
f->FFi(z1) = TEPB.f->FFi(TEPB.z);
|
f->FFi(z1) = TEPB.f->FFi(TEPB.z);
|
||||||
|
|
@ -225,34 +216,52 @@ void Swap (SwapFaceType &f, const int z )
|
||||||
// NOTA funziona SOLO per la topologia VF!!!
|
// NOTA funziona SOLO per la topologia VF!!!
|
||||||
// usata nelle classi di collapse
|
// usata nelle classi di collapse
|
||||||
template <class FaceType>
|
template <class FaceType>
|
||||||
void VFDetach(FaceType & f, int z)
|
void VFDetach(FaceType* &f, int z)
|
||||||
{
|
{
|
||||||
if(f.V(z)->VFp()==&f ) //if it is the first face detach from the begin
|
if(f->V(z)->VFp()==f )
|
||||||
{
|
{
|
||||||
int fz = f.V(z)->VFi();
|
int fz = f->V(z)->VFi();
|
||||||
f.V(z)->VFp() = f.VFp(fz);
|
f->V(z)->VFp() = (FaceType*) f->VFp(fz);
|
||||||
f.V(z)->VFi() = f.VFi(fz);
|
f->V(z)->VFi() = f->VFi(fz);
|
||||||
}
|
}
|
||||||
else // scan the list of faces in order to finde the current face f to be detached
|
else
|
||||||
{
|
{
|
||||||
VFIterator<FaceType> x(f.V(z)->VFp(),f.V(z)->VFi());
|
|
||||||
VFIterator<FaceType> y;
|
|
||||||
|
|
||||||
for(;;)
|
vcg::face::VFIterator<FaceType> x,y;
|
||||||
{
|
|
||||||
|
x.f = f->V(z)->VFp();
|
||||||
|
x.z = f->V(z)->VFi();
|
||||||
y = x;
|
y = x;
|
||||||
++x;
|
y++;
|
||||||
assert(x.f!=0);
|
while (!y.End())
|
||||||
if(x.f==&f) // found!
|
|
||||||
{
|
{
|
||||||
y.f->VFp(y.z) = f.VFp(z);
|
assert(y.f!=0);
|
||||||
y.f->VFi(y.z) = f.VFi(z);
|
if(y.f==f)
|
||||||
|
{
|
||||||
|
x.f->VFp(x.z) = y.f->VFp(y.z);
|
||||||
|
x.f->VFi(x.z) = y.f->VFi(y.z);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
x++;
|
||||||
|
y++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// Append a face in VF list of vertex f->V(z)
|
||||||
|
template <class FaceType>
|
||||||
|
void VFAppend(FaceType* & f, int z)
|
||||||
|
{
|
||||||
|
FaceType::VertexType *v=f->V(z);
|
||||||
|
FaceType *f0=v->VFp();
|
||||||
|
int z0=v->VFi();
|
||||||
|
v->VFp()=f;
|
||||||
|
v->VFi()=z;
|
||||||
|
f->VFp(z)=f0;
|
||||||
|
f->VFi(z)=z0;
|
||||||
|
}
|
||||||
|
|
||||||
/*@}*/
|
/*@}*/
|
||||||
} // end namespace
|
} // end namespace
|
||||||
} // end namespace
|
} // end namespace
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue