SHAPER  9.12.0
PrimitivesPlugin_Tube.h
1 // Copyright (C) 2014-2023 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 PrimitivesPlugin_Tube_H_
21 #define PrimitivesPlugin_Tube_H_
22 
23 #include <GeomAlgoAPI_Tube.h>
24 #include <ModelAPI_Feature.h>
25 #include <PrimitivesPlugin.h>
26 
36 {
37  public:
39  inline static const std::string& ID()
40  {
41  static const std::string MY_TUBE_ID("Tube");
42  return MY_TUBE_ID;
43  }
44 
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 
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 
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 
67  PRIMITIVESPLUGIN_EXPORT virtual const std::string& getKind()
68  {
69  static std::string MY_KIND = PrimitivesPlugin_Tube::ID();
70  return MY_KIND;
71  }
72 
74  PRIMITIVESPLUGIN_EXPORT virtual void execute();
75 
77  PRIMITIVESPLUGIN_EXPORT virtual void initAttributes();
78 
81 
82  private:
84  void loadNamingDS(std::shared_ptr<GeomAlgoAPI_Tube> theTubeAlgo,
85  std::shared_ptr<ModelAPI_ResultBody> theResultBox);
86 };
87 
88 #endif
Feature function that represents the particular functionality of this operation.
Definition: ModelAPI_Feature.h:39
Feature for creation of a tube primitive using various methods.
Definition: PrimitivesPlugin_Tube.h:36
virtual PRIMITIVESPLUGIN_EXPORT void initAttributes()
Request for initialization of data model of the feature: adding all attributes.
Definition: PrimitivesPlugin_Tube.cpp:31
static const std::string & RMAX_ID()
Attrinute name of the outer radius.
Definition: PrimitivesPlugin_Tube.h:53
virtual PRIMITIVESPLUGIN_EXPORT void execute()
Performs the algorithm and stores results it in the data structure.
Definition: PrimitivesPlugin_Tube.cpp:39
static const std::string & RMIN_ID()
Attrinute name of the inner radius.
Definition: PrimitivesPlugin_Tube.h:46
static const std::string & ID()
Tube kind.
Definition: PrimitivesPlugin_Tube.h:39
static const std::string & HEIGHT_ID()
Attrinute name of the height.
Definition: PrimitivesPlugin_Tube.h:60
PrimitivesPlugin_Tube()
Use plugin manager for features creation.
Definition: PrimitivesPlugin_Tube.cpp:26
virtual PRIMITIVESPLUGIN_EXPORT const std::string & getKind()
Returns the kind of a feature.
Definition: PrimitivesPlugin_Tube.h:67