+ if ( bndSegs[i].branchID() )
+ {
+ if ( bndSegs[i]._prev &&
+ bndSegs[i]._branchID == -bndSegs[i]._prev->_branchID &&
+ bndSegs[i]._edge )
+ {
+ SMESH_MAT2d::BranchEndType type =
+ ( bndSegs[i]._inSeg->isConnected( bndSegs[i]._edge ) ?
+ SMESH_MAT2d::BE_ON_VERTEX :
+ SMESH_MAT2d::BE_END );
+ endType.insert( make_pair( bndSegs[i]._edge->vertex1(), type ));
+ }
+ continue;
+ }
+ if ( !bndSegs[i]._prev &&
+ !bndSegs[i].hasOppositeEdge() )
+ continue;
+
+ if ( !bndSegs[i]._prev ||
+ !bndSegs[i]._prev->isSameBranch( bndSegs[i] ))
+ {
+ branchEdges.resize(( branchID = branchEdges.size()) + 1 );
+ if ( bndSegs[i]._edge && bndSegs[i]._prev )
+ {
+ endType.insert( make_pair( bndSegs[i]._edge->vertex1(), SMESH_MAT2d::BE_BRANCH_POINT ));
+ if ( bndSegs[i]._prev->_branchID < 0 )
+ // 0023404: a branch-point is inside a branch
+ branchesToCheckEnd.push_back( make_pair( bndSegs[i]._prev->branchID(),
+ bndSegs[i]._edge->vertex1() ));
+ }
+ }
+ else if ( bndSegs[i]._prev->_branchID )
+ {
+ branchID = bndSegs[i]._prev->_branchID; // with sign
+ }
+ else if ( bndSegs[i]._edge ) // 1st bndSeg of a WIRE
+ {
+ branchEdges.resize(( branchID = branchEdges.size()) + 1 );
+ if ( bndSegs[i]._inSeg->isConnected( bndSegs[i]._edge ))
+ {
+ if ( bndSegs[i]._inSeg->point0() == bndSegs[i]._edge->vertex1() )
+ endType.insert( make_pair( bndSegs[i]._edge->vertex1(), SMESH_MAT2d::BE_ON_VERTEX ));
+ else
+ endType.insert( make_pair( bndSegs[i]._edge->vertex0(), SMESH_MAT2d::BE_ON_VERTEX ));
+ }
+ }