]> SALOME platform Git repositories - modules/shaper.git/blob - src/PrimitivesAPI/PrimitivesAPI_Cone.h
Salome HOME
Task #2924 : Ability to remove a result. Disable ability to remove groups and fields...
[modules/shaper.git] / src / PrimitivesAPI / PrimitivesAPI_Cone.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_Cone.h
21 // Created:     20 Mar 2017
22 // Author:      Clarisse Genrault
23
24 #ifndef PRIMITIVESAPI_CONE_H_
25 #define PRIMITIVESAPI_CONE_H_
26
27 #include "PrimitivesAPI.h"
28
29 #include <PrimitivesPlugin_Cone.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_Cone
38 /// \ingroup CPPHighAPI
39 /// \brief Interface for primitive Cone feature.
40 class PrimitivesAPI_Cone: public ModelHighAPI_Interface
41 {
42 public:
43   /// Constructor without values.
44   PRIMITIVESAPI_EXPORT
45   explicit PrimitivesAPI_Cone(const std::shared_ptr<ModelAPI_Feature>& theFeature);
46
47   /// Constructor with values.
48   PRIMITIVESAPI_EXPORT
49   explicit PrimitivesAPI_Cone(const std::shared_ptr<ModelAPI_Feature>& theFeature,
50                               const ModelHighAPI_Selection& theBasePoint,
51                               const ModelHighAPI_Selection& theAxis,
52                               const ModelHighAPI_Double& theBaseRadius,
53                               const ModelHighAPI_Double& theTopRadius,
54                               const ModelHighAPI_Double& theHeight);
55
56   /// Destructor.
57   PRIMITIVESAPI_EXPORT
58   virtual ~PrimitivesAPI_Cone();
59
60   INTERFACE_5(PrimitivesPlugin_Cone::ID(),
61              basePoint, PrimitivesPlugin_Cone::BASE_POINT_ID(),
62              ModelAPI_AttributeSelection, /** Base point */,
63              axis, PrimitivesPlugin_Cone::AXIS_ID(),
64              ModelAPI_AttributeSelection, /** Axis */,
65              baseRadius, PrimitivesPlugin_Cone::BASE_RADIUS_ID(),
66              ModelAPI_AttributeDouble, /** Base radius */,
67              topRadius, PrimitivesPlugin_Cone::TOP_RADIUS_ID(),
68              ModelAPI_AttributeDouble, /** Top radius */,
69              height, PrimitivesPlugin_Cone::HEIGHT_ID(),
70              ModelAPI_AttributeDouble, /** Height */)
71
72   /// Set radius
73   PRIMITIVESAPI_EXPORT
74   void setRadius(const ModelHighAPI_Double& theBaseRadius,
75                  const ModelHighAPI_Double& theTopRadius);
76
77   /// Set height
78   PRIMITIVESAPI_EXPORT
79   void setHeight(const ModelHighAPI_Double& theHeight);
80
81   /// Dump wrapped feature
82   PRIMITIVESAPI_EXPORT
83   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
84 };
85
86 /// Pointer on primitive Cone object
87 typedef std::shared_ptr<PrimitivesAPI_Cone> ConePtr;
88
89 /// \ingroup CPPHighAPI
90 /// \brief Create primitive Cone feature.
91 PRIMITIVESAPI_EXPORT
92 ConePtr addCone(const std::shared_ptr<ModelAPI_Document>& thePart,
93                 const ModelHighAPI_Selection& theBasePoint,
94                 const ModelHighAPI_Selection& theAxis,
95                 const ModelHighAPI_Double& theBaseRadius,
96                 const ModelHighAPI_Double& theTopRadius,
97                 const ModelHighAPI_Double& theHeight);
98
99 /// \ingroup CPPHighAPI
100 /// \brief Create primitive Cone feature.
101 PRIMITIVESAPI_EXPORT
102 ConePtr addCone(const std::shared_ptr<ModelAPI_Document>& thePart,
103                 const ModelHighAPI_Double& theBaseRadius,
104                 const ModelHighAPI_Double& theTopRadius,
105                 const ModelHighAPI_Double& theHeight);
106
107 #endif // PRIMITIVESAPI_CONE_H_