Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions src/DatasetsAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ DatasetsAction::DatasetsAction(QObject* parent, const QString& title) :
if (scatterplotPlugin == nullptr)
return;

auto& settingsAction = scatterplotPlugin->getSettingsAction();
auto& settingsAction = *dynamic_cast<SettingsAction*>(parent);
auto& plotAction = settingsAction.getPlotAction();
auto& pointPlotAction = plotAction.getPointPlotAction();

Expand Down Expand Up @@ -132,7 +132,7 @@ void DatasetsAction::setupPositionDatasetPickerAction(ScatterplotPlugin* scatter

void DatasetsAction::setupColorDatasetPickerAction(ScatterplotPlugin* scatterplotPlugin)
{
auto& settingsAction = scatterplotPlugin->getSettingsAction();
auto& settingsAction = *dynamic_cast<SettingsAction*>(parent());

_colorDatasetPickerAction.setFilterFunction([this, scatterplotPlugin](mv::Dataset<DatasetImpl> dataset) -> bool {
if (!(dataset->getDataType() == PointType || dataset->getDataType() == ColorType || dataset->getDataType() == ClusterType))
Expand Down
6 changes: 3 additions & 3 deletions src/DensityPlotAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ void DensityPlotAction::initialize(ScatterplotPlugin* scatterplotPlugin)
_scatterplotPlugin = scatterplotPlugin;

const auto computeDensity = [this]() -> void {
if (static_cast<std::int32_t>(_scatterplotPlugin->getSettingsAction().getRenderModeAction().getCurrentIndex()) == ScatterplotWidget::RenderMode::SCATTERPLOT)
if (static_cast<std::int32_t>(dynamic_cast<SettingsAction*>(parent()->parent())->getRenderModeAction().getCurrentIndex()) == ScatterplotWidget::RenderMode::SCATTERPLOT)
return;

_scatterplotPlugin->getScatterplotWidget().setSigma(_sigmaAction.getValue());

const auto maxDensity = _scatterplotPlugin->getScatterplotWidget().getDensityRenderer().getMaxDensity();

if (maxDensity > 0)
_scatterplotPlugin->getSettingsAction().getColoringAction().getColorMap1DAction().getRangeAction(ColorMapAction::Axis::X).setRange({ 0.0f, maxDensity });
dynamic_cast<SettingsAction*>(parent()->parent())->getColoringAction().getColorMap1DAction().getRangeAction(ColorMapAction::Axis::X).setRange({ 0.0f, maxDensity });
};

connect(&_sigmaAction, &DecimalAction::valueChanged, this, computeDensity);
Expand All @@ -59,7 +59,7 @@ void DensityPlotAction::initialize(ScatterplotPlugin* scatterplotPlugin)
computeDensity();
});

connect(&_scatterplotPlugin->getSettingsAction().getRenderModeAction(), &OptionAction::currentIndexChanged, this, computeDensity);
connect(&dynamic_cast<SettingsAction*>(parent()->parent())->getRenderModeAction(), &OptionAction::currentIndexChanged, this, computeDensity);

updateSigmaAction();
computeDensity();
Expand Down
Loading
Loading