Salome HOME
cleaning some comments
authorPaul RASCLE <paul.rascle@openfields.fr>
Wed, 23 Sep 2020 15:36:13 +0000 (17: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
src/HYDROGUI/HYDROGUI_MeasurementToolOp.cxx
src/HYDROGUI/HYDROGUI_Module.cxx
src/HYDROGUI/HYDROGUI_Shape.cxx
src/HYDROGUI/HYDROGUI_ShapeBathymetry.cxx
src/HYDROGUI/HYDROGUI_SplitPolylinesOp.cxx
src/HYDRO_tests/TestViewer.cxx

index 41adb0685223608a10c16bafdd6ec47869b60207..b73f60c36221e3a6132c48237075a100310ec7e2 100644 (file)
@@ -99,48 +99,6 @@ void HYDROGUI_BathymetryPrs::Compute( const Handle(PrsMgr_PresentationManager3d)
   if( theMode== BATH_HIGHLIGHT_MODE ) // highlight ==> draw bounding box
   {
     AIS_PointCloud::Compute( thePresentationManager, thePresentation, AIS_PointCloud::DM_BndBox );
-//    if( myBound.IsVoid() )
-//      UpdateBound();
-//
-//    if( myBound.IsVoid() ||
-//        myBound.IsOpenXmin() || myBound.IsOpenXmax() ||
-//        myBound.IsOpenYmin() || myBound.IsOpenYmax() ||
-//        myBound.IsOpenZmin() || myBound.IsOpenZmax() )
-//      return;
-//
-//    Standard_Real xmin, xmax, ymin, ymax, zmin, zmax;
-//    myBound.Get( xmin, ymin, zmin, xmax, ymax, zmax );
-//
-//    Handle(Prs3d_LineAspect) aWireAspect = new Prs3d_LineAspect( Quantity_NOC_RED, Aspect_TOL_DASH, 4.0 );
-//    aGroup->SetPrimitivesAspect( aWireAspect->Aspect() ); // use Aspect_TOL_DASH to find the group by the aspect style
-//
-//    Handle(Graphic3d_ArrayOfPolylines) aLines = new Graphic3d_ArrayOfPolylines( 18, 6 );
-//
-//    aLines->AddBound( 5 );
-//    aLines->AddVertex( xmin, ymin, zmin );
-//    aLines->AddVertex( xmax, ymin, zmin );
-//    aLines->AddVertex( xmax, ymax, zmin );
-//    aLines->AddVertex( xmin, ymax, zmin );
-//    aLines->AddVertex( xmin, ymin, zmin );
-//    aLines->AddBound( 5 );
-//    aLines->AddVertex( xmin, ymin, zmax );
-//    aLines->AddVertex( xmax, ymin, zmax );
-//    aLines->AddVertex( xmax, ymax, zmax );
-//    aLines->AddVertex( xmin, ymax, zmax );
-//    aLines->AddVertex( xmin, ymin, zmax );
-//    aLines->AddBound( 2 );
-//    aLines->AddVertex( xmin, ymin, zmin );
-//    aLines->AddVertex( xmin, ymin, zmax );
-//    aLines->AddBound( 2 );
-//    aLines->AddVertex( xmax, ymin, zmin );
-//    aLines->AddVertex( xmax, ymin, zmax );
-//    aLines->AddBound( 2 );
-//    aLines->AddVertex( xmax, ymax, zmin );
-//    aLines->AddVertex( xmax, ymax, zmax );
-//    aLines->AddBound( 2 );
-//    aLines->AddVertex( xmin, ymax, zmin );
-//    aLines->AddVertex( xmin, ymax, zmax );
-//    aGroup->AddPrimitiveArray( aLines );
   }
   else if (theMode == 0)
   {
@@ -220,21 +178,6 @@ void HYDROGUI_BathymetryPrs::ComputeSelection( const Handle(SelectMgr_Selection)
     }
   }
 
-//  if( theMode == 0 )
-//  {
-//    if( myBound.IsVoid() )
-//      UpdateBound();
-//
-//    if( myBound.IsVoid() ||
-//        myBound.IsOpenXmin() || myBound.IsOpenXmax() ||
-//        myBound.IsOpenYmin() || myBound.IsOpenYmax() ||
-//        myBound.IsOpenZmin() || myBound.IsOpenZmax() )
-//      return;
-//
-//    Handle(SelectMgr_EntityOwner) anOwner = new SelectMgr_EntityOwner( this );
-//    Handle(Select3D_SensitiveBox) aSensitiveBox = new Select3D_SensitiveBox( anOwner, myBound );
-//    theSelection->Add( aSensitiveBox );
-//  }
   if( theMode == 1 )
   {
     Handle(Graphic3d_ArrayOfPoints) points = GetPoints();
@@ -287,20 +230,6 @@ void HYDROGUI_BathymetryPrs::HilightOwnerWithColor( const Handle(PrsMgr_Presenta
   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,
@@ -363,11 +292,6 @@ void HYDROGUI_BathymetryPrs::SetTextLabels( const QVector<int>& theTextIndices )
 }
 
 
-
-
-
-
-
 HYDROGUI_BathymetryPointOwner::HYDROGUI_BathymetryPointOwner
   ( const Handle(HYDROGUI_BathymetryPrs)& theBathymetry, int theIndex )
   : SelectMgr_EntityOwner( Handle(SelectMgr_SelectableObject)::DownCast( theBathymetry ), 0 ),
index 9e6e5bc76b69f4ef5e6a4b737e8f41862365e672..8f723525b11fc5676efb61d15b84b8d3d5597266 100644 (file)
@@ -110,32 +110,14 @@ void HYDROGUI_BathymetrySelectionOp::activateSelection( bool isActive )
   QList<Handle(HYDROGUI_BathymetryPrs)> baths = getShownBathymetries( module() );
   if( isActive )
   {
-//    QList<SUIT_Selector*> aSelectorList;
-//    QString aViewType = OCCViewer_Viewer::Type();
-//    LightApp_SelectionMgr* aSelectionMgr = module()->getApp()->selectionMgr();
-//    aSelectionMgr->selectors(aViewType, aSelectorList);
-//    QList<SUIT_Selector*>::iterator anIter, anIterEnd = aSelectorList.end();
-//    for( anIter = aSelectorList.begin(); anIter != anIterEnd; anIter++ )
-//    {
-//      SUIT_Selector* aSelector = *anIter;
-//      aSelector->setEnabled( false );
-//    }
-
     const int aSelectionMode = 1;  // Cf. AIS_PointCloud 0=selection by points ?
-    //ctx->Deactivate( Standard_True );
-    //ctx->OpenLocalContext( Standard_True );
     foreach( Handle(HYDROGUI_BathymetryPrs) bath, baths )
     {
       DEBTRACE("bathy name: " << bath->GetShape()->getObject()->GetName().toStdString());
       ctx->Deactivate(bath);
       ctx->RemoveFilters();
-      //ctx->Activate( bath, aSelectionMode, Standard_True );
       ctx->SetSelectionModeActive (bath, aSelectionMode, Standard_True, AIS_SelectionModesConcurrency_Multiple, Standard_False);
-      //ctx->SetSelectionModeActive (bath, 0, Standard_True, AIS_SelectionModesConcurrency_Multiple, 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();
   }
@@ -150,7 +132,6 @@ void HYDROGUI_BathymetrySelectionOp::activateSelection( bool isActive )
       ctx->Deactivate( bath );
       ctx->SetSelectionModeActive (bath, 2, Standard_True, AIS_SelectionModesConcurrency_Multiple, Standard_False);
     }
-    //ctx->CloseLocalContext( -1, Standard_True );
   }
 
   myIsActive = isActive;
index 73a2bd6e7d24a41c83bc18bde41b803dfb0d756f..763c79cfbec3c2a1b51c2b6c766ddfab872220e2 100644 (file)
@@ -178,8 +178,6 @@ void HYDROGUI_MeasurementToolOp::onMousePress(SUIT_ViewWindow* theWindow, QMouse
 
     if ( !myAISLineM.IsNull() )
     {
-//       if ( aCtx->HasOpenedContext() )
-//         aCtx->CloseLocalContext();
       aCtx->Erase( myAISLineM, Standard_False );
     }
   }
@@ -320,8 +318,6 @@ void HYDROGUI_MeasurementToolOp::onMousePress(SUIT_ViewWindow* theWindow, QMouse
 
   aCtx->SetZLayer(myAISLineM, Graphic3d_ZLayerId_Topmost);
 
-//   if ( aCtx->HasOpenedContext() )
-//     aCtx->CloseLocalContext();
   aCtx->Display( myAISLineM, Standard_False );
   aCtx->UpdateCurrentViewer();
 }
@@ -338,8 +334,6 @@ void HYDROGUI_MeasurementToolOp::eraseLine()
         Handle(AIS_InteractiveContext) aCtx = aViewer->getAISContext();
         if ( !aCtx.IsNull() )
         {
-//           if ( aCtx->HasOpenedContext() )
-//             aCtx->CloseLocalContext();
           aCtx->Erase( myAISLineM, Standard_False );
         }
         myAISLineM.Nullify();
index 790781d8a77a944e5c041576ec92a637fe455ccb..3a64a59624b57a9d882c0ebc6f7e0ed92aa04dd7 100755 (executable)
@@ -1907,7 +1907,7 @@ void HYDROGUI_Module::updateViewer( HYDROGUI_AbstractDisplayer* theDisplayer,
 
 void HYDROGUI_Module::createSelector( SUIT_ViewManager* theViewManager )
 {
-  DEBTRACE("HYDROGUI_Module::createSelector ====================================");
+  DEBTRACE("HYDROGUI_Module::createSelector");
   if( !theViewManager )
     return;
 
@@ -1931,9 +1931,6 @@ void HYDROGUI_Module::createSelector( SUIT_ViewManager* theViewManager )
   for( anIter = aSelectorList.begin(); anIter != anIterEnd; anIter++ )
   {
     SUIT_Selector* aSelector = *anIter;
-//    if( aSelector && ( !dynamic_cast<HYDROGUI_GVSelector*>( aSelector ) &&
-//                       !dynamic_cast<SVTK_Selector*>( aSelector ) &&
-//                       !dynamic_cast<HYDROGUI_OCCSelector*>( aSelector ) ) )
     bool isOk = false;
     if (aSelector)
     {
index be547c460533a4a1684ec691939f3360539dc30f..b11879dcd46e74ff1a6fa8f8946b9a61f1c5b2b2 100644 (file)
@@ -230,8 +230,6 @@ void HYDROGUI_Shape::update( bool isUpdateViewer,
         }
       }
 
-      //if ( theToDisplay && isVisible() && !myContext.IsNull() )
-      //  displayShape( false );
     }
     else if ( myObject->IsKind( STANDARD_TYPE(HYDROData_Polyline3D) ) )
     {
@@ -700,29 +698,21 @@ void HYDROGUI_Shape::updateShape( const bool theToDisplay,
 void HYDROGUI_Shape::displayShape( const bool theIsUpdateViewer )
 {
   DEBTRACE("displayShape " << theIsUpdateViewer << " " << mySelectionMode << " AIScontext " << myContext.get());
-//   if ( myContext->HasOpenedContext() && mySelectionMode > 0 )
-//     myContext->CloseLocalContext();
 
   foreach( Handle(AIS_InteractiveObject) aShape, myShapes )
   {
     if ( mySelectionMode >= 0 )
-      // Display object in local context with selection
-        //myContext->Display( aShape, myDisplayMode, mySelectionMode, Standard_False, Standard_False );
+      // Display object with selection
         myContext->Display( aShape, Standard_False );
     else
     {
-//       if ( !myContext->HasOpenedContext() )
-//         Ordinary display of object published in the Object Browser
-//         myContext->Display( aShape, Standard_False );
-//       else
-        // Display object in local context without selection
+        // Display object without selection
         myContext->Display( aShape, myDisplayMode, -1, Standard_False, Standard_False );
     }
   }
 
   if ( mySelectionMode >= 0 )
   {
-    //myContext->Deactivate(); //OpenLocalContext();
     foreach( Handle(AIS_InteractiveObject) aShape, myShapes )
       myContext->Activate( aShape, mySelectionMode, Standard_True );
   }
@@ -740,9 +730,6 @@ void HYDROGUI_Shape::displayShape( const bool theIsUpdateViewer )
 
 void HYDROGUI_Shape::eraseShape( const bool theIsUpdateViewer )
 {
-//   if ( myContext->HasOpenedContext() && mySelectionMode > 0 )
-//     myContext->CloseLocalContext();
-
   foreach( Handle(AIS_InteractiveObject) aShape, myShapes )
     myContext->Erase( aShape, Standard_False );
 
index 8f893ec544b7de1a077372085af9b082aabb1aa0..a6de2d915509941d23825af2618fac74c0cf06e5 100644 (file)
@@ -237,24 +237,6 @@ QVector<int> HYDROGUI_ShapeBathymetry::selected() const
   QVector<int> selected;
 
   // HYDROGUI_BathymetryPrs::ClearSelected() called before: Nothing left...
-//  selected.reserve( myCoords->Size() );
-//
-//  Handle(AIS_InteractiveObject) obj = getAISObjects().first();
-//
-//  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())
@@ -282,8 +264,7 @@ void HYDROGUI_ShapeBathymetry::Rescale( double theMin, double theMax )
   if( !getAISObjects().isEmpty() )
   {
     getContext()->RecomputePrsOnly( getAISObjects()[0], true );
-    //getAISObjects()[0]->Redisplay();
-}
+  }
 }
 
 void HYDROGUI_ShapeBathymetry::RescaleDefault()
@@ -333,10 +314,8 @@ void HYDROGUI_ShapeBathymetry::TextLabels( bool isOn, bool isUpdateCurrentViewer
     selection = selected();
 
 
-  //getContext()->ClearSelected(true);
   prs->SetTextLabels( selection );
   getContext()->RecomputePrsOnly( prs, Standard_False, Standard_False );
-  //prs->Redisplay();
   if( isUpdateCurrentViewer )
   getContext()->UpdateCurrentViewer();
 }
index d6aa45b50614e0d6c2278d7778a3f41006785b13..a30a0e13a537205c46d1791a9c860633fd02e780 100644 (file)
@@ -198,8 +198,6 @@ void HYDROGUI_SplitPolylinesOp::OnUpdatePreview()
 
         if ( mySplitPointPreview )
         {
-//           if ( aCtx->HasOpenedContext() )
-//             aCtx->CloseLocalContext();
           if ( aPanel->GetMode() == HYDROGUI_SplitPolylinesDlg::ByPoint )
           {
             if ( !aCtx->IsDisplayed( mySplitPointPreview ) )
@@ -306,14 +304,10 @@ void HYDROGUI_SplitPolylinesOp::onMousePress(SUIT_ViewWindow* theWindow, QMouseE
 
   if ( mySplitPointPreview )
   {
-//     if ( aCtx->HasOpenedContext() )
-//       aCtx->CloseLocalContext();
     aCtx->Erase( mySplitPointPreview, Standard_False );
   }
 
   mySplitPointPreview = new AIS_Shape( aShape );
-//   if ( aCtx->HasOpenedContext() )
-//     aCtx->CloseLocalContext();
   aCtx->Display( mySplitPointPreview, Standard_False );
 
   aCtx->UpdateCurrentViewer();
index c350a2198a27881c2ff92cca78779ccf5178985b..be461e7d86c74988c9d16f9b3e9eaae4876ae9be 100644 (file)
@@ -124,7 +124,6 @@ QColor TestViewer::GetColor(int i)
 
 void TestViewer::eraseAll( bool isUpdate, bool eraseStructures )
 {
-  //context()->CloseLocalContext( -1, Standard_False );
   context()->EraseAll( isUpdate );
   if( eraseStructures )
   {