FEM: Draft architecture of post data extraction with histogram example
This commit is contained in:
@@ -29,6 +29,10 @@
|
||||
#include "FemPostObjectPy.h"
|
||||
#include "FemPostObjectPy.cpp"
|
||||
|
||||
#ifdef BUILD_FEM_VTK_WRAPPER
|
||||
#include <vtkDataSet.h>
|
||||
#include <vtkPythonUtil.h>
|
||||
#endif //BUILD_FEM_VTK
|
||||
|
||||
using namespace Fem;
|
||||
|
||||
@@ -55,6 +59,27 @@ PyObject* FemPostObjectPy::writeVTK(PyObject* args)
|
||||
Py_Return;
|
||||
}
|
||||
|
||||
PyObject* FemPostObjectPy::getDataSet(PyObject* args)
|
||||
{
|
||||
#ifdef BUILD_FEM_VTK_WRAPPER
|
||||
// we take no arguments
|
||||
if (!PyArg_ParseTuple(args, "")) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// return python object for the dataset
|
||||
auto dataset = getFemPostObjectPtr()->getDataSet();
|
||||
if (dataset) {
|
||||
PyObject* py_algorithm = vtkPythonUtil::GetObjectFromPointer(dataset);
|
||||
return Py::new_reference_to(py_algorithm);
|
||||
}
|
||||
return Py_None;
|
||||
#else
|
||||
PyErr_SetString(PyExc_NotImplementedError, "VTK python wrapper not available");
|
||||
Py_Return;
|
||||
#endif
|
||||
}
|
||||
|
||||
PyObject* FemPostObjectPy::getCustomAttributes(const char* /*attr*/) const
|
||||
{
|
||||
return nullptr;
|
||||
|
||||
Reference in New Issue
Block a user