Salome HOME
Update constraint Mirror.
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_Validators.h
index 61553fea865450b327c40cd3b312ce6bd17d065b..e4f6d36d6904eefabf32e44a0b30e4f9ade5e169 100644 (file)
@@ -8,7 +8,7 @@
 #define SketchPlugin_Validators_H
 
 #include "SketchPlugin.h"
-#include <ModelAPI_RefAttrValidator.h>
+#include <ModelAPI_AttributeValidator.h>
 
 /**\class SketchPlugin_DistanceAttrValidator
  * \ingroup Validators
  *
  * It just checks that distance is greater than zero.
  */
-class SketchPlugin_DistanceAttrValidator : 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;
 };
 
-/**\class SketchPlugin_DifferentObjectsValidator
+
+/**\class SketchPlugin_TangentAttrValidator
+ * \ingroup Validators
+ * \brief Validator for the tangent constraint input.
+ *
+ * It just checks that distance is greater than zero.
+ */
+class SketchPlugin_TangentAttrValidator : 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;
+};
+
+
+/**\class SketchPlugin_NotFixed
+ * \ingroup Validators
+ * \brief Validator for the rigid constraint input.
+ *
+ * It just checks there is no rigid constraint for the current feature.
+ */
+class SketchPlugin_NotFixedValidator : public ModelAPI_AttributeValidator
+{
+ public:
+  //! returns true if attribute is not used in another rigid constraint
+  //! \param theAttribute the checked attribute
+  //! \param theArguments arguments of the attribute
+  virtual bool isValid(const AttributePtr& theAttribute,
+                       const std::list<std::string>& theArguments) const;
+};
+
+/**\class SketchPlugin_EqualAttrValidator
  * \ingroup Validators
+ * \brief Validator for the equal constraint input.
  *
- * 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.
+ * It checks that attributes of the Equal constraint are correct.
  */
-// Use PartSet_DifferentObjectsValidator
-//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;
-//};
+class SketchPlugin_EqualAttrValidator : 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;
+};
+
+/**\class SketchPlugin_MirrorAttrValidator
+ * \ingroup Validators
+ * \brief Validator for the mirror constraint input.
+ *
+ * It checks that attributes of the Mirror constraint are correct.
+ */
+class SketchPlugin_MirrorAttrValidator : public ModelAPI_AttributeValidator
+{
+ public:
+  //! returns true if attribute is valid
+  //! \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;
+};
+
 
 #endif