1 // File: GeomAlgoAPI_Placement.h
3 // Author: Artem ZHIDKOV
5 #ifndef GeomAlgoAPI_Placement_H_
6 #define GeomAlgoAPI_Placement_H_
8 #include <GeomAlgoAPI.h>
9 #include <GeomAPI_Shape.h>
10 #include <GeomAPI_Dir.h>
11 #include <GeomAPI_Pln.h>
12 #include <GeomAlgoAPI_MakeShape.h>
13 #include <GeomAPI_DataMapOfShapeShape.h>
16 /**\class GeomAlgoAPI_Placement
18 * \brief Creates the copied object which face is placed on the given plane
20 class GeomAlgoAPI_Placement : public GeomAPI_Interface
23 /** \brief Creates an object which is obtained from current object by transformation calculated
24 * as a movement of the source plane to be coincident with the destination plane
25 * \param[in] theAttractiveShape shape to be moved
26 * \param[in] theSourcePlane plane on the shape to be made coincident with destination plane
27 * \param[in] theDestPlane destination plane
29 GEOMALGOAPI_EXPORT GeomAlgoAPI_Placement(std::shared_ptr<GeomAPI_Shape> theAttractiveShape,
30 std::shared_ptr<GeomAPI_Pln> theSourcePlane,
31 std::shared_ptr<GeomAPI_Pln> theDestPlane);
33 /// Returns True if algorithm succeed
34 GEOMALGOAPI_EXPORT const bool isDone() const
37 /// Returns True if resulting shape is valid
38 GEOMALGOAPI_EXPORT const bool isValid() const;
40 /// Returns True if resulting shape has volume
41 GEOMALGOAPI_EXPORT const bool hasVolume() const;
43 /// Returns result of the Placement algorithm which may be a Solid or a Face
44 GEOMALGOAPI_EXPORT const std::shared_ptr<GeomAPI_Shape>& shape () const;
46 /// Returns map of sub-shapes of the result. To be used for History keeping
47 GEOMALGOAPI_EXPORT void mapOfShapes (GeomAPI_DataMapOfShapeShape& theMap) const;
49 /// Return interface for for History processing
50 GEOMALGOAPI_EXPORT GeomAlgoAPI_MakeShape* makeShape () const;
53 GEOMALGOAPI_EXPORT virtual ~GeomAlgoAPI_Placement();
56 /// builds resulting shape
57 void build(const std::shared_ptr<GeomAPI_Shape>& theAttractiveShape,
58 const std::shared_ptr<GeomAPI_Pln>& theSourcePlane,
59 const std::shared_ptr<GeomAPI_Pln>& theDestPlane);
63 std::shared_ptr<GeomAPI_Shape> myShape;
64 GeomAPI_DataMapOfShapeShape myMap;
65 GeomAlgoAPI_MakeShape * myMkShape;