Salome HOME
Validators return InfoMessage instead of string as an error
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_ExternalValidator.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:        Model_ResultValidators.h
4 // Created:     27 Feb 2015
5 // Author:      Natalia ERMOLAEVA
6
7 #ifndef SketchPlugin_ExternalValidator_H
8 #define SketchPlugin_ExternalValidator_H
9
10 #include <SketchPlugin.h>
11 #include <ModelAPI_AttributeValidator.h>
12
13 /**\class SketchPlugin_ExternalValidator
14  * \ingroup Validators
15  * \brief Validator for the points selection
16  *
17  * Allows to select points only.
18  */
19 class SketchPlugin_ExternalValidator : public ModelAPI_AttributeValidator
20 {
21 public:
22   /// returns true if the feature of attribute do not contain external features in the given attribute and
23   /// among attributes listed in the arguments
24   /// \param theAttribute an attribute to check
25   /// \param theArguments a filter parameters
26   /// \param theError error message
27   SKETCHPLUGIN_EXPORT virtual bool isValid(const AttributePtr& theAttribute,
28                                            const std::list<std::string>& theArguments,
29                                            Events_InfoMessage& theError) const;
30
31 protected:
32   /// returns true if the feature of the attribute is external
33   /// \param theAttribute an attribute to check
34   bool isExternalAttribute(const AttributePtr& theAttribute) const;
35 };
36
37 #endif