]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
CMake improvement: usage of SALOME_GUI_MODE() macro
authormpa <mpa@opencascade.com>
Thu, 11 Jun 2015 13:03:47 +0000 (16:03 +0300)
committermpa <mpa@opencascade.com>
Thu, 11 Jun 2015 13:03:47 +0000 (16:03 +0300)
16 files changed:
CMakeLists.txt
doc/salome/gui/GEOM/input/dependency_tree.doc
doc/salome/gui/GEOM/input/shape_statistics_operation.doc
src/CMakeLists.txt
src/EntityGUI/EntityGUI_SubShapeDlg.cxx
src/EntityGUI/EntityGUI_SubShapeDlg.h
src/GEOMGUI/GeometryGUI.cxx
src/GEOMGUI/GeometryGUI_Operations.h
src/GEOMToolsGUI/CMakeLists.txt
src/GEOMToolsGUI/GEOMToolsGUI.cxx
src/GEOMToolsGUI/GEOMToolsGUI.h
src/GEOMToolsGUI/GEOMToolsGUI_1.cxx
src/GroupGUI/GroupGUI_GroupDlg.cxx
src/GroupGUI/GroupGUI_GroupDlg.h
src/MeasureGUI/CMakeLists.txt
src/MeasureGUI/MeasureGUI.cxx

index dbf940714bd43519142597159a5ea51971a29982..8637d67847b34a355a1caddd904328866f120683 100755 (executable)
@@ -108,7 +108,9 @@ IF(SALOME_BUILD_GUI)
   IF(EXISTS ${GUI_ROOT_DIR})
     LIST(APPEND CMAKE_MODULE_PATH "${GUI_ROOT_DIR}/adm_local/cmake_files")
     FIND_PACKAGE(SalomeGUI)
-    FULL_GUI(TRUE) #check whether GUI builded in full mode and with CORBA
+    SALOME_GUI_WITH_CORBA() #check whether GUI builded with CORBA
+    SALOME_GUI_MODE(SALOME_USE_OCCVIEWER SALOME_USE_VTKVIEWER SALOME_USE_SALOMEOBJECT 
+                    OPTIONAL SALOME_USE_PLOT2DVIEWER SALOME_USE_GRAPHICSVIEW SALOME_USE_PYCONSOLE)
     ADD_DEFINITIONS(${GUI_DEFINITIONS})
     INCLUDE_DIRECTORIES(${GUI_INCLUDE_DIRS})
   ELSE(EXISTS ${GUI_ROOT_DIR})
@@ -125,12 +127,6 @@ IF(SALOME_BUILD_GUI)
 
   # Qt4
   FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui QtXml)
-
-  # Optional prerequisites for GUI
-  IF(SALOME_USE_GLVIEWER)
-    FIND_PACKAGE(SalomeOpenGL)
-    SALOME_LOG_OPTIONAL_PACKAGE(OpenGL SALOME_USE_GLVIEWER) 
-  ENDIF() 
 ENDIF(SALOME_BUILD_GUI)
 
 ##
@@ -231,9 +227,12 @@ IF(SALOME_BUILD_GUI)
   LIST(APPEND _${PROJECT_NAME}_exposed_targets 
     AdvancedGUI BasicGUI BlocksGUI BooleanGUI BuildGUI DisplayGUI DlgRef CurveCreator EntityGUI GEOMBase
     GEOMFiltersSelection GEOM GEOMToolsGUI GenerationGUI GroupGUI Material MeasureGUI GEOMObject
-    OperationGUI PrimitiveGUI RepairGUI TransformationGUI DependencyTree
+    OperationGUI PrimitiveGUI RepairGUI TransformationGUI
     STLPluginGUI BREPPluginGUI STEPPluginGUI IGESPluginGUI XAOPluginGUI VTKPluginGUI
     )
+  IF(SALOME_USE_GRAPHICSVIEW)
+    LIST(APPEND _${PROJECT_NAME}_exposed_targets DependencyTree)
+  ENDIF(SALOME_USE_GRAPHICSVIEW)
 ENDIF(SALOME_BUILD_GUI)
 
 IF(SALOME_GEOM_USE_OPENCV)
index b8346eec7553ef4ee1e26879baefc7c2350cf59c..40e1a2ac4bcdb237ab70c5672697297dc0f2c7f9 100644 (file)
@@ -28,6 +28,8 @@ It is also possible to select an object(s) directly in the "Dependency Tree" vie
 
 All necessary parameters of Dependency Tree Viewer can be edited in the \ref pref_dependency_tree "Preferences".
 
