}
bool ExchangePlugin_FormatValidator::isValid(const AttributePtr& theAttribute,
- const std::list<std::string>& theArguments) const
+ const std::list<std::string>& theArguments,
+ std::string& theError) const
{
if (!theAttribute->isInitialized())
return false;
* allowed formats.
*/
virtual bool isValid(const AttributePtr& theAttribute,
- const std::list<std::string>& theArguments) const;
+ const std::list<std::string>& theArguments,
+ std::string& theError) const;
};
class ExchangePlugin_ImportFormatValidator : public ExchangePlugin_FormatValidator
#include "ModelAPI_CompositeFeature.h"
bool GeomValidators_ConstructionComposite::isValid(const AttributePtr& theAttribute,
- const std::list<std::string>& theArguments) const
+ const std::list<std::string>& theArguments,
+ std::string& theError) const
{
bool aValid = false;
AttributeSelectionPtr aSelectionAttr = std::dynamic_pointer_cast<ModelAPI_AttributeSelection>
//! \param theAttribute the checked attribute
//! \param theArguments arguments of the attribute
GEOMVALIDATORS_EXPORT virtual bool isValid(const AttributePtr& theAttribute,
- const std::list<std::string>& theArguments) const;
+ const std::list<std::string>& theArguments,
+ std::string& theError) const;
};
#endif
}
bool GeomValidators_Face::isValid(const AttributePtr& theAttribute,
- const std::list<std::string>& theArguments) const
+ const std::list<std::string>& theArguments,
+ std::string& theError) const
{
bool aValid = false;
//! \param theAttribute the checked attribute
//! \param theArguments arguments of the attribute
GEOMVALIDATORS_EXPORT virtual bool isValid(const AttributePtr& theAttribute,
- const std::list<std::string>& theArguments) const;
+ const std::list<std::string>& theArguments,
+ std::string& theError) const;
protected:
/// Convert string to TypeOfFace value
/// \param theType a string value
aFactory->registerValidator("GeomValidators_Positive", this);
}
-bool GeomValidators_Positive::isValid(
- const AttributePtr& theAttribute, const std::list<std::string>& theArguments) const
+bool GeomValidators_Positive::isValid(const AttributePtr& theAttribute,
+ const std::list<std::string>& theArguments,
+ std::string& theError) const
{
AttributeDoublePtr aDouble =
std::dynamic_pointer_cast<ModelAPI_AttributeDouble>(theAttribute);
//! \param theAttribute the checked attribute
//! \param theArguments arguments of the attribute
GEOMVALIDATORS_EXPORT virtual bool isValid(const AttributePtr& theAttribute,
- const std::list<std::string>& theArguments) const;
+ const std::list<std::string>& theArguments,
+ std::string& theError) const;
};
}
bool GeomValidators_ShapeType::isValid(const AttributePtr& theAttribute,
- const std::list<std::string>& theArguments) const
+ const std::list<std::string>& theArguments,
+ std::string& theError) const
{
bool aValid = false;
//! \param theAttribute the checked attribute
//! \param theArguments arguments of the attribute
GEOMVALIDATORS_EXPORT virtual bool isValid(const AttributePtr& theAttribute,
- const std::list<std::string>& theArguments) const;
+ const std::list<std::string>& theArguments,
+ std::string& theError) const;
protected:
/// Convert string to TypeOfShape value
/// \param theType a string value
//! \param theAttribute the checked attribute
//! \param theArguments arguments of the attribute
virtual bool isValid(const AttributePtr& theAttribute,
- const std::list<std::string>& theArguments) const = 0;
+ const std::list<std::string>& theArguments,
+ std::string& theError = std::string()) const = 0;
MODELAPI_EXPORT ~ModelAPI_AttributeValidator();
};
#include "ModelAPI_Object.h"
bool ModelAPI_ShapeValidator::isValid(const AttributePtr& theAttribute,
- const std::list<std::string>& theArguments) const
+ const std::list<std::string>& theArguments,
+ std::string& theError) const
{
FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(theAttribute->owner());
AttributeSelectionPtr aSelectionAttribute =
/// \param theAttribute an attribute to check
/// \param theArguments a filter parameters
MODELAPI_EXPORT virtual bool isValid(const AttributePtr& theAttribute,
- const std::list<std::string>& theArguments) const;
+ const std::list<std::string>& theArguments,
+ std::string& theError) const;
};
#endif
}
bool ParametersPlugin_VariableValidator::isValid(const AttributePtr& theAttribute,
- const std::list<std::string>& theArguments) const
+ const std::list<std::string>& theArguments,
+ std::string& theError) const
{
AttributeStringPtr aStrAttr = std::dynamic_pointer_cast<ModelAPI_AttributeString>(theAttribute);
bool result = isVariable(aStrAttr->value()) && isUnique(theAttribute, aStrAttr->value());
}
bool ParametersPlugin_ExpressionValidator::isValid(const AttributePtr& theAttribute,
- const std::list<std::string>& theArguments) const
+ const std::list<std::string>& theArguments,
+ std::string& theError) const
{
FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(theAttribute->owner());
ResultParameterPtr aParam =
//! \param theAttribute the checked attribute
//! \param theArguments arguments of the attribute
PARAMETERSPLUGIN_EXPORT virtual bool isValid(const AttributePtr& theAttribute,
- const std::list<std::string>& theArguments) const;
+ const std::list<std::string>& theArguments,
+ std::string& theError) const;
protected:
PARAMETERSPLUGIN_EXPORT bool isVariable(const std::string& theString) const;
//! \param theAttribute the checked attribute
//! \param theArguments arguments of the attribute
PARAMETERSPLUGIN_EXPORT virtual bool isValid(const AttributePtr& theAttribute,
- const std::list<std::string>& theArguments) const;
+ const std::list<std::string>& theArguments,
+ std::string& theError) const;
};
bool PartSet_DifferentObjectsValidator::isValid(const AttributePtr& theAttribute,
- const std::list<std::string>& theArguments) const
+ const std::list<std::string>& theArguments,
+ std::string& theError) const
{
FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(theAttribute->owner());
}
bool PartSet_SketchEntityValidator::isValid(const AttributePtr& theAttribute,
- const std::list<std::string>& theArguments) const
+ const std::list<std::string>& theArguments,
+ std::string& theError) const
{
bool isSketchEntities = true;
std::set<std::string> anEntityKinds;
-bool PartSet_SameTypeAttrValidator::isValid(
- const AttributePtr& theAttribute, const std::list<std::string>& theArguments ) const
+bool PartSet_SameTypeAttrValidator::isValid(const AttributePtr& theAttribute,
+ const std::list<std::string>& theArguments,
+ std::string& theError ) const
{
// there is a check whether the feature contains a point and a linear edge or two point values
std::string aParamA = theArguments.front();
return false;
}
-bool PartSet_CoincidentAttr::isValid(
- const AttributePtr& theAttribute, const std::list<std::string>& theArguments ) const
+bool PartSet_CoincidentAttr::isValid(const AttributePtr& theAttribute,
+ const std::list<std::string>& theArguments,
+ std::string& theError) const
{
// there is a check whether the feature contains a point and a linear edge or two point values
std::string aParamA = theArguments.front();
//! \param theAttribute an attribute
//! \param theArguments a list of arguments (names of attributes to check)
virtual bool isValid(const AttributePtr& theAttribute,
- const std::list<std::string>& theArguments) const;
+ const std::list<std::string>& theArguments,
+ std::string& theError) const;
protected:
//! Checks whethe other feature attributes has a reference to the given attribute
//! \param theAttribute an attribute
//! \param theArguments a list of arguments (names of attributes to check)
virtual bool isValid(const AttributePtr& theAttribute,
- const std::list<std::string>& theArguments) const;
+ const std::list<std::string>& theArguments,
+ std::string& theError) const;
};
/**\class PartSet_SameTypeAttrValidator
//! \param theAttribute the checked attribute
//! \param theArguments arguments of the attribute
virtual bool isValid(const AttributePtr& theAttribute,
- const std::list<std::string>& theArguments) const;
+ const std::list<std::string>& theArguments,
+ std::string& theError) const;
};
/**\class PartSet_CoincidentAttr
//! \param theAttribute the checked attribute
//! \param theArguments arguments of the attribute
virtual bool isValid(const AttributePtr& theAttribute,
- const std::list<std::string>& theArguments) const;
+ const std::list<std::string>& theArguments,
+ std::string& theError) const;
};
#include <ModelAPI_AttributeRefAttr.h>
bool SketchPlugin_ExternalValidator::isValid(const AttributePtr& theAttribute,
- const std::list<std::string>& theArguments) const
+ const std::list<std::string>& theArguments,
+ std::string& theError) const
{
if (theArguments.size() != 1)
return true;
/// \param theAttribute an attribute to check
/// \param theArguments a filter parameters
SKETCHPLUGIN_EXPORT virtual bool isValid(const AttributePtr& theAttribute,
- const std::list<std::string>& theArguments) const;
+ const std::list<std::string>& theArguments,
+ std::string& theError) const;
protected:
/// returns true if the feature of the attribute is external
#include <GeomDataAPI_Point2D.h>
-bool SketchPlugin_DistanceAttrValidator::isValid(
- const AttributePtr& theAttribute, const std::list<std::string>& theArguments ) const
+bool SketchPlugin_DistanceAttrValidator::isValid(const AttributePtr& theAttribute,
+ const std::list<std::string>& theArguments,
+ std::string& theError) const
{
// there is a check whether the feature contains a point and a linear edge or two point values
std::string aParamA = theArguments.front();
return false;
}
-bool SketchPlugin_TangentAttrValidator::isValid(
- const AttributePtr& theAttribute, const std::list<std::string>& theArguments ) const
+bool SketchPlugin_TangentAttrValidator::isValid(const AttributePtr& theAttribute,
+ const std::list<std::string>& theArguments,
+ std::string& theError) const
{
// there is a check whether the feature contains a point and a linear edge or two point values
std::string aParamA = theArguments.front();
return false;
}
-bool SketchPlugin_NotFixedValidator::isValid(
- const AttributePtr& theAttribute, const std::list<std::string>& theArguments) const
+bool SketchPlugin_NotFixedValidator::isValid(const AttributePtr& theAttribute,
+ const std::list<std::string>& theArguments,
+ std::string& theError) const
{
std::shared_ptr<SketchPlugin_Feature> aFeature =
std::dynamic_pointer_cast<SketchPlugin_Feature>(theAttribute->owner());
return true;
}
-bool SketchPlugin_EqualAttrValidator::isValid(
- const AttributePtr& theAttribute, const std::list<std::string>& theArguments ) const
+bool SketchPlugin_EqualAttrValidator::isValid(const AttributePtr& theAttribute,
+ const std::list<std::string>& theArguments,
+ std::string& theError) const
{
std::string aParamA = theArguments.front();
FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(theAttribute->owner());
return true;
}
-bool SketchPlugin_MirrorAttrValidator::isValid(
- const AttributePtr& theAttribute, const std::list<std::string>& theArguments ) const
+bool SketchPlugin_MirrorAttrValidator::isValid(const AttributePtr& theAttribute,
+ const std::list<std::string>& theArguments,
+ std::string& theError) const
{
FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(theAttribute->owner());
AttributeSelectionListPtr aSelAttr =
}
-bool SketchPlugin_CoincidenceAttrValidator::isValid(
- const AttributePtr& theAttribute, const std::list<std::string>& theArguments ) const
+bool SketchPlugin_CoincidenceAttrValidator::isValid(const AttributePtr& theAttribute,
+ const std::list<std::string>& theArguments,
+ std::string& theError) const
{
// there is a check whether the feature contains a point and a linear edge or two point values
std::string aParamA = theArguments.front();
}
-bool SketchPlugin_CopyValidator::isValid(
- const AttributePtr& theAttribute, const std::list<std::string>& theArguments ) const
+bool SketchPlugin_CopyValidator::isValid(const AttributePtr& theAttribute,
+ const std::list<std::string>& theArguments,
+ std::string& theError) const
{
FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(theAttribute->owner());
AttributeSelectionListPtr aSelAttr =
//! \param theAttribute the checked attribute
//! \param theArguments arguments of the attribute
virtual bool isValid(const AttributePtr& theAttribute,
- const std::list<std::string>& theArguments) const;
+ const std::list<std::string>& theArguments,
+ std::string& theError) const;
};
/**\class SketchPlugin_TangentAttrValidator
//! \param theAttribute the checked attribute
//! \param theArguments arguments of the attribute
virtual bool isValid(const AttributePtr& theAttribute,
- const std::list<std::string>& theArguments) const;
+ const std::list<std::string>& theArguments,
+ std::string& theError) const;
};
//! \param theAttribute the checked attribute
//! \param theArguments arguments of the attribute
virtual bool isValid(const AttributePtr& theAttribute,
- const std::list<std::string>& theArguments) const;
+ const std::list<std::string>& theArguments,
+ std::string& theError) const;
};
/**\class SketchPlugin_EqualAttrValidator
//! \param theAttribute the checked attribute
//! \param theArguments arguments of the attribute
virtual bool isValid(const AttributePtr& theAttribute,
- const std::list<std::string>& theArguments) const;
+ const std::list<std::string>& theArguments,
+ std::string& theError) const;
};
/**\class SketchPlugin_MirrorAttrValidator
//! \param theAttribute the checked attribute
//! \param theArguments arguments of the attribute (not used)
virtual bool isValid(const AttributePtr& theAttribute,
- const std::list<std::string>& theArguments) const;
+ const std::list<std::string>& theArguments,
+ std::string& theError) const;
};
//! \param theAttribute the checked attribute
//! \param theArguments arguments of the attribute (not used)
virtual bool isValid(const AttributePtr& theAttribute,
- const std::list<std::string>& theArguments) const;
+ const std::list<std::string>& theArguments,
+ std::string& theError) const;
};
//! \param theAttribute the checked attribute
//! \param theArguments arguments of the attribute (not used)
virtual bool isValid(const AttributePtr& theAttribute,
- const std::list<std::string>& theArguments) const;
+ const std::list<std::string>& theArguments,
+ std::string& theError) const;
};
#endif