1 // Copyright (C) 2014-2017 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
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 #ifndef GEOMALGOAPI_SCALE_H_
22 #define GEOMALGOAPI_SCALE_H_
24 #include <GeomAlgoAPI_MakeShape.h>
26 #include <GeomAPI_Pnt.h>
28 /// \class GeomAlgoAPI_Scale
30 /// \brief Creates a copy of the object by performing a scale operation by a factor or
32 class GeomAlgoAPI_Scale : public GeomAlgoAPI_MakeShape
35 /// Type of scale operation
37 BY_FACTOR, ///< Scale by factor.
38 BY_DIMENSIONS, ///< Scale by dimensions.
41 /// \brief Creates an object which is obtained from current object by performing
42 /// a scale operation by a factor.
43 /// \param[in] theSourceShape the shape to be moved.
44 /// \param[in] theCenterPoint the center point.
45 /// \param[in] theFactor the scale factor.
46 GEOMALGOAPI_EXPORT GeomAlgoAPI_Scale(std::shared_ptr<GeomAPI_Shape> theSourceShape,
47 std::shared_ptr<GeomAPI_Pnt> theCenterPoint,
48 double theScaleFactor);
50 /// \brief Creates an object which is obtained from current object by performing
51 /// a scale operation by dimensions.
52 /// \param[in] theSourceShape the shape to be moved.
53 /// \param[in] theCenterPoint the center point.
54 /// \param[in] theFactorX the scale factor in X.
55 /// \param[in] theFactorY the scale factor in Y.
56 /// \param[in] theFactorZ the scale factor in Z.
57 GEOMALGOAPI_EXPORT GeomAlgoAPI_Scale(std::shared_ptr<GeomAPI_Shape> theSourceShape,
58 std::shared_ptr<GeomAPI_Pnt> theCenterPoint,
59 double theScaleFactorX,
60 double theScaleFactorY,
61 double theScaleFactorZ);
63 /// Checks if data for the scale transform is OK.
64 GEOMALGOAPI_EXPORT bool check();
66 /// Execute the scale transform.
67 GEOMALGOAPI_EXPORT void build();
70 MethodType myMethodType; /// Type of method used.
71 std::shared_ptr<GeomAPI_Shape> mySourceShape; /// Shape to be moved.
72 std::shared_ptr<GeomAPI_Pnt> myCenterPoint; /// Center point.
73 double myScaleFactor; /// Scale factor.
74 double myScaleFactorX; /// Scale factor in X.
75 double myScaleFactorY; /// Scale factor in Y.
76 double myScaleFactorZ; /// Scale factor in Z.
79 void buildByDimensions();
82 #endif // GEOMALGOAPI_SCALE_H_