+\note This functionality is available only if GUI module is builded with Graphics view (set option SALOME_USE_GRAPHICSVIEW to ON when building GUI module).
+
 <hr>
 \anchor dependency_tree_nodes_anchor <h2>Nodes</h2>
 
index 207db3b7537ca872a3300dfba817a90459c3d9e0..991d103b50467619ee9c064c26a420562bb8b12b 100644 (file)
@@ -25,4 +25,6 @@ In this dialog:
 
 - Close dialog box, by pressing <b>Close</b> button.
 
+\note This functionality is available only if GUI module is builded with Plot 2D Viewer (set option SALOME_USE_PLOT2DVIEWER to ON when building GUI module).
+
 */
index 6f830743b957ffe5951b5607bc6a753fbbd872aa..bd7e3428d56bc9104b3e6753b39a5c45c0fc9345 100755 (executable)
@@ -42,11 +42,14 @@ ENDIF()
 IF(SALOME_BUILD_GUI)
   SET(SUBDIRS_GUI
     OBJECT DlgRef GEOMFiltersSelection Material GEOMGUI
-    GEOMBase DependencyTree GEOMToolsGUI DisplayGUI BasicGUI PrimitiveGUI GenerationGUI
+    GEOMBase GEOMToolsGUI DisplayGUI BasicGUI PrimitiveGUI GenerationGUI
     CurveCreator MeasureGUI EntityGUI BuildGUI BooleanGUI TransformationGUI OperationGUI
     RepairGUI GroupGUI BlocksGUI AdvancedGUI
     GEOM_SWIG_WITHIHM
     )
+  IF(SALOME_USE_GRAPHICSVIEW)
+    LIST(APPEND SUBDIRS_GUI DependencyTree)
+  ENDIF()
 ENDIF()
 
 SET(SUBDIRS
index 598d05de696a15242499b921f372e42b8046f7ea..9449cf0309e58f8057b5fa5927b724e2270a9ff6 100644 (file)
@@ -30,7 +30,9 @@
 #include <GeometryGUI.h>
 #include <GEOMBase.h>
 #include <GEOMUtils.hxx>
-#include <MeasureGUI_ShapeStatisticsDlg.h>
+#ifndef DISABLE_PLOT2DVIEWER
+  #include <MeasureGUI_ShapeStatisticsDlg.h>
+#endif
 
 #include <OCCViewer_ViewModel.h>
 #include <SVTK_ViewModel.h>
@@ -166,7 +168,9 @@ EntityGUI_SubShapeDlg::EntityGUI_SubShapeDlg(GeometryGUI* theGeometryGUI, QWidge
   myLessFilterSpin = new SalomeApp_DoubleSpinBox(myFilterGrp);
   myGreaterFilterSpin = new SalomeApp_DoubleSpinBox(myFilterGrp);
   myApplyFilterButton = new QPushButton(tr("GEOM_BUT_APPLY"), myFilterGrp);
+#ifndef DISABLE_PLOT2DVIEWER
   myPlotDistributionButton = new QPushButton(tr("GEOM_PLOT_DISTRIBUTION"), myFilterGrp);
+#endif
 
   QGridLayout* filterLayout = new QGridLayout(myFilterGrp);
   filterLayout->addWidget(myLessFilterCheck,    0, 0);
@@ -176,7 +180,9 @@ EntityGUI_SubShapeDlg::EntityGUI_SubShapeDlg(GeometryGUI* theGeometryGUI, QWidge
   filterLayout->addWidget(myGreaterFilterCombo, 1, 1);
   filterLayout->addWidget(myGreaterFilterSpin,  1, 2);
   filterLayout->addWidget(myApplyFilterButton,  0, 3);
+#ifndef DISABLE_PLOT2DVIEWER
   filterLayout->addWidget(myPlotDistributionButton,  1, 3);
+#endif
 
   QVBoxLayout* layout = new QVBoxLayout(centralWidget());
   layout->setMargin(0); layout->setSpacing(6);
@@ -253,7 +259,9 @@ void EntityGUI_SubShapeDlg::Init()
   connect(GroupPoints->PushButton4, SIGNAL(clicked()), this, SLOT(showOnlySelected()));
 
   connect(myApplyFilterButton, SIGNAL(clicked()),         this, SLOT(ClickOnOkFilter()));
+#ifndef DISABLE_PLOT2DVIEWER
   connect(myPlotDistributionButton, SIGNAL(clicked()),    this, SLOT(ClickOnPlot()));
+#endif
   connect(myLessFilterCheck,   SIGNAL(stateChanged(int)), this, SLOT(MeasureToggled()));
   connect(myGreaterFilterCheck,   SIGNAL(stateChanged(int)), this, SLOT(MeasureToggled()));
 
@@ -495,10 +503,12 @@ void EntityGUI_SubShapeDlg::SubShapeToggled()
                           GroupPoints->CheckButton1->isChecked() &&
                           shapeType() < GEOM::VERTEX);
 
+#ifndef DISABLE_PLOT2DVIEWER
   myPlotDistributionButton->setEnabled( myFilterGrp->isEnabled() &&
                                        ( shapeType() == TopAbs_EDGE || 
                                          shapeType() == TopAbs_FACE ||
                                          shapeType() == TopAbs_SOLID ) );
+#endif
 
   activateSelection();
 }
@@ -945,6 +955,7 @@ void EntityGUI_SubShapeDlg::ClickOnOkFilter()
   updateButtonState();
 }
 
