diff --git a/src/Mod/Fem/App/FemMesh.cpp b/src/Mod/Fem/App/FemMesh.cpp index 47a7c9e1f7..0b383b5942 100644 --- a/src/Mod/Fem/App/FemMesh.cpp +++ b/src/Mod/Fem/App/FemMesh.cpp @@ -2596,6 +2596,23 @@ Data::Segment* FemMesh::getSubElement(const char* /*Type*/, unsigned long /*n*/) return nullptr; } +void FemMesh::getPoints(std::vector &Points, + std::vector & /*Normals*/, + double /*Accuracy*/, uint16_t /*flags*/) const +{ + const SMESHDS_Mesh* data = getSMesh()->GetMeshDS(); + std::vector nodes; + nodes.reserve(data->NbNodes()); + + SMDS_NodeIteratorPtr aNodeIter = data->nodesIterator(); + for (;aNodeIter->more();) { + const SMDS_MeshNode* aNode = aNodeIter->next(); + nodes.emplace_back(aNode->X(), aNode->Y(), aNode->Z()); + } + + Points = transformPointsToOutside(nodes); +} + struct Fem::FemMesh::FemMeshInfo FemMesh::getInfo() const{ struct FemMeshInfo rtrn; diff --git a/src/Mod/Fem/App/FemMesh.h b/src/Mod/Fem/App/FemMesh.h index eac622822c..568a9af6c0 100644 --- a/src/Mod/Fem/App/FemMesh.h +++ b/src/Mod/Fem/App/FemMesh.h @@ -85,6 +85,10 @@ public: unsigned long countSubElements(const char* Type) const override; /// get the subelement by type and number Data::Segment* getSubElement(const char* Type, unsigned long) const override; + /** Get points from object with given accuracy */ + void getPoints(std::vector &Points, + std::vector &Normals, + double Accuracy, uint16_t flags=0) const override; //@} /** @name search and retrieval */ diff --git a/src/Mod/Fem/App/FemMeshObject.cpp b/src/Mod/Fem/App/FemMeshObject.cpp index 27656ec352..36814b3315 100644 --- a/src/Mod/Fem/App/FemMeshObject.cpp +++ b/src/Mod/Fem/App/FemMeshObject.cpp @@ -22,7 +22,7 @@ #include "PreCompiled.h" -#include +#include #include #include @@ -56,7 +56,7 @@ PyObject *FemMeshObject::getPyObject() { if (PythonObject.is(Py::_None())){ // ref counter is set to 1 - PythonObject = Py::Object(new DocumentObjectPy(this), true); + PythonObject = Py::asObject(new GeoFeaturePy(this)); } return Py::new_reference_to(PythonObject); } @@ -84,7 +84,7 @@ template<> const char* Fem::FemMeshObjectPython::getViewProviderName() const { template<> PyObject* Fem::FemMeshObjectPython::getPyObject() { if (PythonObject.is(Py::_None())) { // ref counter is set to 1 - PythonObject = Py::Object(new App::FeaturePythonPyT(this), true); + PythonObject = Py::asObject(new App::FeaturePythonPyT(this)); } return Py::new_reference_to(PythonObject); } diff --git a/src/Mod/Fem/App/FemMeshObject.h b/src/Mod/Fem/App/FemMeshObject.h index 2ef63eeeaf..5360686d31 100644 --- a/src/Mod/Fem/App/FemMeshObject.h +++ b/src/Mod/Fem/App/FemMeshObject.h @@ -51,6 +51,9 @@ public: } short mustExecute() const override; PyObject *getPyObject() override; + const App::PropertyComplexGeoData* getPropertyOfGeometry() const override { + return &FemMesh; + } PropertyFemMesh FemMesh;