1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: GeomAlgoAPI_Movement.h
4 // Created: 8 June 2015
5 // Author: Dmitry Bobylev
7 #ifndef GeomAlgoAPI_Movement_H_
8 #define GeomAlgoAPI_Movement_H_
10 #include <GeomAlgoAPI.h>
11 #include <GeomAlgoAPI_MakeShape.h>
12 #include <GeomAPI_Ax1.h>
13 #include <GeomAPI_DataMapOfShapeShape.h>
14 #include <GeomAPI_Shape.h>
15 #include <GeomAPI_Trsf.h>
17 /** \class GeomAlgoAPI_Movement
19 * \brief Creates a copy of the object by moving it along the axis.
21 class GeomAlgoAPI_Movement : public GeomAPI_Interface
24 /** \brief Creates an object which is obtained from current object by moving it along the axis.
25 * \param[in] theSourceShape a shape to be moved.
26 * \param[in] theAxis movement axis.
27 * \param[in] theDistance movement distance.
28 * \param[in] theSimpleTransform makes just transformation of shape without changing of topology or geometry
30 GEOMALGOAPI_EXPORT GeomAlgoAPI_Movement(std::shared_ptr<GeomAPI_Shape> theSourceShape,
31 std::shared_ptr<GeomAPI_Ax1> theAxis,
33 bool theSimpleTransform = false);
35 /// \return true if algorithm succeed.
36 GEOMALGOAPI_EXPORT const bool isDone() const
39 /// \return true if resulting shape is valid.
40 GEOMALGOAPI_EXPORT const bool isValid() const;
42 /// \return true if resulting shape has volume.
43 GEOMALGOAPI_EXPORT const bool hasVolume() const;
45 /// \return result of the movement algorithm.
46 GEOMALGOAPI_EXPORT const std::shared_ptr<GeomAPI_Shape>& shape() const;
48 /// \return map of sub-shapes of the result. To be used for History keeping.
49 GEOMALGOAPI_EXPORT std::shared_ptr<GeomAPI_DataMapOfShapeShape> mapOfShapes() const;
51 /// \return interface for for History processing.
52 GEOMALGOAPI_EXPORT std::shared_ptr<GeomAlgoAPI_MakeShape> makeShape() const;
54 /// Returns the simple transformation
55 GEOMALGOAPI_EXPORT std::shared_ptr<GeomAPI_Trsf> transformation() const;
58 /// Builds resulting shape.
59 void build(std::shared_ptr<GeomAPI_Shape> theSourceShape,
60 std::shared_ptr<GeomAPI_Ax1> theAxis,
62 bool theSimpleTransform);
67 std::shared_ptr<GeomAPI_Shape> myShape;
68 std::shared_ptr<GeomAPI_DataMapOfShapeShape> myMap;
69 std::shared_ptr<GeomAlgoAPI_MakeShape> myMkShape;
70 std::shared_ptr<GeomAPI_Trsf> myTrsf; ///< transformation of the shape in case theSimpleTransform