Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,13 @@ DataFrameClustering::DataFrameClustering()
method_, [](const auto& p) { return p.getSelectedIdentifier() == "spectral"; });

method_.set("agglo");

dataFrame_.onChange([&]() { onDataFrameChange(); });
}

void DataFrameClustering::process() {
if (dataFrame_.isChanged()) {
onDataFrameChange();
}

pybind11::list cols;
for (auto& p : columns_.getPropertiesByType<BoolProperty>()) {
if (p->getVisible() && p->get()) {
Expand Down
20 changes: 13 additions & 7 deletions misc/vtk/include/inviwo/vtk/processors/vtkgenericprocessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,6 @@ inline void updateFieldSelection(vtkDataObject::FieldAssociations assoc, vtkData

void setupFieldSelection(Inport* inport, auto& wrapper) {
if (auto* vtkinport = dynamic_cast<vtk::VtkInport*>(inport)) {
vtkinport->onChange([port = vtkinport, w = &wrapper]() {
if (port->isReady()) {
updateFieldSelection(w->fieldAssociation.get(), port->getData(), w->name);
}
});
wrapper.fieldAssociation.onChange([port = vtkinport, w = &wrapper]() {
if (port->isReady()) {
updateFieldSelection(w->fieldAssociation.get(), port->getData(), w->name);
Expand Down Expand Up @@ -269,8 +264,19 @@ class VTKGenericProcessor : public Processor {

virtual void process() override {
bool ready = true;
util::for_each_in_tuple([&](auto& wrapper) { ready &= wrapper.set(*filter_); },
traits_.properties);
util::for_each_in_tuple(
[&](auto& wrapper) {
if constexpr (std::is_base_of_v<FieldSelection, std::decay_t<decltype(wrapper)>>) {
auto* inport = getInport(wrapper.inport);
if (const auto* vtkinport = dynamic_cast<vtk::VtkInport*>(inport);
vtkinport && vtkinport->isChanged() && vtkinport->isReady()) {
updateFieldSelection(wrapper.fieldAssociation.get(), vtkinport->getData(),
wrapper.name);
}
}
ready &= wrapper.set(*filter_);
},
traits_.properties);

if (!ready) return;

Expand Down
Loading