//=================================================================================================
bool BuildPlugin_ValidatorBaseForBuild::isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
// Get base objects list.
if(theAttribute->attributeType() != ModelAPI_AttributeSelectionList::typeId()) {
//=================================================================================================
bool BuildPlugin_ValidatorBaseForWire::isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
// Get attribute.
if(theArguments.size() != 1) {
//=================================================================================================
bool BuildPlugin_ValidatorBaseForFace::isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
// Get attribute.
if(theArguments.size() != 1) {
//=================================================================================================
bool BuildPlugin_ValidatorSubShapesSelection::isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
if(theArguments.size() != 1) {
std::string aMsg = "Error: BuildPlugin_ValidatorSubShapesSelection should be used only with "
//! \param[out] theError error message.
virtual bool isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
};
/// \class BuildPlugin_ValidatorBaseForWire
//! \param theError error message.
virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
/// \return true if the attribute in feature is not obligatory for the feature execution
virtual bool isNotObligatory(std::string theFeature, std::string theAttribute);
//! \param theError error message.
virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
/// \return true if the attribute in feature is not obligatory for the feature execution
virtual bool isNotObligatory(std::string theFeature, std::string theAttribute);
//! \param[out] theError error message.
virtual bool isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
};
#endif
return true;
}
-std::string Config_Translator::translate(std::shared_ptr<Events_InfoMessage> theInfo)
+std::string Config_Translator::translate(const Events_InfoMessage& theInfo)
{
- std::string aContext = theInfo->context();
- std::string aMessage = theInfo->messageString();
- std::list<std::string> aParameters = theInfo->parameters();
+ std::string aContext = theInfo.context();
+ std::string aMessage = theInfo.messageString();
+ std::list<std::string> aParameters = theInfo.parameters();
return translate(aContext, aMessage, aParameters);
}
-
std::string insertParameters(const std::string& theString, const std::list<std::string>& theParams)
{
std::string aResult = theString;
/**
* Returns translation from the given info message.
- * If transdlation is not exists then it returns a string
+ * If translation is not exists then it returns a string
* from the info data without translation
* \param theInfo an info message
*/
- static CONFIG_EXPORT std::string translate(std::shared_ptr<Events_InfoMessage> theInfo);
+ static CONFIG_EXPORT std::string translate(const Events_InfoMessage& theInfo);
/**
* Returns translation from the given data.
#endif
};
-#endif
\ No newline at end of file
+#endif
/// Constructor
/// \param theSender a pointer on sender object
- Events_InfoMessage(const void* theSender = 0):Events_Message(Events_Loop::eventByName("InfoMessage"), theSender) {}
+ explicit Events_InfoMessage(const void* theSender = 0):Events_Message(Events_Loop::eventByName("InfoMessage"), theSender) {}
/// Constructor
/// \param theSender a pointer on sender object
/// Returns message
std::string messageString() const { return myMessage; }
+ Events_InfoMessage& operator=(const std::string& theMsg) {
+ setMessageString(theMsg);
+ return *this;
+ }
+
+ bool empty() const {
+ return myMessage.empty();
+ }
+
/// Add parameter for message string of string type
/// \param theParam the parameter
void addParameter(const std::string& theParam)
std::list<std::string> myParameters;
};
-#endif
\ No newline at end of file
+#endif
#include <ExchangePlugin_Tools.h>
+#include <Events_InfoMessage.h>
+
#include <ModelAPI_Feature.h>
#include <ModelAPI_Object.h>
#include <ModelAPI_Session.h>
bool ExchangePlugin_FormatValidator::isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
if (!theAttribute->isInitialized()) {
theError = "Is not initialized.";
*/
virtual bool isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
};
/**
#include "FeaturesPlugin_ValidatorTransform.h"
+#include <Events_InfoMessage.h>
+
#include "ModelAPI_AttributeSelectionList.h"
#include "ModelAPI_ResultPart.h"
#include "ModelAPI_ResultBody.h"
bool FeaturesPlugin_ValidatorTransform::isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
bool aValid = true;
std::string anAttributeType = theAttribute->attributeType();
*/
virtual bool isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
};
#endif
#include "FeaturesPlugin_Union.h"
+#include <Events_InfoMessage.h>
+
#include <ModelAPI_Attribute.h>
#include <ModelAPI_AttributeInteger.h>
#include <ModelAPI_AttributeSelectionList.h>
//==================================================================================================
bool FeaturesPlugin_ValidatorPipePath::isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
AttributeSelectionPtr aPathAttrSelection = std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(theAttribute);
if(!aPathAttrSelection.get()) {
//==================================================================================================
bool FeaturesPlugin_ValidatorPipeLocations::isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
static const std::string aCreationMethodID = "creation_method";
static const std::string aBaseObjectsID = "base_objects";
//==================================================================================================
bool FeaturesPlugin_ValidatorBaseForGeneration::isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
if(theArguments.empty()) {
theError = "Error: Validator parameters is empty.";
//==================================================================================================
bool FeaturesPlugin_ValidatorBaseForGeneration::isValidAttribute(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
if(!theAttribute.get()) {
theError = "Error: Empty attribute.";
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: ";
- std::list<std::string>::const_iterator anIt = theArguments.cbegin();
- theError += *anIt;
- for(++anIt; anIt != theArguments.cend(); ++anIt) {
- theError += ", " + *anIt;
+ "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())
+ anArgumentString += ", ";
+ anArgumentString += *anIt;
}
+ theError.arg(anArgumentString);
return false;
}
//==================================================================================================
bool FeaturesPlugin_ValidatorCompositeLauncher::isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
if (theAttribute->attributeType() != ModelAPI_AttributeReference::typeId()) {
theError = "Error: The attribute with the " + theAttribute->attributeType() + " type is not processed";
//==================================================================================================
bool FeaturesPlugin_ValidatorExtrusionDir::isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
if(theArguments.size() != 2) {
theError = "Error: Validator should be used with 2 parameters for extrusion.";
//==================================================================================================
bool FeaturesPlugin_ValidatorExtrusionDir::isShapesCanBeEmpty(const AttributePtr& theAttribute,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
if(!theAttribute.get()) {
return true;
//==================================================================================================
bool FeaturesPlugin_ValidatorBooleanSelection::isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
AttributeSelectionListPtr anAttrSelectionList = std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
if(!anAttrSelectionList.get()) {
//==================================================================================================
bool FeaturesPlugin_ValidatorPartitionSelection::isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
AttributeSelectionListPtr anAttrSelectionList = std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
if(!anAttrSelectionList.get()) {
//==================================================================================================
bool FeaturesPlugin_ValidatorRemoveSubShapesSelection::isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
AttributeSelectionListPtr aSubShapesAttrList = std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
if(!aSubShapesAttrList.get()) {
//==================================================================================================
bool FeaturesPlugin_ValidatorRemoveSubShapesResult::isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
static const std::string aBaseShapeID = "base_shape";
static const std::string aSubShapesID = "subshapes";
//==================================================================================================
bool FeaturesPlugin_ValidatorUnionSelection::isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
AttributeSelectionListPtr aBaseObjectsAttrList = std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
if(!aBaseObjectsAttrList.get()) {
//==================================================================================================
bool FeaturesPlugin_ValidatorUnionArguments::isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
// Check feature kind.
if(theFeature->getKind() != FeaturesPlugin_Union::ID()) {
//! \param[out] theError error message.
virtual bool isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
};
/// \class FeaturesPlugin_ValidatorPipeLocations
//! \param theError error message
virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
/// Returns true if the attribute in feature is not obligatory for the feature execution
virtual bool isNotObligatory(std::string theFeature, std::string theAttribute);
//! \param[out] theError error message.
virtual bool isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
private:
bool isValidAttribute(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
};
/// \class FeaturesPlugin_ValidatorCompositeLauncher
//! \param[out] theError error message.
virtual bool isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
};
/// \class FeaturesPlugin_ValidatorExtrusionDir
//! \param[out] theError error message.
virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
/// \return true if the attribute in feature is not obligatory for the feature execution
virtual bool isNotObligatory(std::string theFeature, std::string theAttribute);
private:
bool isShapesCanBeEmpty(const AttributePtr& theAttribute,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
};
/// \class FeaturesPlugin_ValidatorBooleanSelection
/// \param[out] theError error message.
virtual bool isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
};
/// \class FeaturesPlugin_ValidatorPartitionSelection
/// \param[out] theError error message.
virtual bool isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
};
/// \class FeaturesPlugin_ValidatorRemoveSubShapesSelection
/// \param[out] theError error message.
virtual bool isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
};
/// \class FeaturesPlugin_ValidatorRemoveSubShapesResult
//! \param theError error message
virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
/// \return true if the attribute in feature is not obligatory for the feature execution
virtual bool isNotObligatory(std::string theFeature, std::string theAttribute);
/// \param[out] theError error message.
virtual bool isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
};
/// \class FeaturesPlugin_ValidatorUnionArguments
//! \param theError error message
virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
/// \return true if the attribute in feature is not obligatory for the feature execution
virtual bool isNotObligatory(std::string theFeature, std::string theAttribute);
#include "GeomValidators_BodyShapes.h"
+#include <Events_InfoMessage.h>
+
#include <ModelAPI_AttributeSelectionList.h>
#include <ModelAPI_Object.h>
#include <ModelAPI_ResultConstruction.h>
bool GeomValidators_BodyShapes::isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
std::string anAttributeType = theAttribute->attributeType();
if(anAttributeType == ModelAPI_AttributeSelection::typeId()) {
/// \param[out] theError error message.
GEOMVALIDATORS_EXPORT virtual bool isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
};
#endif
#include <GeomValidators_BooleanArguments.h>
+#include <Events_InfoMessage.h>
+
#include <ModelAPI_AttributeInteger.h>
#include <ModelAPI_AttributeSelectionList.h>
//=================================================================================================
bool GeomValidators_BooleanArguments::isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
if(theArguments.size() != 3) {
theError = "Wrong number of arguments (expected 3).";
*/
GEOMVALIDATORS_EXPORT virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
/// \return true if the attribute in feature is not obligatory for the feature execution.
GEOMVALIDATORS_EXPORT virtual bool isNotObligatory(std::string theFeature, std::string theAttribute);
#include "GeomValidators_ConstructionComposite.h"
+#include <Events_InfoMessage.h>
+
#include "ModelAPI_AttributeSelection.h"
#include "ModelAPI_ResultConstruction.h"
#include "ModelAPI_CompositeFeature.h"
bool GeomValidators_ConstructionComposite::isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
bool aValid = true;
if (theAttribute->attributeType() != ModelAPI_AttributeSelection::typeId()) {
//! \param[out] theError error message.
GEOMVALIDATORS_EXPORT virtual bool isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
};
#endif
#include <GeomValidators_Different.h>
+#include <Events_InfoMessage.h>
+
#include <GeomDataAPI_Point2D.h>
#include <GeomAPI_Pnt2d.h>
bool GeomValidators_Different::isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
std::map<std::string, std::list<AttributePtr> > anAttributesMap;
// For all attributes referred by theArguments
*/
GEOMVALIDATORS_EXPORT virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
GEOMVALIDATORS_EXPORT virtual bool isNotObligatory(std::string theFeature, std::string theAttribute);
};
#include "GeomValidators_DifferentShapes.h"
+#include <Events_InfoMessage.h>
+
#include <ModelAPI_AttributeSelection.h>
#include "ModelAPI_Object.h"
bool GeomValidators_DifferentShapes::isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(theAttribute->owner());
AttributeSelectionPtr aSelectionAttribute =
/// \param[out] theError error message.
GEOMVALIDATORS_EXPORT virtual bool isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
};
#endif
bool GeomValidators_Face::isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
std::string anAttributeType = theAttribute->attributeType();
if (anAttributeType != ModelAPI_AttributeSelection::typeId()) {
//! \param[out] theError error message.
GEOMVALIDATORS_EXPORT virtual bool isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
};
#endif
#include "GeomValidators_FeatureKind.h"
+#include <Events_InfoMessage.h>
+
#include <ModelAPI_AttributeSelectionList.h>
#include <ModelAPI_AttributeRefList.h>
#include <ModelAPI_AttributeRefAttr.h>
bool GeomValidators_FeatureKind::isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
bool isSketchEntities = true;
std::set<std::string> anEntityKinds;
/// \param[out] theError error message.
GEOMVALIDATORS_EXPORT virtual bool isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
};
#endif
#include <GeomValidators_Finite.h>
+#include <Events_InfoMessage.h>
+
#include <ModelAPI_AttributeSelectionList.h>
#include <ModelAPI_ResultConstruction.h>
bool GeomValidators_Finite::isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
bool aValid = true;
//! \param[out] theError error message.
GEOMVALIDATORS_EXPORT virtual bool isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
};
#endif
#include "GeomValidators_IntersectionSelection.h"
+#include <Events_InfoMessage.h>
+
#include <ModelAPI_AttributeInteger.h>
#include <ModelAPI_AttributeSelectionList.h>
#include <ModelAPI_Feature.h>
bool GeomValidators_IntersectionSelection::isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
if(!theAttribute.get()) {
theError = "Error: empty selection.";
if(aFeatureKind == "Sketch" ||
aFeatureKind == "Plane" ||
aFeatureKind == "Axis") {
- theError = "Error: ";
- theError += aFeatureKind;
- theError += " shape is not allowed for selection.";
+ theError = "Error: %1 shape is not allowed for selection.";
+ theError.arg(aFeatureKind);
return false;
}
std::shared_ptr<GeomAPI_Shape> aShape = anAttrSelection->value();
/// \param[out] theError error message.
GEOMVALIDATORS_EXPORT virtual bool isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
};
#endif
#include <GeomValidators_MinObjectsSelected.h>
+#include <Events_InfoMessage.h>
+
#include <ModelAPI_AttributeInteger.h>
#include <ModelAPI_AttributeSelectionList.h>
//=================================================================================================
bool GeomValidators_MinObjectsSelected::isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
if(theArguments.size() != 2) {
theError = "Error: Wrong number of arguments (expected 2): selection list id and min number of objects";
/// \returns true if feature is valid.
GEOMVALIDATORS_EXPORT virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
/// \return true if the attribute in feature is not obligatory for the feature execution.
GEOMVALIDATORS_EXPORT virtual bool isNotObligatory(std::string theFeature, std::string theAttribute);
#include <GeomValidators_PartitionArguments.h>
+#include <Events_InfoMessage.h>
+
#include <ModelAPI_AttributeBoolean.h>
#include <ModelAPI_AttributeSelectionList.h>
//=================================================================================================
bool GeomValidators_PartitionArguments::isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
if(theArguments.size() != 3) {
theError = "Wrong number of arguments (expected 3).";
*/
GEOMVALIDATORS_EXPORT virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
/// \return true if the attribute in feature is not obligatory for the feature execution.
GEOMVALIDATORS_EXPORT virtual bool isNotObligatory(std::string theFeature, std::string theAttribute);
// Author: Mikhail PONIKAROV
#include "GeomValidators_Positive.h"
+
+#include <Events_InfoMessage.h>
+
#include <ModelAPI_AttributeDouble.h>
#include <ModelAPI_AttributeInteger.h>
#include <ModelAPI_Session.h>
bool GeomValidators_Positive::isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
double aMinValue = 1.e-5;
if(theArguments.size() == 1) {
//! \param[out] theError error message.
GEOMVALIDATORS_EXPORT virtual bool isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
};
bool GeomValidators_ShapeType::isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
bool aValid = false;
bool GeomValidators_ShapeType::isValidAttribute(const AttributePtr& theAttribute,
const TypeOfShape theShapeType,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
bool aValid = true;
bool GeomValidators_ShapeType::isValidObject(const ObjectPtr& theObject,
const TypeOfShape theShapeType,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
bool aValid = true;
if (!theObject.get()) {
bool GeomValidators_ShapeType::isValidShape(const GeomShapePtr theShape,
const TypeOfShape theShapeType,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
bool aValid = true;
//! \param[out] theError error message.
GEOMVALIDATORS_EXPORT virtual bool isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
protected:
/// Convert string to TypeOfShape value
/// \param theType a string value
/// \param[out] theError error message.
bool isValidAttribute(const AttributePtr& theAttribute,
const TypeOfShape theShapeType,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
/// Returns true if the attibute's object type satisfies the argument value
/// \param[in] theObject a checked object
/// \param[out] theError error message.
bool isValidObject(const ObjectPtr& theObject,
const TypeOfShape theShapeType,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
/// Returns true if the attibute's object type satisfies the argument value
/// \param[in] theShape a checked shape
/// \param[out] theError error message.
bool isValidShape(const GeomShapePtr theShape,
const TypeOfShape theShapeType,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
};
#include <GeomValidators_ZeroOffset.h>
+#include <Events_InfoMessage.h>
+
#include <ModelAPI_AttributeDouble.h>
#include <ModelAPI_AttributeSelection.h>
#include <ModelAPI_AttributeSelectionList.h>
//=================================================================================================
bool GeomValidators_ZeroOffset::isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
if(theArguments.size() != 9) {
theError = "Wrong number of validator arguments in xml(expected 9).";
*/
GEOMVALIDATORS_EXPORT virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
/// \return true if the attribute in feature is not obligatory for the feature execution.
GEOMVALIDATORS_EXPORT virtual bool isNotObligatory(std::string theFeature, std::string theAttribute);
#include "Model_AttributeValidator.h"
+#include <Events_InfoMessage.h>
+
#include <ModelAPI_AttributeDouble.h>
#include <ModelAPI_AttributeInteger.h>
bool Model_AttributeValidator::isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
if (theAttribute->attributeType() == ModelAPI_AttributeInteger::typeId()) {
AttributeIntegerPtr anAttribue =
/// \returns true if attribute is valid
MODEL_EXPORT virtual bool isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
};
#endif // Model_AttributeValidator_H
// Author: Vitaly SMETANNIKOV
#include <Model_FeatureValidator.h>
+
+#include <Events_InfoMessage.h>
+
#include <Model_Validator.h>
#include <ModelAPI_Attribute.h>
#include <ModelAPI_Data.h>
bool Model_FeatureValidator::isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
static Model_ValidatorsFactory* aValidators =
static_cast<Model_ValidatorsFactory*>(ModelAPI_Session::get()->validators());
/// \returns true if feature is valid
MODEL_EXPORT virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
/// sets not obligatory attributes, not checked for initialization
virtual void registerNotObligatory(std::string theFeature, std::string theAttribute);
const ModelAPI_FeatureValidator* aFValidator =
dynamic_cast<const ModelAPI_FeatureValidator*>(validator(aValidatorID));
if (aFValidator) {
- std::string anError;
+ Events_InfoMessage anError;
if (!aFValidator->isValid(theFeature, anArguments, anError)) {
if (anError.empty())
anError = "Unknown error.";
- anError = aValidatorID + ": " + anError;
- theFeature->setError(anError, false);
+ anError = aValidatorID + ": " + anError.messageString();
+ theFeature->setError(anError.messageString(), false);
theFeature->data()->execState(ModelAPI_StateInvalidArgument);
return false;
}
AttributePtr anAttribute = theFeature->data()->attribute(anAttributeID);
std::string aValidatorID;
- std::string anError;
+ Events_InfoMessage anError;
if (!validate(anAttribute, aValidatorID, anError)) {
if (anError.empty())
anError = "Unknown error.";
- anError = anAttributeID + " - " + aValidatorID + ": " + anError;
- theFeature->setError(anError, false);
+ anError = anAttributeID + " - " + aValidatorID + ": " + anError.messageString();
+ theFeature->setError(anError.messageString(), false);
theFeature->data()->execState(ModelAPI_StateInvalidArgument);
return false;
}
bool Model_ValidatorsFactory::validate(const std::shared_ptr<ModelAPI_Attribute>& theAttribute,
std::string& theValidator,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
FeaturePtr aFeature = ModelAPI_Feature::feature(theAttribute->owner());
if (!aFeature.get()) {
/// Returns true if the attribute is valid.
MODEL_EXPORT virtual bool validate(const std::shared_ptr<ModelAPI_Attribute>& theAttribute,
- std::string& theValidator, std::string& theError) const;
+ std::string& theValidator, Events_InfoMessage& theError) const;
/// register that this attribute in feature is not obligatory for the feature execution
/// so, it is not needed for the standard validation mechanism
//! \param theError the error string message if validation fails
virtual bool isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const = 0;
+ Events_InfoMessage& theError) const = 0;
MODELAPI_EXPORT ~ModelAPI_AttributeValidator();
};
/// \param theError the error string message if validation fails
virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<std::string>& theArguments,
- std::string& theError) const = 0;
+ Events_InfoMessage& theError) const = 0;
/// Returns true if the attribute in feature is not obligatory for the feature execution
virtual bool isNotObligatory(std::string theFeature, std::string theAttribute) = 0;
#include <list>
class ModelAPI_Feature;
+class Events_InfoMessage;
/**\class ModelAPI_Validator
* \ingroup DataModel
/// Returns true if the attribute is valid.
virtual bool validate(const std::shared_ptr<ModelAPI_Attribute>& theAttribute,
- std::string& theValidator, std::string& theError) const = 0;
+ std::string& theValidator, Events_InfoMessage& theError) const = 0;
/// register that this attribute in feature is not obligatory for the feature execution
/// so, it is not needed for the standard validation mechanism
#include "ModuleBase_Tools.h"
#include "ModuleBase_WidgetValidator.h"
+#include <Events_InfoMessage.h>
+
#include <ModelAPI_Data.h>
#include <ModelAPI_Attribute.h>
#include <ModelAPI_Events.h>
return anError;
std::string aValidatorID;
- std::string anErrorMsg;
+ Events_InfoMessage anErrorMsg;
static ModelAPI_ValidatorsFactory* aValidators = ModelAPI_Session::get()->validators();
if (!aValidators->validate(anAttribute, aValidatorID, anErrorMsg)) {
if (anErrorMsg.empty())
anErrorMsg = "unknown error.";
- anErrorMsg = anAttributeID + " - " + aValidatorID + ": " + anErrorMsg;
+ anErrorMsg = anAttributeID + " - " + aValidatorID + ": " + anErrorMsg.messageString();
+ }
+
+ if (!anErrorMsg.empty()) {
+ std::string aStr = Config_Translator::translate(anErrorMsg);
+ std::string aCodec = Config_Translator::codec(anErrorMsg.context());
+ anError = QTextCodec::codecForName(aCodec.c_str())->toUnicode(aStr.c_str());
}
- anError = QString::fromStdString(anErrorMsg);
if (anError.isEmpty() && theValueStateChecked)
anError = getValueStateError();
#include <ModuleBase_WidgetSelectorStore.h>
#include <ModuleBase_ViewerPrs.h>
+#include <Events_InfoMessage.h>
+
#include <ModelAPI_Session.h>
#include <ModelAPI_Validator.h>
#include <ModelAPI_AttributeValidator.h>
{
SessionPtr aMgr = ModelAPI_Session::get();
ModelAPI_ValidatorsFactory* aFactory = aMgr->validators();
- std::string aValidatorID, anError;
+ std::string aValidatorID;
+ Events_InfoMessage anError;
return aFactory->validate(theAttribute, aValidatorID, anError);
}
bool isValidAttribute(const AttributePtr& theAttribute)
{
- std::string aValidator, anError;
+ std::string aValidator;
+ Events_InfoMessage anError;
return ModelAPI_Session::get()->validators()->validate(theAttribute, aValidator, anError);
}
#include <ParametersPlugin_Parameter.h>
+#include <Events_InfoMessage.h>
+
#include <ModelAPI_AttributeString.h>
#include <ModelAPI_Feature.h>
#include <ModelAPI_ResultParameter.h>
bool ParametersPlugin_VariableValidator::isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
AttributeStringPtr aStrAttr = std::dynamic_pointer_cast<ModelAPI_AttributeString>(theAttribute);
if (!aStrAttr->isInitialized()) {
bool ParametersPlugin_ExpressionValidator::isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(theAttribute->owner());
ResultParameterPtr aParam =
*/
PARAMETERSPLUGIN_EXPORT virtual bool isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
protected:
/// Returns true if theString is a valid variable name.
*/
PARAMETERSPLUGIN_EXPORT virtual bool isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
};
#include "ParametersPlugin_Parameter.h"
#include "ParametersPlugin_Validators.h"
+#include <Events_InfoMessage.h>
+
#include <ModelAPI_ResultParameter.h>
#include <ModelAPI_AttributeString.h>
#include <ModelAPI_AttributeRefList.h>
ParametersPlugin_ExpressionValidator aValidator;
std::list<std::string> aArgs;
std::string aAttrId = ParametersPlugin_Parameter::VARIABLE_ID();
- std::string aErr;
+ Events_InfoMessage aErr;
int aId = 0;
foreach(FeaturePtr aFeature, myParametersList) {
if (!aValidator.isValid(aFeature->attribute(aAttrId), aArgs, aErr)) {
- QMessageBox::warning(this, tr("Warning"), aErr.c_str());
+ // TODO(spo): translate
+ QMessageBox::warning(this, tr("Warning"), aErr.messageString().c_str());
selectItemScroll(myParameters->child(aId));
return false;
}
#include <ModuleBase_OperationFeature.h>
#include <ModuleBase_ViewerPrs.h>
+#include <Events_InfoMessage.h>
+
#include <ModelAPI_AttributeRefAttr.h>
#include <ModelAPI_AttributeSelection.h>
#include <ModelAPI_AttributeReference.h>
bool PartSet_DifferentObjectsValidator::isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(theAttribute->owner());
bool PartSet_CoincidentAttr::isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
if (theAttribute->attributeType() != ModelAPI_AttributeRefAttr::typeId()) {
theError = "The attribute with the " + theAttribute->attributeType() + " type is not processed";
//! \param theError an output error string
virtual bool isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
private:
//! Returns error message for the error type
//! \param theType a type of error
//! \param theError an output error string
virtual bool isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
};
#include <GeomAPI_Face.h>
+#include <Events_InfoMessage.h>
+
#include <ModelAPI_Session.h>
#include <ModelAPI_ResultBody.h>
#include <ModelAPI_AttributeSelection.h>
SessionPtr aMgr = ModelAPI_Session::get();
ModelAPI_ValidatorsFactory* aFactory = aMgr->validators();
AttributePtr anAttribute = myFeature->attribute(anObjectsAttribute);
- std::string aValidatorID, anError;
+ std::string aValidatorID;
+ Events_InfoMessage anError;
aSelList->append(aRes, GeomShapePtr());
if (aFactory->validate(anAttribute, aValidatorID, anError))
updateObject(aCompFeature);
SessionPtr aMgr = ModelAPI_Session::get();
ModelAPI_ValidatorsFactory* aFactory = aMgr->validators();
- std::string aValidatorID, anError;
+ std::string aValidatorID;
+ Events_InfoMessage anError;
bool isValidPComposite = aFactory->validate(anAttrList, aValidatorID, anError);
if (!isValidPComposite) {
XGUI_Workshop* aWorkshop = XGUI_Tools::workshop(myModule->workshop());
+ // TODO(spo): translate
QMessageBox::question(aWorkshop->desktop(), tr("Apply current feature"),
- tr("Sketch is invalid and will be deleted.\nError: %1").arg(anError.c_str()),
+ tr("Sketch is invalid and will be deleted.\nError: %1").arg(anError.messageString().c_str()),
QMessageBox::Ok);
}
return isValidPComposite;
#include "SketchPlugin_ExternalValidator.h"
#include "SketchPlugin_Feature.h"
+#include <Events_InfoMessage.h>
+
#include <ModelAPI_Session.h>
#include <ModelAPI_Result.h>
#include <ModelAPI_Tools.h>
bool SketchPlugin_ExternalValidator::isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
if (theArguments.size() != 1)
return true;
/// \param theError error message
SKETCHPLUGIN_EXPORT virtual bool isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
protected:
/// returns true if the feature of the attribute is external
#include "SketcherPrs_Tools.h"
+#include <Events_InfoMessage.h>
+
#include <ModelAPI_Data.h>
#include <ModelAPI_Validator.h>
#include <ModelAPI_AttributeDouble.h>
bool SketchPlugin_DistanceAttrValidator::isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
if (theAttribute->attributeType() != ModelAPI_AttributeRefAttr::typeId()) {
theError = "The attribute with the " + theAttribute->attributeType() + " type is not processed";
dynamic_cast<const ModelAPI_AttributeValidator*>(aFactory->validator("GeomValidators_ShapeType"));
std::list<std::string> anArguments;
anArguments.push_back("circle");
- std::string aCircleError;
+ Events_InfoMessage aCircleError;
bool aShapeValid = aShapeValidator->isValid(aRefAttr, anArguments, aCircleError);
// the circle line is not a valid case
if (aShapeValid) {
anArguments.clear();
anArguments.push_back("line");
- std::string aLineError;
+ Events_InfoMessage aLineError;
aShapeValid = aShapeValidator->isValid(aRefAttr, anArguments, aLineError);
// if the attribute value is not a line, that means it is a vertex. A vertex is always valid
if (aShapeValid) {
bool SketchPlugin_TangentAttrValidator::isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
if (theAttribute->attributeType() != ModelAPI_AttributeRefAttr::typeId()) {
theError = "The attribute with the " + theAttribute->attributeType() + " type is not processed";
bool SketchPlugin_NotFixedValidator::isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
if (theAttribute->attributeType() != ModelAPI_AttributeRefAttr::typeId()) {
theError = "The attribute with the " + theAttribute->attributeType() + " type is not processed";
bool SketchPlugin_EqualAttrValidator::isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
if (theAttribute->attributeType() != ModelAPI_AttributeRefAttr::typeId()) {
theError = "The attribute with the " + theAttribute->attributeType() + " type is not processed";
bool SketchPlugin_MirrorAttrValidator::isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
if (theAttribute->attributeType() != ModelAPI_AttributeRefList::typeId()) {
theError = "The attribute with the " + theAttribute->attributeType() + " type is not processed";
bool SketchPlugin_CoincidenceAttrValidator::isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
if (theAttribute->attributeType() != ModelAPI_AttributeRefAttr::typeId()) {
theError = "The attribute with the " + theAttribute->attributeType() + " type is not processed";
bool SketchPlugin_CopyValidator::isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
if (theAttribute->attributeType() != ModelAPI_AttributeRefList::typeId()) {
theError = "The attribute with the " + theAttribute->attributeType() + " type is not processed";
bool SketchPlugin_SolverErrorValidator::isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
AttributeStringPtr aAttributeString = theFeature->string(SketchPlugin_Sketch::SOLVER_ERROR());
bool SketchPlugin_FilletVertexValidator::isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
std::shared_ptr<SketchPlugin_ConstraintFillet> aFilletFeature = std::dynamic_pointer_cast<SketchPlugin_ConstraintFillet>(theAttribute->owner());
AttributeRefAttrListPtr aPointsRefList = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttrList>(theAttribute);
bool SketchPlugin_MiddlePointAttrValidator::isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
if (theAttribute->attributeType() != ModelAPI_AttributeRefAttr::typeId()) {
theError = "The attribute with the " + theAttribute->attributeType() + " type is not processed";
bool SketchPlugin_ArcTangentPointValidator::isValid(const AttributePtr& theAttribute,
const std::list<std::string>& /*theArguments*/,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
if (theAttribute->attributeType() != ModelAPI_AttributeRefAttr::typeId()) {
theError = "The attribute with the " + theAttribute->attributeType() + " type is not processed";
bool SketchPlugin_IntersectionValidator::isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
if (theAttribute->attributeType() != ModelAPI_AttributeSelection::typeId()) {
theError = "The attribute with the " + theAttribute->attributeType() + " type is not processed";
bool SketchPlugin_ProjectionValidator::isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const
+ Events_InfoMessage& theError) const
{
if (theAttribute->attributeType() != ModelAPI_AttributeSelection::typeId()) {
theError = "The attribute with the " + theAttribute->attributeType() + " type is not processed";
//! \param theError error message
virtual bool isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
};
/**\class SketchPlugin_TangentAttrValidator
//! \param theError error message
virtual bool isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
};
//! \param theError error message
virtual bool isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
};
/**\class SketchPlugin_EqualAttrValidator
//! \param theError error message
virtual bool isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
};
/**\class SketchPlugin_MirrorAttrValidator
//! \param theError error message
virtual bool isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
};
//! \param theError error message
virtual bool isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
};
//! \param theError error message
virtual bool isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
};
/**\class SketchPlugin_SolverErrorValidator
//! \param theError error message
virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
/// Returns true if the attribute in feature is not obligatory for the feature execution
virtual bool isNotObligatory(std::string theFeature, std::string theAttribute);
//! \param theError error message
virtual bool isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
};
//! \param theError error message
virtual bool isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
};
//! \param theError error message
virtual bool isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
};
/**\class SketchPlugin_IntersectionValidator
//! \param theError error message
virtual bool isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
};
/**\class SketchPlugin_ProjectionValidator
//! \param theError error message
virtual bool isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError) const;
+ Events_InfoMessage& theError) const;
};
#endif
void XGUI_ErrorDialog::addError(std::shared_ptr<Events_InfoMessage> theMsg)
{
- std::string aError = Config_Translator::translate(theMsg);
+ std::string aError = Config_Translator::translate(*theMsg);
std::string aCodec = Config_Translator::codec(theMsg->context());
QString aMsg = QTextCodec::codecForName(aCodec.c_str())->toUnicode(aError.c_str());
myErrors.append(aMsg);