Salome HOME
Merge branch 'master' into cgt/devCEA
[modules/shaper.git] / src / PrimitivesAPI / PrimitivesAPI_Cone.h
1 // Copyright (C) 2014-201x CEA/DEN, EDF R&D -->
2
3 // File:        PrimitivesAPI_Cone.h
4 // Created:     20 Mar 2017
5 // Author:      Clarisse Genrault
6
7 #ifndef PRIMITIVESAPI_CONE_H_
8 #define PRIMITIVESAPI_CONE_H_
9
10 #include "PrimitivesAPI.h"
11
12 #include <PrimitivesPlugin_Cone.h>
13
14 #include <ModelHighAPI_Interface.h>
15 #include <ModelHighAPI_Macro.h>
16
17 class ModelHighAPI_Double;
18 class ModelHighAPI_Selection;
19
20 /// \class PrimitivesAPI_Cone
21 /// \ingroup CPPHighAPI
22 /// \brief Interface for primitive Cone feature.
23 class PrimitivesAPI_Cone: public ModelHighAPI_Interface
24 {
25 public:
26   /// Constructor without values.
27   PRIMITIVESAPI_EXPORT
28   explicit PrimitivesAPI_Cone(const std::shared_ptr<ModelAPI_Feature>& theFeature);
29
30   /// Constructor with values.
31   PRIMITIVESAPI_EXPORT
32   explicit PrimitivesAPI_Cone(const std::shared_ptr<ModelAPI_Feature>& theFeature,
33                               const ModelHighAPI_Selection& theBasePoint,
34                               const ModelHighAPI_Selection& theAxis,
35                               const ModelHighAPI_Double& theBaseRadius,
36                               const ModelHighAPI_Double& theTopRadius,
37                               const ModelHighAPI_Double& theHeight);
38
39   /// Destructor.
40   PRIMITIVESAPI_EXPORT
41   virtual ~PrimitivesAPI_Cone();
42
43   INTERFACE_5(PrimitivesPlugin_Cone::ID(),
44              basePoint, PrimitivesPlugin_Cone::BASE_POINT_ID(),
45              ModelAPI_AttributeSelection, /** Base point */,
46              axis, PrimitivesPlugin_Cone::AXIS_ID(),
47              ModelAPI_AttributeSelection, /** Axis */,
48              baseRadius, PrimitivesPlugin_Cone::BASE_RADIUS_ID(),
49              ModelAPI_AttributeDouble, /** Base radius */,
50              topRadius, PrimitivesPlugin_Cone::TOP_RADIUS_ID(),
51              ModelAPI_AttributeDouble, /** Top radius */,
52              height, PrimitivesPlugin_Cone::HEIGHT_ID(),
53              ModelAPI_AttributeDouble, /** Height */)
54
55   /// Set radius
56   PRIMITIVESAPI_EXPORT
57   void setRadius(const ModelHighAPI_Double& theBaseRadius,
58                  const ModelHighAPI_Double& theTopRadius);
59
60   /// Set height
61   PRIMITIVESAPI_EXPORT
62   void setHeight(const ModelHighAPI_Double& theHeight);
63
64   /// Dump wrapped feature
65   PRIMITIVESAPI_EXPORT
66   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
67 };
68
69 /// Pointer on primitive Cone object
70 typedef std::shared_ptr<PrimitivesAPI_Cone> ConePtr;
71
72 /// \ingroup CPPHighAPI
73 /// \brief Create primitive Cone feature.
74 PRIMITIVESAPI_EXPORT
75 ConePtr addCone(const std::shared_ptr<ModelAPI_Document>& thePart,
76                 const ModelHighAPI_Selection& theBasePoint,
77                 const ModelHighAPI_Selection& theAxis,
78                 const ModelHighAPI_Double& theBaseRadius,
79                 const ModelHighAPI_Double& theTopRadius,
80                 const ModelHighAPI_Double& theHeight);
81
82 /// \ingroup CPPHighAPI
83 /// \brief Create primitive Cone feature.
84 PRIMITIVESAPI_EXPORT
85 ConePtr addCone(const std::shared_ptr<ModelAPI_Document>& thePart,
86                 const ModelHighAPI_Double& theBaseRadius,
87                 const ModelHighAPI_Double& theTopRadius,
88                 const ModelHighAPI_Double& theHeight);
89
90 #endif // PRIMITIVESAPI_CONE_H_