}
AttributeSelectionListPtr aSelectionList = theFeature->selectionList(theArguments.front());
if(!aSelectionList.get()) {
- theError = "Empty attribute \"" + theArguments.front() + "\".";
+ theError = "Empty attribute \"%1\".";
+ theError.arg(theArguments.front());
return false;
}
}
AttributeSelectionListPtr aSelectionList = theFeature->selectionList(theArguments.front());
if(!aSelectionList.get()) {
- theError = "Empty attribute \"" + theArguments.front() + "\".";
+ theError = "Empty attribute \"%1\".";
+ theError.arg(theArguments.front());
return false;
}
bool aValid = true;
std::string anAttributeType = theAttribute->attributeType();
if (anAttributeType != ModelAPI_AttributeSelectionList::typeId()) {
- theError = "The attribute with the " + theAttribute->attributeType() + " type is not processed";
+ theError = "The attribute with the %1 type is not processed";
+ theError.arg(theAttribute->attributeType());
return false;
}
if (!aValid) {
std::string aResultGroupName = isPartSetDocument ? ModelAPI_ResultPart::group()
: ModelAPI_ResultBody::group();
- theError = "Objects from the " + aResultGroupName +
- " group can be selected in the " + aDocument->kind() +
- "document, but an objects from the " + anErrorGroupName +
- " group is selected.";
+ theError = "Objects from the %1 group can be selected in the %2 document, but an objects from the %3 group is selected.";
+ theError.arg(aResultGroupName).arg(aDocument->kind()).arg(anErrorGroupName);
}
return aValid;
}
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;
}
AttributeSelectionListPtr aBaseObjectsSelectionList = theFeature->selectionList(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;
}
// 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())
}
} 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;
}
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
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,
if(!aDirShape.get()) {
// Check that dir can be empty.
if(!isShapesCanBeEmpty(aCheckAttribute, theError)) {
- theError = "Error: Base objects list contains vertex or edge, so attribute \"" + *anArgsIt
- + "\" can not be used with default value. Select direction for extrusion.";
+ theError = "Error: Base objects list contains vertex or edge, so attribute \"%1\" can not be used with default value. Select direction for extrusion.";
+ theError.arg(*anArgsIt);
return false;
} else {
return true;
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;
}
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;
}
{
AttributeSelectionListPtr aBaseObjectsAttrList = std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(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;
}
{
// 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());
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;
}
}
}
} 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;
}
bool aValid = true;
if (theAttribute->attributeType() != ModelAPI_AttributeSelection::typeId()) {
aValid = false;
- theError = "The attribute with the " + theAttribute->attributeType() + " type is not processed";
+ theError = "The attribute with the %1 type is not processed";
+ theError.arg(theAttribute->attributeType());
return aValid;
}
{
std::string anAttributeType = theAttribute->attributeType();
if (anAttributeType != ModelAPI_AttributeSelection::typeId()) {
- theError = "The attribute with the " + theAttribute->attributeType() + " type is not processed";
+ theError = "The attribute with the %1 type is not processed";
+ theError.arg(theAttribute->attributeType());
return false;
}
std::string aSelectionListId = theArguments.front();
AttributeSelectionListPtr anAttrSelList = theFeature->selectionList(aSelectionListId);
if(!anAttrSelList.get()) {
- theError = "Error: Could not get attribute \"" + aSelectionListId + "\".";
+ theError = "Error: Could not get attribute \"%1\".";
+ theError.arg(aSelectionListId);
return false;
}
int anObjectsNb = anAttrSelList->size();
int aMinObjectsNb = atoi(theArguments.back().c_str());
if(anObjectsNb < aMinObjectsNb) {
- theError = "Error: Attribute \"" + aSelectionListId + "\" should contain at least "
- + theArguments.back() + " items.";
+ theError = "Error: Attribute \"%1\" should contain at least %2 items.";
+ theError.arg(aSelectionListId).arg(theArguments.back());
return false;
}
if (!aTypes.empty())
aTypes += ", ";
}
- theError = "It does not contain element with acceptable shape type. The type should be one of the next: "
- + aTypes;
+ theError = "It does not contain element with acceptable shape type. The type should be one of the next: %1";
+ theError.arg(aTypes);
}
return aValid;
else {
std::string anAttributeType = aRefAttr->attributeType();
aValid = anAttributeType == GeomDataAPI_Point2D::typeId();
- if (!aValid)
- theError = "Shape type is \"" + anAttributeType +
- "\", it should be \"" + getShapeTypeDescription(theShapeType) + "\"";
+ if (!aValid) {
+ theError = "Shape type is \"%1\", it should be \"%2\"";
+ theError.arg(anAttributeType).arg(getShapeTypeDescription(theShapeType));
+ }
}
}
}
}
else {
aValid = false;
- theError = "The attribute with the " + anAttributeType + " type is not processed";
+ theError = "The attribute with the %1 type is not processed";
+ theError.arg(anAttributeType);
}
return aValid;
}
myNotObligatory.find(theFeature->getKind());
if (aFeatureFind == myNotObligatory.end() || // and it is obligatory for filling
aFeatureFind->second.find(*it) == aFeatureFind->second.end()) {
- theError = "Attribute \"" + anAttr->id() + "\" is not initialized.";
+ theError = "Attribute \"%1\" is not initialized.";
+ theError.arg(anAttr->id());
return false;
}
}
{
AttributeStringPtr aStrAttr = std::dynamic_pointer_cast<ModelAPI_AttributeString>(theAttribute);
if (!aStrAttr->isInitialized()) {
- theError = "Attribute \"" + aStrAttr->id() + "\" is not initialized.";
+ theError = "Attribute \"%1\" is not initialized.";
+ theError.arg(aStrAttr->id());
return false;
}
bool isEmptyExpr = aStrAttr->value().empty();
if (isEmptyExpr) {
- theError = "Attribute \"" + aStrAttr->id() + "\" value is empty.";
+ theError = "Attribute \"%1\" value is empty.";
+ theError.arg(aStrAttr->id());
return false;
}
if (!isVariable(aStrAttr->value())) {
AttributeStringPtr aStrAttr =
std::dynamic_pointer_cast<ModelAPI_AttributeString>(theAttribute);
if (!aStrAttr->isInitialized()) {
- theError = "Attribute \"" + aStrAttr->id() + "\" is not initialized.";
+ theError = "Attribute \"%1\" is not initialized.";
+ theError.arg(aStrAttr->id());
return false;
}
bool isEmptyExpr = aStrAttr->value().empty();
Events_InfoMessage& theError) const
{
if (theAttribute->attributeType() != ModelAPI_AttributeRefAttr::typeId()) {
- theError = "The attribute with the " + theAttribute->attributeType() + " type is not processed";
+ theError = "The attribute with the %1 type is not processed";
+ theError.arg(theAttribute->attributeType());
return false;
}
Events_InfoMessage& theError) const
{
if (theAttribute->attributeType() != ModelAPI_AttributeRefAttr::typeId()) {
- theError = "The attribute with the " + theAttribute->attributeType() + " type is not processed";
+ theError = "The attribute with the %1 type is not processed";
+ theError.arg(theAttribute->attributeType());
return false;
}
Events_InfoMessage& theError) const
{
if (theAttribute->attributeType() != ModelAPI_AttributeRefAttr::typeId()) {
- theError = "The attribute with the " + theAttribute->attributeType() + " type is not processed";
+ theError = "The attribute with the %1 type is not processed";
+ theError.arg(theAttribute->attributeType());
return false;
}
if (aRefFea->getKind() == SketchPlugin_Line::ID()) {
if (aOtherFea->getKind() != SketchPlugin_Arc::ID() &&
aOtherFea->getKind() != SketchPlugin_Circle::ID()) {
- theError = "It refers to a " + SketchPlugin_Line::ID() + ", but " + aParamA + " is neither an "
- + SketchPlugin_Arc::ID() + " nor " + SketchPlugin_Circle::ID();
+ theError = "It refers to a %1, but %2 is neither an %3 nor %4";
+ theError.arg(SketchPlugin_Line::ID()).arg(aParamA)
+ .arg(SketchPlugin_Arc::ID()).arg(SketchPlugin_Circle::ID());
return false;
}
}
else if (aRefFea->getKind() == SketchPlugin_Arc::ID()) {
if (aOtherFea->getKind() != SketchPlugin_Line::ID() &&
aOtherFea->getKind() != SketchPlugin_Arc::ID()) {
- theError = "It refers to an " + SketchPlugin_Arc::ID() + ", but " + aParamA + " is not a "
- + SketchPlugin_Line::ID() + " or an " + SketchPlugin_Arc::ID();
+ theError = "It refers to an %1, but %2 is not a %3 or an %4";
+ theError.arg(SketchPlugin_Arc::ID()).arg(aParamA)
+ .arg(SketchPlugin_Line::ID()).arg(SketchPlugin_Arc::ID());
return false;
}
}
else if (aRefFea->getKind() == SketchPlugin_Circle::ID()) {
if (aOtherFea->getKind() != SketchPlugin_Line::ID()) {
- theError = "It refers to an " + SketchPlugin_Circle::ID() + ", but " + aParamA + " is not a "
- + SketchPlugin_Line::ID();
+ theError = "It refers to an %1, but %2 is not a %3";
+ theError.arg(SketchPlugin_Circle::ID()).arg(aParamA)
+ .arg(SketchPlugin_Line::ID());
return false;
}
}
else {
- theError = "It refers to " + aRefFea->getKind() + ", but should refer to " + SketchPlugin_Line::ID()
- + " or " + SketchPlugin_Arc::ID() + " or " + SketchPlugin_Circle::ID();
+ theError = "It refers to %1, but should refer to %2 or %3 or %4";
+ theError.arg(aRefFea->getKind()).arg(SketchPlugin_Line::ID())
+ .arg(SketchPlugin_Arc::ID()).arg(SketchPlugin_Circle::ID());
return false;
}
return true;
Events_InfoMessage& theError) const
{
if (theAttribute->attributeType() != ModelAPI_AttributeRefAttr::typeId()) {
- theError = "The attribute with the " + theAttribute->attributeType() + " type is not processed";
+ theError = "The attribute with the %1 type is not processed";
+ theError.arg(theAttribute->attributeType());
return false;
}
if (aRefAttr->object() == aRAttr->object()) {
ObjectPtr anObject = aRefAttr->object();
std::string aName = anObject.get() ? anObject->data()->name() : "";
- theError = "The object " + aName + " has been already fixed.";
+ theError = "The object %1 has been already fixed.";
+ theError.arg(aName);
return false;
}
}
else if (aRefAttr->attr() == aRAttr->attr()) {
AttributePtr anAttribute = aRefAttr->attr();
std::string aName = anAttribute.get() ? anAttribute->id() : "";
- theError = "The attribute " + aName + " has been already fixed.";
+ theError = "The attribute %1 has been already fixed.";
+ theError.arg(aName);
return false;
}
}
Events_InfoMessage& theError) const
{
if (theAttribute->attributeType() != ModelAPI_AttributeRefAttr::typeId()) {
- theError = "The attribute with the " + theAttribute->attributeType() + " type is not processed";
+ theError = "The attribute with the %1 type is not processed";
+ theError.arg(theAttribute->attributeType());
return false;
}
if (aFeature->getKind() != SketchPlugin_Line::ID() &&
aFeature->getKind() != SketchPlugin_Circle::ID() &&
aFeature->getKind() != SketchPlugin_Arc::ID()) {
- theError = "The " + aFeature->getKind() + " feature kind of attribute is wrong. It should be " +
- SketchPlugin_Line::ID() + " or " + SketchPlugin_Circle::ID() + " or " +
- SketchPlugin_Arc::ID();
+ theError = "The %1 feature kind of attribute is wrong. It should be %2 or %3 or %4";
+ theError.arg(aFeature->getKind()).arg(SketchPlugin_Line::ID())
+ .arg(SketchPlugin_Circle::ID()).arg(SketchPlugin_Arc::ID());
// wrong type of attribute
return false;
}
if ((aType[0] == SketchPlugin_Line::ID() || aType[1] == SketchPlugin_Line::ID()) &&
aType[0] != aType[1]) {
- theError = "Feature with kinds " + aType[0] + " and " + aType[1] + "can not be equal.";
+ theError = "Feature with kinds %1 and %2 can not be equal.";
+ theError.arg(aType[0]).arg(aType[1]);
return false;
}
return true;
Events_InfoMessage& theError) const
{
if (theAttribute->attributeType() != ModelAPI_AttributeRefList::typeId()) {
- theError = "The attribute with the " + theAttribute->attributeType() + " type is not processed";
+ theError = "The attribute with the %1 type is not processed";
+ theError.arg(theAttribute->attributeType());
return false;
}
std::list<ObjectPtr>::iterator aMirIter = aMirroredObjects.begin();
for (; aMirIter != aMirroredObjects.end(); aMirIter++)
if (aSelObject == *aMirIter) {
- theError = "The object " + aName + " is a result of mirror";
+ theError = "The object %1 is a result of mirror";
+ theError.arg(aName);
return false;
}
}
Events_InfoMessage& theError) const
{
if (theAttribute->attributeType() != ModelAPI_AttributeRefAttr::typeId()) {
- theError = "The attribute with the " + theAttribute->attributeType() + " type is not processed";
+ theError = "The attribute with the %1 type is not processed";
+ theError.arg(theAttribute->attributeType());
return false;
}
FeaturePtr aConstraint = std::dynamic_pointer_cast<ModelAPI_Feature>(theAttribute->owner());
AttributeRefAttrPtr aRefAttrA = aConstraint->data()->refattr(aParamA);
if (!aRefAttrA) {
- theError = "The " + aParamA + " attribute " + " should be " + ModelAPI_AttributeRefAttr::typeId();
+ theError = "The %1 attribute should be %2";
+ theError.arg(aParamA).arg(ModelAPI_AttributeRefAttr::typeId());
return false;
}
else {
ObjectPtr anObject = aRefAttrA->object();
if (!anObject.get()) {
- theError = aParamA + " attribute has an empty object";
+ theError = "%1 attribute has an empty object";
+ theError.arg(aParamA);
return false;
}
FeaturePtr aFeature = ModelAPI_Feature::feature(aRefAttrA->object());
if (!aFeature.get()) {
- theError = aParamA + " attribute has an empty feature";
+ theError = "%1 attribute has an empty feature";
+ theError.arg(aParamA);
return false;
}
else {
FeaturePtr aFeature = ModelAPI_Feature::feature(aRefAttrB->object());
if (!aFeature) {
- theError = theAttribute->id() + " attribute has an empty object";
+ theError = "%1 attribute has an empty object";
+ theError.arg(theAttribute->id());
return false;
}
if (aFeature->getKind() == SketchPlugin_Point::ID())
Events_InfoMessage& theError) const
{
if (theAttribute->attributeType() != ModelAPI_AttributeRefList::typeId()) {
- theError = "The attribute with the " + theAttribute->attributeType() + " type is not processed";
+ theError = "The attribute with the %1 type is not processed";
+ theError.arg(theAttribute->attributeType());
return false;
}
for (; anObjIter != aCopiedObjects.end(); anObjIter++)
if (aSelObject == *anObjIter) {
std::string aName = aSelObject.get() ? aSelObject->data()->name() : "";
- theError = "The object " + aName + " is a result of copy";
+ theError = "The object %1 is a result of copy";
+ theError.arg(aName);
return false;
}
}
Events_InfoMessage& theError) const
{
if (theAttribute->attributeType() != ModelAPI_AttributeRefAttr::typeId()) {
- theError = "The attribute with the " + theAttribute->attributeType() + " type is not processed";
+ theError = "The attribute with the %1 type is not processed";
+ theError.arg(theAttribute->attributeType());
return false;
}
Events_InfoMessage& theError) const
{
if (theAttribute->attributeType() != ModelAPI_AttributeRefAttr::typeId()) {
- theError = "The attribute with the " + theAttribute->attributeType() + " type is not processed";
+ theError = "The attribute with the %1 type is not processed";
+ theError.arg(theAttribute->attributeType());
return false;
}
AttributeRefAttrPtr aRefAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theAttribute);
AttributePtr anAttr = aRefAttr->attr();
if (!anAttr) {
- theError = "The attribute " + theAttribute->id() + " should be a point";
+ theError = "The attribute %1 should be a point";
+ theError.arg(theAttribute->id());
return false;
}
// selected point should not be a center of arc
const std::string& aPntId = anAttr->id();
if (aPntId != SketchPlugin_Arc::START_ID() && aPntId != SketchPlugin_Arc::END_ID()) {
- theError = "The attribute " + aPntId + " is not supported";
+ theError = "The attribute %1 is not supported";
+ theError.arg(aPntId);
return false;
}
}
// selected point should be bound point of line
const std::string& aPntId = anAttr->id();
if (aPntId != SketchPlugin_Line::START_ID() && aPntId != SketchPlugin_Line::END_ID()) {
- theError = "The attribute " + aPntId + " is not supported";
+ theError = "The attribute %1 is not supported";
+ theError.arg(aPntId);
return false;
}
}
else {
- theError = "Unable to build tangent arc on " + anAttrFeature->getKind();
+ theError = "Unable to build tangent arc on %1";
+ theError.arg(anAttrFeature->getKind());
return false;
}
Events_InfoMessage& theError) const
{
if (theAttribute->attributeType() != ModelAPI_AttributeSelection::typeId()) {
- theError = "The attribute with the " + theAttribute->attributeType() + " type is not processed";
+ theError = "The attribute with the %1 type is not processed";
+ theError.arg(theAttribute->attributeType());
return false;
}
AttributeSelectionPtr aLineAttr =
}
if (!anEdge || !anEdge->isLine()) {
- theError = "The attribute " + theAttribute->id() + " should be a line";
+ theError = "The attribute %1 should be a line";
+ theError.arg(theAttribute->id());
return false;
}
Events_InfoMessage& theError) const
{
if (theAttribute->attributeType() != ModelAPI_AttributeSelection::typeId()) {
- theError = "The attribute with the " + theAttribute->attributeType() + " type is not processed";
+ theError = "The attribute with the %1 type is not processed";
+ theError.arg(theAttribute->attributeType());
return false;
}
}
if (!anEdge) {
- theError = "The attribute " + theAttribute->id() + " should be an edge";
+ theError = "The attribute %1 should be an edge";
+ theError.arg(theAttribute->id());
return false;
}