SHAPER 9.16.0
FeaturesPlugin_Revolution.h
1// Copyright (C) 2014-2026 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 FeaturesPlugin_Revolution_H_
21#define FeaturesPlugin_Revolution_H_
22
23#include "FeaturesPlugin.h"
24
25#include "FeaturesPlugin_CompositeSketch.h"
26
27#include <GeomAlgoAPI_MakeShape.h>
28
35{
36public:
38 inline static const std::string& ID()
39 {
40 static const std::string MY_ID("Revolution");
41 return MY_ID;
42 }
43
45 inline static const std::string& CREATION_METHOD()
46 {
47 static const std::string MY_CREATION_METHOD_ID("CreationMethod");
48 return MY_CREATION_METHOD_ID;
49 }
50
52 inline static const std::string& CREATION_METHOD_THROUGH_ALL()
53 {
54 static const std::string MY_CREATION_METHOD_THROUGH_ALL("ThroughAll");
55 return MY_CREATION_METHOD_THROUGH_ALL;
56 }
57
59 inline static const std::string& CREATION_METHOD_BY_ANGLES()
60 {
61 static const std::string MY_CREATION_METHOD_BY_ANGLES("ByAngles");
62 return MY_CREATION_METHOD_BY_ANGLES;
63 }
64
66 inline static const std::string& CREATION_METHOD_BY_PLANES()
67 {
68 static const std::string MY_CREATION_METHOD_BY_PLANES("ByPlanesAndOffsets");
69 return MY_CREATION_METHOD_BY_PLANES;
70 }
71
73 inline static const std::string& AXIS_OBJECT_ID()
74 {
75 static const std::string MY_AXIS_OBJECT_ID("axis_object");
76 return MY_AXIS_OBJECT_ID;
77 }
78
80 inline static const std::string& TO_ANGLE_ID()
81 {
82 static const std::string MY_TO_ANGLE_ID("to_angle");
83 return MY_TO_ANGLE_ID;
84 }
85
87 inline static const std::string& FROM_ANGLE_ID()
88 {
89 static const std::string MY_FROM_ANGLE_ID("from_angle");
90 return MY_FROM_ANGLE_ID;
91 }
92
94 inline static const std::string& TO_OBJECT_ID()
95 {
96 static const std::string MY_TO_OBJECT_ID("to_object");
97 return MY_TO_OBJECT_ID;
98 }
99
101 inline static const std::string& TO_OFFSET_ID()
102 {
103 static const std::string MY_TO_OFFSET_ID("to_offset");
104 return MY_TO_OFFSET_ID;
105 }
106
108 inline static const std::string& FROM_OBJECT_ID()
109 {
110 static const std::string MY_FROM_OBJECT_ID("from_object");
111 return MY_FROM_OBJECT_ID;
112 }
113
115 inline static const std::string& FROM_OFFSET_ID()
116 {
117 static const std::string MY_FROM_OFFSET_ID("from_offset");
118 return MY_FROM_OFFSET_ID;
119 }
120
122 FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
123 {
124 static std::string MY_KIND = FeaturesPlugin_Revolution::ID();
125 return MY_KIND;
126 }
127
129 FEATURESPLUGIN_EXPORT virtual void execute();
130
132 FEATURESPLUGIN_EXPORT virtual void initAttributes();
133
136
137 protected:
142 bool makeRevolutions(ListOfShape& theBaseShapes,
143 ListOfMakeShape& theMakeShapes);
144};
145
146#endif
Interface for the composite sketch feature.
Definition: FeaturesPlugin_CompositeSketch.h:33
Feature for creation of revolution from the planar face.
Definition: FeaturesPlugin_Revolution.h:35
static const std::string & CREATION_METHOD_THROUGH_ALL()
Attribute name for creation method.
Definition: FeaturesPlugin_Revolution.h:52
bool makeRevolutions(ListOfShape &theBaseShapes, ListOfMakeShape &theMakeShapes)
Generates revolutions.
Definition: FeaturesPlugin_Revolution.cpp:88
static const std::string & FROM_ANGLE_ID()
Attribute name of revolution from angle.
Definition: FeaturesPlugin_Revolution.h:87
static const std::string & ID()
Feature kind.
Definition: FeaturesPlugin_Revolution.h:38
virtual void initAttributes()
Request for initialization of data model of the feature: adding all attributes.
Definition: FeaturesPlugin_Revolution.cpp:41
static const std::string & TO_ANGLE_ID()
Attribute name of revolution to angle.
Definition: FeaturesPlugin_Revolution.h:80
virtual const std::string & getKind()
Definition: FeaturesPlugin_Revolution.h:122
static const std::string & TO_OFFSET_ID()
Attribute name of revolution offset.
Definition: FeaturesPlugin_Revolution.h:101
static const std::string & CREATION_METHOD_BY_PLANES()
Attribute name for creation method.
Definition: FeaturesPlugin_Revolution.h:66
static const std::string & FROM_OFFSET_ID()
Attribute name of revolution offset.
Definition: FeaturesPlugin_Revolution.h:115
FeaturesPlugin_Revolution()
Use plugin manager for features creation.
Definition: FeaturesPlugin_Revolution.cpp:36
static const std::string & AXIS_OBJECT_ID()
Attribute name of an revolution axis.
Definition: FeaturesPlugin_Revolution.h:73
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 & CREATION_METHOD_BY_ANGLES()
Attribute name for creation method.
Definition: FeaturesPlugin_Revolution.h:59
static const std::string & CREATION_METHOD()
Attribute name for creation method.
Definition: FeaturesPlugin_Revolution.h:45
virtual void execute()
Performs the algorithm and stores results it in the data structure.
Definition: FeaturesPlugin_Revolution.cpp:65
static const std::string & FROM_OBJECT_ID()
Attribute name of an object from which the revolution grows.
Definition: FeaturesPlugin_Revolution.h:108