+#ifndef DISABLE_PLOT2DVIEWER
 //=================================================================================
 // function : ClickOnPlot()
 // purpose  : opens "Shape Statistics" dialog box in order to plot sub-shapes distribution.
@@ -956,6 +967,7 @@ void EntityGUI_SubShapeDlg::ClickOnPlot()
     dlg->show();
   }
 }
+#endif
 
 //=================================================================================
 // function : MeasureToggled()
index c2f14e66e0a8d1326c3caa20321d3cbfc803188d..18c0c9ec87b1804f54a8b46c8fa46eb5a8435258 100644 (file)
@@ -73,7 +73,9 @@ private slots:
 
   void                                showOnlySelected();
   void                                ClickOnOkFilter();
+#ifndef DISABLE_PLOT2DVIEWER
   void                                ClickOnPlot();
+#endif
   void                                MeasureToggled();
 
 private:
index 8b4f0968a95e0a8ee22d656cbb423f13a1509139..3bfe0e5b0d31a9cb09a5946a78266d9d1356b2ef 100644 (file)
@@ -51,8 +51,6 @@
 #include <SUIT_Session.h>
 #include <SUIT_ViewManager.h>
 
-#include <PyInterp_Interp.h>
-
 #include <OCCViewer_ViewWindow.h>
 #include <OCCViewer_ViewPort3d.h>
 #include <OCCViewer_ViewModel.h>
@@ -66,7 +64,9 @@
 #include <SVTK_InteractorStyle.h>
 #include <SVTK_ViewModel.h>
 
+#ifndef DISABLE_GRAPHICSVIEW
 #include <GraphicsView_Viewer.h>
+#endif
 
 #include <SalomeApp_Application.h>
 #include <SalomeApp_DataObject.h>
@@ -438,7 +438,11 @@ void GeometryGUI::OnGUIEvent( int id, const QVariant& theParam )
   SUIT_ViewWindow* window = desk->activeWindow();
   bool ViewOCC = ( window && window->getViewManager()->getType() == OCCViewer_Viewer::Type() );
   bool ViewVTK = ( window && window->getViewManager()->getType() == SVTK_Viewer::Type() );
+#ifndef DISABLE_GRAPHICSVIEW
   bool ViewDep = ( window && window->getViewManager()->getType() == GraphicsView_Viewer::Type() );
+#else
+  bool ViewDep = 0;
+#endif
   // if current viewframe is not of OCC and not of VTK type - return immediately
   // fix for IPAL8958 - allow some commands to execute even when NO viewer is active (rename for example)
   QList<int> NotViewerDependentCommands;
@@ -479,7 +483,9 @@ void GeometryGUI::OnGUIEvent( int id, const QVariant& theParam )
   case GEOMOp::OpSelectCompound:     // POPUP MENU - SELECT ONLY - COMPOUND
   case GEOMOp::OpSelectAll:          // POPUP MENU - SELECT ONLY - SELECT ALL
   case GEOMOp::OpDelete:             // MENU EDIT - DELETE
+#ifndef DISABLE_PYCONSOLE
   case GEOMOp::OpCheckGeom:          // MENU TOOLS - CHECK GEOMETRY
+#endif
   case GEOMOp::OpMaterialsLibrary:   // MENU TOOLS - MATERIALS LIBRARY
   case GEOMOp::OpDeflection:         // POPUP MENU - DEFLECTION COEFFICIENT
   case GEOMOp::OpColor:              // POPUP MENU - COLOR
