Salome HOME
Copyright update 2022
[modules/shaper.git] / src / PrimitivesPlugin / PrimitivesPlugin_Tube.h
1 // Copyright (C) 2014-2022  CEA/DEN, EDF R&D
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 PrimitivesPlugin_Tube_H_
21 #define PrimitivesPlugin_Tube_H_
22
23 #include <GeomAlgoAPI_Tube.h>
24 #include <ModelAPI_Feature.h>
25 #include <PrimitivesPlugin.h>
26
27 /**\class PrimitivesPlugin_Tube
28  * \ingroup Plugins
29  * \brief Feature for creation of a tube primitive using various methods.
30  *
31  * Tube creates a tuboid - Holed cylinder. It can be built via two methods : 
32  * using an inner raidus, an outer radius and a heigth or radii (inner and outer)
33  * and angles.
34  */
35 class PrimitivesPlugin_Tube : public ModelAPI_Feature
36 {
37  public:
38   /// Tube kind
39   inline static const std::string& ID()
40   {
41     static const std::string MY_TUBE_ID("Tube");
42     return MY_TUBE_ID;
43   }
44
45   /// Attrinute name of the inner radius
46   inline static const std::string& RMIN_ID()
47   {
48     static const std::string MY_RMIN_ID("rmin");
49     return MY_RMIN_ID;
50   }
51
52   /// Attrinute name of the outer radius
53   inline static const std::string& RMAX_ID()
54   {
55     static const std::string MY_RMAX_ID("rmax");
56     return MY_RMAX_ID;
57   }
58
59   /// Attrinute name of the height
60   inline static const std::string& HEIGHT_ID()
61   {
62     static const std::string MY_HEIGHT_ID("height");
63     return MY_HEIGHT_ID;
64   }
65
66   /// Returns the kind of a feature
67   PRIMITIVESPLUGIN_EXPORT virtual const std::string& getKind()
68   {
69     static std::string MY_KIND = PrimitivesPlugin_Tube::ID();
70     return MY_KIND;
71   }
72
73   /// Performs the algorithm and stores results it in the data structure
74   PRIMITIVESPLUGIN_EXPORT virtual void execute();
75
76   /// Request for initialization of data model of the feature: adding all attributes
77   PRIMITIVESPLUGIN_EXPORT virtual void initAttributes();
78
79   /// Use plugin manager for features creation.
80   PrimitivesPlugin_Tube();
81
82  private:
83   /// Load naming data structure of the feature to the document
84   void loadNamingDS(std::shared_ptr<GeomAlgoAPI_Tube> theTubeAlgo,
85                     std::shared_ptr<ModelAPI_ResultBody> theResultBox);
86 };
87
88 #endif