diff --git a/src/Mod/Fem/App/CMakeLists.txt b/src/Mod/Fem/App/CMakeLists.txt index 357a0e0225..1f24428b9f 100755 --- a/src/Mod/Fem/App/CMakeLists.txt +++ b/src/Mod/Fem/App/CMakeLists.txt @@ -64,7 +64,8 @@ SOURCE_GROUP("Module" FILES ${Mod_SRCS}) SET(FemScripts_SRCS convert2TetGen.py - FemLib.py + FemLib.py + CalculixLib.py MechanicalAnalysis.py MechanicalMaterial.py ) diff --git a/src/Mod/Fem/App/FemMeshPyImp.cpp b/src/Mod/Fem/App/FemMeshPyImp.cpp index 0cfef63ee0..1241732746 100755 --- a/src/Mod/Fem/App/FemMeshPyImp.cpp +++ b/src/Mod/Fem/App/FemMeshPyImp.cpp @@ -181,21 +181,42 @@ PyObject* FemMeshPy::compute(PyObject *args) PyObject* FemMeshPy::addNode(PyObject *args) { double x,y,z; - if (!PyArg_ParseTuple(args, "ddd",&x,&y,&z)) - return 0; + int i = -1; + if (PyArg_ParseTuple(args, "ddd",&x,&y,&z)){ + try { + SMESH_Mesh* mesh = getFemMeshPtr()->getSMesh(); + SMESHDS_Mesh* meshDS = mesh->GetMeshDS(); + SMDS_MeshNode* node = meshDS->AddNode(x,y,z); + if (!node) + throw std::runtime_error("Failed to add node"); + return Py::new_reference_to(Py::Int(node->GetID())); + } + catch (const std::exception& e) { + PyErr_SetString(PyExc_Exception, e.what()); + return 0; + } + } + PyErr_Clear(); - try { - SMESH_Mesh* mesh = getFemMeshPtr()->getSMesh(); - SMESHDS_Mesh* meshDS = mesh->GetMeshDS(); - SMDS_MeshNode* node = meshDS->AddNode(x,y,z); - if (!node) - throw std::runtime_error("Failed to add node"); - return Py::new_reference_to(Py::Int(node->GetID())); - } - catch (const std::exception& e) { - PyErr_SetString(PyExc_Exception, e.what()); - return 0; + if (PyArg_ParseTuple(args, "dddi",&x,&y,&z,&i)){ + try { + SMESH_Mesh* mesh = getFemMeshPtr()->getSMesh(); + SMESHDS_Mesh* meshDS = mesh->GetMeshDS(); + SMDS_MeshNode* node = meshDS->AddNodeWithID(x,y,z,i); + if (!node) + throw std::runtime_error("Failed to add node"); + return Py::new_reference_to(Py::Int(node->GetID())); + } + catch (const std::exception& e) { + PyErr_SetString(PyExc_Exception, e.what()); + return 0; + } } + PyErr_SetString(PyExc_TypeError, "addNode() accepts:\n" + "-- addNode(x,y,z)\n" + "-- addNode(x,y,z,ElemId)\n"); + return 0; + } PyObject* FemMeshPy::addEdge(PyObject *args) @@ -356,24 +377,47 @@ PyObject* FemMeshPy::addVolume(PyObject *args) } SMDS_MeshVolume* vol=0; - switch(Nodes.size()){ - case 4: - vol = meshDS->AddVolume(Nodes[0],Nodes[1],Nodes[2],Nodes[3]); - if (!vol) - throw std::runtime_error("Failed to add Tet4 volume"); - break; - case 8: - vol = meshDS->AddVolume(Nodes[0],Nodes[1],Nodes[2],Nodes[3],Nodes[4],Nodes[5],Nodes[6],Nodes[7]); - if (!vol) - throw std::runtime_error("Failed to add Tet10 volume"); - break; - case 10: - vol = meshDS->AddVolume(Nodes[0],Nodes[1],Nodes[2],Nodes[3],Nodes[4],Nodes[5],Nodes[6],Nodes[7],Nodes[8],Nodes[9]); - if (!vol) - throw std::runtime_error("Failed to add Tet10 volume"); - break; + if(ElementId != -1) { + switch(Nodes.size()){ + case 4: + vol = meshDS->AddVolumeWithID(Nodes[0],Nodes[1],Nodes[2],Nodes[3],ElementId); + if (!vol) + throw std::runtime_error("Failed to add Tet4 volume"); + break; + case 8: + vol = meshDS->AddVolumeWithID(Nodes[0],Nodes[1],Nodes[2],Nodes[3],Nodes[4],Nodes[5],Nodes[6],Nodes[7],ElementId); + if (!vol) + throw std::runtime_error("Failed to add Tet10 volume"); + break; + case 10: + vol = meshDS->AddVolumeWithID(Nodes[0],Nodes[1],Nodes[2],Nodes[3],Nodes[4],Nodes[5],Nodes[6],Nodes[7],Nodes[8],Nodes[9],ElementId); + if (!vol) + throw std::runtime_error("Failed to add Tet10 volume"); + break; + + default: throw std::runtime_error("Unknown node count, [4|5|6|8|10|13|18] are allowed"); //unknown face type + } + }else{ + switch(Nodes.size()){ + case 4: + vol = meshDS->AddVolume(Nodes[0],Nodes[1],Nodes[2],Nodes[3]); + if (!vol) + throw std::runtime_error("Failed to add Tet4 volume"); + break; + case 8: + vol = meshDS->AddVolume(Nodes[0],Nodes[1],Nodes[2],Nodes[3],Nodes[4],Nodes[5],Nodes[6],Nodes[7]); + if (!vol) + throw std::runtime_error("Failed to add Tet10 volume"); + break; + case 10: + vol = meshDS->AddVolume(Nodes[0],Nodes[1],Nodes[2],Nodes[3],Nodes[4],Nodes[5],Nodes[6],Nodes[7],Nodes[8],Nodes[9]); + if (!vol) + throw std::runtime_error("Failed to add Tet10 volume"); + break; + + default: throw std::runtime_error("Unknown node count, [4|5|6|8|10|13|18] are allowed"); //unknown face type + } - default: throw std::runtime_error("Unknown node count, [4|5|6|8|10|13|18] are allowed"); //unknown face type } return Py::new_reference_to(Py::Int(vol->GetID())); diff --git a/src/Mod/Fem/App/FemResultObject.cpp b/src/Mod/Fem/App/FemResultObject.cpp index b7db4b7ecf..07f0e64969 100644 --- a/src/Mod/Fem/App/FemResultObject.cpp +++ b/src/Mod/Fem/App/FemResultObject.cpp @@ -40,6 +40,7 @@ FemResultObject::FemResultObject() ADD_PROPERTY_TYPE(DataType,(""), "General",Prop_None,"Type identifier of the result data"); ADD_PROPERTY_TYPE(Unit,(Base::Quantity()), "General",Prop_None,"Unit of the data"); ADD_PROPERTY_TYPE(ElementNumbers,(0), "Data",Prop_None,"Numbers of the result elements"); + ADD_PROPERTY_TYPE(Mesh,(0), "General",Prop_None,"Link to the corosbonding mesh"); } FemResultObject::~FemResultObject() diff --git a/src/Mod/Fem/App/FemResultObject.h b/src/Mod/Fem/App/FemResultObject.h index 3db4b065b0..2dd5ec4de4 100644 --- a/src/Mod/Fem/App/FemResultObject.h +++ b/src/Mod/Fem/App/FemResultObject.h @@ -48,10 +48,13 @@ public: App::PropertyQuantity Unit; /// List of element numbers in this result object App::PropertyIntegerList ElementNumbers; + /// Link to the corosbonding mesh + App::PropertyLink Mesh; + /// returns the type name of the ViewProvider - //virtual const char* getViewProviderName(void) const { - // return "FemGui::ViewProviderFemSet"; - //} + virtual const char* getViewProviderName(void) const { + return "FemGui::ViewProviderResult"; + } virtual App::DocumentObjectExecReturn *execute(void) { return App::DocumentObject::StdReturn; } diff --git a/src/Mod/Fem/App/FemResultValue.cpp b/src/Mod/Fem/App/FemResultValue.cpp index bb698858ed..b882fe676d 100644 --- a/src/Mod/Fem/App/FemResultValue.cpp +++ b/src/Mod/Fem/App/FemResultValue.cpp @@ -32,7 +32,7 @@ using namespace Fem; using namespace App; -PROPERTY_SOURCE(Fem::FemResultValue, App::DocumentObject) +PROPERTY_SOURCE(Fem::FemResultValue, Fem::FemResultObject) FemResultValue::FemResultValue() diff --git a/src/Mod/Fem/App/FemResultVector.cpp b/src/Mod/Fem/App/FemResultVector.cpp index 4b3cb23708..1196ecbaeb 100644 --- a/src/Mod/Fem/App/FemResultVector.cpp +++ b/src/Mod/Fem/App/FemResultVector.cpp @@ -32,7 +32,7 @@ using namespace Fem; using namespace App; -PROPERTY_SOURCE(Fem::FemResultVector, App::DocumentObject) +PROPERTY_SOURCE(Fem::FemResultVector, Fem::FemResultObject) FemResultVector::FemResultVector() diff --git a/src/Mod/Fem/CalculixLib.py b/src/Mod/Fem/CalculixLib.py index 9b66195cf5..573bbd8724 100644 --- a/src/Mod/Fem/CalculixLib.py +++ b/src/Mod/Fem/CalculixLib.py @@ -1,5 +1,6 @@ #*************************************************************************** #* * +#* Copyright (c) 2013 - Joachim Zettler * #* Copyright (c) 2013 - Juergen Riegel * #* * #* This program is free software; you can redistribute it and/or modify * @@ -21,42 +22,158 @@ #*************************************************************************** +import FreeCAD,os +from math import pow,sqrt +__title__="FreeCAD Calculix library" +__author__ = "Juergen Riegel " +__url__ = "http://www.freecadweb.org" +if open.__module__ == '__builtin__': + pyopen = open # because we'll redefine open below + +# read a calculix result file and extract the nodes, displacement vectores and stress values. def readResult(frd_input) : - input = open(frd_input,"r") - nodes_x = [] - nodes_y = [] - nodes_z = [] - disp_x = [] - disp_y = [] - disp_z = [] - displaced_nodes_x = [] - displaced_nodes_y = [] - displaced_nodes_z = [] + input = pyopen(frd_input,"r") + nodes = {} + disp = {} + stress = {} + elements = {} disp_found = False - nodes_found = True + nodes_found = False + stress_found = False + elements_found = False + elem = -1 while True: - line=input.readline() - if not line: break - #first lets extract the node and coordinate information from the results file - if nodes_found and (line[1:3] == "-1"): - nodes_x.append(float(line[13:25])) - nodes_y.append(float(line[25:37])) - nodes_z.append(float(line[37:49])) - #Check if we found displacement section - if line[5:9] == "DISP": - disp_found = True - #we found a displacement line in the frd file - if disp_found and (line[1:3] == "-1"): - disp_x.append(float(line[13:25])) - disp_y.append(float(line[25:37])) - disp_z.append(float(line[37:49])) - #Check for the end of a section - if line[1:3] == "-3": - #the section with the displacements and the nodes ended - disp_found = False - nodes_found = False + line=input.readline() + if not line: break + #Check if we found nodes section + if line[4:6] == "2C": + nodes_found = True + #first lets extract the node and coordinate information from the results file + if nodes_found and (line[1:3] == "-1"): + elem = int(line[4:13]) + nodes_x = float(line[13:25]) + nodes_y = float(line[25:37]) + nodes_z = float(line[37:49]) + nodes[elem] = FreeCAD.Vector(nodes_x,nodes_y,nodes_z) + #Check if we found nodes section + if line[4:6] == "3C": + elements_found = True + #first lets extract element number + if elements_found and (line[1:3] == "-1"): + elem = int(line[4:13]) + #then the 10 id's for the Tet10 element + if elements_found and (line[1:3] == "-2"): + node_id_2 = int(line[3:13]) + node_id_1 = int(line[13:23]) + node_id_3 = int(line[23:33]) + node_id_4 = int(line[33:43]) + node_id_5 = int(line[43:53]) + node_id_7 = int(line[53:63]) + node_id_6 = int(line[63:73]) + node_id_9 = int(line[73:83]) + node_id_8 = int(line[83:93]) + node_id_10 = int(line[93:103]) + elements[elem] = (node_id_1,node_id_2,node_id_3,node_id_4,node_id_5,node_id_6,node_id_7,node_id_8,node_id_9,node_id_10) + #Check if we found displacement section + if line[5:9] == "DISP": + disp_found = True + #we found a displacement line in the frd file + if disp_found and (line[1:3] == "-1"): + elem = int(line[4:13]) + disp_x = float(line[13:25]) + disp_y = float(line[25:37]) + disp_z = float(line[37:49]) + disp[elem] = FreeCAD.Vector(disp_x,disp_y,disp_z) + if line[5:11] == "STRESS": + stress_found = True + #we found a displacement line in the frd file + if stress_found and (line[1:3] == "-1"): + elem = int(line[4:13]) + stress_1 = float(line[13:25]) + stress_2 = float(line[25:37]) + stress_3 = float(line[37:49]) + stress_4 = float(line[49:61]) + stress_5 = float(line[61:73]) + stress_6 = float(line[73:85]) + stress[elem] = (stress_1,stress_2,stress_3,stress_4,stress_5,stress_6) + #Check for the end of a section + if line[1:3] == "-3": + #the section with the displacements and the nodes ended + disp_found = False + nodes_found = False + stress_found = False + elements_found = False input.close() + FreeCAD.Console.PrintLog('Read Calculix result: ' + `len(nodes)` + ' Nodes, ' + `len(disp)` + ' Displacements and ' + `len(stress)` + ' Stress values\n') + + return {'Nodes':nodes,'Tet10Elem':elements,'Displacement':disp,'Stress':stress} + + +def importFrd(filename): + m = readResult(filename); + MeshObject = None + if(len(m) > 0): + import Fem + AnalysisName = os.path.splitext(os.path.basename(filename))[0] + AnalysisObject = FreeCAD.ActiveDocument.addObject('Fem::FemAnalysis','Analysis') + AnalysisObject.Label = AnalysisName + if(m.has_key('Tet10Elem') and m.has_key('Nodes') ): + mesh = Fem.FemMesh() + nds = m['Nodes'] + for i in nds: + n = nds[i] + mesh.addNode(n[0],n[1],n[2],i) + elms = m['Tet10Elem'] + for i in elms: + e = elms[i] + mesh.addVolume([e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9]],i) + + MeshObject = FreeCAD.ActiveDocument.addObject('Fem::FemMeshObject','ResultMesh') + MeshObject.FemMesh = mesh + AnalysisObject.Member = AnalysisObject.Member + [MeshObject] + + if(m.has_key('Displacement')): + disp = m['Displacement'] + o = FreeCAD.ActiveDocument.addObject('Fem::FemResultVector','Displacement') + o.Values = disp.values() + o.ElementNumbers = disp.keys() + if(MeshObject): + o.Mesh = MeshObject + AnalysisObject.Member = AnalysisObject.Member + [o] + if(m.has_key('Stress')): + stress = m['Stress'] + o = FreeCAD.ActiveDocument.addObject('Fem::FemResultValue','MisesStress') + mstress = [] + for i in stress.values(): + # van mises stress (http://en.wikipedia.org/wiki/Von_Mises_yield_criterion) + mstress.append( sqrt( pow( i[0] - i[1] ,2) + pow( i[1] - i[2] ,2) + pow( i[2] - i[0] ,2) + 6 * (pow(i[3],2)+pow(i[4],2)+pow(i[5],2) ) ) ) + + o.Values = mstress + o.ElementNumbers = stress.keys() + if(MeshObject): + o.Mesh = MeshObject + AnalysisObject.Member = AnalysisObject.Member + [o] + if(FreeCAD.GuiUp): + import FemGui + FemGui.setActiveAnalysis(AnalysisObject) + +def insert(filename,docname): + "called when freecad wants to import a file" + try: + doc = FreeCAD.getDocument(docname) + except: + doc = FreeCAD.newDocument(docname) + FreeCAD.ActiveDocument = doc + + importFrd(filename) + +def open(filename): + "called when freecad opens a file" + docname = os.path.splitext(os.path.basename(filename))[0] + insert(filename,docname) + + diff --git a/src/Mod/Fem/Gui/AppFemGui.cpp b/src/Mod/Fem/Gui/AppFemGui.cpp index fbaf712b15..1edd9bcb54 100755 --- a/src/Mod/Fem/Gui/AppFemGui.cpp +++ b/src/Mod/Fem/Gui/AppFemGui.cpp @@ -45,6 +45,7 @@ #include "ViewProviderFemConstraintForce.h" #include "ViewProviderFemConstraintGear.h" #include "ViewProviderFemConstraintPulley.h" +#include "ViewProviderResult.h" #include "Workbench.h" //#include "resources/qrc_Fem.cpp" @@ -94,6 +95,7 @@ void FemGuiExport initFemGui() FemGui::ViewProviderFemConstraintForce ::init(); FemGui::ViewProviderFemConstraintGear ::init(); FemGui::ViewProviderFemConstraintPulley ::init(); + FemGui::ViewProviderResult ::init(); Base::Interpreter().loadModule("MechanicalAnalysis"); Base::Interpreter().loadModule("MechanicalMaterial"); diff --git a/src/Mod/Fem/Gui/CMakeLists.txt b/src/Mod/Fem/Gui/CMakeLists.txt index e22f858c31..b6ca94af14 100755 --- a/src/Mod/Fem/Gui/CMakeLists.txt +++ b/src/Mod/Fem/Gui/CMakeLists.txt @@ -133,6 +133,8 @@ SET(FemGui_SRCS_ViewProvider ViewProviderFemConstraintGear.h ViewProviderFemConstraintPulley.cpp ViewProviderFemConstraintPulley.h + ViewProviderResult.cpp + ViewProviderResult.h ) SOURCE_GROUP("ViewProvider" FILES ${FemGui_SRCS_ViewProvider}) diff --git a/src/Mod/Fem/Gui/Resources/Fem.qrc b/src/Mod/Fem/Gui/Resources/Fem.qrc index b39ff82915..ee00e6358f 100755 --- a/src/Mod/Fem/Gui/Resources/Fem.qrc +++ b/src/Mod/Fem/Gui/Resources/Fem.qrc @@ -13,6 +13,9 @@ icons/Fem_AddPart.svg icons/Fem_Material.svg icons/Fem_NewAnalysis.svg + icons/Fem_Result.svg + icons/Fem_ResultDisplacement.svg + icons/Fem_ResultStress.svg translations/Fem_af.qm translations/Fem_de.qm translations/Fem_fi.qm diff --git a/src/Mod/Fem/Gui/Resources/icons/Fem_Analysis.svg b/src/Mod/Fem/Gui/Resources/icons/Fem_Analysis.svg index a6d5d1992e..990bbd30e0 100644 --- a/src/Mod/Fem/Gui/Resources/icons/Fem_Analysis.svg +++ b/src/Mod/Fem/Gui/Resources/icons/Fem_Analysis.svg @@ -15,7 +15,7 @@ id="svg2860" sodipodi:version="0.32" inkscape:version="0.48.4 r9939" - sodipodi:docname="Fem_FemMesh.svg" + sodipodi:docname="Fem_Analysis.svg" inkscape:output_extension="org.inkscape.output.svg.inkscape" version="1.1"> @@ -98,7 +98,7 @@ image/svg+xml - + @@ -108,7 +108,7 @@ inkscape:groupmode="layer"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/src/Mod/Fem/Gui/Resources/icons/Fem_ResultDisplacement.svg b/src/Mod/Fem/Gui/Resources/icons/Fem_ResultDisplacement.svg new file mode 100644 index 0000000000..8d2ae98175 --- /dev/null +++ b/src/Mod/Fem/Gui/Resources/icons/Fem_ResultDisplacement.svg @@ -0,0 +1,181 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/src/Mod/Fem/Gui/Resources/icons/Fem_ResultStress.svg b/src/Mod/Fem/Gui/Resources/icons/Fem_ResultStress.svg new file mode 100644 index 0000000000..4578008251 --- /dev/null +++ b/src/Mod/Fem/Gui/Resources/icons/Fem_ResultStress.svg @@ -0,0 +1,194 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/src/Mod/Fem/Gui/ViewProviderAnalysis.cpp b/src/Mod/Fem/Gui/ViewProviderAnalysis.cpp index 6dd0d2767c..f651ea3aae 100644 --- a/src/Mod/Fem/Gui/ViewProviderAnalysis.cpp +++ b/src/Mod/Fem/Gui/ViewProviderAnalysis.cpp @@ -50,7 +50,7 @@ PROPERTY_SOURCE(FemGui::ViewProviderFemAnalysis, Gui::ViewProviderDocumentObject ViewProviderFemAnalysis::ViewProviderFemAnalysis() { - + sPixmap = "Fem_Analysis"; } diff --git a/src/Mod/Fem/Gui/ViewProviderAnalysis.h b/src/Mod/Fem/Gui/ViewProviderAnalysis.h index 096ee7ba5e..c1c89abada 100644 --- a/src/Mod/Fem/Gui/ViewProviderAnalysis.h +++ b/src/Mod/Fem/Gui/ViewProviderAnalysis.h @@ -60,6 +60,9 @@ public: virtual bool onDelete(const std::vector &); + // shows solid in the tree + virtual bool isShow(void) const{return true;} + protected: virtual bool setEdit(int ModNum); virtual void unsetEdit(int ModNum); diff --git a/src/Mod/Fem/Gui/ViewProviderFemMesh.cpp b/src/Mod/Fem/Gui/ViewProviderFemMesh.cpp index 6c40269b3b..dd4e182ce0 100755 --- a/src/Mod/Fem/Gui/ViewProviderFemMesh.cpp +++ b/src/Mod/Fem/Gui/ViewProviderFemMesh.cpp @@ -166,6 +166,7 @@ App::PropertyFloatConstraint::Constraints ViewProviderFemMesh::floatRange = {1.0 ViewProviderFemMesh::ViewProviderFemMesh() { + sPixmap = "Fem_FemMesh"; ADD_PROPERTY(PointColor,(App::Color(0.7f,0.7f,0.7f))); ADD_PROPERTY(PointSize,(5.0f)); diff --git a/src/Mod/Fem/Gui/ViewProviderResult.cpp b/src/Mod/Fem/Gui/ViewProviderResult.cpp new file mode 100644 index 0000000000..3d23639c6c --- /dev/null +++ b/src/Mod/Fem/Gui/ViewProviderResult.cpp @@ -0,0 +1,73 @@ +/*************************************************************************** + * Copyright (c) 2013 Jürgen Riegel (FreeCAD@juergen-riegel.net) * + * * + * 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 "ViewProviderResult.h" +#include +#include +#include + +#include + +#include "TaskDlgAnalysis.h" + +using namespace FemGui; + + + + + + + +PROPERTY_SOURCE(FemGui::ViewProviderResult, Gui::ViewProviderDocumentObject) + + +ViewProviderResult::ViewProviderResult() +{ + sPixmap = "Fem_Result"; + +} + +ViewProviderResult::~ViewProviderResult() +{ + +} + + + +// Python feature ----------------------------------------------------------------------- + +namespace Gui { +/// @cond DOXERR +PROPERTY_SOURCE_TEMPLATE(FemGui::ViewProviderResultPython, FemGui::ViewProviderResult) +/// @endcond + +// explicit template instantiation +template class FemGuiExport ViewProviderPythonFeatureT; +} diff --git a/src/Mod/Fem/Gui/ViewProviderResult.h b/src/Mod/Fem/Gui/ViewProviderResult.h new file mode 100644 index 0000000000..bdcdbd3a86 --- /dev/null +++ b/src/Mod/Fem/Gui/ViewProviderResult.h @@ -0,0 +1,65 @@ +/*************************************************************************** + * Copyright (c) 2013 Jürgen Riegel (FreeCAD@juergen-riegel.net) * + * * + * 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 FEM_ViewProviderResult_H +#define FEM_ViewProviderResult_H + +#include +#include +#include + +class SoCoordinate3; +class SoDrawStyle; +class SoIndexedFaceSet; +class SoIndexedLineSet; +class SoShapeHints; +class SoMaterialBinding; + +namespace FemGui +{ + + + +class FemGuiExport ViewProviderResult : public Gui::ViewProviderDocumentObject +{ + PROPERTY_HEADER(FemGui::ViewProviderResult); + +public: + /// constructor + ViewProviderResult(); + + /// destructor + ~ViewProviderResult(); + + // shows solid in the tree + virtual bool isShow(void) const{return true;} +protected: + +}; + +typedef Gui::ViewProviderPythonFeatureT ViewProviderResultPython; + +} //namespace FemGui + + +#endif // FEM_ViewProviderResult_H diff --git a/src/Mod/Material/CMakeLists.txt b/src/Mod/Material/CMakeLists.txt index 8175d1f7c5..b5eae04293 100644 --- a/src/Mod/Material/CMakeLists.txt +++ b/src/Mod/Material/CMakeLists.txt @@ -6,7 +6,7 @@ SET(Material_SRCS importFCMat.py MaterialEditor.py ) -SOURCE_GROUP("" FILES ${Material_SRCS}) +SOURCE_GROUP("Module" FILES ${Material_SRCS}) # collect all the material cards: #FILE( GLOB MaterialLib_Files ./StandardMaterial/*.FCMat ./StandardMaterial/*.txt ) @@ -17,8 +17,9 @@ SET (MaterialLib_Files StandardMaterial/PLA.FCMat StandardMaterial/Readme.txt ) +SOURCE_GROUP("MatLib" FILES ${MaterialLib_Files}) -SET(all_files ${Material_SRCS}) +SET(all_files ${Material_SRCS} ${MaterialLib_Files} ) ADD_CUSTOM_TARGET(Material ALL SOURCES ${all_files} @@ -26,6 +27,7 @@ ADD_CUSTOM_TARGET(Material ALL fc_copy_sources(Material "${CMAKE_BINARY_DIR}/Mod/Material" ${all_files}) + fc_target_copy_resource(Material ${CMAKE_SOURCE_DIR}/src/Mod/Material ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_DATADIR}/Mod/Material