From: Gérald NICOLAS Date: Wed, 27 May 2020 15:01:35 +0000 (+0200) Subject: homardGen réactivé X-Git-Tag: V9_7_0a1~18^2~88 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=baad437937a7458cb806e3c8cf1537e8bd6108fc;p=modules%2Fsmesh.git homardGen réactivé --- diff --git a/src/SMESHGUI/CMakeLists.txt b/src/SMESHGUI/CMakeLists.txt index 53f99bf29..185d6c5fe 100644 --- a/src/SMESHGUI/CMakeLists.txt +++ b/src/SMESHGUI/CMakeLists.txt @@ -75,6 +75,7 @@ SET(_link_LIBRARIES SMESHControls SMESHObject ADAPTGUI + ADAPTImpl ) # --- headers --- @@ -277,7 +278,7 @@ SET(_ts_RESOURCES SMESH_msg_en.ts SMESH_msg_fr.ts SMESH_msg_ja.ts -) +) # --- rules --- diff --git a/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx b/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx index 78eb57775..387baa90f 100644 --- a/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_AdaptDlg.cxx @@ -20,11 +20,10 @@ // SMESH SMESHGUI : GUI for the adaptation in the SMESH component // File : SMESHGUI_AdaptDlg.cxx // Author : Gerald NICOLAS, EDF -// ADAPTGUI includes -// -#include "SMESHGUI_AdaptDlg.h" +// SMESH includes #include "SMESHGUI.h" +#include "SMESHGUI_AdaptDlg.h" #include "SMESHGUI_Utils.h" #include "SMESHGUI_VTKUtils.h" #include "SMESHGUI_GroupUtils.h" @@ -44,36 +43,20 @@ #include // SALOME GUI includes +#include #include - +#include #include -#include -#include #include #include - -#include +#include +#include +#include #include #include -#include - -#include - -#include - +#include #include -// SALOME KERNEL includes -#include -#include - -// VTK Includes -#include -#include - -// OCCT includes -#include - // Qt includes #include #include @@ -99,6 +82,23 @@ #include #include +// VTK includes +#include +#include + +// SALOME KERNEL includes +#include +#include +#include +#include +#include +#include +#include "utilities.h" +#include + +// OCCT includes +#include + #define SPACING 6 #define MARGIN 11 @@ -149,9 +149,11 @@ SMESHGUI_AdaptDlg::SMESHGUI_AdaptDlg( SMESHGUI* theModule, // myGeomGroupLine->setEnabled( false ); // } } -//======================================================================= -// OnGUIEvent for the adaptations -//======================================================================= +/*! + * \brief Launches the GUI for the adaptation + * \param theCommandID - the integer taht references the operation + * \return Graphical object +*/ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) { std::cout << "OnGUIEvent avec theCommandID : " << theCommandID << std::endl; @@ -160,8 +162,8 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); if ( !app ) return false; - SalomeApp_Study* stud = dynamic_cast ( app->activeStudy() ); - if ( !stud ) + SalomeApp_Study* aStudy = dynamic_cast ( app->activeStudy() ); + if ( !aStudy ) { MESSAGE ( "FAILED to cast active study to SalomeApp_Study" ); return false; @@ -169,11 +171,13 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID) SUIT_Desktop* parent = SUIT_Session::session()->activeApplication()->desktop(); -// ADAPT::ADAPT_Gen_var homardGen = ADAPTGUI::InitHOMARDGen(app); -// -// if (!CORBA::is_nil(homardGen)) -// homardGen->UpdateStudy(); -// + SALOME_LifeCycleCORBA* ls = new SALOME_LifeCycleCORBA(app->namingService()); + Engines::EngineComponent_var comp = + ls->FindOrLoad_Component("FactoryServer", "SMESH"); + ADAPT::ADAPT_Gen_var homardGen = ADAPT::ADAPT_Gen::_narrow(comp); + if (!CORBA::is_nil(homardGen)) + homardGen->UpdateStudy(); + SMESHGUI::GetSMESHGUI()->getApp()->updateObjectBrowser(); // // B. Choix selon les commandes diff --git a/src/SMESHGUI/SMESHGUI_AdaptDlg.h b/src/SMESHGUI/SMESHGUI_AdaptDlg.h index 0138e03d2..0aded7c31 100644 --- a/src/SMESHGUI/SMESHGUI_AdaptDlg.h +++ b/src/SMESHGUI/SMESHGUI_AdaptDlg.h @@ -73,11 +73,11 @@ public: int theCommandID, SMESH::SMESH_Mesh_ptr = SMESH::SMESH_Mesh::_nil() ); ~SMESHGUI_AdaptDlg(); - + virtual bool OnGUIEvent (int theCommandID); static QString GetDefaultName( const QString& ); - + public slots: void onAdd(); void onRemove(); @@ -89,31 +89,31 @@ private slots: void onTypeChanged( int ); void onGrpTypeChanged( int ); void onColorChanged( QColor ); - + void onOK(); bool onApply(); void onHelp(); void onDeactivate(); void onVisibilityChanged(); - + void onListSelectionChanged(); void onObjectSelectionChanged(); - + void onSelectAll(); void onSelectSubMesh( bool ); void onSelectGroup( bool ); void onSelectGeomGroup( bool ); void setCurrentSelection(); - + void setFilters(); void onSort(); - + void onNameChanged( const QString& ); void onFilterAccepted(); - + void onGeomPopup( QAction* ); void onGeomSelectionButton( bool ); - + void onPublishShapeByMeshDlg( SUIT_Operation* ); void onCloseShapeByMeshDlg( SUIT_Operation* ); @@ -134,10 +134,10 @@ private: void restoreShowEntityMode(); bool IsActorVisible( SMESH_Actor* ); - + void setGroupColor( const SALOMEDS::Color& ); SALOMEDS::Color getGroupColor() const; - + void setGroupQColor( const QColor& ); QColor getGroupQColor() const; void setDefaultName() const; @@ -155,16 +155,16 @@ private: int myStoredShownEntity; /* Store ShowEntity mode of myMesh */ QLineEdit* myCurrentLineEdit; /* Current LineEdit */ SVTK_Selector* mySelector; - + QPushButton* myMeshGroupBtn; QLineEdit* myMeshGroupLine; - + QButtonGroup* myTypeGroup; QLineEdit* myName; QString myOldName; - + QButtonGroup* myGrpTypeGroup; - + QStackedWidget* myWGStack; QCheckBox* mySelectAll; QCheckBox* myAllowElemsModif; @@ -174,7 +174,7 @@ private: QPushButton* myAddBtn; QPushButton* myRemoveBtn; QPushButton* mySortBtn; - + QGroupBox* mySelectBox; QCheckBox* mySelectSubMesh; QPushButton* mySubMeshBtn; @@ -182,9 +182,9 @@ private: QCheckBox* mySelectGroup; QPushButton* myGroupBtn; QLineEdit* myGroupLine; - + QtxColorButton* myColorBtn; - + QCheckBox* mySelectGeomGroup; QToolButton* myGeomGroupBtn; QLineEdit* myGeomGroupLine; @@ -194,9 +194,9 @@ private: QPushButton* myApplyBtn; QPushButton* myCloseBtn; QPushButton* myHelpBtn; - + SMESHGUI_ShapeByMeshOp* myShapeByMeshOp; - + SMESH::SMESH_Mesh_var myMesh; QList myActorsList; SMESH::SMESH_Group_var myGroup; @@ -205,7 +205,7 @@ private: SMESH::Filter_var myFilter; QList myIdList; GEOM::ListOfGO_var myGeomObjects; - + int mySelectionMode; //Handle(SMESH_TypeFilter) myMeshFilter; //Handle(SMESH_TypeFilter) mySubMeshFilter; @@ -214,13 +214,13 @@ private: SMESH_LogicalFilter* mySubMeshFilter; SMESH_LogicalFilter* myGroupFilter; SUIT_SelectionFilter* myGeomFilter; - + SMESHGUI_FilterDlg* myFilterDlg; - + bool myCreate, myIsBusy; - + QString myHelpFileName; - + QMap myActions; bool myNameChanged; //added by skl for IPAL19574