7 #include <fwAtoms/Numeric.hpp> 8 #include <fwAtoms/Numeric.hxx> 10 #include "fwAtomsPatch/infos/log.hpp" 11 #include "fwAtomsPatch/conditions/NumericOverflow.hpp" 19 NumericOverflow::NumericOverflow(::fwAtoms::Base::sptr defaultValue) : Abstract(defaultValue)
25 void NumericOverflow::setTreshold(::fwAtoms::Numeric::sptr treshold)
27 m_treshold = treshold;
32 bool NumericOverflow::test(::fwAtoms::Base::sptr old,
33 ::fwAtoms::Base::sptr newValue)
35 return this->test(newValue);
40 bool NumericOverflow::test(::fwAtoms::Base::sptr value)
42 if(value->isNumeric())
44 ::fwAtoms::Numeric::sptr numeric = ::fwAtoms::Numeric::dynamicCast(value);
45 return numeric->getValue<
double>() <= m_treshold->getValue<
double>();
49 fwAtomsPatchErrorLogMacro(
"the value is not a numeric");
57 NumericOverflow::sptr NumericOverflow::New(::fwAtoms::Base::sptr defaultValue)
Contains functions used to control patching process by defining conditions on objects.
Contains base functionalities used to transform objects from a version to another.
Applies condition on numeric value.