Salome HOME
NPAL18352: Selection bug in GEOM GUI.
[modules/geom.git] / src / GEOMGUI / GeometryGUI.cxx
index f08c87cac97a79624a73f8862ee6923f4ef70e98..1cd8629e8eb32cfbeb39c367439f1e60f36d4ddf 100644 (file)
@@ -212,11 +212,11 @@ GEOMGUI* GeometryGUI::getLibrary( const QString& libraryName )
     // try to load library if it is not loaded yet
     QCString libs;
 #ifndef WNT
-    if( ( libs = getenv( "LD_LIBRARY_PATH" ) ) ) {
-         QStringList dirList = QStringList::split( ":", libs, false ); // skip empty entries
+    if ( (libs = getenv( "LD_LIBRARY_PATH" )) ) {
+      QStringList dirList = QStringList::split( ":", libs, false ); // skip empty entries
 #else
-       if( ( libs = getenv( "PATH" ) ) ) {
-         QStringList dirList = QStringList::split( ";", libs, false ); // skip empty entries
+      if ( (libs = getenv( "PATH" )) ) {
+        QStringList dirList = QStringList::split( ";", libs, false ); // skip empty entries
 #endif
       for( int i = dirList.count()-1; i >= 0; i-- ) {
        QString dir = dirList[ i ];
@@ -377,7 +377,7 @@ void GeometryGUI::OnGUIEvent( int id )
       id == 2175 ||  // POPUP VIEWER - SELECT ONLY - SHELL
       id == 2176 ||  // POPUP VIEWER - SELECT ONLY - SOLID
       id == 2177 ||  // POPUP VIEWER - SELECT ONLY - COMPOUND
-      id == 2178 ||  // POPUP VIEWER - SELECT ONLY - SELECT ALL      
+      id == 2178 ||  // POPUP VIEWER - SELECT ONLY - SELECT ALL
       id == 31   ||  // MENU EDIT - COPY
       id == 33   ||  // MENU EDIT - DELETE
       id == 411  ||  // MENU SETTINGS - ADD IN STUDY
@@ -524,6 +524,7 @@ void GeometryGUI::OnGUIEvent( int id )
   else if( id == 701   ||  // MENU MEASURE - PROPERTIES
           id == 702   ||  // MENU MEASURE - CDG
           id == 703   ||  // MENU MEASURE - INERTIA
+          id == 704   ||  // MENU MEASURE - NORMALE
           id == 7041  ||  // MENU MEASURE - BOUNDING BOX
           id == 7042  ||  // MENU MEASURE - MIN DISTANCE
           id == 7043  ||  // MENU MEASURE - ANGLE
@@ -767,7 +768,7 @@ void GeometryGUI::initialize( CAM_Application* app )
   createGeomAction( 111, "IMPORT", "", (CTRL + Key_I) );
   createGeomAction( 121, "EXPORT", "", (CTRL + Key_E) );
 
-  createGeomAction( 33, "DELETE" );
+  createGeomAction( 33, "DELETE", "", Key_Delete );
 
   createGeomAction( 4011, "POINT" );
   createGeomAction( 4012, "LINE" );
@@ -847,6 +848,7 @@ void GeometryGUI::initialize( CAM_Application* app )
   createGeomAction( 701, "BASIC_PROPS" );
   createGeomAction( 702, "MASS_CENTER" );
   createGeomAction( 703, "INERTIA" );
+  createGeomAction( 704, "NORMALE" );
   createGeomAction( 7041, "BND_BOX" );
   createGeomAction( 7042, "MIN_DIST" );
   createGeomAction( 7043, "MEASURE_ANGLE" );
@@ -856,7 +858,7 @@ void GeometryGUI::initialize( CAM_Application* app )
   createGeomAction( 707, "CHECK" );
   createGeomAction( 7072, "CHECK_COMPOUND" );
 
-#ifdef _DEBUG_ // PAL16821 
+#ifdef _DEBUG_ // PAL16821
   createGeomAction( 5103, "CHECK_GEOMETRY" );
 #endif
   createGeomAction( 412, "SHADING_COLOR" );
@@ -878,7 +880,7 @@ void GeometryGUI::initialize( CAM_Application* app )
   createGeomAction( 213, "DISPLAY_ONLY" );
   createGeomAction( 215, "ERASE" );
 
-  createGeomAction( 901, "POP_RENAME" );
+  createGeomAction( 901, "POP_RENAME", "", Key_F2 );
   createGeomAction( 80311, "POP_WIREFRAME", "", 0, true );
   createGeomAction( 80312, "POP_SHADING", "", 0, true );
   createGeomAction( 8032, "POP_COLOR" );
@@ -1002,6 +1004,7 @@ void GeometryGUI::initialize( CAM_Application* app )
   createMenu( separator(), measurId, -1 );
   createMenu( 702, measurId, -1 );
   createMenu( 703, measurId, -1 );
+  createMenu( 704, measurId, -1 );
   // NPAL16572: move "Check free boundaries" and "Check free faces" from "Repair" to "Measure"
   createMenu( separator(), measurId, -1 );
   createMenu( 609, measurId, -1 );
@@ -1021,7 +1024,7 @@ void GeometryGUI::initialize( CAM_Application* app )
   createMenu( 707, measurId, -1 );
   createMenu( 7072, measurId, -1 );
 
-#ifdef _DEBUG_ // PAL16821 
+#ifdef _DEBUG_ // PAL16821
   int toolsId = createMenu( tr( "MEN_TOOLS" ), -1, -1, 50 );
   createMenu( separator(), toolsId, -1 );
   createMenu( 5103, toolsId, -1 );
@@ -1107,6 +1110,8 @@ void GeometryGUI::initialize( CAM_Application* app )
   QtxPopupMgr* mgr = popupMgr();
   mgr->insert( action(  901 ), -1, -1 );  // rename
   mgr->setRule( action( 901 ), "$type in {'Shape' 'Group'} and selcount=1", true );
+  mgr->insert( action(   33 ), -1, -1 );  // delete
+  mgr->setRule( action(  33 ), "$type in {'Shape' 'Group'} and selcount>0", true );
   mgr->insert( action(  8001 ), -1, -1 ); // create group
   mgr->setRule( action( 8001 ), "client='ObjectBrowser' and type='Shape' and selcount=1 and isOCC=true", true );
   mgr->insert( action(  801 ), -1, -1 );  // edit group
@@ -1144,7 +1149,7 @@ void GeometryGUI::initialize( CAM_Application* app )
   mgr->setRule( action( 214 ), clientOCCorVTK, true );
 
   QString selectOnly = "(client='OCCViewer' or client='VTKViewer') and (selcount=0)";
-  
+
   int selectolnyId = mgr->insert( tr("MEN_SELECT_ONLY"), -1, -1);                //select only menu
   mgr->insert( action(2171), selectolnyId, -1);                                  //Vertex
   mgr->setRule(action(2171), selectOnly, true);
@@ -1171,7 +1176,7 @@ void GeometryGUI::initialize( CAM_Application* app )
   mgr->insert( action(2178), selectolnyId, -1);                                  //Clear selection filter
   mgr->setRule(action(2178), selectOnly, true);
   mgr->setRule(action(2178), selectOnly + " and selectionmode='ALL'", false);
-  
+
   mgr->insert( action(  213 ), -1, -1 ); // display only
   mgr->setRule( action( 213 ), rule.arg( types ).arg( "true" ), true );
   mgr->insert( separator(), -1, -1 );
@@ -1220,12 +1225,12 @@ bool GeometryGUI::activateModule( SUIT_Study* study )
     myVTKSelectors.append( new LightApp_VTKSelector( dynamic_cast<SVTK_Viewer*>( vm->getViewModel() ), sm ) );
 
   // disable OCC selectors
-  getApp()->selectionMgr()->setEnabled( false, OCCViewer_Viewer::Type() );
+  //getApp()->selectionMgr()->setEnabled( false, OCCViewer_Viewer::Type() );
   for ( GEOMGUI_OCCSelector* sr = myOCCSelectors.first(); sr; sr = myOCCSelectors.next() )
     sr->setEnabled(true);
 
   // disable VTK selectors
-  getApp()->selectionMgr()->setEnabled( false, SVTK_Viewer::Type() );
+  //getApp()->selectionMgr()->setEnabled( false, SVTK_Viewer::Type() );
   for ( LightApp_VTKSelector* sr = myVTKSelectors.first(); sr; sr = myVTKSelectors.next() )
     sr->setEnabled(true);