X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FFeaturesPlugin%2FFeaturesPlugin_Validators.cpp;h=0de4d856a96de2bc262914492e50ad51b971cb81;hb=fb54db5e1466b16dfc029c4a7364a67a9a6a8c24;hp=2230d9eb2458939a525a01b8937d849a06be5e27;hpb=d44671b5418920fef3264b53af7e62a8f8cb2bb7;p=modules%2Fshaper.git diff --git a/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp b/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp index 2230d9eb2..0de4d856a 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp @@ -155,7 +155,7 @@ bool FeaturesPlugin_ValidatorBaseForGeneration::isValidAttribute(const Attribute GeomValidators_ShapeType aShapeTypeValidator; if(!aShapeTypeValidator.isValid(anAttr, theArguments, theError)) { theError = "Selected shape has unacceptable type. Acceptable types are: faces or wires on sketch, \ - whole sketch(if it has at least one face), and whole objects with shape types: "; +whole sketch(if it has at least one face), and whole objects with shape types: "; std::list::const_iterator anIt = theArguments.cbegin(); theError += *anIt; for(++anIt; anIt != theArguments.cend(); ++anIt) { @@ -222,21 +222,13 @@ bool FeaturesPlugin_ValidatorCanBeEmpty::isValid(const std::shared_ptr& theArguments, std::string& theError) const { - if(theArguments.size() != 5 && theArguments.size() != 6) { - theError = "Validator should be used with 6 parameters for extrusion and with 5 for revolution."; + if(theArguments.size() != 2) { + theError = "Validator should be used with 2 parameters for extrusion."; return false; } std::list::const_iterator anArgsIt = theArguments.begin(), aLast = theArguments.end(); - std::string aSelectedMethod; - if(theFeature->string(*anArgsIt)) { - aSelectedMethod = theFeature->string(*anArgsIt)->value(); - } - ++anArgsIt; - std::string aCreationMethod = *anArgsIt; - ++anArgsIt; - AttributePtr aCheckAttribute = theFeature->attribute(*anArgsIt); ++anArgsIt; @@ -244,33 +236,26 @@ bool FeaturesPlugin_ValidatorCanBeEmpty::isValid(const std::shared_ptrselection(*anArgsIt); + if(!aSelAttr.get()) { + theError = "Could not get selection attribute \"" + *anArgsIt + "\"."; + return false; } - for(; anArgsIt != theArguments.cend(); ++anArgsIt) { - AttributeSelectionPtr aSelAttr = theFeature->selection(*anArgsIt); - if(!aSelAttr.get()) { - theError = "Could not get selection attribute \"" + *anArgsIt + "\"."; + GeomShapePtr aShape = aSelAttr->value(); + if(!aShape.get()) { + ResultPtr aContext = aSelAttr->context(); + if(!aContext.get()) { + theError = "Selection attribute \"" + *anArgsIt + "\" can not be empty."; return false; } - GeomShapePtr aShape = aSelAttr->value(); - if(!aShape.get()) { - ResultPtr aContext = aSelAttr->context(); - if(!aContext.get()) { - theError = "Selection attribute \"" + *anArgsIt + "\" can not be empty."; - return false; - } - - aShape = aContext->shape(); - } + aShape = aContext->shape(); + } - if(!aShape.get()) { - theError = "Selection attribute \"" + *anArgsIt + "\" can not be empty."; - return false; - } + if(!aShape.get()) { + theError = "Selection attribute \"" + *anArgsIt + "\" can not be empty."; + return false; } return true;