1 // Copyright (C) 2014-201x CEA/DEN, EDF R&D
3 // File: GeomAlgoAPI_Scale.h
4 // Created: 23 Jan 2017
5 // Author: Clarisse Genrault (CEA)
7 #ifndef GEOMALGOAPI_SCALE_H_
8 #define GEOMALGOAPI_SCALE_H_
10 #include <GeomAlgoAPI_MakeShape.h>
12 #include <GeomAPI_Pnt.h>
14 /// \class GeomAlgoAPI_Scale
16 /// \brief Creates a copy of the object by performing a scale operation by a factor or
18 class GeomAlgoAPI_Scale : public GeomAlgoAPI_MakeShape
21 /// Type of scale operation
23 BY_FACTOR, ///< Scale by factor.
24 BY_DIMENSIONS, ///< Scale by dimensions.
27 /// \brief Creates an object which is obtained from current object by performing
28 /// a scale operation by a factor.
29 /// \param[in] theSourceShape the shape to be moved.
30 /// \param[in] theCenterPoint the center point.
31 /// \param[in] theFactor the scale factor.
32 GEOMALGOAPI_EXPORT GeomAlgoAPI_Scale(std::shared_ptr<GeomAPI_Shape> theSourceShape,
33 std::shared_ptr<GeomAPI_Pnt> theCenterPoint,
34 double theScaleFactor);
36 /// \brief Creates an object which is obtained from current object by performing
37 /// a scale operation by dimensions.
38 /// \param[in] theSourceShape the shape to be moved.
39 /// \param[in] theCenterPoint the center point.
40 /// \param[in] theFactorX the scale factor in X.
41 /// \param[in] theFactorY the scale factor in Y.
42 /// \param[in] theFactorZ the scale factor in Z.
43 GEOMALGOAPI_EXPORT GeomAlgoAPI_Scale(std::shared_ptr<GeomAPI_Shape> theSourceShape,
44 std::shared_ptr<GeomAPI_Pnt> theCenterPoint,
45 double theScaleFactorX,
46 double theScaleFactorY,
47 double theScaleFactorZ);
49 /// Checks if data for the scale transform is OK.
50 GEOMALGOAPI_EXPORT bool check();
52 /// Execute the scale transform.
53 GEOMALGOAPI_EXPORT void build();
56 MethodType myMethodType; /// Type of method used.
57 std::shared_ptr<GeomAPI_Shape> mySourceShape; /// Shape to be moved.
58 std::shared_ptr<GeomAPI_Pnt> myCenterPoint; /// Center point.
59 double myScaleFactor; /// Scale factor.
60 double myScaleFactorX; /// Scale factor in X.
61 double myScaleFactorY; /// Scale factor in Y.
62 double myScaleFactorZ; /// Scale factor in Z.
65 void buildByDimensions();
68 #endif // GEOMALGOAPI_SCALE_H_