Salome HOME
Fix regression in unit tests
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_Extrusion.h
index f3e7880491ec8c0a8b7d25d1c10d205b4913cc65..98c9af7c9ddf90f655fba32f66b2e9b8daf61df1 100644 (file)
@@ -7,19 +7,21 @@
 #ifndef FeaturesPlugin_Extrusion_H_
 #define FeaturesPlugin_Extrusion_H_
 
-#include "FeaturesPlugin.h"
+#include <FeaturesPlugin.h>
 #include <ModelAPI_Feature.h>
-#include <ModelAPI_ResultBody.h>
-#include <GeomAlgoAPI_Extrusion.h>
-#include <GeomAPI_Shape.h>
+#include <GeomAlgoAPI_Prism.h>
+
+class GeomAPI_Shape;
+class ModelAPI_ResultBody;
 
 /**\class FeaturesPlugin_Extrusion
  * \ingroup Plugins
  * \brief Feature for creation of extrusion from the planar face.
  *
  * Extrusion creates the lateral faces based on edges of the base face and
- * the top face equal to the base face. Direction of extrusion is taken from the face
- * plane, but can be corrected by the "reverse" flag.
+ * the top and bottom faces equal to the base face or this faces can be projection on the
+ * bounding planes if they were set. Direction of extrusion is taken from the face
+ * plane or if the bounding faces were set then it will be from the bottom to the top plane.
  */
 class FeaturesPlugin_Extrusion : public ModelAPI_Feature
 {
@@ -45,6 +47,13 @@ class FeaturesPlugin_Extrusion : public ModelAPI_Feature
     return MY_TO_OBJECT_ID;
   }
 
+  /// attribute name for creation method
+  inline static const std::string& CREATION_METHOD()
+  {
+    static const std::string METHOD_ATTR("CreationMethod");
+    return METHOD_ATTR;
+  }
+
   /// attribute name of extrusion size
   inline static const std::string& TO_SIZE_ID()
   {
@@ -66,18 +75,26 @@ class FeaturesPlugin_Extrusion : public ModelAPI_Feature
     return MY_TO_OBJECT_ID;
   }
 
+  /// attribute name of extrusion offset
+  inline static const std::string& TO_OFFSET_ID()
+  {
+    static const std::string MY_TO_OFFSET_ID("to_offset");
+    return MY_TO_OFFSET_ID;
+  }
+
   /// attribute name of tool object
   inline static const std::string& FROM_OBJECT_ID()
   {
     static const std::string MY_FROM_OBJECT_ID("from_object");
     return MY_FROM_OBJECT_ID;
   }
-  /// attribute name of reverse direction
- inline static const std::string& REVERSE_ID()
- {
-   static const std::string MY_REVERSE_ID("reverse");
-   return MY_REVERSE_ID;
- }
+
+  /// attribute name of extrusion offset
+  inline static const std::string& FROM_OFFSET_ID()
+  {
+    static const std::string MY_FROM_OFFSET_ID("from_offset");
+    return MY_FROM_OFFSET_ID;
+  }
 
   /// Returns the kind of a feature
   FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
@@ -96,12 +113,9 @@ class FeaturesPlugin_Extrusion : public ModelAPI_Feature
   FeaturesPlugin_Extrusion();
 private:
   /// Load Naming data structure of the feature to the document
-  void LoadNamingDS(GeomAlgoAPI_Extrusion& theFeature, std::shared_ptr<ModelAPI_ResultBody> theResultBody,
-                       std::shared_ptr<GeomAPI_Shape> theBasis,
-                       std::shared_ptr<GeomAPI_Shape> theContext);
-
-  /// Set an empty shape to the result of extrusion
-  void clearResult();
+  void loadNamingDS(GeomAlgoAPI_Prism& thePrismAlgo,
+                    std::shared_ptr<ModelAPI_ResultBody> theResultBody,
+                    std::shared_ptr<GeomAPI_Shape> theBasis);
 };
 
 #endif