2004-06-18 14:34:31 +06:00
|
|
|
// SMESH SMESHGUI : GUI for SMESH component
|
|
|
|
//
|
|
|
|
// Copyright (C) 2003 CEA
|
|
|
|
//
|
|
|
|
// 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
|
|
|
|
//
|
2006-06-01 17:39:17 +06:00
|
|
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
2004-06-18 14:34:31 +06:00
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// File : SMESHGUI_GroupDlg.h
|
|
|
|
// Author : Natalia KOPNOVA
|
|
|
|
// Module : SMESH
|
|
|
|
// $Header$
|
|
|
|
|
|
|
|
#ifndef DIALOGBOX_GROUP_H
|
|
|
|
#define DIALOGBOX_GROUP_H
|
|
|
|
|
2008-03-07 12:47:05 +05:00
|
|
|
#include "SMESH_SMESHGUI.hxx"
|
|
|
|
|
2005-11-03 13:38:17 +05:00
|
|
|
#include "LightApp_SelectionMgr.h"
|
2005-06-07 19:22:20 +06:00
|
|
|
//#include "SMESH_TypeFilter.hxx"
|
|
|
|
#include "SUIT_SelectionFilter.h"
|
2004-06-18 14:34:31 +06:00
|
|
|
|
|
|
|
// QT Includes
|
|
|
|
#include <qdialog.h>
|
|
|
|
#include <qvaluelist.h>
|
|
|
|
|
|
|
|
// IDL Headers
|
|
|
|
#include <SALOMEconfig.h>
|
|
|
|
#include CORBA_SERVER_HEADER(SMESH_Mesh)
|
|
|
|
#include CORBA_SERVER_HEADER(SMESH_Group)
|
|
|
|
|
|
|
|
class QLineEdit;
|
|
|
|
class QButtonGroup;
|
2004-12-01 15:48:31 +05:00
|
|
|
class QGroupBox;
|
2004-06-18 14:34:31 +06:00
|
|
|
class QListBox;
|
2008-03-07 12:47:05 +05:00
|
|
|
class QPopupMenu;
|
2004-06-18 14:34:31 +06:00
|
|
|
class QPushButton;
|
2008-03-07 12:47:05 +05:00
|
|
|
class QToolButton;
|
2004-06-18 14:34:31 +06:00
|
|
|
class QCheckBox;
|
2004-12-01 15:48:31 +05:00
|
|
|
class QWidgetStack;
|
2006-05-06 14:51:48 +06:00
|
|
|
class QtxIntSpinBox;
|
2004-06-18 14:34:31 +06:00
|
|
|
class SMESHGUI;
|
|
|
|
class SMESH_Actor;
|
|
|
|
class SMESHGUI_FilterDlg;
|
2008-03-07 12:47:05 +05:00
|
|
|
class SMESHGUI_ShapeByMeshOp;
|
|
|
|
class SUIT_Operation;
|
2005-06-07 19:22:20 +06:00
|
|
|
class SVTK_Selector;
|
|
|
|
class SVTK_ViewWindow;
|
2004-06-18 14:34:31 +06:00
|
|
|
|
|
|
|
//=================================================================================
|
|
|
|
// class : SMESHGUI_GroupDlg
|
|
|
|
// purpose :
|
|
|
|
//=================================================================================
|
2008-03-07 12:47:05 +05:00
|
|
|
class SMESHGUI_EXPORT SMESHGUI_GroupDlg : public QDialog
|
2004-06-18 14:34:31 +06:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2005-06-07 19:22:20 +06:00
|
|
|
SMESHGUI_GroupDlg( SMESHGUI*,
|
|
|
|
const char* name = 0,
|
2004-06-18 14:34:31 +06:00
|
|
|
SMESH::SMESH_Mesh_ptr theMesh = SMESH::SMESH_Mesh::_nil(),
|
|
|
|
bool modal = FALSE, WFlags fl = 0 );
|
2005-06-07 19:22:20 +06:00
|
|
|
SMESHGUI_GroupDlg( SMESHGUI*,
|
|
|
|
const char* name,
|
2006-03-13 20:29:49 +05:00
|
|
|
SMESH::SMESH_GroupBase_ptr theGroup,
|
2005-06-07 19:22:20 +06:00
|
|
|
bool modal = FALSE, WFlags fl = 0 );
|
2004-06-18 14:34:31 +06:00
|
|
|
~SMESHGUI_GroupDlg();
|
|
|
|
|
2008-03-07 12:47:05 +05:00
|
|
|
static QString GetDefaultName(const QString& theOperation);
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
public slots:
|
|
|
|
|
|
|
|
void onAdd();
|
|
|
|
void onRemove();
|
|
|
|
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
|
|
|
void onTypeChanged(int id);
|
2004-12-01 15:48:31 +05:00
|
|
|
void onGrpTypeChanged(int id);
|
2004-06-18 14:34:31 +06:00
|
|
|
|
|
|
|
void onOK();
|
|
|
|
void onClose();
|
|
|
|
bool onApply();
|
2006-05-06 14:51:48 +06:00
|
|
|
void onHelp();
|
2004-12-01 15:48:31 +05:00
|
|
|
void onDeactivate();
|
2004-06-18 14:34:31 +06:00
|
|
|
|
|
|
|
void onListSelectionChanged();
|
|
|
|
void onObjectSelectionChanged();
|
|
|
|
|
|
|
|
void onSelectSubMesh(bool on);
|
|
|
|
void onSelectGroup(bool on);
|
2004-12-01 15:48:31 +05:00
|
|
|
void onSelectGeomGroup(bool on);
|
2004-06-18 14:34:31 +06:00
|
|
|
void setCurrentSelection();
|
|
|
|
|
|
|
|
void setFilters();
|
|
|
|
void onSort();
|
|
|
|
|
|
|
|
void onNameChanged(const QString& text);
|
2004-12-01 15:48:31 +05:00
|
|
|
void onFilterAccepted();
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2008-03-07 12:47:05 +05:00
|
|
|
void onSelectColor();
|
|
|
|
|
|
|
|
void onGeomPopup( int );
|
|
|
|
void onGeomSelectionButton( bool );
|
|
|
|
|
|
|
|
void onPublishShapeByMeshDlg(SUIT_Operation*);
|
|
|
|
void onCloseShapeByMeshDlg(SUIT_Operation*);
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
private:
|
2005-06-07 19:22:20 +06:00
|
|
|
void initDialog(bool create);
|
2004-06-18 14:34:31 +06:00
|
|
|
void init(SMESH::SMESH_Mesh_ptr theMesh);
|
2006-03-13 20:29:49 +05:00
|
|
|
void init(SMESH::SMESH_GroupBase_ptr theGroup);
|
2004-06-18 14:34:31 +06:00
|
|
|
void closeEvent(QCloseEvent* e);
|
2005-06-07 19:22:20 +06:00
|
|
|
void enterEvent (QEvent*);
|
|
|
|
void hideEvent (QHideEvent*); /* ESC key */
|
2008-03-07 12:47:05 +05:00
|
|
|
void keyPressEvent(QKeyEvent*);
|
2004-06-18 14:34:31 +06:00
|
|
|
void setSelectionMode(int theMode);
|
|
|
|
void updateButtons();
|
2008-03-07 12:47:05 +05:00
|
|
|
void updateGeomPopup();
|
|
|
|
|
|
|
|
void setGroupColor( const SALOMEDS::Color& );
|
|
|
|
SALOMEDS::Color getGroupColor() const;
|
|
|
|
|
|
|
|
void setGroupQColor( const QColor& );
|
|
|
|
QColor getGroupQColor() const;
|
|
|
|
|
|
|
|
void setDefaultGroupColor();
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2005-06-07 19:22:20 +06:00
|
|
|
SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
|
2005-11-03 13:38:17 +05:00
|
|
|
LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
|
2005-06-07 19:22:20 +06:00
|
|
|
SMESH_Actor* myActor; /* Current mesh actor */
|
|
|
|
int myGrpTypeId; /* Current group type id : standalone or group on geometry */
|
|
|
|
int myTypeId; /* Current type id = radio button id */
|
|
|
|
QLineEdit* myCurrentLineEdit; /* Current LineEdit */
|
|
|
|
SVTK_Selector* mySelector;
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2004-12-01 15:48:31 +05:00
|
|
|
QPushButton* myMeshGroupBtn;
|
|
|
|
QLineEdit* myMeshGroupLine;
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
QButtonGroup* myTypeGroup;
|
|
|
|
QLineEdit* myName;
|
2008-03-07 12:47:05 +05:00
|
|
|
QString myOldName;
|
2004-12-01 15:48:31 +05:00
|
|
|
|
|
|
|
QButtonGroup* myGrpTypeGroup;
|
|
|
|
|
|
|
|
QWidgetStack* myWGStack;
|
2004-06-18 14:34:31 +06:00
|
|
|
QListBox* myElements;
|
|
|
|
QPushButton* myFilter;
|
|
|
|
|
|
|
|
QCheckBox* mySelectSubMesh;
|
|
|
|
QPushButton* mySubMeshBtn;
|
|
|
|
QLineEdit* mySubMeshLine;
|
|
|
|
|
|
|
|
QCheckBox* mySelectGroup;
|
|
|
|
QPushButton* myGroupBtn;
|
|
|
|
QLineEdit* myGroupLine;
|
|
|
|
|
2008-03-07 12:47:05 +05:00
|
|
|
QPushButton* myColorBtn;
|
2006-03-13 20:29:49 +05:00
|
|
|
|
2004-12-01 15:48:31 +05:00
|
|
|
QCheckBox* mySelectGeomGroup;
|
2008-03-07 12:47:05 +05:00
|
|
|
QToolButton* myGeomGroupBtn;
|
2004-12-01 15:48:31 +05:00
|
|
|
QLineEdit* myGeomGroupLine;
|
2008-03-07 12:47:05 +05:00
|
|
|
QPopupMenu* myGeomPopup;
|
|
|
|
|
|
|
|
SMESHGUI_ShapeByMeshOp* myShapeByMeshOp;
|
2004-12-01 15:48:31 +05:00
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
SMESH::SMESH_Mesh_var myMesh;
|
|
|
|
SMESH::SMESH_Group_var myGroup;
|
2006-03-13 20:29:49 +05:00
|
|
|
SMESH::SMESH_GroupOnGeom_var myGroupOnGeom;
|
2004-06-18 14:34:31 +06:00
|
|
|
QValueList<int> myIdList;
|
2008-03-07 12:47:05 +05:00
|
|
|
GEOM::ListOfGO_var myGeomObjects;
|
2004-06-18 14:34:31 +06:00
|
|
|
|
|
|
|
int mySelectionMode;
|
2005-06-07 19:22:20 +06:00
|
|
|
//Handle(SMESH_TypeFilter) myMeshFilter;
|
|
|
|
//Handle(SMESH_TypeFilter) mySubMeshFilter;
|
|
|
|
//Handle(SMESH_TypeFilter) myGroupFilter;
|
|
|
|
SUIT_SelectionFilter* myMeshFilter;
|
|
|
|
SUIT_SelectionFilter* mySubMeshFilter;
|
|
|
|
SUIT_SelectionFilter* myGroupFilter;
|
2008-03-07 12:47:05 +05:00
|
|
|
SUIT_SelectionFilter* myGeomFilter;
|
2004-06-18 14:34:31 +06:00
|
|
|
|
|
|
|
SMESHGUI_FilterDlg* myFilterDlg;
|
2004-12-01 15:48:31 +05:00
|
|
|
|
2005-06-08 12:18:53 +06:00
|
|
|
bool myCreate, myIsBusy;
|
2006-05-06 14:51:48 +06:00
|
|
|
|
|
|
|
QString myHelpFileName;
|
2004-06-18 14:34:31 +06:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // DIALOGBOX_GROUP_H
|