]> SALOME platform Git repositories - modules/shaper.git/blob - src/GeomAlgoAPI/GeomAlgoAPI_Extrusion.h
Salome HOME
Merge branch 'master' of newgeom:newgeom.git
[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 <boost/shared_ptr.hpp>
13 /**\class GeomAlgoAPI_Extrusion
14  * \ingroup DataAlgo
15  * \brief Allows to create the prism based on a given face and a direction
16  */
17
18 class GeomAlgoAPI_Extrusion : public GeomAPI_Interface
19 {
20  public:
21
22   /* \brief Creates extrusion for the given shape along the normal for this shape
23    * \param[in] theShape face or wire to be extruded
24    * \param[in] theSize  the length of extrusion (if the value is less than 0, the extrusion in opposite normal)
25    * \return a solid or a face which is obtained from specified one
26   
27   static boost::shared_ptr<GeomAPI_Shape> makeExtrusion(boost::shared_ptr<ModelAPI_ResultBody> theResult,
28                                                                                                                 boost::shared_ptr<GeomAPI_Shape> theBasis,
29                                                                                                                 boost::shared_ptr<GeomAPI_Shape> theContext,
30                                                         double theSize); */
31   /// Constructor
32   GEOMALGOAPI_EXPORT GeomAlgoAPI_Extrusion (boost::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 boost::shared_ptr<GeomAPI_Shape>& shape () const;
45
46   /// Returns list of shapes generated from theShape
47   GEOMALGOAPI_EXPORT void generated(const boost::shared_ptr<GeomAPI_Shape> theShape,
48                                     ListOfShape& theHistory);
49
50   /// Returns the first shape 
51   GEOMALGOAPI_EXPORT const boost::shared_ptr<GeomAPI_Shape>& firstShape();
52
53   /// returns last shape
54   GEOMALGOAPI_EXPORT const boost::shared_ptr<GeomAPI_Shape>& lastShape();        
55
56 private:
57   /// builds resulting shape
58   void build(const boost::shared_ptr<GeomAPI_Shape>& theBasis);
59
60   double mySize;
61   bool myDone;
62   boost::shared_ptr<GeomAPI_Shape> myShape;
63   boost::shared_ptr<GeomAPI_Shape> myFirst;
64   boost::shared_ptr<GeomAPI_Shape> myLast;
65 };
66
67 #endif