diff --git a/brayns/Brayns.cpp b/brayns/Brayns.cpp index 26332ab35..a627744a2 100644 --- a/brayns/Brayns.cpp +++ b/brayns/Brayns.cpp @@ -878,9 +878,6 @@ struct Brayns::Impl _keyboardHandler.registerKeyboardShortcut( 'r', "Set animation frame to 0", std::bind(&Brayns::Impl::_resetAnimationFrame, this)); - _keyboardHandler.registerKeyboardShortcut( - 'R', "Set animation frame to infinity", - std::bind(&Brayns::Impl::_infiniteAnimationFrame, this)); _keyboardHandler.registerKeyboardShortcut( 'u', "Enable/Disable shadows", std::bind(&Brayns::Impl::_toggleShadows, this)); @@ -1070,12 +1067,6 @@ struct Brayns::Impl animParams.setFrame(0); } - void _infiniteAnimationFrame() - { - auto& animParams = _parametersManager.getAnimationParameters(); - animParams.setFrame(std::numeric_limits::max()); - } - void _toggleShadows() { RenderingParameters& renderParams = diff --git a/brayns/common/volume/VolumeHandler.cpp b/brayns/common/volume/VolumeHandler.cpp index 0b966c908..6f5e4b7ae 100644 --- a/brayns/common/volume/VolumeHandler.cpp +++ b/brayns/common/volume/VolumeHandler.cpp @@ -38,7 +38,6 @@ namespace brayns VolumeHandler::VolumeHandler(const VolumeParameters& volumeParameters, const IndexMode indexMode) : _volumeParameters(volumeParameters) - , _currentIndex(std::numeric_limits::max()) , _indexMode(indexMode) { } diff --git a/brayns/common/volume/VolumeHandler.h b/brayns/common/volume/VolumeHandler.h index 8bf2c2914..af7020908 100644 --- a/brayns/common/volume/VolumeHandler.h +++ b/brayns/common/volume/VolumeHandler.h @@ -208,10 +208,10 @@ class VolumeHandler const VolumeParameters& _volumeParameters; std::map _volumeDescriptors; - uint32_t _currentIndex; + uint32_t _currentIndex{std::numeric_limits::max()}; IndexMode _indexMode; std::map _histograms; - uint64_t _nbFrames = 0; + uint64_t _nbFrames{0}; }; } diff --git a/brayns/io/simulation/CADiffusionSimulationHandler.cpp b/brayns/io/simulation/CADiffusionSimulationHandler.cpp index 088fcc6f5..77147c332 100644 --- a/brayns/io/simulation/CADiffusionSimulationHandler.cpp +++ b/brayns/io/simulation/CADiffusionSimulationHandler.cpp @@ -36,8 +36,6 @@ namespace brayns { CADiffusionSimulationHandler::CADiffusionSimulationHandler( const std::string& simulationFolder) - : _currentFrame(std::numeric_limits::max()) - , _spheresCreated(false) { BRAYNS_DEBUG << "Loading Calcium simulation from " << simulationFolder << std::endl; diff --git a/brayns/io/simulation/CADiffusionSimulationHandler.h b/brayns/io/simulation/CADiffusionSimulationHandler.h index a5df1a064..5c9031013 100644 --- a/brayns/io/simulation/CADiffusionSimulationHandler.h +++ b/brayns/io/simulation/CADiffusionSimulationHandler.h @@ -61,8 +61,8 @@ class CADiffusionSimulationHandler std::map _simulationFiles; Vector3fs _calciumPositions; - size_t _currentFrame; - bool _spheresCreated; + size_t _currentFrame{std::numeric_limits::max()}; + bool _spheresCreated{false}; }; } #endif // CADIFFUSIONSIMULATIONHANDLER_H diff --git a/brayns/parameters/AnimationParameters.h b/brayns/parameters/AnimationParameters.h index a73d3c0fa..41e73a109 100644 --- a/brayns/parameters/AnimationParameters.h +++ b/brayns/parameters/AnimationParameters.h @@ -52,8 +52,8 @@ class AnimationParameters final : public AbstractParameters uint32_t getEnd() const { return _end; } void reset() { - _updateValue(_end, std::numeric_limits::max()); - _updateValue(_current, std::numeric_limits::max()); + _updateValue(_end, 0u); + _updateValue(_current, 0u); _updateValue(_unit, std::string()); _updateValue(_dt, 0.); } @@ -66,13 +66,12 @@ class AnimationParameters final : public AbstractParameters uint32_t adjustCurrent(const uint32_t newCurrent) const { const auto nbFrames = _end - _start; - return nbFrames == 0 ? std::numeric_limits::max() - : _start + (newCurrent % nbFrames); + return nbFrames == 0 ? 0 : _start + (newCurrent % nbFrames); } uint32_t _start{0}; - uint32_t _end{std::numeric_limits::max()}; - uint32_t _current{std::numeric_limits::max()}; + uint32_t _end{0}; + uint32_t _current{0}; int32_t _delta{0}; double _dt{0}; std::string _unit; diff --git a/plugins/engines/ospray/ispc/geometry/ExtendedCones.ispc b/plugins/engines/ospray/ispc/geometry/ExtendedCones.ispc index 7831d4310..02ab2d3a6 100644 --- a/plugins/engines/ospray/ispc/geometry/ExtendedCones.ispc +++ b/plugins/engines/ospray/ispc/geometry/ExtendedCones.ispc @@ -92,7 +92,7 @@ void ExtendedCones_intersect(uniform ExtendedCones *uniform geometry, uniform float timestamp = *((uniform float *)(conePtr + geometry->offset_timestamp)); - if (timestamp > ray.time) + if (ray.time > 0 && timestamp > ray.time) return; uniform vec3f v0 = *((uniform vec3f *)(conePtr + geometry->offset_center)); diff --git a/plugins/engines/ospray/ispc/geometry/ExtendedCylinders.ispc b/plugins/engines/ospray/ispc/geometry/ExtendedCylinders.ispc index 784aee054..f672a70d8 100644 --- a/plugins/engines/ospray/ispc/geometry/ExtendedCylinders.ispc +++ b/plugins/engines/ospray/ispc/geometry/ExtendedCylinders.ispc @@ -75,7 +75,7 @@ void ExtendedCylinders_intersect(uniform ExtendedCylinders *uniform geometry, uniform float timestamp = *((uniform float *)(cylinderPtr + geometry->offset_timestamp)); - if (timestamp > ray.time) + if (ray.time > 0 && timestamp > ray.time) return; if (geometry->offset_radius >= 0) diff --git a/plugins/engines/ospray/ispc/geometry/ExtendedSpheres.ispc b/plugins/engines/ospray/ispc/geometry/ExtendedSpheres.ispc index cf5bf1626..a18ce0d28 100644 --- a/plugins/engines/ospray/ispc/geometry/ExtendedSpheres.ispc +++ b/plugins/engines/ospray/ispc/geometry/ExtendedSpheres.ispc @@ -149,7 +149,7 @@ void ExtendedSpheres_intersect(uniform ExtendedSpheres *uniform geometry, uniform float timestamp = *((uniform float *)(spherePtr + geometry->offset_timestamp)); - if (timestamp > ray.time) + if (ray.time > 0 && timestamp > ray.time) return; uniform float radius = geometry->radius; diff --git a/tests/brayns.cpp b/tests/brayns.cpp index 464b73842..e88815c5e 100644 --- a/tests/brayns.cpp +++ b/tests/brayns.cpp @@ -123,8 +123,7 @@ BOOST_AUTO_TEST_CASE(defaults) std::numeric_limits::min()); const auto& animParams = pm.getAnimationParameters(); - BOOST_CHECK_EQUAL(animParams.getFrame(), - std::numeric_limits::max()); + BOOST_CHECK_EQUAL(animParams.getFrame(), 0); const auto& volumeParams = pm.getVolumeParameters(); BOOST_CHECK_EQUAL(volumeParams.getDimensions(), brayns::Vector3ui(0, 0, 0));