1 // Copyright (C) 2017-2019 CEA/DEN, EDF R&D
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 // File: PrimitivesAPI_Cone.h
21 // Created: 20 Mar 2017
22 // Author: Clarisse Genrault
24 #ifndef PRIMITIVESAPI_CONE_H_
25 #define PRIMITIVESAPI_CONE_H_
27 #include "PrimitivesAPI.h"
29 #include <PrimitivesPlugin_Cone.h>
31 #include <ModelHighAPI_Interface.h>
32 #include <ModelHighAPI_Macro.h>
34 class ModelHighAPI_Double;
35 class ModelHighAPI_Selection;
37 /// \class PrimitivesAPI_Cone
38 /// \ingroup CPPHighAPI
39 /// \brief Interface for primitive Cone feature.
40 class PrimitivesAPI_Cone: public ModelHighAPI_Interface
43 /// Constructor without values.
45 explicit PrimitivesAPI_Cone(const std::shared_ptr<ModelAPI_Feature>& theFeature);
47 /// Constructor with values.
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);
58 virtual ~PrimitivesAPI_Cone();
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 */)
74 void setRadius(const ModelHighAPI_Double& theBaseRadius,
75 const ModelHighAPI_Double& theTopRadius);
79 void setHeight(const ModelHighAPI_Double& theHeight);
81 /// Dump wrapped feature
83 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
86 /// Pointer on primitive Cone object
87 typedef std::shared_ptr<PrimitivesAPI_Cone> ConePtr;
89 /// \ingroup CPPHighAPI
90 /// \brief Create primitive Cone feature.
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);
99 /// \ingroup CPPHighAPI
100 /// \brief Create primitive Cone feature.
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);
107 #endif // PRIMITIVESAPI_CONE_H_