@@ -506,7 +512,9 @@ void GeometryGUI::OnGUIEvent( int id, const QVariant& theParam )
   case GEOMOp::OpClsBringToFront:    //
   case GEOMOp::OpCreateFolder:       // POPUP MENU - CREATE FOLDER
   case GEOMOp::OpSortChildren:       // POPUP MENU - SORT CHILD ITEMS
+#ifndef DISABLE_GRAPHICSVIEW
   case GEOMOp::OpShowDependencyTree: // POPUP MENU - SHOW DEPENDENCY TREE
+#endif
   case GEOMOp::OpReduceStudy:        // POPUP MENU - REDUCE STUDY
     libName = "GEOMToolsGUI";
     break;
@@ -653,7 +661,9 @@ void GeometryGUI::OnGUIEvent( int id, const QVariant& theParam )
   case GEOMOp::OpCheckSelfInters:    // MENU MEASURE - CHECK SELF INTERSECTIONS
   case GEOMOp::OpFastCheckInters:    // MENU MEASURE - FAST CHECK INTERSECTIONS
   case GEOMOp::OpManageDimensions:   // MENU MEASURE - MANAGE DIMENSIONS
+#ifndef DISABLE_PLOT2DVIEWER
   case GEOMOp::OpShapeStatistics:    // MENU MEASURE - SHAPE STATISTICS
+#endif
   case GEOMOp::OpShowAllDimensions:  // POPUP MENU - SHOW ALL DIMENSIONS
   case GEOMOp::OpHideAllDimensions:  // POPUP MENU - HIDE ALL DIMENSIONS
     libName = "MeasureGUI";
@@ -1035,10 +1045,14 @@ void GeometryGUI::initialize( CAM_Application* app )
   createGeomAction( GEOMOp::OpGetNonBlocks,     "GET_NON_BLOCKS" );
   createGeomAction( GEOMOp::OpCheckSelfInters,  "CHECK_SELF_INTERSECTIONS" );
   createGeomAction( GEOMOp::OpFastCheckInters,  "FAST_CHECK_INTERSECTIONS" );
+#ifndef DISABLE_PLOT2DVIEWER
   createGeomAction( GEOMOp::OpShapeStatistics,  "SHAPE_STATISTICS" );
+#endif
 
+#ifndef DISABLE_PYCONSOLE
 #ifdef _DEBUG_ // PAL16821
   createGeomAction( GEOMOp::OpCheckGeom,        "CHECK_GEOMETRY" );
+#endif
 #endif
 
   createGeomAction( GEOMOp::OpMaterialsLibrary,   "MATERIALS_LIBRARY" );
@@ -1093,7 +1107,9 @@ void GeometryGUI::initialize( CAM_Application* app )
   createGeomAction( GEOMOp::OpPredefMaterCustom,    "POP_PREDEF_MATER_CUSTOM" );
   createGeomAction( GEOMOp::OpCreateFolder, "POP_CREATE_FOLDER" );
   createGeomAction( GEOMOp::OpSortChildren, "POP_SORT_CHILD_ITEMS" );
+#ifndef DISABLE_GRAPHICSVIEW
   createGeomAction( GEOMOp::OpShowDependencyTree, "POP_SHOW_DEPENDENCY_TREE" );
+#endif
   createGeomAction( GEOMOp::OpReduceStudy,       "POP_REDUCE_STUDY" );
   createGeomAction( GEOMOp::OpShowAllDimensions, "POP_SHOW_ALL_DIMENSIONS" );
   createGeomAction( GEOMOp::OpHideAllDimensions, "POP_HIDE_ALL_DIMENSIONS" );
@@ -1299,12 +1315,16 @@ void GeometryGUI::initialize( CAM_Application* app )
   createMenu( GEOMOp::OpCheckSelfInters, measurId, -1 );
   createMenu( GEOMOp::OpFastCheckInters, measurId, -1 );
   createMenu( GEOMOp::OpInspectObj,      measurId, -1 );
+#ifndef DISABLE_PLOT2DVIEWER
   createMenu( GEOMOp::OpShapeStatistics, measurId, -1 );
+#endif
 
   int toolsId = createMenu( tr( "MEN_TOOLS" ), -1, -1, 50 );
+#ifndef DISABLE_PYCONSOLE
 #if defined(_DEBUG_) || defined(_DEBUG) // PAL16821
   createMenu( separator(),         toolsId, -1 );
   createMenu( GEOMOp::OpCheckGeom, toolsId, -1 );
