X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGEOMGUI%2FGeometryGUI.cxx;h=f94d3902d8c10921d60dcc65205651e5bdcdd0f6;hb=2dbe613765884256942925d8a95293e3c473caec;hp=2058d7a2ea2473bc2645adfcdfd1b5068cfb3ad5;hpb=04f3d723da1ae9133d108921c8f10338a9656d12;p=modules%2Fgeom.git diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx index 2058d7a2e..f94d3902d 100644 --- a/src/GEOMGUI/GeometryGUI.cxx +++ b/src/GEOMGUI/GeometryGUI.cxx @@ -47,10 +47,12 @@ #include #include #include +#include #include #include #include #include +#include // External includes #include @@ -466,7 +468,8 @@ void GeometryGUI::OnGUIEvent( int id ) id == 504 || // MENU OPERATION - ARCHIMEDE id == 505 || // MENU OPERATION - FILLET id == 506 || // MENU OPERATION - CHAMFER - id == 507 ) { // MENU OPERATION - CLIPPING RANGE + id == 507 || // MENU OPERATION - CLIPPING RANGE + id == 508 ) { // MENU OPERATION - GET SHAPES ON SHAPE #ifndef WNT library = getLibrary( "libOperationGUI.so" ); #else @@ -797,6 +800,7 @@ void GeometryGUI::initialize( CAM_Application* app ) createGeomAction( 505, "FILLET" ); createGeomAction( 506, "CHAMFER" ); //createGeomAction( 507, "CLIPPING" ); + createGeomAction( 508, "GET_SHAPES_ON_SHAPES" ); createGeomAction( 9998, "MUL_TRANSFORM" ); createGeomAction( 9995, "EXPLODE_BLOCKS" ); @@ -946,6 +950,7 @@ void GeometryGUI::initialize( CAM_Application* app ) createMenu( 503, operId, -1 ); createMenu( 504, operId, -1 ); + createMenu( 508, operId, -1 ); createMenu( separator(), operId, -1 ); createMenu( 505, transId, -1 ); createMenu( 506, transId, -1 ); @@ -1187,14 +1192,17 @@ bool GeometryGUI::activateModule( SUIT_Study* study ) // Reset actions accelerator keys //action(111)->setAccel(QKeySequence(CTRL + Key_I)); // Import //action(121)->setAccel(QKeySequence(CTRL + Key_E)); // Export - action(111)->setEnabled(true); // Import - action(121)->setEnabled(true); // Export + action(111)->setEnabled( true ); // Import: CTRL + Key_I + action(121)->setEnabled( true ); // Export: CTRL + Key_E + action( 33)->setEnabled( true ); // Delete: Key_Delete + action(901)->setEnabled( true ); // Rename: Key_F2 GUIMap::Iterator it; for ( it = myGUIMap.begin(); it != myGUIMap.end(); ++it ) it.value()->activate( application()->desktop() ); LightApp_SelectionMgr* sm = getApp()->selectionMgr(); + SUIT_ViewManager* vm; ViewManagerList OCCViewManagers, VTKViewManagers; @@ -1208,20 +1216,27 @@ bool GeometryGUI::activateModule( SUIT_Study* study ) while ( itVTK.hasNext() && (vm = itVTK.next()) ) myVTKSelectors.append( new LightApp_VTKSelector( dynamic_cast( vm->getViewModel() ), sm ) ); + //NPAL 19674 + SALOME_ListIO selected; + sm->selectedObjects( selected ); + sm->clearSelected(); + // disable OCC selectors - //getApp()->selectionMgr()->setEnabled( false, OCCViewer_Viewer::Type() ); + getApp()->selectionMgr()->setEnabled( false, OCCViewer_Viewer::Type() ); QListIterator itOCCSel( myOCCSelectors ); while ( itOCCSel.hasNext() ) if ( GEOMGUI_OCCSelector* sr = itOCCSel.next() ) sr->setEnabled(true); // disable VTK selectors - //getApp()->selectionMgr()->setEnabled( false, SVTK_Viewer::Type() ); + getApp()->selectionMgr()->setEnabled( false, SVTK_Viewer::Type() ); QListIterator itVTKSel( myVTKSelectors ); while ( itVTKSel.hasNext() ) if ( LightApp_VTKSelector* sr = itVTKSel.next() ) sr->setEnabled(true); + sm->setSelectedObjects( selected, true ); //NPAL 19674 + return true; } @@ -1247,12 +1262,16 @@ bool GeometryGUI::deactivateModule( SUIT_Study* study ) // Unset actions accelerator keys //action(111)->setAccel(QKeySequence()); // Import //action(121)->setAccel(QKeySequence()); // Export - action(111)->setEnabled(false); // Import - action(121)->setEnabled(false); // Export + action(111)->setEnabled( false ); // Import: CTRL + Key_I + action(121)->setEnabled( false ); // Export: CTRL + Key_E + action( 33)->setEnabled( false ); // Delete: Key_Delete + action(901)->setEnabled( false ); // Rename: Key_F2 + qDeleteAll(myOCCSelectors); myOCCSelectors.clear(); getApp()->selectionMgr()->setEnabled( true, OCCViewer_Viewer::Type() ); + qDeleteAll(myVTKSelectors); myVTKSelectors.clear(); getApp()->selectionMgr()->setEnabled( true, SVTK_Viewer::Type() ); @@ -1288,7 +1307,6 @@ void GeometryGUI::onWindowActivated( SUIT_ViewWindow* win ) action( 607 )->setEnabled( ViewOCC ); // RemoveInternalWires action( 608 )->setEnabled( ViewOCC ); // AddPointOnEdge // action( 609 )->setEnabled( ViewOCC ); // Free boundaries -// action( 413 )->setEnabled( ViewOCC || ViewVTK ); // Isos Settings action( 800 )->setEnabled( ViewOCC ); // Create Group action( 801 )->setEnabled( ViewOCC ); // Edit Group @@ -1378,9 +1396,9 @@ QString GeometryGUI::engineIOR() const return ""; } -LightApp_Selection* GeometryGUI::createSelection( const QString& client, LightApp_SelectionMgr* mgr ) const +LightApp_Selection* GeometryGUI::createSelection() const { - return new GEOMGUI_Selection( client, mgr ); + return new GEOMGUI_Selection(); } void GeometryGUI::contextMenuPopup( const QString& client, QMenu* menu, QString& title ) @@ -1403,7 +1421,7 @@ void GeometryGUI::createPreferences() int tabId = addPreference( tr( "PREF_TAB_SETTINGS" ) ); int genGroup = addPreference( tr( "PREF_GROUP_GENERAL" ), tabId ); - setPreferenceProperty( genGroup, "columns", 1 ); + setPreferenceProperty( genGroup, "columns", 2 ); int dispmode = addPreference( tr( "PREF_DISPLAY_MODE" ), genGroup, LightApp_Preferences::Selector, @@ -1431,6 +1449,7 @@ void GeometryGUI::createPreferences() LightApp_Preferences::IntSpin, "Geometry", "SettingsGeomStep" ); int VertexGroup = addPreference( tr( "PREF_GROUP_VERTEX" ), tabId ); + setPreferenceProperty( VertexGroup, "columns", 2 ); int typeOfMarker = addPreference( tr( "PREF_TYPE_OF_MARKER" ), VertexGroup, LightApp_Preferences::Selector, "Geometry", "type_of_marker" ); @@ -1451,7 +1470,7 @@ void GeometryGUI::createPreferences() setPreferenceProperty( dispmode, "indexes", anIndexesList ); // Set property for step value for spinboxes - setPreferenceProperty( step, "min", 0.001 ); + setPreferenceProperty( step, "min", 1 ); setPreferenceProperty( step, "max", 10000 ); setPreferenceProperty( step, "precision", 3 );