smesh/src/SMESHGUI/SMESHGUI_GroupDlg.h

235 lines
8.4 KiB
C
Raw Normal View History

2012-08-09 16:03:55 +06:00
// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
2004-06-18 14:34:31 +06:00
//
2012-08-09 16:03:55 +06:00
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
2004-06-18 14:34:31 +06:00
//
2012-08-09 16:03:55 +06:00
// 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.
2004-06-18 14:34:31 +06:00
//
2012-08-09 16:03:55 +06:00
// 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.
2004-06-18 14:34:31 +06:00
//
2012-08-09 16:03:55 +06:00
// 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
2009-02-17 10:27:49 +05:00
//
2012-08-09 16:03:55 +06:00
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
2009-02-17 10:27:49 +05:00
//
2012-08-09 16:03:55 +06:00
2009-02-17 10:27:49 +05:00
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_GroupDlg.h
// Author : Natalia KOPNOVA, Open CASCADE S.A.S.
//
#ifndef SMESHGUI_GROUPDLG_H
#define SMESHGUI_GROUPDLG_H
2004-06-18 14:34:31 +06:00
2009-02-17 10:27:49 +05:00
// SMESH includes
#include "SMESH_SMESHGUI.hxx"
2009-02-17 10:27:49 +05:00
// Qt includes
#include <QDialog>
#include <QList>
#include <QMap>
2004-06-18 14:34:31 +06:00
2009-02-17 10:27:49 +05:00
// IDL includes
2004-06-18 14:34:31 +06:00
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_Mesh)
#include CORBA_SERVER_HEADER(SMESH_Group)
2012-08-09 16:03:55 +06:00
#include CORBA_SERVER_HEADER(SMESH_Filter)
2004-06-18 14:34:31 +06:00
2012-08-09 16:03:55 +06:00
class QGroupBox;
class QLabel;
2004-06-18 14:34:31 +06:00
class QLineEdit;
class QButtonGroup;
2009-02-17 10:27:49 +05:00
class QListWidget;
class QMenu;
2004-06-18 14:34:31 +06:00
class QPushButton;
class QToolButton;
2004-06-18 14:34:31 +06:00
class QCheckBox;
2009-02-17 10:27:49 +05:00
class QStackedWidget;
class QAction;
2004-06-18 14:34:31 +06:00
class SMESHGUI;
class SMESH_Actor;
class SMESHGUI_FilterDlg;
class SMESHGUI_ShapeByMeshOp;
2009-02-17 10:27:49 +05:00
class QtxColorButton;
class SUIT_Operation;
class SVTK_Selector;
2009-02-17 10:27:49 +05:00
class SUIT_SelectionFilter;
class LightApp_SelectionMgr;
2012-08-09 16:03:55 +06:00
class SMESH_LogicalFilter;
2004-06-18 14:34:31 +06:00
//=================================================================================
// class : SMESHGUI_GroupDlg
// purpose :
//=================================================================================
class SMESHGUI_EXPORT SMESHGUI_GroupDlg : public QDialog
2004-06-18 14:34:31 +06:00
{
2009-02-17 10:27:49 +05:00
Q_OBJECT
2004-06-18 14:34:31 +06:00
public:
2009-02-17 10:27:49 +05:00
SMESHGUI_GroupDlg( SMESHGUI*,
2012-08-09 16:03:55 +06:00
SMESH::SMESH_Mesh_ptr = SMESH::SMESH_Mesh::_nil() );
2009-02-17 10:27:49 +05:00
SMESHGUI_GroupDlg( SMESHGUI*,
2012-08-09 16:03:55 +06:00
SMESH::SMESH_GroupBase_ptr,
2009-02-17 10:27:49 +05:00
const bool theIsConvert = false );
~SMESHGUI_GroupDlg();
static QString GetDefaultName( const QString& );
2004-06-18 14:34:31 +06:00
public slots:
2009-02-17 10:27:49 +05:00
void onAdd();
void onRemove();
2004-06-18 14:34:31 +06:00
private slots:
2009-02-17 10:27:49 +05:00
void onTypeChanged( int );
void onGrpTypeChanged( int );
void onColorChanged( QColor );
void onOK();
void onClose();
bool onApply();
void onHelp();
void onDeactivate();
2012-08-09 16:03:55 +06:00
void onVisibilityChanged();
2009-02-17 10:27:49 +05:00
void onListSelectionChanged();
void onObjectSelectionChanged();
2012-08-09 16:03:55 +06:00
void onSelectAll();
2009-02-17 10:27:49 +05:00
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* );
2004-06-18 14:34:31 +06:00
private:
2009-02-17 10:27:49 +05:00
void initDialog( bool );
void init( SMESH::SMESH_Mesh_ptr );
void init( SMESH::SMESH_GroupBase_ptr,
const bool theIsConvert = false );
void closeEvent( QCloseEvent* );
void enterEvent( QEvent* );
void hideEvent( QHideEvent* ); /* ESC key */
void keyPressEvent( QKeyEvent* );
void setSelectionMode( int );
void updateButtons();
void updateGeomPopup();
bool SetAppropriateActor();
void setShowEntityMode();
void restoreShowEntityMode();
2012-08-09 16:03:55 +06:00
bool IsActorVisible( SMESH_Actor* );
2009-02-17 10:27:49 +05:00
void setGroupColor( const SALOMEDS::Color& );
SALOMEDS::Color getGroupColor() const;
void setGroupQColor( const QColor& );
QColor getGroupQColor() const;
2012-12-13 17:41:29 +06:00
void setDefaultName() const;
2009-02-17 10:27:49 +05:00
void setDefaultGroupColor();
2012-08-09 16:03:55 +06:00
void setIsApplyAndClose( const bool theFlag );
bool isApplyAndClose() const;
private:
2009-02-17 10:27:49 +05:00
SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
int myGrpTypeId; /* Current group type id : standalone or group on geometry */
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;
2012-08-09 16:03:55 +06:00
QCheckBox* mySelectAll;
QCheckBox* myAllowElemsModif;
QLabel* myElementsLab;
2009-02-17 10:27:49 +05:00
QListWidget* myElements;
2012-08-09 16:03:55 +06:00
QPushButton* myFilterBtn;
QPushButton* myAddBtn;
QPushButton* myRemoveBtn;
QPushButton* mySortBtn;
2009-02-17 10:27:49 +05:00
2012-08-09 16:03:55 +06:00
QGroupBox* mySelectBox;
2009-02-17 10:27:49 +05:00
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;
2012-08-09 16:03:55 +06:00
QList<SMESH_Actor*> myActorsList;
2009-02-17 10:27:49 +05:00
SMESH::SMESH_Group_var myGroup;
SMESH::SMESH_GroupOnGeom_var myGroupOnGeom;
2012-08-09 16:03:55 +06:00
SMESH::SMESH_GroupOnFilter_var myGroupOnFilter;
SMESH::Filter_var myFilter;
2009-02-17 10:27:49 +05:00
QList<int> myIdList;
GEOM::ListOfGO_var myGeomObjects;
int mySelectionMode;
//Handle(SMESH_TypeFilter) myMeshFilter;
//Handle(SMESH_TypeFilter) mySubMeshFilter;
//Handle(SMESH_TypeFilter) myGroupFilter;
SUIT_SelectionFilter* myMeshFilter;
2012-08-09 16:03:55 +06:00
SMESH_LogicalFilter* mySubMeshFilter;
SMESH_LogicalFilter* myGroupFilter;
2009-02-17 10:27:49 +05:00
SUIT_SelectionFilter* myGeomFilter;
SMESHGUI_FilterDlg* myFilterDlg;
bool myCreate, myIsBusy;
QString myHelpFileName;
QMap<QAction*, int> myActions;
bool myNameChanged; //added by skl for IPAL19574
2012-08-09 16:03:55 +06:00
int myNbChangesOfContents; // nb add's and remove's
QString myObjectToSelect;
bool myIsApplyAndClose;
2004-06-18 14:34:31 +06:00
};
2009-02-17 10:27:49 +05:00
#endif // SMESHGUI_GROUPDLG_H