]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
fix polyline curve tablewidget edition: avoid deselection and table hide at each... yan/V9_5_BR_HYDRO
authorPaul RASCLE <paul.rascle@openfields.fr>
Mon, 30 Nov 2020 10:39:35 +0000 (11:39 +0100)
committerYOANN AUDOUIN <B61570@dsp0919998.atlas.edf.fr>
Wed, 2 Dec 2020 07:12:35 +0000 (08:12 +0100)
src/CurveCreator/CurveCreator_TableView.cxx
src/CurveCreator/CurveCreator_Widget.cxx
src/CurveCreator/CurveCreator_Widget.h

index 4251d425d835ef5716385a8411b766456bc8fd1a..b72d1c19f790ff4d8f4527551c8cd228e7a663ec 100644 (file)
@@ -219,7 +219,7 @@ void CurveCreator_TableView::OnHeaderClick( int theLogicalId )
     int point = item( r, 1 )->data( Qt::UserRole ).toInt();
     selected.push_back( CurveCreator_ICurve::SectionToPoint( section, point ) );
   }
-  myWidget->setSelectedPoints( selected );
+  //myWidget->setSelectedPoints( selected ); // seems unneeded and breaks the sorting
 
   myCurrentSortId = theLogicalId;
 }
index 09bc3d3487bc1133816e21e1f7fc43803d8b5392..8740e1bacc190bc712abfd7b28df8fe1b4d8cc83 100644 (file)
@@ -1526,17 +1526,18 @@ void CurveCreator_Widget::moveSelectedPoints( const int theXPosition,
   finishCurveModification( myDragPoints );
 }
 
-void CurveCreator_Widget::updateLocalPointView()
+void CurveCreator_Widget::updateLocalPointView(bool isGetSelected)
 {
   if ( myDragStarted )
     return;
   Handle(AIS_InteractiveContext) aContext = getAISContext();
   if ( aContext.IsNull() )
     return;
-
-  CurveCreator_Utils::getSelectedPoints( aContext, myCurve, myLocalPoints );
+  if (isGetSelected)
+  {
+      CurveCreator_Utils::getSelectedPoints( aContext, myCurve, myLocalPoints );
+  }
   int aNbPoints = myLocalPoints.size();
-
   //bool isRowLimit = aNbPoints > myLocalPointRowLimit;
   myLocalPointView->setVisible( getActionMode() == ModificationMode/* && !isRowLimit */);
 
@@ -1606,8 +1607,8 @@ void CurveCreator_Widget::setSelectedPoints( const CurveCreator_ICurve::SectionT
     return;
 
   CurveCreator_Utils::setSelectedPoints( aContext, myCurve, thePoints );
-
-  updateLocalPointView();
+  bool keepSelected = (thePoints.size() != 0) && (getActionMode() == ModificationMode);
+  updateLocalPointView(!keepSelected);
 }
 
 void CurveCreator_Widget::stopActionMode()
index f66925eda4e19c7dfb117e3b583c5cea39a237a0..7f4d98a192f371d8ddf80144c48f9de849fcb3fa 100644 (file)
@@ -98,7 +98,7 @@ public:
   void setSelectedPoints( const CurveCreator_ICurve::SectionToPointList& =
                                CurveCreator_ICurve::SectionToPointList() );
 
-  void updateLocalPointView();
+  void updateLocalPointView(bool isGetSelected = true);
   void setLocalPointContext( const bool theOpen, const bool isUpdateTable = false );
 
 signals: