Path: blob/devel/ElmerGUI/Application/src/edfeditor.h
3203 views
/*****************************************************************************1* *2* Elmer, A Finite Element Software for Multiphysical Problems *3* *4* Copyright 1st April 1995 - , CSC - IT Center for Science Ltd., Finland *5* *6* This program is free software; you can redistribute it and/or *7* modify it under the terms of the GNU General Public License *8* as published by the Free Software Foundation; either version 2 *9* of the License, or (at your option) any later version. *10* *11* This program 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 *14* GNU General Public License for more details. *15* *16* You should have received a copy of the GNU General Public License *17* along with this program (in file fem/GPL-2); if not, write to the *18* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, *19* Boston, MA 02110-1301, USA. *20* *21*****************************************************************************/2223/*****************************************************************************24* *25* ElmerGUI edfeditor *26* *27*****************************************************************************28* *29* Authors: Mikko Lyly, Juha Ruokolainen and Peter Råback *30* Email: [email protected] *31* Web: http://www.csc.fi/elmer *32* Address: CSC - IT Center for Science Ltd. *33* Keilaranta 14 *34* 02101 Espoo, Finland *35* *36* Original Date: 15 Mar 2008 *37* *38*****************************************************************************/3940#ifndef EDFEDITOR_H41#define EDFEDITOR_H4243#include <QWidget>44#include <QDomDocument>45#include <QIcon>46#include <QTreeWidget>47#include <QHash>48#include "dynamiceditor.h"4950class QPushButton;5152class EdfEditor : public QWidget53{54Q_OBJECT5556public:57EdfEditor(QWidget *parent = 0);58~EdfEditor();5960QSize minimumSizeHint() const;61QSize sizeHint() const;6263void setupEditor(QDomDocument *elmerDefs);64bool appendFrom(QString);65QString defaultEdfDir();6667signals:6869protected:70void keyPressEvent(QKeyEvent*);71void keyReleaseEvent(QKeyEvent*);7273private slots:74void addButtonClicked();75void removeButtonClicked();76void expandCollapseAllButtonClicked();77void openButtonClicked();78void appendButtonClicked();79void saveAsButtonClicked();80void applyButtonClicked();81void previewButtonClicked();8283void treeItemClicked(QTreeWidgetItem*, int);84void updateElement(QTreeWidgetItem*, int);8586private:87QIcon addIcon;88QIcon removeIcon;89QIcon collapseIcon;90QIcon expandIcon;91QIcon openIcon;92QIcon appendIcon;93QIcon saveAsIcon;94QIcon applyIcon;95QIcon previewIcon;9697QTreeWidget *edfTree;98QPushButton *addButton;99QPushButton *removeButton;100QPushButton *expandCollapseAllButton;101QPushButton *openButton;102QPushButton *appendButton;103QPushButton *saveAsButton;104QPushButton *applyButton;105QPushButton *previewButton;106107DynamicEditor *dynamicEditorSimulation;108DynamicEditor *dynamicEditorConstants;109DynamicEditor *dynamicEditorMaterial;110DynamicEditor *dynamicEditorSolver;111DynamicEditor *dynamicEditorBC;112DynamicEditor *dynamicEditorIC;113DynamicEditor *dynamicEditorEquation;114DynamicEditor *dynamicEditorBodyForce;115116QDomDocument *elmerDefs;117QHash<QTreeWidgetItem*, QDomElement> elementForItem;118void insertItemForElement(QDomElement, QTreeWidgetItem*);119120bool expandCollapseAll;121QTreeWidgetItem *lastActiveItem;122bool ctrlPressed;123bool altPressed;124125QString defaultDir;126};127128#endif // EDFEDITOR_H129130131