X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomValidators%2FGeomValidators_Positive.cpp;h=9d3fbf983cbb233da6fbd89d8ee71c3aae325a99;hb=0cea3be102af7247b2fe2c8035a1bb38b7bf82ae;hp=d2261b357c0686c12959376d395498d26fc77579;hpb=50e082b16ea4f2fd6e94ddb6879112036a0610aa;p=modules%2Fshaper.git diff --git a/src/GeomValidators/GeomValidators_Positive.cpp b/src/GeomValidators/GeomValidators_Positive.cpp index d2261b357..9d3fbf983 100644 --- a/src/GeomValidators/GeomValidators_Positive.cpp +++ b/src/GeomValidators/GeomValidators_Positive.cpp @@ -1,9 +1,12 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + // File: GeomValidators_ValidatorPositive.cpp // Created: 16 Sep 2014 // Author: Mikhail PONIKAROV #include "GeomValidators_Positive.h" #include +#include #include #include @@ -21,7 +24,11 @@ GeomValidators_Positive::GeomValidators_Positive() bool GeomValidators_Positive::isValid( const AttributePtr& theAttribute, const std::list& theArguments) const { - boost::shared_ptr aDouble = - boost::dynamic_pointer_cast(theAttribute); - return aDouble->isInitialized() && aDouble->value() > 1.e-5; + AttributeDoublePtr aDouble = + std::dynamic_pointer_cast(theAttribute); + if (aDouble.get()) + return aDouble->isInitialized() && aDouble->value() > 1.e-5; + AttributeIntegerPtr aInteger = + std::dynamic_pointer_cast(theAttribute); + return aInteger->isInitialized() && aInteger->value() > 0; }