Path: blob/devel/ElmerGUI/Application/src/objectbrowser.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 objectbrowser.h *26* *27*****************************************************************************28* *29* Author: Saeki Takayuki *30* Original Date: 11 Jan 2020 *31* *32*****************************************************************************/3334#ifndef OBJECTBROWSER_H35#define OBJECTBROWSER_H3637#if WITH_QT638#include <QtWidgets>39#endif40#include <QWidget>41#include "projectio.h"42#include "dynamiceditor.h"43#include "glwidget.h"44#include "boundarypropertyeditor.h"454647class ObjectBrowser : public QDockWidget48{49Q_OBJECT5051//signals:5253public:54ObjectBrowser(QMainWindow *parent, Qt::WindowFlags flags=Qt::Widget);55~ObjectBrowser();5657//public slots:5859private slots:60void modelSetupSlot();61void addEquationSlot();62void addMaterialSlot();63void addBodyForceSlot();64void addInitialConditionSlot();65void addBoundaryConditionSlot();66void equationSelectedSlot(QAction*);67void materialSelectedSlot(QAction*);68void bodyForceSelectedSlot(QAction*);69void initialConditionSelectedSlot(QAction*);70void boundaryConditionSelectedSlot(QAction*);71void equationEditorFinishedSlot(int signal, int id);72void materialEditorFinishedSlot(int signal, int id);73void bodyForceEditorFinishedSlot(int signal, int id);74void initialConditionEditorFinishedSlot(int signal, int id);75void boundaryConditionEditorFinishedSlot(int signal, int id);76void treeItemClickedSlot(QTreeWidgetItem *item, int column);77void treeItemDoubleClickedSlot(QTreeWidgetItem *item, int column);78void treeItemExpandedSlot(QTreeWidgetItem* item);79void treeItemSelectionChangedSlot();8081void openSlot();82void loadSlot();83void loadProjectSlot();84void saveProjectSlot();85void newProjectSlot();86void modelClearSlot();8788void viewFullScreenSlot();89void viewNormalModeSlot();9091void boundaryDividedSlot(double);92void boundaryUnifiedSlot();9394void boundarySelectedSlot(list_t*, Qt::KeyboardModifiers);9596void boundaryComboChanged(BoundaryPropertyEditor *,QString);97void bodyComboChanged(BodyPropertyEditor *,QString);98void bodyPropertyEditorAccepted(bool);99void bodyPropertyEditorDiscarded(bool);100void boundaryPropertyEditorAccepted(bool);101void boundaryPropertyEditorDiscarded(bool);102void bodyCheckBoxChangedSlot(int);103void boundaryCheckBoxChangedSlot(int);104105void focusChangedSlot(QWidget*, QWidget*);106107void meshingStartedSlot();108void meshingTerminatedSlot();109void meshingFinishedSlot();110111private:112QMainWindow *mainWindow;113QTreeWidget *tree;114115QTreeWidgetItem *geometryTopLevelTreeItem;116QTreeWidgetItem *modelTopLevelTreeItem;117QTreeWidgetItem *bodyPropertyParentTreeItem;118QTreeWidgetItem *boundaryPropertyParentTreeItem;119QTreeWidgetItem *geometryParentTreeItem;120QTreeWidgetItem *setupParentTreeItem;121QTreeWidgetItem *equationParentTreeItem;122QTreeWidgetItem *materialParentTreeItem;123QTreeWidgetItem *bodyForceParentTreeItem;124QTreeWidgetItem *initialConditionParentTreeItem;125QTreeWidgetItem *boundaryConditionParentTreeItem;126void addToTree(DynamicEditor*, bool select = false);127void updateBoundaryProperties(BoundaryPropertyEditor* selectThis = NULL);128void updateBodyProperties(BodyPropertyEditor* selectThis = NULL);129void updateEquation();130void updateMaterial();131void updateBodyForce();132void updateInitialCondition();133void updateBoundaryCondition();134void snap(QWidget*);135void selectTreeItemByID(QTreeWidgetItem* parent, int id);136137int boundaryListToBodyIndex(list_t*);138list_t* selectBoundary(BoundaryPropertyEditor *pe, bool append = false, bool select = true);139list_t* selectBody(BodyPropertyEditor *pe, bool append = false, bool select = true);140list_t* boundaryList(int index);141list_t* bodyList(int index);142143bool connect1(const QObject * sender, const char * signal, const QObject * receiver, const char * method, Qt::ConnectionType type = Qt::AutoConnection);144};145146#endif // OBJECTBROWSER_H147148149