Salome HOME
Update copyrights
[modules/med.git] / src / MEDGUI / MEDGUIDataBaseDockWidget.cxx
1 // Copyright (C) 2007-2019  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
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, or (at your option) any later version.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #include "MEDGUIDataBaseDockWidget.hxx"
21
22 #include "CAM_Application.h"
23 #include "SUIT_ResourceMgr.h"
24
25 #include <QTreeWidget>
26 #include <QHeaderView>
27 #include <QGridLayout>
28
29 MEDGUIDataBaseDockWidget::MEDGUIDataBaseDockWidget(CAM_Application *app, QWidget * parent):QDockWidget(parent),_app(app)
30 {
31   setWindowTitle("MEDUtils DataBase");
32   setObjectName("MEDUtils DataBase");
33   setMinimumWidth(270);
34   setMinimumHeight(300);
35   QWidget *content = new QWidget;
36   setWidget(content);
37   QGridLayout *gridLayout1 = new QGridLayout(content);
38   _tree_widget=new QTreeWidget(content);
39   QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
40   QTreeWidgetItem *item1 = new QTreeWidgetItem;
41   item1->setText(0, QString::fromUtf8("Name"));
42   _tree_widget->setHeaderItem(item1);
43   sizePolicy.setHeightForWidth(_tree_widget->sizePolicy().hasHeightForWidth());
44   _tree_widget->setSizePolicy(sizePolicy);
45   _tree_widget->setMinimumSize(QSize(0, 0));
46   _tree_widget->setSizeIncrement(QSize(0, 0));
47   _tree_widget->header()->setCascadingSectionResizes(true);
48   gridLayout1->addWidget(_tree_widget,0,0,1,1);
49   //
50   QPixmap pixmap;
51   SUIT_ResourceMgr* mgr=_app->resourceMgr();
52   pixmap=mgr->loadPixmap("FIELDS","med_field.png");
53   _fields=new QTreeWidgetItem((QTreeWidget*)0,QStringList(QString("Fields")));
54   _fields->setIcon(0,QIcon(pixmap));
55   _tree_widget->addTopLevelItem(_fields);
56   pixmap=mgr->loadPixmap("FIELDS","med_mesh.png");
57   _meshes=new QTreeWidgetItem((QTreeWidget*)0,QStringList(QString("Meshes")));
58   _meshes->setIcon(0,QIcon(pixmap));
59   _tree_widget->addTopLevelItem(_meshes);
60 }
61
62 void MEDGUIDataBaseDockWidget::appendFieldLT(const std::vector<ParaMEDMEM::MEDCalculatorBrowserLiteStruct>& lts)
63 {
64 }