X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_MeshInfo.h;h=85edb6001be0c7e56d9119479a77cd0bf3790247;hb=24dd5df5f053455d186962be79786dc9237a1a0e;hp=d84097e1c97e689a9c1798f555454122a17f8278;hpb=a58d1281752d62ff40dac81af7076e1ab1fee824;p=modules%2Fsmesh.git diff --git a/src/SMESHGUI/SMESHGUI_MeshInfo.h b/src/SMESHGUI/SMESHGUI_MeshInfo.h index d84097e1c..85edb6001 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,10 +26,13 @@ #define SMESHGUI_MESHINFO_H #include "SMESH_SMESHGUI.hxx" -#include #include "SMESH_ControlsDef.hxx" -#include +#ifndef DISABLE_PLOT2DVIEWER + #include +#else + #include +#endif #include #include @@ -42,20 +45,26 @@ #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 QCheckBox; class QContextMenuEvent; +class QGridLayout; class QLabel; class QLineEdit; class QPushButton; class QTabWidget; class QTextBrowser; -class QGridLayout; -class SMESH_Actor; -class SMDS_MeshNode; class SMDS_MeshElement; +class SMDS_MeshNode; +class SMESHGUI_IdPreview; class SMESHGUI_SpinBox; +class SMESH_Actor; class ExtraWidget; @@ -105,7 +114,8 @@ class SMESHGUI_EXPORT SMESHGUI_MeshInfo : public QFrame iSingle = 1, iTotal = iSingle, iLinear, - iQuadratic + iQuadratic, + iBiQuadratic }; typedef QList wlist; @@ -143,28 +153,33 @@ public: SMESHGUI_ElemInfo( QWidget* = 0 ); ~SMESHGUI_ElemInfo(); - void setSource( SMESH_Actor* ); + void setSource( SMESH_Actor*, SMESH::SMESH_IDSource_var ); void showInfo( long, bool ); void showInfo( QSet, bool ); void clear(); virtual void saveInfo( QTextStream &out ) = 0; + gp_XYZ getGravityCenter( const SMDS_MeshElement* e ) { return gravityCenter(e); } + protected: struct XYZ { 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; } double y() const { return myY; } double z() const { return myZ; } + operator gp_XYZ() const { return gp_XYZ( myX, myY, myZ ); } }; typedef QMap< int, QList > Connectivity; QWidget* frame() const; SMESH_Actor* actor() const; bool isElements() const; + bool hasShapeToMesh() const { return myMeshHasShape; } virtual void information( const QList& ) = 0; virtual void clearInternal(); @@ -172,6 +187,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 ); @@ -189,6 +205,7 @@ private: QWidget* myFrame; ExtraWidget* myExtra; int myIndex; + bool myMeshHasShape; }; class SMESHGUI_EXPORT SMESHGUI_SimpleElemInfo : public SMESHGUI_ElemInfo @@ -222,13 +239,16 @@ public: 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 ); + void saveExpanded( QTreeWidgetItem* ); private: QTreeWidgetItem* createItem( QTreeWidgetItem* = 0, int = 0 ); + QString expandedResource( QTreeWidgetItem* ); private: QTreeWidget* myInfo; @@ -239,7 +259,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: @@ -248,6 +268,7 @@ public slots: private: SMESH::SMESH_GroupBase_var myGroup; QTreeWidgetItem* myItem; + bool myToComputeSize; }; class SMESHGUI_EXPORT SMESHGUI_AddInfo : public QTreeWidget @@ -303,14 +324,16 @@ private: QwtPlot* createPlot( QWidget* ); void setFontAttributes( QWidget* ); void clearInternal(); - SMESH::long_array_var getElementsByType( SMESH::ElementType theElementType ); - int nbElemsControl( SMESH::long_array_var&, SMESH::Controls::FunctorPtr ); - Plot2d_Histogram* getHistogram( SMESH::long_array_var&, SMESH::Controls::NumericalFunctorPtr ); +#ifndef DISABLE_PLOT2DVIEWER + Plot2d_Histogram* getHistogram( SMESH::NumericalFunctor_ptr functor ); +#endif + void computeNb( int ft, int iBut, int iWdg ); private slots: - void computeFaceInfo(); - void computeVolumeInfo(); + void computeAspectRatio(); + void computeAspectRatio3D(); void computeFreeNodesInfo(); + void computeNodesNbConnInfo(); void computeDoubleNodesInfo(); void computeDoubleEdgesInfo(); void computeDoubleFacesInfo(); @@ -318,9 +341,12 @@ private slots: void computeDoubleVolumesInfo(); void computeOverConstrainedVolumesInfo(); void setTolerance( const double theTolerance ); + private: - SMESH_Actor* myActor; + 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; @@ -328,6 +354,8 @@ private: QwtPlot* myPlot; QwtPlot* myPlot3D; QList myButtons; + QList myPredicates; + TNumFunctor myAspectRatio, myAspectRatio3D, myNodeConnFunctor; }; class SMESHGUI_EXPORT SMESHGUI_MeshInfoDlg : public QDialog @@ -363,19 +391,23 @@ private slots: void deactivate(); void modeChanged(); void idChanged(); + void idPreviewChange(bool); void showItemInfo( int ); void showItemInfo( const QString& ); void dump(); private: - QTabWidget* myTabWidget; - SMESHGUI_MeshInfo* myBaseInfo; - QButtonGroup* myMode; - QLineEdit* myID; - SMESHGUI_ElemInfo* myElemInfo; - SMESHGUI_AddInfo* myAddInfo; - SMESHGUI_CtrlInfo* myCtrlInfo; - SMESH_Actor* myActor; + QTabWidget* myTabWidget; + SMESHGUI_MeshInfo* myBaseInfo; + QButtonGroup* myMode; + QLineEdit* myID; + QCheckBox* myIDPreviewCheck; + SMESHGUI_IdPreview* myIDPreview; + SMESHGUI_ElemInfo* myElemInfo; + SMESHGUI_AddInfo* myAddInfo; + SMESHGUI_CtrlInfo* myCtrlInfo; + SMESH_Actor* myActor; + Handle(SALOME_InteractiveObject) myIO; }; class SMESHGUI_EXPORT SMESHGUI_CtrlInfoDlg : public QDialog @@ -394,6 +426,8 @@ private slots: void activate(); void deactivate(); void updateSelection(); + void help(); + void dump(); private: SMESHGUI_CtrlInfo* myCtrlInfo;