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] theBaseShape face or wire to be extruded.
27 * \param[in] theToSize offset for "to" plane.
28 * \param[in] theFromSize offset for "from" plane.
30 GEOMALGOAPI_EXPORT GeomAlgoAPI_Prism(std::shared_ptr<GeomAPI_Shape> theBaseShape,
34 /** \brief Creates extrusion for the given shape along the normal for this shape.
35 * \param[in] theBaseShape face or wire to be extruded.
36 * \param[in] theToShape top bounding shape. Can be empty. In this case offset will be applied to the basis.
37 * \param[in] theToSize offset for "to" plane.
38 * \param[in] theFromShape bottom bounding shape. Can be empty. In this case offset will be applied to the basis.
39 * \param[in] theFromSize offset for "from" plane.
41 GEOMALGOAPI_EXPORT GeomAlgoAPI_Prism(std::shared_ptr<GeomAPI_Shape> theBaseShape,
42 std::shared_ptr<GeomAPI_Shape> theToShape,
44 std::shared_ptr<GeomAPI_Shape> theFromShape,
47 /// \return true if algorithm succeed.
48 GEOMALGOAPI_EXPORT bool isDone() const;
50 /// \return true if resulting shape is valid.
51 GEOMALGOAPI_EXPORT bool isValid() const;
53 /// \return true if resulting shape has volume.
54 GEOMALGOAPI_EXPORT bool hasVolume() const;
56 /// \return result of the Prism algorithm.
57 GEOMALGOAPI_EXPORT std::shared_ptr<GeomAPI_Shape> shape() const;
59 /// \returns the list of from faces.
60 GEOMALGOAPI_EXPORT const ListOfShape& fromFaces() const;
62 /// \return the list of to faces.
63 GEOMALGOAPI_EXPORT const ListOfShape& toFaces() const;
65 /// \return map of sub-shapes of the result. To be used for History keeping.
66 GEOMALGOAPI_EXPORT std::shared_ptr<GeomAPI_DataMapOfShapeShape> mapOfShapes() const;
68 /// \return interface for History processing.
69 GEOMALGOAPI_EXPORT std::shared_ptr<GeomAlgoAPI_MakeShape> makeShape() const;
72 /// Builds resulting shape.
73 void build(const std::shared_ptr<GeomAPI_Shape>& theBaseShape,
74 const std::shared_ptr<GeomAPI_Shape>& theToShape,
76 const std::shared_ptr<GeomAPI_Shape>& theFromShape,
82 std::shared_ptr<GeomAPI_Shape> myShape;
83 ListOfShape myFromFaces;
84 ListOfShape myToFaces;
85 std::shared_ptr<GeomAPI_DataMapOfShapeShape> myMap;
86 std::shared_ptr<GeomAlgoAPI_MakeShape> myMkShape;