X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FEntityGUI%2FEntityGUI.cxx;h=b47285b72a5f96d04fdc9ec6322fed5ae79cbe88;hb=888b3b52e179ae1505352d56ba63477275693919;hp=95e5f1565291de8638c77c8662733be89872fec9;hpb=6f000dfe28cad33bcf7053913e1a2f24b3fa3e33;p=modules%2Fgeom.git diff --git a/src/EntityGUI/EntityGUI.cxx b/src/EntityGUI/EntityGUI.cxx index 95e5f1565..b47285b72 100644 --- a/src/EntityGUI/EntityGUI.cxx +++ b/src/EntityGUI/EntityGUI.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2022 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -42,6 +42,7 @@ #include #include #include +#include "utilities.h" #include #include @@ -55,6 +56,7 @@ #include "EntityGUI_SketcherDlg.h" // Sketcher #include "EntityGUI_3DSketcherDlg.h" // Sketcher #include "EntityGUI_IsolineDlg.h" // Isoline +#include "EntityGUI_SurfFromFaceDlg.h" // Surface From Face #include "EntityGUI_SubShapeDlg.h" // Method SUBSHAPE #include "EntityGUI_FeatureDetectorDlg.h" // Feature Detection #include "EntityGUI_PictureImportDlg.h" // Import Picture in viewer @@ -106,6 +108,9 @@ bool EntityGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent ) case GEOMOp::OpIsoline: // ISOLINE aDlg = new EntityGUI_IsolineDlg( getGeometryGUI(), parent ); break; + case GEOMOp::OpSurfaceFromFace: // SURFACE FROM FACE + aDlg = new EntityGUI_SurfFromFaceDlg( getGeometryGUI(), parent ); + break; case GEOMOp::OpExplode: // EXPLODE aDlg = new EntityGUI_SubShapeDlg( getGeometryGUI(), parent ); break; @@ -136,14 +141,16 @@ bool EntityGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent ) GEOM::GEOM_FieldStep_var step; SalomeApp_Study* study = dynamic_cast( SUIT_Session::session()->activeApplication()->activeStudy() ); - if ( aList.Extent() > 0 && study ) { + if ( study ) for ( ; anIter.More(); anIter.Next() ) { Handle(SALOME_InteractiveObject) anIObj = anIter.Value(); if ( !anIObj.IsNull() && anIObj->hasEntry() ) - if ( _PTR(SObject) obj = study->studyDS()->FindObjectID( anIObj->getEntry() )) + { + _PTR(SObject) obj = study->studyDS()->FindObjectID( anIObj->getEntry() ); + if ( GeometryGUI::IsInGeomComponent( obj )) { - CORBA::Object_var corbaObj = GeometryGUI::ClientSObjectToObject( obj ); + CORBA::Object_var corbaObj = GeometryGUI::ClientSObjectToObject( obj ); GEOM::GEOM_BaseObject_var bo = GEOM::GEOM_BaseObject::_narrow( corbaObj ); GEOM::GEOM_Field_var f; GEOM::GEOM_FieldStep_var s; @@ -168,9 +175,8 @@ bool EntityGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent ) field = f; } } + } } - } - if ( !field->_is_nil()) { int stepID; if ( !step->_is_nil() ) { @@ -207,7 +213,7 @@ bool EntityGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent ) // function : 0nMousePress() // purpose : [static] manage mouse events //================================================================================= -bool EntityGUI::OnMousePress( QMouseEvent* pe, SUIT_Desktop* parent, SUIT_ViewWindow* theViewWindow ) +bool EntityGUI::OnMousePress( QMouseEvent* pe, SUIT_Desktop* /*parent*/, SUIT_ViewWindow* theViewWindow ) { QDialog* aDlg = getGeometryGUI()->GetActiveDialogBox(); @@ -229,9 +235,9 @@ bool EntityGUI::OnMousePress( QMouseEvent* pe, SUIT_Desktop* parent, SUIT_ViewWi ic->InitSelected(); if ( pe->modifiers() == Qt::ShiftModifier ) - ic->ShiftSelect(); // Append selection + ic->ShiftSelect( Standard_True ); // Append selection else - ic->Select(); // New selection + ic->Select( Standard_True ); // New selection ic->InitSelected(); if ( ic->MoreSelected() ) { @@ -258,7 +264,7 @@ bool EntityGUI::OnMousePress( QMouseEvent* pe, SUIT_Desktop* parent, SUIT_ViewWi Handle(AIS_InteractiveContext) ic = anOCCViewer->getAISContext(); ic->InitSelected(); - ic->Select(); // New selection + ic->Select( Standard_True ); // New selection ic->InitSelected(); TopoDS_Shape aShape; @@ -289,11 +295,11 @@ bool EntityGUI::OnMousePress( QMouseEvent* pe, SUIT_Desktop* parent, SUIT_ViewWi // function : 0nMouseRelease() // purpose : [static] manage mouse events //================================================================================= -bool EntityGUI::OnMouseRelease( QMouseEvent* pe, SUIT_Desktop* parent, SUIT_ViewWindow* theViewWindow ) +bool EntityGUI::OnMouseRelease( QMouseEvent* pe, SUIT_Desktop* /*parent*/, SUIT_ViewWindow* theViewWindow ) { ((OCCViewer_ViewWindow*)theViewWindow)->setSketcherStyle(false); - QDialog* aDlg = getGeometryGUI()->GetActiveDialogBox(); #ifdef WITH_OPENCV + QDialog* aDlg = getGeometryGUI()->GetActiveDialogBox(); if ( aDlg && ( QString( aDlg->metaObject()->className() ).compare( "EntityGUI_FeatureDetectorDlg" ) == 0 ) && theViewWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() && pe->modifiers() != Qt::ControlModifier ) @@ -318,7 +324,7 @@ bool EntityGUI::OnMouseRelease( QMouseEvent* pe, SUIT_Desktop* parent, SUIT_View // function : 0nMouseMove() // purpose : [static] manage mouse events //================================================================================= -bool EntityGUI::OnMouseMove( QMouseEvent* pe, SUIT_Desktop* parent, SUIT_ViewWindow* theViewWindow ) +bool EntityGUI::OnMouseMove( QMouseEvent* pe, SUIT_Desktop* /*parent*/, SUIT_ViewWindow* theViewWindow ) { QDialog* aDlg = getGeometryGUI()->GetActiveDialogBox(); @@ -346,7 +352,7 @@ bool EntityGUI::OnMouseMove( QMouseEvent* pe, SUIT_Desktop* parent, SUIT_ViewWin //===================================================================================== void EntityGUI::DisplaySimulationShape( const TopoDS_Shape& S1, const TopoDS_Shape& S2 ) { - MESSAGE("EntityGUI::DisplaySimulationShape") + MESSAGE("EntityGUI::DisplaySimulationShape"); SalomeApp_Application* app = getGeometryGUI()->getApp(); if ( !app ) return; @@ -360,7 +366,7 @@ void EntityGUI::DisplaySimulationShape( const TopoDS_Shape& S1, const TopoDS_Sha if ( !S1.IsNull() ) { /* erase any previous */ ic->Erase( mySimulationShape1, Standard_True ); - ic->ClearPrs( mySimulationShape1 ); + ic->ClearPrs( mySimulationShape1, 0, Standard_True ); mySimulationShape1 = new AIS_Shape( TopoDS_Shape() ); mySimulationShape1->Set( S1 ); @@ -372,7 +378,7 @@ void EntityGUI::DisplaySimulationShape( const TopoDS_Shape& S1, const TopoDS_Sha } if ( !S2.IsNull() ) { ic->Erase( mySimulationShape2, Standard_True ); - ic->ClearPrs( mySimulationShape2 ); + ic->ClearPrs( mySimulationShape2, 0, Standard_True ); mySimulationShape2 = new AIS_Shape( TopoDS_Shape() ); mySimulationShape2->Set( S2 ); @@ -384,8 +390,8 @@ void EntityGUI::DisplaySimulationShape( const TopoDS_Shape& S1, const TopoDS_Sha } ic->UpdateCurrentViewer(); } - catch( Standard_Failure ) { - MESSAGE( "Exception catched in EntityGUI::DisplaySimulationShape" ); + catch( Standard_Failure& ) { + MESSAGE( "Exception caught in EntityGUI::DisplaySimulationShape" ); } } @@ -395,7 +401,7 @@ void EntityGUI::DisplaySimulationShape( const TopoDS_Shape& S1, const TopoDS_Sha //================================================================================== void EntityGUI::EraseSimulationShape() { - MESSAGE("EntityGUI::EraseSimulationShape") + MESSAGE("EntityGUI::EraseSimulationShape"); SalomeApp_Application* app = getGeometryGUI()->getApp(); if ( !app ) return; @@ -417,8 +423,8 @@ void EntityGUI::EraseSimulationShape() Handle(AIS_InteractiveContext) ic = v3d->getAISContext(); ic->Erase( mySimulationShape1, Standard_True ); ic->Erase( mySimulationShape2, Standard_True ); - ic->ClearPrs( mySimulationShape1 ); - ic->ClearPrs( mySimulationShape2 ); + ic->ClearPrs( mySimulationShape1, 0, Standard_True ); + ic->ClearPrs( mySimulationShape2, 0, Standard_True ); ic->UpdateCurrentViewer(); } }