X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomValidators%2FGeomValidators_Positive.cpp;h=9d3fbf983cbb233da6fbd89d8ee71c3aae325a99;hb=0cea3be102af7247b2fe2c8035a1bb38b7bf82ae;hp=58964c04f985a1ce4f9afc8bedd3c83f8ebc6926;hpb=7bf19255421b34594c7b0a76d0ce28166d0ce895;p=modules%2Fshaper.git diff --git a/src/GeomValidators/GeomValidators_Positive.cpp b/src/GeomValidators/GeomValidators_Positive.cpp index 58964c04f..9d3fbf983 100644 --- a/src/GeomValidators/GeomValidators_Positive.cpp +++ b/src/GeomValidators/GeomValidators_Positive.cpp @@ -6,6 +6,7 @@ #include "GeomValidators_Positive.h" #include +#include #include #include @@ -23,7 +24,11 @@ GeomValidators_Positive::GeomValidators_Positive() bool GeomValidators_Positive::isValid( const AttributePtr& theAttribute, const std::list& theArguments) const { - std::shared_ptr aDouble = + AttributeDoublePtr aDouble = std::dynamic_pointer_cast(theAttribute); - return aDouble->isInitialized() && aDouble->value() > 1.e-5; + if (aDouble.get()) + return aDouble->isInitialized() && aDouble->value() > 1.e-5; + AttributeIntegerPtr aInteger = + std::dynamic_pointer_cast(theAttribute); + return aInteger->isInitialized() && aInteger->value() > 0; }