1 // Copyright (C) 2017-2023 CEA, EDF
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 PRIMITIVESAPI_TUBE_H_
21 #define PRIMITIVESAPI_TUBE_H_
23 #include "PrimitivesAPI.h"
25 #include <PrimitivesPlugin_Tube.h>
27 #include <ModelHighAPI_Double.h>
28 #include <ModelHighAPI_Interface.h>
29 #include <ModelHighAPI_Macro.h>
32 /// \class PrimitivesAPI_Tube
33 /// \ingroup CPPHighAPI
34 /// \brief Interface for primitive Tube feature.
35 class PrimitivesAPI_Tube: public ModelHighAPI_Interface
38 /// Constructor without values.
40 explicit PrimitivesAPI_Tube(const std::shared_ptr<ModelAPI_Feature>& theFeature);
42 /// Constructor with values.
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);
51 virtual ~PrimitivesAPI_Tube();
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 */)
63 void setRadius(const ModelHighAPI_Double& theRMin,
64 const ModelHighAPI_Double& theRMax);
68 void setHeight(const ModelHighAPI_Double& theHeight);
70 /// Dump wrapped feature
72 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
75 /// Pointer on primitive Tube object
76 typedef std::shared_ptr<PrimitivesAPI_Tube> TubePtr;
78 /// \ingroup CPPHighAPI
79 /// \brief Create primitive Tube feature.
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);
86 #endif // PRIMITIVESAPI_TUBE_H_