homardGen réactivé

This commit is contained in:
Gérald NICOLAS 2020-05-27 17:01:35 +02:00
parent 4434b7437b
commit baad437937
3 changed files with 66 additions and 61 deletions

View File

@ -75,6 +75,7 @@ SET(_link_LIBRARIES
SMESHControls SMESHControls
SMESHObject SMESHObject
ADAPTGUI ADAPTGUI
ADAPTImpl
) )
# --- headers --- # --- headers ---
@ -277,7 +278,7 @@ SET(_ts_RESOURCES
SMESH_msg_en.ts SMESH_msg_en.ts
SMESH_msg_fr.ts SMESH_msg_fr.ts
SMESH_msg_ja.ts SMESH_msg_ja.ts
) )
# --- rules --- # --- rules ---

View File

@ -20,11 +20,10 @@
// SMESH SMESHGUI : GUI for the adaptation in the SMESH component // SMESH SMESHGUI : GUI for the adaptation in the SMESH component
// File : SMESHGUI_AdaptDlg.cxx // File : SMESHGUI_AdaptDlg.cxx
// Author : Gerald NICOLAS, EDF // Author : Gerald NICOLAS, EDF
// ADAPTGUI includes
//
#include "SMESHGUI_AdaptDlg.h"
// SMESH includes
#include "SMESHGUI.h" #include "SMESHGUI.h"
#include "SMESHGUI_AdaptDlg.h"
#include "SMESHGUI_Utils.h" #include "SMESHGUI_Utils.h"
#include "SMESHGUI_VTKUtils.h" #include "SMESHGUI_VTKUtils.h"
#include "SMESHGUI_GroupUtils.h" #include "SMESHGUI_GroupUtils.h"
@ -44,36 +43,20 @@
#include <GEOM_wrap.hxx> #include <GEOM_wrap.hxx>
// SALOME GUI includes // SALOME GUI includes
#include <LightApp_SelectionMgr.h>
#include <QtxColorButton.h> #include <QtxColorButton.h>
#include <SALOME_ListIO.hxx>
#include <SUIT_Desktop.h> #include <SUIT_Desktop.h>
#include <SUIT_ResourceMgr.h>
#include <SUIT_Session.h>
#include <SUIT_MessageBox.h> #include <SUIT_MessageBox.h>
#include <SUIT_OverrideCursor.h> #include <SUIT_OverrideCursor.h>
#include <SUIT_ResourceMgr.h>
#include <SalomeApp_Tools.h> #include <SUIT_Session.h>
#include <SVTK_ViewWindow.h>
#include <SalomeApp_Application.h> #include <SalomeApp_Application.h>
#include <SalomeApp_Study.h> #include <SalomeApp_Study.h>
#include <LightApp_SelectionMgr.h> #include <SalomeApp_Tools.h>
#include <SALOME_ListIO.hxx>
#include <SVTK_ViewWindow.h>
#include <VTKViewer_Algorithm.h> #include <VTKViewer_Algorithm.h>
// SALOME KERNEL includes
#include <SALOMEDSClient_Study.hxx>
#include <utilities.h>
// VTK Includes
#include <vtkRenderer.h>
#include <vtkActorCollection.h>
// OCCT includes
#include <TColStd_MapOfInteger.hxx>
// Qt includes // Qt includes
#include <QButtonGroup> #include <QButtonGroup>
#include <QGroupBox> #include <QGroupBox>
@ -99,6 +82,23 @@
#include <algorithm> #include <algorithm>
#include <set> #include <set>
// VTK includes
#include <vtkRenderer.h>
#include <vtkActorCollection.h>
// SALOME KERNEL includes
#include <SALOMEDSClient_ClientFactory.hxx>
#include <SALOMEDSClient_IParameters.hxx>
#include <SALOMEDSClient_SComponent.hxx>
#include <SALOMEDSClient_StudyBuilder.hxx>
#include <SALOMEDS_Study.hxx>
#include <SALOMEDS_SObject.hxx>
#include "utilities.h"
#include <SALOME_LifeCycleCORBA.hxx>
// OCCT includes
#include <TColStd_MapOfInteger.hxx>
#define SPACING 6 #define SPACING 6
#define MARGIN 11 #define MARGIN 11
@ -149,9 +149,11 @@ SMESHGUI_AdaptDlg::SMESHGUI_AdaptDlg( SMESHGUI* theModule,
// myGeomGroupLine->setEnabled( false ); // 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) bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID)
{ {
std::cout << "OnGUIEvent avec theCommandID : " << theCommandID << std::endl; 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() ); dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
if ( !app ) return false; if ( !app ) return false;
SalomeApp_Study* stud = dynamic_cast<SalomeApp_Study*> ( app->activeStudy() ); SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*> ( app->activeStudy() );
if ( !stud ) if ( !aStudy )
{ {
MESSAGE ( "FAILED to cast active study to SalomeApp_Study" ); MESSAGE ( "FAILED to cast active study to SalomeApp_Study" );
return false; return false;
@ -169,11 +171,13 @@ bool SMESHGUI_AdaptDlg::OnGUIEvent (int theCommandID)
SUIT_Desktop* parent = SUIT_Session::session()->activeApplication()->desktop(); SUIT_Desktop* parent = SUIT_Session::session()->activeApplication()->desktop();
// ADAPT::ADAPT_Gen_var homardGen = ADAPTGUI::InitHOMARDGen(app); SALOME_LifeCycleCORBA* ls = new SALOME_LifeCycleCORBA(app->namingService());
// Engines::EngineComponent_var comp =
// if (!CORBA::is_nil(homardGen)) ls->FindOrLoad_Component("FactoryServer", "SMESH");
// homardGen->UpdateStudy(); ADAPT::ADAPT_Gen_var homardGen = ADAPT::ADAPT_Gen::_narrow(comp);
// if (!CORBA::is_nil(homardGen))
homardGen->UpdateStudy();
SMESHGUI::GetSMESHGUI()->getApp()->updateObjectBrowser(); SMESHGUI::GetSMESHGUI()->getApp()->updateObjectBrowser();
// //
// B. Choix selon les commandes // B. Choix selon les commandes

View File

@ -73,11 +73,11 @@ public:
int theCommandID, int theCommandID,
SMESH::SMESH_Mesh_ptr = SMESH::SMESH_Mesh::_nil() ); SMESH::SMESH_Mesh_ptr = SMESH::SMESH_Mesh::_nil() );
~SMESHGUI_AdaptDlg(); ~SMESHGUI_AdaptDlg();
virtual bool OnGUIEvent (int theCommandID); virtual bool OnGUIEvent (int theCommandID);
static QString GetDefaultName( const QString& ); static QString GetDefaultName( const QString& );
public slots: public slots:
void onAdd(); void onAdd();
void onRemove(); void onRemove();
@ -89,31 +89,31 @@ private slots:
void onTypeChanged( int ); void onTypeChanged( int );
void onGrpTypeChanged( int ); void onGrpTypeChanged( int );
void onColorChanged( QColor ); void onColorChanged( QColor );
void onOK(); void onOK();
bool onApply(); bool onApply();
void onHelp(); void onHelp();
void onDeactivate(); void onDeactivate();
void onVisibilityChanged(); void onVisibilityChanged();
void onListSelectionChanged(); void onListSelectionChanged();
void onObjectSelectionChanged(); void onObjectSelectionChanged();
void onSelectAll(); void onSelectAll();
void onSelectSubMesh( bool ); void onSelectSubMesh( bool );
void onSelectGroup( bool ); void onSelectGroup( bool );
void onSelectGeomGroup( bool ); void onSelectGeomGroup( bool );
void setCurrentSelection(); void setCurrentSelection();
void setFilters(); void setFilters();
void onSort(); void onSort();
void onNameChanged( const QString& ); void onNameChanged( const QString& );
void onFilterAccepted(); void onFilterAccepted();
void onGeomPopup( QAction* ); void onGeomPopup( QAction* );
void onGeomSelectionButton( bool ); void onGeomSelectionButton( bool );
void onPublishShapeByMeshDlg( SUIT_Operation* ); void onPublishShapeByMeshDlg( SUIT_Operation* );
void onCloseShapeByMeshDlg( SUIT_Operation* ); void onCloseShapeByMeshDlg( SUIT_Operation* );
@ -134,10 +134,10 @@ private:
void restoreShowEntityMode(); void restoreShowEntityMode();
bool IsActorVisible( SMESH_Actor* ); bool IsActorVisible( SMESH_Actor* );
void setGroupColor( const SALOMEDS::Color& ); void setGroupColor( const SALOMEDS::Color& );
SALOMEDS::Color getGroupColor() const; SALOMEDS::Color getGroupColor() const;
void setGroupQColor( const QColor& ); void setGroupQColor( const QColor& );
QColor getGroupQColor() const; QColor getGroupQColor() const;
void setDefaultName() const; void setDefaultName() const;
@ -155,16 +155,16 @@ private:
int myStoredShownEntity; /* Store ShowEntity mode of myMesh */ int myStoredShownEntity; /* Store ShowEntity mode of myMesh */
QLineEdit* myCurrentLineEdit; /* Current LineEdit */ QLineEdit* myCurrentLineEdit; /* Current LineEdit */
SVTK_Selector* mySelector; SVTK_Selector* mySelector;
QPushButton* myMeshGroupBtn; QPushButton* myMeshGroupBtn;
QLineEdit* myMeshGroupLine; QLineEdit* myMeshGroupLine;
QButtonGroup* myTypeGroup; QButtonGroup* myTypeGroup;
QLineEdit* myName; QLineEdit* myName;
QString myOldName; QString myOldName;
QButtonGroup* myGrpTypeGroup; QButtonGroup* myGrpTypeGroup;
QStackedWidget* myWGStack; QStackedWidget* myWGStack;
QCheckBox* mySelectAll; QCheckBox* mySelectAll;
QCheckBox* myAllowElemsModif; QCheckBox* myAllowElemsModif;
@ -174,7 +174,7 @@ private:
QPushButton* myAddBtn; QPushButton* myAddBtn;
QPushButton* myRemoveBtn; QPushButton* myRemoveBtn;
QPushButton* mySortBtn; QPushButton* mySortBtn;
QGroupBox* mySelectBox; QGroupBox* mySelectBox;
QCheckBox* mySelectSubMesh; QCheckBox* mySelectSubMesh;
QPushButton* mySubMeshBtn; QPushButton* mySubMeshBtn;
@ -182,9 +182,9 @@ private:
QCheckBox* mySelectGroup; QCheckBox* mySelectGroup;
QPushButton* myGroupBtn; QPushButton* myGroupBtn;
QLineEdit* myGroupLine; QLineEdit* myGroupLine;
QtxColorButton* myColorBtn; QtxColorButton* myColorBtn;
QCheckBox* mySelectGeomGroup; QCheckBox* mySelectGeomGroup;
QToolButton* myGeomGroupBtn; QToolButton* myGeomGroupBtn;
QLineEdit* myGeomGroupLine; QLineEdit* myGeomGroupLine;
@ -194,9 +194,9 @@ private:
QPushButton* myApplyBtn; QPushButton* myApplyBtn;
QPushButton* myCloseBtn; QPushButton* myCloseBtn;
QPushButton* myHelpBtn; QPushButton* myHelpBtn;
SMESHGUI_ShapeByMeshOp* myShapeByMeshOp; SMESHGUI_ShapeByMeshOp* myShapeByMeshOp;
SMESH::SMESH_Mesh_var myMesh; SMESH::SMESH_Mesh_var myMesh;
QList<SMESH_Actor*> myActorsList; QList<SMESH_Actor*> myActorsList;
SMESH::SMESH_Group_var myGroup; SMESH::SMESH_Group_var myGroup;
@ -205,7 +205,7 @@ private:
SMESH::Filter_var myFilter; SMESH::Filter_var myFilter;
QList<int> myIdList; QList<int> myIdList;
GEOM::ListOfGO_var myGeomObjects; GEOM::ListOfGO_var myGeomObjects;
int mySelectionMode; int mySelectionMode;
//Handle(SMESH_TypeFilter) myMeshFilter; //Handle(SMESH_TypeFilter) myMeshFilter;
//Handle(SMESH_TypeFilter) mySubMeshFilter; //Handle(SMESH_TypeFilter) mySubMeshFilter;
@ -214,13 +214,13 @@ private:
SMESH_LogicalFilter* mySubMeshFilter; SMESH_LogicalFilter* mySubMeshFilter;
SMESH_LogicalFilter* myGroupFilter; SMESH_LogicalFilter* myGroupFilter;
SUIT_SelectionFilter* myGeomFilter; SUIT_SelectionFilter* myGeomFilter;
SMESHGUI_FilterDlg* myFilterDlg; SMESHGUI_FilterDlg* myFilterDlg;
bool myCreate, myIsBusy; bool myCreate, myIsBusy;
QString myHelpFileName; QString myHelpFileName;
QMap<QAction*, int> myActions; QMap<QAction*, int> myActions;
bool myNameChanged; //added by skl for IPAL19574 bool myNameChanged; //added by skl for IPAL19574