Salome HOME
Updated copyright comment
[modules/shaper.git] / src / SketchAPI / SketchAPI_Rotation.h
1 // Copyright (C) 2014-2024  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 SRC_SKETCHAPI_SKETCHAPI_ROTATION_H_
21 #define SRC_SKETCHAPI_SKETCHAPI_ROTATION_H_
22
23 //--------------------------------------------------------------------------------------
24 #include "SketchAPI.h"
25 #include "SketchAPI_SketchEntity.h"
26
27 #include <list>
28
29 #include <SketchPlugin_MultiRotation.h>
30
31 #include <ModelHighAPI_Interface.h>
32 #include <ModelHighAPI_Macro.h>
33 //--------------------------------------------------------------------------------------
34 class ModelAPI_Object;
35 class ModelHighAPI_Double;
36 class ModelHighAPI_Integer;
37 class ModelHighAPI_RefAttr;
38 //--------------------------------------------------------------------------------------
39 /**\class SketchAPI_Rotation
40  * \ingroup CPPHighAPI
41  * \brief Interface for Rotation feature
42  */
43 class SketchAPI_Rotation : public ModelHighAPI_Interface
44 {
45 public:
46   /// Constructor without values
47   SKETCHAPI_EXPORT
48   explicit SketchAPI_Rotation(const std::shared_ptr<ModelAPI_Feature> & theFeature);
49   /// Constructor with values
50   SKETCHAPI_EXPORT
51   SketchAPI_Rotation(const std::shared_ptr<ModelAPI_Feature> & theFeature,
52                      const std::list<std::shared_ptr<ModelAPI_Object> > & theObjects,
53                      const ModelHighAPI_RefAttr & theCenter,
54                      const ModelHighAPI_Double & theAngle,
55                      const ModelHighAPI_Integer & theNumberOfObjects,
56                      bool theFullValue = false,
57                      bool theReversed  = false);
58   /// Destructor
59   SKETCHAPI_EXPORT
60   virtual ~SketchAPI_Rotation();
61
62   INTERFACE_8(SketchPlugin_MultiRotation::ID(),
63               rotationList, SketchPlugin_MultiRotation::ROTATION_LIST_ID(),
64               ModelAPI_AttributeRefList, /** Rotation list */,
65               center, SketchPlugin_MultiRotation::CENTER_ID(),
66               ModelAPI_AttributeRefAttr, /** Center */,
67               angle, SketchPlugin_MultiRotation::ANGLE_ID(),
68               ModelAPI_AttributeDouble, /** Angle */,
69               reversed, SketchPlugin_MultiRotation::REVERSED_ID(),
70               ModelAPI_AttributeBoolean, /** Negative angle */,
71               numberOfObjects, SketchPlugin_MultiRotation::NUMBER_OF_OBJECTS_ID(),
72               ModelAPI_AttributeInteger, /** Number of objects */,
73               valueType, SketchPlugin_MultiRotation::ANGLE_TYPE(),
74               ModelAPI_AttributeString, /** Value type */,
75               referenceObjects, SketchPlugin_MultiRotation::ENTITY_A(),
76               ModelAPI_AttributeRefList, /** Reference objects */,
77               rotatedObjects, SketchPlugin_MultiRotation::ENTITY_B(),
78               ModelAPI_AttributeRefList, /** Rotated objects */
79   )
80
81   /// Set list of objects to be rotated
82   SKETCHAPI_EXPORT
83   void setRotationList(const std::list<std::shared_ptr<ModelAPI_Object> >& theObjects);
84
85   /// List of rotated objects.
86   /// [DEPRECATED]: use rotatedList() instead.
87   SKETCHAPI_EXPORT
88   std::list<std::shared_ptr<SketchAPI_SketchEntity> > rotated() const;
89
90   /// List of rotated objects.
91   SKETCHAPI_EXPORT
92   std::list<std::shared_ptr<SketchAPI_SketchEntity> > rotatedList() const;
93
94   /// Dump wrapped feature
95   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
96 };
97
98 //! Pointer on Rotation object
99 typedef std::shared_ptr<SketchAPI_Rotation> RotationPtr;
100
101 //--------------------------------------------------------------------------------------
102 //--------------------------------------------------------------------------------------
103 #endif /* SRC_SKETCHAPI_SKETCHAPI_ROTATION_H_ */