Skip to content
Snippets Groups Projects
Commit ffda6ac4 authored by Owen Arnold's avatar Owen Arnold
Browse files

Merge pull request #722 from mantidproject/11718_slice_viewer_crash_infs

Slice viewer crash.
parents 687747c2 9a5a117b
No related merge requests found
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include "MantidAPI/IMDIterator.h" #include "MantidAPI/IMDIterator.h"
#include <boost/scoped_array.hpp> #include <boost/scoped_array.hpp>
#include <boost/make_shared.hpp> #include <boost/make_shared.hpp>
#include <boost/math/special_functions/fpclassify.hpp>
using namespace Mantid::Kernel; using namespace Mantid::Kernel;
using namespace Mantid::Geometry; using namespace Mantid::Geometry;
...@@ -600,7 +601,12 @@ void MDHistoWorkspace::getLinePlot(const Mantid::Kernel::VMD &start, ...@@ -600,7 +601,12 @@ void MDHistoWorkspace::getLinePlot(const Mantid::Kernel::VMD &start,
break; break;
} }
// And add the normalized signal/error to the list too // And add the normalized signal/error to the list too
y.push_back(this->getSignalAt(linearIndex) * normalizer); auto signal = this->getSignalAt(linearIndex) * normalizer;
if (boost::math::isinf(signal)){
// The plotting library (qwt) doesn't like infs.
signal = std::numeric_limits<signal_t>::quiet_NaN();
}
y.push_back(signal);
e.push_back(this->getErrorAt(linearIndex) * normalizer); e.push_back(this->getErrorAt(linearIndex) * normalizer);
// Save the position for next bin // Save the position for next bin
lastPos = pos; lastPos = pos;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment