From e2620a4887a3ecff0ce4f5f2264bba74b4f7e8b4 Mon Sep 17 00:00:00 2001 From: nds Date: Thu, 21 Nov 2013 11:30:31 +0000 Subject: [PATCH] Fix for the #trefs 106 - Edit polyline Modification mode - rows in table change their position --- src/HYDROCurveCreator/CurveCreator_Widget.cxx | 47 +++++++++++-------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/src/HYDROCurveCreator/CurveCreator_Widget.cxx b/src/HYDROCurveCreator/CurveCreator_Widget.cxx index 3cf3975e..b054e983 100644 --- a/src/HYDROCurveCreator/CurveCreator_Widget.cxx +++ b/src/HYDROCurveCreator/CurveCreator_Widget.cxx @@ -1361,31 +1361,38 @@ void CurveCreator_Widget::setSelectedPonts( const CurveCreator_Widget::SectionTo AIS_ListOfInteractive aDisplayedList; ic->DisplayedObjects( aDisplayedList ); - for ( AIS_ListIteratorOfListOfInteractive it( aDisplayedList ); it.More(); it.Next() ) - { - Handle(AIS_InteractiveObject) anAIS = it.Value(); - if ( anAIS.IsNull() ) - continue; - Handle(AIS_Point) anAISPoint = Handle(AIS_Point)::DownCast( anAIS ); - if ( anAISPoint.IsNull() ) - continue; - TopoDS_Vertex aVertex = TopoDS::Vertex( anAISPoint->Vertex() ); + SectionToPointList::const_iterator anIt = thePoints.begin(), aLast = thePoints.end(); + SectionToPoint aSToPoint; + for( ; anIt != aLast; anIt++ ) { + aSToPoint = *anIt; - if ( aVertex.IsNull() ) - continue; + for ( AIS_ListIteratorOfListOfInteractive it( aDisplayedList ); it.More(); it.Next() ) + { + Handle(AIS_InteractiveObject) anAIS = it.Value(); + if ( anAIS.IsNull() ) + continue; + Handle(AIS_Point) anAISPoint = Handle(AIS_Point)::DownCast( anAIS ); + if ( anAISPoint.IsNull() ) + continue; + + TopoDS_Vertex aVertex = TopoDS::Vertex( anAISPoint->Vertex() ); + + if ( aVertex.IsNull() ) + continue; - gp_Pnt aPnt = BRep_Tool::Pnt( aVertex ); + gp_Pnt aPnt = BRep_Tool::Pnt( aVertex ); - SectionToPointList aPoints; - findSectionsToPoints( aPnt.X(), aPnt.Y(), aPoints ); + SectionToPointList aPoints; + findSectionsToPoints( aPnt.X(), aPnt.Y(), aPoints ); - SectionToPointList::const_iterator anIt = aPoints.begin(), aLast = aPoints.end(); - SectionToPoint aPoint; - for ( ; anIt != aLast; anIt++ ) { - aPoint = *anIt; - if ( contains( thePoints, aPoint ) ) - aListToSelect.Append( anAIS ); + SectionToPointList::const_iterator anIt = aPoints.begin(), aLast = aPoints.end(); + SectionToPoint aPoint; + for ( ; anIt != aLast; anIt++ ) { + aPoint = *anIt; + if ( aPoint.first == aSToPoint.first && aPoint.second == aSToPoint.second ) + aListToSelect.Append( anAIS ); + } } } -- 2.39.2