Version: 9.16.0
SMESHGUI_MeshInfo.h
Go to the documentation of this file.
1// Copyright (C) 2007-2026 CEA, EDF, OPEN CASCADE
2//
3// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5//
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, or (at your option) any later version.
10//
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.
15//
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
19//
20// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21//
22
23#ifndef SMESHGUI_MESHINFO_H
24#define SMESHGUI_MESHINFO_H
25
26#include "SMESH_SMESHGUI.hxx"
28
29#ifndef DISABLE_PLOT2DVIEWER
30 #include <Plot2d_Histogram.h>
31#else
32 #include <qwt_plot.h>
33#endif
34
35#include <QDialog>
36#include <QList>
37#include <QMap>
38#include <QSet>
39#include <QToolBox>
40
41#include <SALOMEconfig.h>
42#include CORBA_SERVER_HEADER(SMESH_Filter)
43
44#include <SALOME_InteractiveObject.hxx>
45#include <SALOME_GenericObj_wrap.hxx>
46
47class QAbstractButton;
48class QButtonGroup;
49class QCheckBox;
50class QContextMenuEvent;
51class QLabel;
52class QLineEdit;
53class QTabWidget;
54class QTextBrowser;
55class QTreeWidget;
56class QTreeWidgetItem;
58class SMDS_MeshNode;
61
62class ExtraWidget;
63class GroupCombo;
64class InfoWriter;
65
67{
68public:
69 SMESHGUI_Info( QWidget* = 0 );
70 virtual void saveInfo( QTextStream& ) = 0;
71};
72
74{
75 Q_OBJECT
76
77 enum
78 {
80 iObjectStart = iStart,
81 iName = iObjectStart,
84 iNodesStart = iObjectEnd,
87 iElementsStart = iNodesEnd,
88 iElementsTitleStart = iElementsStart,
91 iElementsTotalStart = iElementsTitleEnd,
94 i0DStart = iElementsTotalEnd,
97 iBallsStart = i0DEnd,
100 i1DStart = iBallsEnd,
103 i2DStart = i1DEnd,
109 i3DStart = i2DEnd,
118 iElementsEnd = i3DEnd,
120 iOther = iEnd
121 };
122
123 enum
124 {
127 iTotal = iSingle,
131 iNbColumns
132 };
133
134 typedef QMap<int, QWidget*> wlist;
135 typedef QMap<int, wlist> iwlist;
136
137public:
140
141 void showInfo( const SMESH::SelectionProxy& );
142 void clear();
143 void saveInfo( QTextStream& );
144
145private:
146 QWidget* addWidget( QWidget*, int, int, int = 1 );
147 QWidget* widget( int, int ) const;
148 QString value( int, int ) const;
149 void setFieldsVisible( int, int, bool );
150
151private slots:
152 void updateInfo();
153 void loadMesh();
154
155private:
158};
159
161{
162 Q_OBJECT
163
164public:
167
168 void showInfo( const SMESH::SelectionProxy&, uint, bool );
169 void showInfo( const SMESH::SelectionProxy&, QSet<uint>, bool );
170 void showInfo( const SMESH::SelectionProxy& );
171 void clear();
172 void saveInfo( QTextStream& );
173
174protected:
175 enum { ShowNone, ShowNodes, ShowElements };
176
177 QWidget* centralWidget() const;
178
179 SMESH::SelectionProxy proxy() const;
180 int what() const;
181
182 QString type2str( int, bool = false );
183 QString stype2str( int );
184 QString etype2str( int );
185 QString ctrl2str( int );
186 void writeInfo( InfoWriter*, const QList<uint>& );
187 virtual void information( const QList<uint>& ) = 0;
188 virtual void clearInternal();
189
190signals:
191 void itemInfo( int type, const QString& ids );
192
193private slots:
194 void showPrevious();
195 void showNext();
196 void updateControls();
197
198private:
203 QList<uint> myIDs;
205};
206
208{
209 Q_OBJECT
210
211public:
213
214protected:
215 void information( const QList<uint>& );
216 void clearInternal();
217
218private slots:
219 void connectivityClicked(const QUrl &);
220
221 private:
222 QTextBrowser* myInfo;
223};
224
226{
227 Q_OBJECT
228
229 class ItemDelegate;
230 class ItemCreator;
231
232public:
234
235protected:
236 void contextMenuEvent( QContextMenuEvent* );
237 void information( const QList<uint>& );
238 void nodeInfo( const SMDS_MeshNode*, int, int, QTreeWidgetItem* );
239 void clearInternal();
240
241private slots:
242 void itemDoubleClicked( QTreeWidgetItem*, int );
243 void saveExpanded( QTreeWidgetItem* );
244
245private:
246 QTreeWidgetItem* createItem( QTreeWidgetItem* = 0, int = 0 );
247 QString expandedResource( QTreeWidgetItem* );
248
249private:
251};
252
254{
255 Q_OBJECT
256
257public:
259
261
262signals:
263 void computed();
264
265public slots:
266 void compute();
267
268private:
271};
272
274{
275 Q_OBJECT
276
277public:
280
281 void showInfo( const SMESH::SelectionProxy& );
282 void clear();
283 void saveInfo( QTextStream& );
284
285private slots:
286 void updateInfo();
287 void showPreviousGroups();
288 void showNextGroups();
289 void showPreviousSubMeshes();
290 void showNextSubMeshes();
291
292private:
293 QTreeWidgetItem* createItem( QTreeWidgetItem* = 0, int = 0 );
294 void meshInfo( const SMESH::SelectionProxy&, QTreeWidgetItem* );
295 void subMeshInfo( const SMESH::SelectionProxy&, QTreeWidgetItem* );
296 void groupInfo( const SMESH::SelectionProxy&, QTreeWidgetItem* );
297
298 void showGroups();
299 void showSubMeshes();
300
301private:
304 QList<InfoComputor*> myComputors;
305 QList<SMESH::SelectionProxy> myGroups;
306 QList<SMESH::SelectionProxy> mySubMeshes;
307};
308
310{
311 Q_OBJECT
312
313public:
316
317 void showInfo( const SMESH::SelectionProxy& );
318 void saveInfo( QTextStream& );
319
320private:
321 enum ObjectType { Mesh, SubMesh, Group };
322 QwtPlot* createPlot( QWidget* );
323 void clearInternal();
324#ifndef DISABLE_PLOT2DVIEWER
325 Plot2d_Histogram* getHistogram( SMESH::NumericalFunctor_ptr );
326#endif
327 void computeNb( int, int, int );
328
329private slots:
330 void computeAspectRatio();
331 void computeAspectRatio3D();
332 void computeFreeNodesInfo();
333 void computeNodesNbConnInfo();
334 void computeDoubleNodesInfo();
335 void computeDoubleEdgesInfo();
336 void computeDoubleFacesInfo();
337 void computeOverConstrainedFacesInfo();
338 void computeDoubleVolumesInfo();
339 void computeOverConstrainedVolumesInfo();
340 void setTolerance( double );
341
342private:
343 typedef SALOME::GenericObj_wrap< SMESH::Predicate > TPredicate;
344 typedef SALOME::GenericObj_wrap< SMESH::NumericalFunctor > TNumFunctor;
348 QList<QLabel*> myWidgets;
349 QToolBox* myMeshTB;
352 QList<QAbstractButton*> myButtons;
353 QList<TPredicate> myPredicates;
354 TNumFunctor myAspectRatio, myAspectRatio3D, myNodeConnFunctor;
355};
356
358{
359 Q_OBJECT
360
361 enum { NodeMode, ElemMode, GroupMode };
362
363public:
365 enum
366 {
370 CtrlInfo
371 };
372
373 SMESHGUI_MeshInfoDlg( QWidget* = 0, int = BaseInfo );
375
376 void showInfo( const Handle(SALOME_InteractiveObject)& );
377 void reject();
378
379protected:
380 void keyPressEvent( QKeyEvent* );
381
382signals:
383 void switchMode( int );
384
385private slots:
386 void help();
387 void updateSelection();
388 void updateInfo();
389 void deactivate();
390 void modeChanged();
391 void idChanged();
392 void idPreviewChange( bool );
393 void showItemInfo( int type, const QString& ids );
394 void dump();
395
396private:
397 void showInfo( const SMESH::SelectionProxy& );
398
400 QTabWidget* myTabWidget;
405 QButtonGroup* myMode;
406 QLineEdit* myID;
410};
411
413{
414 Q_OBJECT
415
416public:
419
420 void showInfo( const Handle(SALOME_InteractiveObject)& );
421 void reject();
422
423private slots:
424 void updateInfo();
425 void deactivate();
426 void updateSelection();
427 void help();
428 void dump();
429
430private:
431 void showInfo( const SMESH::SelectionProxy& );
432
435};
436
437#endif // SMESHGUI_MESHINFO_H
Handle(SALOME_InteractiveObject) GeomSelectionTools
Return the first selected Salome Interactive Object (Handle(Salome_InteractiveObject))
Definition: GeomSelectionTools.cxx:97
#define SMESHGUI_EXPORT
Definition: SMESH_SMESHGUI.hxx:36
Auxiliary widget to browse between chunks of information.
Definition: SMESHGUI_MeshInfo.cxx:433
Customized combo box to manage list of mesh groups.
Definition: SMESHGUI_MeshInfo.cxx:2900
Mesh information computor.
Definition: SMESHGUI_MeshInfo.h:254
void compute()
Compute requested information.
Definition: SMESHGUI_MeshInfo.cxx:2336
@ GrpNbNodes
Definition: SMESHGUI_MeshInfo.h:258
@ GrpSize
Definition: SMESHGUI_MeshInfo.h:258
InfoComputor(QObject *, const SMESH::SelectionProxy &, int)
Constructor.
Definition: SMESHGUI_MeshInfo.cxx:2327
void computed()
int myOperation
Definition: SMESHGUI_MeshInfo.h:270
SMESH::SelectionProxy myProxy
Definition: SMESHGUI_MeshInfo.h:269
Base info writer class.
Definition: SMESHGUI_MeshInfo.cxx:1154
Base class for elements.
Definition: SMDS_MeshElement.hxx:56
Definition: SMDS_MeshNode.hxx:36
Show additional information on selected object.
Definition: SMESHGUI_MeshInfo.h:274
SMESH::SelectionProxy myProxy
Definition: SMESHGUI_MeshInfo.h:302
QList< InfoComputor * > myComputors
Definition: SMESHGUI_MeshInfo.h:304
QList< SMESH::SelectionProxy > myGroups
Definition: SMESHGUI_MeshInfo.h:305
QList< SMESH::SelectionProxy > mySubMeshes
Definition: SMESHGUI_MeshInfo.h:306
QTreeWidget * myTree
Definition: SMESHGUI_MeshInfo.h:303
Show basic information on selected object.
Definition: SMESHGUI_MeshInfo.h:74
SMESH::SelectionProxy myProxy
Definition: SMESHGUI_MeshInfo.h:157
QMap< int, wlist > iwlist
Definition: SMESHGUI_MeshInfo.h:135
QMap< int, QWidget * > wlist
Definition: SMESHGUI_MeshInfo.h:134
@ iBiQuadratic
Definition: SMESHGUI_MeshInfo.h:130
@ iQuadratic
Definition: SMESHGUI_MeshInfo.h:129
@ iLinear
Definition: SMESHGUI_MeshInfo.h:128
@ iSingle
Definition: SMESHGUI_MeshInfo.h:126
@ iLabel
Definition: SMESHGUI_MeshInfo.h:125
iwlist myWidgets
Definition: SMESHGUI_MeshInfo.h:156
@ i0DEnd
Definition: SMESHGUI_MeshInfo.h:96
@ iStart
Definition: SMESHGUI_MeshInfo.h:79
@ iNodesEnd
Definition: SMESHGUI_MeshInfo.h:86
@ i1D
Definition: SMESHGUI_MeshInfo.h:101
@ i1DEnd
Definition: SMESHGUI_MeshInfo.h:102
@ i3DEnd
Definition: SMESHGUI_MeshInfo.h:117
@ iElementsTotal
Definition: SMESHGUI_MeshInfo.h:92
@ iBallsEnd
Definition: SMESHGUI_MeshInfo.h:99
@ iElementsTitleEnd
Definition: SMESHGUI_MeshInfo.h:90
@ i2DQuadrangles
Definition: SMESHGUI_MeshInfo.h:106
@ i3D
Definition: SMESHGUI_MeshInfo.h:110
@ i3DHexaPrisms
Definition: SMESHGUI_MeshInfo.h:115
@ iElementsTotalEnd
Definition: SMESHGUI_MeshInfo.h:93
@ i3DTetrahedrons
Definition: SMESHGUI_MeshInfo.h:111
@ i3DHexahedrons
Definition: SMESHGUI_MeshInfo.h:112
@ i2DTriangles
Definition: SMESHGUI_MeshInfo.h:105
@ iEnd
Definition: SMESHGUI_MeshInfo.h:119
@ iObjectEnd
Definition: SMESHGUI_MeshInfo.h:83
@ i0D
Definition: SMESHGUI_MeshInfo.h:95
@ iBalls
Definition: SMESHGUI_MeshInfo.h:98
@ i3DPyramids
Definition: SMESHGUI_MeshInfo.h:113
@ iNodes
Definition: SMESHGUI_MeshInfo.h:85
@ iObject
Definition: SMESHGUI_MeshInfo.h:82
@ i2D
Definition: SMESHGUI_MeshInfo.h:104
@ i2DPolygons
Definition: SMESHGUI_MeshInfo.h:107
@ i3DPolyhedrons
Definition: SMESHGUI_MeshInfo.h:116
@ i2DEnd
Definition: SMESHGUI_MeshInfo.h:108
@ iElementsTitle
Definition: SMESHGUI_MeshInfo.h:89
@ i3DPrisms
Definition: SMESHGUI_MeshInfo.h:114
Overall Mesh Quality dialog.
Definition: SMESHGUI_MeshInfo.h:413
SMESHGUI_CtrlInfo * myCtrlInfo
Definition: SMESHGUI_MeshInfo.h:434
SMESH::SelectionProxy myProxy
Definition: SMESHGUI_MeshInfo.h:433
Show quality statistics information on selected object.
Definition: SMESHGUI_MeshInfo.h:310
QToolBox * myMeshTB
Definition: SMESHGUI_MeshInfo.h:349
QList< QAbstractButton * > myButtons
Definition: SMESHGUI_MeshInfo.h:352
QwtPlot * myPlot
Definition: SMESHGUI_MeshInfo.h:350
QList< TPredicate > myPredicates
Definition: SMESHGUI_MeshInfo.h:353
SALOME::GenericObj_wrap< SMESH::NumericalFunctor > TNumFunctor
Definition: SMESHGUI_MeshInfo.h:344
TNumFunctor myAspectRatio
Definition: SMESHGUI_MeshInfo.h:354
QList< QLabel * > myWidgets
Definition: SMESHGUI_MeshInfo.h:348
ObjectType
Definition: SMESHGUI_MeshInfo.h:321
ObjectType myObjectType
Definition: SMESHGUI_MeshInfo.h:346
SALOME::GenericObj_wrap< SMESH::Predicate > TPredicate
Definition: SMESHGUI_MeshInfo.h:343
SMESHGUI_SpinBox * myToleranceWidget
Definition: SMESHGUI_MeshInfo.h:347
QwtPlot * myPlot3D
Definition: SMESHGUI_MeshInfo.h:351
SMESH::SelectionProxy myProxy
Definition: SMESHGUI_MeshInfo.h:345
Base class for the mesh element information widget.
Definition: SMESHGUI_MeshInfo.h:161
ExtraWidget * myExtra
Definition: SMESHGUI_MeshInfo.h:200
SMESH::SelectionProxy myProxy
Definition: SMESHGUI_MeshInfo.h:201
void itemInfo(int type, const QString &ids)
virtual void information(const QList< uint > &)=0
Show information on given mesh nodes / elements.
int myIndex
Definition: SMESHGUI_MeshInfo.h:204
QList< uint > myIDs
Definition: SMESHGUI_MeshInfo.h:203
QWidget * myFrame
Definition: SMESHGUI_MeshInfo.h:199
int myWhat
Definition: SMESHGUI_MeshInfo.h:202
To display in the viewer IDs of selected elements or nodes.
Definition: SMESHGUI_IdPreview.h:51
Base widget for all information panes.
Definition: SMESHGUI_MeshInfo.h:67
virtual void saveInfo(QTextStream &)=0
Centralized dialog box for the measurements.
Definition: SMESHGUI_MeshInfo.h:358
SMESH::SelectionProxy myProxy
Definition: SMESHGUI_MeshInfo.h:399
SMESHGUI_BaseInfo * myBaseInfo
Definition: SMESHGUI_MeshInfo.h:401
SMESHGUI_ElemInfo * myElemInfo
Definition: SMESHGUI_MeshInfo.h:402
@ ElemInfo
mesh element information
Definition: SMESHGUI_MeshInfo.h:368
@ BaseInfo
base mesh information
Definition: SMESHGUI_MeshInfo.h:367
@ AddInfo
additional information
Definition: SMESHGUI_MeshInfo.h:369
SMESHGUI_AddInfo * myAddInfo
Definition: SMESHGUI_MeshInfo.h:403
QTabWidget * myTabWidget
Definition: SMESHGUI_MeshInfo.h:400
QButtonGroup * myMode
Definition: SMESHGUI_MeshInfo.h:405
QCheckBox * myIDPreviewCheck
Definition: SMESHGUI_MeshInfo.h:407
SMESHGUI_CtrlInfo * myCtrlInfo
Definition: SMESHGUI_MeshInfo.h:404
@ ElemMode
Definition: SMESHGUI_MeshInfo.h:361
QLineEdit * myID
Definition: SMESHGUI_MeshInfo.h:406
SMESHGUI_IdPreview * myIDPreview
Definition: SMESHGUI_MeshInfo.h:409
GroupCombo * myGroups
Definition: SMESHGUI_MeshInfo.h:408
Show mesh element information in the simple text area.
Definition: SMESHGUI_MeshInfo.h:208
QTextBrowser * myInfo
Definition: SMESHGUI_MeshInfo.h:222
Definition: SMESHGUI_SpinBox.h:48
Item creator for tree mesh info widget.
Definition: SMESHGUI_MeshInfo.cxx:2110
Item delegate for tree mesh info widget.
Definition: SMESHGUI_MeshInfo.cxx:2077
Show mesh element information as the tree.
Definition: SMESHGUI_MeshInfo.h:226
QTreeWidget * myInfo
Definition: SMESHGUI_MeshInfo.h:250
Provide operations over the selected object.
Definition: SMESHGUI_SelectionProxy.h:117