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 <GeomAlgoAPI_MakeShape.h>
12 #include <GeomAPI_DataMapOfShapeShape.h>
14 /**\class GeomAlgoAPI_Extrusion
16 * \brief Allows to create the prism based on a given face and a direction
19 class GeomAlgoAPI_Extrusion : public GeomAPI_Interface
23 /* \brief Creates extrusion for the given shape along the normal for this shape
24 * \param[in] theBasis face or wire to be extruded
25 * \param[in] theSize the length of extrusion (if the value is less than 0, the extrusion in opposite normal)
26 * \return a solid or a face/shell which is obtained from specified one
29 GEOMALGOAPI_EXPORT GeomAlgoAPI_Extrusion (std::shared_ptr<GeomAPI_Shape> theBasis, double theSize);
31 /// Returns True if algorithm succeed
32 GEOMALGOAPI_EXPORT const bool isDone() const;
34 /// Returns True if resulting shape is valid
35 GEOMALGOAPI_EXPORT const bool isValid() const;
37 /// Returns True if resulting shape has volume
38 GEOMALGOAPI_EXPORT const bool hasVolume() const;
40 /// Returns result of the Extrusion algorithm which may be a Solid or a Face
41 GEOMALGOAPI_EXPORT const std::shared_ptr<GeomAPI_Shape>& shape () const;
43 /// Returns the first shape
44 GEOMALGOAPI_EXPORT const std::shared_ptr<GeomAPI_Shape>& firstShape();
46 /// returns last shape
47 GEOMALGOAPI_EXPORT const std::shared_ptr<GeomAPI_Shape>& lastShape();
49 /// Returns map of sub-shapes of the result. To be used for History keeping
50 GEOMALGOAPI_EXPORT void mapOfShapes (GeomAPI_DataMapOfShapeShape& theMap) const;
52 /// Return interface for for History processing
53 GEOMALGOAPI_EXPORT GeomAlgoAPI_MakeShape* makeShape () const;
56 GEOMALGOAPI_EXPORT ~GeomAlgoAPI_Extrusion();
58 /// builds resulting shape
59 void build(const std::shared_ptr<GeomAPI_Shape>& theBasis);
63 std::shared_ptr<GeomAPI_Shape> myShape;
64 std::shared_ptr<GeomAPI_Shape> myFirst;
65 std::shared_ptr<GeomAPI_Shape> myLast;
66 GeomAPI_DataMapOfShapeShape myMap;
67 GeomAlgoAPI_MakeShape * myMkShape;