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] theFromDistance offset for "from" plane.
29 * \param[in] theToShape top bounding shape.
30 * \param[in] theToDistance offset for "to" plane.
32 GEOMALGOAPI_EXPORT GeomAlgoAPI_Prism(const std::shared_ptr<GeomAPI_Shape>& theBasis,
33 const std::shared_ptr<GeomAPI_Shape>& theFromShape,
34 double theFromDistance,
35 const std::shared_ptr<GeomAPI_Shape>& theToShape,
36 double theToDistance);
38 /// \return true if algorithm succeed.
39 GEOMALGOAPI_EXPORT bool isDone() const;
41 /// \return true if resulting shape is valid.
42 GEOMALGOAPI_EXPORT bool isValid() const;
44 /// \return true if resulting shape has volume.
45 GEOMALGOAPI_EXPORT bool hasVolume() const;
47 /// \return result of the Prism algorithm.
48 GEOMALGOAPI_EXPORT std::shared_ptr<GeomAPI_Shape> shape() const;
50 /// \returns the first shape.
51 GEOMALGOAPI_EXPORT std::shared_ptr<GeomAPI_Shape> firstShape() const;
53 /// \return the last shape.
54 GEOMALGOAPI_EXPORT std::shared_ptr<GeomAPI_Shape> lastShape() const;
56 /// \return map of sub-shapes of the result. To be used for History keeping.
57 GEOMALGOAPI_EXPORT std::shared_ptr<GeomAPI_DataMapOfShapeShape> mapOfShapes() const;
59 /// \return interface for History processing.
60 GEOMALGOAPI_EXPORT std::shared_ptr<GeomAlgoAPI_MakeShape> makeShape() const;
63 /// Builds resulting shape.
64 void build(const std::shared_ptr<GeomAPI_Shape>& theBasis,
65 const std::shared_ptr<GeomAPI_Shape>& theFromShape,
66 double theFromDistance,
67 const std::shared_ptr<GeomAPI_Shape>& theToShape,
68 double theToDistance);
73 std::shared_ptr<GeomAPI_Shape> myShape;
74 std::shared_ptr<GeomAPI_Shape> myFirst;
75 std::shared_ptr<GeomAPI_Shape> myLast;
76 std::shared_ptr<GeomAPI_DataMapOfShapeShape> myMap;
77 std::shared_ptr<GeomAlgoAPI_MakeShape> myMkShape;