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