Salome HOME
lot 10 - warnings for DTM - untested
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_ShapeBathymetry.cxx
index aa45119c9f571865c8984900dc5a815acbd81bb8..b3d390141093fd35b134e305d1bd9d1d8c234022 100644 (file)
@@ -220,7 +220,9 @@ void HYDROGUI_ShapeBathymetry::RescaleByVisible( OCCViewer_ViewWindow* theWindow
   // For now "complete" is implemented
   Rescale( visible, visible.isEmpty() );
 
+#ifdef _DEBUG
   MESSAGE("Time after rescale:" << t1.elapsed());
+#endif
 }
 
 QVector<int> HYDROGUI_ShapeBathymetry::selected() const
@@ -228,6 +230,8 @@ QVector<int> HYDROGUI_ShapeBathymetry::selected() const
   QVector<int> selected;
   selected.reserve( myCoords->Size() );
 
+  Handle(AIS_InteractiveObject) obj = getAISObjects().first();
+
   Handle(AIS_InteractiveContext) c = getContext();
   if( !c.IsNull() )
   {
@@ -238,7 +242,7 @@ QVector<int> HYDROGUI_ShapeBathymetry::selected() const
       {
         Handle(HYDROGUI_BathymetryPointOwner) anOwner = 
           Handle(HYDROGUI_BathymetryPointOwner)::DownCast( lc->SelectedOwner() );
-        if( anOwner )
+        if( !anOwner.IsNull() && anOwner->Selectable()==obj )
           selected.append( anOwner->GetIndex() );
       }
     }
@@ -257,16 +261,16 @@ void HYDROGUI_ShapeBathymetry::RescaleBySelection()
 
 void HYDROGUI_ShapeBathymetry::Rescale( double theMin, double theMax )
 {
-  getContext()->ClearSelected();
+  getContext()->ClearSelected(true);
   myMin = qMin( theMin, theMax );
   myMax = qMax( theMin, theMax );
   setToUpdateColorScale( true );
 
   if( !getAISObjects().isEmpty() )
   {
-    getContext()->RecomputePrsOnly( getAISObjects()[0] );
+    getContext()->RecomputePrsOnly( getAISObjects()[0], true );
     //getAISObjects()[0]->Redisplay();
-  }
+}
 }
 
 void HYDROGUI_ShapeBathymetry::RescaleDefault()
@@ -301,7 +305,7 @@ void HYDROGUI_ShapeBathymetry::Build()
   buildShape();
 }
 
-void HYDROGUI_ShapeBathymetry::TextLabels( bool isOn )
+void HYDROGUI_ShapeBathymetry::TextLabels( bool isOn, bool isUpdateCurrentViewer )
 {
   if( getAISObjects().isEmpty() )
     return;
@@ -314,9 +318,11 @@ void HYDROGUI_ShapeBathymetry::TextLabels( bool isOn )
   if( isOn )
     selection = selected();
 
-  //getContext()->ClearSelected();
+
+  //getContext()->ClearSelected(true);
   prs->SetTextLabels( selection );
-  getContext()->RecomputePrsOnly( prs );
+  getContext()->RecomputePrsOnly( prs, Standard_False, Standard_False );
   //prs->Redisplay();
+  if( isUpdateCurrentViewer )
   getContext()->UpdateCurrentViewer();
 }