From: nds Date: Thu, 21 Nov 2013 11:30:31 +0000 (+0000) Subject: Fix for the #trefs 106 - Edit polyline Modification mode - rows in table change their... X-Git-Tag: BR_hydro_v_0_3_1~24 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e2620a4887a3ecff0ce4f5f2264bba74b4f7e8b4;p=modules%2Fhydro.git Fix for the #trefs 106 - Edit polyline Modification mode - rows in table change their position --- 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 ); + } } }