]> SALOME platform Git repositories - modules/shaper.git/blob - src/GeomAlgoAPI/GeomAlgoAPI_Placement.h
Salome HOME
Make the movement, placement and rotation 3D features may be applied to the Part...
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_Placement.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        GeomAlgoAPI_Placement.h
4 // Created:     2 Dec 2014
5 // Author:      Artem ZHIDKOV
6
7 #ifndef GeomAlgoAPI_Placement_H_
8 #define GeomAlgoAPI_Placement_H_
9
10 #include <GeomAlgoAPI.h>
11 #include <GeomAPI_Shape.h>
12 #include <GeomAPI_Dir.h>
13 #include <GeomAPI_Face.h>
14 #include <GeomAlgoAPI_MakeShape.h>
15 #include <GeomAPI_DataMapOfShapeShape.h>
16 #include <memory>
17
18 /**\class GeomAlgoAPI_Placement
19  * \ingroup DataAlgo
20  * \brief Creates the copied object which sub-element is placed on the given element
21  */
22 class GeomAlgoAPI_Placement : public GeomAPI_Interface
23 {
24 public:
25   /** \brief Creates an object which is obtained from current object by transformation calculated
26    *         as a movement of the source object to be coincident with the destination object
27    *  \param[in] theSourceSolid  a shape to be moved
28    *  \param[in] theDestSolid    invariant shape
29    *  \param[in] theSourceShape  a shape on the solid to be made coincident with destination object
30    *  \param[in] theDestShape    destination object
31    *  \param[in] theIsReverse    indicates that the solid materials should be on the same side against the destination plane
32    *  \param[in] theIsCentering  indicates the planes should be centered
33    *  \param[in] theSimpleTransform makes just transformation of shape without changing of topology or geometry
34    */
35   GEOMALGOAPI_EXPORT GeomAlgoAPI_Placement(std::shared_ptr<GeomAPI_Shape> theSourceSolid,
36                                            std::shared_ptr<GeomAPI_Shape> theDestSolid,
37                                            std::shared_ptr<GeomAPI_Shape> theSourceShape,
38                                            std::shared_ptr<GeomAPI_Shape> theDestShape,
39                                            bool theIsReverse = false,
40                                            bool theIsCentering = false,
41                                            bool theSimpleTransform = false);
42
43   /// Returns True if algorithm succeed
44   GEOMALGOAPI_EXPORT const bool isDone() const
45   { return myDone; }
46
47   ///  Returns True if resulting shape is valid
48   GEOMALGOAPI_EXPORT const bool isValid() const;
49
50   /// Returns True if resulting shape has volume
51   GEOMALGOAPI_EXPORT const bool hasVolume() const;
52
53   /// Returns result of the Placement algorithm which may be a Solid or a Face
54   GEOMALGOAPI_EXPORT const std::shared_ptr<GeomAPI_Shape>& shape () const;
55
56   /// Returns map of sub-shapes of the result. To be used for History keeping
57   GEOMALGOAPI_EXPORT void  mapOfShapes (GeomAPI_DataMapOfShapeShape& theMap) const;
58
59   /// Return interface for for History processing
60   GEOMALGOAPI_EXPORT GeomAlgoAPI_MakeShape* makeShape () const;
61
62   /// Destructor
63   GEOMALGOAPI_EXPORT virtual ~GeomAlgoAPI_Placement();
64
65 private:
66   /// builds resulting shape
67   void build(const std::shared_ptr<GeomAPI_Shape>& theSourceSolid,
68              const std::shared_ptr<GeomAPI_Shape>& theDestSolid,
69              const std::shared_ptr<GeomAPI_Shape>& theSourceShape,
70              const std::shared_ptr<GeomAPI_Shape>& theDestShape,
71              bool theIsReverse,
72              bool theIsCentering,
73              bool theSimpleTransform);
74
75   /// fields
76   bool myDone;
77   std::shared_ptr<GeomAPI_Shape> myShape;
78   GeomAPI_DataMapOfShapeShape myMap;
79   GeomAlgoAPI_MakeShape * myMkShape;
80 };
81
82 #endif