本文整理汇总了C++中cmesho::FacePointer::FFp方法的典型用法代码示例。如果您正苦于以下问题:C++ FacePointer::FFp方法的具体用法?C++ FacePointer::FFp怎么用?C++ FacePointer::FFp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cmesho::FacePointer
的用法示例。
在下文中一共展示了FacePointer::FFp方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DeleteCollinearBorder
int DeleteCollinearBorder(CMeshO &m, float threshold)
{
int total=0;
CMeshO::FaceIterator fi;
for(fi=m.face.begin();fi!=m.face.end();++fi)
if(!(*fi).IsD())
{
for(int i=0;i<3;++i)
{
if(face::IsBorder(*fi,i) && !face::IsBorder(*fi,(i+1)%3))
{
CMeshO::VertexPointer V0= (*fi).V0(i);
CMeshO::VertexPointer V1= (*fi).V1(i);
CMeshO::VertexPointer V2=0;
CMeshO::FacePointer fadj = (*fi).FFp((i+1)%3);
int adjBordInd = (*fi).FFi((i+1)%3);
if(fadj->V1(adjBordInd) == V1)
V2 = fadj->V2(adjBordInd);
else
continue; // non coerent face ordering.
if(face::IsBorder(*fadj,(adjBordInd+1)%3))
{
// the colinearity test;
Point3f pp;
float dist;
SegmentPointDistance(Segment3f(V0->cP(),V2->cP()),V1->cP(),pp,dist);
if(dist* threshold < Distance(V0->cP(),V2->cP()) )
{
(*fi).V1(i)=V2;
if(face::IsBorder(*fadj,(adjBordInd+2)%3))
{
(*fi).FFp((i+1)%3)=&*fi;
(*fi).FFi((i+1)%3)=(i+1)%3;
}
else
{
CMeshO::FacePointer fj = fadj->FFp((adjBordInd+2)%3);
int ij = fadj->FFi((adjBordInd+2)%3);
(*fi).FFp((i+1)%3)= fj;
(*fi).FFi((i+1)%3)= ij;
fj->FFp(ij)=&*fi;
fj->FFi(ij)=(i+1)%3;
}
tri::Allocator<CMeshO>::DeleteFace(m,*fadj);
total++;
}
}
}
}
}
return total;
}
示例2: ComputeIntersection
/**
@def Compute the intersection of the segment from p1 to p2 and the face f
@param CoordType p1 - position of the first point
@param Coordtype p2 - position of the second point
@param Facepointer f - pointer to the face
@param CoordType int_point - intersection point this is a return parameter for the function.
@param FacePointer face - pointer to the new face
@return the intersection edge index if there is an intersection -1 elsewhere
Step
*/
int ComputeIntersection(CMeshO::CoordType p1,CMeshO::CoordType p2,CMeshO::FacePointer &f,CMeshO::FacePointer &new_f,CMeshO::CoordType &int_point){
CMeshO::CoordType v0=f->V(0)->P();
CMeshO::CoordType v1=f->V(1)->P();
CMeshO::CoordType v2=f->V(2)->P();
float dist[3];
Point3f int_points[3];
dist[0]=PSDist(p2,v0,v1,int_points[0]);
dist[1]=PSDist(p2,v1,v2,int_points[1]);
dist[2]=PSDist(p2,v2,v0,int_points[2]);
int edge=-1;
if(dist[0]<dist[1]){
if(dist[0]<dist[2]) edge=0;
else edge=2;
}else{
if(dist[1]<dist[2]) edge=1;
else edge=2;
}
CMeshO::VertexType* v;
if(Distance(int_points[edge],f->V(edge)->P())<Distance(int_points[edge],f->V((edge+1) % 3)->P())) v=f->V(edge);
else v=f->V((edge+1) % 3);
vcg::face::Pos<CMeshO::FaceType> p(f,edge,v);
new_f=f->FFp(edge);
if(new_f==f) return -1;
if(Distance(int_points[edge],v->P())<EPSILON){
p.FlipF();
CMeshO::FacePointer tmp_f=p.F();
int n_face=0;
while(tmp_f!=f){
p.FlipE();
p.FlipF();
tmp_f=p.F();
n_face++;
}
if(n_face!=0){
int r=(rand()%(n_face-1))+2;
for(int i=0;i<r;i++){
p.FlipE();
p.FlipF();
}
new_f=p.F();
}
}
int_point=GetSafePosition(int_points[edge],new_f);
return edge;
}