1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: GeomAlgoAPI_Extrusion.h
4 // Created: 22 October 2014
5 // Author: Sergey Zaritchny
7 #ifndef GeomAlgoAPI_Extrusion_H_
8 #define GeomAlgoAPI_Extrusion_H_
10 #include <GeomAlgoAPI.h>
11 #include <GeomAPI_Shape.h>
12 #include <GeomAPI_Dir.h>
13 #include <GeomAlgoAPI_MakeShape.h>
14 #include <GeomAPI_DataMapOfShapeShape.h>
16 /**\class GeomAlgoAPI_Extrusion
18 * \brief Allows to create the prism based on a given face and a direction
21 class GeomAlgoAPI_Extrusion : public GeomAPI_Interface
25 /* \brief Creates extrusion for the given shape along the normal for this shape
26 * \param[in] theBasis face or wire to be extruded
27 * \param[in] theSize the length of extrusion (if the value is less than 0, the extrusion in opposite normal)
28 * \return a solid or a face/shell which is obtained from specified one
31 GEOMALGOAPI_EXPORT GeomAlgoAPI_Extrusion (std::shared_ptr<GeomAPI_Shape> theBasis, double theSize);
33 /// Returns True if algorithm succeed
34 GEOMALGOAPI_EXPORT const bool isDone() const;
36 /// Returns True if resulting shape is valid
37 GEOMALGOAPI_EXPORT const bool isValid() const;
39 /// Returns True if resulting shape has volume
40 GEOMALGOAPI_EXPORT const bool hasVolume() const;
42 /// Returns result of the Extrusion algorithm which may be a Solid or a Face
43 GEOMALGOAPI_EXPORT const std::shared_ptr<GeomAPI_Shape>& shape () const;
45 /// Returns the first shape
46 GEOMALGOAPI_EXPORT const std::shared_ptr<GeomAPI_Shape>& firstShape();
48 /// returns last shape
49 GEOMALGOAPI_EXPORT const std::shared_ptr<GeomAPI_Shape>& lastShape();
51 /// Returns map of sub-shapes of the result. To be used for History keeping
52 GEOMALGOAPI_EXPORT void mapOfShapes (GeomAPI_DataMapOfShapeShape& theMap) const;
54 /// Return interface for for History processing
55 GEOMALGOAPI_EXPORT GeomAlgoAPI_MakeShape* makeShape () const;
58 GEOMALGOAPI_EXPORT ~GeomAlgoAPI_Extrusion();
60 /// builds resulting shape
61 void build(const std::shared_ptr<GeomAPI_Shape>& theBasis);
65 std::shared_ptr<GeomAPI_Shape> myShape;
66 std::shared_ptr<GeomAPI_Shape> myFirst;
67 std::shared_ptr<GeomAPI_Shape> myLast;
68 GeomAPI_DataMapOfShapeShape myMap;
69 GeomAlgoAPI_MakeShape * myMkShape;