Salome HOME
A fix for the next case:
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_Prism.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        GeomAlgoAPI_Prism.h
4 // Created:     5 May 2015
5 // Author:      Dmitry Bobylev
6
7 #ifndef GeomAlgoAPI_Prism_H_
8 #define GeomAlgoAPI_Prism_H_
9
10 #include <GeomAlgoAPI.h>
11 #include <GeomAPI_Shape.h>
12 #include <GeomAlgoAPI_MakeShape.h>
13 #include <GeomAPI_DataMapOfShapeShape.h>
14 #include <memory>
15
16 /**\class GeomAlgoAPI_Prism
17  * \ingroup DataAlgo
18  * \brief Allows to create the prism based on a given face and bounding planes
19  */
20
21 class GeomAlgoAPI_Prism : public GeomAPI_Interface
22 {
23 public:
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
29    */
30   /// Constructor
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);
34
35   /// Returns True if algorithm succeed
36   GEOMALGOAPI_EXPORT const bool isDone() const;
37
38   ///  Returns True if resulting shape is valid
39   GEOMALGOAPI_EXPORT const bool isValid() const;
40
41   /// Returns True if resulting shape has volume
42   GEOMALGOAPI_EXPORT const bool hasVolume() const;
43
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;
46
47   /// Returns the first shape 
48   GEOMALGOAPI_EXPORT const std::shared_ptr<GeomAPI_Shape>& firstShape();
49
50   /// returns last shape
51   GEOMALGOAPI_EXPORT const std::shared_ptr<GeomAPI_Shape>& lastShape();
52  
53   /// Returns map of sub-shapes of the result. To be used for History keeping
54   GEOMALGOAPI_EXPORT void  mapOfShapes(GeomAPI_DataMapOfShapeShape& theMap) const;
55
56   /// Return interface for for History processing
57   GEOMALGOAPI_EXPORT GeomAlgoAPI_MakeShape* makeShape() const;
58
59   /// Destructor
60   GEOMALGOAPI_EXPORT  ~GeomAlgoAPI_Prism();
61 private:
62   /// builds resulting shape
63   void build(const std::shared_ptr<GeomAPI_Shape>& theBasis);
64   /// fields
65   std::shared_ptr<GeomAPI_Shape> myFromShape;
66   std::shared_ptr<GeomAPI_Shape> myToShape;
67   bool myDone;
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;
73 };
74
75 #endif