1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: GeomAlgoAPI_Prism.h
5 // Author: Dmitry Bobylev
7 #ifndef GeomAlgoAPI_Prism_H_
8 #define GeomAlgoAPI_Prism_H_
10 #include <GeomAlgoAPI.h>
11 #include <GeomAPI_Shape.h>
12 #include <GeomAlgoAPI_MakeShape.h>
13 #include <GeomAPI_DataMapOfShapeShape.h>
16 /** \class GeomAlgoAPI_Prism
18 * \brief Allows to create the prism based on a given face and bounding planes.
19 * \n Note that only planar faces are allowed as bounding faces and resulting
20 * extrusion will be bounded by the infinite planes taken from the faces.
22 class GeomAlgoAPI_Prism : 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] theFromShape bottom bounding shape;
28 * \param[in] theToShape top bounding shape;
30 GEOMALGOAPI_EXPORT GeomAlgoAPI_Prism(std::shared_ptr<GeomAPI_Shape> theBasis,
31 std::shared_ptr<GeomAPI_Shape> theFromShape,
32 std::shared_ptr<GeomAPI_Shape> theToShape);
34 /// \return true if algorithm succeed.
35 GEOMALGOAPI_EXPORT const bool isDone() const;
37 /// \return true if resulting shape is valid.
38 GEOMALGOAPI_EXPORT const bool isValid() const;
40 /// \return true if resulting shape has volume.
41 GEOMALGOAPI_EXPORT const bool hasVolume() const;
43 /// \return result of the Prism algorithm.
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 /// \return the last shape.
50 GEOMALGOAPI_EXPORT const std::shared_ptr<GeomAPI_Shape>& lastShape();
52 /// \return 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 History processing.
56 GEOMALGOAPI_EXPORT GeomAlgoAPI_MakeShape* makeShape() const;
59 GEOMALGOAPI_EXPORT ~GeomAlgoAPI_Prism();
62 /// Builds resulting shape.
63 void build(const std::shared_ptr<GeomAPI_Shape>& theBasis);
67 std::shared_ptr<GeomAPI_Shape> myFromShape;
68 std::shared_ptr<GeomAPI_Shape> myToShape;
70 std::shared_ptr<GeomAPI_Shape> myShape;
71 std::shared_ptr<GeomAPI_Shape> myFirst;
72 std::shared_ptr<GeomAPI_Shape> myLast;
73 GeomAPI_DataMapOfShapeShape myMap;
74 GeomAlgoAPI_MakeShape* myMkShape;