本文整理汇总了C++中BOP_Face::getEdgeIndex方法的典型用法代码示例。如果您正苦于以下问题:C++ BOP_Face::getEdgeIndex方法的具体用法?C++ BOP_Face::getEdgeIndex怎么用?C++ BOP_Face::getEdgeIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BOP_Face
的用法示例。
在下文中一共展示了BOP_Face::getEdgeIndex方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: triangulate
/**
* Triangulates the input face according to the specified segment.
* @param mesh mesh that contains the faces, edges and vertices
* @param faces set of faces that contains the original face and the new triangulated faces
* @param face face to be triangulated
* @param s segment used to triangulate face
*/
void triangulate(BOP_Mesh *mesh, BOP_Faces *faces, BOP_Face *face, BOP_Segment s)
{
if (BOP_Segment::isUndefined(s.m_cfg1)) {
// Nothing to do
}
else if (BOP_Segment::isVertex(s.m_cfg1)) {
// VERTEX(v1) + VERTEX(v2) => nothing to do
}
else if (BOP_Segment::isEdge(s.m_cfg1)) {
if (BOP_Segment::isVertex(s.m_cfg2) || BOP_Segment::isUndefined(s.m_cfg2)) {
// EDGE(v1) + VERTEX(v2)
BOP_Edge *edge = mesh->getEdge(face,BOP_Segment::getEdge(s.m_cfg1));
BOP_triangulateA(mesh,faces,face,s.m_v1,BOP_Segment::getEdge(s.m_cfg1));
BOP_Face *opposite = BOP_getOppositeFace(mesh,faces,face,edge);
if (opposite != NULL) {
unsigned int e;
opposite->getEdgeIndex(edge->getVertex1(), edge->getVertex2(),e);
BOP_triangulateA(mesh, faces, opposite, s.m_v1, e);
}
}
else {
// EDGE(v1) + EDGE(v2)
if (BOP_Segment::getEdge(s.m_cfg1) == BOP_Segment::getEdge(s.m_cfg2)) {
// EDGE(v1) == EDGE(v2)
BOP_Edge *edge = mesh->getEdge(face,BOP_Segment::getEdge(s.m_cfg1));
BOP_triangulateD(mesh, faces, face, s.m_v1, s.m_v2,
BOP_Segment::getEdge(s.m_cfg1));
BOP_Face *opposite = BOP_getOppositeFace(mesh,faces,face,edge);
if (opposite != NULL) {
unsigned int e;
opposite->getEdgeIndex(edge->getVertex1(), edge->getVertex2(),e);
BOP_triangulateD(mesh, faces, opposite, s.m_v1, s.m_v2, e);
}
}
else { // EDGE(v1) != EDGE(v2)
BOP_Edge *edge1 = mesh->getEdge(face,BOP_Segment::getEdge(s.m_cfg1));
BOP_Edge *edge2 = mesh->getEdge(face,BOP_Segment::getEdge(s.m_cfg2));
BOP_triangulateE(mesh, faces, face, s.m_v1, s.m_v2,
BOP_Segment::getEdge(s.m_cfg1),
BOP_Segment::getEdge(s.m_cfg2));
BOP_Face *opposite = BOP_getOppositeFace(mesh,faces,face,edge1);
if (opposite != NULL) {
unsigned int e;
opposite->getEdgeIndex(edge1->getVertex1(), edge1->getVertex2(),e);
BOP_triangulateA(mesh, faces, opposite, s.m_v1, e);
}
opposite = BOP_getOppositeFace(mesh,faces,face,edge2);
if (opposite != NULL) {
unsigned int e;
opposite->getEdgeIndex(edge2->getVertex1(), edge2->getVertex2(),e);
BOP_triangulateA(mesh, faces, opposite, s.m_v2, e);
}
}
}
}
else if (BOP_Segment::isIn(s.m_cfg1)) {
if (BOP_Segment::isVertex(s.m_cfg2) || BOP_Segment::isUndefined(s.m_cfg2)) {
// IN(v1) + VERTEX(v2)
BOP_triangulateB(mesh,faces,face,s.m_v1);
}
else if (BOP_Segment::isEdge(s.m_cfg2)) {
// IN(v1) + EDGE(v2)
BOP_Edge *edge = mesh->getEdge(face,BOP_Segment::getEdge(s.m_cfg2));
BOP_triangulateF(mesh,faces,face,s.m_v1,s.m_v2,BOP_Segment::getEdge(s.m_cfg2));
BOP_Face *opposite = BOP_getOppositeFace(mesh,faces,face,edge);
if (opposite != NULL) {
unsigned int e;
opposite->getEdgeIndex(edge->getVertex1(), edge->getVertex2(),e);
BOP_triangulateA(mesh, faces, opposite, s.m_v2, e);
}
}
else // IN(v1) + IN(v2)
BOP_triangulateC(mesh,faces,face,s.m_v1,s.m_v2);
}
}