Salome HOME
Mantis issue 0021392: EDF 1631 GEOM: Dump study of sketcher 3D with relatives coordin...
[modules/geom.git] / src / GEOMGUI / GeometryGUI.cxx
index 1ae3b2977f37753f4451276b4d1cc28920ac6c1a..b59220aadd3e107e3714b956c9c80f096c92cc97 100644 (file)
@@ -535,6 +535,7 @@ void GeometryGUI::OnGUIEvent( int id )
   case GEOMOp::OpGlueEdges:          // MENU REPAIR - GLUE EDGES
   case GEOMOp::OpLimitTolerance:     // MENU REPAIR - LIMIT TOLERANCE
   case GEOMOp::OpRemoveExtraEdges:   // MENU REPAIR - REMOVE EXTRA EDGES
+  case GEOMOp::OpFuseEdges:          // MENU REPAIR - FUSE COLLINEAR EDGES
     libName = "RepairGUI";
     break;
   case GEOMOp::OpProperties:         // MENU MEASURE - PROPERTIES
@@ -548,6 +549,7 @@ void GeometryGUI::OnGUIEvent( int id )
   case GEOMOp::OpWhatIs:             // MENU MEASURE - WHATIS
   case GEOMOp::OpCheckShape:         // MENU MEASURE - CHECK
   case GEOMOp::OpCheckCompound:      // MENU MEASURE - CHECK COMPOUND OF BLOCKS
+  case GEOMOp::OpGetNonBlocks:       // MENU MEASURE - Get NON BLOCKS
   case GEOMOp::OpPointCoordinates:   // MENU MEASURE - POINT COORDINATES
   case GEOMOp::OpCheckSelfInters:    // MENU MEASURE - CHECK SELF INTERSECTIONS
     libName = "MeasureGUI";
@@ -813,6 +815,7 @@ void GeometryGUI::initialize( CAM_Application* app )
   createGeomAction( GEOMOp::OpFreeFaces,        "CHECK_FREE_FACES" );
   createGeomAction( GEOMOp::OpOrientation,      "CHANGE_ORIENTATION" );
   createGeomAction( GEOMOp::OpRemoveExtraEdges, "REMOVE_EXTRA_EDGES" );
+  createGeomAction( GEOMOp::OpFuseEdges,        "FUSE_EDGES" );
 
   createGeomAction( GEOMOp::OpPointCoordinates, "POINT_COORDS" );
   createGeomAction( GEOMOp::OpProperties,       "BASIC_PROPS" );
@@ -827,6 +830,7 @@ void GeometryGUI::initialize( CAM_Application* app )
   createGeomAction( GEOMOp::OpWhatIs,           "WHAT_IS" );
   createGeomAction( GEOMOp::OpCheckShape,       "CHECK" );
   createGeomAction( GEOMOp::OpCheckCompound,    "CHECK_COMPOUND" );
+  createGeomAction( GEOMOp::OpGetNonBlocks,     "GET_NON_BLOCKS" );
   createGeomAction( GEOMOp::OpCheckSelfInters,  "CHECK_SELF_INTERSECTIONS" );
 
 #ifdef _DEBUG_ // PAL16821
@@ -1032,6 +1036,7 @@ void GeometryGUI::initialize( CAM_Application* app )
   //createMenu( GEOMOp::OpFreeFaces,       repairId, -1 );
   createMenu( GEOMOp::OpOrientation,      repairId, -1 );
   createMenu( GEOMOp::OpRemoveExtraEdges, repairId, -1 );
+  createMenu( GEOMOp::OpFuseEdges,        repairId, -1 );
 
   int measurId = createMenu( tr( "MEN_MEASURES" ), -1, -1, 10 );
   createMenu( GEOMOp::OpPointCoordinates, measurId, -1 );
@@ -1056,6 +1061,7 @@ void GeometryGUI::initialize( CAM_Application* app )
   createMenu( GEOMOp::OpWhatIs,          measurId, -1 );
   createMenu( GEOMOp::OpCheckShape,      measurId, -1 );
   createMenu( GEOMOp::OpCheckCompound,   measurId, -1 );
+  createMenu( GEOMOp::OpGetNonBlocks,    measurId, -1 );
   createMenu( GEOMOp::OpCheckSelfInters, measurId, -1 );
 
 #ifdef _DEBUG_ // PAL16821
@@ -1193,6 +1199,7 @@ void GeometryGUI::initialize( CAM_Application* app )
   createTool( GEOMOp::OpWhatIs,           measureTbId );
   createTool( GEOMOp::OpCheckShape,       measureTbId );
   createTool( GEOMOp::OpCheckCompound,    measureTbId );
+  createTool( GEOMOp::OpGetNonBlocks,     measureTbId );
   createTool( GEOMOp::OpCheckSelfInters,  measureTbId );
   
   int picturesTbId = createTool( tr( "TOOL_PICTURES" ) );
@@ -1660,41 +1667,19 @@ LightApp_Selection* GeometryGUI::createSelection() const
 void GeometryGUI::contextMenuPopup( const QString& client, QMenu* menu, QString& title )
 {
   SalomeApp_Module::contextMenuPopup( client, menu, title );
-
-  /*
   SALOME_ListIO lst;
-  getApp()->selectionMgr()->selectedObjects(lst);
-  if (lst.Extent() < 1)
-    return;
-
-  SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>(application()->activeStudy());
-  _PTR(Study) study = appStudy->studyDS();
-
-  bool isImported = true;
-  SALOME_ListIteratorOfListIO anIt (lst);
-  for (; anIt.More() && isImported; anIt.Next()) {
-    Handle(SALOME_InteractiveObject) io = anIt.Value();
-    _PTR(SObject) aSObj = study->FindObjectID(io->getEntry());
-    if (aSObj) {
-      if (lst.Extent() == 1) {
-        // Set context menu title
-        if (client == "OCCViewer" || client == "VTKViewer")
-          title = QString(aSObj->GetName().c_str());
-      }
-
-      CORBA::Object_var anObj = GeometryGUI::ClientSObjectToObject(aSObj);
-      GEOM::GEOM_Object_var aGeomObj = GEOM::GEOM_Object::_narrow(anObj);
-      if (CORBA::is_nil(aGeomObj) || aGeomObj->GetType() != GEOM_IMPORT)
-        isImported = false;
-    } else {
-      isImported = false;
+  getApp()->selectionMgr()->selectedObjects( lst );
+  if ( ( client == "OCCViewer" || client == "VTKViewer" ) && lst.Extent() == 1 ) {
+    Handle(SALOME_InteractiveObject) io = lst.First();
+    SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( application()->activeStudy() );
+    _PTR(Study) study = appStudy->studyDS();
+    _PTR(SObject) obj = study->FindObjectID( io->getEntry() );
+    if ( obj ) {
+      QString aName = QString( obj->GetName().c_str() );
+      aName.remove( QRegExp("\\s+$") );
+      title = aName;
     }
   }
-
-  if (isImported) {
-    menu->addAction(action(GEOMOp::OpReimport)); // Reload imported shape
-  }
-  */
 }
 
 void GeometryGUI::createPreferences()