+#endif
 #endif
 
   createMenu( separator(),         toolsId, -1 );
@@ -1633,9 +1653,11 @@ void GeometryGUI::initialize( CAM_Application* app )
   mgr->insert( action(  GEOMOp::OpSortChildren ), -1, -1 ); // Sort child items
   mgr->setRule( action( GEOMOp::OpSortChildren ), QString("client='ObjectBrowser' and $component={'GEOM'} and nbChildren>1"), QtxPopupMgr::VisibleRule );
 
+#ifndef DISABLE_GRAPHICSVIEW
   mgr->insert( separator(), -1, -1 );     // -----------
   mgr->insert( action(  GEOMOp::OpShowDependencyTree ), -1, -1 ); // Show dependency tree
   mgr->setRule( action( GEOMOp::OpShowDependencyTree ), clientOCCorVTKorOB + " and selcount>0 and ($component={'GEOM'}) and type='Shape'", QtxPopupMgr::VisibleRule );
+#endif
 
   mgr->insert( separator(), -1, -1 );     // -----------
   mgr->insert( action(  GEOMOp::OpReduceStudy ), -1, -1 ); // Reduce Study
@@ -1756,17 +1778,18 @@ bool GeometryGUI::activateModule( SUIT_Study* study )
 
   // import Python module that manages GEOM plugins (need to be here because SalomePyQt API uses active module)
   PyGILState_STATE gstate = PyGILState_Ensure();
-  PyObjWrapper pluginsmanager = PyImport_ImportModuleNoBlock((char*)"salome_pluginsmanager");
+  PyObject* pluginsmanager = PyImport_ImportModuleNoBlock((char*)"salome_pluginsmanager");
   if ( !pluginsmanager ) {
     PyErr_Print();
   }
   else {
-    PyObjWrapper result =
+    PyObject* result =
       PyObject_CallMethod(pluginsmanager, (char*)"initialize", (char*)"isss", 1, "geom",
                           tr("MEN_NEW_ENTITY").toUtf8().data(),
                           tr("GEOM_PLUGINS_OTHER").toUtf8().data());
     if ( !result )
       PyErr_Print();
+    Py_XDECREF(result);
   }
   PyGILState_Release(gstate);
   // end of GEOM plugins loading
@@ -1835,6 +1858,7 @@ bool GeometryGUI::activateModule( SUIT_Study* study )
     }
   }
 
+  Py_XDECREF(pluginsmanager);
   return true;
 }
 
