X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FFeaturesPlugin%2FFeaturesPlugin_Validators.cpp;h=5f27c10ce8af8fc3a349e28e890b610f396bff35;hb=596cc06a3cdc89783d15e893e7da4b6b882fb442;hp=ff7d8cb391a1963bea496a14eba4ca6c7134ce00;hpb=64981a525f8bc2c450475822e96dcc2766454ad3;p=modules%2Fshaper.git diff --git a/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp b/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp index ff7d8cb39..5f27c10ce 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp @@ -15,9 +15,11 @@ #include #include #include +#include #include #include #include +#include #include #include @@ -42,7 +44,8 @@ bool FeaturesPlugin_ValidatorPipePath::isValid(const AttributePtr& theAttribute, const std::list& theArguments, Events_InfoMessage& theError) const { - AttributeSelectionPtr aPathAttrSelection = std::dynamic_pointer_cast(theAttribute); + AttributeSelectionPtr aPathAttrSelection = + std::dynamic_pointer_cast(theAttribute); if(!aPathAttrSelection.get()) { theError = "Error: This validator can only work with path selector in \"Pipe\" feature."; return false; @@ -55,7 +58,8 @@ bool FeaturesPlugin_ValidatorPipePath::isValid(const AttributePtr& theAttribute, return false; } GeomShapePtr aContextShape = aContext->shape(); - if(aPathShape.get() && aPathShape->shapeType() == GeomAPI_Shape::WIRE && !aPathShape->isEqual(aContextShape)) { + if(aPathShape.get() && aPathShape->shapeType() == GeomAPI_Shape::WIRE && + !aPathShape->isEqual(aContextShape)) { theError = "Error: Local selection of wires not allowed."; return false; } @@ -64,22 +68,25 @@ bool FeaturesPlugin_ValidatorPipePath::isValid(const AttributePtr& theAttribute, } //================================================================================================== -bool FeaturesPlugin_ValidatorPipeLocations::isValid(const std::shared_ptr& theFeature, - const std::list& theArguments, - Events_InfoMessage& theError) const +bool FeaturesPlugin_ValidatorPipeLocations::isValid( + const std::shared_ptr& theFeature, + const std::list& theArguments, + Events_InfoMessage& theError) const { static const std::string aCreationMethodID = "creation_method"; static const std::string aBaseObjectsID = "base_objects"; static const std::string aLocationsID = "locations_objects"; if(theFeature->getKind() != "Pipe") { - theError = "Error: Feature \"" + theFeature->getKind() + "\" does not supported by this validator."; + theError = "Error: Feature \"%1\" does not supported by this validator."; + theError.arg(theFeature->getKind()); return false; } AttributeStringPtr aCreationMethodAttr = theFeature->string(aCreationMethodID); if(!aCreationMethodAttr.get()) { - theError = "Error: Could not get \"" + aCreationMethodID + "\" attribute."; + theError = "Error: Could not get \"%1\" attribute."; + theError.arg(aCreationMethodID); return false; } @@ -89,17 +96,20 @@ bool FeaturesPlugin_ValidatorPipeLocations::isValid(const std::shared_ptrselectionList(aBaseObjectsID); if(!aBaseObjectsSelectionList.get()) { - theError = "Error: Could not get \"" + aBaseObjectsID + "\" attribute."; + theError = "Error: Could not get \"%1\" attribute."; + theError.arg(aBaseObjectsID); return false; } AttributeSelectionListPtr aLocationsSelectionList = theFeature->selectionList(aLocationsID); if(!aLocationsSelectionList.get()) { - theError = "Error: Could not get \"" + aBaseObjectsID + "\" attribute."; + theError = "Error: Could not get \"%1\" attribute."; + theError.arg(aBaseObjectsID); return false; } - if(aLocationsSelectionList->size() > 0 && aLocationsSelectionList->size() != aBaseObjectsSelectionList->size()) { + if(aLocationsSelectionList->size() > 0 && + aLocationsSelectionList->size() != aBaseObjectsSelectionList->size()) { theError = "Error: Number of locations should be the same as base objects."; return false; } @@ -108,7 +118,8 @@ bool FeaturesPlugin_ValidatorPipeLocations::isValid(const std::shared_ptrattributeType(); if(anAttributeType == ModelAPI_AttributeSelectionList::typeId()) { - AttributeSelectionListPtr aListAttr = std::dynamic_pointer_cast(theAttribute); + AttributeSelectionListPtr aListAttr = + std::dynamic_pointer_cast(theAttribute); for(int anIndex = 0; anIndex < aListAttr->size(); ++anIndex) { AttributeSelectionPtr aSelectionAttr = aListAttr->value(anIndex); ResultPtr aContext = aSelectionAttr->context(); @@ -145,9 +157,11 @@ bool FeaturesPlugin_ValidatorBaseForGeneration::isValid(const AttributePtr& theA return false; } - ResultConstructionPtr aResultConstruction = std::dynamic_pointer_cast(aContext); + ResultConstructionPtr aResultConstruction = + std::dynamic_pointer_cast(aContext); if(!aResultConstruction.get()) { - // It is not a result construction. If shape is compound check that it contains only faces and edges. + // It is not a result construction. + // If shape is compound check that it contains only faces and edges. GeomShapePtr aShape = aSelectionAttr->value(); if(!aShape.get()) { aShape = aContext->shape(); @@ -171,8 +185,10 @@ bool FeaturesPlugin_ValidatorBaseForGeneration::isValid(const AttributePtr& theA GeomShapePtr aContextShape = aResultConstruction->shape(); if(!aShape.get()) { // Whole sketch selected. - if(aSelectedSketchesFromObjects.find(aResultConstruction) != aSelectedSketchesFromObjects.cend()) { - theError = "Error: Object from this sketch is already selected. Sketch is not allowed for selection."; + if(aSelectedSketchesFromObjects.find(aResultConstruction) != + aSelectedSketchesFromObjects.cend()) { + theError = "Error: Object from this sketch is already selected. " + "Sketch is not allowed for selection."; return false; } @@ -180,7 +196,8 @@ bool FeaturesPlugin_ValidatorBaseForGeneration::isValid(const AttributePtr& theA } else { // Object from sketch selected. if(aSelectedSketches.find(aResultConstruction) != aSelectedSketches.cend()) { - theError = "Error: Whole sketch with this object is already selected. Don't allow to select this object."; + theError = "Error: Whole sketch with this object is already selected. " + "Don't allow to select this object."; return false; } @@ -192,7 +209,8 @@ bool FeaturesPlugin_ValidatorBaseForGeneration::isValid(const AttributePtr& theA } if(aSelectedWiresFromObjects.isBound(aWire)) { - theError = "Error: Objects with such wire already selected. Don't allow to select this object."; + theError = + "Error: Objects with such wire already selected. Don't allow to select this object."; return false; } @@ -208,8 +226,8 @@ bool FeaturesPlugin_ValidatorBaseForGeneration::isValid(const AttributePtr& theA //================================================================================================== bool FeaturesPlugin_ValidatorBaseForGeneration::isValidAttribute(const AttributePtr& theAttribute, - const std::list& theArguments, - Events_InfoMessage& theError) const + const std::list& theArguments, + Events_InfoMessage& theError) const { if(!theAttribute.get()) { theError = "Error: Empty attribute."; @@ -218,7 +236,8 @@ bool FeaturesPlugin_ValidatorBaseForGeneration::isValidAttribute(const Attribute std::string anAttributeType = theAttribute->attributeType(); if(anAttributeType == ModelAPI_AttributeSelectionList::typeId()) { - AttributeSelectionListPtr aListAttr = std::dynamic_pointer_cast(theAttribute); + AttributeSelectionListPtr aListAttr = + std::dynamic_pointer_cast(theAttribute); for(int anIndex = 0; anIndex < aListAttr->size(); ++anIndex) { // If at least one attribute is invalid, the result is false. if(!isValidAttribute(aListAttr->value(anIndex), theArguments, theError)) { @@ -227,7 +246,8 @@ bool FeaturesPlugin_ValidatorBaseForGeneration::isValidAttribute(const Attribute } } else if(anAttributeType == ModelAPI_AttributeSelection::typeId()) { // Getting context. - AttributeSelectionPtr anAttr = std::dynamic_pointer_cast(theAttribute); + AttributeSelectionPtr anAttr = + std::dynamic_pointer_cast(theAttribute); ResultPtr aContext = anAttr->context(); if(!aContext.get()) { theError = "Error: Attribute have empty context."; @@ -244,7 +264,8 @@ bool FeaturesPlugin_ValidatorBaseForGeneration::isValidAttribute(const Attribute return false; } - ResultConstructionPtr aConstruction = std::dynamic_pointer_cast(aContext); + ResultConstructionPtr aConstruction = + std::dynamic_pointer_cast(aContext); if(aConstruction.get()) { // Construciotn selected. Check that is is not infinite. if(aConstruction->isInfinite()) { @@ -259,7 +280,8 @@ bool FeaturesPlugin_ValidatorBaseForGeneration::isValidAttribute(const Attribute } } else { // Shape on construction selected. Check that it is a face or wire. - if(aShape->shapeType() == GeomAPI_Shape::WIRE || aShape->shapeType() == GeomAPI_Shape::FACE) { + if(aShape->shapeType() == GeomAPI_Shape::WIRE || + aShape->shapeType() == GeomAPI_Shape::FACE) { return true; } } @@ -269,15 +291,17 @@ bool FeaturesPlugin_ValidatorBaseForGeneration::isValidAttribute(const Attribute if(!aShape->isEqual(aContextShape)) { // Local selection on body does not allowed. - theError = "Error: Selected shape is in the local selection. Only global selection is allowed."; + theError = + "Error: Selected shape is in the local selection. Only global selection is allowed."; return false; } // Check that object is a shape with allowed type. GeomValidators_ShapeType aShapeTypeValidator; if(!aShapeTypeValidator.isValid(anAttr, theArguments, theError)) { - theError = "Error: 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: %1"; + theError = "Error: 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: %1"; std::string anArgumentString; for(auto anIt = theArguments.cbegin(); anIt != theArguments.cend(); ++anIt) { if (!anArgumentString.empty()) @@ -289,7 +313,8 @@ bool FeaturesPlugin_ValidatorBaseForGeneration::isValidAttribute(const Attribute } } else { - theError = "Error: Attribute \"" + anAttributeType + "\" does not supported by this validator."; + theError = "Error: Attribute \"%1\" does not supported by this validator."; + theError.arg(anAttributeType); return false; } @@ -302,11 +327,13 @@ bool FeaturesPlugin_ValidatorCompositeLauncher::isValid(const AttributePtr& theA Events_InfoMessage& theError) const { if (theAttribute->attributeType() != ModelAPI_AttributeReference::typeId()) { - theError = "Error: The attribute with the " + theAttribute->attributeType() + " type is not processed"; + theError = "Error: The attribute with the %1 type is not processed"; + theError.arg(theAttribute->attributeType()); return false; } if (theArguments.size() != 2) { - theError = "Error: Wrong parameters in XML definition for " + theAttribute->attributeType() + " type"; + theError = "Error: Wrong parameters in XML definition for %1 type"; + theError.arg(theAttribute->attributeType()); return false; } // first argument is for the base attribute, second - for skipping feature kind @@ -315,7 +342,8 @@ bool FeaturesPlugin_ValidatorCompositeLauncher::isValid(const AttributePtr& theA FeaturePtr aFeature = ModelAPI_Feature::feature(theAttribute->owner()); AttributePtr aBaseAttribute = aFeature->attribute(aBaseAttributeId); if (!aBaseAttribute.get()) { - theError = "Wrong parameters in XML definition for " + theAttribute->attributeType() + " type"; + theError = "Wrong parameters in XML definition for %1 type"; + theError.arg(theAttribute->attributeType()); return false; } if (aBaseAttribute->isInitialized()) // when base list of composite feature is already filled, @@ -342,16 +370,18 @@ bool FeaturesPlugin_ValidatorCompositeLauncher::isValid(const AttributePtr& theA } //================================================================================================== -bool FeaturesPlugin_ValidatorExtrusionDir::isValid(const std::shared_ptr& theFeature, - const std::list& theArguments, - Events_InfoMessage& theError) const +bool FeaturesPlugin_ValidatorExtrusionDir::isValid( + const std::shared_ptr& theFeature, + const std::list& theArguments, + Events_InfoMessage& theError) const { if(theArguments.size() != 2) { theError = "Error: Validator should be used with 2 parameters for extrusion."; return false; } - std::list::const_iterator anArgsIt = theArguments.begin(), aLast = theArguments.end(); + std::list::const_iterator + anArgsIt = theArguments.begin(), aLast = theArguments.end(); AttributePtr aCheckAttribute = theFeature->attribute(*anArgsIt); ++anArgsIt; @@ -371,8 +401,9 @@ bool FeaturesPlugin_ValidatorExtrusionDir::isValid(const std::shared_ptr aDirEdge(new GeomAPI_Edge(aDirShape)); // If faces selected check that direction not parallel with them. - AttributeSelectionListPtr aListAttr = std::dynamic_pointer_cast(aCheckAttribute); + AttributeSelectionListPtr aListAttr = + std::dynamic_pointer_cast(aCheckAttribute); for(int anIndex = 0; anIndex < aListAttr->size(); ++anIndex) { AttributeSelectionPtr anAttr = aListAttr->value(anIndex); GeomShapePtr aShapeInList = anAttr->value(); @@ -390,8 +422,10 @@ bool FeaturesPlugin_ValidatorExtrusionDir::isValid(const std::shared_ptrcontext()->shape(); } bool isParallel = true; - if(aShapeInList->shapeType() == GeomAPI_Shape::FACE || aShapeInList->shapeType() == GeomAPI_Shape::SHELL) { - for(GeomAPI_ShapeExplorer anExp(aShapeInList, GeomAPI_Shape::FACE); anExp.more(); anExp.next()) { + if(aShapeInList->shapeType() == GeomAPI_Shape::FACE || + aShapeInList->shapeType() == GeomAPI_Shape::SHELL) { + for(GeomAPI_ShapeExplorer + anExp(aShapeInList, GeomAPI_Shape::FACE); anExp.more(); anExp.next()) { std::shared_ptr aFace(new GeomAPI_Face(anExp.current())); isParallel = GeomAlgoAPI_ShapeTools::isParallel(aDirEdge, aFace); if(isParallel) { @@ -399,12 +433,13 @@ bool FeaturesPlugin_ValidatorExtrusionDir::isValid(const std::shared_ptrshapeType() == GeomAPI_Shape::COMPOUND) { - std::shared_ptr aPlanarEdges = std::dynamic_pointer_cast(aShapeInList); + std::shared_ptr aPlanarEdges = + std::dynamic_pointer_cast(aShapeInList); if(aPlanarEdges.get()) { std::shared_ptr aSketchDir = aPlanarEdges->norm(); if(aDirEdge->isLine()) { std::shared_ptr aDir = aDirEdge->line()->direction(); - isParallel = abs(aSketchDir->angle(aDir) - M_PI / 2.0) < 10e-7; + isParallel = fabs(aSketchDir->angle(aDir) - M_PI / 2.0) < 10e-7; } else { isParallel = false; } @@ -415,7 +450,8 @@ bool FeaturesPlugin_ValidatorExtrusionDir::isValid(const std::shared_ptrattributeType(); if(anAttributeType == ModelAPI_AttributeSelectionList::typeId()) { - AttributeSelectionListPtr aListAttr = std::dynamic_pointer_cast(theAttribute); + AttributeSelectionListPtr aListAttr = + std::dynamic_pointer_cast(theAttribute); for(int anIndex = 0; anIndex < aListAttr->size(); ++anIndex) { // If at least one attribute is invalid, the result is false. if(!isShapesCanBeEmpty(aListAttr->value(anIndex), theError)) { @@ -448,7 +486,8 @@ bool FeaturesPlugin_ValidatorExtrusionDir::isShapesCanBeEmpty(const AttributePtr } } else if(anAttributeType == ModelAPI_AttributeSelection::typeId()) { // Getting context. - AttributeSelectionPtr anAttr = std::dynamic_pointer_cast(theAttribute); + AttributeSelectionPtr anAttr = + std::dynamic_pointer_cast(theAttribute); ResultPtr aContext = anAttr->context(); if(!aContext.get()) { return false; @@ -480,9 +519,11 @@ bool FeaturesPlugin_ValidatorBooleanSelection::isValid(const AttributePtr& theAt const std::list& theArguments, Events_InfoMessage& theError) const { - AttributeSelectionListPtr anAttrSelectionList = std::dynamic_pointer_cast(theAttribute); + AttributeSelectionListPtr anAttrSelectionList = + std::dynamic_pointer_cast(theAttribute); if(!anAttrSelectionList.get()) { - theError = "Error: This validator can only work with selection list attributes in \"Boolean\" feature."; + theError = + "Error: This validator can only work with selection list attributes in \"Boolean\" feature."; return false; } FeaturePtr aFeature = std::dynamic_pointer_cast(theAttribute->owner()); @@ -545,10 +586,11 @@ bool FeaturesPlugin_ValidatorBooleanSelection::isValid(const AttributePtr& theAt //================================================================================================== bool FeaturesPlugin_ValidatorPartitionSelection::isValid(const AttributePtr& theAttribute, - const std::list& theArguments, - Events_InfoMessage& theError) const + const std::list& theArguments, + Events_InfoMessage& theError) const { - AttributeSelectionListPtr anAttrSelectionList = std::dynamic_pointer_cast(theAttribute); + AttributeSelectionListPtr anAttrSelectionList = + std::dynamic_pointer_cast(theAttribute); if(!anAttrSelectionList.get()) { theError = "Error: This validator can only work with selection list in \"Partition\" feature."; return false; @@ -568,13 +610,15 @@ bool FeaturesPlugin_ValidatorPartitionSelection::isValid(const AttributePtr& the } ResultPtr aContext = aSelectAttr->context(); - ResultConstructionPtr aResultConstruction = std::dynamic_pointer_cast(aContext); + ResultConstructionPtr aResultConstruction = + std::dynamic_pointer_cast(aContext); if(aResultConstruction.get()) { theError = "Error: Only body shapes and construction planes are allowed for selection."; return false; } - ResultCompSolidPtr aResultCompsolid = std::dynamic_pointer_cast(aContext); + ResultCompSolidPtr aResultCompsolid = + std::dynamic_pointer_cast(aContext); if(aResultCompsolid.get()) { continue; } @@ -589,12 +633,14 @@ bool FeaturesPlugin_ValidatorPartitionSelection::isValid(const AttributePtr& the //================================================================================================== bool FeaturesPlugin_ValidatorRemoveSubShapesSelection::isValid(const AttributePtr& theAttribute, - const std::list& theArguments, - Events_InfoMessage& theError) const + const std::list& theArguments, + Events_InfoMessage& theError) const { - AttributeSelectionListPtr aSubShapesAttrList = std::dynamic_pointer_cast(theAttribute); + AttributeSelectionListPtr aSubShapesAttrList = + std::dynamic_pointer_cast(theAttribute); if(!aSubShapesAttrList.get()) { - theError = "Error: This validator can only work with selection list in \"Remove Sub-Shapes\" feature."; + theError = + "Error: This validator can only work with selection list in \"Remove Sub-Shapes\" feature."; return false; } @@ -603,7 +649,8 @@ bool FeaturesPlugin_ValidatorRemoveSubShapesSelection::isValid(const AttributePt AttributeSelectionPtr aShapeAttrSelection = aFeature->selection(aBaseShapeID); if(!aShapeAttrSelection.get()) { - theError = "Error: Could not get \"" + aBaseShapeID + "\" attribute."; + theError = "Error: Could not get \"%1\" attribute."; + theError.arg(aBaseShapeID); return false; } @@ -641,27 +688,31 @@ bool FeaturesPlugin_ValidatorRemoveSubShapesSelection::isValid(const AttributePt } //================================================================================================== -bool FeaturesPlugin_ValidatorRemoveSubShapesResult::isValid(const std::shared_ptr& theFeature, - const std::list& theArguments, - Events_InfoMessage& theError) const +bool FeaturesPlugin_ValidatorRemoveSubShapesResult::isValid( + const std::shared_ptr& theFeature, + const std::list& theArguments, + Events_InfoMessage& theError) const { static const std::string aBaseShapeID = "base_shape"; static const std::string aSubShapesID = "subshapes"; if(theFeature->getKind() != "Remove_SubShapes") { - theError = "Error: Feature \"" + theFeature->getKind() + "\" does not supported by this validator."; + theError = "Error: Feature \"%1\" does not supported by this validator."; + theError.arg(theFeature->getKind()); return false; } AttributeSelectionPtr aShapeAttrSelection = theFeature->selection(aBaseShapeID); if(!aShapeAttrSelection.get()) { - theError = "Error: Could not get \"" + aBaseShapeID + "\" attribute."; + theError = "Error: Could not get \"%1\" attribute."; + theError.arg(aBaseShapeID); return false; } AttributeSelectionListPtr aSubShapesAttrList = theFeature->selectionList(aSubShapesID); if(!aSubShapesAttrList.get()) { - theError = "Error: Could not get \"" + aSubShapesID + "\" attribute."; + theError = "Error: Could not get \"%1\" attribute."; + theError.arg(aSubShapesID); return false; } @@ -701,16 +752,19 @@ bool FeaturesPlugin_ValidatorUnionSelection::isValid(const AttributePtr& theAttr const std::list& theArguments, Events_InfoMessage& theError) const { - AttributeSelectionListPtr aBaseObjectsAttrList = std::dynamic_pointer_cast(theAttribute); + AttributeSelectionListPtr aBaseObjectsAttrList = + std::dynamic_pointer_cast(theAttribute); if(!aBaseObjectsAttrList.get()) { - theError = "Error: This validator can only work with selection list in \"" + FeaturesPlugin_Union::ID() + "\" feature."; + theError = "Error: This validator can only work with selection list in \"%1\" feature."; + theError.arg(FeaturesPlugin_Union::ID()); return false; } for(int anIndex = 0; anIndex < aBaseObjectsAttrList->size(); ++anIndex) { bool isSameFound = false; AttributeSelectionPtr anAttrSelectionInList = aBaseObjectsAttrList->value(anIndex); - ResultCompSolidPtr aResult = std::dynamic_pointer_cast(anAttrSelectionInList->context()); + ResultCompSolidPtr aResult = + std::dynamic_pointer_cast(anAttrSelectionInList->context()); if(!aResult.get()) { continue; } @@ -724,20 +778,24 @@ bool FeaturesPlugin_ValidatorUnionSelection::isValid(const AttributePtr& theAttr } //================================================================================================== -bool FeaturesPlugin_ValidatorUnionArguments::isValid(const std::shared_ptr& theFeature, - const std::list& theArguments, - Events_InfoMessage& theError) const +bool FeaturesPlugin_ValidatorUnionArguments::isValid( + const std::shared_ptr& theFeature, + const std::list& theArguments, + Events_InfoMessage& theError) const { // Check feature kind. if(theFeature->getKind() != FeaturesPlugin_Union::ID()) { - theError = "Error: This validator supports only \"" + FeaturesPlugin_Union::ID() + "\" feature."; + theError = "Error: This validator supports only \"%1\" feature."; + theError.arg(FeaturesPlugin_Union::ID()); return false; } // Get base objects attribute list. - AttributeSelectionListPtr aBaseObejctsAttrList = theFeature->selectionList(FeaturesPlugin_Union::BASE_OBJECTS_ID()); + AttributeSelectionListPtr aBaseObejctsAttrList = + theFeature->selectionList(FeaturesPlugin_Union::BASE_OBJECTS_ID()); if(!aBaseObejctsAttrList.get()) { - theError = "Error: Could not get \"" + FeaturesPlugin_Union::BASE_OBJECTS_ID() + "\" attribute."; + theError = "Error: Could not get \"%1\" attribute."; + theError.arg(FeaturesPlugin_Union::BASE_OBJECTS_ID()); return false; } @@ -768,3 +826,48 @@ bool FeaturesPlugin_ValidatorUnionArguments::isNotObligatory(std::string theFeat { return false; } + +bool FeaturesPlugin_ValidatorConcealedResult::isValid(const AttributePtr& theAttribute, + const std::list& theArguments, + Events_InfoMessage& theError) const +{ + if (theAttribute->attributeType() != ModelAPI_AttributeReference::typeId()) { + theError = "Error: The attribute with the %1 type is not processed"; + theError.arg(theAttribute->attributeType()); + return false; + } + + AttributeReferencePtr aRefAttribute = std::dynamic_pointer_cast + (theAttribute); + ObjectPtr aRefObject = aRefAttribute->value(); + if (!aRefObject.get()) { + theError = "Error: Empty feature."; + return false; + } + + FeaturePtr aRefFeature = std::dynamic_pointer_cast(aRefObject); + if (!aRefFeature.get()) { + theError = "Error: Empty feature."; + return false; + } + std::list > aResults; + ModelAPI_Tools::getConcealedResults(aRefFeature, aResults); + + size_t aConcealedResults = aResults.size(); + if (!aConcealedResults && !theArguments.empty()) { + // find if these results are touched by the feature in another attribute + std::list::const_iterator anIt = theArguments.begin(); + std::string aRecoveredList = *anIt; + if (!aRecoveredList.empty()) { + std::shared_ptr aParameterList = + theAttribute->owner()->data()->reflist(aRecoveredList); + if (aParameterList.get()) + aConcealedResults = aParameterList->size(); + } + } + + if (aConcealedResults == 0) + theError = "Error: No concealed results."; + + return theError.empty(); +}