1 // Copyright (C) 2014-2017 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<mailto: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);
59 /// Constructor with values.
61 explicit FeaturesAPI_Revolution(const std::shared_ptr<ModelAPI_Feature>& theFeature,
62 const std::list<ModelHighAPI_Selection>& theBaseObjects,
63 const ModelHighAPI_Selection& theAxis,
64 const ModelHighAPI_Selection& theToObject,
65 const ModelHighAPI_Double& theToOffset,
66 const ModelHighAPI_Selection& theFromObject,
67 const ModelHighAPI_Double& theFromOffset);
71 virtual ~FeaturesAPI_Revolution();
73 INTERFACE_10(FeaturesPlugin_Revolution::ID(),
74 sketch, FeaturesPlugin_Revolution::SKETCH_ID(),
75 ModelAPI_AttributeReference, /** Sketch launcher */,
76 baseObjects, FeaturesPlugin_Revolution::BASE_OBJECTS_ID(),
77 ModelAPI_AttributeSelectionList, /** Base objects */,
78 axis, FeaturesPlugin_Revolution::AXIS_OBJECT_ID(),
79 ModelAPI_AttributeSelection, /** Axis */,
80 creationMethod, FeaturesPlugin_Revolution::CREATION_METHOD(),
81 ModelAPI_AttributeString, /** Creation method */,
82 toAngle, FeaturesPlugin_Revolution::TO_ANGLE_ID(),
83 ModelAPI_AttributeDouble, /** To angle */,
84 fromAngle, FeaturesPlugin_Revolution::FROM_ANGLE_ID(),
85 ModelAPI_AttributeDouble, /** From angle */,
86 toObject, FeaturesPlugin_Revolution::TO_OBJECT_ID(),
87 ModelAPI_AttributeSelection, /** To object */,
88 toOffset, FeaturesPlugin_Revolution::TO_OFFSET_ID(),
89 ModelAPI_AttributeDouble, /** To offset */,
90 fromObject, FeaturesPlugin_Revolution::FROM_OBJECT_ID(),
91 ModelAPI_AttributeSelection, /** From object */,
92 fromOffset, FeaturesPlugin_Revolution::FROM_OFFSET_ID(),
93 ModelAPI_AttributeDouble, /** From offset */)
95 /// Modify base attribute of the feature.
97 void setNestedSketch(const ModelHighAPI_Reference& theSketch);
99 /// Modify base attribute of the feature.
101 void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
103 /// Modify axis_object attribute of the feature.
105 void setAxis(const ModelHighAPI_Selection& theAxis);
107 /// Modify CreationMethod, to_angle, from_angle attributes of the feature.
109 void setAngles(const ModelHighAPI_Double& theToAngle,
110 const ModelHighAPI_Double& theFromAngle);
112 /// Modify CreationMethod, to_angle, from_angle attributes of the feature.
114 void setAngle(const ModelHighAPI_Double& theAngle);
116 /// Modify CreationMethod, to_object, to_offset,
117 /// from_object, from_offset attributes of the feature.
119 void setPlanesAndOffsets(const ModelHighAPI_Selection& theToObject,
120 const ModelHighAPI_Double& theToOffset,
121 const ModelHighAPI_Selection& theFromObject,
122 const ModelHighAPI_Double& theFromOffset);
124 /// Dump wrapped feature
126 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
129 void execIfBaseNotEmpty();
132 /// Pointer on Revolution object.
133 typedef std::shared_ptr<FeaturesAPI_Revolution> RevolutionPtr;
135 /// \ingroup CPPHighAPI
136 /// \brief Create Revolution feature.
138 RevolutionPtr addRevolution(const std::shared_ptr<ModelAPI_Document>& thePart,
139 const std::list<ModelHighAPI_Selection>& theBaseObjects,
140 const ModelHighAPI_Selection& theAxis,
141 const ModelHighAPI_Double& theAngle);
143 /// \ingroup CPPHighAPI
144 /// \brief Create Revolution feature.
146 RevolutionPtr addRevolution(const std::shared_ptr<ModelAPI_Document>& thePart,
147 const std::list<ModelHighAPI_Selection>& theBaseObjects,
148 const ModelHighAPI_Selection& theAxis,
149 const ModelHighAPI_Double& theToAngle,
150 const ModelHighAPI_Double& theFromAngle);
152 /// \ingroup CPPHighAPI
153 /// \brief Create Revolution feature.
155 RevolutionPtr addRevolution(const std::shared_ptr<ModelAPI_Document>& thePart,
156 const std::list<ModelHighAPI_Selection>& theBaseObjects,
157 const ModelHighAPI_Selection& theAxis,
158 const ModelHighAPI_Selection& theToObject,
159 const ModelHighAPI_Double& theToOffset,
160 const ModelHighAPI_Selection& theFromObject,
161 const ModelHighAPI_Double& theFromOffset);
163 #endif // FeaturesAPI_Revolution_H_