Salome HOME
Remove extra includes
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_Validators.h
index 74357d1eb24e5a10e4564f83b563727d61b3039a..14647fa71b35f372f84e8844b3996cb067950b0d 100644 (file)
@@ -6,17 +6,43 @@
 #define SketchPlugin_Validators_H
 
 #include "SketchPlugin.h"
-//#include <ModuleBase_FeatureValidator.h>
-#include <ModelAPI_AttributeValidator.h>
+#include <ModelAPI_RefAttrValidator.h>
 
-
-class SketchPlugin_DistanceAttrValidator: public ModelAPI_AttributeValidator
+class SketchPlugin_DistanceAttrValidator : public ModelAPI_RefAttrValidator
 {
-public:
-  virtual bool isValid(const FeaturePtr& theFeature, 
-                       const std::list<std::string>& theArguments,
+ 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_DifferentObjectsValidator : 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;
 };
 
-#endif
\ No newline at end of file
+#endif