From db1882d3239825da5ca1f23933b976fa7911132b Mon Sep 17 00:00:00 2001 From: Gennady Pospelov <g.pospelov@fz-juelich.de> Date: Tue, 21 Apr 2015 11:15:20 +0200 Subject: [PATCH] ParticleItem now can have negative depth in GUI --- Core/Algorithms/src/Simulation.cpp | 2 +- GUI/coregui/Models/ParticleItem.cpp | 2 +- GUI/coregui/Views/JobWidgets/ModelTuningDelegate.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Core/Algorithms/src/Simulation.cpp b/Core/Algorithms/src/Simulation.cpp index 0f34eb1fb0d..59b77f89983 100644 --- a/Core/Algorithms/src/Simulation.cpp +++ b/Core/Algorithms/src/Simulation.cpp @@ -161,7 +161,7 @@ void Simulation::runSimulation() boost::scoped_ptr<ParameterPool > p_param_pool(createParameterTree()); for (size_t index=0; index < param_combinations; ++index) { double weight = m_distribution_handler.setParameterValues( - p_param_pool, index); + p_param_pool.get(), index); updateSample(); runSingleSimulation(); m_intensity_map.scaleAll(weight); diff --git a/GUI/coregui/Models/ParticleItem.cpp b/GUI/coregui/Models/ParticleItem.cpp index ad175ea1272..17143fe8ac9 100644 --- a/GUI/coregui/Models/ParticleItem.cpp +++ b/GUI/coregui/Models/ParticleItem.cpp @@ -32,7 +32,7 @@ ParticleItem::ParticleItem(ParameterizedItem *parent) registerGroupProperty(P_FORM_FACTOR, Constants::FormFactorGroup); registerProperty(P_MATERIAL, MaterialUtils::getDefaultMaterialProperty().getVariant()); - registerProperty(P_DEPTH, 0.0); + registerProperty(P_DEPTH, 0.0, PropertyAttribute(AttLimits::limited(-10000.0, 10000.0), 2)); registerProperty(P_ABUNDANCE, 1.0, PropertyAttribute(AttLimits::limited(0.0, 1.0),3)); diff --git a/GUI/coregui/Views/JobWidgets/ModelTuningDelegate.cpp b/GUI/coregui/Views/JobWidgets/ModelTuningDelegate.cpp index a559c24979e..59470165306 100644 --- a/GUI/coregui/Views/JobWidgets/ModelTuningDelegate.cpp +++ b/GUI/coregui/Views/JobWidgets/ModelTuningDelegate.cpp @@ -65,7 +65,7 @@ int ModelTuningDelegate::SliderData::value_to_slider(double value) if(value == 0.0) { dr = 1.0*m_range_factor/100.; } else { - dr = value*m_range_factor/100.; + dr = std::abs(value)*m_range_factor/100.; } m_rmin = value - dr; m_rmax = value + dr; -- GitLab