1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // SMESH SMESHGUI : GUI for SMESH component
23 // File : SMESHGUI_GroupDlg.h
24 // Author : Natalia KOPNOVA
28 #ifndef DIALOGBOX_GROUP_H
29 #define DIALOGBOX_GROUP_H
31 #include "SMESH_SMESHGUI.hxx"
33 #include "LightApp_SelectionMgr.h"
34 //#include "SMESH_TypeFilter.hxx"
35 #include "SUIT_SelectionFilter.h"
39 #include <qvaluelist.h>
42 #include <SALOMEconfig.h>
43 #include CORBA_SERVER_HEADER(SMESH_Mesh)
44 #include CORBA_SERVER_HEADER(SMESH_Group)
58 class SMESHGUI_FilterDlg;
59 class SMESHGUI_ShapeByMeshOp;
62 class SVTK_ViewWindow;
64 //=================================================================================
65 // class : SMESHGUI_GroupDlg
67 //=================================================================================
68 class SMESHGUI_EXPORT SMESHGUI_GroupDlg : public QDialog
73 SMESHGUI_GroupDlg( SMESHGUI*,
75 SMESH::SMESH_Mesh_ptr theMesh = SMESH::SMESH_Mesh::_nil(),
76 bool modal = FALSE, WFlags fl = 0 );
77 SMESHGUI_GroupDlg( SMESHGUI*,
79 SMESH::SMESH_GroupBase_ptr theGroup,
80 bool modal = FALSE, WFlags fl = 0 );
83 static QString GetDefaultName(const QString& theOperation);
93 void onTypeChanged(int id);
94 void onGrpTypeChanged(int id);
101 void onVisibilityChanged();
103 void onListSelectionChanged();
104 void onObjectSelectionChanged();
106 void onSelectSubMesh(bool on);
107 void onSelectGroup(bool on);
108 void onSelectGeomGroup(bool on);
109 void setCurrentSelection();
114 void onNameChanged(const QString& text);
115 void onFilterAccepted();
117 void onSelectColor();
119 void onGeomPopup( int );
120 void onGeomSelectionButton( bool );
122 void onPublishShapeByMeshDlg(SUIT_Operation*);
123 void onCloseShapeByMeshDlg(SUIT_Operation*);
126 void initDialog(bool create);
127 void init(SMESH::SMESH_Mesh_ptr theMesh);
128 void init(SMESH::SMESH_GroupBase_ptr theGroup);
129 void closeEvent(QCloseEvent* e);
130 void enterEvent (QEvent*);
131 void hideEvent (QHideEvent*); /* ESC key */
132 void keyPressEvent(QKeyEvent*);
133 void setSelectionMode(int theMode);
134 void updateButtons();
135 void updateGeomPopup();
136 bool SetAppropriateActor();
137 void setShowEntityMode();
138 void restoreShowEntityMode();
140 void setGroupColor( const SALOMEDS::Color& );
141 SALOMEDS::Color getGroupColor() const;
143 void setGroupQColor( const QColor& );
144 QColor getGroupQColor() const;
146 void setDefaultGroupColor();
148 SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
149 LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
150 int myGrpTypeId; /* Current group type id : standalone or group on geometry */
151 int myTypeId; /* Current type id = radio button id */
152 int myStoredShownEntity; /* Store ShowEntity mode of myMesh */
153 QLineEdit* myCurrentLineEdit; /* Current LineEdit */
154 SVTK_Selector* mySelector;
156 QPushButton* myMeshGroupBtn;
157 QLineEdit* myMeshGroupLine;
159 QButtonGroup* myTypeGroup;
163 QButtonGroup* myGrpTypeGroup;
165 QWidgetStack* myWGStack;
166 QListBox* myElements;
167 QPushButton* myFilter;
169 QCheckBox* mySelectSubMesh;
170 QPushButton* mySubMeshBtn;
171 QLineEdit* mySubMeshLine;
173 QCheckBox* mySelectGroup;
174 QPushButton* myGroupBtn;
175 QLineEdit* myGroupLine;
177 QPushButton* myColorBtn;
179 QCheckBox* mySelectGeomGroup;
180 QToolButton* myGeomGroupBtn;
181 QLineEdit* myGeomGroupLine;
182 QPopupMenu* myGeomPopup;
184 SMESHGUI_ShapeByMeshOp* myShapeByMeshOp;
186 SMESH::SMESH_Mesh_var myMesh;
187 QPtrList<SMESH_Actor> myActorsList;
188 SMESH::SMESH_Group_var myGroup;
189 SMESH::SMESH_GroupOnGeom_var myGroupOnGeom;
190 QValueList<int> myIdList;
191 GEOM::ListOfGO_var myGeomObjects;
194 //Handle(SMESH_TypeFilter) myMeshFilter;
195 //Handle(SMESH_TypeFilter) mySubMeshFilter;
196 //Handle(SMESH_TypeFilter) myGroupFilter;
197 SUIT_SelectionFilter* myMeshFilter;
198 SUIT_SelectionFilter* mySubMeshFilter;
199 SUIT_SelectionFilter* myGroupFilter;
200 SUIT_SelectionFilter* myGeomFilter;
202 SMESHGUI_FilterDlg* myFilterDlg;
204 bool myCreate, myIsBusy;
206 QString myHelpFileName;
208 bool myNameChanged; //added by skl for IPAL19574
211 #endif // DIALOGBOX_GROUP_H