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
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 #ifndef FeaturesAPI_Revolution_H_
22 #define FeaturesAPI_Revolution_H_
24 #include "FeaturesAPI.h"
26 #include <FeaturesPlugin_Revolution.h>
28 #include <ModelHighAPI_Interface.h>
29 #include <ModelHighAPI_Macro.h>
31 class ModelHighAPI_Double;
32 class ModelHighAPI_Reference;
33 class ModelHighAPI_Selection;
35 /// \class FeaturesAPI_Revolution
36 /// \ingroup CPPHighAPI
37 /// \brief Interface for Revolution feature.
38 class FeaturesAPI_Revolution: public ModelHighAPI_Interface
41 /// Constructor without values.
43 explicit FeaturesAPI_Revolution(const std::shared_ptr<ModelAPI_Feature>& theFeature);
45 /// Constructor with values.
47 explicit FeaturesAPI_Revolution(const std::shared_ptr<ModelAPI_Feature>& theFeature,
48 const std::list<ModelHighAPI_Selection>& theBaseObjects,
49 const ModelHighAPI_Selection& theAxis,
50 const ModelHighAPI_Double& theAngle);
52 /// Constructor with values.
54 explicit FeaturesAPI_Revolution(const std::shared_ptr<ModelAPI_Feature>& theFeature,
55 const std::list<ModelHighAPI_Selection>& theBaseObjects,
56 const ModelHighAPI_Selection& theAxis,
57 const ModelHighAPI_Double& theToAngle,
58 const ModelHighAPI_Double& theFromAngle);
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);
72 virtual ~FeaturesAPI_Revolution();
74 INTERFACE_10(FeaturesPlugin_Revolution::ID(),
75 sketch, FeaturesPlugin_Revolution::SKETCH_ID(),
76 ModelAPI_AttributeReference, /** Sketch launcher */,
77 baseObjects, FeaturesPlugin_Revolution::BASE_OBJECTS_ID(),
78 ModelAPI_AttributeSelectionList, /** Base objects */,
79 axis, FeaturesPlugin_Revolution::AXIS_OBJECT_ID(),
80 ModelAPI_AttributeSelection, /** Axis */,
81 creationMethod, FeaturesPlugin_Revolution::CREATION_METHOD(),
82 ModelAPI_AttributeString, /** Creation method */,
83 toAngle, FeaturesPlugin_Revolution::TO_ANGLE_ID(),
84 ModelAPI_AttributeDouble, /** To angle */,
85 fromAngle, FeaturesPlugin_Revolution::FROM_ANGLE_ID(),
86 ModelAPI_AttributeDouble, /** From angle */,
87 toObject, FeaturesPlugin_Revolution::TO_OBJECT_ID(),
88 ModelAPI_AttributeSelection, /** To object */,
89 toOffset, FeaturesPlugin_Revolution::TO_OFFSET_ID(),
90 ModelAPI_AttributeDouble, /** To offset */,
91 fromObject, FeaturesPlugin_Revolution::FROM_OBJECT_ID(),
92 ModelAPI_AttributeSelection, /** From object */,
93 fromOffset, FeaturesPlugin_Revolution::FROM_OFFSET_ID(),
94 ModelAPI_AttributeDouble, /** From offset */)
96 /// Modify base attribute of the feature.
98 void setNestedSketch(const ModelHighAPI_Reference& theSketch);
100 /// Modify base attribute of the feature.
102 void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
104 /// Modify axis_object attribute of the feature.
106 void setAxis(const ModelHighAPI_Selection& theAxis);
108 /// Modify CreationMethod, to_angle, from_angle attributes of the feature.
110 void setAngles(const ModelHighAPI_Double& theToAngle,
111 const ModelHighAPI_Double& theFromAngle);
113 /// Modify CreationMethod, to_angle, from_angle attributes of the feature.
115 void setAngle(const ModelHighAPI_Double& theAngle);
117 /// Modify CreationMethod, to_object, to_offset,
118 /// from_object, from_offset attributes of the feature.
120 void setPlanesAndOffsets(const ModelHighAPI_Selection& theToObject,
121 const ModelHighAPI_Double& theToOffset,
122 const ModelHighAPI_Selection& theFromObject,
123 const ModelHighAPI_Double& theFromOffset);
125 /// Dump wrapped feature
127 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
130 void execIfBaseNotEmpty();
133 /// Pointer on Revolution object.
134 typedef std::shared_ptr<FeaturesAPI_Revolution> RevolutionPtr;
136 /// \ingroup CPPHighAPI
137 /// \brief Create Revolution feature.
139 RevolutionPtr addRevolution(const std::shared_ptr<ModelAPI_Document>& thePart,
140 const std::list<ModelHighAPI_Selection>& theBaseObjects,
141 const ModelHighAPI_Selection& theAxis,
142 const ModelHighAPI_Double& theAngle);
144 /// \ingroup CPPHighAPI
145 /// \brief Create Revolution feature.
147 RevolutionPtr addRevolution(const std::shared_ptr<ModelAPI_Document>& thePart,
148 const std::list<ModelHighAPI_Selection>& theBaseObjects,
149 const ModelHighAPI_Selection& theAxis,
150 const ModelHighAPI_Double& theToAngle,
151 const ModelHighAPI_Double& theFromAngle);
153 /// \ingroup CPPHighAPI
154 /// \brief Create Revolution feature.
156 RevolutionPtr addRevolution(const std::shared_ptr<ModelAPI_Document>& thePart,
157 const std::list<ModelHighAPI_Selection>& theBaseObjects,
158 const ModelHighAPI_Selection& theAxis,
159 const ModelHighAPI_Selection& theToObject,
160 const ModelHighAPI_Double& theToOffset,
161 const ModelHighAPI_Selection& theFromObject,
162 const ModelHighAPI_Double& theFromOffset);
164 #endif // FeaturesAPI_Revolution_H_