Salome HOME
Union of validator and filter functionalities.
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_Validators.h
index 2f675c4f4fcc46150eb1cfc8b70463fb49a1ff20..f686d3e6ebe97a5e75cefcee21b313b3fd2b7f04 100644 (file)
@@ -8,43 +8,22 @@
 #define SketchPlugin_Validators_H
 
 #include "SketchPlugin.h"
-#include <ModelAPI_RefAttrValidator.h>
+#include <ModelAPI_AttributeValidator.h>
 
-class SketchPlugin_DistanceAttrValidator : public ModelAPI_RefAttrValidator
-{
- public:
-  //! returns true if attribute is valid
-  //! \param theAttribute the checked attribute
-  //! \param theArguments arguments of the attribute
-  virtual bool isValid(
-    const AttributePtr& theAttribute, const std::list<std::string>& theArguments) const;
-  //! Returns true if object is good for the feature attribute
-  virtual bool isValid(const FeaturePtr& theFeature, const std::list<std::string>& theArguments,
-                       const ObjectPtr& theObject) const;
-
-  //! Returns true if the attribute is good for the feature attribute
-  virtual bool isValid(const FeaturePtr& theFeature, const std::list<std::string>& theArguments,
-                       const AttributePtr& theAttribute) const { return true; };
-};
-
-/**
- * Check that there is no same object was already selected in the feature.
- * For an example: to avoid perpendicularity on line and the same line.
+/**\class SketchPlugin_DistanceAttrValidator
+ * \ingroup Validators
+ * \brief Validator for the distance input.
+ *
+ * It just checks that distance is greater than zero.
  */
-class SketchPlugin_DifferentObjectsValidator : public ModelAPI_RefAttrValidator
+class SketchPlugin_DistanceAttrValidator : public ModelAPI_AttributeValidator
 {
  public:
   //! returns true if attribute is valid
   //! \param theAttribute the checked attribute
   //! \param theArguments arguments of the attribute
-  virtual bool isValid(
-    const AttributePtr& theAttribute, const std::list<std::string>& theArguments) const;
-  //! Returns true if object is good for the feature attribute
-  virtual bool isValid(const FeaturePtr& theFeature, const std::list<std::string>& theArguments,
-                       const ObjectPtr& theObject) const;
-  //! Returns true if the attribute is good for the feature attribute
-  virtual bool isValid(const FeaturePtr& theFeature, const std::list<std::string>& theArguments,
-                       const AttributePtr& theAttribute) const;
+  virtual bool isValid(const AttributePtr& theAttribute,
+                       const std::list<std::string>& theArguments) const;
 };
 
 #endif