Salome HOME
23416: [CEA 2033] Impossible to re-compute a mesh from an hdf
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_MeshInfo.h
index 54ee1aca5191d91d0e2e8bbd161d55940c04f9a9..4b43e1aa43f323055c18ae4c3d61a0a0c0e5ace0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  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
 #include "SMESH_SMESHGUI.hxx"
 #include "SMESH_ControlsDef.hxx"
 
-#include <Plot2d_Histogram.h>
+#ifndef DISABLE_PLOT2DVIEWER
+  #include <Plot2d_Histogram.h>
+#else
+  #include <qwt_plot.h>
+#endif
 
 #include <QFrame>
 #include <QDialog>
 
 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;
 
@@ -153,16 +159,20 @@ public:
   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<int> > Connectivity;
 
@@ -176,6 +186,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 );
@@ -231,9 +242,11 @@ protected:
 
 private slots:
   void             itemDoubleClicked( QTreeWidgetItem*, int );
+  void             saveExpanded( QTreeWidgetItem* );
   
 private:
   QTreeWidgetItem* createItem( QTreeWidgetItem* = 0, int = 0 );
+  QString          expandedResource( QTreeWidgetItem* );
   
 private:
   QTreeWidget*     myInfo;
@@ -244,7 +257,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:
@@ -253,6 +266,7 @@ public slots:
 private:
   SMESH::SMESH_GroupBase_var myGroup;
   QTreeWidgetItem*           myItem;
+  bool                       myToComputeSize;
 };
 
 class SMESHGUI_EXPORT SMESHGUI_AddInfo : public QTreeWidget
@@ -308,13 +322,16 @@ private:
   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();
@@ -336,7 +353,7 @@ private:
   QwtPlot*                  myPlot3D;
   QList<QAbstractButton*>   myButtons;
   QList<TPredicate>         myPredicates;
-  TNumFunctor               myAspectRatio, myAspectRatio3D;
+  TNumFunctor               myAspectRatio, myAspectRatio3D, myNodeConnFunctor;
 };
 
 class SMESHGUI_EXPORT SMESHGUI_MeshInfoDlg : public QDialog
@@ -372,19 +389,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