From 04c71db8f9e682d856ac4739da0da8b810cb40d6 Mon Sep 17 00:00:00 2001 From: asl Date: Thu, 28 Sep 2017 15:20:30 +0300 Subject: [PATCH] refs #1326: debug of the selection on bathymetry --- src/HYDROGUI/HYDROGUI_BathymetryPrs.cxx | 4 +++- src/HYDROGUI/HYDROGUI_BathymetrySelectionOp.cxx | 3 +++ src/HYDROGUI/HYDROGUI_ShapeBathymetry.cxx | 5 +++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/HYDROGUI/HYDROGUI_BathymetryPrs.cxx b/src/HYDROGUI/HYDROGUI_BathymetryPrs.cxx index 3eef5d64..1334896f 100644 --- a/src/HYDROGUI/HYDROGUI_BathymetryPrs.cxx +++ b/src/HYDROGUI/HYDROGUI_BathymetryPrs.cxx @@ -31,7 +31,7 @@ const int BATH_HIGHLIGHT_MODE = 10; HYDROGUI_BathymetryPrs::HYDROGUI_BathymetryPrs() { SetHilightMode( BATH_HIGHLIGHT_MODE ); - SetAutoHilight( Standard_False ); + SetAutoHilight( Standard_True ); } HYDROGUI_BathymetryPrs::~HYDROGUI_BathymetryPrs() @@ -189,6 +189,8 @@ void HYDROGUI_BathymetryPrs::AddPoint( const Handle(Graphic3d_ArrayOfPoints)& th const Handle(SelectMgr_EntityOwner)& theOwner ) { Handle(HYDROGUI_BathymetryPointOwner) anOwner = Handle(HYDROGUI_BathymetryPointOwner)::DownCast( theOwner ); + if( anOwner.IsNull() ) + return; gp_Pnt p = GetPoint( anOwner->GetIndex() ); thePoints->AddVertex( p ); } diff --git a/src/HYDROGUI/HYDROGUI_BathymetrySelectionOp.cxx b/src/HYDROGUI/HYDROGUI_BathymetrySelectionOp.cxx index aa3e0f4b..317ca6aa 100644 --- a/src/HYDROGUI/HYDROGUI_BathymetrySelectionOp.cxx +++ b/src/HYDROGUI/HYDROGUI_BathymetrySelectionOp.cxx @@ -86,7 +86,10 @@ void HYDROGUI_BathymetrySelectionOp::activateSelection( bool isActive ) else { foreach( Handle(HYDROGUI_BathymetryPrs) bath, baths ) + { + bath->ClearSelected(); ctx->Deactivate( bath ); + } ctx->CloseLocalContext( -1, Standard_True ); } diff --git a/src/HYDROGUI/HYDROGUI_ShapeBathymetry.cxx b/src/HYDROGUI/HYDROGUI_ShapeBathymetry.cxx index 76065dfc..75542ee3 100644 --- a/src/HYDROGUI/HYDROGUI_ShapeBathymetry.cxx +++ b/src/HYDROGUI/HYDROGUI_ShapeBathymetry.cxx @@ -71,7 +71,7 @@ Handle(AIS_InteractiveObject) HYDROGUI_ShapeBathymetry::createShape() const if( !aBath.IsNull() ) { aPntCloud = new HYDROGUI_BathymetryPrs(); - aPntCloud->SetHilightMode( AIS_PointCloud::DM_BndBox ); + //aPntCloud->SetHilightMode( AIS_PointCloud::DM_BndBox ); aPntCloud->Attributes()->SetPointAspect (new Prs3d_PointAspect (Aspect_TOM_POINT, Quantity_NOC_WHITE, 2.0)); const HYDROData_Bathymetry::AltitudePoints& aBathPoints = aBath->GetAltitudePoints(); @@ -104,9 +104,10 @@ void HYDROGUI_ShapeBathymetry::UpdateWithColorScale( const Handle(AIS_ColorScale theColorScale->FindColor( z, aColor ); myColors->SetValue( i, aColor ); } - Handle(AIS_PointCloud) aPntCloud = Handle(AIS_PointCloud)::DownCast( getAISObject() ); + Handle(HYDROGUI_BathymetryPrs) aPntCloud = Handle(HYDROGUI_BathymetryPrs)::DownCast( getAISObject() ); aPntCloud->SetPoints( myCoords, myColors ); getContext()->RecomputePrsOnly( aPntCloud, Standard_True ); + getContext()->RecomputeSelectionOnly( aPntCloud ); } void HYDROGUI_ShapeBathymetry::setVisible( const bool theState, -- 2.39.2