SHAPER  9.12.0
PrimitivesAPI_Torus.h
1 // Copyright (C) 2017-2023 CEA, EDF
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 
36 
41 {
42 public:
44  PRIMITIVESAPI_EXPORT
45  explicit PrimitivesAPI_Torus(const std::shared_ptr<ModelAPI_Feature>& theFeature);
46 
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 
56  PRIMITIVESAPI_EXPORT
57  virtual ~PrimitivesAPI_Torus();
58 
59  INTERFACE_4(PrimitivesPlugin_Torus::ID(),
68 
69 
70  PRIMITIVESAPI_EXPORT
71  void setRadius(const ModelHighAPI_Double& theRadius,
72  const ModelHighAPI_Double& theRingRadius);
73 
75  PRIMITIVESAPI_EXPORT
76  virtual void dump(ModelHighAPI_Dumper& theDumper) const;
77 };
78 
80 typedef std::shared_ptr<PrimitivesAPI_Torus> TorusPtr;
81 
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 
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_
Attribute that contains real value with double precision.
Definition: ModelAPI_AttributeDouble.h:34
Attribute that contains reference to the sub-shape of some result, the selected shape.
Definition: ModelAPI_AttributeSelection.h:35
Document for internal data structure of any object storage.
Definition: ModelAPI_Document.h:52
Class for filling ModelAPI_AttributeDouble.
Definition: ModelHighAPI_Double.h:37
Dump engine for the model.
Definition: ModelHighAPI_Dumper.h:81
Base class for feature interfaces.
Definition: ModelHighAPI_Interface.h:42
Class for filling ModelAPI_AttributeSelection.
Definition: ModelHighAPI_Selection.h:49
Interface for primitive Torus feature.
Definition: PrimitivesAPI_Torus.h:41
virtual std::shared_ptr< ModelAPI_AttributeSelection > axis() const
Axis.
Definition: PrimitivesAPI_Torus.h:67
virtual void dump(ModelHighAPI_Dumper &theDumper) const
Dump wrapped feature.
Definition: PrimitivesAPI_Torus.cpp:67
virtual std::shared_ptr< ModelAPI_AttributeDouble > ringRadius() const
Ring radius.
Definition: PrimitivesAPI_Torus.h:67
virtual std::shared_ptr< ModelAPI_AttributeDouble > radius() const
Radius.
Definition: PrimitivesAPI_Torus.h:67
virtual std::shared_ptr< ModelAPI_AttributeSelection > basePoint() const
Base point.
Definition: PrimitivesAPI_Torus.h:67
PrimitivesAPI_Torus(const std::shared_ptr< ModelAPI_Feature > &theFeature)
Constructor without values.
Definition: PrimitivesAPI_Torus.cpp:31
void setRadius(const ModelHighAPI_Double &theRadius, const ModelHighAPI_Double &theRingRadius)
Set radius.
Definition: PrimitivesAPI_Torus.cpp:58
virtual ~PrimitivesAPI_Torus()
Destructor.
Definition: PrimitivesAPI_Torus.cpp:53
static const std::string & BASE_POINT_ID()
Attribute name of the base point.
Definition: PrimitivesPlugin_Torus.h:48
static const std::string & ID()
Torus kind.
Definition: PrimitivesPlugin_Torus.h:41
static const std::string & RING_RADIUS_ID()
Attribute name of the section radius.
Definition: PrimitivesPlugin_Torus.h:69
static const std::string & RADIUS_ID()
Attribute name of the radius.
Definition: PrimitivesPlugin_Torus.h:62
static const std::string & AXIS_ID()
Attribute name of the axis.
Definition: PrimitivesPlugin_Torus.h:55
TorusPtr addTorus(const std::shared_ptr< ModelAPI_Document > &thePart, const ModelHighAPI_Selection &theBasePoint, const ModelHighAPI_Selection &theAxis, const ModelHighAPI_Double &theRadius, const ModelHighAPI_Double &theRingRadius)
Create primitive Torus feature.
Definition: PrimitivesAPI_Torus.cpp:88