From: Paul RASCLE Date: Wed, 23 Sep 2020 15:36:13 +0000 (+0200) Subject: cleaning some comments X-Git-Tag: SH_V2_2_0~33 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=92c3e5ddda56d434c842e744b3db1341ad2f87f5;p=modules%2Fhydro.git cleaning some comments --- diff --git a/src/HYDROGUI/HYDROGUI_BathymetryPrs.cxx b/src/HYDROGUI/HYDROGUI_BathymetryPrs.cxx index 41adb068..b73f60c3 100644 --- a/src/HYDROGUI/HYDROGUI_BathymetryPrs.cxx +++ b/src/HYDROGUI/HYDROGUI_BathymetryPrs.cxx @@ -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& theTextIndices ) } - - - - - HYDROGUI_BathymetryPointOwner::HYDROGUI_BathymetryPointOwner ( const Handle(HYDROGUI_BathymetryPrs)& theBathymetry, int theIndex ) : SelectMgr_EntityOwner( Handle(SelectMgr_SelectableObject)::DownCast( theBathymetry ), 0 ), diff --git a/src/HYDROGUI/HYDROGUI_BathymetrySelectionOp.cxx b/src/HYDROGUI/HYDROGUI_BathymetrySelectionOp.cxx index 9e6e5bc7..8f723525 100644 --- a/src/HYDROGUI/HYDROGUI_BathymetrySelectionOp.cxx +++ b/src/HYDROGUI/HYDROGUI_BathymetrySelectionOp.cxx @@ -110,32 +110,14 @@ void HYDROGUI_BathymetrySelectionOp::activateSelection( bool isActive ) QList baths = getShownBathymetries( module() ); if( isActive ) { -// QList aSelectorList; -// QString aViewType = OCCViewer_Viewer::Type(); -// LightApp_SelectionMgr* aSelectionMgr = module()->getApp()->selectionMgr(); -// aSelectionMgr->selectors(aViewType, aSelectorList); -// QList::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; diff --git a/src/HYDROGUI/HYDROGUI_MeasurementToolOp.cxx b/src/HYDROGUI/HYDROGUI_MeasurementToolOp.cxx index 73a2bd6e..763c79cf 100644 --- a/src/HYDROGUI/HYDROGUI_MeasurementToolOp.cxx +++ b/src/HYDROGUI/HYDROGUI_MeasurementToolOp.cxx @@ -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(); diff --git a/src/HYDROGUI/HYDROGUI_Module.cxx b/src/HYDROGUI/HYDROGUI_Module.cxx index 790781d8..3a64a596 100755 --- a/src/HYDROGUI/HYDROGUI_Module.cxx +++ b/src/HYDROGUI/HYDROGUI_Module.cxx @@ -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( aSelector ) && -// !dynamic_cast( aSelector ) && -// !dynamic_cast( aSelector ) ) ) bool isOk = false; if (aSelector) { diff --git a/src/HYDROGUI/HYDROGUI_Shape.cxx b/src/HYDROGUI/HYDROGUI_Shape.cxx index be547c46..b11879dc 100644 --- a/src/HYDROGUI/HYDROGUI_Shape.cxx +++ b/src/HYDROGUI/HYDROGUI_Shape.cxx @@ -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 ); diff --git a/src/HYDROGUI/HYDROGUI_ShapeBathymetry.cxx b/src/HYDROGUI/HYDROGUI_ShapeBathymetry.cxx index 8f893ec5..a6de2d91 100644 --- a/src/HYDROGUI/HYDROGUI_ShapeBathymetry.cxx +++ b/src/HYDROGUI/HYDROGUI_ShapeBathymetry.cxx @@ -237,24 +237,6 @@ QVector HYDROGUI_ShapeBathymetry::selected() const QVector 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(); } diff --git a/src/HYDROGUI/HYDROGUI_SplitPolylinesOp.cxx b/src/HYDROGUI/HYDROGUI_SplitPolylinesOp.cxx index d6aa45b5..a30a0e13 100644 --- a/src/HYDROGUI/HYDROGUI_SplitPolylinesOp.cxx +++ b/src/HYDROGUI/HYDROGUI_SplitPolylinesOp.cxx @@ -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(); diff --git a/src/HYDRO_tests/TestViewer.cxx b/src/HYDRO_tests/TestViewer.cxx index c350a219..be461e7d 100644 --- a/src/HYDRO_tests/TestViewer.cxx +++ b/src/HYDRO_tests/TestViewer.cxx @@ -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 ) {