FEM: Abaqus writer, pref GUI for element and group export parameter
This commit is contained in:
committed by
Yorik van Havre
parent
b7ea89b65c
commit
1bf52f4686
@@ -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<FemGui::DlgSettingsFemGeneralImp> (QT_TRANSLATE_NOOP("QObject","FEM"));
|
||||
new Gui::PrefPageProducer<FemGui::DlgSettingsFemCcxImp> (QT_TRANSLATE_NOOP("QObject","FEM"));
|
||||
new Gui::PrefPageProducer<FemGui::DlgSettingsFemExportAbaqusImp> (QT_TRANSLATE_NOOP("QObject","FEM"));
|
||||
new Gui::PrefPageProducer<FemGui::DlgSettingsFemGmshImp> (QT_TRANSLATE_NOOP("QObject","FEM"));
|
||||
new Gui::PrefPageProducer<FemGui::DlgSettingsFemZ88Imp> (QT_TRANSLATE_NOOP("QObject","FEM"));
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
123
src/Mod/Fem/Gui/DlgSettingsFemExportAbaqus.ui
Normal file
123
src/Mod/Fem/Gui/DlgSettingsFemExportAbaqus.ui
Normal file
@@ -0,0 +1,123 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>FemGui::DlgSettingsFemExportAbaqusImp</class>
|
||||
<widget class="QWidget" name="FemGui::DlgSettingsFemExportAbaqusImp">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>445</width>
|
||||
<height>298</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Abaqus INP</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="1" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>82</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Export</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="1">
|
||||
<layout class="QGridLayout" name="girdLayoutAbaqus">
|
||||
<item row="1" column="1">
|
||||
<widget class="Gui::PrefCheckBox" name="checkBoxWriteGroups">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>AbaqusWriteGroups</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/Fem/Abaqus</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label2">
|
||||
<property name="text">
|
||||
<string>Export group data</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="Gui::PrefComboBox" name="comboBoxElemChoiceParam">
|
||||
<property name="toolTip">
|
||||
<string>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)</string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>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)</string>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<string>AbaqusElementChoice</string>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<string>Mod/Fem/Abaqus</string>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>All</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Highest</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>FEM</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label1">
|
||||
<property name="text">
|
||||
<string>Which mesh elements to export</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>Gui::PrefComboBox</class>
|
||||
<extends>QComboBox</extends>
|
||||
<header>Gui/PrefWidgets.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>Gui::PrefCheckBox</class>
|
||||
<extends>QCheckBox</extends>
|
||||
<header>Gui/PrefWidgets.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
83
src/Mod/Fem/Gui/DlgSettingsFemExportAbaqusImp.cpp
Normal file
83
src/Mod/Fem/Gui/DlgSettingsFemExportAbaqusImp.cpp
Normal file
@@ -0,0 +1,83 @@
|
||||
/**************************************************************************
|
||||
* Copyright (c) 2017 FreeCAD Developers *
|
||||
* Author: Bernd Hahnebach <bernd@bimstatik.ch> *
|
||||
* 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 <Gui/PrefWidgets.h>
|
||||
|
||||
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"
|
||||
50
src/Mod/Fem/Gui/DlgSettingsFemExportAbaqusImp.h
Normal file
50
src/Mod/Fem/Gui/DlgSettingsFemExportAbaqusImp.h
Normal file
@@ -0,0 +1,50 @@
|
||||
/******************b********************************************************
|
||||
* Copyright (c) 2017 FreeCAD Developers *
|
||||
* Author: Bernd Hahnebach <bernd@bimstatik.ch> *
|
||||
* 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 <Gui/PropertyPage.h>
|
||||
|
||||
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
|
||||
Reference in New Issue
Block a user