Salome HOME
Merge remote-tracking branch 'remotes/origin/Filters_Development_2'
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_Validators.h
index 398fd16baf5c29f8f1b2f9368b92fc5eca8b52a7..4a7bd052576a7952bb799ef1c3169c1a83e380c5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // You should have received a copy of the GNU Lesser General Public
 // License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SketchPlugin_Validators_H
@@ -427,4 +426,72 @@ class SketchPlugin_ArcEndPointIntersectionValidator: public ModelAPI_AttributeVa
                        Events_InfoMessage& theError) const;
 };
 
+/**\class SketchPlugin_HasNoConstraint
+ * \ingroup Validators
+ * \brief Validator for checking whether the feature has constraint.
+ *
+ * Checks that feature of the attribute does not have constraint with some kinds.
+ * The kinds of constraints should be described in parameters of the validator
+ * Validator processes the ModelAPI_AttributeRefAttr attribute kind
+ */
+class SketchPlugin_HasNoConstraint: public ModelAPI_AttributeValidator
+{
+ public:
+  //! returns true if attribute is valid
+  //! \param theAttribute the checked attribute
+  //! \param theArguments arguments of the attribute
+  //! \param theError error message
+  virtual bool isValid(const AttributePtr& theAttribute,
+                       const std::list<std::string>& theArguments,
+                       Events_InfoMessage& theError) const;
+};
+
+/**\class SketchPlugin_ReplicationReferenceValidator
+ * \ingroup Validators
+ * \brief Validator checking that the replications features (Mirror,
+ *        Multi-Rotation, Mutli-Translation) do not refer to the shapes they produce.
+ */
+class SketchPlugin_ReplicationReferenceValidator: public ModelAPI_AttributeValidator
+{
+ public:
+  //! returns true if attribute is valid
+  //! \param theAttribute the checked attribute
+  //! \param theArguments arguments of the attribute
+  //! \param theError error message
+  virtual bool isValid(const AttributePtr& theAttribute,
+                       const std::list<std::string>& theArguments,
+                       Events_InfoMessage& theError) const;
+};
+
+/**\class SketchPlugin_SketchFeatureValidator
+ * \ingroup Validators
+ * \brief Validator for checking whether the feature referred by attribute is a sketch feature.
+ */
+class SketchPlugin_SketchFeatureValidator: public ModelAPI_AttributeValidator
+{
+ public:
+  //! returns true if attribute is valid
+  //! \param theAttribute the checked attribute
+  //! \param theArguments arguments of the attribute
+  //! \param theError error message
+  virtual bool isValid(const AttributePtr& theAttribute,
+                       const std::list<std::string>& theArguments,
+                       Events_InfoMessage& theError) const;
+};
+
+/**\class SketchPlugin_MultiRotationAngleValidator
+ * \ingroup Validators
+ * \brief Validator for checking whether the angle of MultiRotation is in range [0, 360].
+ */
+class SketchPlugin_MultiRotationAngleValidator : public ModelAPI_AttributeValidator
+{
+  //! returns true if attribute is valid
+  //! \param theAttribute the checked attribute
+  //! \param theArguments arguments of the attribute
+  //! \param theError error message
+  virtual bool isValid(const AttributePtr& theAttribute,
+                       const std::list<std::string>& theArguments,
+                       Events_InfoMessage& theError) const;
+};
+
 #endif