Salome HOME
Issue #353 constraint on 2 segments from not acive sketches
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_Validators.h
index 8a5a82bb04a3f30f5bd76b90361a60548f778c28..d6368a1eb3e30ba13697582c7c57f30a34187993 100644 (file)
@@ -1,3 +1,5 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
+
 // File:        SketchPlugin_Validators.h
 // Created:     01 Aug 2014
 // Author:      Vitaly SMETANNIKOV
@@ -8,6 +10,12 @@
 #include "SketchPlugin.h"
 #include <ModelAPI_RefAttrValidator.h>
 
+/**\class SketchPlugin_DistanceAttrValidator
+ * \ingroup Validators
+ * \brief Validator for the distance input.
+ *
+ * It just checks that distance is greater than zero.
+ */
 class SketchPlugin_DistanceAttrValidator : public ModelAPI_RefAttrValidator
 {
  public:
@@ -20,12 +28,18 @@ class SketchPlugin_DistanceAttrValidator : public ModelAPI_RefAttrValidator
   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;
 };
 
-/**
- * It must be bigger than 1.e-5
+/**\class SketchPlugin_DifferentObjectsValidator
+ * \ingroup Validators
+ *
+ * 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_RadiusValidator : public ModelAPI_AttributeValidator
+class SketchPlugin_DifferentObjectsValidator : public ModelAPI_RefAttrValidator
 {
  public:
   //! returns true if attribute is valid
@@ -33,7 +47,12 @@ class SketchPlugin_RadiusValidator : public ModelAPI_AttributeValidator
   //! \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