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
21 class GeomAlgoAPI_Prism : public GeomAPI_Interface
24 /* \brief Creates extrusion for the given shape along the normal for this shape
25 * \param[in] theBasis face or wire to be extruded
26 * \param[in] theFromShape bottom bounding shape
27 * \param[in] theToShape top bounding shape
28 * \return a solid or a face/shell which is obtained from specified one
31 GEOMALGOAPI_EXPORT GeomAlgoAPI_Prism(std::shared_ptr<GeomAPI_Shape> theBasis,
32 std::shared_ptr<GeomAPI_Shape> theFromShape,
33 std::shared_ptr<GeomAPI_Shape> theToShape);
35 /// Returns True if algorithm succeed
36 GEOMALGOAPI_EXPORT const bool isDone() const;
38 /// Returns True if resulting shape is valid
39 GEOMALGOAPI_EXPORT const bool isValid() const;
41 /// Returns True if resulting shape has volume
42 GEOMALGOAPI_EXPORT const bool hasVolume() const;
44 /// Returns result of the Prism algorithm which may be a Solid or a Face
45 GEOMALGOAPI_EXPORT const std::shared_ptr<GeomAPI_Shape>& shape() const;
47 /// Returns the first shape
48 GEOMALGOAPI_EXPORT const std::shared_ptr<GeomAPI_Shape>& firstShape();
50 /// returns last shape
51 GEOMALGOAPI_EXPORT const std::shared_ptr<GeomAPI_Shape>& lastShape();
53 /// Returns map of sub-shapes of the result. To be used for History keeping
54 GEOMALGOAPI_EXPORT void mapOfShapes(GeomAPI_DataMapOfShapeShape& theMap) const;
56 /// Return interface for for History processing
57 GEOMALGOAPI_EXPORT GeomAlgoAPI_MakeShape* makeShape() const;
60 GEOMALGOAPI_EXPORT ~GeomAlgoAPI_Prism();
62 /// builds resulting shape
63 void build(const std::shared_ptr<GeomAPI_Shape>& theBasis);
65 std::shared_ptr<GeomAPI_Shape> myFromShape;
66 std::shared_ptr<GeomAPI_Shape> myToShape;
68 std::shared_ptr<GeomAPI_Shape> myShape;
69 std::shared_ptr<GeomAPI_Shape> myFirst;
70 std::shared_ptr<GeomAPI_Shape> myLast;
71 GeomAPI_DataMapOfShapeShape myMap;
72 GeomAlgoAPI_MakeShape* myMkShape;