Salome HOME
Issue #2660: Update data model before save.
[modules/shaper.git] / src / BuildPlugin / BuildPlugin_Validators.h
index 522e3bb8361b470b1998d456c6e2df8b47b3673a..d69f0b8b7b3ae4f3148d759b3a1f6013c163d60d 100644 (file)
@@ -55,9 +55,6 @@ public:
   virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
                        const std::list<std::string>& theArguments,
                        Events_InfoMessage& theError) const;
-
-  /// \return true if the attribute in feature is not obligatory for the feature execution
-  virtual bool isNotObligatory(std::string theFeature, std::string theAttribute);
 };
 
 /// \class BuildPlugin_ValidatorBaseForFace
@@ -74,9 +71,22 @@ public:
   virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
                        const std::list<std::string>& theArguments,
                        Events_InfoMessage& theError) const;
+};
 
-  /// \return true if the attribute in feature is not obligatory for the feature execution
-  virtual bool isNotObligatory(std::string theFeature, std::string theAttribute);
+/// \class BuildPlugin_ValidatorBaseForSolids
+/// \ingroup Validators
+/// \brief A validator for selection base shapes for solid. Allows to select faces closed enough
+/// to create a solid.
+class BuildPlugin_ValidatorBaseForSolids: public ModelAPI_FeatureValidator
+{
+public:
+  //! Returns true if attributes is ok.
+  //! \param theFeature the checked feature.
+  //! \param theArguments arguments of the feature.
+  //! \param theError error message.
+  virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                       const std::list<std::string>& theArguments,
+                       Events_InfoMessage& theError) const;
 };
 
 /// \class BuildPlugin_ValidatorSubShapesSelection
@@ -94,4 +104,19 @@ public:
                         Events_InfoMessage& theError) const;
 };
 
+/// \class BuildPlugin_ValidatorFillingSelection
+/// \ingroup Validators
+/// \brief A validator for selection of Filling feature.
+class BuildPlugin_ValidatorFillingSelection: public ModelAPI_AttributeValidator
+{
+public:
+  //! Returns true if attribute is ok.
+  //! \param[in] theAttribute the checked attribute.
+  //! \param[in] theArguments arguments of the attribute.
+  //! \param[out] theError error message.
+   virtual bool isValid(const AttributePtr& theAttribute,
+                        const std::list<std::string>& theArguments,
+                        Events_InfoMessage& theError) const;
+};
+
 #endif