1 // Copyright (C) 2014-2019 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef GEOMALGOAPI_SCALE_H_
21 #define GEOMALGOAPI_SCALE_H_
23 #include <GeomAlgoAPI_MakeShape.h>
25 #include <GeomAPI_Pnt.h>
27 /// \class GeomAlgoAPI_Scale
29 /// \brief Creates a copy of the object by performing a scale operation by a factor or
31 class GeomAlgoAPI_Scale : public GeomAlgoAPI_MakeShape
34 /// Type of scale operation
36 BY_FACTOR, ///< Scale by factor.
37 BY_DIMENSIONS, ///< Scale by dimensions.
40 /// \brief Creates an object which is obtained from current object by performing
41 /// a scale operation by a factor.
42 /// \param[in] theSourceShape the shape to be moved.
43 /// \param[in] theCenterPoint the center point.
44 /// \param[in] theFactor the scale factor.
45 GEOMALGOAPI_EXPORT GeomAlgoAPI_Scale(std::shared_ptr<GeomAPI_Shape> theSourceShape,
46 std::shared_ptr<GeomAPI_Pnt> theCenterPoint,
47 double theScaleFactor);
49 /// \brief Creates an object which is obtained from current object by performing
50 /// a scale operation by dimensions.
51 /// \param[in] theSourceShape the shape to be moved.
52 /// \param[in] theCenterPoint the center point.
53 /// \param[in] theFactorX the scale factor in X.
54 /// \param[in] theFactorY the scale factor in Y.
55 /// \param[in] theFactorZ the scale factor in Z.
56 GEOMALGOAPI_EXPORT GeomAlgoAPI_Scale(std::shared_ptr<GeomAPI_Shape> theSourceShape,
57 std::shared_ptr<GeomAPI_Pnt> theCenterPoint,
58 double theScaleFactorX,
59 double theScaleFactorY,
60 double theScaleFactorZ);
62 /// Checks if data for the scale transform is OK.
63 GEOMALGOAPI_EXPORT bool check();
65 /// Execute the scale transform.
66 GEOMALGOAPI_EXPORT void build();
69 MethodType myMethodType; /// Type of method used.
70 std::shared_ptr<GeomAPI_Shape> mySourceShape; /// Shape to be moved.
71 std::shared_ptr<GeomAPI_Pnt> myCenterPoint; /// Center point.
72 double myScaleFactor; /// Scale factor.
73 double myScaleFactorX; /// Scale factor in X.
74 double myScaleFactorY; /// Scale factor in Y.
75 double myScaleFactorZ; /// Scale factor in Z.
78 void buildByDimensions();
81 #endif // GEOMALGOAPI_SCALE_H_