X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModelAPI%2FModelAPI_ShapeValidator.cpp;h=fb03f459fbacc878155c6b552d2a9c37d3f0898f;hb=b2418a13c302e03ed5f80dbdae0cd20f0abd16af;hp=8de8d27679c530607eba6f4c06ffc619891a6e65;hpb=8babac25037f2666dcb422dd68a66dd2ed1383d8;p=modules%2Fshaper.git diff --git a/src/ModelAPI/ModelAPI_ShapeValidator.cpp b/src/ModelAPI/ModelAPI_ShapeValidator.cpp index 8de8d2767..fb03f459f 100644 --- a/src/ModelAPI/ModelAPI_ShapeValidator.cpp +++ b/src/ModelAPI/ModelAPI_ShapeValidator.cpp @@ -9,15 +9,19 @@ #include #include "ModelAPI_Object.h" -bool ModelAPI_ShapeValidator::isValid(const FeaturePtr& theFeature, - const AttributePtr& theAttribute, - const GeomShapePtr& theShape) const +bool ModelAPI_ShapeValidator::isValid(const AttributePtr& theAttribute, + const std::list& theArguments) const { + FeaturePtr aFeature = std::dynamic_pointer_cast(theAttribute->owner()); + AttributeSelectionPtr aSelectionAttribute = + std::dynamic_pointer_cast(theAttribute); + GeomShapePtr aShape = aSelectionAttribute->value(); + std::string aCurrentAttributeId = theAttribute->id(); // get all feature attributes std::list anAttrs = - theFeature->data()->attributes(ModelAPI_AttributeSelection::typeId()); - if (anAttrs.size() > 0 && theShape.get() != NULL) { + aFeature->data()->attributes(ModelAPI_AttributeSelection::typeId()); + if (anAttrs.size() > 0 && aShape.get() != NULL) { std::list::iterator anAttr = anAttrs.begin(); for(; anAttr != anAttrs.end(); anAttr++) { AttributePtr anAttribute = *anAttr; @@ -26,7 +30,7 @@ bool ModelAPI_ShapeValidator::isValid(const FeaturePtr& theFeature, AttributeSelectionPtr aSelectionAttribute = std::dynamic_pointer_cast(anAttribute); // the shape of the attribute should be not the same - if (aSelectionAttribute.get() != NULL && theShape->isEqual(aSelectionAttribute->value())) { + if (aSelectionAttribute.get() != NULL && aShape->isEqual(aSelectionAttribute->value())) { return false; } }