Salome HOME
Updated copyright comment
[modules/shaper.git] / src / PrimitivesAPI / PrimitivesAPI_Tube.h
1 // Copyright (C) 2017-2024  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 PRIMITIVESAPI_TUBE_H_
21 #define PRIMITIVESAPI_TUBE_H_
22
23 #include "PrimitivesAPI.h"
24
25 #include <PrimitivesPlugin_Tube.h>
26
27 #include <ModelHighAPI_Double.h>
28 #include <ModelHighAPI_Interface.h>
29 #include <ModelHighAPI_Macro.h>
30
31
32 /// \class PrimitivesAPI_Tube
33 /// \ingroup CPPHighAPI
34 /// \brief Interface for primitive Tube feature.
35 class PrimitivesAPI_Tube: public ModelHighAPI_Interface
36 {
37 public:
38   /// Constructor without values.
39   PRIMITIVESAPI_EXPORT
40   explicit PrimitivesAPI_Tube(const std::shared_ptr<ModelAPI_Feature>& theFeature);
41
42   /// Constructor with values.
43   PRIMITIVESAPI_EXPORT
44   explicit PrimitivesAPI_Tube(const std::shared_ptr<ModelAPI_Feature>& theFeature,
45                               const ModelHighAPI_Double& theRMin,
46                               const ModelHighAPI_Double& theRMax,
47                               const ModelHighAPI_Double& theHeight);
48
49   /// Destructor.
50   PRIMITIVESAPI_EXPORT
51   virtual ~PrimitivesAPI_Tube();
52
53   INTERFACE_3(PrimitivesPlugin_Tube::ID(),
54               rmin, PrimitivesPlugin_Tube::RMIN_ID(),
55               ModelAPI_AttributeDouble, /** Inner radius */,
56               rmax, PrimitivesPlugin_Tube::RMAX_ID(),
57               ModelAPI_AttributeDouble, /** Outer radius */,
58               height, PrimitivesPlugin_Tube::HEIGHT_ID(),
59               ModelAPI_AttributeDouble, /** Height */)
60
61   /// Set radius
62   PRIMITIVESAPI_EXPORT
63   void setRadius(const ModelHighAPI_Double& theRMin,
64                  const ModelHighAPI_Double& theRMax);
65
66   /// Set height
67   PRIMITIVESAPI_EXPORT
68   void setHeight(const ModelHighAPI_Double& theHeight);
69
70   /// Dump wrapped feature
71   PRIMITIVESAPI_EXPORT
72   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
73 };
74
75 /// Pointer on primitive Tube object
76 typedef std::shared_ptr<PrimitivesAPI_Tube> TubePtr;
77
78 /// \ingroup CPPHighAPI
79 /// \brief Create primitive Tube feature.
80 PRIMITIVESAPI_EXPORT
81 TubePtr addTube(const std::shared_ptr<ModelAPI_Document>& thePart,
82                 const ModelHighAPI_Double& theRMin,
83                 const ModelHighAPI_Double& theRMax,
84                 const ModelHighAPI_Double& theHeight);
85
86 #endif // PRIMITIVESAPI_TUBE_H_