1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // VISU VISUGUI : GUI of VISU component
23 // File : VisuGUI_SelectionPanel.h
24 // Author : Laurent CORNABE & Hubert ROLLAND
28 #ifndef VISUGUI_SELECTIONPANEL_H
29 #define VISUGUI_SELECTIONPANEL_H
31 #include "VisuGUI_Panel.h"
35 #include <vtkSystemIncludes.h>
44 class VisuGUI_GaussPointsSelectionPane;
45 class VisuGUI_FindPane;
46 class VisuGUI_SelectionPrefDlg;
48 typedef vtkIdType TPointID;
49 typedef vtkIdType TCellID;
59 vtkFloatingPointType X;
60 vtkFloatingPointType Y;
61 vtkFloatingPointType Z;
68 typedef QMap<TPointID, TPointData> TPointDataMap;
69 typedef QMap<TCellID, TValueData> TCellDataMap;
71 struct TCellToPointData
74 TPointDataMap PointDataMap;
77 struct TPointToCellData
80 TCellDataMap CellDataMap;
83 typedef QMap<TCellID, TCellToPointData> TCellToPointDataMap;
84 typedef QMap<TPointID, TPointToCellData> TPointToCellDataMap;
86 class VisuGUI_SelectionPanel: public VisuGUI_Panel
90 enum MeshType { StdMesh = 0, ElnoMesh };
91 enum TableId { CellStdCell = 0, CellStdPoint, PointStd, CellElno, PointElno };
92 enum ColumnId { Cell = 0, Point, X, Y, Z, I, J, K, Scalar, Vector };
95 VisuGUI_SelectionPanel( const VisuGUI* theModule, QWidget* theParent = 0 );
96 virtual ~VisuGUI_SelectionPanel ();
99 void setSelectionMode( int theId );
102 virtual void keyPressEvent( QKeyEvent* theEvent );
103 virtual void showEvent( QShowEvent* theEvent );
104 virtual void closeEvent( QCloseEvent* theEvent );
107 virtual void onApply();
108 virtual void onClose();
109 virtual void onHelp();
111 void onPreferences();
113 void onSelectionModeChanged( int theId );
114 void onSelectionEvent();
115 void onPointIdEdit();
117 void onDoubleClicked( const QModelIndex& theIndex );
119 void onIdChanged( int theFirstId, int theSecondId );
122 void selectionModeChanged( int );
125 VisuGUI_SelectionPrefDlg* preferencesDlg();
128 int column( int theTableId, int theColumnId );
129 QVariant data( int theTableId, int theRow, int theColumnId );
130 void setData( int theTableId, int theRow, int theColumnId, const QVariant& theValue );
131 void setRowSpan( int theTableId, int theRow, int theColumnId, int theRowSpan );
137 QTabWidget* myTabWidget;
138 QWidget* myPointsPane;
139 QWidget* myCellsPane;
141 QLineEdit* myIDValLbl;
142 QStackedWidget* myPointStackedWg;
144 QLineEdit* myCellIDValLbl;
145 QStackedWidget* myCellStackedWg;
147 QMap<int, QTableWidget*> myTables;
149 QWidget* myActorsPane;
157 VisuGUI_GaussPointsSelectionPane* myGaussPointsPane;
159 VisuGUI_FindPane* myFindPane;
161 VisuGUI_SelectionPrefDlg* myPreferencesDlg;
165 QMap< int, QList<int> > myColumnData;