Salome HOME
Issue #608: Usage of OCCT in interface -- Remove OCCT from *Export interfaces --...
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_Extrusion.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        GeomAlgoAPI_Extrusion.h
4 // Created:     22 October 2014
5 // Author:      Sergey Zaritchny
6
7 #ifndef GeomAlgoAPI_Extrusion_H_
8 #define GeomAlgoAPI_Extrusion_H_
9
10 #include <GeomAlgoAPI.h>
11 #include <GeomAPI_Shape.h>
12 #include <GeomAPI_Dir.h>
13 #include <GeomAlgoAPI_MakeShape.h>
14 #include <GeomAPI_DataMapOfShapeShape.h>
15 #include <memory>
16
17 /**\class GeomAlgoAPI_Extrusion
18  * \ingroup DataAlgo
19  * \brief Allows to create the prism based on a given face and a direction
20  */
21
22 class GeomAlgoAPI_Extrusion : public GeomAPI_Interface
23 {
24  public:
25
26   /* \brief Creates extrusion for the given shape along the normal for this shape
27    * \param[in] theBasis face or wire to be extruded
28    * \param[in] theSize  the length of extrusion (if the value is less than 0, the extrusion in opposite normal)
29    * \return a solid or a face/shell which is obtained from specified one  
30    */
31   /// Constructor
32   GEOMALGOAPI_EXPORT GeomAlgoAPI_Extrusion (std::shared_ptr<GeomAPI_Shape> theBasis, double theSize);
33
34   /// Returns True if algorithm succeed
35   GEOMALGOAPI_EXPORT const bool isDone() const;
36
37   ///  Returns True if resulting shape is valid
38   GEOMALGOAPI_EXPORT const bool isValid() const;
39
40   /// Returns True if resulting shape has volume
41   GEOMALGOAPI_EXPORT const bool hasVolume() const;
42
43   /// Returns result of the Extrusion algorithm which may be a Solid or a Face
44   GEOMALGOAPI_EXPORT const std::shared_ptr<GeomAPI_Shape>& shape () const;
45
46   /// Returns the first shape 
47   GEOMALGOAPI_EXPORT const std::shared_ptr<GeomAPI_Shape>& firstShape();
48
49   /// returns last shape
50   GEOMALGOAPI_EXPORT const std::shared_ptr<GeomAPI_Shape>& lastShape(); 
51  
52   /// Returns map of sub-shapes of the result. To be used for History keeping
53   GEOMALGOAPI_EXPORT void  mapOfShapes (GeomAPI_DataMapOfShapeShape& theMap) const;
54
55   /// Return interface for for History processing
56   GEOMALGOAPI_EXPORT GeomAlgoAPI_MakeShape* makeShape () const;
57
58   /// Destructor
59   GEOMALGOAPI_EXPORT  ~GeomAlgoAPI_Extrusion();
60 private:
61   /// builds resulting shape
62   void build(const std::shared_ptr<GeomAPI_Shape>& theBasis);
63   /// fields
64   double mySize;
65   bool myDone;
66   std::shared_ptr<GeomAPI_Shape> myShape;
67   std::shared_ptr<GeomAPI_Shape> myFirst;
68   std::shared_ptr<GeomAPI_Shape> myLast;
69   GeomAPI_DataMapOfShapeShape myMap;
70   GeomAlgoAPI_MakeShape * myMkShape;
71 };
72
73 #endif