+ //================================================================================
+ /*!
+ * \brief Try to extend self by a point located at a node.
+ * Return a success flag.
+ */
+ //================================================================================
+
+ bool Path::SetCutAtCorner( const SMESH_NodeXYZ& cornerNode,
+ const gp_XYZ& plnNorm,
+ const gp_XYZ& plnOrig,
+ std::vector< Path > * paths )
+ {
+ bool ok = false;
+ const bool isContinuation = myFace; // extend this path or find all possible paths?
+ const SMDS_MeshElement* lastFace = myFace;
+
+ myAvoidSet.clear();
+
+ SMDS_ElemIteratorPtr fIt = cornerNode->GetInverseElementIterator(SMDSAbs_Face);
+ while ( fIt->more() )
+ {
+ Path path( lastFace, mySrcPntInd );
+ if ( !path.SetCutAtCorner( cornerNode, fIt->next(), plnNorm, plnOrig ))
+ continue;
+
+ if ( !myAvoidSet.insert( path.myNode1.Node() ).second ||
+ !myAvoidSet.insert( path.myNode2.Node() ).second )
+ continue;
+
+ if ( isContinuation )
+ {
+ if ( ok ) // non-manifold continuation
+ {
+ path.myPoints = myPoints;
+ path.myLength = myLength;
+ path.AddPoint( cornerNode );
+ paths->push_back( path );
+ }
+ else
+ {
+ double len = myLength;
+ this->CopyNoPoints( path );
+ this->myLength = len;
+ this->AddPoint( path.myPoints.back() );
+ }
+ }
+ else
+ {
+ paths->push_back( path );
+ }
+ ok = true;
+ }
+
+ return ok;
+ }
+