]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
some tests on bathy selection...
authorPaul RASCLE <paul.rascle@openfields.fr>
Sat, 19 Sep 2020 14:36:00 +0000 (16:36 +0200)
committerYOANN AUDOUIN <B61570@dsp0851742.postes.calibre.edf.fr>
Fri, 30 Oct 2020 16:08:09 +0000 (17:08 +0100)
src/HYDROGUI/HYDROGUI_BathymetryPrs.cxx
src/HYDROGUI/HYDROGUI_BathymetrySelectionOp.cxx

index a7ade032eaa3be18216c3a4842e0257ecb17adcf..0c9a95877faf9481dd330133b2187503ab40ca74 100644 (file)
@@ -205,7 +205,7 @@ void HYDROGUI_BathymetryPrs::ComputeSelection( const Handle(SelectMgr_Selection)
     case 1:
     {
       DEBTRACE("Subset of points detection");
-      AIS_PointCloud::ComputeSelection( theSelection, SM_SubsetOfPoints );
+      AIS_PointCloud::ComputeSelection( theSelection, SM_SubsetOfPoints ); // SM_Points ?
       break;
     }
     default:
@@ -265,49 +265,54 @@ void HYDROGUI_BathymetryPrs::AddPoint( const Handle(Graphic3d_ArrayOfPoints)& th
                                        const Handle(SelectMgr_EntityOwner)& theOwner )
 {
   DEBTRACE("AddPoint");
-  Handle(HYDROGUI_BathymetryPointOwner) anOwner = Handle(HYDROGUI_BathymetryPointOwner)::DownCast( theOwner );
+  Handle(AIS_PointCloudOwner) anOwner = Handle(AIS_PointCloudOwner)::DownCast( theOwner );
   if( anOwner.IsNull() )
     return;
-  gp_Pnt p = GetPoint( anOwner->GetIndex() );
-  thePoints->AddVertex( p );
+//  gp_Pnt p = GetPoint( anOwner->GetIndex() );
+//  thePoints->AddVertex( p );
 }
 
 void HYDROGUI_BathymetryPrs::HilightOwnerWithColor( const Handle(PrsMgr_PresentationManager3d)& thePM,
                                                     const Handle(Prs3d_Drawer)& theColor,
                                                     const Handle(SelectMgr_EntityOwner)& theOwner )
 {
-  DEBTRACE("HilightOwnerWithColor");
-  Handle(Prs3d_Presentation) aHilightPrs = GetHilightPresentation( thePM );
-  aHilightPrs->SetZLayer( Graphic3d_ZLayerId_Topmost );
-  aHilightPrs->Clear();
-  Handle(Graphic3d_ArrayOfPoints) points = new Graphic3d_ArrayOfPoints( 1 );
-  AddPoint( points, theOwner );
-
-  Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup( aHilightPrs );
-  Handle(Graphic3d_AspectMarker3d) anAspect = new Graphic3d_AspectMarker3d( Aspect_TOM_X, Quantity_NOC_WHITE, 1.0 );
-  aGroup->SetGroupPrimitivesAspect( anAspect );
-  aGroup->AddPrimitiveArray( points );
-
-  if( thePM->IsImmediateModeOn() )
-    thePM->AddToImmediateList( aHilightPrs );
+  DEBTRACE("HilightOwnerWithColor"); // appel si AIS_PointCloud::ComputeSelection( theSelection, SM_Points);
+  Handle(AIS_PointCloudOwner) anOwner = Handle(AIS_PointCloudOwner)::DownCast( theOwner );
+  if (anOwner.IsNull())
+    return;
+  DEBTRACE("---"); // jamais appelé : on n'a pas de AIS_PointCloudOwner
+
+//  Handle(Prs3d_Presentation) aHilightPrs = GetHilightPresentation( thePM );
+//  aHilightPrs->SetZLayer( Graphic3d_ZLayerId_Topmost );
+//  aHilightPrs->Clear();
+//  Handle(Graphic3d_ArrayOfPoints) points = new Graphic3d_ArrayOfPoints( 1 );
+//  AddPoint( points, theOwner );
+//
+//  Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup( aHilightPrs );
+//  Handle(Graphic3d_AspectMarker3d) anAspect = new Graphic3d_AspectMarker3d( Aspect_TOM_X, Quantity_NOC_WHITE, 1.0 );
+//  aGroup->SetGroupPrimitivesAspect( anAspect );
+//  aGroup->AddPrimitiveArray( points );
+//
+//  if( thePM->IsImmediateModeOn() )
+//    thePM->AddToImmediateList( aHilightPrs );
 }
 
 void HYDROGUI_BathymetryPrs::HilightSelected( const Handle(PrsMgr_PresentationManager3d)& thePM,
                                               const SelectMgr_SequenceOfOwner& theOwners )
 {
-  DEBTRACE("HilightSelected " << theOwners.Size());
+  DEBTRACE("HilightSelected " << theOwners.Size()); // appel si AIS_PointCloud::ComputeSelection( theSelection, SM_SubsetOfPoints );
+  //AIS_PointCloud::HilightSelected(thePM, theOwners); // Non, fige la machine !
   if (theOwners.Size() == 0)
     return;
   Handle(SelectMgr_EntityOwner) owner = theOwners.First();
   Handle(AIS_PointCloudOwner) anOwner = Handle(AIS_PointCloudOwner)::DownCast( owner );
   if (anOwner.IsNull())
     return;
-  Handle(TColStd_HPackedMapOfInteger) thePointsH =  anOwner->SelectedPoints();
-  TColStd_PackedMapOfInteger thePoints = thePointsH->Map();
-  DEBTRACE("thePoints.Extent() :"  << thePoints.Extent());
-  Handle(TColStd_HPackedMapOfInteger) thePointsDH =  anOwner->DetectedPoints();
-  TColStd_PackedMapOfInteger thePointsD = thePointsDH->Map();
-  DEBTRACE("thePointsD.Extent() :"  << thePointsD.Extent());
+  DEBTRACE("immediateMode: " << thePM->IsImmediateModeOn()); // semble sans effet
+  const Handle(TColStd_HPackedMapOfInteger)& aSMap = anOwner->SelectedPoints();
+  DEBTRACE("selectedPoints.Extent() :"  << aSMap->Map().Extent());
+  const Handle(TColStd_HPackedMapOfInteger)& aDMap = anOwner->DetectedPoints();
+  DEBTRACE("detectedPoints.Extent() :"  << aDMap->Map().Extent());
 
 
 //  Handle(Prs3d_Presentation) aSelectPrs = GetSelectPresentation( thePM );
index b9a7d1a687bbc069a190c97d57a269b3f0f64142..577eb7a1b6ef7bc3419288f070627a3fa90d7b6a 100644 (file)
@@ -115,7 +115,10 @@ void HYDROGUI_BathymetrySelectionOp::activateSelection( bool isActive )
       ctx->Deactivate(bath);
       //ctx->Activate( bath, aSelectionMode, Standard_True );
       ctx->SetSelectionModeActive (bath, aSelectionMode, Standard_True, AIS_SelectionModesConcurrency_Multiple, Standard_False);
-      bath->SetAutoHilight( Standard_False );
+      bath->SetAutoHilight( Standard_False ); // True bloque le passage dans hilightSelected...
+//      DEBTRACE("immediateMode: " << ctx->MainPrsMgr()->IsImmediateModeOn());
+//      if (!ctx->MainPrsMgr()->IsImmediateModeOn())
+//        ctx->MainPrsMgr()->BeginImmediateDraw();
     }
     ctx->UpdateCurrentViewer();
   }