1 // Copyright (C) 2014-2020 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef FeaturesAPI_Revolution_H_
21 #define FeaturesAPI_Revolution_H_
23 #include "FeaturesAPI.h"
25 #include <FeaturesPlugin_Revolution.h>
27 #include <ModelHighAPI_Interface.h>
28 #include <ModelHighAPI_Macro.h>
30 class ModelHighAPI_Double;
31 class ModelHighAPI_Reference;
32 class ModelHighAPI_Selection;
34 /// \class FeaturesAPI_Revolution
35 /// \ingroup CPPHighAPI
36 /// \brief Interface for Revolution feature.
37 class FeaturesAPI_Revolution: public ModelHighAPI_Interface
40 /// Constructor without values.
42 explicit FeaturesAPI_Revolution(const std::shared_ptr<ModelAPI_Feature>& theFeature);
44 /// Constructor with values.
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);
51 /// Constructor with values.
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());
60 /// Constructor with values.
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());
73 virtual ~FeaturesAPI_Revolution();
75 INTERFACE_10(FeaturesPlugin_Revolution::ID(),
76 sketch, FeaturesPlugin_Revolution::SKETCH_ID(),
77 ModelAPI_AttributeReference, /** Sketch launcher */,
78 baseObjects, FeaturesPlugin_Revolution::BASE_OBJECTS_ID(),
79 ModelAPI_AttributeSelectionList, /** Base objects */,
80 axis, FeaturesPlugin_Revolution::AXIS_OBJECT_ID(),
81 ModelAPI_AttributeSelection, /** Axis */,
82 creationMethod, FeaturesPlugin_Revolution::CREATION_METHOD(),
83 ModelAPI_AttributeString, /** Creation method */,
84 toAngle, FeaturesPlugin_Revolution::TO_ANGLE_ID(),
85 ModelAPI_AttributeDouble, /** To angle */,
86 fromAngle, FeaturesPlugin_Revolution::FROM_ANGLE_ID(),
87 ModelAPI_AttributeDouble, /** From angle */,
88 toObject, FeaturesPlugin_Revolution::TO_OBJECT_ID(),
89 ModelAPI_AttributeSelection, /** To object */,
90 toOffset, FeaturesPlugin_Revolution::TO_OFFSET_ID(),
91 ModelAPI_AttributeDouble, /** To offset */,
92 fromObject, FeaturesPlugin_Revolution::FROM_OBJECT_ID(),
93 ModelAPI_AttributeSelection, /** From object */,
94 fromOffset, FeaturesPlugin_Revolution::FROM_OFFSET_ID(),
95 ModelAPI_AttributeDouble, /** From offset */)
97 /// Modify base attribute of the feature.
99 void setNestedSketch(const ModelHighAPI_Reference& theSketch);
101 /// Modify base attribute of the feature.
103 void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
105 /// Modify axis_object attribute of the feature.
107 void setAxis(const ModelHighAPI_Selection& theAxis);
109 /// Modify CreationMethod, to_angle, from_angle attributes of the feature.
111 void setAngles(const ModelHighAPI_Double& theToAngle,
112 const ModelHighAPI_Double& theFromAngle);
114 /// Modify CreationMethod, to_angle, from_angle attributes of the feature.
116 void setAngle(const ModelHighAPI_Double& theAngle);
118 /// Modify CreationMethod, to_object, to_offset,
119 /// from_object, from_offset attributes of the feature.
121 void setPlanesAndOffsets(const ModelHighAPI_Selection& theToObject,
122 const ModelHighAPI_Double& theToOffset,
123 const ModelHighAPI_Selection& theFromObject,
124 const ModelHighAPI_Double& theFromOffset);
126 /// Dump wrapped feature
128 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
131 void execIfBaseNotEmpty();
134 /// Pointer on Revolution object.
135 typedef std::shared_ptr<FeaturesAPI_Revolution> RevolutionPtr;
137 /// \ingroup CPPHighAPI
138 /// \brief Create Revolution feature.
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);
145 /// \ingroup CPPHighAPI
146 /// \brief Create Revolution feature.
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());
155 /// \ingroup CPPHighAPI
156 /// \brief Create Revolution feature.
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());
167 #endif // FeaturesAPI_Revolution_H_