int TriangleAdjacencyGraph::calcEgdeLines ( vector<Index> & indexVec, bool codeBorder ) { unsigned int i, nN, j, nE, halfEdgeCount = 0; Index startVertexIndex, endVertexIndex; HalfEdge *halfEdge; bool isBorder; indexVec.clear(); nN = _temporaryVector.size(); for (i = 0; i < nN; i++) { nE = _temporaryVector[i].size(); for ( j = 0; j < nE; j++) { halfEdge = _temporaryVector[i][j].second; startVertexIndex = halfEdge->vertexStart(); endVertexIndex = halfEdge->vertexEnd(); if ((isBorder = (halfEdge->twin == 0)) || (startVertexIndex < endVertexIndex)) { indexVec.push_back(startVertexIndex); indexVec.push_back(endVertexIndex); if (codeBorder) indexVec.push_back(isBorder ? 0 : 1); halfEdgeCount++; } } } return halfEdgeCount; }
//---------------------------------------------------------------------- // Method: calcEdgeLines // Author: jbehr // Date: Tue Feb 15 18:16:59 2000 // Description: // //---------------------------------------------------------------------- Int32 HalfEdgeGraph::calcEgdeLines(vector<HalfEdgeGraph::IndexT> & indexVec, bool codeBorder ) { UInt32 i, nN, j, nE, halfEdgeCount = 0; HalfEdgeGraph::IndexT startVertexIndex, endVertexIndex; HalfEdge *halfEdge; bool isBorder; indexVec.clear(); nN = _edgeLinkVec.size(); for (i = 0; i < nN; ++i) { nE = _edgeLinkVec[i].size(); for ( j = 0; j < nE; ++j) { halfEdge = _edgeLinkVec[i][j].second; startVertexIndex = halfEdge->vertexStart(); endVertexIndex = halfEdge->vertexEnd(); if ((isBorder = (halfEdge->twin == 0)) || (startVertexIndex < endVertexIndex)) { indexVec.push_back(startVertexIndex); indexVec.push_back(endVertexIndex); if(codeBorder) indexVec.push_back(isBorder ? 0 : 1); ++halfEdgeCount; } } } return halfEdgeCount; }