X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_MeshInfo.h;h=dd1af5c0271303f84724bc12bfefbd906f928227;hp=111a73b5b3accf20cf41abf0c2e41f3fc3029170;hb=5c5e1f2368ca2b3388f657ae028b2a6b5ce8ae36;hpb=bd8f1aee7c78f7d2eb82bd4fec5e08c9e3d280ce diff --git a/src/SMESHGUI/SMESHGUI_MeshInfo.h b/src/SMESHGUI/SMESHGUI_MeshInfo.h index 111a73b5b..dd1af5c02 100644 --- a/src/SMESHGUI/SMESHGUI_MeshInfo.h +++ b/src/SMESHGUI/SMESHGUI_MeshInfo.h @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -6,7 +6,7 @@ // 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. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -26,7 +26,13 @@ #define SMESHGUI_MESHINFO_H #include "SMESH_SMESHGUI.hxx" -#include +#include "SMESH_ControlsDef.hxx" + +#ifndef DISABLE_PLOT2DVIEWER + #include +#else + #include +#endif #include #include @@ -39,7 +45,12 @@ #include #include CORBA_SERVER_HEADER(SMESH_Mesh) #include CORBA_SERVER_HEADER(SMESH_Group) +#include CORBA_SERVER_HEADER(SMESH_Filter) +#include +#include + +class QAbstractButton; class QButtonGroup; class QContextMenuEvent; class QLabel; @@ -47,9 +58,11 @@ class QLineEdit; class QPushButton; class QTabWidget; class QTextBrowser; +class QGridLayout; class SMESH_Actor; class SMDS_MeshNode; class SMDS_MeshElement; +class SMESHGUI_SpinBox; class ExtraWidget; @@ -99,7 +112,8 @@ class SMESHGUI_EXPORT SMESHGUI_MeshInfo : public QFrame iSingle = 1, iTotal = iSingle, iLinear, - iQuadratic + iQuadratic, + iBiQuadratic }; typedef QList wlist; @@ -148,6 +162,7 @@ protected: { double myX, myY, myZ; XYZ() { myX = myY = myZ = 0.0; } + XYZ(double x, double y, double z) { myX = x; myY = y; myZ = z; } void add( double x, double y, double z ) { myX += x; myY += y; myZ += z; } void divide( double a ) { if ( a != 0.) { myX /= a; myY /= a; myZ /= a; } } double x() const { return myX; } @@ -166,6 +181,7 @@ protected: Connectivity nodeConnectivity( const SMDS_MeshNode* ); QString formatConnectivity( Connectivity, int ); XYZ gravityCenter( const SMDS_MeshElement* ); + XYZ normal( const SMDS_MeshElement* ); signals: void itemInfo( int ); @@ -216,6 +232,7 @@ public: protected: void contextMenuEvent( QContextMenuEvent* e ); void information( const QList& ); + void nodeInfo( const SMDS_MeshNode*, int, int, QTreeWidgetItem* ); void clearInternal(); private slots: @@ -233,7 +250,7 @@ class GrpComputor: public QObject Q_OBJECT; public: - GrpComputor( SMESH::SMESH_GroupBase_ptr, QTreeWidgetItem*, QObject* ); + GrpComputor( SMESH::SMESH_GroupBase_ptr, QTreeWidgetItem*, QObject*, bool = false); QTreeWidgetItem* getItem() { return myItem; } public slots: @@ -242,6 +259,7 @@ public slots: private: SMESH::SMESH_GroupBase_var myGroup; QTreeWidgetItem* myItem; + bool myToComputeSize; }; class SMESHGUI_EXPORT SMESHGUI_AddInfo : public QTreeWidget @@ -280,6 +298,57 @@ private: SMESH::submesh_array_var mySubMeshes; }; +class SMESHGUI_EXPORT SMESHGUI_CtrlInfo : public QFrame +{ + Q_OBJECT; + +public: + SMESHGUI_CtrlInfo( QWidget* = 0 ); + ~SMESHGUI_CtrlInfo(); + + void showInfo( SMESH::SMESH_IDSource_ptr ); + void saveInfo( QTextStream &out ); + +private: + enum ObjectType { Mesh, SubMesh, Group }; + QLabel* createField(); + QwtPlot* createPlot( QWidget* ); + void setFontAttributes( QWidget* ); + void clearInternal(); +#ifndef DISABLE_PLOT2DVIEWER + Plot2d_Histogram* getHistogram( SMESH::NumericalFunctor_ptr functor ); +#endif + void computeNb( int ft, int iBut, int iWdg ); + +private slots: + void computeAspectRatio(); + void computeAspectRatio3D(); + void computeFreeNodesInfo(); + void computeNodesNbConnInfo(); + void computeDoubleNodesInfo(); + void computeDoubleEdgesInfo(); + void computeDoubleFacesInfo(); + void computeOverConstrainedFacesInfo(); + void computeDoubleVolumesInfo(); + void computeOverConstrainedVolumesInfo(); + void setTolerance( const double theTolerance ); + + +private: + typedef SALOME::GenericObj_wrap< SMESH::Predicate > TPredicate; + typedef SALOME::GenericObj_wrap< SMESH::NumericalFunctor > TNumFunctor; + SMESH::SMESH_IDSource_var myObject; + ObjectType myObjectType; + SMESHGUI_SpinBox* myToleranceWidget; + QList myWidgets; + QGridLayout* myMainLayout; + QwtPlot* myPlot; + QwtPlot* myPlot3D; + QList myButtons; + QList myPredicates; + TNumFunctor myAspectRatio, myAspectRatio3D, myNodeConnFunctor; +}; + class SMESHGUI_EXPORT SMESHGUI_MeshInfoDlg : public QDialog { Q_OBJECT; @@ -291,7 +360,8 @@ public: enum { BaseInfo, //!< base mesh information ElemInfo, //!< mesh element information - AddInfo //!< additional information + AddInfo, //!< additional information + CtrlInfo //!< controls information }; SMESHGUI_MeshInfoDlg( QWidget* = 0, int = BaseInfo ); @@ -323,7 +393,31 @@ private: QLineEdit* myID; SMESHGUI_ElemInfo* myElemInfo; SMESHGUI_AddInfo* myAddInfo; + SMESHGUI_CtrlInfo* myCtrlInfo; SMESH_Actor* myActor; }; +class SMESHGUI_EXPORT SMESHGUI_CtrlInfoDlg : public QDialog +{ + Q_OBJECT; + +public: + SMESHGUI_CtrlInfoDlg( QWidget* = 0 ); + ~SMESHGUI_CtrlInfoDlg(); + + void showInfo( const Handle(SALOME_InteractiveObject)& ); + void reject(); + +private slots: + void updateInfo(); + void activate(); + void deactivate(); + void updateSelection(); + void help(); + void dump(); + +private: + SMESHGUI_CtrlInfo* myCtrlInfo; +}; + #endif // SMESHGUI_MESHINFO_H