Fem: Implement basic python filter functionality and glyph example

This commit is contained in:
Stefan Tröger
2025-02-13 19:35:10 +01:00
parent bb0c06e8f7
commit 9430bdde01
33 changed files with 1793 additions and 166 deletions

View File

@@ -42,6 +42,10 @@
#include <vtkXMLUnstructuredGridReader.h>
#endif
#ifdef BUILD_FEM_VTK_WRAPPER
#include <vtkPythonUtil.h>
#endif
#include <App/Application.h>
#include <App/DocumentObject.h>
#include <Base/Console.h>
@@ -162,12 +166,26 @@ int PropertyPostDataObject::getDataType()
PyObject* PropertyPostDataObject::getPyObject()
{
// TODO: fetch the vtk python object from the data set and return it
return Py::new_reference_to(Py::None());
#ifdef BUILD_FEM_VTK_WRAPPER
//create a copy first
auto copy = static_cast<PropertyPostDataObject*>(Copy());
// get the data python wrapper
PyObject* py_dataset = vtkPythonUtil::GetObjectFromPointer(copy->getValue());
auto result = Py::new_reference_to(py_dataset);
delete copy;
return result;
#else
PyErr_SetString(PyExc_NotImplementedError, "VTK python wrapper not available");
Py_Return;
#endif
}
void PropertyPostDataObject::setPyObject(PyObject* /*value*/)
{}
{
throw Base::NotImplementedError();
}
App::Property* PropertyPostDataObject::Copy() const
{