Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
ElmerCSC
GitHub Repository: ElmerCSC/elmerfem
Path: blob/devel/ElmerGUI/Application/src/edfeditor.h
3203 views
1
/*****************************************************************************
2
* *
3
* Elmer, A Finite Element Software for Multiphysical Problems *
4
* *
5
* Copyright 1st April 1995 - , CSC - IT Center for Science Ltd., Finland *
6
* *
7
* This program is free software; you can redistribute it and/or *
8
* modify it under the terms of the GNU General Public License *
9
* as published by the Free Software Foundation; either version 2 *
10
* of the License, or (at your option) any later version. *
11
* *
12
* This program is distributed in the hope that it will be useful, *
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15
* GNU General Public License for more details. *
16
* *
17
* You should have received a copy of the GNU General Public License *
18
* along with this program (in file fem/GPL-2); if not, write to the *
19
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, *
20
* Boston, MA 02110-1301, USA. *
21
* *
22
*****************************************************************************/
23
24
/*****************************************************************************
25
* *
26
* ElmerGUI edfeditor *
27
* *
28
*****************************************************************************
29
* *
30
* Authors: Mikko Lyly, Juha Ruokolainen and Peter Råback *
31
* Email: [email protected] *
32
* Web: http://www.csc.fi/elmer *
33
* Address: CSC - IT Center for Science Ltd. *
34
* Keilaranta 14 *
35
* 02101 Espoo, Finland *
36
* *
37
* Original Date: 15 Mar 2008 *
38
* *
39
*****************************************************************************/
40
41
#ifndef EDFEDITOR_H
42
#define EDFEDITOR_H
43
44
#include <QWidget>
45
#include <QDomDocument>
46
#include <QIcon>
47
#include <QTreeWidget>
48
#include <QHash>
49
#include "dynamiceditor.h"
50
51
class QPushButton;
52
53
class EdfEditor : public QWidget
54
{
55
Q_OBJECT
56
57
public:
58
EdfEditor(QWidget *parent = 0);
59
~EdfEditor();
60
61
QSize minimumSizeHint() const;
62
QSize sizeHint() const;
63
64
void setupEditor(QDomDocument *elmerDefs);
65
bool appendFrom(QString);
66
QString defaultEdfDir();
67
68
signals:
69
70
protected:
71
void keyPressEvent(QKeyEvent*);
72
void keyReleaseEvent(QKeyEvent*);
73
74
private slots:
75
void addButtonClicked();
76
void removeButtonClicked();
77
void expandCollapseAllButtonClicked();
78
void openButtonClicked();
79
void appendButtonClicked();
80
void saveAsButtonClicked();
81
void applyButtonClicked();
82
void previewButtonClicked();
83
84
void treeItemClicked(QTreeWidgetItem*, int);
85
void updateElement(QTreeWidgetItem*, int);
86
87
private:
88
QIcon addIcon;
89
QIcon removeIcon;
90
QIcon collapseIcon;
91
QIcon expandIcon;
92
QIcon openIcon;
93
QIcon appendIcon;
94
QIcon saveAsIcon;
95
QIcon applyIcon;
96
QIcon previewIcon;
97
98
QTreeWidget *edfTree;
99
QPushButton *addButton;
100
QPushButton *removeButton;
101
QPushButton *expandCollapseAllButton;
102
QPushButton *openButton;
103
QPushButton *appendButton;
104
QPushButton *saveAsButton;
105
QPushButton *applyButton;
106
QPushButton *previewButton;
107
108
DynamicEditor *dynamicEditorSimulation;
109
DynamicEditor *dynamicEditorConstants;
110
DynamicEditor *dynamicEditorMaterial;
111
DynamicEditor *dynamicEditorSolver;
112
DynamicEditor *dynamicEditorBC;
113
DynamicEditor *dynamicEditorIC;
114
DynamicEditor *dynamicEditorEquation;
115
DynamicEditor *dynamicEditorBodyForce;
116
117
QDomDocument *elmerDefs;
118
QHash<QTreeWidgetItem*, QDomElement> elementForItem;
119
void insertItemForElement(QDomElement, QTreeWidgetItem*);
120
121
bool expandCollapseAll;
122
QTreeWidgetItem *lastActiveItem;
123
bool ctrlPressed;
124
bool altPressed;
125
126
QString defaultDir;
127
};
128
129
#endif // EDFEDITOR_H
130
131