FEM: Multiframe adoptions

- To support timedata and the relevant filters the pipeline needs to be fully setup, hence not only working on data
 - Multiblock source algorithm is needed to supply the time data for the algorithms
This commit is contained in:
Stefan Tröger
2024-11-24 16:11:53 +01:00
committed by Benjamin Nauck
parent 2119f9dfb4
commit 1cff507a7f
28 changed files with 1752 additions and 249 deletions

View File

@@ -59,6 +59,8 @@
#include "ui_TaskPostDisplay.h"
#include "ui_TaskPostScalarClip.h"
#include "ui_TaskPostWarpVector.h"
#include "ui_TaskPostFrames.h"
#include "FemSettings.h"
#include "TaskPostBoxes.h"
@@ -473,6 +475,66 @@ void TaskPostFunction::applyPythonCode()
}
// ***************************************************************************
// Frames
TaskPostFrames::TaskPostFrames(ViewProviderFemPostObject* view, QWidget* parent)
: TaskPostBox(view,
Gui::BitmapFactory().pixmap("FEM_PostFrames"),
tr("Result Frames"),
parent), ui(new Ui_TaskPostFrames)
{
// we load the views widget
proxy = new QWidget(this);
ui->setupUi(proxy);
this->groupLayout()->addWidget(proxy);
setupConnections();
// populate the data
auto pipeline = static_cast<Fem::FemPostPipeline*>(getObject());
ui->Type->setText(QString::fromStdString(pipeline->getFrameType()));
auto unit = pipeline->getFrameUnit();
auto steps = pipeline->getFrameValues();
for (unsigned long i=0; i<steps.size(); i++) {
QTableWidgetItem *idx = new QTableWidgetItem(QString::number(i));
QTableWidgetItem *value = new QTableWidgetItem(Base::Quantity(steps[i], unit).getUserString());
int rowIdx = ui->FrameTable->rowCount();
ui->FrameTable->insertRow (rowIdx);
ui->FrameTable->setItem(rowIdx, 0, idx);
ui->FrameTable->setItem(rowIdx, 1, value);
}
ui->FrameTable->selectRow(pipeline->Frame.getValue());
}
TaskPostFrames::~TaskPostFrames() = default;
void TaskPostFrames::setupConnections()
{
connect(ui->FrameTable,
qOverload<>(&QTableWidget::itemSelectionChanged),
this,
&TaskPostFrames::onSelectionChanged);
}
void TaskPostFrames::onSelectionChanged()
{
auto selection = ui->FrameTable->selectedItems();
if (selection.count() > 0) {
static_cast<Fem::FemPostPipeline*>(getObject())->Frame.setValue(selection.front()->row());
recompute();
}
}
void TaskPostFrames::applyPythonCode()
{
// we apply the views widgets python code
}
// ***************************************************************************
// in the following, the different filters sorted alphabetically
// ***************************************************************************