Salome HOME
Tooltips update for extrusion and revolution
[modules/shaper.git] / src / GeomValidators / GeomValidators_ShapeType.h
index ce3232d61b5074674f621dbff70dcc28a26d23b1..5d30779b107c5c88a3906bb53683fcc5e380ee82 100644 (file)
@@ -10,6 +10,8 @@
 #include "GeomValidators.h"
 #include "ModelAPI_AttributeValidator.h"
 
+#include <GeomAPI_Shape.h>
+
 #include <string>
 
 /**
@@ -24,10 +26,16 @@ class GeomValidators_ShapeType : public ModelAPI_AttributeValidator
   //  the edge type
   enum TypeOfShape
   {
-    AnyShape,
+    Empty,
     Vertex,
+    Edge,
     Line,
-    Circle
+    Circle,
+    Face,
+    Solid,
+    Compound,
+    Plane,
+    AnyShape
   };
 
  public:
@@ -36,7 +44,8 @@ class GeomValidators_ShapeType : public ModelAPI_AttributeValidator
   //! \param theAttribute the checked attribute
   //! \param theArguments arguments of the attribute
   GEOMVALIDATORS_EXPORT virtual bool isValid(const AttributePtr& theAttribute,
-                                             const std::list<std::string>& theArguments) const;
+                                             const std::list<std::string>& theArguments,
+                                             std::string& theError) const;
 protected:
   /// Convert string to TypeOfShape value
   /// \param theType a string value
@@ -45,6 +54,24 @@ protected:
   bool isValidArgument(const AttributePtr& theAttribute,
                        const std::string& theArgument) const;
 
+  /// Returns true if the attibute's object type satisfies the argument value
+  /// \param theAttribute a checked attribute
+  /// \param theArgument a parameter
+  bool isValidAttribute(const AttributePtr& theAttribute,
+                        const TypeOfShape theShapeType) const;
+
+  /// Returns true if the attibute's object type satisfies the argument value
+  /// \param theAttribute a checked object
+  /// \param theShapeType a shape type
+  bool isValidObject(const ObjectPtr& theObject,
+                     const TypeOfShape theShapeType) const;
+
+  /// Returns true if the attibute's object type satisfies the argument value
+  /// \param theShape a checked shape
+  /// \param theShapeType a shape type
+  bool isValidShape(const GeomShapePtr theShape,
+                    const TypeOfShape theShapeType) const;
+
 };
 
 #endif