Salome HOME
Minor changes.
[modules/hydro.git] / src / HYDROCurveCreator / CurveCreator_TreeView.cxx
index ce580d5357ee720a045f3b2ceed086832bba7add..36d1dfcfb5dfc3c85f68468445cfdf826ae61514 100755 (executable)
@@ -252,6 +252,39 @@ QList<int> CurveCreator_TreeView::getSelectedSections() const
   return aSect;
 }
 
+void CurveCreator_TreeView::pointsAdded( int theSection, int thePoint, int thePointsCnt )
+{
+  CurveCreator_TreeViewModel* aModel = dynamic_cast<CurveCreator_TreeViewModel*>(model());
+  if( aModel ){
+    QModelIndex aSectIndx = aModel->sectionIndex( theSection );
+    rowsInserted(aSectIndx, thePoint, thePoint + thePointsCnt - 1 );
+//    expand( aSectIndx );
+    update( aModel->nbPointsIndex( theSection ) );
+  }
+}
+
+void CurveCreator_TreeView::pointDataChanged( int theSection, int thePoint )
+{
+  CurveCreator_TreeViewModel* aModel = dynamic_cast<CurveCreator_TreeViewModel*>(model());
+  if( aModel ){
+    QModelIndex aPointIndx = aModel->pointIndex( theSection, thePoint );
+    dataChanged( aPointIndx, aPointIndx );
+  }
+}
+
+void CurveCreator_TreeView::pointsRemoved( int theSection, int thePoint, int thePointsCnt )
+{
+  CurveCreator_TreeViewModel* aModel = dynamic_cast<CurveCreator_TreeViewModel*>(model());
+  if( aModel ){
+    for( int i = 0 ; i < thePointsCnt ; i++ ){
+      QModelIndex aSectIndx = aModel->pointIndex(theSection, thePoint + i);
+      selectionModel()->select(aSectIndx,QItemSelectionModel::Deselect);
+    }
+    QModelIndex aSectIndx = aModel->sectionIndex( theSection );
+    rowsRemoved(aSectIndx, thePoint, thePoint + thePointsCnt - 1 );
+  }
+}
+
 void CurveCreator_TreeView::sectionAdded( int theSection )
 {
   CurveCreator_TreeViewModel* aModel = dynamic_cast<CurveCreator_TreeViewModel*>(model());