1 // Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // VISU VISUGUI : GUI of VISU component
21 // File : VisuGUI_SelectionPanel.h
22 // Author : Laurent CORNABE & Hubert ROLLAND
26 #ifndef VISUGUI_SELECTIONPANEL_H
27 #define VISUGUI_SELECTIONPANEL_H
29 #include "VisuGUI_Panel.h"
33 #include <vtkSystemIncludes.h>
42 class VisuGUI_GaussPointsSelectionPane;
43 class VisuGUI_FindPane;
44 class VisuGUI_SelectionPrefDlg;
46 typedef vtkIdType TPointID;
47 typedef vtkIdType TCellID;
57 vtkFloatingPointType X;
58 vtkFloatingPointType Y;
59 vtkFloatingPointType Z;
66 typedef QMap<TPointID, TPointData> TPointDataMap;
67 typedef QMap<TCellID, TValueData> TCellDataMap;
69 struct TCellToPointData
72 TPointDataMap PointDataMap;
75 struct TPointToCellData
78 TCellDataMap CellDataMap;
81 typedef QMap<TCellID, TCellToPointData> TCellToPointDataMap;
82 typedef QMap<TPointID, TPointToCellData> TPointToCellDataMap;
84 class VisuGUI_SelectionPanel: public VisuGUI_Panel
88 enum MeshType { StdMesh = 0, ElnoMesh };
89 enum TableId { CellStdCell = 0, CellStdPoint, PointStd, CellElno, PointElno };
90 enum ColumnId { Cell = 0, Point, X, Y, Z, I, J, K, Scalar, Vector };
93 VisuGUI_SelectionPanel( VisuGUI* theModule, QWidget* theParent = 0 );
94 virtual ~VisuGUI_SelectionPanel ();
97 void setSelectionMode( int theId );
100 virtual void onModuleActivated();
101 virtual void onModuleDeactivated();
104 virtual void keyPressEvent( QKeyEvent* theEvent );
105 virtual void showEvent( QShowEvent* theEvent );
106 virtual void closeEvent( QCloseEvent* theEvent );
109 virtual void onApply();
110 virtual void onClose();
111 virtual void onHelp();
113 void onPreferences();
115 void onSelectionModeChanged( int theId );
116 void onSelectionEvent();
117 void onPointIdEdit();
119 void onDoubleClicked( const QModelIndex& theIndex );
121 void onIdChanged( int theFirstId, int theSecondId );
124 void selectionModeChanged( int );
127 VisuGUI_SelectionPrefDlg* preferencesDlg();
130 int column( int theTableId, int theColumnId );
131 QVariant data( int theTableId, int theRow, int theColumnId );
132 void setData( int theTableId, int theRow, int theColumnId, const QVariant& theValue );
133 void setRowSpan( int theTableId, int theRow, int theColumnId, int theRowSpan );
139 QTabWidget* myTabWidget;
140 QWidget* myPointsPane;
141 QWidget* myCellsPane;
143 QLineEdit* myIDValLbl;
144 QStackedWidget* myPointStackedWg;
146 QLineEdit* myCellIDValLbl;
147 QStackedWidget* myCellStackedWg;
149 QMap<int, QTableWidget*> myTables;
151 QWidget* myActorsPane;
159 VisuGUI_GaussPointsSelectionPane* myGaussPointsPane;
161 VisuGUI_FindPane* myFindPane;
163 VisuGUI_SelectionPrefDlg* myPreferencesDlg;
167 QMap< int, QList<int> > myColumnData;