Salome HOME
Adjust test cases according to updated Arc behavior
[modules/shaper.git] / src / BuildPlugin / BuildPlugin_Validators.h
index eb698b21ad9e50b8fcfed386c7387ea260426c67..347ef5f22f4db23d368ae2fa3fca5ef1fa028ced 100644 (file)
 #include <ModelAPI_AttributeValidator.h>
 #include <ModelAPI_FeatureValidator.h>
 
-/// \class BuildPlugin_ValidatorBaseForVertex
+/// \class BuildPlugin_ValidatorBaseForBuild
 /// \ingroup Validators
-/// \brief A validator for selection base shapes for vertex. Allows to select vertices on sketch and
-/// vertex objects.
-class BuildPlugin_ValidatorBaseForVertex: public ModelAPI_AttributeValidator
+/// \brief A validator for selection base shapes for build features.
+/// Allows to select shapes on sketch and
+/// whole objects with allowed type.
+class BuildPlugin_ValidatorBaseForBuild: public ModelAPI_AttributeValidator
 {
 public:
   //! Returns true if attribute is ok.
@@ -23,14 +24,51 @@ public:
   //! \param[out] theError error message.
    virtual bool isValid(const AttributePtr& theAttribute,
                         const std::list<std::string>& theArguments,
-                        std::string& theError) const;
+                        Events_InfoMessage& theError) const;
 };
 
 /// \class BuildPlugin_ValidatorBaseForWire
 /// \ingroup Validators
 /// \brief A validator for selection base shapes for wire. Allows to select edges on sketch and
 /// wires objects that are connected to already selected shapes.
-class BuildPlugin_ValidatorBaseForWire: public ModelAPI_AttributeValidator
+class BuildPlugin_ValidatorBaseForWire: 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;
+
+  /// \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
+/// \ingroup Validators
+/// \brief A validator for selection base shapes for face. Allows to select sketch edges, edges and
+/// wires objects that lie in the same plane and don't have intersections.
+class BuildPlugin_ValidatorBaseForFace: 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;
+
+  /// \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_ValidatorSubShapesSelection
+/// \ingroup Validators
+/// \brief A validator for selection sub-shapes for SubShape feature.
+class BuildPlugin_ValidatorSubShapesSelection: public ModelAPI_AttributeValidator
 {
 public:
   //! Returns true if attribute is ok.
@@ -39,7 +77,7 @@ public:
   //! \param[out] theError error message.
    virtual bool isValid(const AttributePtr& theAttribute,
                         const std::list<std::string>& theArguments,
-                        std::string& theError) const;
+                        Events_InfoMessage& theError) const;
 };
 
 #endif