Salome HOME
Add copyright header according to request of CEA from 06.06.2017
[modules/shaper.git] / src / GDMLPlugin / GDMLPlugin_ConeSegment.h
1 // Copyright (C) 2014-2017  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
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
19 //
20
21 #ifndef GDMLPLUGIN_CONESEGMENT_H_
22 #define GDMLPLUGIN_CONESEGMENT_H_
23
24 #include <GDMLPlugin.h>
25 #include <ModelAPI_Feature.h>
26 #include <GeomAlgoAPI_ConeSegment.h>
27
28 class GeomAPI_Shape;
29 class ModelAPI_ResultBody;
30
31 /**\class GDMLPlugin_ConeSegment
32  * \ingroup Plugins
33  * \brief Feature for creation of a GDML ConeSegment solid.
34  */
35 class GDMLPlugin_ConeSegment : public ModelAPI_Feature
36 {
37  public:
38   /// Cone segment kind
39   inline static const std::string& ID()
40   {
41     static const std::string MY_CONESEGMENT_ID("ConeSegment");
42     return MY_CONESEGMENT_ID;
43   }
44   /// attribute name of the inner radius at base of cone
45   inline static const std::string& RMIN1_ID()
46   {
47     static const std::string MY_RMIN1_ID("rmin1");
48     return MY_RMIN1_ID;
49   }
50   /// attribute name of the outer radius at base of cone
51   inline static const std::string& RMAX1_ID()
52   {
53     static const std::string MY_RMAX1_ID("rmax1");
54     return MY_RMAX1_ID;
55   }
56   /// attribute name of the inner radius at top of cone
57   inline static const std::string& RMIN2_ID()
58   {
59     static const std::string MY_RMIN2_ID("rmin2");
60     return MY_RMIN2_ID;
61   }
62   /// attribute name of the outer radius at top of cone
63   inline static const std::string& RMAX2_ID()
64   {
65     static const std::string MY_RMAX2_ID("rmax2");
66     return MY_RMAX2_ID;
67   }
68   /// attribute name of the height of the cone segment
69   inline static const std::string& Z_ID()
70   {
71     static const std::string MY_Z_ID("z");
72     return MY_Z_ID;
73   }
74   /// attribute name of the start angle of the segment
75   inline static const std::string& STARTPHI_ID()
76   {
77     static const std::string MY_STARTPHI_ID("startphi");
78     return MY_STARTPHI_ID;
79   }
80   /// attribute name of the angle of the segment
81   inline static const std::string& DELTAPHI_ID()
82   {
83     static const std::string MY_DELTAPHI_ID("deltaphi");
84     return MY_DELTAPHI_ID;
85   }
86
87   /// Returns the kind of a feature
88   GDMLPLUGIN_EXPORT virtual const std::string& getKind()
89   {
90     static std::string MY_KIND = GDMLPlugin_ConeSegment::ID();
91     return MY_KIND;
92   }
93
94   /// Creates a new part document if needed
95   GDMLPLUGIN_EXPORT virtual void execute();
96
97   /// Request for initialization of data model of the feature: adding all attributes
98   GDMLPLUGIN_EXPORT virtual void initAttributes();
99
100   /// Use plugin manager for features creation
101   GDMLPlugin_ConeSegment();
102
103  private:
104   /// Load Naming data structure of the feature to the document
105   void loadNamingDS(std::shared_ptr<GeomAlgoAPI_ConeSegment> theConeSegmentAlgo,
106                     std::shared_ptr<ModelAPI_ResultBody> theResultConeSegment);
107
108 };
109
110 #endif // GDMLPLUGIN_CONESEGMENT_H_