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 FEATURESAPI_SCALE_H_
22 #define FEATURESAPI_SCALE_H_
24 #include "FeaturesAPI.h"
26 #include <FeaturesPlugin_Scale.h>
28 #include <ModelHighAPI_Interface.h>
29 #include <ModelHighAPI_Macro.h>
31 class ModelHighAPI_Double;
32 class ModelHighAPI_Dumper;
33 class ModelHighAPI_Selection;
35 /// \class FeaturesAPI_Scale
36 /// \ingroup CPPHighAPI
37 /// \brief Interface for Scale feature.
38 class FeaturesAPI_Scale: public ModelHighAPI_Interface
41 /// Constructor without values.
43 explicit FeaturesAPI_Scale(const std::shared_ptr<ModelAPI_Feature>& theFeature);
45 /// Constructor with values.
47 explicit FeaturesAPI_Scale(const std::shared_ptr<ModelAPI_Feature>& theFeature,
48 const std::list<ModelHighAPI_Selection>& theMainObjects,
49 const ModelHighAPI_Selection& theCenterPoint,
50 const ModelHighAPI_Double& theScaleFactor);
52 /// Constructor with values.
54 explicit FeaturesAPI_Scale(const std::shared_ptr<ModelAPI_Feature>& theFeature,
55 const std::list<ModelHighAPI_Selection>& theMainObjects,
56 const ModelHighAPI_Selection& theCenterPoint,
57 const ModelHighAPI_Double& theScaleFactorX,
58 const ModelHighAPI_Double& theScaleFactorY,
59 const ModelHighAPI_Double& theScaleFactorZ);
63 virtual ~FeaturesAPI_Scale();
65 INTERFACE_7(FeaturesPlugin_Scale::ID(),
66 creationMethod, FeaturesPlugin_Scale::CREATION_METHOD(),
67 ModelAPI_AttributeString, /** Creation method */,
68 mainObjects, FeaturesPlugin_Scale::OBJECTS_LIST_ID(),
69 ModelAPI_AttributeSelectionList, /** Main objects */,
70 centerPoint, FeaturesPlugin_Scale::CENTER_POINT_ID(),
71 ModelAPI_AttributeSelection, /** Center point */,
72 scaleFactor, FeaturesPlugin_Scale::SCALE_FACTOR_ID(),
73 ModelAPI_AttributeDouble, /** Scale factor */,
74 scaleFactorX, FeaturesPlugin_Scale::SCALE_FACTOR_X_ID(),
75 ModelAPI_AttributeDouble, /** Scale factor in X */,
76 scaleFactorY, FeaturesPlugin_Scale::SCALE_FACTOR_Y_ID(),
77 ModelAPI_AttributeDouble, /** Scale factor in Y */,
78 scaleFactorZ, FeaturesPlugin_Scale::SCALE_FACTOR_Z_ID(),
79 ModelAPI_AttributeDouble, /** Scale factor in Z */)
83 void setMainObjects(const std::list<ModelHighAPI_Selection>& theMainObjects);
85 /// Modify center_point attribute of the feature.
87 void setCenterPoint(const ModelHighAPI_Selection& theCenterPoint);
89 /// Modify Creation Method and scale_factor attribute of the feature.
91 void setScaleFactor(const ModelHighAPI_Double& theScaleFactor);
93 /// Modify Creation Method and scale_factor_x, scale_factor_y and scale_factor_z
94 /// attributes of the feature.
96 void setDimensions(const ModelHighAPI_Double& theScaleFactorX,
97 const ModelHighAPI_Double& theScaleFactorY,
98 const ModelHighAPI_Double& theScaleFactorZ);
100 /// Dump wrapped feature
102 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
105 /// Pointer on Scale object.
106 typedef std::shared_ptr<FeaturesAPI_Scale> ScalePtr;
108 /// \ingroup CPPHighAPI
109 /// \brief Create Scale feature.
111 ScalePtr addScale(const std::shared_ptr<ModelAPI_Document>& thePart,
112 const std::list<ModelHighAPI_Selection>& theMainObjects,
113 const ModelHighAPI_Selection& theCenterPoint,
114 const ModelHighAPI_Double& theScaleFactor);
116 /// \ingroup CPPHighAPI
117 /// \brief Create Scale feature.
119 ScalePtr addScale(const std::shared_ptr<ModelAPI_Document>& thePart,
120 const std::list<ModelHighAPI_Selection>& theMainObjects,
121 const ModelHighAPI_Selection& theCenterPoint,
122 const ModelHighAPI_Double& theScaleFactorX,
123 const ModelHighAPI_Double& theScaleFactorY,
124 const ModelHighAPI_Double& theScaleFactorZ);
126 #endif // FEATURESAPI_SCALE_H_