mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-31 11:50:34 +05:00
Bugs in Path::Remove()
This commit is contained in:
parent
e1969210a9
commit
b15e8bd341
@ -12867,9 +12867,23 @@ namespace // utils for MakePolyLine
|
|||||||
|
|
||||||
bool Extend( const gp_XYZ& plnNorm, const gp_XYZ& plnOrig );
|
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 );
|
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
|
* \brief Remove a path from a vector
|
||||||
@ -12884,12 +12898,15 @@ namespace // utils for MakePolyLine
|
|||||||
if ( i < j )
|
if ( i < j )
|
||||||
{
|
{
|
||||||
paths[ i ].myPoints.swap( paths[ j ].myPoints );
|
paths[ i ].myPoints.swap( paths[ j ].myPoints );
|
||||||
|
paths[ i ].myLength = paths[ j ].myLength;
|
||||||
|
paths[ i ].mySrcPntInd = paths[ j ].mySrcPntInd;
|
||||||
paths[ i ].myFace = paths[ j ].myFace;
|
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 ].myNode1 = paths[ j ].myNode1;
|
||||||
paths[ i ].myNode2 = paths[ j ].myNode2;
|
paths[ i ].myNode2 = paths[ j ].myNode2;
|
||||||
paths[ i ].myLength = paths[ j ].myLength;
|
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();
|
paths.pop_back();
|
||||||
@ -13139,9 +13156,7 @@ namespace // utils for MakePolyLine
|
|||||||
// join paths that reach same point
|
// join paths that reach same point
|
||||||
for ( size_t j = 0; j < paths.size(); ++j )
|
for ( size_t j = 0; j < paths.size(); ++j )
|
||||||
{
|
{
|
||||||
if ( i != j &&
|
if ( i != j && paths[i].ReachSamePoint( paths[j] ))
|
||||||
paths[i].myFace == paths[j].myFace &&
|
|
||||||
paths[i].mySrcPntInd != paths[j].mySrcPntInd )
|
|
||||||
{
|
{
|
||||||
double distLast = ( paths[i].myPoints.back() - paths[j].myPoints.back() ).Modulus();
|
double distLast = ( paths[i].myPoints.back() - paths[j].myPoints.back() ).Modulus();
|
||||||
double fullLength = ( paths[i].myLength + paths[j].myLength + distLast );
|
double fullLength = ( paths[i].myLength + paths[j].myLength + distLast );
|
||||||
|
Loading…
Reference in New Issue
Block a user