X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_GroupOpDlg.h;h=6f6b70175f49c3402cf7cca13d1464c57057719c;hp=d05201390a54448ad371550166af24d1d2207c70;hb=5c19bc1e1684ec6a466423361949ed7b60556968;hpb=c38c10811a065cf5b13e8807ed71864d92ca7d80 diff --git a/src/SMESHGUI/SMESHGUI_GroupOpDlg.h b/src/SMESHGUI/SMESHGUI_GroupOpDlg.h index d05201390..6f6b70175 100644 --- a/src/SMESHGUI/SMESHGUI_GroupOpDlg.h +++ b/src/SMESHGUI/SMESHGUI_GroupOpDlg.h @@ -1,104 +1,252 @@ -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE // +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// File : SMESHGUI_GroupOpDlg.h -// Author : Sergey LITONIN -// Module : SMESH +// SMESH SMESHGUI : GUI for SMESH component +// File : SMESHGUI_GroupOpDlg.h +// Author : Sergey LITONIN, Open CASCADE S.A.S. +// +#ifndef SMESHGUI_GROUPOPDLG_H +#define SMESHGUI_GROUPOPDLG_H -#ifndef SMESHGUI_GroupOpDlg_H -#define SMESHGUI_GroupOpDlg_H +// SMESH includes +#include "SMESH_SMESHGUI.hxx" -#include +// Qt includes +#include +// IDL includes #include #include CORBA_SERVER_HEADER(SMESH_Group) -class QCloseEvent; -class QLabel; -class QFrame; -class QPushButton; -class SalomeApp_SelectionMgr; +class LightApp_SelectionMgr; +class QCheckBox; +class QComboBox; +class QGroupBox; class QLineEdit; +class QListWidget; +class QPushButton; +class QtxColorButton; +class SMESHGUI; +class SVTK_Selector; /* Class : SMESHGUI_GroupOpDlg Description : Perform boolean operations on groups */ -class SMESHGUI_GroupOpDlg : public QDialog +class SMESHGUI_EXPORT SMESHGUI_GroupOpDlg : public QDialog { Q_OBJECT public: - enum { UNION, INTERSECT, CUT }; + //enum { UNION, INTERSECT, CUT }; public: - SMESHGUI_GroupOpDlg( QWidget*, SalomeApp_SelectionMgr*, const int ); - virtual ~SMESHGUI_GroupOpDlg(); + SMESHGUI_GroupOpDlg( SMESHGUI* ); + virtual ~SMESHGUI_GroupOpDlg(); - void Init( SalomeApp_SelectionMgr* ) ; - -private: + void Init(); + +protected slots: + + virtual bool onApply(); + virtual void onSelectionDone(); + virtual void setVisible ( bool visible ); + +protected: - void closeEvent( QCloseEvent* e ) ; - void enterEvent ( QEvent * ) ; + virtual void reset(); + + QString getName() const; + void setName( const QString& theName ); + + QGroupBox* getArgGrp() const; + void setHelpFileName( const QString& theFName ); + SMESHGUI* getSMESHGUI() const; + bool isValid( const QList& theListGrp ); + bool getSelectedGroups( QList& theOutList, + QStringList& theOutNames ); + SMESH::ListOfGroups* convert( const QList& ); + + SALOMEDS::Color getColor() const; + + void setIsApplyAndClose( const bool theFlag ); + bool isApplyAndClose() const; + +private: + void enterEvent( QEvent* ); + void keyPressEvent( QKeyEvent* ); -private slots: +protected slots: + virtual void reject(); +private slots: void onOk(); - bool onApply(); - void onClose(); + void onHelp(); void onDeactivate(); - void onSelectionDone(); - void onFocusChanged(); -private: + void onOpenView(); + void onCloseView(); - QFrame* createButtonFrame( QWidget* ); - QFrame* createMainFrame ( QWidget* ); - bool isValid(); - void reset(); - private: - + QWidget* createButtonFrame( QWidget* ); + QWidget* createMainFrame ( QWidget* ); + +private: QPushButton* myOkBtn; QPushButton* myApplyBtn; QPushButton* myCloseBtn; + QPushButton* myHelpBtn; QLineEdit* myNameEdit; - QLineEdit* myEdit1; - QLineEdit* myEdit2; - QPushButton* myBtn1; - QPushButton* myBtn2; - - SalomeApp_SelectionMgr* mySelectionMgr; - int myMode; + QGroupBox* myArgGrp; + QtxColorButton* myColorBtn; - QLineEdit* myFocusWg; + SMESHGUI* mySMESHGUI; + LightApp_SelectionMgr* mySelectionMgr; + SVTK_Selector* mySelector; - SMESH::SMESH_GroupBase_var myGroup1; - SMESH::SMESH_GroupBase_var myGroup2; + QString myHelpFileName; + + bool myIsApplyAndClose; +}; + +/* + Class : SMESHGUI_UnionGroupsDlg + Description : Perform union of several groups +*/ + +class SMESHGUI_EXPORT SMESHGUI_UnionGroupsDlg : public SMESHGUI_GroupOpDlg +{ + Q_OBJECT + +public: + + SMESHGUI_UnionGroupsDlg( SMESHGUI* ); + virtual ~SMESHGUI_UnionGroupsDlg(); + +protected slots: + virtual bool onApply(); + virtual void onSelectionDone(); + +protected: + virtual void reset(); + +private: + QListWidget* myListWg; + QList myGroups; +}; + +/* + Class : SMESHGUI_IntersectGroupsDlg + Description : Perform intersection of several groups +*/ + +class SMESHGUI_EXPORT SMESHGUI_IntersectGroupsDlg : public SMESHGUI_GroupOpDlg +{ + Q_OBJECT + +public: + + SMESHGUI_IntersectGroupsDlg( SMESHGUI* ); + virtual ~SMESHGUI_IntersectGroupsDlg(); + +protected slots: + virtual bool onApply(); + virtual void onSelectionDone(); + +protected: + virtual void reset(); + +private: + QListWidget* myListWg; + QList myGroups; +}; + +/* + Class : SMESHGUI_CutGroupsDlg + Description : Perform cut of several groups +*/ + +class SMESHGUI_EXPORT SMESHGUI_CutGroupsDlg : public SMESHGUI_GroupOpDlg +{ + Q_OBJECT + +public: + + SMESHGUI_CutGroupsDlg( SMESHGUI* ); + virtual ~SMESHGUI_CutGroupsDlg(); + +protected slots: + virtual bool onApply(); + virtual void onSelectionDone(); + +protected: + virtual void reset(); + +private: + QPushButton* myBtn1; + QPushButton* myBtn2; + QListWidget* myListWg1; + QListWidget* myListWg2; + QList myGroups1; + QList myGroups2; +}; + +/* + Class : SMESHGUI_DimGroupDlg + Description : Dialog for creating groups of entities from existing + groups of superior dimensions +*/ + +class SMESHGUI_EXPORT SMESHGUI_DimGroupDlg : public SMESHGUI_GroupOpDlg +{ + Q_OBJECT + +public: + + SMESHGUI_DimGroupDlg( SMESHGUI* ); + virtual ~SMESHGUI_DimGroupDlg(); + + SMESH::ElementType getElementType() const; + void setElementType( const SMESH::ElementType& theElemType ); + +protected: + virtual void reset(); + +protected slots: + virtual bool onApply(); + virtual void onSelectionDone(); + +private: + QComboBox* myTypeCombo; + QComboBox* myNbNoCombo; + QListWidget* myListWg; + QCheckBox* myUnderlOnlyChk; + QList myGroups; }; -#endif +#endif // SMESHGUI_GROUPOPDLG_H + +