diff --git a/src/Mod/Fem/Gui/AppFemGui.cpp b/src/Mod/Fem/Gui/AppFemGui.cpp index ab4c580854..fe7a352977 100644 --- a/src/Mod/Fem/Gui/AppFemGui.cpp +++ b/src/Mod/Fem/Gui/AppFemGui.cpp @@ -35,6 +35,7 @@ #include "PropertyFemMeshItem.h" #include "DlgSettingsFemGeneralImp.h" #include "DlgSettingsFemCcxImp.h" +#include "DlgSettingsFemExportAbaqusImp.h" #include "DlgSettingsFemGmshImp.h" #include "DlgSettingsFemZ88Imp.h" #include "ViewProviderFemMesh.h" @@ -157,6 +158,7 @@ PyMOD_INIT_FUNC(FemGui) // register preferences pages new Gui::PrefPageProducer (QT_TRANSLATE_NOOP("QObject","FEM")); new Gui::PrefPageProducer (QT_TRANSLATE_NOOP("QObject","FEM")); + new Gui::PrefPageProducer (QT_TRANSLATE_NOOP("QObject","FEM")); new Gui::PrefPageProducer (QT_TRANSLATE_NOOP("QObject","FEM")); new Gui::PrefPageProducer (QT_TRANSLATE_NOOP("QObject","FEM")); diff --git a/src/Mod/Fem/Gui/CMakeLists.txt b/src/Mod/Fem/Gui/CMakeLists.txt index ddf24d761f..64726ca288 100755 --- a/src/Mod/Fem/Gui/CMakeLists.txt +++ b/src/Mod/Fem/Gui/CMakeLists.txt @@ -42,6 +42,7 @@ SOURCE_GROUP("Python" FILES ${Python_SRCS}) set(FemGui_MOC_HDRS DlgSettingsFemCcxImp.h + DlgSettingsFemExportAbaqusImp.h DlgSettingsFemGeneralImp.h DlgSettingsFemGmshImp.h DlgSettingsFemZ88Imp.h @@ -82,6 +83,7 @@ SOURCE_GROUP("Moc" FILES ${FemGui_MOC_SRCS}) set(FemGui_UIC_SRCS DlgSettingsFemCcx.ui + DlgSettingsFemExportAbaqus.ui DlgSettingsFemGeneral.ui DlgSettingsFemGmsh.ui DlgSettingsFemZ88.ui @@ -132,6 +134,9 @@ SET(FemGui_DLG_SRCS DlgSettingsFemGeneral.ui DlgSettingsFemGeneralImp.cpp DlgSettingsFemGeneralImp.h + DlgSettingsFemExportAbaqus.ui + DlgSettingsFemExportAbaqusImp.cpp + DlgSettingsFemExportAbaqusImp.h DlgSettingsFemGmsh.ui DlgSettingsFemGmshImp.cpp DlgSettingsFemGmshImp.h diff --git a/src/Mod/Fem/Gui/DlgSettingsFemExportAbaqus.ui b/src/Mod/Fem/Gui/DlgSettingsFemExportAbaqus.ui new file mode 100644 index 0000000000..79cb592b18 --- /dev/null +++ b/src/Mod/Fem/Gui/DlgSettingsFemExportAbaqus.ui @@ -0,0 +1,123 @@ + + + FemGui::DlgSettingsFemExportAbaqusImp + + + + 0 + 0 + 445 + 298 + + + + Abaqus INP + + + + + + Qt::Vertical + + + + 20 + 82 + + + + + + + + Export + + + + + + + + + + + false + + + AbaqusWriteGroups + + + Mod/Fem/Abaqus + + + + + + + Export group data + + + + + + + element parameter: All: all elements, highest: highest elements only, FEM: FEM elements only (only edges not belonging to faces and faces not belonging to volumes) + + + + + + element parameter: All: all elements, highest: highest elements only, FEM: FEM elements only (only edges not belonging to faces and faces not belonging to volumes) + + + AbaqusElementChoice + + + Mod/Fem/Abaqus + + + + All + + + + + Highest + + + + + FEM + + + + + + + + Which mesh elements to export + + + + + + + + + + + + + Gui::PrefComboBox + QComboBox +
Gui/PrefWidgets.h
+
+ + Gui::PrefCheckBox + QCheckBox +
Gui/PrefWidgets.h
+
+
+ + +
diff --git a/src/Mod/Fem/Gui/DlgSettingsFemExportAbaqusImp.cpp b/src/Mod/Fem/Gui/DlgSettingsFemExportAbaqusImp.cpp new file mode 100644 index 0000000000..f7e330dd05 --- /dev/null +++ b/src/Mod/Fem/Gui/DlgSettingsFemExportAbaqusImp.cpp @@ -0,0 +1,83 @@ +/************************************************************************** + * Copyright (c) 2017 FreeCAD Developers * + * Author: Bernd Hahnebach * + * Based on src/Mod/Fem/Gui/DlgSettingsFemCcx.cpp * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + + +#include "PreCompiled.h" + +#include "Gui/Application.h" +#include "DlgSettingsFemExportAbaqusImp.h" +#include + +using namespace FemGui; + +DlgSettingsFemExportAbaqusImp::DlgSettingsFemExportAbaqusImp( QWidget* parent ) + : PreferencePage( parent ) +{ + this->setupUi(this); +} + +/* + * Destroys the object and frees any allocated resources + */ +DlgSettingsFemExportAbaqusImp::~DlgSettingsFemExportAbaqusImp() +{ + // no need to delete child widgets, Qt does it all for us +} + +void DlgSettingsFemExportAbaqusImp::saveSettings() +{ + ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath + ("User parameter:BaseApp/Preferences/Mod/Fem/Abaqus"); + hGrp->SetInt("AbaqusElementChoice", comboBoxElemChoiceParam->currentIndex()); + + comboBoxElemChoiceParam->onSave(); + checkBoxWriteGroups->onSave(); +} + +void DlgSettingsFemExportAbaqusImp::loadSettings() +{ + ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath + ("User parameter:BaseApp/Preferences/Mod/Fem/Abaqus"); + hGrp->SetInt("AbaqusElementChoice", comboBoxElemChoiceParam->currentIndex()); + + comboBoxElemChoiceParam->onRestore(); + checkBoxWriteGroups->onRestore(); +} + +/** + * Sets the strings of the subwidgets using the current language. + */ +void DlgSettingsFemExportAbaqusImp::changeEvent(QEvent *e) +{ + if (e->type() == QEvent::LanguageChange) { + int c_index = comboBoxElemChoiceParam->currentIndex(); + retranslateUi(this); + comboBoxElemChoiceParam->setCurrentIndex(c_index); + } + else { + QWidget::changeEvent(e); + } +} + +#include "moc_DlgSettingsFemExportAbaqusImp.cpp" diff --git a/src/Mod/Fem/Gui/DlgSettingsFemExportAbaqusImp.h b/src/Mod/Fem/Gui/DlgSettingsFemExportAbaqusImp.h new file mode 100644 index 0000000000..8a338acfaa --- /dev/null +++ b/src/Mod/Fem/Gui/DlgSettingsFemExportAbaqusImp.h @@ -0,0 +1,50 @@ +/******************b******************************************************** + * Copyright (c) 2017 FreeCAD Developers * + * Author: Bernd Hahnebach * + * Based on src/Mod/Fem/Gui/DlgSettingsFemCcx.h * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + + +#ifndef FEMGUI_DLGSETTINGSFEMEXPORTABAQUSIMP_H +#define FEMGUI_DLGSETTINGSFEMEXPORTABAQUSIMP_H + +#include "ui_DlgSettingsFemExportAbaqus.h" +#include + +namespace FemGui { + +class DlgSettingsFemExportAbaqusImp : public Gui::Dialog::PreferencePage, public Ui_DlgSettingsFemExportAbaqusImp +{ + Q_OBJECT + +public: + DlgSettingsFemExportAbaqusImp( QWidget* parent = 0 ); + ~DlgSettingsFemExportAbaqusImp(); + +protected: + void saveSettings(); + void loadSettings(); + void changeEvent(QEvent *e); +}; + +} // namespace FemGui + +#endif // FEMGUI_DLGSETTINGSFEMEXPORTABAQUSIMP_H