Changed to trisplit to make it c++ 01 compliant
This commit is contained in:
parent
dc71da4424
commit
323362697a
|
@ -239,7 +239,7 @@ int main(int argc,char ** argv){
|
||||||
{
|
{
|
||||||
f1=f2;
|
f1=f2;
|
||||||
f2++;
|
f2++;
|
||||||
TriSplit<MyMesh,CenterPoint<MyMesh> >(vf[i],&(*f1),&(*f2),&(*vertp),CenterPoint<MyMesh>() );
|
TriSplit<MyMesh,CenterPointBarycenter<MyMesh> >::Apply(vf[i],&(*f1),&(*f2),&(*vertp),CenterPointBarycenter<MyMesh>() );
|
||||||
f1->SetS();
|
f1->SetS();
|
||||||
f2->SetS();
|
f2->SetS();
|
||||||
for(int itr=0;itr<3;itr++)
|
for(int itr=0;itr<3;itr++)
|
||||||
|
|
|
@ -882,14 +882,20 @@ struct CenterPointBarycenter : public std::unary_function<typename TRIMESH_TYPE:
|
||||||
|
|
||||||
|
|
||||||
template<class TRIMESH_TYPE, class CenterPoint=CenterPointBarycenter <TRIMESH_TYPE> >
|
template<class TRIMESH_TYPE, class CenterPoint=CenterPointBarycenter <TRIMESH_TYPE> >
|
||||||
void TriSplit(typename TRIMESH_TYPE::FacePointer f,
|
class TriSplit
|
||||||
typename TRIMESH_TYPE::FacePointer f1,typename TRIMESH_TYPE::FacePointer f2,
|
|
||||||
typename TRIMESH_TYPE::VertexPointer vB, CenterPoint Center)
|
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
|
typedef typename TRIMESH_TYPE::FaceType FaceType;
|
||||||
|
typedef typename TRIMESH_TYPE::VertexType VertexType;
|
||||||
|
|
||||||
|
static void Apply(FaceType *f,
|
||||||
|
FaceType * f1,FaceType * f2,
|
||||||
|
VertexType * vB, CenterPoint Center)
|
||||||
|
{
|
||||||
vB->P() = Center(f);
|
vB->P() = Center(f);
|
||||||
|
|
||||||
//i tre vertici della faccia da dividere
|
//i tre vertici della faccia da dividere
|
||||||
typename TRIMESH_TYPE::VertexType* V0,*V1,*V2;
|
VertexType *V0,*V1,*V2;
|
||||||
V0 = f->V(0);
|
V0 = f->V(0);
|
||||||
V1 = f->V(1);
|
V1 = f->V(1);
|
||||||
V2 = f->V(2);
|
V2 = f->V(2);
|
||||||
|
@ -912,7 +918,7 @@ void TriSplit(typename TRIMESH_TYPE::FacePointer f,
|
||||||
f->FFp(2)->FFp(f->FFi(2)) = f2;
|
f->FFp(2)->FFp(f->FFi(2)) = f2;
|
||||||
|
|
||||||
//adiacenza ff
|
//adiacenza ff
|
||||||
typename TRIMESH_TYPE::FacePointer FF0,FF1,FF2;
|
FaceType * FF0,*FF1,*FF2;
|
||||||
FF0 = f->FFp(0);
|
FF0 = f->FFp(0);
|
||||||
FF1 = f->FFp(1);
|
FF1 = f->FFp(1);
|
||||||
FF2 = f->FFp(2);
|
FF2 = f->FFp(2);
|
||||||
|
@ -949,7 +955,8 @@ void TriSplit(typename TRIMESH_TYPE::FacePointer f,
|
||||||
(*f2).FFp(2) = FF2;
|
(*f2).FFp(2) = FF2;
|
||||||
(*f2).FFi(2) = FFi2;
|
(*f2).FFi(2) = FFi2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}; // end class TriSplit
|
||||||
|
|
||||||
} // namespace tri
|
} // namespace tri
|
||||||
} // namespace vcg
|
} // namespace vcg
|
||||||
|
|
Loading…
Reference in New Issue