#include <QTime>
#include <utilities.h>
-#define _DEVDEBUG_
+//#define _DEVDEBUG_
#include "HYDRO_trace.hxx"
HYDROGUI_ShapeBathymetry::HYDROGUI_ShapeBathymetry( HYDROGUI_OCCDisplayer* theDisplayer,
{
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;
}
if( !getAISObjects().isEmpty() )
{
getContext()->RecomputePrsOnly( getAISObjects()[0], true );
- //getAISObjects()[0]->Redisplay();
-}
+ }
}
void HYDROGUI_ShapeBathymetry::RescaleDefault()
selection = selected();
- //getContext()->ClearSelected(true);
prs->SetTextLabels( selection );
getContext()->RecomputePrsOnly( prs, Standard_False, Standard_False );
- //prs->Redisplay();
if( isUpdateCurrentViewer )
getContext()->UpdateCurrentViewer();
}