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