#include <HYDROGUI_OCCDisplayer.h>
#include <HYDROGUI_BathymetryPrs.h>
#include <HYDROData_Bathymetry.h>
+#include <HYDROGUI_Tool.h>
#include <AIS_InteractiveContext.hxx>
#include <AIS_ColorScale.hxx>
#include <QTime>
#include <utilities.h>
+//#define _DEVDEBUG_
+#include "HYDRO_trace.hxx"
+
HYDROGUI_ShapeBathymetry::HYDROGUI_ShapeBathymetry( HYDROGUI_OCCDisplayer* theDisplayer,
const Handle(AIS_InteractiveContext)& theContext,
const Handle(HYDROData_Bathymetry)& theBathymetry,
QList<Handle(AIS_InteractiveObject)> HYDROGUI_ShapeBathymetry::createShape() const
{
+ DEBTRACE("createShape");
QList<Handle(AIS_InteractiveObject)> shapes;
Handle(AIS_InteractiveObject) aPntCloud;
void HYDROGUI_ShapeBathymetry::UpdateWithColorScale( const Handle(AIS_ColorScale)& theColorScale )
{
+ DEBTRACE("UpdateWithColorScale");
if (!myCoords || getAISObjects().isEmpty())
return;
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();
- if( !c.IsNull() )
- {
- for( c->InitSelected(); c->MoreSelected(); c->NextSelected() )
- {
- Handle(HYDROGUI_BathymetryPointOwner) anOwner =
- Handle(HYDROGUI_BathymetryPointOwner)::DownCast( c->SelectedOwner() );
- if( !anOwner.IsNull() && anOwner->Selectable()==obj )
- selected.append( anOwner->GetIndex() );
- }
- }
+ 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()
void HYDROGUI_ShapeBathymetry::TextLabels( bool isOn, bool isUpdateCurrentViewer )
{
+ DEBTRACE("TextLabels " << isOn << " " << isUpdateCurrentViewer);
if( getAISObjects().isEmpty() )
return;
selection = selected();
- //getContext()->ClearSelected(true);
prs->SetTextLabels( selection );
getContext()->RecomputePrsOnly( prs, Standard_False, Standard_False );
- //prs->Redisplay();
if( isUpdateCurrentViewer )
getContext()->UpdateCurrentViewer();
}