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( VisuGUI* theModule, QWidget* theParent = 0 );
96 virtual ~VisuGUI_SelectionPanel ();
99 void setSelectionMode( int theId );
102 virtual void onModuleActivated();
103 virtual void onModuleDeactivated();
106 virtual void keyPressEvent( QKeyEvent* theEvent );
107 virtual void showEvent( QShowEvent* theEvent );
108 virtual void closeEvent( QCloseEvent* theEvent );
111 virtual void onApply();
112 virtual void onClose();
113 virtual void onHelp();
115 void onPreferences();
117 void onSelectionModeChanged( int theId );
118 void onSelectionEvent();
119 void onPointIdEdit();
121 void onDoubleClicked( const QModelIndex& theIndex );
123 void onIdChanged( int theFirstId, int theSecondId );
126 void selectionModeChanged( int );
129 VisuGUI_SelectionPrefDlg* preferencesDlg();
132 int column( int theTableId, int theColumnId );
133 QVariant data( int theTableId, int theRow, int theColumnId );
134 void setData( int theTableId, int theRow, int theColumnId, const QVariant& theValue );
135 void setRowSpan( int theTableId, int theRow, int theColumnId, int theRowSpan );
141 QTabWidget* myTabWidget;
142 QWidget* myPointsPane;
143 QWidget* myCellsPane;
145 QLineEdit* myIDValLbl;
146 QStackedWidget* myPointStackedWg;
148 QLineEdit* myCellIDValLbl;
149 QStackedWidget* myCellStackedWg;
151 QMap<int, QTableWidget*> myTables;
153 QWidget* myActorsPane;
161 VisuGUI_GaussPointsSelectionPane* myGaussPointsPane;
163 VisuGUI_FindPane* myFindPane;
165 VisuGUI_SelectionPrefDlg* myPreferencesDlg;
169 QMap< int, QList<int> > myColumnData;