SHAPER 9.16.0
FeaturesAPI_Scale.h
1// Copyright (C) 2014-2026 CEA, EDF
2//
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.
7//
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.
12//
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
16//
17// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18//
19
20#ifndef FEATURESAPI_SCALE_H_
21#define FEATURESAPI_SCALE_H_
22
23#include "FeaturesAPI.h"
24
25#include <FeaturesPlugin_Scale.h>
26
27#include <ModelHighAPI_Double.h>
28#include <ModelHighAPI_Interface.h>
29#include <ModelHighAPI_Macro.h>
30
33
38{
39public:
41 FEATURESAPI_EXPORT
42 explicit FeaturesAPI_Scale(const std::shared_ptr<ModelAPI_Feature>& theFeature);
43
45 FEATURESAPI_EXPORT
46 explicit FeaturesAPI_Scale(const std::shared_ptr<ModelAPI_Feature>& theFeature,
47 const std::list<ModelHighAPI_Selection>& theMainObjects,
48 const ModelHighAPI_Selection& theCenterPoint,
49 const ModelHighAPI_Double& theScaleFactor);
50
52 FEATURESAPI_EXPORT
53 explicit FeaturesAPI_Scale(const std::shared_ptr<ModelAPI_Feature>& theFeature,
54 const std::list<ModelHighAPI_Selection>& theMainObjects,
55 const ModelHighAPI_Selection& theCenterPoint,
56 const ModelHighAPI_Double& theScaleFactorX,
57 const ModelHighAPI_Double& theScaleFactorY,
58 const ModelHighAPI_Double& theScaleFactorZ);
59
61 FEATURESAPI_EXPORT
62 virtual ~FeaturesAPI_Scale();
63
64 INTERFACE_7(FeaturesPlugin_Scale::ID(),
79
80
81 FEATURESAPI_EXPORT
82 void setMainObjects(const std::list<ModelHighAPI_Selection>& theMainObjects);
83
85 FEATURESAPI_EXPORT
86 void setCenterPoint(const ModelHighAPI_Selection& theCenterPoint);
87
89 FEATURESAPI_EXPORT
90 void setScaleFactor(const ModelHighAPI_Double& theScaleFactor);
91
94 FEATURESAPI_EXPORT
95 void setDimensions(const ModelHighAPI_Double& theScaleFactorX,
96 const ModelHighAPI_Double& theScaleFactorY,
97 const ModelHighAPI_Double& theScaleFactorZ);
98
100 FEATURESAPI_EXPORT
101 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
102};
103
105typedef std::shared_ptr<FeaturesAPI_Scale> ScalePtr;
106
109FEATURESAPI_EXPORT
110ScalePtr addScale(const std::shared_ptr<ModelAPI_Document>& thePart,
111 const std::list<ModelHighAPI_Selection>& theMainObjects,
112 const ModelHighAPI_Selection& theCenterPoint,
113 const ModelHighAPI_Double& theScaleFactorX,
114 const ModelHighAPI_Double& theScaleFactorY = ModelHighAPI_Double(0.0),
115 const ModelHighAPI_Double& theScaleFactorZ = ModelHighAPI_Double(0.0),
116 const bool keepSubResults = false);
117
118#endif // FEATURESAPI_SCALE_H_
Interface for Scale feature.
Definition: FeaturesAPI_Scale.h:38
void setCenterPoint(const ModelHighAPI_Selection &theCenterPoint)
Modify center_point attribute of the feature.
Definition: FeaturesAPI_Scale.cpp:75
virtual std::shared_ptr< ModelAPI_AttributeString > creationMethod() const
Creation method.
Definition: FeaturesAPI_Scale.h:78
virtual void dump(ModelHighAPI_Dumper &theDumper) const
Dump wrapped feature.
Definition: FeaturesAPI_Scale.cpp:102
virtual std::shared_ptr< ModelAPI_AttributeDouble > scaleFactor() const
Scale factor.
Definition: FeaturesAPI_Scale.h:78
virtual std::shared_ptr< ModelAPI_AttributeDouble > scaleFactorY() const
Scale factor in Y.
Definition: FeaturesAPI_Scale.h:78
void setMainObjects(const std::list< ModelHighAPI_Selection > &theMainObjects)
Set main objects.
Definition: FeaturesAPI_Scale.cpp:68
virtual ~FeaturesAPI_Scale()
Destructor.
Definition: FeaturesAPI_Scale.cpp:63
FeaturesAPI_Scale(const std::shared_ptr< ModelAPI_Feature > &theFeature)
Constructor without values.
Definition: FeaturesAPI_Scale.cpp:26
void setScaleFactor(const ModelHighAPI_Double &theScaleFactor)
Modify Creation Method and scale_factor attribute of the feature.
Definition: FeaturesAPI_Scale.cpp:82
virtual std::shared_ptr< ModelAPI_AttributeSelection > centerPoint() const
Center point.
Definition: FeaturesAPI_Scale.h:78
virtual std::shared_ptr< ModelAPI_AttributeDouble > scaleFactorX() const
Scale factor in X.
Definition: FeaturesAPI_Scale.h:78
virtual std::shared_ptr< ModelAPI_AttributeSelectionList > mainObjects() const
Main objects.
Definition: FeaturesAPI_Scale.h:78
void setDimensions(const ModelHighAPI_Double &theScaleFactorX, const ModelHighAPI_Double &theScaleFactorY, const ModelHighAPI_Double &theScaleFactorZ)
Modify Creation Method and scale_factor_x, scale_factor_y and scale_factor_z attributes of the featur...
Definition: FeaturesAPI_Scale.cpp:90
virtual std::shared_ptr< ModelAPI_AttributeDouble > scaleFactorZ() const
Scale factor in Z.
Definition: FeaturesAPI_Scale.h:78
static const std::string & CENTER_POINT_ID()
Attribute name of center point.
Definition: FeaturesPlugin_Scale.h:70
static const std::string & SCALE_FACTOR_ID()
Attribute name of scale factor.
Definition: FeaturesPlugin_Scale.h:77
static const std::string & ID()
Scale kind.
Definition: FeaturesPlugin_Scale.h:35
static const std::string & SCALE_FACTOR_Y_ID()
Attribute name of scale factor in Y.
Definition: FeaturesPlugin_Scale.h:91
static const std::string & SCALE_FACTOR_X_ID()
Attribute name of scale factor in X.
Definition: FeaturesPlugin_Scale.h:84
static const std::string & SCALE_FACTOR_Z_ID()
Attribute name of scale factor in Z.
Definition: FeaturesPlugin_Scale.h:98
static const std::string & OBJECTS_LIST_ID()
Attribute name of referenced objects.
Definition: FeaturesPlugin_Scale.h:63
static const std::string & CREATION_METHOD()
Attribute name for creation method.
Definition: FeaturesPlugin_Scale.h:42
Attribute that contains real value with double precision.
Definition: ModelAPI_AttributeDouble.h:34
Attribute that contains list of references to the sub-shapes with possibility to manage them.
Definition: ModelAPI_AttributeSelectionList.h:37
Attribute that contains reference to the sub-shape of some result, the selected shape.
Definition: ModelAPI_AttributeSelection.h:35
API for the attribute that contains std (null terminated) string.
Definition: ModelAPI_AttributeString.h:33
Document for internal data structure of any object storage.
Definition: ModelAPI_Document.h:53
Class for filling ModelAPI_AttributeDouble.
Definition: ModelHighAPI_Double.h:37
Dump engine for the model.
Definition: ModelHighAPI_Dumper.h:81
Base class for feature interfaces.
Definition: ModelHighAPI_Interface.h:46
Class for filling ModelAPI_AttributeSelection.
Definition: ModelHighAPI_Selection.h:49
ScalePtr addScale(const std::shared_ptr< ModelAPI_Document > &thePart, const std::list< ModelHighAPI_Selection > &theMainObjects, const ModelHighAPI_Selection &theCenterPoint, const ModelHighAPI_Double &theScaleFactorX, const ModelHighAPI_Double &theScaleFactorY=ModelHighAPI_Double(0.0), const ModelHighAPI_Double &theScaleFactorZ=ModelHighAPI_Double(0.0), const bool keepSubResults=false)
Create Scale feature.
Definition: FeaturesAPI_Scale.cpp:140