FEM: Ensure post task dialogs work without VTK python build

This commit is contained in:
Stefan Tröger
2025-05-09 10:02:50 +02:00
parent 64d864c944
commit d50a98b9cf
3 changed files with 18 additions and 1 deletions

View File

@@ -31,8 +31,10 @@
#include "TaskPostBoxes.h"
#include "ViewProviderFemPostFilter.h"
#include "ViewProviderFemPostFilterPy.h"
#include "TaskPostExtraction.h"
#ifdef FC_USE_VTK_PYTHON
#include "TaskPostExtraction.h"
#endif
using namespace FemGui;
@@ -91,9 +93,11 @@ void ViewProviderFemPostDataAlongLine::setupTaskDialog(TaskDlgPost* dlg)
auto panel = new TaskPostDataAlongLine(this);
dlg->addTaskBox(panel->getIcon(), panel);
#ifdef FC_USE_VTK_PYTHON
// and the extraction
auto extr_panel = new TaskPostExtraction(this);
dlg->addTaskBox(extr_panel->windowIcon().pixmap(32), extr_panel);
#endif
}
@@ -144,9 +148,11 @@ void ViewProviderFemPostDataAtPoint::setupTaskDialog(TaskDlgPost* dlg)
auto panel = new TaskPostDataAtPoint(this);
dlg->addTaskBox(panel->getIcon(), panel);
#ifdef FC_USE_VTK_PYTHON
// and the extraction
auto extr_panel = new TaskPostExtraction(this);
dlg->addTaskBox(extr_panel->windowIcon().pixmap(32), extr_panel);
#endif
}

View File

@@ -27,7 +27,9 @@
#include <Gui/PythonWrapper.h>
#include "ViewProviderFemPostFilter.h"
#include "TaskPostBoxes.h"
#ifdef FC_USE_VTK_PYTHON
#include "TaskPostExtraction.h"
#endif
// inclusion of the generated files (generated out of ViewProviderFemPostFilterPy.xml)
#include "ViewProviderFemPostFilterPy.h"
#include "ViewProviderFemPostFilterPy.cpp"
@@ -63,6 +65,7 @@ PyObject* ViewProviderFemPostFilterPy::createDisplayTaskWidget(PyObject* args)
PyObject* ViewProviderFemPostFilterPy::createExtractionTaskWidget(PyObject* args)
{
#ifdef FC_USE_VTK_PYTHON
// we take no arguments
if (!PyArg_ParseTuple(args, "")) {
return nullptr;
@@ -77,6 +80,10 @@ PyObject* ViewProviderFemPostFilterPy::createExtractionTaskWidget(PyObject* args
PyErr_SetString(PyExc_TypeError, "creating the panel failed");
return nullptr;
#else
PyErr_SetString(PyExc_NotImplementedError, "VTK python wrapper not available");
Py_Return;
#endif
}
PyObject* ViewProviderFemPostFilterPy::getCustomAttributes(const char* /*attr*/) const

View File

@@ -67,7 +67,9 @@
#include <Mod/Fem/App/FemPostFilter.h>
#include "TaskPostBoxes.h"
#ifdef FC_USE_VTK_PYTHON
#include "TaskPostExtraction.h"
#endif
#include "ViewProviderAnalysis.h"
#include "ViewProviderFemPostObject.h"
@@ -1024,8 +1026,10 @@ void ViewProviderFemPostObject::setupTaskDialog(TaskDlgPost* dlg)
auto disp_panel = new TaskPostDisplay(this);
dlg->addTaskBox(disp_panel->windowIcon().pixmap(32), disp_panel);
#ifdef FC_USE_VTK_PYTHON
auto extr_panel = new TaskPostExtraction(this);
dlg->addTaskBox(extr_panel->windowIcon().pixmap(32), extr_panel);
#endif
}
void ViewProviderFemPostObject::unsetEdit(int ModNum)