X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_GroupOpDlg.h;h=fda94dd0101a732c1c2ba1ca7d18b3f5b7e78285;hp=89e4d3ccc84336368186ab80c1558dc2ab8aab09;hb=0635c9fc80f67d1e5dc0e94ec85f487286a92070;hpb=c63ee099ad2b149bd70136839c973e8910137bc5 diff --git a/src/SMESHGUI/SMESHGUI_GroupOpDlg.h b/src/SMESHGUI/SMESHGUI_GroupOpDlg.h index 89e4d3ccc..fda94dd01 100644 --- a/src/SMESHGUI/SMESHGUI_GroupOpDlg.h +++ b/src/SMESHGUI/SMESHGUI_GroupOpDlg.h @@ -1,45 +1,49 @@ -// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com +// Copyright (C) 2007-2008 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. // -// File : SMESHGUI_GroupOpDlg.h -// Author : Sergey LITONIN -// Module : SMESH - +// 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 +// +// 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 LightApp_SelectionMgr; +class QtxColorButton; +class QComboBox; +class QListWidget; +class QGroupBox; class QLineEdit; class SMESHGUI; -class SVTK_ViewWindow; +class LightApp_SelectionMgr; class SVTK_Selector; /* @@ -47,67 +51,188 @@ class SVTK_Selector; 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( SMESHGUI*, const int ); - virtual ~SMESHGUI_GroupOpDlg(); + SMESHGUI_GroupOpDlg( SMESHGUI* ); + virtual ~SMESHGUI_GroupOpDlg(); void Init(); - -private: - void closeEvent( QCloseEvent* e ) ; - void enterEvent ( QEvent * ) ; +protected slots: + + virtual bool onApply(); + virtual void onSelectionDone(); + virtual void setVisible ( bool visible ); + +protected: + + 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; + +private: + void closeEvent( QCloseEvent* ); + void enterEvent( QEvent* ); + void keyPressEvent( QKeyEvent* ); private slots: - void onOk(); - bool onApply(); void onClose(); void onHelp(); void onDeactivate(); - void onSelectionDone(); - void onFocusChanged(); private: - - QFrame* createButtonFrame( QWidget* ); - QFrame* createMainFrame ( QWidget* ); - bool isValid(); - void reset(); - + 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; + QGroupBox* myArgGrp; + QtxColorButton* myColorBtn; SMESHGUI* mySMESHGUI; LightApp_SelectionMgr* mySelectionMgr; - int myMode; SVTK_Selector* mySelector; - QLineEdit* myFocusWg; - - SMESH::SMESH_GroupBase_var myGroup1; - SMESH::SMESH_GroupBase_var myGroup2; - QString myHelpFileName; - }; -#endif +/* + 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* myCombo; + QListWidget* myListWg; + QList myGroups; +}; + +#endif // SMESHGUI_GROUPOPDLG_H + +