Salome HOME
8855f5de12399804b422b3b578f0322344f6aa90
[modules/med.git] / src / MEDGUI / MEDGUIFileContentDial.h
1 // Copyright (C) 2007-2022  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
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, or (at your option) any later version.
10 //
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.
15 //
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
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 //  MED MEDGUI : MED component GUI implementation
24 //  File   : MEDGUIFileContentDial.h
25 //  Module : MED
26 //
27 #ifndef __MEDGUIFILECONTENTDIAL_H__
28 #define __MEDGUIFILECONTENTDIAL_H__
29
30 #include "MEDCalculatorBrowserLiteStruct.hxx"
31
32 #include <QDialog>
33 #include <QTreeWidgetItem>
34
35 class MEDGUIDataBaseDockWidget;
36
37 namespace Ui
38 {
39   class MEDGUIFileContentDial;
40 }
41
42 class MEDGUIFileContentDial : public QDialog
43 {
44   Q_OBJECT
45     public:
46   MEDGUIFileContentDial(MEDGUIDataBaseDockWidget*, QWidget* = 0);
47   ~MEDGUIFileContentDial();
48   
49  protected:
50   void changeEvent(QEvent *e);
51   void selFromFile(QTreeWidgetItem*, QString);//  Method to set all elements of a MedGUI_LiteStruct to (un)selected according to a string (such as "all", "none", ...)
52   void selFromField(QTreeWidgetItem*, QString);//  Method to set all elements of a MedGUI_Field to (un)selected according to a string (such as "all", "none", ...)
53   void selFromStep(QTreeWidgetItem*,QString);//  Method to set all elements of a MedGUI_Field when selection is made from a MedGUI_Step to (un)selected according to a string (such as "all", "none", ...)
54   
55 public slots:
56   void openFile();//  Create a new MedGUI_LiteStruct from a file and add content to QTreeWidgets
57   void meshesStateChange(QTreeWidgetItem*, int);//  Change the select statement of one or more meshes, the item represents a mesh or a file
58   void fieldsStateChange(QTreeWidgetItem*, int);//  Change the select statement of one or more fields, the item represents a mesh or a field or a step
59   void fieldsStateChanges();
60   void sendSelectionToDB();
61   void unselectAll();//  Unselec all fields and meshes
62   void overfield(QTreeWidgetItem*,int);//  Show in red the corresponding meshes from a field or a step or a field hoovered by mouse
63   void selCompoPopup(bool);//  Show the dialog for selecting components and changing components names
64   void selStepsPopup(bool);//  Show the QLineEdit for selecting steps
65   
66 private:
67   Ui::MEDGUIFileContentDial *ui;
68   MEDGUIDataBaseDockWidget *_db;
69   std::vector<ParaMEDMEM::MEDCalculatorBrowserLiteStruct> litestructs;//  Liste of files (MEdGUI_LiteStruct)
70   std::vector<QTreeWidgetItem*> coloredMeshes;//  Liste of meshes currently colored in red
71 };
72
73 #endif // MEDGUI_FILECONTENTDIAL_HXX