Salome HOME
Issue #1860: fix end lines with spaces
[modules/shaper.git] / src / FeaturesAPI / FeaturesAPI_Revolution.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:        FeaturesAPI_Revolution.h
4 // Created:     09 June 2016
5 // Author:      Dmitry Bobylev
6
7 #ifndef FeaturesAPI_Revolution_H_
8 #define FeaturesAPI_Revolution_H_
9
10 #include "FeaturesAPI.h"
11
12 #include <FeaturesPlugin_Revolution.h>
13
14 #include <ModelHighAPI_Interface.h>
15 #include <ModelHighAPI_Macro.h>
16
17 class ModelHighAPI_Double;
18 class ModelHighAPI_Reference;
19 class ModelHighAPI_Selection;
20
21 /// \class FeaturesAPI_Revolution
22 /// \ingroup CPPHighAPI
23 /// \brief Interface for Revolution feature.
24 class FeaturesAPI_Revolution: public ModelHighAPI_Interface
25 {
26 public:
27   /// Constructor without values.
28   FEATURESAPI_EXPORT
29   explicit FeaturesAPI_Revolution(const std::shared_ptr<ModelAPI_Feature>& theFeature);
30
31   /// Constructor with values.
32   FEATURESAPI_EXPORT
33   explicit FeaturesAPI_Revolution(const std::shared_ptr<ModelAPI_Feature>& theFeature,
34                                   const std::list<ModelHighAPI_Selection>& theBaseObjects,
35                                   const ModelHighAPI_Selection& theAxis,
36                                   const ModelHighAPI_Double& theAngle);
37
38   /// Constructor with values.
39   FEATURESAPI_EXPORT
40   explicit FeaturesAPI_Revolution(const std::shared_ptr<ModelAPI_Feature>& theFeature,
41                                   const std::list<ModelHighAPI_Selection>& theBaseObjects,
42                                   const ModelHighAPI_Selection& theAxis,
43                                   const ModelHighAPI_Double& theToAngle,
44                                   const ModelHighAPI_Double& theFromAngle);
45
46   /// Constructor with values.
47   FEATURESAPI_EXPORT
48   explicit FeaturesAPI_Revolution(const std::shared_ptr<ModelAPI_Feature>& theFeature,
49                                   const std::list<ModelHighAPI_Selection>& theBaseObjects,
50                                   const ModelHighAPI_Selection& theAxis,
51                                   const ModelHighAPI_Selection& theToObject,
52                                   const ModelHighAPI_Double& theToOffset,
53                                   const ModelHighAPI_Selection& theFromObject,
54                                   const ModelHighAPI_Double& theFromOffset);
55
56   /// Destructor.
57   FEATURESAPI_EXPORT
58   virtual ~FeaturesAPI_Revolution();
59
60   INTERFACE_10(FeaturesPlugin_Revolution::ID(),
61                sketch, FeaturesPlugin_Revolution::SKETCH_ID(),
62                ModelAPI_AttributeReference, /** Sketch launcher */,
63                baseObjects, FeaturesPlugin_Revolution::BASE_OBJECTS_ID(),
64                ModelAPI_AttributeSelectionList, /** Base objects */,
65                axis, FeaturesPlugin_Revolution::AXIS_OBJECT_ID(),
66                ModelAPI_AttributeSelection, /** Axis */,
67                creationMethod, FeaturesPlugin_Revolution::CREATION_METHOD(),
68                ModelAPI_AttributeString, /** Creation method */,
69                toAngle, FeaturesPlugin_Revolution::TO_ANGLE_ID(),
70                ModelAPI_AttributeDouble, /** To angle */,
71                fromAngle, FeaturesPlugin_Revolution::FROM_ANGLE_ID(),
72                ModelAPI_AttributeDouble, /** From angle */,
73                toObject, FeaturesPlugin_Revolution::TO_OBJECT_ID(),
74                ModelAPI_AttributeSelection, /** To object */,
75                toOffset, FeaturesPlugin_Revolution::TO_OFFSET_ID(),
76                ModelAPI_AttributeDouble, /** To offset */,
77                fromObject, FeaturesPlugin_Revolution::FROM_OBJECT_ID(),
78                ModelAPI_AttributeSelection, /** From object */,
79                fromOffset, FeaturesPlugin_Revolution::FROM_OFFSET_ID(),
80                ModelAPI_AttributeDouble, /** From offset */)
81
82   /// Modify base attribute of the feature.
83   FEATURESAPI_EXPORT
84   void setNestedSketch(const ModelHighAPI_Reference& theSketch);
85
86   /// Modify base attribute of the feature.
87   FEATURESAPI_EXPORT
88   void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
89
90   /// Modify axis_object attribute of the feature.
91   FEATURESAPI_EXPORT
92   void setAxis(const ModelHighAPI_Selection& theAxis);
93
94   /// Modify CreationMethod, to_angle, from_angle attributes of the feature.
95   FEATURESAPI_EXPORT
96   void setAngles(const ModelHighAPI_Double& theToAngle,
97                  const ModelHighAPI_Double& theFromAngle);
98
99   /// Modify CreationMethod, to_angle, from_angle attributes of the feature.
100   FEATURESAPI_EXPORT
101   void setAngle(const ModelHighAPI_Double& theAngle);
102
103   /// Modify CreationMethod, to_object, to_offset,
104   /// from_object, from_offset attributes of the feature.
105   FEATURESAPI_EXPORT
106   void setPlanesAndOffsets(const ModelHighAPI_Selection& theToObject,
107                            const ModelHighAPI_Double& theToOffset,
108                            const ModelHighAPI_Selection& theFromObject,
109                            const ModelHighAPI_Double& theFromOffset);
110
111   /// Dump wrapped feature
112   FEATURESAPI_EXPORT
113   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
114
115 private:
116   void execIfBaseNotEmpty();
117 };
118
119 /// Pointer on Revolution object.
120 typedef std::shared_ptr<FeaturesAPI_Revolution> RevolutionPtr;
121
122 /// \ingroup CPPHighAPI
123 /// \brief Create Revolution feature.
124 FEATURESAPI_EXPORT
125 RevolutionPtr addRevolution(const std::shared_ptr<ModelAPI_Document>& thePart,
126                             const std::list<ModelHighAPI_Selection>& theBaseObjects,
127                             const ModelHighAPI_Selection& theAxis,
128                             const ModelHighAPI_Double& theAngle);
129
130 /// \ingroup CPPHighAPI
131 /// \brief Create Revolution feature.
132 FEATURESAPI_EXPORT
133 RevolutionPtr addRevolution(const std::shared_ptr<ModelAPI_Document>& thePart,
134                             const std::list<ModelHighAPI_Selection>& theBaseObjects,
135                             const ModelHighAPI_Selection& theAxis,
136                             const ModelHighAPI_Double& theToAngle,
137                             const ModelHighAPI_Double& theFromAngle);
138
139 /// \ingroup CPPHighAPI
140 /// \brief Create Revolution feature.
141 FEATURESAPI_EXPORT
142 RevolutionPtr addRevolution(const std::shared_ptr<ModelAPI_Document>& thePart,
143                             const std::list<ModelHighAPI_Selection>& theBaseObjects,
144                             const ModelHighAPI_Selection& theAxis,
145                             const ModelHighAPI_Selection& theToObject,
146                             const ModelHighAPI_Double& theToOffset,
147                             const ModelHighAPI_Selection& theFromObject,
148                             const ModelHighAPI_Double& theFromOffset);
149
150 #endif // FeaturesAPI_Revolution_H_