From 9baedc2569af283a904102bd0ad409a2d1200f66 Mon Sep 17 00:00:00 2001 From: vsv Date: Fri, 6 Mar 2015 11:14:59 +0300 Subject: [PATCH] Correction of validator for point to point distance --- src/PartSet/PartSet_Validators.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) 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, -- 2.39.2