Salome HOME
NPAL18352: Selection bug in GEOM GUI.
[modules/geom.git] / src / GEOMGUI / GeometryGUI.cxx
index 3179c7e54bbc2207e59e7c283815c02bb1155cc4..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
@@ -511,8 +511,8 @@ void GeometryGUI::OnGUIEvent( int id )
            id == 606 ||   // MENU REPAIR - CLOSE CONTOUR
            id == 607 ||   // MENU REPAIR - REMOVE INTERNAL WIRES
            id == 608 ||   // MENU REPAIR - ADD POINT ON EDGE
-           id == 609 ||   // MENU REPAIR - FREE BOUNDARIES
-           id == 610 ||   // MENU REPAIR - FREE FACES
+           id == 609 ||   // MENU MEASURE - FREE BOUNDARIES
+           id == 610 ||   // MENU MEASURE - FREE FACES
            id == 611 ||   // MENU REPAIR - CHANGE ORIENTATION
           id == 602 ) {  // MENU REPAIR - GLUE FACES
 #ifndef WNT
@@ -524,8 +524,10 @@ 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
           id == 705   ||  // MENU MEASURE - TOLERANCE
           id == 706   ||  // MENU MEASURE - WHATIS
           id == 707   ||  // MENU MEASURE - CHECK
@@ -766,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" );
@@ -846,15 +848,17 @@ 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" );
 
   createGeomAction( 705, "TOLERANCE" );
   createGeomAction( 706, "WHAT_IS" );
   createGeomAction( 707, "CHECK" );
   createGeomAction( 7072, "CHECK_COMPOUND" );
 
-#ifdef _DEBUG_ // PAL16821 
+#ifdef _DEBUG_ // PAL16821
   createGeomAction( 5103, "CHECK_GEOMETRY" );
 #endif
   createGeomAction( 412, "SHADING_COLOR" );
@@ -876,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" );
@@ -990,8 +994,8 @@ void GeometryGUI::initialize( CAM_Application* app )
   createMenu( 601, repairId, -1 );
   createMenu( 602, repairId, -1 );
   createMenu( 608, repairId, -1 );
-  createMenu( 609, repairId, -1 );
-  createMenu( 610, repairId, -1 );
+  //createMenu( 609, repairId, -1 );
+  //createMenu( 610, repairId, -1 );
   createMenu( 611, repairId, -1 );
 
   int measurId = createMenu( tr( "MEN_MEASURES" ), -1, -1, 10 );
@@ -1000,11 +1004,18 @@ 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 );
+  createMenu( 610, measurId, -1 );
+  // NPAL16572 END
   createMenu( separator(), measurId, -1 );
 
   int dimId = createMenu( tr( "MEN_DIMENSIONS" ), measurId, -1 );
   createMenu( 7041, dimId, -1 );
   createMenu( 7042, dimId, -1 );
+  createMenu( 7043, dimId, -1 );
   createMenu( separator(), measurId, -1 );
 
   createMenu( 705, measurId, -1 );
@@ -1013,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 );
@@ -1099,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
@@ -1136,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);
@@ -1163,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 );
@@ -1212,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);