}
}
} else {
+// LCOV_EXCL_START
theError = "Error: Attribute \"%1\" does not supported by this validator.";
theError.arg(anAttributeType);
return false;
+// LCOV_EXCL_STOP
}
return true;
{
bool aValid = true;
if (theAttribute->attributeType() != ModelAPI_AttributeSelection::typeId()) {
+// LCOV_EXCL_START
aValid = false;
theError = "The attribute with the %1 type is not processed";
theError.arg(theAttribute->attributeType());
return aValid;
+// LCOV_EXCL_STOP
}
AttributeSelectionPtr aSelectionAttr = std::dynamic_pointer_cast<ModelAPI_AttributeSelection>
{
std::string anAttributeType = theAttribute->attributeType();
if (anAttributeType != ModelAPI_AttributeSelection::typeId()) {
+// LCOV_EXCL_START
theError = "The attribute with the %1 type is not processed";
theError.arg(theAttribute->attributeType());
return false;
+// LCOV_EXCL_STOP
}
bool aValid = true;
const std::list<std::string>& theArguments,
Events_InfoMessage& theError) const
{
+// LCOV_EXCL_START
if (!theAttribute) {
theError = "Error: empty selection.";
return false;
theError = "Error: compare with nothing";
return false;
}
+// LCOV_EXCL_STOP
FeaturePtr aFeature = ModelAPI_Feature::feature(theAttribute->owner());
for (std::list<std::string>::const_iterator anIt = theArguments.begin();
anIt != theArguments.end() && isOk; ++anIt) {
aSelection = aFeature->selection(*anIt);
+// LCOV_EXCL_START
if (!aSelection) {
theError = "Error: incorrect type of attribute";
return false;
}
+// LCOV_EXCL_STOP
GeomShapePtr aShape;
if (aSelection)
Events_InfoMessage& theError) const
{
if(theArguments.size() != 2) {
+// LCOV_EXCL_START
theError =
"Error: Wrong number of arguments (expected 2): selection list id and min number of objects";
return false;
+// LCOV_EXCL_STOP
}
std::string aSelectionListId = theArguments.front();
AttributeSelectionListPtr anAttrSelList = theFeature->selectionList(aSelectionListId);
if(!anAttrSelList.get()) {
+// LCOV_EXCL_START
theError = "Error: Could not get attribute \"%1\".";
theError.arg(aSelectionListId);
return false;
+// LCOV_EXCL_STOP
}
int anObjectsNb = anAttrSelList->size();
const std::list<std::string>& theArguments,
Events_InfoMessage& theError) const
{
+// LCOV_EXCL_START
if (theArguments.empty()) {
theError = "Error: empty selection.";
return false;
}
+// LCOV_EXCL_STOP
for (std::list<std::string>::const_iterator anIt = theArguments.cbegin();
anIt != theArguments.cend();
std::string anArgument = *anIt;
AttributePtr anAttribute = theFeature->attribute(anArgument);
if (!anAttribute.get()) {
+// LCOV_EXCL_START
theError = std::string("Error: Feature does not contain attribute: ") + anArgument;
return false;
+// LCOV_EXCL_STOP
}
if (anAttribute->attributeType() == ModelAPI_AttributeSelectionList::typeId()) {
AttributeSelectionListPtr anAttrSelectionList =
for (int anIndex = 0; anIndex < anAttrSelectionList->size(); ++anIndex) {
AttributeSelectionPtr anAttrSelection = anAttrSelectionList->value(anIndex);
if (!anAttrSelection.get()) {
+// LCOV_EXCL_START
theError = "Error: Empty attribute selection.";
return false;
+// LCOV_EXCL_STOP
}
ResultPtr aContext = anAttrSelection->context();
if (!aContext.get()) {
}*/
}
} else {
+// LCOV_EXCL_START
theError = std::string("Error: validator does not support attribute with type: ")
+ anAttribute->attributeType();
return false;
+// LCOV_EXCL_STOP
}
}
std::string anAttributeType = aRefAttr->attributeType();
aValid = anAttributeType == GeomDataAPI_Point2D::typeId();
if (!aValid) {
+// LCOV_EXCL_START
theError = "Shape type is \"%1\", it should be \"%2\"";
theError.arg(anAttributeType).arg(getShapeTypeDescription(theShapeType));
+// LCOV_EXCL_STOP
}
}
}
}
}
else {
+// LCOV_EXCL_START
aValid = false;
theError = "The attribute with the %1 type is not processed";
theError.arg(anAttributeType);
+// LCOV_EXCL_STOP
}
if (aValid)
theError = "";
const std::list<std::string>& theArguments,
Events_InfoMessage& theError) const
{
+// LCOV_EXCL_START
if(theArguments.size() != 9) {
theError = "Wrong number of validator arguments in xml(expected 9).";
return false;
}
+// LCOV_EXCL_STOP
std::list<std::string>::const_iterator anIt = theArguments.begin(), aLast = theArguments.end();