bool Extend( const gp_XYZ& plnNorm, const gp_XYZ& plnOrig );
+ bool ReachSamePoint( const Path& other );
+
static void Remove( std::vector< Path > & paths, size_t& i );
};
+ //================================================================================
+ /*!
+ * \brief Return true if this Path meats another
+ */
+ //================================================================================
+
+ bool Path::ReachSamePoint( const Path& other )
+ {
+ return ( mySrcPntInd != other.mySrcPntInd &&
+ myFace == other.myFace );
+ }
+
//================================================================================
/*!
* \brief Remove a path from a vector
if ( i < j )
{
paths[ i ].myPoints.swap( paths[ j ].myPoints );
- paths[ i ].myFace = paths[ j ].myFace;
- paths[ i ].myNodeInd1 = paths[ j ].myNodeInd1;
- paths[ i ].myNodeInd2 = paths[ j ].myNodeInd2;
- paths[ i ].myNode1 = paths[ j ].myNode1;
- paths[ i ].myNode2 = paths[ j ].myNode2;
- paths[ i ].myLength = paths[ j ].myLength;
+ paths[ i ].myLength = paths[ j ].myLength;
+ paths[ i ].mySrcPntInd = paths[ j ].mySrcPntInd;
+ paths[ i ].myFace = paths[ j ].myFace;
+ paths[ i ].myNode1 = paths[ j ].myNode1;
+ paths[ i ].myNode2 = paths[ j ].myNode2;
+ paths[ i ].myNodeInd1 = paths[ j ].myNodeInd1;
+ paths[ i ].myNodeInd2 = paths[ j ].myNodeInd2;
+ paths[ i ].myDot1 = paths[ j ].myDot1;
+ paths[ i ].myDot2 = paths[ j ].myDot2;
}
}
paths.pop_back();
// join paths that reach same point
for ( size_t j = 0; j < paths.size(); ++j )
{
- if ( i != j &&
- paths[i].myFace == paths[j].myFace &&
- paths[i].mySrcPntInd != paths[j].mySrcPntInd )
+ if ( i != j && paths[i].ReachSamePoint( paths[j] ))
{
double distLast = ( paths[i].myPoints.back() - paths[j].myPoints.back() ).Modulus();
double fullLength = ( paths[i].myLength + paths[j].myLength + distLast );