本文整理汇总了C++中FEdge::setNextEdge方法的典型用法代码示例。如果您正苦于以下问题:C++ FEdge::setNextEdge方法的具体用法?C++ FEdge::setNextEdge怎么用?C++ FEdge::setNextEdge使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FEdge
的用法示例。
在下文中一共展示了FEdge::setNextEdge方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FindNextWEdge
ViewEdge *ViewEdgeXBuilder::BuildSharpViewEdge(const OWXEdge& iWEdge)
{
// Start a new sharp chain edges
ViewEdge *newVEdge = new ViewEdge;
newVEdge->setId(_currentViewId);
++_currentViewId;
unsigned size = 0;
_pCurrentVShape->AddEdge(newVEdge);
// Find first edge:
OWXEdge firstWEdge = iWEdge;
/* OWXEdge previousWEdge = firstWEdge; */ /* UNUSED */
OWXEdge currentWEdge = firstWEdge;
list<OWXEdge> edgesChain;
#if 0 /* TK 02-Sep-2012 Experimental fix for incorrect view edge visibility. */
// bidirectional chaining
// first direction:
while (!stopSharpViewEdge(currentWEdge.e)) {
edgesChain.push_back(currentWEdge);
++size;
currentWEdge.e->userdata = (void *)1; // processed
// Find the next edge!
currentWEdge = FindNextWEdge(currentWEdge);
}
OWXEdge endWEdge = edgesChain.back();
// second direction
currentWEdge = FindPreviousWEdge(firstWEdge);
while (!stopSharpViewEdge(currentWEdge.e)) {
edgesChain.push_front(currentWEdge);
++size;
currentWEdge.e->userdata = (void *)1; // processed
// Find the previous edge!
currentWEdge = FindPreviousWEdge(currentWEdge);
}
#else
edgesChain.push_back(currentWEdge);
++size;
currentWEdge.e->userdata = (void *)1; // processed
OWXEdge endWEdge = edgesChain.back();
#endif
firstWEdge = edgesChain.front();
// build FEdges
FEdge *feprevious = NULL;
FEdge *fefirst = NULL;
FEdge *fe = NULL;
for (list<OWXEdge>::iterator we = edgesChain.begin(), weend = edgesChain.end(); we != weend; ++we) {
fe = BuildSharpFEdge(feprevious, (*we));
fe->setViewEdge(newVEdge);
if (!fefirst)
fefirst = fe;
feprevious = fe;
}
// Store the chain starting edge:
_pCurrentSShape->AddChain(fefirst);
newVEdge->setNature(iWEdge.e->nature());
newVEdge->setFEdgeA(fefirst);
newVEdge->setFEdgeB(fe);
// is it a closed loop ?
if ((firstWEdge == endWEdge) && (size != 1)) {
fefirst->setPreviousEdge(fe);
fe->setNextEdge(fefirst);
newVEdge->setA(0);
newVEdge->setB(0);
}
else {
ViewVertex *vva = MakeViewVertex(fefirst->vertexA());
ViewVertex *vvb = MakeViewVertex(fe->vertexB());
((NonTVertex *)vva)->AddOutgoingViewEdge(newVEdge);
((NonTVertex *)vvb)->AddIncomingViewEdge(newVEdge);
newVEdge->setA(vva);
newVEdge->setB(vvb);
}
return newVEdge;
}
示例2: FindNextFaceLayer
ViewEdge *ViewEdgeXBuilder::BuildSmoothViewEdge(const OWXFaceLayer& iFaceLayer)
{
// Find first edge:
OWXFaceLayer first = iFaceLayer;
OWXFaceLayer currentFace = first;
// bidirectional chaining.
// first direction
list<OWXFaceLayer> facesChain;
unsigned size = 0;
while (!stopSmoothViewEdge(currentFace.fl)) {
facesChain.push_back(currentFace);
++size;
currentFace.fl->userdata = (void *)1; // processed
// Find the next edge!
currentFace = FindNextFaceLayer(currentFace);
}
OWXFaceLayer end = facesChain.back();
// second direction
currentFace = FindPreviousFaceLayer(first);
while (!stopSmoothViewEdge(currentFace.fl)) {
facesChain.push_front(currentFace);
++size;
currentFace.fl->userdata = (void *)1; // processed
// Find the previous edge!
currentFace = FindPreviousFaceLayer(currentFace);
}
first = facesChain.front();
if (iFaceLayer.fl->nature() & Nature::RIDGE) {
if (size < 4) {
return 0;
}
}
// Start a new chain edges
ViewEdge *newVEdge = new ViewEdge;
newVEdge->setId(_currentViewId);
++_currentViewId;
_pCurrentVShape->AddEdge(newVEdge);
// build FEdges
FEdge *feprevious = NULL;
FEdge *fefirst = NULL;
FEdge *fe = NULL;
for (list<OWXFaceLayer>::iterator fl = facesChain.begin(), flend = facesChain.end(); fl != flend; ++fl) {
fe = BuildSmoothFEdge(feprevious, (*fl));
if (feprevious && fe == feprevious)
continue;
fe->setViewEdge(newVEdge);
if (!fefirst)
fefirst = fe;
feprevious = fe;
}
// Store the chain starting edge:
_pCurrentSShape->AddChain(fefirst);
newVEdge->setNature(iFaceLayer.fl->nature());
newVEdge->setFEdgeA(fefirst);
newVEdge->setFEdgeB(fe);
// is it a closed loop ?
if ((first == end) && (size != 1)) {
fefirst->setPreviousEdge(fe);
fe->setNextEdge(fefirst);
newVEdge->setA(0);
newVEdge->setB(0);
}
else {
ViewVertex *vva = MakeViewVertex(fefirst->vertexA());
ViewVertex *vvb = MakeViewVertex(fe->vertexB());
((NonTVertex *)vva)->AddOutgoingViewEdge(newVEdge);
((NonTVertex *)vvb)->AddIncomingViewEdge(newVEdge);
newVEdge->setA(vva);
newVEdge->setB(vvb);
}
return newVEdge;
}