1 // Copyright (C) 2014-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 #ifndef PrimitivesPlugin_Tube_H_
21 #define PrimitivesPlugin_Tube_H_
23 #include <GeomAlgoAPI_Tube.h>
24 #include <ModelAPI_Feature.h>
25 #include <PrimitivesPlugin.h>
27 /**\class PrimitivesPlugin_Tube
29 * \brief Feature for creation of a tube primitive using various methods.
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)
35 class PrimitivesPlugin_Tube : public ModelAPI_Feature
39 inline static const std::string& ID()
41 static const std::string MY_TUBE_ID("Tube");
45 /// Attrinute name of the inner radius
46 inline static const std::string& RMIN_ID()
48 static const std::string MY_RMIN_ID("rmin");
52 /// Attrinute name of the outer radius
53 inline static const std::string& RMAX_ID()
55 static const std::string MY_RMAX_ID("rmax");
59 /// Attrinute name of the height
60 inline static const std::string& HEIGHT_ID()
62 static const std::string MY_HEIGHT_ID("height");
66 /// Returns the kind of a feature
67 PRIMITIVESPLUGIN_EXPORT virtual const std::string& getKind()
69 static std::string MY_KIND = PrimitivesPlugin_Tube::ID();
73 /// Performs the algorithm and stores results it in the data structure
74 PRIMITIVESPLUGIN_EXPORT virtual void execute();
76 /// Request for initialization of data model of the feature: adding all attributes
77 PRIMITIVESPLUGIN_EXPORT virtual void initAttributes();
79 /// Use plugin manager for features creation.
80 PrimitivesPlugin_Tube();
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);