SHAPER  9.12.0
FeaturesAPI_Rotation.h
1 // Copyright (C) 2014-2023 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_Rotation_H_
21 #define FeaturesAPI_Rotation_H_
22 
23 #include "FeaturesAPI.h"
24 
25 #include <FeaturesPlugin_Rotation.h>
26 
27 #include <ModelHighAPI_Double.h>
28 #include <ModelHighAPI_Interface.h>
29 #include <ModelHighAPI_Macro.h>
30 #include <ModelHighAPI_Selection.h>
31 
33 
38 {
39 public:
41  FEATURESAPI_EXPORT
42  explicit FeaturesAPI_Rotation(const std::shared_ptr<ModelAPI_Feature>& theFeature);
43 
45  FEATURESAPI_EXPORT
46  FeaturesAPI_Rotation(const std::shared_ptr<ModelAPI_Feature>& theFeature,
47  const std::list<ModelHighAPI_Selection>& theMainObjects,
48  const ModelHighAPI_Selection& theAxisObject,
49  const ModelHighAPI_Double& theAngle);
50 
52  FEATURESAPI_EXPORT
53  FeaturesAPI_Rotation(const std::shared_ptr<ModelAPI_Feature>& theFeature,
54  const std::list<ModelHighAPI_Selection>& theMainObjects,
55  const ModelHighAPI_Selection& theCenterPoint,
56  const ModelHighAPI_Selection& theStartPoint,
57  const ModelHighAPI_Selection& theEndPoint);
58 
60  FEATURESAPI_EXPORT
61  virtual ~FeaturesAPI_Rotation();
62 
63  INTERFACE_7(FeaturesPlugin_Rotation::ID(),
78  )
79 
80 
81  FEATURESAPI_EXPORT
82  void setMainObjects(const std::list<ModelHighAPI_Selection>& theMainObjects);
83 
85  FEATURESAPI_EXPORT
86  void setAxisObject(const ModelHighAPI_Selection& theAxisObject);
87 
89  FEATURESAPI_EXPORT
90  void setAngle(const ModelHighAPI_Double& theAngle);
91 
93  FEATURESAPI_EXPORT
94  void setPoints(const ModelHighAPI_Selection& theCenterPoint,
95  const ModelHighAPI_Selection& theStartPoint,
96  const ModelHighAPI_Selection& theEndPoint);
97 
99  FEATURESAPI_EXPORT
100  virtual void dump(ModelHighAPI_Dumper& theDumper) const;
101 };
102 
104 typedef std::shared_ptr<FeaturesAPI_Rotation> RotationPtr;
105 
106 
107 #define DUMMY std::pair<ModelHighAPI_Selection, ModelHighAPI_Double>()
108 
111 FEATURESAPI_EXPORT RotationPtr addRotation(
112  const std::shared_ptr<ModelAPI_Document>& part,
113  const std::list<ModelHighAPI_Selection>& objects,
115  const std::pair<ModelHighAPI_Selection, ModelHighAPI_Double>& angle = DUMMY,
119  const bool keepSubResults = false);
120 
121 #endif // FeaturesAPI_Rotation_H_
Interface for Rotation feature.
Definition: FeaturesAPI_Rotation.h:38
virtual std::shared_ptr< ModelAPI_AttributeString > creationMethod() const
Creation method.
Definition: FeaturesAPI_Rotation.h:78
void setAxisObject(const ModelHighAPI_Selection &theAxisObject)
Set axis object.
Definition: FeaturesAPI_Rotation.cpp:75
virtual std::shared_ptr< ModelAPI_AttributeSelection > startPoint() const
Start point.
Definition: FeaturesAPI_Rotation.h:78
virtual std::shared_ptr< ModelAPI_AttributeSelection > endPoint() const
End point.
Definition: FeaturesAPI_Rotation.h:78
virtual ~FeaturesAPI_Rotation()
Destructor.
Definition: FeaturesAPI_Rotation.cpp:61
virtual std::shared_ptr< ModelAPI_AttributeSelection > axisObject() const
Axis object.
Definition: FeaturesAPI_Rotation.h:78
void setPoints(const ModelHighAPI_Selection &theCenterPoint, const ModelHighAPI_Selection &theStartPoint, const ModelHighAPI_Selection &theEndPoint)
Set center point, start point and end point.
Definition: FeaturesAPI_Rotation.cpp:93
virtual std::shared_ptr< ModelAPI_AttributeSelectionList > mainObjects() const
Main objects.
Definition: FeaturesAPI_Rotation.h:78
FeaturesAPI_Rotation(const std::shared_ptr< ModelAPI_Feature > &theFeature)
Constructor without values.
Definition: FeaturesAPI_Rotation.cpp:26
virtual void dump(ModelHighAPI_Dumper &theDumper) const
Dump wrapped feature.
Definition: FeaturesAPI_Rotation.cpp:106
void setAngle(const ModelHighAPI_Double &theAngle)
Set angle.
Definition: FeaturesAPI_Rotation.cpp:84
virtual std::shared_ptr< ModelAPI_AttributeDouble > angle() const
Angle.
Definition: FeaturesAPI_Rotation.h:78
virtual std::shared_ptr< ModelAPI_AttributeSelection > centerPoint() const
Center point.
Definition: FeaturesAPI_Rotation.h:78
void setMainObjects(const std::list< ModelHighAPI_Selection > &theMainObjects)
Set main objects.
Definition: FeaturesAPI_Rotation.cpp:67
static const std::string & START_POINT_ID()
Attribute name of a center point.
Definition: FeaturesPlugin_Rotation.h:92
static const std::string & CREATION_METHOD()
Attribute name for creation method.
Definition: FeaturesPlugin_Rotation.h:43
static const std::string & AXIS_OBJECT_ID()
Attribute name of an axis.
Definition: FeaturesPlugin_Rotation.h:71
static const std::string & ANGLE_ID()
Attribute name of angle.
Definition: FeaturesPlugin_Rotation.h:78
static const std::string & OBJECTS_LIST_ID()
Attribute name of referenced objects.
Definition: FeaturesPlugin_Rotation.h:64
static const std::string & END_POINT_ID()
Attribute name of a center point.
Definition: FeaturesPlugin_Rotation.h:99
static const std::string & ID()
Rotation kind.
Definition: FeaturesPlugin_Rotation.h:36
static const std::string & CENTER_POINT_ID()
Attribute name of a center point.
Definition: FeaturesPlugin_Rotation.h:85
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
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:42
Class for filling ModelAPI_AttributeSelection.
Definition: ModelHighAPI_Selection.h:49
RotationPtr addRotation(const std::shared_ptr< ModelAPI_Document > &part, const std::list< ModelHighAPI_Selection > &objects, const ModelHighAPI_Selection &axis=ModelHighAPI_Selection(), const std::pair< ModelHighAPI_Selection, ModelHighAPI_Double > &angle=std::pair< ModelHighAPI_Selection, ModelHighAPI_Double >(), const ModelHighAPI_Selection &center=ModelHighAPI_Selection(), const ModelHighAPI_Selection &start=ModelHighAPI_Selection(), const ModelHighAPI_Selection &end=ModelHighAPI_Selection(), const bool keepSubResults=false)
Create Rotation feature.
Definition: FeaturesAPI_Rotation.cpp:142