| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| |
|
| | #include <App/FeaturePythonPyImp.h> |
| | #include <App/GeoFeaturePy.h> |
| | #include <Base/Placement.h> |
| |
|
| | #include "FemMesh.h" |
| | #include "FemMeshObject.h" |
| |
|
| |
|
| | using namespace Fem; |
| | using namespace App; |
| |
|
| | PROPERTY_SOURCE(Fem::FemMeshObject, App::GeoFeature) |
| |
|
| |
|
| | FemMeshObject::FemMeshObject() |
| | { |
| | ADD_PROPERTY_TYPE(FemMesh, (), "FEM Mesh", Prop_NoRecompute, "FEM Mesh object"); |
| | |
| | |
| |
|
| | suppressibleExt.initExtension(this); |
| | } |
| |
|
| | FemMeshObject::~FemMeshObject() = default; |
| |
|
| | short FemMeshObject::mustExecute() const |
| | { |
| | return 0; |
| | } |
| |
|
| | PyObject* FemMeshObject::getPyObject() |
| | { |
| | if (PythonObject.is(Py::_None())) { |
| | |
| | PythonObject = Py::asObject(new GeoFeaturePy(this)); |
| | } |
| | return Py::new_reference_to(PythonObject); |
| | } |
| |
|
| | void FemMeshObject::onChanged(const Property* prop) |
| | { |
| | App::GeoFeature::onChanged(prop); |
| |
|
| | |
| | if (prop == &this->Placement) { |
| | this->FemMesh.setTransform(this->Placement.getValue().toMatrix()); |
| | } |
| | } |
| |
|
| | |
| |
|
| | namespace App |
| | { |
| | |
| | PROPERTY_SOURCE_TEMPLATE(Fem::FemMeshObjectPython, Fem::FemMeshObject) |
| | template<> |
| | const char* Fem::FemMeshObjectPython::getViewProviderName() const |
| | { |
| | return "FemGui::ViewProviderFemMeshPython"; |
| | } |
| |
|
| | template<> |
| | PyObject* Fem::FemMeshObjectPython::getPyObject() |
| | { |
| | if (PythonObject.is(Py::_None())) { |
| | |
| | PythonObject = Py::asObject(new App::FeaturePythonPyT<App::GeoFeaturePy>(this)); |
| | } |
| | return Py::new_reference_to(PythonObject); |
| | } |
| |
|
| | |
| | template class FemExport FeaturePythonT<Fem::FemMeshObject>; |
| |
|
| | |
| |
|
| | } |
| |
|