Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
ElmerCSC
GitHub Repository: ElmerCSC/elmerfem
Path: blob/devel/ElmerGUI/Application/src/objectbrowser.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 objectbrowser.h *
27
* *
28
*****************************************************************************
29
* *
30
* Author: Saeki Takayuki *
31
* Original Date: 11 Jan 2020 *
32
* *
33
*****************************************************************************/
34
35
#ifndef OBJECTBROWSER_H
36
#define OBJECTBROWSER_H
37
38
#if WITH_QT6
39
#include <QtWidgets>
40
#endif
41
#include <QWidget>
42
#include "projectio.h"
43
#include "dynamiceditor.h"
44
#include "glwidget.h"
45
#include "boundarypropertyeditor.h"
46
47
48
class ObjectBrowser : public QDockWidget
49
{
50
Q_OBJECT
51
52
//signals:
53
54
public:
55
ObjectBrowser(QMainWindow *parent, Qt::WindowFlags flags=Qt::Widget);
56
~ObjectBrowser();
57
58
//public slots:
59
60
private slots:
61
void modelSetupSlot();
62
void addEquationSlot();
63
void addMaterialSlot();
64
void addBodyForceSlot();
65
void addInitialConditionSlot();
66
void addBoundaryConditionSlot();
67
void equationSelectedSlot(QAction*);
68
void materialSelectedSlot(QAction*);
69
void bodyForceSelectedSlot(QAction*);
70
void initialConditionSelectedSlot(QAction*);
71
void boundaryConditionSelectedSlot(QAction*);
72
void equationEditorFinishedSlot(int signal, int id);
73
void materialEditorFinishedSlot(int signal, int id);
74
void bodyForceEditorFinishedSlot(int signal, int id);
75
void initialConditionEditorFinishedSlot(int signal, int id);
76
void boundaryConditionEditorFinishedSlot(int signal, int id);
77
void treeItemClickedSlot(QTreeWidgetItem *item, int column);
78
void treeItemDoubleClickedSlot(QTreeWidgetItem *item, int column);
79
void treeItemExpandedSlot(QTreeWidgetItem* item);
80
void treeItemSelectionChangedSlot();
81
82
void openSlot();
83
void loadSlot();
84
void loadProjectSlot();
85
void saveProjectSlot();
86
void newProjectSlot();
87
void modelClearSlot();
88
89
void viewFullScreenSlot();
90
void viewNormalModeSlot();
91
92
void boundaryDividedSlot(double);
93
void boundaryUnifiedSlot();
94
95
void boundarySelectedSlot(list_t*, Qt::KeyboardModifiers);
96
97
void boundaryComboChanged(BoundaryPropertyEditor *,QString);
98
void bodyComboChanged(BodyPropertyEditor *,QString);
99
void bodyPropertyEditorAccepted(bool);
100
void bodyPropertyEditorDiscarded(bool);
101
void boundaryPropertyEditorAccepted(bool);
102
void boundaryPropertyEditorDiscarded(bool);
103
void bodyCheckBoxChangedSlot(int);
104
void boundaryCheckBoxChangedSlot(int);
105
106
void focusChangedSlot(QWidget*, QWidget*);
107
108
void meshingStartedSlot();
109
void meshingTerminatedSlot();
110
void meshingFinishedSlot();
111
112
private:
113
QMainWindow *mainWindow;
114
QTreeWidget *tree;
115
116
QTreeWidgetItem *geometryTopLevelTreeItem;
117
QTreeWidgetItem *modelTopLevelTreeItem;
118
QTreeWidgetItem *bodyPropertyParentTreeItem;
119
QTreeWidgetItem *boundaryPropertyParentTreeItem;
120
QTreeWidgetItem *geometryParentTreeItem;
121
QTreeWidgetItem *setupParentTreeItem;
122
QTreeWidgetItem *equationParentTreeItem;
123
QTreeWidgetItem *materialParentTreeItem;
124
QTreeWidgetItem *bodyForceParentTreeItem;
125
QTreeWidgetItem *initialConditionParentTreeItem;
126
QTreeWidgetItem *boundaryConditionParentTreeItem;
127
void addToTree(DynamicEditor*, bool select = false);
128
void updateBoundaryProperties(BoundaryPropertyEditor* selectThis = NULL);
129
void updateBodyProperties(BodyPropertyEditor* selectThis = NULL);
130
void updateEquation();
131
void updateMaterial();
132
void updateBodyForce();
133
void updateInitialCondition();
134
void updateBoundaryCondition();
135
void snap(QWidget*);
136
void selectTreeItemByID(QTreeWidgetItem* parent, int id);
137
138
int boundaryListToBodyIndex(list_t*);
139
list_t* selectBoundary(BoundaryPropertyEditor *pe, bool append = false, bool select = true);
140
list_t* selectBody(BodyPropertyEditor *pe, bool append = false, bool select = true);
141
list_t* boundaryList(int index);
142
list_t* bodyList(int index);
143
144
bool connect1(const QObject * sender, const char * signal, const QObject * receiver, const char * method, Qt::ConnectionType type = Qt::AutoConnection);
145
};
146
147
#endif // OBJECTBROWSER_H
148
149