Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
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