X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FSMESHGUI%2FSMESHGUI_MeshInfo.h;h=54ee1aca5191d91d0e2e8bbd161d55940c04f9a9;hb=5d68554076bbca0e1e95fb0db215a6c2b84b6c54;hp=a2fa39930e6deb2dc6b12f5d505dee906d3d1ce3;hpb=bd4e115a78b52e3fbc016e5e30bb0e19b2a9e7d6;p=modules%2Fsmesh.git diff --git a/src/SMESHGUI/SMESHGUI_MeshInfo.h b/src/SMESHGUI/SMESHGUI_MeshInfo.h index a2fa39930..54ee1aca5 100644 --- a/src/SMESHGUI/SMESHGUI_MeshInfo.h +++ b/src/SMESHGUI/SMESHGUI_MeshInfo.h @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2014 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,9 @@ #define SMESHGUI_MESHINFO_H #include "SMESH_SMESHGUI.hxx" -#include +#include "SMESH_ControlsDef.hxx" + +#include #include #include @@ -39,16 +41,24 @@ #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; class QLineEdit; class QPushButton; class QTabWidget; class QTextBrowser; +class QGridLayout; class SMESH_Actor; class SMDS_MeshNode; class SMDS_MeshElement; +class SMESHGUI_SpinBox; class ExtraWidget; @@ -64,7 +74,10 @@ class SMESHGUI_EXPORT SMESHGUI_MeshInfo : public QFrame iNodesEnd, iElementsStart = iNodesEnd, iElements, - i0DStart, + iNbStart, + iNb, + iNbEnd, + i0DStart = iNbEnd, i0D, i0DEnd, iBallsStart = i0DEnd, @@ -95,7 +108,8 @@ class SMESHGUI_EXPORT SMESHGUI_MeshInfo : public QFrame iSingle = 1, iTotal = iSingle, iLinear, - iQuadratic + iQuadratic, + iBiQuadratic }; typedef QList wlist; @@ -107,6 +121,7 @@ public: void showInfo( SMESH::SMESH_IDSource_ptr ); void clear(); + void saveInfo( QTextStream &out ); private: enum { Bold = 0x01, Italic = 0x02 }; @@ -136,6 +151,7 @@ public: void showInfo( long, bool ); void showInfo( QSet, bool ); void clear(); + virtual void saveInfo( QTextStream &out ) = 0; protected: struct XYZ @@ -161,6 +177,10 @@ protected: QString formatConnectivity( Connectivity, int ); XYZ gravityCenter( const SMDS_MeshElement* ); +signals: + void itemInfo( int ); + void itemInfo( const QString& ); + private slots: void showPrevious(); void showNext(); @@ -177,8 +197,11 @@ private: class SMESHGUI_EXPORT SMESHGUI_SimpleElemInfo : public SMESHGUI_ElemInfo { + Q_OBJECT + public: SMESHGUI_SimpleElemInfo( QWidget* = 0 ); + void saveInfo( QTextStream &out ); protected: void information( const QList& ); @@ -190,17 +213,25 @@ private: class SMESHGUI_EXPORT SMESHGUI_TreeElemInfo : public SMESHGUI_ElemInfo { + Q_OBJECT; + class ItemDelegate; enum { Bold = 0x01, All = 0x80 }; public: SMESHGUI_TreeElemInfo( QWidget* = 0 ); + void saveInfo( QTextStream &out ); protected: + void contextMenuEvent( QContextMenuEvent* e ); void information( const QList& ); + void nodeInfo( const SMDS_MeshNode*, int, int, QTreeWidgetItem* ); void clearInternal(); +private slots: + void itemDoubleClicked( QTreeWidgetItem*, int ); + private: QTreeWidgetItem* createItem( QTreeWidgetItem* = 0, int = 0 ); @@ -236,6 +267,7 @@ public: void showInfo( SMESH::SMESH_IDSource_ptr ); // void clear(); + void saveInfo( QTextStream &out ); private slots: void changeLoadToCompute(); @@ -259,6 +291,54 @@ 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(); + Plot2d_Histogram* getHistogram( SMESH::NumericalFunctor_ptr functor ); + void computeNb( int ft, int iBut, int iWdg ); + +private slots: + void computeAspectRatio(); + void computeAspectRatio3D(); + void computeFreeNodesInfo(); + 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; +}; + class SMESHGUI_EXPORT SMESHGUI_MeshInfoDlg : public QDialog { Q_OBJECT; @@ -270,7 +350,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 ); @@ -291,6 +372,9 @@ private slots: void deactivate(); void modeChanged(); void idChanged(); + void showItemInfo( int ); + void showItemInfo( const QString& ); + void dump(); private: QTabWidget* myTabWidget; @@ -299,7 +383,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