Additional objects to handle Analysises
This commit is contained in:
parent
95e19226c1
commit
63adaeb9fc
|
@ -39,6 +39,7 @@ SET(Python_SRCS
|
|||
HypothesisPy.cpp
|
||||
HypothesisPy.h
|
||||
)
|
||||
SOURCE_GROUP("Python" FILES ${Python_SRCS})
|
||||
|
||||
SET(Mod_SRCS
|
||||
AppFem.cpp
|
||||
|
@ -46,10 +47,25 @@ SET(Mod_SRCS
|
|||
PreCompiled.cpp
|
||||
PreCompiled.h
|
||||
)
|
||||
SOURCE_GROUP("Module" FILES ${Mod_SRCS})
|
||||
|
||||
SET(Fem_SRCS
|
||||
|
||||
SET(FemBase_SRCS
|
||||
FemMeshObject.cpp
|
||||
FemMeshObject.h
|
||||
FemMeshShapeObject.cpp
|
||||
FemMeshShapeObject.h
|
||||
FemAnalysis.cpp
|
||||
FemAnalysis.h
|
||||
FemMesh.cpp
|
||||
FemMesh.h
|
||||
FemMeshProperty.cpp
|
||||
FemMeshProperty.h
|
||||
)
|
||||
SOURCE_GROUP("Base types" FILES ${FemBase_SRCS})
|
||||
|
||||
|
||||
SET(FemSet_SRCS
|
||||
FemSetObject.cpp
|
||||
FemSetObject.h
|
||||
FemSetNodesObject.cpp
|
||||
|
@ -60,10 +76,10 @@ SET(Fem_SRCS
|
|||
FemSetFacesObject.h
|
||||
FemSetGeometryObject.cpp
|
||||
FemSetGeometryObject.h
|
||||
FemMesh.cpp
|
||||
FemMesh.h
|
||||
FemMeshProperty.cpp
|
||||
FemMeshProperty.h
|
||||
)
|
||||
SOURCE_GROUP("Set objects" FILES ${FemSet_SRCS})
|
||||
|
||||
SET(FemConstraints_SRCS
|
||||
FemConstraint.cpp
|
||||
FemConstraint.h
|
||||
FemConstraintBearing.h
|
||||
|
@ -76,13 +92,18 @@ SET(Fem_SRCS
|
|||
FemConstraintGear.h
|
||||
FemConstraintPulley.cpp
|
||||
FemConstraintPulley.h
|
||||
)
|
||||
SOURCE_GROUP("Constraints" FILES ${FemConstraints_SRCS})
|
||||
|
||||
SET(Fem_SRCS
|
||||
${FemBase_SRCS}
|
||||
${FemSet_SRCS}
|
||||
${FemConstraints_SRCS}
|
||||
${Mod_SRCS}
|
||||
${Python_SRCS}
|
||||
)
|
||||
|
||||
|
||||
SOURCE_GROUP("Python" FILES ${Python_SRCS})
|
||||
SOURCE_GROUP("Module" FILES ${Mod_SRCS})
|
||||
|
||||
add_library(Fem SHARED ${Fem_SRCS})
|
||||
target_link_libraries(Fem ${Fem_LIBS})
|
||||
|
|
65
src/Mod/Fem/App/FemAnalysis.cpp
Normal file
65
src/Mod/Fem/App/FemAnalysis.cpp
Normal file
|
@ -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 *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
#include "PreCompiled.h"
|
||||
|
||||
#ifndef _PreComp_
|
||||
#endif
|
||||
|
||||
#include "FemAnalysis.h"
|
||||
#include <App/DocumentObjectPy.h>
|
||||
#include <Base/Placement.h>
|
||||
|
||||
using namespace Fem;
|
||||
using namespace App;
|
||||
|
||||
PROPERTY_SOURCE(Fem::FemAnalysis, App::DocumentObject)
|
||||
|
||||
|
||||
FemAnalysis::FemAnalysis()
|
||||
{
|
||||
ADD_PROPERTY_TYPE(Member,(0), "Analysis member",Prop_None,"All objects belonging to the Analysis");
|
||||
}
|
||||
|
||||
FemAnalysis::~FemAnalysis()
|
||||
{
|
||||
}
|
||||
|
||||
short FemAnalysis::mustExecute(void) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
PyObject *FemAnalysis::getPyObject()
|
||||
{
|
||||
if (PythonObject.is(Py::_None())){
|
||||
// ref counter is set to 1
|
||||
PythonObject = Py::Object(new DocumentObjectPy(this),true);
|
||||
}
|
||||
return Py::new_reference_to(PythonObject);
|
||||
}
|
||||
|
||||
void FemAnalysis::onChanged(const Property* prop)
|
||||
{
|
||||
App::DocumentObject::onChanged(prop);
|
||||
}
|
64
src/Mod/Fem/App/FemAnalysis.h
Normal file
64
src/Mod/Fem/App/FemAnalysis.h
Normal file
|
@ -0,0 +1,64 @@
|
|||
/***************************************************************************
|
||||
* 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_FemAnalysis_H
|
||||
#define Fem_FemAnalysis_H
|
||||
|
||||
|
||||
#include <App/DocumentObject.h>
|
||||
#include <App/PropertyLinks.h>
|
||||
|
||||
|
||||
namespace Fem
|
||||
{
|
||||
|
||||
class AppFemExport FemAnalysis : public App::DocumentObject
|
||||
{
|
||||
PROPERTY_HEADER(Fem::FemAnalysis);
|
||||
|
||||
public:
|
||||
/// Constructor
|
||||
FemAnalysis(void);
|
||||
virtual ~FemAnalysis();
|
||||
|
||||
/// returns the type name of the ViewProvider
|
||||
virtual const char* getViewProviderName(void) const {
|
||||
return "FemGui::ViewProviderFemAnalysis";
|
||||
}
|
||||
virtual App::DocumentObjectExecReturn *execute(void) {
|
||||
return App::DocumentObject::StdReturn;
|
||||
}
|
||||
virtual short mustExecute(void) const;
|
||||
virtual PyObject *getPyObject(void);
|
||||
|
||||
App::PropertyLinkList Member;
|
||||
|
||||
protected:
|
||||
/// get called by the container when a property has changed
|
||||
virtual void onChanged (const App::Property* prop);
|
||||
};
|
||||
|
||||
} //namespace Fem
|
||||
|
||||
|
||||
#endif // Fem_FemAnalysis_H
|
65
src/Mod/Fem/App/FemMeshShapeObject.cpp
Normal file
65
src/Mod/Fem/App/FemMeshShapeObject.cpp
Normal file
|
@ -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 *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
#include "PreCompiled.h"
|
||||
|
||||
#ifndef _PreComp_
|
||||
#endif
|
||||
|
||||
#include "FemMeshShapeObject.h"
|
||||
#include <App/DocumentObjectPy.h>
|
||||
#include <Base/Placement.h>
|
||||
|
||||
using namespace Fem;
|
||||
using namespace App;
|
||||
|
||||
PROPERTY_SOURCE(Fem::FemMeshShapeObject, Fem::FemMeshShapeObject)
|
||||
|
||||
|
||||
FemMeshShapeObject::FemMeshShapeObject()
|
||||
{
|
||||
ADD_PROPERTY_TYPE(FemMesh,(), "FEM Mesh",Prop_None,"FEM Mesh object");
|
||||
}
|
||||
|
||||
FemMeshShapeObject::~FemMeshShapeObject()
|
||||
{
|
||||
}
|
||||
|
||||
short FemMeshShapeObject::mustExecute(void) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
PyObject *FemMeshShapeObject::getPyObject()
|
||||
{
|
||||
if (PythonObject.is(Py::_None())){
|
||||
// ref counter is set to 1
|
||||
PythonObject = Py::Object(new DocumentObjectPy(this),true);
|
||||
}
|
||||
return Py::new_reference_to(PythonObject);
|
||||
}
|
||||
|
||||
void FemMeshShapeObject::onChanged(const Property* prop)
|
||||
{
|
||||
App::GeoFeature::onChanged(prop);
|
||||
}
|
64
src/Mod/Fem/App/FemMeshShapeObject.h
Normal file
64
src/Mod/Fem/App/FemMeshShapeObject.h
Normal file
|
@ -0,0 +1,64 @@
|
|||
/***************************************************************************
|
||||
* 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_FemMeshShapeObject_H
|
||||
#define Fem_FemMeshShapeObject_H
|
||||
|
||||
|
||||
#include "FemMesh.h"
|
||||
#include "FemMeshObject.h"
|
||||
#include "FemMeshProperty.h"
|
||||
|
||||
namespace Fem
|
||||
{
|
||||
|
||||
class AppFemExport FemMeshShapeObject : public FemMeshObject
|
||||
{
|
||||
PROPERTY_HEADER(Fem::FemMeshShapeObject);
|
||||
|
||||
public:
|
||||
/// Constructor
|
||||
FemMeshShapeObject(void);
|
||||
virtual ~FemMeshShapeObject();
|
||||
|
||||
/// returns the type name of the ViewProvider
|
||||
virtual const char* getViewProviderName(void) const {
|
||||
return "FemGui::ViewProviderFemMeshShape";
|
||||
}
|
||||
virtual App::DocumentObjectExecReturn *execute(void) {
|
||||
return App::DocumentObject::StdReturn;
|
||||
}
|
||||
virtual short mustExecute(void) const;
|
||||
virtual PyObject *getPyObject(void);
|
||||
|
||||
App::PropertyLink Shape;
|
||||
|
||||
protected:
|
||||
/// get called by the container when a property has changed
|
||||
virtual void onChanged (const App::Property* prop);
|
||||
};
|
||||
|
||||
} //namespace Fem
|
||||
|
||||
|
||||
#endif // Fem_FemMeshShapeObject_H
|
Loading…
Reference in New Issue
Block a user