1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: GeomAlgoAPI_Translation.h
4 // Created: 8 June 2015
5 // Author: Dmitry Bobylev
7 #ifndef GeomAlgoAPI_Translation_H_
8 #define GeomAlgoAPI_Translation_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_Translation
19 * \brief Creates a copy of the object by moving it along the axis.
21 class GeomAlgoAPI_Translation : 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.
29 GEOMALGOAPI_EXPORT GeomAlgoAPI_Translation(std::shared_ptr<GeomAPI_Shape> theSourceShape,
30 std::shared_ptr<GeomAPI_Ax1> theAxis,
33 /// \return true if algorithm succeed.
34 GEOMALGOAPI_EXPORT const bool isDone() const
37 /// \return true if resulting shape is valid.
38 GEOMALGOAPI_EXPORT const bool isValid() const;
40 /// \return true if resulting shape has volume.
41 GEOMALGOAPI_EXPORT const bool hasVolume() const;
43 /// \return result of the movement algorithm.
44 GEOMALGOAPI_EXPORT const std::shared_ptr<GeomAPI_Shape>& shape() const;
46 /// \return map of sub-shapes of the result. To be used for History keeping.
47 GEOMALGOAPI_EXPORT std::shared_ptr<GeomAPI_DataMapOfShapeShape> mapOfShapes() const;
49 /// \return interface for for History processing.
50 GEOMALGOAPI_EXPORT std::shared_ptr<GeomAlgoAPI_MakeShape> makeShape() const;
52 /// Returns the simple transformation
53 GEOMALGOAPI_EXPORT std::shared_ptr<GeomAPI_Trsf> transformation() const;
56 /// Builds resulting shape.
57 void build(std::shared_ptr<GeomAPI_Shape> theSourceShape,
58 std::shared_ptr<GeomAPI_Ax1> theAxis,
64 std::shared_ptr<GeomAPI_Shape> myShape;
65 std::shared_ptr<GeomAPI_DataMapOfShapeShape> myMap;
66 std::shared_ptr<GeomAlgoAPI_MakeShape> myMkShape;
67 std::shared_ptr<GeomAPI_Trsf> myTrsf;