Salome HOME
cleaning some comments
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_ShapeBathymetry.cxx
index 226561b534eb4b78249deac53da35d5aa05a5a3d..a6de2d915509941d23825af2618fac74c0cf06e5 100644 (file)
@@ -31,7 +31,7 @@
 #include <QTime>
 #include <utilities.h>
 
-#define _DEVDEBUG_
+//#define _DEVDEBUG_
 #include "HYDRO_trace.hxx"
 
 HYDROGUI_ShapeBathymetry::HYDROGUI_ShapeBathymetry( HYDROGUI_OCCDisplayer*                theDisplayer,
@@ -235,24 +235,13 @@ QVector<int> HYDROGUI_ShapeBathymetry::selected() const
 {
   DEBTRACE("selected");
   QVector<int> selected;
-  selected.reserve( myCoords->Size() );
 
-  Handle(AIS_InteractiveObject) obj = getAISObjects().first();
+  // HYDROGUI_BathymetryPrs::ClearSelected() called before: Nothing left...
 
-  Handle(AIS_InteractiveContext) c = getContext();
-  int cnt = 0;
-  if( !c.IsNull() )
-  {
-      for( c->InitSelected(); c->MoreSelected(); c->NextSelected() )
-      {
-        cnt++;
-        Handle(HYDROGUI_BathymetryPointOwner) anOwner =
-          Handle(HYDROGUI_BathymetryPointOwner)::DownCast( c->SelectedOwner() );
-        if( !anOwner.IsNull() && anOwner->Selectable()==obj )
-          selected.append( anOwner->GetIndex() );
-      }
-  }
-  DEBTRACE("selected " << cnt << " " << selected.size() );
+  Handle(HYDROGUI_BathymetryPrs) aPntCloud = Handle(HYDROGUI_BathymetryPrs)::DownCast( getAISObjects()[0] );
+  if (!aPntCloud.IsNull())
+    selected = aPntCloud->getSelectedPoints();
+  DEBTRACE("selected " << selected.size());
   return selected;
 }
 
@@ -275,8 +264,7 @@ void HYDROGUI_ShapeBathymetry::Rescale( double theMin, double theMax )
   if( !getAISObjects().isEmpty() )
   {
     getContext()->RecomputePrsOnly( getAISObjects()[0], true );
-    //getAISObjects()[0]->Redisplay();
-}
+  }
 }
 
 void HYDROGUI_ShapeBathymetry::RescaleDefault()
@@ -326,10 +314,8 @@ void HYDROGUI_ShapeBathymetry::TextLabels( bool isOn, bool isUpdateCurrentViewer
     selection = selected();
 
 
-  //getContext()->ClearSelected(true);
   prs->SetTextLabels( selection );
   getContext()->RecomputePrsOnly( prs, Standard_False, Standard_False );
-  //prs->Redisplay();
   if( isUpdateCurrentViewer )
   getContext()->UpdateCurrentViewer();
 }