1 // File: SketchPlugin_Validators.h
2 // Created: 01 Aug 2014
3 // Author: Vitaly SMETANNIKOV
5 #ifndef SketchPlugin_Validators_H
6 #define SketchPlugin_Validators_H
8 #include "SketchPlugin.h"
9 #include <ModelAPI_RefAttrValidator.h>
11 class SketchPlugin_DistanceAttrValidator : public ModelAPI_RefAttrValidator
14 //! returns true if attribute is valid
15 //! \param theAttribute the checked attribute
16 //! \param theArguments arguments of the attribute
18 const AttributePtr& theAttribute, const std::list<std::string>& theArguments) const;
19 //! Returns true if object is good for the feature attribute
20 virtual bool isValid(const FeaturePtr& theFeature, const std::list<std::string>& theArguments,
21 const ObjectPtr& theObject) const;
23 //! Returns true if the attribute is good for the feature attribute
24 virtual bool isValid(const FeaturePtr& theFeature, const std::list<std::string>& theArguments,
25 const AttributePtr& theAttribute) const { return true; };
29 * Check that there is no same object was already selected in the feature.
30 * For an example: to avoid perpendicularity on line and the same line.
32 class SketchPlugin_DifferentObjectsValidator : public ModelAPI_RefAttrValidator
35 //! returns true if attribute is valid
36 //! \param theAttribute the checked attribute
37 //! \param theArguments arguments of the attribute
39 const AttributePtr& theAttribute, const std::list<std::string>& theArguments) const;
40 //! Returns true if object is good for the feature attribute
41 virtual bool isValid(const FeaturePtr& theFeature, const std::list<std::string>& theArguments,
42 const ObjectPtr& theObject) const;
43 //! Returns true if the attribute is good for the feature attribute
44 virtual bool isValid(const FeaturePtr& theFeature, const std::list<std::string>& theArguments,
45 const AttributePtr& theAttribute) const;