Lancement des menus pour l'adaptation

This commit is contained in:
Gérald NICOLAS 2020-05-26 10:46:55 +02:00
parent 1e51d8ea89
commit ed1a6f1c4d
3 changed files with 2854 additions and 921 deletions

View File

@ -3018,8 +3018,8 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
} }
break; break;
} }
case SMESHOp::OpSplitBiQuadratic:
// Adaptation - begin
case SMESHOp::OpUniformRefinement: case SMESHOp::OpUniformRefinement:
case SMESHOp::OpHONewCase: case SMESHOp::OpHONewCase:
case SMESHOp::OpHOCaseFollow: case SMESHOp::OpHOCaseFollow:
@ -3029,7 +3029,14 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
case SMESHOp::OpHOEdit: case SMESHOp::OpHOEdit:
case SMESHOp::OpHODelete: case SMESHOp::OpHODelete:
case SMESHOp::OpMGAdapt: case SMESHOp::OpMGAdapt:
{
SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_nil();
SMESHGUI_AdaptDlg *aDlg = new SMESHGUI_AdaptDlg( this, theCommandID, aMesh);
aDlg->show();
}
// Adaptation - end
case SMESHOp::OpSplitBiQuadratic:
case SMESHOp::OpConvertMeshToQuadratic: case SMESHOp::OpConvertMeshToQuadratic:
case SMESHOp::OpCreateBoundaryElements: // create 2D mesh from 3D case SMESHOp::OpCreateBoundaryElements: // create 2D mesh from 3D
case SMESHOp::OpReorientFaces: case SMESHOp::OpReorientFaces:
@ -5908,9 +5915,6 @@ LightApp_Operation* SMESHGUI::createOperation( const int id ) const
// to do : create operation here // to do : create operation here
switch( id ) switch( id )
{ {
case SMESHOp::OpSplitBiQuadratic:
op = new SMESHGUI_SplitBiQuadOp();
break;
case SMESHOp::OpUniformRefinement: case SMESHOp::OpUniformRefinement:
case SMESHOp::OpHONewCase: case SMESHOp::OpHONewCase:
case SMESHOp::OpHOCaseFollow: case SMESHOp::OpHOCaseFollow:
@ -5920,8 +5924,9 @@ LightApp_Operation* SMESHGUI::createOperation( const int id ) const
case SMESHOp::OpHOEdit: case SMESHOp::OpHOEdit:
case SMESHOp::OpHODelete: case SMESHOp::OpHODelete:
case SMESHOp::OpMGAdapt: case SMESHOp::OpMGAdapt:
SMESHGUI_GroupDlg *aDlg = new SMESHGUI_AdaptDlg( this, id); break;
aDlg->show(); case SMESHOp::OpSplitBiQuadratic:
op = new SMESHGUI_SplitBiQuadOp();
break; break;
case SMESHOp::OpConvertMeshToQuadratic: case SMESHOp::OpConvertMeshToQuadratic:
op = new SMESHGUI_ConvToQuadOp(); op = new SMESHGUI_ConvToQuadOp();

File diff suppressed because it is too large Load Diff

View File

@ -24,84 +24,208 @@
#ifndef SMESHGUI_ADAPTDLG_H #ifndef SMESHGUI_ADAPTDLG_H
#define SMESHGUI_ADAPTDLG_H #define SMESHGUI_ADAPTDLG_H
#include "HOMARDGUI_Exports.hxx" // SMESH includes
#include "SMESH_SMESHGUI.hxx"
#include <SalomeApp_Module.h> // Qt includes
#include "SalomeApp_Study.h" #include <QDialog>
#include <QList>
#include <QMap>
// IDL includes
#include <SALOMEconfig.h> #include <SALOMEconfig.h>
#include <SALOME_LifeCycleCORBA.hxx> #include CORBA_SERVER_HEADER(SMESH_Mesh)
#include CORBA_CLIENT_HEADER(HOMARD_Gen) #include CORBA_SERVER_HEADER(SMESH_Group)
#include CORBA_CLIENT_HEADER(HOMARD_Cas) #include CORBA_SERVER_HEADER(SMESH_Filter)
#include CORBA_CLIENT_HEADER(HOMARD_Hypothesis)
#include <QString> class QGroupBox;
class QLabel;
class QLineEdit;
class QButtonGroup;
class QListWidget;
class QMenu;
class QPushButton;
class QToolButton;
class QCheckBox;
class QStackedWidget;
class QAction;
class SMESHGUI;
class SMESH_Actor;
class SMESHGUI_FilterDlg;
class SMESHGUI_ShapeByMeshOp;
class QtxColorButton;
class SUIT_Operation;
class SVTK_Selector;
class SUIT_SelectionFilter;
class LightApp_SelectionMgr;
class SMESH_LogicalFilter;
//================================================================================= //=================================================================================
// class : SMESHGUI_AdaptDlg // class : SMESHGUI_AdaptDlg
// purpose : // purpose :
//================================================================================= //=================================================================================
class SMESHGUI_EXPORT SMESHGUI_AdaptDlg: public QDialog class SMESHGUI_EXPORT SMESHGUI_AdaptDlg : public QDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
SMESHGUI_AdaptDlg( SMESHGUI*, SMESHGUI_AdaptDlg( SMESHGUI*,
int theCommandID); int theCommandID,
SMESH::SMESH_Mesh_ptr = SMESH::SMESH_Mesh::_nil() );
~SMESHGUI_AdaptDlg(); ~SMESHGUI_AdaptDlg();
virtual bool OnGUIEvent (int theCommandID); static QString GetDefaultName( const QString& );
void initialize( CAM_Application* );
QString engineIOR() const;
void windows( QMap<int, int>& ) const;
static HOMARD::HOMARD_Gen_var InitHOMARDGen(SalomeApp_Application* );
public slots: public slots:
bool deactivateModule( SUIT_Study* ); void onAdd();
bool activateModule( SUIT_Study* ); void onRemove();
static void setOrb();
protected slots:
virtual void reject();
private slots: private slots:
void OnGUIEvent(); void onTypeChanged( int );
void EditAsciiFile(); void onGrpTypeChanged( int );
void LanceCalcul0(); void onColorChanged( QColor );
void LanceCalcul1();
void IterInfo(); void onOK();
void NextIter(); bool onApply();
void MeshPublish0(); void onHelp();
void MeshPublish1(); void onDeactivate();
void YACSCreate(); void onVisibilityChanged();
void YACSWrite();
void Edit(); void onListSelectionChanged();
void Delete(); void onObjectSelectionChanged();
public: void onSelectAll();
virtual void contextMenuPopup( const QString&, QMenu*, QString& ); 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* );
void onOpenView();
void onCloseView();
private: private:
void createHOMARDAction( const int id, const QString& po_id, const QString& icon_id = QString(""), void initDialog( bool );
const int key = 0, const bool toggle = false ); void init( SMESH::SMESH_Mesh_ptr );
void createActions(); void init( SMESH::SMESH_GroupBase_ptr );
void createMenus(); void enterEvent( QEvent* );
void recupPreferences(); void keyPressEvent( QKeyEvent* );
void createPopupMenus(); void setSelectionMode( int );
_PTR(SObject) chercheMonObjet(); void updateButtons();
void updateGeomPopup();
bool SetAppropriateActor();
void setShowEntityMode();
void restoreShowEntityMode();
virtual void createPreferences(); bool IsActorVisible( SMESH_Actor* );
HOMARD::HOMARD_Gen_var myComponentHomard;
void setGroupColor( const SALOMEDS::Color& );
SALOMEDS::Color getGroupColor() const;
void setGroupQColor( const QColor& );
QColor getGroupQColor() const;
void setDefaultName() const;
void setDefaultGroupColor();
int anId; void setIsApplyAndClose( const bool theFlag );
QString _ObjectName; bool isApplyAndClose() const;
QString _LanguageShort ;
int _PublisMeshIN ; private:
int _PublisMeshOUT ;
int _YACSMaxIter ; SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
int _YACSMaxNode ; LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
int _YACSMaxElem ; int myGrpTypeId; /* Current group type id : standalone or group on geometry */
int _YACSTypeTest ; int myTypeId; /* Current type id = radio button id */
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;
QLabel* myElementsLab;
QListWidget* myElements;
QPushButton* myFilterBtn;
QPushButton* myAddBtn;
QPushButton* myRemoveBtn;
QPushButton* mySortBtn;
QGroupBox* mySelectBox;
QCheckBox* mySelectSubMesh;
QPushButton* mySubMeshBtn;
QLineEdit* mySubMeshLine;
QCheckBox* mySelectGroup;
QPushButton* myGroupBtn;
QLineEdit* myGroupLine;
QtxColorButton* myColorBtn;
QCheckBox* mySelectGeomGroup;
QToolButton* myGeomGroupBtn;
QLineEdit* myGeomGroupLine;
QMenu* myGeomPopup;
QPushButton* myOKBtn;
QPushButton* myApplyBtn;
QPushButton* myCloseBtn;
QPushButton* myHelpBtn;
SMESHGUI_ShapeByMeshOp* myShapeByMeshOp;
SMESH::SMESH_Mesh_var myMesh;
QList<SMESH_Actor*> myActorsList;
SMESH::SMESH_Group_var myGroup;
SMESH::SMESH_GroupOnGeom_var myGroupOnGeom;
SMESH::SMESH_GroupOnFilter_var myGroupOnFilter;
SMESH::Filter_var myFilter;
QList<int> myIdList;
GEOM::ListOfGO_var myGeomObjects;
int mySelectionMode;
//Handle(SMESH_TypeFilter) myMeshFilter;
//Handle(SMESH_TypeFilter) mySubMeshFilter;
//Handle(SMESH_TypeFilter) myGroupFilter;
SUIT_SelectionFilter* myMeshFilter;
SMESH_LogicalFilter* mySubMeshFilter;
SMESH_LogicalFilter* myGroupFilter;
SUIT_SelectionFilter* myGeomFilter;
SMESHGUI_FilterDlg* myFilterDlg;
bool myCreate, myIsBusy;
QString myHelpFileName;
QMap<QAction*, int> myActions;
bool myNameChanged; //added by skl for IPAL19574
int myNbChangesOfContents; // nb add's and remove's
QString myObjectToSelect;
bool myIsApplyAndClose;
}; };
#endif // SMESHGUI_ADAPTDLG_H #endif // SMESHGUI_ADAPTDLG_H