1 // File: GeomAlgoAPI_Extrusion.h
2 // Created: 22 October 2014
3 // Author: Sergey Zaritchny
5 #ifndef GeomAlgoAPI_Extrusion_H_
6 #define GeomAlgoAPI_Extrusion_H_
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 #include <BRepPrimAPI_MakePrism.hxx>
14 #include <TopoDS_Shape.hxx>
15 /**\class GeomAlgoAPI_Extrusion
17 * \brief Allows to create the prism based on a given face and a direction
20 class GEOMALGOAPI_EXPORT GeomAlgoAPI_Extrusion
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
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,
34 GeomAlgoAPI_Extrusion (boost::shared_ptr<GeomAPI_Shape> theBasis, double theSize);
36 /// Returns True if algorithm succeed
37 const bool isDone() const;
39 /// Returns True if resulting shape is valid
40 const bool isValid() const;
42 /// Returns True if resulting shape has volume
43 const bool hasVolume() const;
45 /// Returns result of the Extrusion algorithm which may be a Solid or a Face
46 const boost::shared_ptr<GeomAPI_Shape>& shape () const;
48 /// Returns list of shapes generated from theShape
49 const ListOfShape& generated(const boost::shared_ptr<GeomAPI_Shape> theShape);
51 /// Returns the first shape
52 const boost::shared_ptr<GeomAPI_Shape>& firstShape();
54 /// returns last shape
55 const boost::shared_ptr<GeomAPI_Shape>& lastShape();
58 /// builds resulting shape
61 BRepPrimAPI_MakePrism * myBuilder;
65 TopoDS_Shape myResult;
66 ListOfShape myHistory;
67 boost::shared_ptr<GeomAPI_Shape> myShape;
68 boost::shared_ptr<GeomAPI_Shape> myFirst;
69 boost::shared_ptr<GeomAPI_Shape> myLast;