Version: 6.3.1

src/VISUGUI/VisuGUI_SelectionPanel.h

Go to the documentation of this file.
00001 // Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 
00020 //  VISU VISUGUI : GUI of VISU component
00021 //  File   : VisuGUI_SelectionPanel.h
00022 //  Author : Laurent CORNABE & Hubert ROLLAND 
00023 //  Module : VISU
00024 //  $Header: /home/server/cvs/VISU/VISU_SRC/src/VISUGUI/VisuGUI_SelectionPanel.h,v 1.2.2.2.10.1.8.1 2011-06-02 06:00:22 vsr Exp $
00025 //
00026 #ifndef VISUGUI_SELECTIONPANEL_H
00027 #define VISUGUI_SELECTIONPANEL_H
00028 
00029 #include "VisuGUI_Panel.h"
00030 
00031 #include <QMap>
00032 
00033 #include <vtkSystemIncludes.h>
00034 
00035 class QLabel;
00036 class QLineEdit;
00037 class QModelIndex;
00038 class QStackedWidget;
00039 class QTableWidget;
00040 class QTabWidget;
00041 
00042 class VisuGUI_GaussPointsSelectionPane;
00043 class VisuGUI_FindPane;
00044 class VisuGUI_SelectionPrefDlg;
00045 
00046 typedef vtkIdType TPointID;
00047 typedef vtkIdType TCellID;
00048 
00049 struct TValueData
00050 {
00051   QString Scalar;
00052   QString Vector;
00053 };
00054 
00055 struct TPointData
00056 {
00057   vtkFloatingPointType X;
00058   vtkFloatingPointType Y;
00059   vtkFloatingPointType Z;
00060   vtkIdType I;
00061   vtkIdType J;
00062   vtkIdType K;
00063   TValueData ValueData;
00064 };
00065 
00066 typedef QMap<TPointID, TPointData> TPointDataMap;
00067 typedef QMap<TCellID,  TValueData> TCellDataMap;
00068 
00069 struct TCellToPointData
00070 {
00071   TValueData CellData;
00072   TPointDataMap PointDataMap;
00073 };
00074 
00075 struct TPointToCellData
00076 {
00077   TPointData PointData;
00078   TCellDataMap CellDataMap;
00079 };
00080   
00081 typedef QMap<TCellID,  TCellToPointData> TCellToPointDataMap;
00082 typedef QMap<TPointID, TPointToCellData> TPointToCellDataMap;
00083 
00084 class VisuGUI_SelectionPanel: public VisuGUI_Panel
00085 {
00086   Q_OBJECT
00087 
00088   enum MeshType { StdMesh = 0, ElnoMesh };
00089   enum TableId { CellStdCell = 0, CellStdPoint, PointStd, CellElno, PointElno };
00090   enum ColumnId { Cell = 0, Point, X, Y, Z, I, J, K, Scalar, Vector };
00091 
00092 public:
00093   VisuGUI_SelectionPanel( VisuGUI* theModule, QWidget* theParent = 0 );
00094   virtual ~VisuGUI_SelectionPanel ();
00095 
00096 public:
00097   void                      setSelectionMode( int theId );
00098 
00099 protected slots:
00100   virtual void              onModuleActivated();
00101   virtual void              onModuleDeactivated();
00102 
00103 protected:
00104   virtual void              keyPressEvent( QKeyEvent* theEvent );
00105   virtual void              showEvent( QShowEvent* theEvent );
00106   virtual void              closeEvent( QCloseEvent* theEvent );
00107 
00108 private slots:
00109   virtual void              onApply();
00110   virtual void              onClose();
00111   virtual void              onHelp();
00112 
00113   void                      onPreferences();
00114 
00115   void                      onSelectionModeChanged( int theId );
00116   void                      onSelectionEvent();
00117   void                      onPointIdEdit();
00118   void                      onCellIdEdit();
00119   void                      onDoubleClicked( const QModelIndex& theIndex );
00120 
00121   void                      onIdChanged( int theFirstId, int theSecondId );
00122 
00123 signals:
00124   void                      selectionModeChanged( int );
00125 
00126 private:
00127   VisuGUI_SelectionPrefDlg* preferencesDlg();
00128   void                      clearFields();
00129 
00130   int                       column( int theTableId, int theColumnId );
00131   QVariant                  data( int theTableId, int theRow, int theColumnId );
00132   void                      setData( int theTableId, int theRow, int theColumnId, const QVariant& theValue );
00133   void                      setRowSpan( int theTableId, int theRow, int theColumnId, int theRowSpan );
00134 
00135 private:
00136   QLabel*                   myMeshName;
00137   QLabel*                   myFieldName;
00138 
00139   QTabWidget*               myTabWidget;
00140   QWidget*                  myPointsPane;
00141   QWidget*                  myCellsPane;
00142 
00143   QLineEdit*                myIDValLbl;
00144   QStackedWidget*           myPointStackedWg;
00145 
00146   QLineEdit*                myCellIDValLbl;
00147   QStackedWidget*           myCellStackedWg;
00148 
00149   QMap<int, QTableWidget*>  myTables;
00150 
00151   QWidget*                  myActorsPane;
00152   QLabel*                   myXPosLbl;
00153   QLabel*                   myYPosLbl;
00154   QLabel*                   myZPosLbl;
00155   QLabel*                   myDXLbl;
00156   QLabel*                   myDYLbl;
00157   QLabel*                   myDZLbl;
00158 
00159   VisuGUI_GaussPointsSelectionPane* myGaussPointsPane;
00160 
00161   VisuGUI_FindPane*         myFindPane;
00162 
00163   VisuGUI_SelectionPrefDlg* myPreferencesDlg;
00164 
00165   bool                      myFl;
00166 
00167   QMap< int, QList<int> >   myColumnData;
00168 };
00169 
00170 #endif
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS