1 // SMESH SMESHGUI : GUI for SMESH component
\r
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
\r
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
\r
6 // This library is free software; you can redistribute it and/or
\r
7 // modify it under the terms of the GNU Lesser General Public
\r
8 // License as published by the Free Software Foundation; either
\r
9 // version 2.1 of the License.
\r
11 // This library is distributed in the hope that it will be useful,
\r
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
\r
14 // Lesser General Public License for more details.
\r
16 // You should have received a copy of the GNU Lesser General Public
\r
17 // License along with this library; if not, write to the Free Software
\r
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
\r
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
\r
24 // File : SMESHGUI_FilterDlg.h
\r
25 // Author : Sergey LITONIN
\r
29 #ifndef SMESHGUI_FilterDlg_H
\r
30 #define SMESHGUI_FilterDlg_H
\r
32 #include <qdialog.h>
\r
34 #include <qvaluelist.h>
\r
35 #include <SALOME_Selection.h>
\r
37 #include <SALOMEconfig.h>
\r
38 #include CORBA_SERVER_HEADER(SMESH_Filter)
\r
39 #include CORBA_SERVER_HEADER(SMESH_Mesh)
\r
49 class SALOME_Selection;
\r
58 Class : SMESHGUI_FilterDlg
\r
59 Description : Dialog to specify filters for VTK viewer
\r
62 class SMESHGUI_FilterDlg : public QDialog
\r
69 enum { FreeBorders = 0, MultiBorders, Length };
\r
72 enum { AspectRatio = 0, Warping, MinimumAngle, Taper, Skew, Area };
\r
75 enum { LessThan = 0, MoreThan, EqualTo };
\r
77 // Logical operations
\r
78 enum { LO_And = 0, LO_Or, LO_Undefined };
\r
80 // Source elements to be selected
\r
81 enum { Mesh, Selection, Dialog, None };
\r
83 typedef QMap<int, Table*> TableMap;
\r
86 SMESHGUI_FilterDlg( QWidget* parent,
\r
88 const bool theModal = true,
\r
89 const char* name = 0 );
\r
90 virtual ~SMESHGUI_FilterDlg();
\r
92 void Init( const int type );
\r
94 void SetSelection( SALOME_Selection* );
\r
95 void SetMesh( SMESH::SMESH_Mesh_ptr );
\r
96 void SetSourceWg( QWidget* );
\r
101 void onRemoveBtn();
\r
103 void onCriterionChanged( int, int );
\r
108 void onDeactivate();
\r
112 void closeEvent( QCloseEvent* e );
\r
113 void enterEvent ( QEvent * );
\r
115 void updateBtnState();
\r
118 QFrame* createButtonFrame( QWidget*, const bool );
\r
119 QFrame* createMainFrame( QWidget* );
\r
120 Table* createTable( QWidget*, const int );
\r
121 QButtonGroup* createSourceGroup( QWidget* );
\r
122 void addRow( Table*, const int );
\r
123 QTableItem* getCriterionItem( QTable*, const int );
\r
124 QTableItem* getCompareItem( QTable* );
\r
125 QTableItem* getNotItem( QTable* );
\r
126 QTableItem* getLogOpItem( QTable* );
\r
127 const QStringList& getCriteria( const int theType ) const;
\r
128 const QStringList& getCompare () const;
\r
131 int getCurrType() const;
\r
132 int getCriterion( const int theType, const int theRow ) const;
\r
135 bool isValid() const;
\r
136 SMESH::Predicate_ptr createPredicate( const int theType );
\r
137 void insertFilterInViewer( SMESH::Predicate_ptr thePred );
\r
138 void selectInViewer( const int theType,
\r
139 const QValueList<int>& theIds );
\r
140 void filterSource( const int theType,
\r
141 SMESH::Predicate_ptr thePred,
\r
142 QValueList<int>& theResIds );
\r
143 void filterSelectionSource( const int theType,
\r
144 SMESH::Predicate_ptr thePred,
\r
145 QValueList<int>& theResIds );
\r
146 void getIdsFromWg( const QWidget*, QValueList<int>& ) const;
\r
147 void setIdsToWg( QWidget*, const QValueList<int>& );
\r
148 Selection_Mode getSelMode( const int ) const;
\r
153 QFrame* myMainFrame;
\r
154 QGroupBox* myTableGrp;
\r
157 QPushButton* myAddBtn;
\r
158 QPushButton* myRemoveBtn;
\r
159 QPushButton* myClearBtn;
\r
160 QButtonGroup* mySourceGrp;
\r
161 QCheckBox* mySetInViewer;
\r
163 QPushButton* myOkBtn;
\r
164 QPushButton* myApplyBtn;
\r
165 QPushButton* myCloseBtn;
\r
169 SMESHGUI* mySMESHGUI;
\r
170 SALOME_Selection* mySelection;
\r
171 SMESH::SMESH_Mesh_ptr myMesh;
\r
172 QWidget* mySourceWg;
\r