]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
refs #1326: debug of the selection on bathymetry
authorasl <asl@opencascade.com>
Thu, 28 Sep 2017 12:20:30 +0000 (15:20 +0300)
committerasl <asl@opencascade.com>
Thu, 28 Sep 2017 12:20:30 +0000 (15:20 +0300)
src/HYDROGUI/HYDROGUI_BathymetryPrs.cxx
src/HYDROGUI/HYDROGUI_BathymetrySelectionOp.cxx
src/HYDROGUI/HYDROGUI_ShapeBathymetry.cxx

index 3eef5d64c6f5e99a0e19b3c2d4b2583c91cb646e..1334896f578f2d79008f9043460feb2898485fbe 100644 (file)
@@ -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 );
 }
index aa3e0f4b09de36e72580098fc429fc4f7869bec3..317ca6aacc70cd261c18b8c0924bdba49212a914 100644 (file)
@@ -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 );
   }
 
index 76065dfc3909fa9dd00b42a53afdce6a4ddef60d..75542ee3be2fe53bbf5e461d2e8ac94e1bfb9f2f 100644 (file)
@@ -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,