@@ -1921,7 +1945,9 @@ void GeometryGUI::windows( QMap<int, int>& mappa ) const
 {
   mappa.insert( SalomeApp_Application::WT_ObjectBrowser, Qt::LeftDockWidgetArea );
   mappa.insert( SalomeApp_Application::WT_NoteBook, Qt::LeftDockWidgetArea );
+#ifndef DISABLE_PYCONSOLE
   mappa.insert( SalomeApp_Application::WT_PyConsole, Qt::BottomDockWidgetArea );
+#endif
   if ( myCreationInfoWdg )
     mappa.insert( myCreationInfoWdg->getWinID(), Qt::LeftDockWidgetArea );
   if ( myTextTreeWdg )
index 865ac91d9a171aa5a93fb7cc0e08ecdc30db11b1..480b7d2fd366ebfbc47dad62cb8f21043d09529d 100644 (file)
@@ -26,7 +26,9 @@ namespace GEOMOp {
   enum {
     // ToolsGUI --------------------//--------------------------------
     OpDelete              = 1020,   // MENU EDIT  - DELETE
+#ifndef DISABLE_PYCONSOLE
     OpCheckGeom           = 1030,   // MENU TOOLS - CHECK GEOMETRY
+#endif
     OpMaterialsLibrary    = 1040,   // MENU TOOLS - MATERIALS LIBRARY
     OpSelectVertex        = 1100,   // POPUP MENU - SELECT ONLY - VERTEX
     OpSelectEdge          = 1101,   // POPUP MENU - SELECT ONLY - EDGE
@@ -59,7 +61,9 @@ namespace GEOMOp {
     OpIsosWidth           = 1261,   // POPUP MENU - LINE WIDTH - ISOS WIDTH
     OpCreateFolder        = 1262,   // POPUP MENU - CREATE FOLDER
     OpSortChildren        = 1263,   // POPUP MENU - SORT CHILD ITEMS
+#ifndef DISABLE_GRAPHICSVIEW
     OpShowDependencyTree  = 1264,   // POPUP MENU - SHOW DEPENDENCY TREE
+#endif
     OpReduceStudy         = 1265,   // POPUP MENU - REDUCE STUDY
     // DisplayGUI ------------------//--------------------------------
     OpSwitchVectors       = 2001,   // MENU VIEW  - DISPLAY MODE - SHOW/HIDE EDGE DIRECTION
@@ -199,8 +203,10 @@ namespace GEOMOp {
     OpShowAllDimensions   = 5015,   // POPUP MENU - SHOW ALL DIMENSIONS
     OpHideAllDimensions   = 5016,   // POPUP MENU - HIDE ALL DIMENSIONS
     OpFastCheckInters     = 5017,   // MENU MEASURES - FAST CHECK INTERSECTIONS
-    OpInspectObj         = 5018,   // MENU MEASURES - INSPECT OBJECT
+    OpInspectObj         = 5018,       // MENU MEASURES - INSPECT OBJECT
+#ifndef DISABLE_PLOT2DVIEWER
     OpShapeStatistics    = 5019,   // MENU MEASURES - SHAPE STATISTICS
+#endif
     // GroupGUI --------------------//--------------------------------
     OpGroupCreate         = 6000,   // MENU GROUP - CREATE
     OpGroupEdit           = 6001,   // MENU GROUP - EDIT
index ea18e8b904575523fb4e4468ef0b1ebf39371f72..cb3e004cb7117deb010018b833fb92fb5150c4c2 100755 (executable)
@@ -58,8 +58,13 @@ SET(_link_LIBRARIES
   GEOM
   GEOMBase
   Material
-  DependencyTree
   )
+  
+IF(SALOME_USE_GRAPHICSVIEW)
+  LIST(APPEND _link_LIBRARIES
+    DependencyTree
+    )
+ENDIF()
 
 # --- headers ---
 
index 5fe45f595bd1ea0b289b927d4eea2b09bdbe1e93..7a437d272feb4ac70e75578ae7ca2add8c70c7d1 100644 (file)
@@ -206,9 +206,11 @@ bool GEOMToolsGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
   case GEOMOp::OpDelete:         // EDIT - DELETE
     OnEditDelete();
     break;
+#ifndef DISABLE_PYCONSOLE
   case GEOMOp::OpCheckGeom:      // TOOLS - CHECK GEOMETRY
     OnCheckGeometry();
     break;
+#endif
   case GEOMOp::OpSelectVertex:   // POPUP - SELECT ONLY - VERTEX
     OnSelectOnly( GEOM_POINT );
     break;
@@ -306,9 +308,11 @@ bool GEOMToolsGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
   case GEOMOp::OpSortChildren:
     OnSortChildren();
     break;
+#ifndef DISABLE_GRAPHICSVIEW
   case GEOMOp::OpShowDependencyTree:
     OnShowDependencyTree();
      break;
+#endif
   case GEOMOp::OpReduceStudy:
     OnReduceStudy();
     break;
index 581d10f7bc612b64d00eb655663ee6b1cec4851b..6916bdfa83ef76f8450d46daf2513b1e5152d07e 100644 (file)
@@ -87,7 +87,9 @@ private:
   void         OnClsBringToFront();
   void         OnCreateFolder();
   void         OnSortChildren();
+#ifndef DISABLE_GRAPHICSVIEW
   void         OnShowDependencyTree();
+#endif
   void         OnReduceStudy();
 
   // Shortcut commands
index d00c98d24103826add3fc3a30139ac1243ef09df..b83b3e77e30da171467a31beb1753d5d0fb24763 100644 (file)
@@ -24,7 +24,9 @@
 //  File   : GEOMToolsGUI_1.cxx
 //  Author : Sergey ANIKIN, Open CASCADE S.A.S. (sergey.anikin@opencascade.com)
 
+#ifndef DISABLE_PYCONSOLE
 #include <PyConsole_Console.h>
+#endif
 
 #include "GEOMToolsGUI.h"
 #include "GEOMToolsGUI_TransparencyDlg.h"
 #include <GEOMBase.h>
 #include <GEOM_Actor.h>
 
+#ifndef DISABLE_GRAPHICSVIEW
 #include <DependencyTree_ViewModel.h>
 #include <DependencyTree_View.h>
 #include <DependencyTree_Selector.h>
+#endif
 
 #include <Basics_OCCTVersion.hxx>
 
 // on Show Dependencies operation
 #define LAYOUT_DEPVIEW
 
+#ifndef DISABLE_PYCONSOLE
 void GEOMToolsGUI::OnCheckGeometry()
 {
   SalomeApp_Application* app =
@@ -135,6 +140,7 @@ void GEOMToolsGUI::OnCheckGeometry()
   if (pyConsole)
     pyConsole->exec("from GEOM_usinggeom import *");
 }
+#endif
 
 void GEOMToolsGUI::OnAutoColor()
 {
@@ -882,6 +888,7 @@ void GEOMToolsGUI::OnSortChildren()
   app->updateObjectBrowser( true );
 }
 
+#ifndef DISABLE_GRAPHICSVIEW
 void GEOMToolsGUI::OnShowDependencyTree()
 {
   SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
@@ -932,6 +939,7 @@ void GEOMToolsGUI::OnShowDependencyTree()
 #endif
   depVw->setFocus();
 }
+#endif
 
 void GEOMToolsGUI::OnReduceStudy()
 {
index a13236cd2930b0302f53b54b43efcc2dedb175c9..984bc28c23591e7eaf61506755c2110b083a63a3 100644 (file)
@@ -31,7 +31,9 @@
 #include <GeometryGUI.h>
 #include <GEOM_Displayer.h>
 #include <GEOMUtils.hxx>
+#ifndef DISABLE_PLOT2DVIEWER
 #include <MeasureGUI_ShapeStatisticsDlg.h>
+#endif
 
 #include <SalomeApp_Application.h>
 #include <SalomeApp_Study.h>
@@ -201,7 +203,9 @@ GroupGUI_GroupDlg::GroupGUI_GroupDlg (Mode mode, GeometryGUI* theGeometryGUI, QW
   myLessFilterSpin = new SalomeApp_DoubleSpinBox(myFilterGrp);
   myGreaterFilterSpin = new SalomeApp_DoubleSpinBox(myFilterGrp);
   myApplyFilterButton = new QPushButton(tr("GEOM_BUT_APPLY"), myFilterGrp);
+#ifndef DISABLE_PLOT2DVIEWER
   myPlotDistributionButton = new QPushButton(tr("GEOM_PLOT_DISTRIBUTION"), myFilterGrp);
+#endif
 
   QGridLayout* filterLayout = new QGridLayout(myFilterGrp);
   filterLayout->addWidget(myLessFilterCheck,    0, 0);
@@ -211,7 +215,9 @@ GroupGUI_GroupDlg::GroupGUI_GroupDlg (Mode mode, GeometryGUI* theGeometryGUI, QW
   filterLayout->addWidget(myGreaterFilterCombo, 1, 1);
   filterLayout->addWidget(myGreaterFilterSpin,  1, 2);
   filterLayout->addWidget(myApplyFilterButton,  0, 3);
+#ifndef DISABLE_PLOT2DVIEWER
   filterLayout->addWidget(myPlotDistributionButton,  1, 3);
+#endif
 
   QVBoxLayout* layout = new QVBoxLayout(centralWidget());
   layout->setMargin(0); layout->setSpacing(6);
@@ -329,7 +335,9 @@ void GroupGUI_GroupDlg::Init()
   connect(myIdList,        SIGNAL(itemSelectionChanged()), this, SLOT(selectionChanged()));
 
   connect(myApplyFilterButton, SIGNAL(clicked()),         this, SLOT(ClickOnOkFilter()));
+#ifndef DISABLE_PLOT2DVIEWER
   connect(myPlotDistributionButton, SIGNAL(clicked()),    this, SLOT(ClickOnPlot()));
+#endif
   connect(myLessFilterCheck,   SIGNAL(stateChanged(int)), this, SLOT(MeasureToggled()));
   connect(myGreaterFilterCheck,   SIGNAL(stateChanged(int)), this, SLOT(MeasureToggled()));
 
@@ -1157,12 +1165,14 @@ void GroupGUI_GroupDlg::updateState (bool isAdd)
   GEOM::GEOM_IShapesOperations_var aShOp = getGeomEngine()->GetIShapesOperations( getStudyId() );
   GEOM::ListOfLong_var aSubShapes = aShOp->SubShapeAllIDs( myMainObj, getShapeType(), false );
   bool hasCurrentEntities = aSubShapes->length() > 0;
+#ifndef DISABLE_PLOT2DVIEWER
   myPlotDistributionButton->setEnabled( myFilterGrp->isEnabled() &&
                                        myIsShapeType &&
                                        ( getShapeType() == TopAbs_EDGE || 
                                          getShapeType() == TopAbs_FACE ||
                                          getShapeType() == TopAbs_SOLID ) &&
                                        hasCurrentEntities );
+#endif
   if (subSelectionWay() == ALL_SUBSHAPES)
     setInPlaceObj(GEOM::GEOM_Object::_nil());
 }
@@ -1451,6 +1461,7 @@ void GroupGUI_GroupDlg::ClickOnOkFilter()
   updateState(true);
 }
 
+#ifndef DISABLE_PLOT2DVIEWER
 //=================================================================================
 // function : ClickOnPlot()
 // purpose  : opens "Shape Statistics" dialog box in order to plot sub-shapes distribution.
@@ -1463,6 +1474,7 @@ void GroupGUI_GroupDlg::ClickOnPlot()
     dlg->show();
   }
 }
+#endif
 
 void GroupGUI_GroupDlg::MeasureToggled()
 {
index 231ea033a1264c08b301a4026562a37be0dcf431..06ecae4cf2d76592fcdd45cfea8dddd764db6efe 100644 (file)
@@ -83,7 +83,9 @@ private slots:
   void                                showOnlySelected();
   void                                selectionChanged();
   void                                ClickOnOkFilter();
+#ifndef DISABLE_PLOT2DVIEWER
   void                                ClickOnPlot();
+#endif
   void                                MeasureToggled();
 
 private:
index 31e2375ac37d2966fd994cc29f866057d0fb322b..0f376152286def07b5a680dfb4168b6017d1413f 100755 (executable)
@@ -129,8 +129,13 @@ SET(_moc_HEADERS
   MeasureGUI_ManageDimensionsDlg.h
   MeasureGUI_CreateDimensionDlg.h
   MeasureGUI_DimensionInteractor.h
-  MeasureGUI_ShapeStatisticsDlg.h
   )
+  
+IF(SALOME_USE_PLOT2DVIEWER)
+  LIST(APPEND _moc_HEADERS
+    MeasureGUI_ShapeStatisticsDlg.h
+    )
+ENDIF()
 
 # header files / uic wrappings
 QT4_WRAP_UI(_uic_HEADERS ${_uic_files})
@@ -164,11 +169,16 @@ SET(MeasureGUI_SOURCES
   MeasureGUI_DimensionCreateTool.cxx
   MeasureGUI_DimensionInteractor.cxx
   MeasureGUI_DimensionFilter.cxx
-  MeasureGUI_ShapeStatisticsDlg.cxx
   ${_moc_SOURCES}
   ${_uic_files}
   )
 
+IF(SALOME_USE_PLOT2DVIEWER)
+  LIST(APPEND MeasureGUI_SOURCES
+    MeasureGUI_ShapeStatisticsDlg.cxx
+    )
+ENDIF()
+
 # --- rules ---
 
 ADD_LIBRARY(MeasureGUI ${MeasureGUI_SOURCES})
index 1ab692d327486ec5eecd1a5e77f45a46714649b4..d76f132ff0e1c04bc5b5c55afb302507d08e9ed3 100644 (file)
@@ -53,7 +53,9 @@
 #include "MeasureGUI_FastCheckIntersectionsDlg.h" // Method FAST CHECK INTERSCTIONS
 #include "MeasureGUI_PointDlg.h"                  // Method POINTCOORDINATES
 #include "MeasureGUI_ManageDimensionsDlg.h"       // Method MANAGEDIMENSIONS
+#ifndef DISABLE_PLOT2DVIEWER
 #include "MeasureGUI_ShapeStatisticsDlg.h"        // Method SHAPE STATISTICS
+#endif
 
 #include <QApplication>
 
@@ -130,9 +132,11 @@ bool MeasureGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
   case GEOMOp::OpFastCheckInters:
     dlg = new MeasureGUI_FastCheckIntersectionsDlg( getGeometryGUI(), parent );
     break; // FAST CHECK INTERSCTIONS
+#ifndef DISABLE_PLOT2DVIEWER
   case GEOMOp::OpShapeStatistics:
     dlg = new MeasureGUI_ShapeStatisticsDlg( parent );
-    break; // FAST CHECK INTERSCTIONS
+    break; // SHAPE STATISTICS
+#endif
   case GEOMOp::OpPointCoordinates:
     dlg = new MeasureGUI_PointDlg( getGeometryGUI(), parent );
     break; // POINT COORDINATES