SHAPER  9.12.0
FeaturesAPI_Revolution.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_Revolution_H_
21 #define FeaturesAPI_Revolution_H_
22 
23 #include "FeaturesAPI.h"
24 
25 #include <FeaturesPlugin_Revolution.h>
26 
27 #include <ModelHighAPI_Interface.h>
28 #include <ModelHighAPI_Macro.h>
29 
33 
38 {
39 public:
41  FEATURESAPI_EXPORT
42  explicit FeaturesAPI_Revolution(const std::shared_ptr<ModelAPI_Feature>& theFeature);
43 
45  FEATURESAPI_EXPORT
46  explicit FeaturesAPI_Revolution(const std::shared_ptr<ModelAPI_Feature>& theFeature,
47  const std::list<ModelHighAPI_Selection>& theBaseObjects,
48  const ModelHighAPI_Selection& theAxis,
49  const ModelHighAPI_Double& theAngle);
50 
52  FEATURESAPI_EXPORT
53  explicit FeaturesAPI_Revolution(const std::shared_ptr<ModelAPI_Feature>& theFeature,
54  const std::list<ModelHighAPI_Selection>& theBaseObjects,
55  const ModelHighAPI_Selection& theAxis,
56  const ModelHighAPI_Double& theToAngle,
57  const ModelHighAPI_Double& theFromAngle,
58  const std::string& theSelectionType = std::string());
59 
61  FEATURESAPI_EXPORT
62  explicit FeaturesAPI_Revolution(const std::shared_ptr<ModelAPI_Feature>& theFeature,
63  const std::list<ModelHighAPI_Selection>& theBaseObjects,
64  const ModelHighAPI_Selection& theAxis,
65  const ModelHighAPI_Selection& theToObject,
66  const ModelHighAPI_Double& theToOffset,
67  const ModelHighAPI_Selection& theFromObject,
68  const ModelHighAPI_Double& theFromOffset,
69  const std::string& theSelectionType = std::string());
70 
72  FEATURESAPI_EXPORT
73  virtual ~FeaturesAPI_Revolution();
74 
75  INTERFACE_10(FeaturesPlugin_Revolution::ID(),
96 
97 
98  FEATURESAPI_EXPORT
99  void setNestedSketch(const ModelHighAPI_Reference& theSketch);
100 
102  FEATURESAPI_EXPORT
103  void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
104 
106  FEATURESAPI_EXPORT
107  void setAxis(const ModelHighAPI_Selection& theAxis);
108 
110  FEATURESAPI_EXPORT
111  void setAngles(const ModelHighAPI_Double& theToAngle,
112  const ModelHighAPI_Double& theFromAngle);
113 
115  FEATURESAPI_EXPORT
116  void setAngle(const ModelHighAPI_Double& theAngle);
117 
120  FEATURESAPI_EXPORT
121  void setPlanesAndOffsets(const ModelHighAPI_Selection& theToObject,
122  const ModelHighAPI_Double& theToOffset,
123  const ModelHighAPI_Selection& theFromObject,
124  const ModelHighAPI_Double& theFromOffset);
125 
127  FEATURESAPI_EXPORT
128  virtual void dump(ModelHighAPI_Dumper& theDumper) const;
129 
130 private:
131  void execIfBaseNotEmpty();
132 };
133 
135 typedef std::shared_ptr<FeaturesAPI_Revolution> RevolutionPtr;
136 
139 FEATURESAPI_EXPORT
140 RevolutionPtr addRevolution(const std::shared_ptr<ModelAPI_Document>& thePart,
141  const std::list<ModelHighAPI_Selection>& theBaseObjects,
142  const ModelHighAPI_Selection& theAxis,
143  const ModelHighAPI_Double& theAngle);
144 
147 FEATURESAPI_EXPORT
148 RevolutionPtr addRevolution(const std::shared_ptr<ModelAPI_Document>& thePart,
149  const std::list<ModelHighAPI_Selection>& theBaseObjects,
150  const ModelHighAPI_Selection& theAxis,
151  const ModelHighAPI_Double& theToAngle,
152  const ModelHighAPI_Double& theFromAngle,
153  const std::string& theSelectionType = std::string());
154 
157 FEATURESAPI_EXPORT
158 RevolutionPtr addRevolution(const std::shared_ptr<ModelAPI_Document>& thePart,
159  const std::list<ModelHighAPI_Selection>& theBaseObjects,
160  const ModelHighAPI_Selection& theAxis,
161  const ModelHighAPI_Selection& theToObject,
162  const ModelHighAPI_Double& theToOffset,
163  const ModelHighAPI_Selection& theFromObject,
164  const ModelHighAPI_Double& theFromOffset,
165  const std::string& theSelectionType = std::string());
166 
167 #endif // FeaturesAPI_Revolution_H_
Interface for Revolution feature.
Definition: FeaturesAPI_Revolution.h:38
virtual std::shared_ptr< ModelAPI_AttributeSelection > axis() const
Axis.
Definition: FeaturesAPI_Revolution.h:95
virtual std::shared_ptr< ModelAPI_AttributeDouble > toAngle() const
To angle.
Definition: FeaturesAPI_Revolution.h:95
void setBase(const std::list< ModelHighAPI_Selection > &theBaseObjects)
Modify base attribute of the feature.
Definition: FeaturesAPI_Revolution.cpp:116
virtual std::shared_ptr< ModelAPI_AttributeString > creationMethod() const
Creation method.
Definition: FeaturesAPI_Revolution.h:95
virtual std::shared_ptr< ModelAPI_AttributeDouble > fromAngle() const
From angle.
Definition: FeaturesAPI_Revolution.h:95
void setAxis(const ModelHighAPI_Selection &theAxis)
Modify axis_object attribute of the feature.
Definition: FeaturesAPI_Revolution.cpp:126
FeaturesAPI_Revolution(const std::shared_ptr< ModelAPI_Feature > &theFeature)
Constructor without values.
Definition: FeaturesAPI_Revolution.cpp:28
void setNestedSketch(const ModelHighAPI_Reference &theSketch)
Modify base attribute of the feature.
Definition: FeaturesAPI_Revolution.cpp:96
virtual std::shared_ptr< ModelAPI_AttributeSelection > toObject() const
To object.
Definition: FeaturesAPI_Revolution.h:95
void setAngles(const ModelHighAPI_Double &theToAngle, const ModelHighAPI_Double &theFromAngle)
Modify CreationMethod, to_angle, from_angle attributes of the feature.
Definition: FeaturesAPI_Revolution.cpp:134
virtual std::shared_ptr< ModelAPI_AttributeDouble > fromOffset() const
From offset.
Definition: FeaturesAPI_Revolution.h:95
virtual std::shared_ptr< ModelAPI_AttributeReference > sketch() const
Sketch launcher.
Definition: FeaturesAPI_Revolution.h:95
virtual ~FeaturesAPI_Revolution()
Destructor.
Definition: FeaturesAPI_Revolution.cpp:90
virtual std::shared_ptr< ModelAPI_AttributeDouble > toOffset() const
To offset.
Definition: FeaturesAPI_Revolution.h:95
void setPlanesAndOffsets(const ModelHighAPI_Selection &theToObject, const ModelHighAPI_Double &theToOffset, const ModelHighAPI_Selection &theFromObject, const ModelHighAPI_Double &theFromOffset)
Modify CreationMethod, to_object, to_offset, from_object, from_offset attributes of the feature.
Definition: FeaturesAPI_Revolution.cpp:151
void setAngle(const ModelHighAPI_Double &theAngle)
Modify CreationMethod, to_angle, from_angle attributes of the feature.
Definition: FeaturesAPI_Revolution.cpp:145
virtual void dump(ModelHighAPI_Dumper &theDumper) const
Dump wrapped feature.
Definition: FeaturesAPI_Revolution.cpp:166
virtual std::shared_ptr< ModelAPI_AttributeSelectionList > baseObjects() const
Base objects.
Definition: FeaturesAPI_Revolution.h:95
virtual std::shared_ptr< ModelAPI_AttributeSelection > fromObject() const
From object.
Definition: FeaturesAPI_Revolution.h:95
static const std::string & BASE_OBJECTS_ID()
Attribute name of base objects.
Definition: FeaturesPlugin_CompositeSketch.h:43
static const std::string & SKETCH_ID()
Attribute name of sketch feature.
Definition: FeaturesPlugin_CompositeSketch.h:36
static const std::string & ID()
Feature kind.
Definition: FeaturesPlugin_Revolution.h:38
static const std::string & TO_ANGLE_ID()
Attribute name of revolution to angle.
Definition: FeaturesPlugin_Revolution.h:80
static const std::string & CREATION_METHOD()
Attribute name for creation method.
Definition: FeaturesPlugin_Revolution.h:45
static const std::string & TO_OBJECT_ID()
Attribute name of an object to which the revolution grows.
Definition: FeaturesPlugin_Revolution.h:94
static const std::string & FROM_ANGLE_ID()
Attribute name of revolution from angle.
Definition: FeaturesPlugin_Revolution.h:87
static const std::string & FROM_OBJECT_ID()
Attribute name of an object from which the revolution grows.
Definition: FeaturesPlugin_Revolution.h:108
static const std::string & TO_OFFSET_ID()
Attribute name of revolution offset.
Definition: FeaturesPlugin_Revolution.h:101
static const std::string & FROM_OFFSET_ID()
Attribute name of revolution offset.
Definition: FeaturesPlugin_Revolution.h:115
static const std::string & AXIS_OBJECT_ID()
Attribute name of an revolution axis.
Definition: FeaturesPlugin_Revolution.h:73
Attribute that contains real value with double precision.
Definition: ModelAPI_AttributeDouble.h:34
Attribute that contains reference to feature (located in the same document).
Definition: ModelAPI_AttributeReference.h:32
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:52
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_AttributeReference.
Definition: ModelHighAPI_Reference.h:41
Class for filling ModelAPI_AttributeSelection.
Definition: ModelHighAPI_Selection.h:49
RevolutionPtr addRevolution(const std::shared_ptr< ModelAPI_Document > &thePart, const std::list< ModelHighAPI_Selection > &theBaseObjects, const ModelHighAPI_Selection &theAxis, const ModelHighAPI_Double &theAngle)
Create Revolution feature.
Definition: FeaturesAPI_Revolution.cpp:228