1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: GeomAlgoAPI_Placement.h
5 // Author: Artem ZHIDKOV
7 #ifndef GeomAlgoAPI_Placement_H_
8 #define GeomAlgoAPI_Placement_H_
10 #include <GeomAlgoAPI.h>
11 #include <GeomAPI_Shape.h>
12 #include <GeomAPI_Dir.h>
13 #include <GeomAPI_Pln.h>
14 #include <GeomAlgoAPI_MakeShape.h>
15 #include <GeomAPI_DataMapOfShapeShape.h>
18 /**\class GeomAlgoAPI_Placement
20 * \brief Creates the copied object which face is placed on the given plane
22 class GeomAlgoAPI_Placement : public GeomAPI_Interface
25 /** \brief Creates an object which is obtained from current object by transformation calculated
26 * as a movement of the source plane to be coincident with the destination plane
27 * \param[in] theAttractiveShape shape to be moved
28 * \param[in] theSourcePlane plane on the shape to be made coincident with destination plane
29 * \param[in] theDestPlane destination plane
31 GEOMALGOAPI_EXPORT GeomAlgoAPI_Placement(std::shared_ptr<GeomAPI_Shape> theAttractiveShape,
32 std::shared_ptr<GeomAPI_Pln> theSourcePlane,
33 std::shared_ptr<GeomAPI_Pln> theDestPlane);
35 /// Returns True if algorithm succeed
36 GEOMALGOAPI_EXPORT const bool isDone() const
39 /// Returns True if resulting shape is valid
40 GEOMALGOAPI_EXPORT const bool isValid() const;
42 /// Returns True if resulting shape has volume
43 GEOMALGOAPI_EXPORT const bool hasVolume() const;
45 /// Returns result of the Placement algorithm which may be a Solid or a Face
46 GEOMALGOAPI_EXPORT const std::shared_ptr<GeomAPI_Shape>& shape () const;
48 /// Returns map of sub-shapes of the result. To be used for History keeping
49 GEOMALGOAPI_EXPORT void mapOfShapes (GeomAPI_DataMapOfShapeShape& theMap) const;
51 /// Return interface for for History processing
52 GEOMALGOAPI_EXPORT GeomAlgoAPI_MakeShape* makeShape () const;
55 GEOMALGOAPI_EXPORT virtual ~GeomAlgoAPI_Placement();
58 /// builds resulting shape
59 void build(const std::shared_ptr<GeomAPI_Shape>& theAttractiveShape,
60 const std::shared_ptr<GeomAPI_Pln>& theSourcePlane,
61 const std::shared_ptr<GeomAPI_Pln>& theDestPlane);
65 std::shared_ptr<GeomAPI_Shape> myShape;
66 GeomAPI_DataMapOfShapeShape myMap;
67 GeomAlgoAPI_MakeShape * myMkShape;