From: vsv Date: Fri, 6 Mar 2015 08:14:59 +0000 (+0300) Subject: Correction of validator for point to point distance X-Git-Tag: V_1.1.0~145^2~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9baedc2569af283a904102bd0ad409a2d1200f66;p=modules%2Fshaper.git Correction of validator for point to point distance --- diff --git a/src/PartSet/PartSet_Validators.cpp b/src/PartSet/PartSet_Validators.cpp index 278c3e637..92100792e 100644 --- a/src/PartSet/PartSet_Validators.cpp +++ b/src/PartSet/PartSet_Validators.cpp @@ -164,7 +164,22 @@ bool PartSet_DifferentObjectsValidator::isValid(const FeaturePtr& theFeature, const std::list& theArguments, const AttributePtr& theAttribute) const { - return PartSet_DifferentObjectsValidator::isValid(theAttribute, theArguments); + if (PartSet_DifferentObjectsValidator::isValid(theAttribute, theArguments)) { + std::list > anAttrs = + theFeature->data()->attributes(ModelAPI_AttributeRefAttr::type()); + std::list >::iterator anAttr = anAttrs.begin(); + for(; anAttr != anAttrs.end(); anAttr++) { + if (*anAttr) { + std::shared_ptr aRef = + std::dynamic_pointer_cast(*anAttr); + // check the object is already presented + if (!aRef->isObject() && aRef->attr() == theAttribute) + return false; + } + } + return true; + } + return false; } bool PartSet_DifferentObjectsValidator::isValid(const AttributePtr& theAttribute,