diff --git a/src/Mod/Fem/Gui/AppFemGui.cpp b/src/Mod/Fem/Gui/AppFemGui.cpp index 5dd9d54282..ab4c580854 100644 --- a/src/Mod/Fem/Gui/AppFemGui.cpp +++ b/src/Mod/Fem/Gui/AppFemGui.cpp @@ -1,167 +1,167 @@ -/*************************************************************************** - * Copyright (c) 2008 Jürgen Riegel (juergen.riegel@web.de) * - * * - * 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" -#ifndef _PreComp_ -# include -# include -#endif - -#include -#include -#include -#include -#include -#include "PropertyFemMeshItem.h" -#include "DlgSettingsFemGeneralImp.h" -#include "DlgSettingsFemCcxImp.h" -#include "DlgSettingsFemGmshImp.h" -#include "DlgSettingsFemZ88Imp.h" -#include "ViewProviderFemMesh.h" -#include "ViewProviderFemMeshShape.h" -#include "ViewProviderFemMeshShapeNetgen.h" -#include "ViewProviderAnalysis.h" -#include "ViewProviderSolver.h" -#include "ViewProviderSetNodes.h" -#include "ViewProviderSetElements.h" -#include "ViewProviderSetFaces.h" -#include "ViewProviderSetGeometry.h" -#include "ViewProviderFemConstraint.h" -#include "ViewProviderFemConstraintBearing.h" -#include "ViewProviderFemConstraintFixed.h" -#include "ViewProviderFemConstraintForce.h" -#include "ViewProviderFemConstraintFluidBoundary.h" -#include "ViewProviderFemConstraintPressure.h" -#include "ViewProviderFemConstraintGear.h" -#include "ViewProviderFemConstraintPulley.h" -#include "ViewProviderFemConstraintDisplacement.h" -#include "ViewProviderFemConstraintTemperature.h" -#include "ViewProviderFemConstraintHeatflux.h" -#include "ViewProviderFemConstraintInitialTemperature.h" -#include "ViewProviderFemConstraintPlaneRotation.h" -#include "ViewProviderFemConstraintContact.h" -#include "ViewProviderFemConstraintTransform.h" -#include "ViewProviderResult.h" -#include "Workbench.h" - -#ifdef FC_USE_VTK -#include "ViewProviderFemPostObject.h" -#include "ViewProviderFemPostPipeline.h" -#include "ViewProviderFemPostFunction.h" -#include "ViewProviderFemPostFilter.h" -#endif - -#ifdef FC_USE_VTK -#include "ViewProviderFemPostObject.h" -#endif - - -// use a different name to CreateCommand() -void CreateFemCommands(void); - -void loadFemResource() -{ - // add resources and reloads the translators - Q_INIT_RESOURCE(Fem); - Gui::Translator::instance()->refresh(); -} - -namespace FemGui { -extern PyObject* initModule(); -} - - -/* Python entry */ -PyMOD_INIT_FUNC(FemGui) -{ - if (!Gui::Application::Instance) { - PyErr_SetString(PyExc_ImportError, "Cannot load Gui module in console application."); - PyMOD_Return(0); - } - - PyObject* mod = FemGui::initModule(); - Base::Console().Log("Loading GUI of Fem module... done\n"); - - // instantiating the commands - CreateFemCommands(); - - // addition objects - FemGui::Workbench ::init(); - FemGui::ViewProviderFemAnalysis ::init(); - FemGui::ViewProviderFemAnalysisPython ::init(); - FemGui::ViewProviderFemMesh ::init(); - FemGui::ViewProviderFemMeshPython ::init(); - FemGui::ViewProviderFemMeshShape ::init(); - FemGui::ViewProviderFemMeshShapeNetgen ::init(); - FemGui::ViewProviderSolver ::init(); - FemGui::ViewProviderSolverPython ::init(); - FemGui::ViewProviderSetNodes ::init(); - FemGui::ViewProviderSetElements ::init(); - FemGui::ViewProviderSetFaces ::init(); - FemGui::ViewProviderSetGeometry ::init(); - FemGui::ViewProviderFemConstraint ::init(); - FemGui::ViewProviderFemConstraintPython ::init(); - FemGui::ViewProviderFemConstraintBearing ::init(); - FemGui::ViewProviderFemConstraintFixed ::init(); - FemGui::ViewProviderFemConstraintForce ::init(); - FemGui::ViewProviderFemConstraintFluidBoundary ::init(); - FemGui::ViewProviderFemConstraintPressure ::init(); - FemGui::ViewProviderFemConstraintGear ::init(); - FemGui::ViewProviderFemConstraintPulley ::init(); - FemGui::ViewProviderFemConstraintDisplacement ::init(); - FemGui::ViewProviderFemConstraintHeatflux ::init(); - FemGui::ViewProviderFemConstraintTemperature ::init(); - FemGui::ViewProviderFemConstraintInitialTemperature ::init(); - FemGui::ViewProviderFemConstraintPlaneRotation::init(); - FemGui::ViewProviderFemConstraintContact ::init(); - FemGui::ViewProviderFemConstraintTransform ::init(); - FemGui::ViewProviderResult ::init(); - FemGui::ViewProviderResultPython ::init(); - FemGui::PropertyFemMeshItem ::init(); - -#ifdef FC_USE_VTK - FemGui::ViewProviderFemPostObject ::init(); - FemGui::ViewProviderFemPostPipeline ::init(); - FemGui::ViewProviderFemPostFunction ::init(); - FemGui::ViewProviderFemPostFunctionProvider::init(); - FemGui::ViewProviderFemPostPlaneFunction ::init(); - FemGui::ViewProviderFemPostSphereFunction ::init(); - FemGui::ViewProviderFemPostClip ::init(); - FemGui::ViewProviderFemPostDataAlongLine ::init(); - FemGui::ViewProviderFemPostScalarClip ::init(); - FemGui::ViewProviderFemPostWarpVector ::init(); - FemGui::ViewProviderFemPostCut ::init(); -#endif - - - // 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")); - - // add resources and reloads the translators - loadFemResource(); - - PyMOD_Return(mod); -} +/*************************************************************************** + * Copyright (c) 2008 Jürgen Riegel (juergen.riegel@web.de) * + * * + * 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" +#ifndef _PreComp_ +# include +# include +#endif + +#include +#include +#include +#include +#include +#include "PropertyFemMeshItem.h" +#include "DlgSettingsFemGeneralImp.h" +#include "DlgSettingsFemCcxImp.h" +#include "DlgSettingsFemGmshImp.h" +#include "DlgSettingsFemZ88Imp.h" +#include "ViewProviderFemMesh.h" +#include "ViewProviderFemMeshShape.h" +#include "ViewProviderFemMeshShapeNetgen.h" +#include "ViewProviderAnalysis.h" +#include "ViewProviderSolver.h" +#include "ViewProviderSetNodes.h" +#include "ViewProviderSetElements.h" +#include "ViewProviderSetFaces.h" +#include "ViewProviderSetGeometry.h" +#include "ViewProviderFemConstraint.h" +#include "ViewProviderFemConstraintBearing.h" +#include "ViewProviderFemConstraintFixed.h" +#include "ViewProviderFemConstraintForce.h" +#include "ViewProviderFemConstraintFluidBoundary.h" +#include "ViewProviderFemConstraintPressure.h" +#include "ViewProviderFemConstraintGear.h" +#include "ViewProviderFemConstraintPulley.h" +#include "ViewProviderFemConstraintDisplacement.h" +#include "ViewProviderFemConstraintTemperature.h" +#include "ViewProviderFemConstraintHeatflux.h" +#include "ViewProviderFemConstraintInitialTemperature.h" +#include "ViewProviderFemConstraintPlaneRotation.h" +#include "ViewProviderFemConstraintContact.h" +#include "ViewProviderFemConstraintTransform.h" +#include "ViewProviderResult.h" +#include "Workbench.h" + +#ifdef FC_USE_VTK +#include "ViewProviderFemPostObject.h" +#include "ViewProviderFemPostPipeline.h" +#include "ViewProviderFemPostFunction.h" +#include "ViewProviderFemPostFilter.h" +#endif + +#ifdef FC_USE_VTK +#include "ViewProviderFemPostObject.h" +#endif + + +// use a different name to CreateCommand() +void CreateFemCommands(void); + +void loadFemResource() +{ + // add resources and reloads the translators + Q_INIT_RESOURCE(Fem); + Gui::Translator::instance()->refresh(); +} + +namespace FemGui { +extern PyObject* initModule(); +} + + +/* Python entry */ +PyMOD_INIT_FUNC(FemGui) +{ + if (!Gui::Application::Instance) { + PyErr_SetString(PyExc_ImportError, "Cannot load Gui module in console application."); + PyMOD_Return(0); + } + + PyObject* mod = FemGui::initModule(); + Base::Console().Log("Loading GUI of Fem module... done\n"); + + // instantiating the commands + CreateFemCommands(); + + // addition objects + FemGui::Workbench ::init(); + FemGui::ViewProviderFemAnalysis ::init(); + FemGui::ViewProviderFemAnalysisPython ::init(); + FemGui::ViewProviderFemMesh ::init(); + FemGui::ViewProviderFemMeshPython ::init(); + FemGui::ViewProviderFemMeshShape ::init(); + FemGui::ViewProviderFemMeshShapeNetgen ::init(); + FemGui::ViewProviderSolver ::init(); + FemGui::ViewProviderSolverPython ::init(); + FemGui::ViewProviderSetNodes ::init(); + FemGui::ViewProviderSetElements ::init(); + FemGui::ViewProviderSetFaces ::init(); + FemGui::ViewProviderSetGeometry ::init(); + FemGui::ViewProviderFemConstraint ::init(); + FemGui::ViewProviderFemConstraintPython ::init(); + FemGui::ViewProviderFemConstraintBearing ::init(); + FemGui::ViewProviderFemConstraintFixed ::init(); + FemGui::ViewProviderFemConstraintForce ::init(); + FemGui::ViewProviderFemConstraintFluidBoundary ::init(); + FemGui::ViewProviderFemConstraintPressure ::init(); + FemGui::ViewProviderFemConstraintGear ::init(); + FemGui::ViewProviderFemConstraintPulley ::init(); + FemGui::ViewProviderFemConstraintDisplacement ::init(); + FemGui::ViewProviderFemConstraintHeatflux ::init(); + FemGui::ViewProviderFemConstraintTemperature ::init(); + FemGui::ViewProviderFemConstraintInitialTemperature ::init(); + FemGui::ViewProviderFemConstraintPlaneRotation::init(); + FemGui::ViewProviderFemConstraintContact ::init(); + FemGui::ViewProviderFemConstraintTransform ::init(); + FemGui::ViewProviderResult ::init(); + FemGui::ViewProviderResultPython ::init(); + FemGui::PropertyFemMeshItem ::init(); + +#ifdef FC_USE_VTK + FemGui::ViewProviderFemPostObject ::init(); + FemGui::ViewProviderFemPostPipeline ::init(); + FemGui::ViewProviderFemPostFunction ::init(); + FemGui::ViewProviderFemPostFunctionProvider::init(); + FemGui::ViewProviderFemPostPlaneFunction ::init(); + FemGui::ViewProviderFemPostSphereFunction ::init(); + FemGui::ViewProviderFemPostClip ::init(); + FemGui::ViewProviderFemPostDataAlongLine ::init(); + FemGui::ViewProviderFemPostScalarClip ::init(); + FemGui::ViewProviderFemPostWarpVector ::init(); + FemGui::ViewProviderFemPostCut ::init(); +#endif + + + // 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")); + + // add resources and reloads the translators + loadFemResource(); + + PyMOD_Return(mod); +} diff --git a/src/Mod/Fem/Gui/Workbench.cpp b/src/Mod/Fem/Gui/Workbench.cpp index 0b62696629..0cdc8fd903 100755 --- a/src/Mod/Fem/Gui/Workbench.cpp +++ b/src/Mod/Fem/Gui/Workbench.cpp @@ -1,228 +1,228 @@ -/*************************************************************************** - * Copyright (c) 2008 Werner Mayer * - * * - * 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" - -#ifndef _PreComp_ -# include -#endif - -#include "Workbench.h" -#include -#include - - -using namespace FemGui; - -#if 0 // needed for Qt's lupdate utility - qApp->translate("Workbench", "FEM"); - qApp->translate("Workbench", "&FEM"); -#endif - -/// @namespace FemGui @class Workbench -TYPESYSTEM_SOURCE(FemGui::Workbench, Gui::StdWorkbench) - -Workbench::Workbench() -{ -} - -Workbench::~Workbench() -{ -} - -void Workbench::setupContextMenu(const char* recipient, Gui::MenuItem* item) const -{ - StdWorkbench::setupContextMenu( recipient, item ); - *item << "Separator" - << "FEM_MeshClear" - << "FEM_MeshPrintInfo"; -} - -Gui::ToolBarItem* Workbench::setupToolBars() const -{ - Gui::ToolBarItem* root = StdWorkbench::setupToolBars(); - Gui::ToolBarItem* model = new Gui::ToolBarItem(root); - model->setCommand("Model"); - *model << "FEM_Analysis" - << "Separator" - << "FEM_MaterialSolid" - << "FEM_MaterialFluid" - << "FEM_MaterialMechanicalNonlinear" - << "FEM_ElementGeometry1D" - << "FEM_ElementGeometry2D" - << "FEM_ElementFluid1D"; - - Gui::ToolBarItem* mech = new Gui::ToolBarItem(root); - mech->setCommand("Mechanical Constraints"); - *mech << "FEM_ConstraintFixed" - << "FEM_ConstraintDisplacement" - << "FEM_ConstraintPlaneRotation" - << "FEM_ConstraintContact" - << "FEM_ConstraintTransform" - << "Separator" - << "FEM_ConstraintForce" - << "FEM_ConstraintPressure" - << "FEM_ConstraintSelfWeight"; - - Gui::ToolBarItem* thermal = new Gui::ToolBarItem(root); - thermal->setCommand("Thermal Constraints"); - *thermal << "FEM_ConstraintInitialTemperature" - << "Separator" - << "FEM_ConstraintTemperature" - << "FEM_ConstraintHeatflux"; - - Gui::ToolBarItem* mesh = new Gui::ToolBarItem(root); - mesh->setCommand("Mesh"); - *mesh << "FEM_MeshNetgenFromShape" - << "FEM_MeshGmshFromShape" - << "Separator" - << "FEM_MeshBoundaryLayer" - << "FEM_MeshRegion" - << "FEM_MeshGroup" - << "Separator" - << "FEM_FEMMesh2Mesh"; - - Gui::ToolBarItem* fluid = new Gui::ToolBarItem(root); - fluid->setCommand("Fluid Constraints"); - *fluid << "FEM_ConstraintFluidBoundary"; - - Gui::ToolBarItem* solve = new Gui::ToolBarItem(root); - solve->setCommand("Solve"); - *solve << "FEM_SolverCalculix" - << "Separator" - << "FEM_SolverControl" - << "FEM_SolverRun"; - - Gui::ToolBarItem* results = new Gui::ToolBarItem(root); - results->setCommand("Results"); - *results << "FEM_ResultsPurge" - << "FEM_ResultShow"; - -#ifdef FC_USE_VTK - *results << "Separator" - << "FEM_PostApplyChanges" - << "FEM_PostPipelineFromResult" - << "Separator" - << "FEM_PostCreateClipFilter" - << "FEM_PostCreateScalarClipFilter" - << "FEM_PostCreateCutFilter" - << "FEM_PostCreateWarpVectorFilter" - << "FEM_PostCreateDataAlongLineFilter" - << "FEM_PostCreateLinearizedStressesFilter" - << "Separator" - << "FEM_PostCreateFunctions"; -#endif - - return root; -} - -Gui::MenuItem* Workbench::setupMenuBar() const -{ - Gui::MenuItem* root = StdWorkbench::setupMenuBar(); - Gui::MenuItem* item = root->findItem("&Windows"); - - Gui::MenuItem* mech = new Gui::MenuItem; - mech->setCommand("&Mechanical Constraints"); - *mech << "FEM_ConstraintFixed" - << "FEM_ConstraintDisplacement" - << "FEM_ConstraintPlaneRotation" - << "FEM_ConstraintContact" - << "FEM_ConstraintTransform" - << "Separator" - << "FEM_ConstraintForce" - << "FEM_ConstraintPressure" - << "FEM_ConstraintSelfWeight" - << "Separator" - << "FEM_ConstraintBearing" - << "FEM_ConstraintGear" - << "FEM_ConstraintPulley"; - - Gui::MenuItem* thermal = new Gui::MenuItem; - thermal->setCommand("&Thermal Constraints"); - *thermal << "FEM_ConstraintInitialTemperature" - << "Separator" - << "FEM_ConstraintHeatflux" - << "FEM_ConstraintTemperature"; - - Gui::MenuItem* fluid = new Gui::MenuItem; - fluid->setCommand("&Fluid Constraints"); - *fluid << "FEM_ConstraintFluidBoundary"; - - Gui::MenuItem* model = new Gui::MenuItem; - root->insertItem(item, model); - model->setCommand("M&odel"); - *model << "FEM_Analysis" - << "Separator" - << "FEM_MaterialSolid" - << "FEM_MaterialFluid" - << "FEM_MaterialMechanicalNonlinear" - << "FEM_ElementGeometry1D" - << "FEM_ElementGeometry2D" - << "FEM_ElementFluid1D" - << "Separator" - << mech - << thermal - << fluid; - - Gui::MenuItem* mesh = new Gui::MenuItem; - root->insertItem(item, mesh); - mesh->setCommand("M&esh"); - *mesh << "FEM_MeshNetgenFromShape" - << "FEM_MeshGmshFromShape" - << "Separator" - << "FEM_MeshBoundaryLayer" - << "FEM_MeshRegion" - << "FEM_MeshGroup" - << "Separator" - << "FEM_CreateNodesSet" - << "FEM_FEMMesh2Mesh"; - - Gui::MenuItem* solve = new Gui::MenuItem; - root->insertItem(item, solve); - solve->setCommand("&Solve"); - *solve << "FEM_SolverCalculix" - << "FEM_SolverZ88" - << "Separator" - << "FEM_SolverControl" - << "FEM_SolverRun"; - - Gui::MenuItem* results = new Gui::MenuItem; - root->insertItem(item, results); - results->setCommand("&Results"); - *results << "FEM_ResultsPurge" - << "FEM_ResultShow" - << "Separator" - << "FEM_PostApplyChanges" - << "FEM_PostPipelineFromResult" - << "Separator" - << "FEM_PostCreateClipFilter" - << "FEM_PostCreateScalarClipFilter" - << "FEM_PostCreateCutFilter" - << "FEM_PostCreateWarpVectorFilter" - << "FEM_PostCreateDataAlongLineFilter" - << "FEM_PostCreateLinearizedStressesFilter" - << "Separator" - << "FEM_PostCreateFunctions"; - - return root; -} +/*************************************************************************** + * Copyright (c) 2008 Werner Mayer * + * * + * 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" + +#ifndef _PreComp_ +# include +#endif + +#include "Workbench.h" +#include +#include + + +using namespace FemGui; + +#if 0 // needed for Qt's lupdate utility + qApp->translate("Workbench", "FEM"); + qApp->translate("Workbench", "&FEM"); +#endif + +/// @namespace FemGui @class Workbench +TYPESYSTEM_SOURCE(FemGui::Workbench, Gui::StdWorkbench) + +Workbench::Workbench() +{ +} + +Workbench::~Workbench() +{ +} + +void Workbench::setupContextMenu(const char* recipient, Gui::MenuItem* item) const +{ + StdWorkbench::setupContextMenu( recipient, item ); + *item << "Separator" + << "FEM_MeshClear" + << "FEM_MeshPrintInfo"; +} + +Gui::ToolBarItem* Workbench::setupToolBars() const +{ + Gui::ToolBarItem* root = StdWorkbench::setupToolBars(); + Gui::ToolBarItem* model = new Gui::ToolBarItem(root); + model->setCommand("Model"); + *model << "FEM_Analysis" + << "Separator" + << "FEM_MaterialSolid" + << "FEM_MaterialFluid" + << "FEM_MaterialMechanicalNonlinear" + << "FEM_ElementGeometry1D" + << "FEM_ElementGeometry2D" + << "FEM_ElementFluid1D"; + + Gui::ToolBarItem* mech = new Gui::ToolBarItem(root); + mech->setCommand("Mechanical Constraints"); + *mech << "FEM_ConstraintFixed" + << "FEM_ConstraintDisplacement" + << "FEM_ConstraintPlaneRotation" + << "FEM_ConstraintContact" + << "FEM_ConstraintTransform" + << "Separator" + << "FEM_ConstraintForce" + << "FEM_ConstraintPressure" + << "FEM_ConstraintSelfWeight"; + + Gui::ToolBarItem* thermal = new Gui::ToolBarItem(root); + thermal->setCommand("Thermal Constraints"); + *thermal << "FEM_ConstraintInitialTemperature" + << "Separator" + << "FEM_ConstraintTemperature" + << "FEM_ConstraintHeatflux"; + + Gui::ToolBarItem* mesh = new Gui::ToolBarItem(root); + mesh->setCommand("Mesh"); + *mesh << "FEM_MeshNetgenFromShape" + << "FEM_MeshGmshFromShape" + << "Separator" + << "FEM_MeshBoundaryLayer" + << "FEM_MeshRegion" + << "FEM_MeshGroup" + << "Separator" + << "FEM_FEMMesh2Mesh"; + + Gui::ToolBarItem* fluid = new Gui::ToolBarItem(root); + fluid->setCommand("Fluid Constraints"); + *fluid << "FEM_ConstraintFluidBoundary"; + + Gui::ToolBarItem* solve = new Gui::ToolBarItem(root); + solve->setCommand("Solve"); + *solve << "FEM_SolverCalculix" + << "Separator" + << "FEM_SolverControl" + << "FEM_SolverRun"; + + Gui::ToolBarItem* results = new Gui::ToolBarItem(root); + results->setCommand("Results"); + *results << "FEM_ResultsPurge" + << "FEM_ResultShow"; + +#ifdef FC_USE_VTK + *results << "Separator" + << "FEM_PostApplyChanges" + << "FEM_PostPipelineFromResult" + << "Separator" + << "FEM_PostCreateClipFilter" + << "FEM_PostCreateScalarClipFilter" + << "FEM_PostCreateCutFilter" + << "FEM_PostCreateWarpVectorFilter" + << "FEM_PostCreateDataAlongLineFilter" + << "FEM_PostCreateLinearizedStressesFilter" + << "Separator" + << "FEM_PostCreateFunctions"; +#endif + + return root; +} + +Gui::MenuItem* Workbench::setupMenuBar() const +{ + Gui::MenuItem* root = StdWorkbench::setupMenuBar(); + Gui::MenuItem* item = root->findItem("&Windows"); + + Gui::MenuItem* mech = new Gui::MenuItem; + mech->setCommand("&Mechanical Constraints"); + *mech << "FEM_ConstraintFixed" + << "FEM_ConstraintDisplacement" + << "FEM_ConstraintPlaneRotation" + << "FEM_ConstraintContact" + << "FEM_ConstraintTransform" + << "Separator" + << "FEM_ConstraintForce" + << "FEM_ConstraintPressure" + << "FEM_ConstraintSelfWeight" + << "Separator" + << "FEM_ConstraintBearing" + << "FEM_ConstraintGear" + << "FEM_ConstraintPulley"; + + Gui::MenuItem* thermal = new Gui::MenuItem; + thermal->setCommand("&Thermal Constraints"); + *thermal << "FEM_ConstraintInitialTemperature" + << "Separator" + << "FEM_ConstraintHeatflux" + << "FEM_ConstraintTemperature"; + + Gui::MenuItem* fluid = new Gui::MenuItem; + fluid->setCommand("&Fluid Constraints"); + *fluid << "FEM_ConstraintFluidBoundary"; + + Gui::MenuItem* model = new Gui::MenuItem; + root->insertItem(item, model); + model->setCommand("M&odel"); + *model << "FEM_Analysis" + << "Separator" + << "FEM_MaterialSolid" + << "FEM_MaterialFluid" + << "FEM_MaterialMechanicalNonlinear" + << "FEM_ElementGeometry1D" + << "FEM_ElementGeometry2D" + << "FEM_ElementFluid1D" + << "Separator" + << mech + << thermal + << fluid; + + Gui::MenuItem* mesh = new Gui::MenuItem; + root->insertItem(item, mesh); + mesh->setCommand("M&esh"); + *mesh << "FEM_MeshNetgenFromShape" + << "FEM_MeshGmshFromShape" + << "Separator" + << "FEM_MeshBoundaryLayer" + << "FEM_MeshRegion" + << "FEM_MeshGroup" + << "Separator" + << "FEM_CreateNodesSet" + << "FEM_FEMMesh2Mesh"; + + Gui::MenuItem* solve = new Gui::MenuItem; + root->insertItem(item, solve); + solve->setCommand("&Solve"); + *solve << "FEM_SolverCalculix" + << "FEM_SolverZ88" + << "Separator" + << "FEM_SolverControl" + << "FEM_SolverRun"; + + Gui::MenuItem* results = new Gui::MenuItem; + root->insertItem(item, results); + results->setCommand("&Results"); + *results << "FEM_ResultsPurge" + << "FEM_ResultShow" + << "Separator" + << "FEM_PostApplyChanges" + << "FEM_PostPipelineFromResult" + << "Separator" + << "FEM_PostCreateClipFilter" + << "FEM_PostCreateScalarClipFilter" + << "FEM_PostCreateCutFilter" + << "FEM_PostCreateWarpVectorFilter" + << "FEM_PostCreateDataAlongLineFilter" + << "FEM_PostCreateLinearizedStressesFilter" + << "Separator" + << "FEM_PostCreateFunctions"; + + return root; +} diff --git a/src/Mod/Fem/Init.py b/src/Mod/Fem/Init.py index 443f858d5a..836c591c3c 100644 --- a/src/Mod/Fem/Init.py +++ b/src/Mod/Fem/Init.py @@ -1,45 +1,45 @@ -# FreeCAD init script of the Fem module -# (c) 2001 Juergen Riegel - -# *************************************************************************** -# * (c) Juergen Riegel (juergen.riegel@web.de) 2002 * -# * * -# * This file is part of the FreeCAD CAx development system. * -# * * -# * This program is free software; you can redistribute it and/or modify * -# * it under the terms of the GNU Lesser General Public License (LGPL) * -# * as published by the Free Software Foundation; either version 2 of * -# * the License, or (at your option) any later version. * -# * for detail see the LICENCE text file. * -# * * -# * FreeCAD 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 Lesser General Public License for more details. * -# * * -# * You should have received a copy of the GNU Library General Public * -# * License along with FreeCAD; if not, write to the Free Software * -# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * -# * USA * -# * * -# * Juergen Riegel 2002 * -# ***************************************************************************/ - -import FreeCAD - -FreeCAD.addExportType("TetGen file (*.poly)", "convert2TetGen") -FreeCAD.addImportType("FEM formats (*.unv *.med *.dat *.bdf)", "Fem") -if("BUILD_FEM_VTK" in FreeCAD.__cmake__): - FreeCAD.addImportType("FEM CFD Unstructure Mesh (*.vtk *.vtu)", "Fem") - FreeCAD.addExportType("FEM CFD Unstructure Mesh (*.vtk *.vtu)", "Fem") - FreeCAD.addImportType("FEM results (*.vtk *.vtu)", "importVTKResults") - FreeCAD.addExportType("FEM CFD Result in VTK format (*.vtk *.vtu)", "importVTKResults") - -FreeCAD.addExportType("FEM formats (*.unv *.med *.dat *.inp)", "Fem") -FreeCAD.addImportType("CalculiX result (*.frd)", "importCcxFrdResults") -FreeCAD.addImportType("Fenics mesh file (*.xml *.xdmf)", "importFenicsMesh") -FreeCAD.addExportType("Fenics mesh file (*.xml *.xdmf)", "importFenicsMesh") -FreeCAD.addImportType("Mesh from Calculix/Abaqus input file (*.inp)", "importInpMesh") -FreeCAD.addImportType("Z88 mesh (i1) file (*.txt)", "importZ88Mesh") -FreeCAD.addExportType("Z88 mesh (i1) file (*.txt)", "importZ88Mesh") -FreeCAD.addImportType("Z88 displacement (o2) result file (*.txt)", "importZ88O2Results") +# FreeCAD init script of the Fem module +# (c) 2001 Juergen Riegel + +# *************************************************************************** +# * (c) Juergen Riegel (juergen.riegel@web.de) 2002 * +# * * +# * This file is part of the FreeCAD CAx development system. * +# * * +# * This program is free software; you can redistribute it and/or modify * +# * it under the terms of the GNU Lesser General Public License (LGPL) * +# * as published by the Free Software Foundation; either version 2 of * +# * the License, or (at your option) any later version. * +# * for detail see the LICENCE text file. * +# * * +# * FreeCAD 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 Lesser General Public License for more details. * +# * * +# * You should have received a copy of the GNU Library General Public * +# * License along with FreeCAD; if not, write to the Free Software * +# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * +# * USA * +# * * +# * Juergen Riegel 2002 * +# ***************************************************************************/ + +import FreeCAD + +FreeCAD.addExportType("TetGen file (*.poly)", "convert2TetGen") +FreeCAD.addImportType("FEM formats (*.unv *.med *.dat *.bdf)", "Fem") +if("BUILD_FEM_VTK" in FreeCAD.__cmake__): + FreeCAD.addImportType("FEM CFD Unstructure Mesh (*.vtk *.vtu)", "Fem") + FreeCAD.addExportType("FEM CFD Unstructure Mesh (*.vtk *.vtu)", "Fem") + FreeCAD.addImportType("FEM results (*.vtk *.vtu)", "importVTKResults") + FreeCAD.addExportType("FEM CFD Result in VTK format (*.vtk *.vtu)", "importVTKResults") + +FreeCAD.addExportType("FEM formats (*.unv *.med *.dat *.inp)", "Fem") +FreeCAD.addImportType("CalculiX result (*.frd)", "importCcxFrdResults") +FreeCAD.addImportType("Fenics mesh file (*.xml *.xdmf)", "importFenicsMesh") +FreeCAD.addExportType("Fenics mesh file (*.xml *.xdmf)", "importFenicsMesh") +FreeCAD.addImportType("Mesh from Calculix/Abaqus input file (*.inp)", "importInpMesh") +FreeCAD.addImportType("Z88 mesh (i1) file (*.txt)", "importZ88Mesh") +FreeCAD.addExportType("Z88 mesh (i1) file (*.txt)", "importZ88Mesh") +FreeCAD.addImportType("Z88 displacement (o2) result file (*.txt)", "importZ88O2Results") diff --git a/src/Mod/Fem/fem.dox b/src/Mod/Fem/fem.dox index c18aeb6c26..8cfa8c96b8 100755 --- a/src/Mod/Fem/fem.dox +++ b/src/Mod/Fem/fem.dox @@ -1,5 +1,5 @@ -/** \defgroup FEM Fem - * \ingroup CWORKBENCHES - * \brief Finite Elements Analysis workbench - */ - +/** \defgroup FEM Fem + * \ingroup CWORKBENCHES + * \brief Finite Elements Analysis workbench + */ +