Salome HOME
Multiple selection in placement
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_Transform.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        GeomAlgoAPI_Transform.h
4 // Created:     29 July 2015
5 // Author:      Dmitry Bobylev
6
7 #ifndef GeomAlgoAPI_Transform_H_
8 #define GeomAlgoAPI_Transform_H_
9
10 #include <GeomAlgoAPI.h>
11 #include <GeomAlgoAPI_MakeShape.h>
12 #include <GeomAPI_DataMapOfShapeShape.h>
13 #include <GeomAPI_Shape.h>
14 #include <GeomAPI_Trsf.h>
15
16 /** \class GeomAlgoAPI_Transform
17  *  \ingroup DataAlgo
18  *  \brief Creates a copy of the object by transformating it.
19  */
20 class GeomAlgoAPI_Transform : public GeomAPI_Interface
21 {
22 public:
23   /** \brief Creates an object which is obtained from current object by transformating it.
24    *  \param[in] theSourceShape  a shape to be transformed.
25    *  \param[in] theTrsf         transformation.
26    */
27   GEOMALGOAPI_EXPORT GeomAlgoAPI_Transform(std::shared_ptr<GeomAPI_Shape> theSourceShape,
28                                            std::shared_ptr<GeomAPI_Trsf>  theTrsf);
29
30   /// \return true if algorithm succeed.
31   GEOMALGOAPI_EXPORT const bool isDone() const
32   { return myDone; }
33
34   /// \return true if resulting shape is valid.
35   GEOMALGOAPI_EXPORT const bool isValid() const;
36
37   /// \return true if resulting shape has volume.
38   GEOMALGOAPI_EXPORT const bool hasVolume() const;
39
40   /// \return result of the transformation algorithm.
41   GEOMALGOAPI_EXPORT const std::shared_ptr<GeomAPI_Shape>& shape() const;
42
43   /// \return map of sub-shapes of the result. To be used for History keeping.
44   GEOMALGOAPI_EXPORT std::shared_ptr<GeomAPI_DataMapOfShapeShape> mapOfShapes() const;
45
46   /// \return interface for for History processing.
47   GEOMALGOAPI_EXPORT std::shared_ptr<GeomAlgoAPI_MakeShape> makeShape() const;
48
49   /// \return the transformation.
50   GEOMALGOAPI_EXPORT std::shared_ptr<GeomAPI_Trsf> transformation() const;
51
52 private:
53   /// Builds resulting shape.
54   void build(std::shared_ptr<GeomAPI_Shape> theSourceShape,
55              std::shared_ptr<GeomAPI_Trsf>  theTrsf);
56
57 private:
58   /// Fields.
59   bool myDone;
60   std::shared_ptr<GeomAPI_Trsf> myTrsf;
61   std::shared_ptr<GeomAPI_Shape> myShape;
62   std::shared_ptr<GeomAPI_DataMapOfShapeShape> myMap;
63   std::shared_ptr<GeomAlgoAPI_MakeShape> myMkShape;
64 };
65
66 #endif