-// 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 FeaturesPlugin_Validators_H_
/// \class FeaturesPlugin_ValidatorPipeLocations
/// \ingroup Validators
+/// \brief A validator for selection pipe locations.
+class FeaturesPlugin_ValidatorPipeLocations: public ModelAPI_AttributeValidator
+{
+public:
+ //! \return True if the attribute is valid.
+ //! \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;
+};
+
+/// \class FeaturesPlugin_ValidatorPipeLocationsNumber
+/// \ingroup Validators
/// \brief Validator for the pipe locations.
-class FeaturesPlugin_ValidatorPipeLocations: public ModelAPI_FeatureValidator
+class FeaturesPlugin_ValidatorPipeLocationsNumber: public ModelAPI_FeatureValidator
{
public:
//! \return true if number of selected locations the same as number of selected bases, or empty.
virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<std::string>& theArguments,
Events_InfoMessage& theError) const;
-
- /// Returns true if the attribute in feature is not obligatory for the feature execution
- virtual bool isNotObligatory(std::string theFeature, std::string theAttribute);
};
/// \class FeaturesPlugin_ValidatorBaseForGeneration
virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<std::string>& theArguments,
Events_InfoMessage& theError) const;
-
- /// Returns true if the attribute in feature is not obligatory for the feature execution
- virtual bool isNotObligatory(std::string theFeature, std::string theAttribute);
};
/// \class FeaturesPlugin_ValidatorCompositeLauncher
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);
-
private:
bool isShapesCanBeEmpty(const AttributePtr& theAttribute,
Events_InfoMessage& theError) const;
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 FeaturesPlugin_ValidatorUnionSelection
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 FeaturesPlugin_ValidatorConcealedResult
Events_InfoMessage& theError) const;
};
+/// \class FeaturesPlugin_ValidatorCircular
+/// \ingroup Validators
+/// \brief Verifies the selected object is circular edge or cylindrical face
+class FeaturesPlugin_ValidatorCircular : public ModelAPI_AttributeValidator
+{
+public:
+ //! \return True if the attribute is valid.
+ //! \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;
+};
+
+/** \class FeaturesPlugin_ValidatorBooleanArguments
+* \ingroup Validators
+* \brief Validates that boolean operation have enough arguments.
+*/
+class FeaturesPlugin_ValidatorBooleanArguments: public ModelAPI_FeatureValidator
+{
+public:
+ /** \brief Returns true if feature and/or attributes are valid.
+ * \param[in] theFeature the validated feature.
+ * \param[in] theArguments the arguments in the configuration file for this validator.
+ * \param[out] theError error message.
+ * \returns true if feature is valid.
+ */
+ 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 FeaturesPlugin_ValidatorBooleanSmashSelection
+/// \ingroup Validators
+/// \brief Verifies the selected object for boolean smash feature
+class FeaturesPlugin_ValidatorBooleanSmashSelection: public ModelAPI_AttributeValidator
+{
+public:
+ //! \return True if the attribute is valid.
+ //! \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;
+};
+
+/// \class FeaturesPlugin_IntersectionSelection
+/// \ingroup Validators
+/// \brief Verifies the selected object for intersection feature
+class FeaturesPlugin_IntersectionSelection: public ModelAPI_AttributeValidator
+{
+public:
+ //! \return True if the attribute is valid.
+ //! \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;
+};
+
+/// \class FeaturesPlugin_ValidatorBooleanFuseSelection
+/// \ingroup Validators
+/// \brief Verifies the selected object for boolean fuse feature
+class FeaturesPlugin_ValidatorBooleanFuseSelection: public ModelAPI_AttributeValidator
+{
+public:
+ //! \return True if the attribute is valid.
+ //! \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;
+};
+
+/** \class FeaturesPlugin_ValidatorBooleanFuseArguments
+* \ingroup Validators
+* \brief Validates that boolean operation have enough arguments.
+*/
+class FeaturesPlugin_ValidatorBooleanFuseArguments: public ModelAPI_FeatureValidator
+{
+public:
+ /** \brief Returns true if feature and/or attributes are valid.
+ * \param[in] theFeature the validated feature.
+ * \param[in] theArguments the arguments in the configuration file for this validator.
+ * \param[out] theError error message.
+ * \returns true if feature is valid.
+ */
+ 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 FeaturesPlugin_ValidatorBooleanCommonSelection
+/// \ingroup Validators
+/// \brief Verifies the selected object for boolean common feature
+class FeaturesPlugin_ValidatorBooleanCommonSelection: public ModelAPI_AttributeValidator
+{
+public:
+ //! \return True if the attribute is valid.
+ //! \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;
+};
+
+/** \class FeaturesPlugin_ValidatorBooleanCommonArguments
+* \ingroup Validators
+* \brief Validates that boolean operation have enough arguments.
+*/
+class FeaturesPlugin_ValidatorBooleanCommonArguments: public ModelAPI_FeatureValidator
+{
+public:
+ /** \brief Returns true if feature and/or attributes are valid.
+ * \param[in] theFeature the validated feature.
+ * \param[in] theArguments the arguments in the configuration file for this validator.
+ * \param[out] theError error message.
+ * \returns true if feature is valid.
+ */
+ 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);
+};
+
#endif