本文整理汇总了C++中BOP_Face::getSplit方法的典型用法代码示例。如果您正苦于以下问题:C++ BOP_Face::getSplit方法的具体用法?C++ BOP_Face::getSplit怎么用?C++ BOP_Face::getSplit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BOP_Face
的用法示例。
在下文中一共展示了BOP_Face::getSplit方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BOP_Face2Face
void BOP_Face2Face(BOP_Mesh *mesh, BOP_Faces *facesA, BOP_Faces *facesB)
{
for(unsigned int idxFaceA=0;idxFaceA<facesA->size();idxFaceA++) {
BOP_Face *faceA = (*facesA)[idxFaceA];
MT_Plane3 planeA = faceA->getPlane();
MT_Point3 p1 = mesh->getVertex(faceA->getVertex(0))->getPoint();
MT_Point3 p2 = mesh->getVertex(faceA->getVertex(1))->getPoint();
MT_Point3 p3 = mesh->getVertex(faceA->getVertex(2))->getPoint();
/* get (or create) bounding box for face A */
if( faceA->getBBox() == NULL )
faceA->setBBox(p1,p2,p3);
BOP_BBox *boxA = faceA->getBBox();
/* start checking B faces with the previously stored split index */
for(unsigned int idxFaceB=faceA->getSplit();
idxFaceB<facesB->size() && (faceA->getTAG() != BROKEN) && (faceA->getTAG() != PHANTOM);) {
BOP_Face *faceB = (*facesB)[idxFaceB];
faceA->setSplit(idxFaceB);
if ((faceB->getTAG() != BROKEN) && (faceB->getTAG() != PHANTOM)) {
/* get (or create) bounding box for face B */
if( faceB->getBBox() == NULL )
faceB->setBBox(mesh->getVertex(faceB->getVertex(0))->getPoint(),
mesh->getVertex(faceB->getVertex(1))->getPoint(),
mesh->getVertex(faceB->getVertex(2))->getPoint());
BOP_BBox *boxB = faceB->getBBox();
if (boxA->intersect(*boxB)) {
MT_Plane3 planeB = faceB->getPlane();
if (BOP_containsPoint(planeB,p1) &&
BOP_containsPoint(planeB,p2) &&
BOP_containsPoint(planeB,p3)) {
if (BOP_orientation(planeB,planeA)>0) {
BOP_intersectCoplanarFaces(mesh,facesB,faceA,faceB,false);
}
}
else {
BOP_intersectNonCoplanarFaces(mesh,facesA,facesB,faceA,faceB);
}
}
}
idxFaceB++;
}
}
// Clean broken faces from facesA
BOP_IT_Faces it;
it = facesA->begin();
while (it != facesA->end()) {
BOP_Face *face = *it;
if (face->getTAG() == BROKEN) it = facesA->erase(it);
else it++;
}
/*
it = facesB->begin();
while (it != facesB->end()) {
BOP_Face *face = *it;
if (face->getTAG() == BROKEN) it = facesB->erase(it);
else it++;
}
*/
}