1 // Copyright (C) 2017-2022 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 // File: PrimitivesPlugin_Torus.h
21 // Created: 17 Mar 2017
22 // Author: Clarisse Genrault (CEA)
24 #ifndef PRIMITIVESPLUGIN_TORUS_H_
25 #define PRIMITIVESPLUGIN_TORUS_H_
27 #include <PrimitivesPlugin.h>
28 #include <ModelAPI_Feature.h>
29 #include <GeomAlgoAPI_Torus.h>
31 /**\class PrimitivesPlugin_Torus
33 * \brief Feature for creation of a torus.
35 * Creates a torus from a
37 class PrimitivesPlugin_Torus : public ModelAPI_Feature
41 inline static const std::string& ID()
43 static const std::string MY_TORUS_ID("Torus");
47 /// Attribute name of the base point
48 inline static const std::string& BASE_POINT_ID()
50 static const std::string MY_BASE_POINT_ID("base_point");
51 return MY_BASE_POINT_ID;
54 /// Attribute name of the axis
55 inline static const std::string& AXIS_ID()
57 static const std::string MY_AXIS_ID("axis");
61 /// Attribute name of the radius
62 inline static const std::string& RADIUS_ID()
64 static const std::string MY_RADIUS_ID("radius");
68 /// Attribute name of the section radius
69 inline static const std::string& RING_RADIUS_ID()
71 static const std::string MY_RING_RADIUS_ID("ring_radius");
72 return MY_RING_RADIUS_ID;
75 /// Returns the kind of a feature
76 PRIMITIVESPLUGIN_EXPORT virtual const std::string& getKind()
78 static std::string MY_KIND = PrimitivesPlugin_Torus::ID();
82 /// Creates a new part document if needed
83 PRIMITIVESPLUGIN_EXPORT virtual void execute();
85 /// Request for initialization of data model of the feature: adding all attributes
86 PRIMITIVESPLUGIN_EXPORT virtual void initAttributes();
88 /// Use plugin manager for features creation
89 PrimitivesPlugin_Torus();
92 /// Load Naming data structure of the feature to the document
93 void loadNamingDS(std::shared_ptr<GeomAlgoAPI_Torus> theTorusAlgo,
94 std::shared_ptr<ModelAPI_ResultBody> theResultTorus);
98 #endif // PRIMITIVESPLUGIN_TORUS_H_