Fem: Implement basic python filter functionality and glyph example
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user