]> SALOME platform Git repositories - modules/shaper.git/blob - src/SketchPlugin/SketchPlugin_Validators.h
Salome HOME
Provide a different object validator with selected shape to check it
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_Validators.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:        SketchPlugin_Validators.h
4 // Created:     01 Aug 2014
5 // Author:      Vitaly SMETANNIKOV
6
7 #ifndef SketchPlugin_Validators_H
8 #define SketchPlugin_Validators_H
9
10 #include "SketchPlugin.h"
11 #include <ModelAPI_RefAttrValidator.h>
12
13 /**\class SketchPlugin_DistanceAttrValidator
14  * \ingroup Validators
15  * \brief Validator for the distance input.
16  *
17  * It just checks that distance is greater than zero.
18  */
19 class SketchPlugin_DistanceAttrValidator : public ModelAPI_RefAttrValidator
20 {
21  public:
22   //! returns true if attribute is valid
23   //! \param theAttribute the checked attribute
24   //! \param theArguments arguments of the attribute
25   virtual bool isValid(const AttributePtr& theAttribute, 
26                        const std::list<std::string>& theArguments) const;
27
28   //! Returns true if object is good for the feature attribute
29   virtual bool isValid(const FeaturePtr& theFeature, const std::list<std::string>& theArguments,
30                        const ObjectPtr& theObject, const GeomShapePtr& theShape) const;
31
32   //! Returns true if the attribute is good for the feature attribute
33   virtual bool isValid(const FeaturePtr& theFeature, const std::list<std::string>& theArguments,
34                        const AttributePtr& theAttribute) const;
35 };
36
37 /**\class SketchPlugin_DifferentObjectsValidator
38  * \ingroup Validators
39  *
40  * Check that there is no same object was already selected in the feature.
41  * For an example: to avoid perpendicularity on line and the same line.
42  */
43 // Use PartSet_DifferentObjectsValidator instead
44 //class SketchPlugin_DifferentObjectsValidator : public ModelAPI_RefAttrValidator
45 //{
46 // public:
47 //  //! returns true if attribute is valid
48 //  //! \param theAttribute the checked attribute
49 //  //! \param theArguments arguments of the attribute
50 //  virtual bool isValid(
51 //    const AttributePtr& theAttribute, const std::list<std::string>& theArguments) const;
52 //  //! Returns true if object is good for the feature attribute
53 //  virtual bool isValid(const FeaturePtr& theFeature, const std::list<std::string>& theArguments,
54 //                       const ObjectPtr& theObject) const;
55 //  //! Returns true if the attribute is good for the feature attribute
56 //  virtual bool isValid(const FeaturePtr& theFeature, const std::list<std::string>& theArguments,
57 //                       const AttributePtr& theAttribute) const;
58 //};
59
60 #endif