SHAPER 9.16.0
PrimitivesAPI_Sphere.h
1// Copyright (C) 2017-2026 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_Sphere.h
21// Created: 16 Mar 2017
22// Author: Clarisse Genrault
23
24#ifndef PRIMITIVESAPI_SPHERE_H_
25#define PRIMITIVESAPI_SPHERE_H_
26
27#include "PrimitivesAPI.h"
28
29#include <PrimitivesPlugin_Sphere.h>
30
31#include <ModelHighAPI_Interface.h>
32#include <ModelHighAPI_Macro.h>
33
36
41{
42public:
44 PRIMITIVESAPI_EXPORT
45 explicit PrimitivesAPI_Sphere(const std::shared_ptr<ModelAPI_Feature>& theFeature);
46
48 PRIMITIVESAPI_EXPORT
49 explicit PrimitivesAPI_Sphere(const std::shared_ptr<ModelAPI_Feature>& theFeature,
50 const ModelHighAPI_Selection& theCenterPoint,
51 const ModelHighAPI_Double& theRadius);
52
54 PRIMITIVESAPI_EXPORT
55 explicit PrimitivesAPI_Sphere(const std::shared_ptr<ModelAPI_Feature>& theFeature,
56 const ModelHighAPI_Double& theRMin,
57 const ModelHighAPI_Double& theRMax,
58 const ModelHighAPI_Double& thePhiMin,
59 const ModelHighAPI_Double& thePhiMax,
60 const ModelHighAPI_Double& theThetaMin,
61 const ModelHighAPI_Double& theThetaMax);
62
64 PRIMITIVESAPI_EXPORT
65 virtual ~PrimitivesAPI_Sphere();
66
67 INTERFACE_9(PrimitivesPlugin_Sphere::ID(),
86
87
88 PRIMITIVESAPI_EXPORT
89 void setCenterPoint(const ModelHighAPI_Selection& theCenterPoint);
90
92 PRIMITIVESAPI_EXPORT
93 void setRadius(const ModelHighAPI_Double& theRadius);
94
96 PRIMITIVESAPI_EXPORT
97 void setRadius(const ModelHighAPI_Double& theRMin, const ModelHighAPI_Double& theRMax);
98
100 PRIMITIVESAPI_EXPORT
101 void setPhi(const ModelHighAPI_Double& thePhiMin, const ModelHighAPI_Double& thePhiMax);
102
104 PRIMITIVESAPI_EXPORT
105 void setTheta(const ModelHighAPI_Double& theThetaMin, const ModelHighAPI_Double& theThetaMax);
106
108 PRIMITIVESAPI_EXPORT
109 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
110};
111
113typedef std::shared_ptr<PrimitivesAPI_Sphere> SpherePtr;
114
117PRIMITIVESAPI_EXPORT
118SpherePtr addSphere(const std::shared_ptr<ModelAPI_Document>& thePart,
119 const ModelHighAPI_Selection& theCenterPoint,
120 const ModelHighAPI_Double& theRadius);
121
124PRIMITIVESAPI_EXPORT
125SpherePtr addSphere(const std::shared_ptr<ModelAPI_Document>& thePart,
126 const ModelHighAPI_Double& theRadius);
127
130PRIMITIVESAPI_EXPORT
131SpherePtr addSphere(const std::shared_ptr<ModelAPI_Document>& thePart,
132 const ModelHighAPI_Double& theRMin,
133 const ModelHighAPI_Double& theRMax,
134 const ModelHighAPI_Double& thePhiMin,
135 const ModelHighAPI_Double& thePhiMax,
136 const ModelHighAPI_Double& theThetaMin,
137 const ModelHighAPI_Double& theThetaMax);
138
139#endif // PRIMITIVESAPI_SPHERE_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
API for the attribute that contains std (null terminated) string.
Definition: ModelAPI_AttributeString.h:33
Document for internal data structure of any object storage.
Definition: ModelAPI_Document.h:53
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:46
Class for filling ModelAPI_AttributeSelection.
Definition: ModelHighAPI_Selection.h:49
Interface for primitive Sphere feature.
Definition: PrimitivesAPI_Sphere.h:41
virtual std::shared_ptr< ModelAPI_AttributeDouble > phimax() const
The maximum phi.
Definition: PrimitivesAPI_Sphere.h:85
void setPhi(const ModelHighAPI_Double &thePhiMin, const ModelHighAPI_Double &thePhiMax)
Set minimum and maximum phi.
Definition: PrimitivesAPI_Sphere.cpp:101
virtual std::shared_ptr< ModelAPI_AttributeString > creationMethod() const
Creation method.
Definition: PrimitivesAPI_Sphere.h:85
virtual std::shared_ptr< ModelAPI_AttributeSelection > centerPoint() const
Center point.
Definition: PrimitivesAPI_Sphere.h:85
void setCenterPoint(const ModelHighAPI_Selection &theCenterPoint)
Set center point.
Definition: PrimitivesAPI_Sphere.cpp:78
virtual std::shared_ptr< ModelAPI_AttributeDouble > rmax() const
The maximum radius.
Definition: PrimitivesAPI_Sphere.h:85
virtual std::shared_ptr< ModelAPI_AttributeDouble > thetamin() const
The minimum theta.
Definition: PrimitivesAPI_Sphere.h:85
virtual std::shared_ptr< ModelAPI_AttributeDouble > phimin() const
The minimum phi.
Definition: PrimitivesAPI_Sphere.h:85
void setRadius(const ModelHighAPI_Double &theRadius)
Set radius.
Definition: PrimitivesAPI_Sphere.cpp:85
virtual std::shared_ptr< ModelAPI_AttributeDouble > rmin() const
The minimum radius.
Definition: PrimitivesAPI_Sphere.h:85
virtual std::shared_ptr< ModelAPI_AttributeDouble > radius() const
Radius.
Definition: PrimitivesAPI_Sphere.h:85
PrimitivesAPI_Sphere(const std::shared_ptr< ModelAPI_Feature > &theFeature)
Constructor without values.
Definition: PrimitivesAPI_Sphere.cpp:31
void setTheta(const ModelHighAPI_Double &theThetaMin, const ModelHighAPI_Double &theThetaMax)
Set minimum and maximum theta.
Definition: PrimitivesAPI_Sphere.cpp:110
virtual std::shared_ptr< ModelAPI_AttributeDouble > thetamax() const
The maximum theta.
Definition: PrimitivesAPI_Sphere.h:85
virtual ~PrimitivesAPI_Sphere()
Destructor.
Definition: PrimitivesAPI_Sphere.cpp:73
virtual void dump(ModelHighAPI_Dumper &theDumper) const
Dump wrapped feature.
Definition: PrimitivesAPI_Sphere.cpp:119
static const std::string & THETAMIN_ID()
attribute name of the lower theta limit
Definition: PrimitivesPlugin_Sphere.h:112
static const std::string & RMIN_ID()
attribute name of the inner radius
Definition: PrimitivesPlugin_Sphere.h:84
static const std::string & RADIUS_ID()
Attribute name of the radius.
Definition: PrimitivesPlugin_Sphere.h:77
static const std::string & CREATION_METHOD()
Attribute name for creation method.
Definition: PrimitivesPlugin_Sphere.h:49
static const std::string & THETAMAX_ID()
attribute name of the higher theta limit
Definition: PrimitivesPlugin_Sphere.h:119
static const std::string & ID()
Sphere kind.
Definition: PrimitivesPlugin_Sphere.h:42
static const std::string & RMAX_ID()
attribute name of the outer radius
Definition: PrimitivesPlugin_Sphere.h:91
static const std::string & PHIMIN_ID()
attribute name of the lower phi limit
Definition: PrimitivesPlugin_Sphere.h:98
static const std::string & PHIMAX_ID()
attribute name of the higher phi limit
Definition: PrimitivesPlugin_Sphere.h:105
static const std::string & CENTER_POINT_ID()
Attribute name of the base point.
Definition: PrimitivesPlugin_Sphere.h:70
SpherePtr addSphere(const std::shared_ptr< ModelAPI_Document > &thePart, const ModelHighAPI_Selection &theCenterPoint, const ModelHighAPI_Double &theRadius)
Create primitive Sphere feature.
Definition: PrimitivesAPI_Sphere.cpp:149