Commit dae1d4d0 authored by Thibaut ROMAIN's avatar Thibaut ROMAIN
Browse files

Merge branch 'GetParameterFloat-Nan' into 'develop'

BUG: Support `nan` in application parameters

Closes #2305

See merge request orfeotoolbox/otb!928
parents ce709dec c60f4ae7
Pipeline #11738 passed with stages
in 107 minutes and 46 seconds
......@@ -22,6 +22,7 @@
#define otbWrapperNumericalParameter_h
#include "otbWrapperParameter.h"
#include "otbAlgoClamp.h"
#include "itkNumericTraits.h"
#include <boost/optional.hpp>
......@@ -56,7 +57,7 @@ public:
/** Set the value */
void SetValue(ScalarType value)
{
m_Value = (value < m_MinimumValue) ? m_MinimumValue : (value < m_MaximumValue) ? value : m_MaximumValue;
m_Value = otb::clamp(value, m_MinimumValue, m_MaximumValue);
// Set Active only if the parameter is not automatically set
if (!GetAutomaticValue())
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment