]> SALOME platform Git repositories - modules/shaper.git/blob - src/PrimitivesAPI/PrimitivesAPI_Torus.h
Salome HOME
Task #2924 : Ability to remove a result. Disable ability to remove groups and fields...
[modules/shaper.git] / src / PrimitivesAPI / PrimitivesAPI_Torus.h
1 // Copyright (C) 2017-2019  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 email : webmaster.salome@opencascade.com
18 //
19
20 // File:        PrimitivesAPI_Torus.h
21 // Created:     20 Mar 2017
22 // Author:      Clarisse Genrault
23
24 #ifndef PRIMITIVESAPI_TORUS_H_
25 #define PRIMITIVESAPI_TORUS_H_
26
27 #include "PrimitivesAPI.h"
28
29 #include <PrimitivesPlugin_Torus.h>
30
31 #include <ModelHighAPI_Interface.h>
32 #include <ModelHighAPI_Macro.h>
33
34 class ModelHighAPI_Double;
35 class ModelHighAPI_Selection;
36
37 /// \class PrimitivesAPI_Torus
38 /// \ingroup CPPHighAPI
39 /// \brief Interface for primitive Cone feature.
40 class PrimitivesAPI_Torus: public ModelHighAPI_Interface
41 {
42 public:
43   /// Constructor without values.
44   PRIMITIVESAPI_EXPORT
45   explicit PrimitivesAPI_Torus(const std::shared_ptr<ModelAPI_Feature>& theFeature);
46
47   /// Constructor with values.
48   PRIMITIVESAPI_EXPORT
49   explicit PrimitivesAPI_Torus(const std::shared_ptr<ModelAPI_Feature>& theFeature,
50                                const ModelHighAPI_Selection& theBasePoint,
51                                const ModelHighAPI_Selection& theAxis,
52                                const ModelHighAPI_Double& theRadius,
53                                const ModelHighAPI_Double& theRingRadius);
54
55   /// Destructor.
56   PRIMITIVESAPI_EXPORT
57   virtual ~PrimitivesAPI_Torus();
58
59   INTERFACE_4(PrimitivesPlugin_Torus::ID(),
60              basePoint, PrimitivesPlugin_Torus::BASE_POINT_ID(),
61              ModelAPI_AttributeSelection, /** Base point */,
62              axis, PrimitivesPlugin_Torus::AXIS_ID(),
63              ModelAPI_AttributeSelection, /** Axis */,
64              radius, PrimitivesPlugin_Torus::RADIUS_ID(),
65              ModelAPI_AttributeDouble, /** Radius */,
66              ringRadius, PrimitivesPlugin_Torus::RING_RADIUS_ID(),
67              ModelAPI_AttributeDouble, /** Ring radius */)
68
69   /// Set radius
70   PRIMITIVESAPI_EXPORT
71   void setRadius(const ModelHighAPI_Double& theRadius,
72                  const ModelHighAPI_Double& theRingRadius);
73
74   /// Dump wrapped feature
75   PRIMITIVESAPI_EXPORT
76   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
77 };
78
79 /// Pointer on primitive Cone object
80 typedef std::shared_ptr<PrimitivesAPI_Torus> TorusPtr;
81
82 /// \ingroup CPPHighAPI
83 /// \brief Create primitive Cone feature.
84 PRIMITIVESAPI_EXPORT
85 TorusPtr addTorus(const std::shared_ptr<ModelAPI_Document>& thePart,
86                   const ModelHighAPI_Selection& theBasePoint,
87                   const ModelHighAPI_Selection& theAxis,
88                   const ModelHighAPI_Double& theRadius,
89                   const ModelHighAPI_Double& theRingRadius);
90
91 /// \ingroup CPPHighAPI
92 /// \brief Create primitive Cone feature.
93 PRIMITIVESAPI_EXPORT
94 TorusPtr addTorus(const std::shared_ptr<ModelAPI_Document>& thePart,
95                   const ModelHighAPI_Double& theRadius,
96                   const ModelHighAPI_Double& theRingRadius);
97
98 #endif // PRIMITIVESAPI_TORUS_H_