X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPrimitivesPlugin%2FPrimitivesPlugin_Sphere.h;h=67a288aa176e012229b950771878a0f4e170d3e1;hb=77ce6d35ac8d2f0fdaecb4f23e0870bf74e36103;hp=08693f3a5c55ac147865922c818bea5478d99b1d;hpb=8c02cd3212ecefba1d69eb9d63f0cb94c98b0d3c;p=modules%2Fshaper.git diff --git a/src/PrimitivesPlugin/PrimitivesPlugin_Sphere.h b/src/PrimitivesPlugin/PrimitivesPlugin_Sphere.h index 08693f3a5..67a288aa1 100644 --- a/src/PrimitivesPlugin/PrimitivesPlugin_Sphere.h +++ b/src/PrimitivesPlugin/PrimitivesPlugin_Sphere.h @@ -1,4 +1,21 @@ -// Copyright (C) 2014-201x CEA/DEN, EDF R&D +// Copyright (C) 2017-2024 CEA, EDF +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// // File: PrimitivesPlugin_Sphere.h // Created: 15 Mar 2017 @@ -13,9 +30,10 @@ /**\class PrimitivesPlugin_Sphere * \ingroup Plugins - * \brief Feature for creation of a sphere. + * \brief Feature for creation of a sphere primitive using various methods. * - * Creates a sphere from a radius and a center point defaulting to the origin + * It can be built via two methods : using a radius and a center point defaulting to the origin, + * or radii (inner and outer) and angle limits (theta and phi). */ class PrimitivesPlugin_Sphere : public ModelAPI_Feature { @@ -27,6 +45,27 @@ class PrimitivesPlugin_Sphere : public ModelAPI_Feature return MY_SPHERE_ID; } + /// Attribute name for creation method + inline static const std::string& CREATION_METHOD() + { + static const std::string MY_CREATION_METHOD_ID("CreationMethod"); + return MY_CREATION_METHOD_ID; + } + + /// Attribute name for creation method + inline static const std::string& CREATION_METHOD_BY_PT_RADIUS() + { + static const std::string MY_CREATION_METHOD_ID("SphereByPointRadius"); + return MY_CREATION_METHOD_ID; + } + + /// Attribute name for creation method + inline static const std::string& CREATION_METHOD_BY_DIMENSIONS() + { + static const std::string MY_CREATION_METHOD_ID("SphereByDimensions"); + return MY_CREATION_METHOD_ID; + } + /// Attribute name of the base point inline static const std::string& CENTER_POINT_ID() { @@ -41,6 +80,48 @@ class PrimitivesPlugin_Sphere : public ModelAPI_Feature return MY_RADIUS_ID; } + /// attribute name of the inner radius + inline static const std::string& RMIN_ID() + { + static const std::string MY_RMIN_ID("rmin"); + return MY_RMIN_ID; + } + + /// attribute name of the outer radius + inline static const std::string& RMAX_ID() + { + static const std::string MY_RMAX_ID("rmax"); + return MY_RMAX_ID; + } + + /// attribute name of the lower phi limit + inline static const std::string& PHIMIN_ID() + { + static const std::string MY_PHIMIN_ID("phimin"); + return MY_PHIMIN_ID; + } + + /// attribute name of the higher phi limit + inline static const std::string& PHIMAX_ID() + { + static const std::string MY_PHIMAX_ID("phimax"); + return MY_PHIMAX_ID; + } + + /// attribute name of the lower theta limit + inline static const std::string& THETAMIN_ID() + { + static const std::string MY_THETAMIN_ID("thetamin"); + return MY_THETAMIN_ID; + } + + /// attribute name of the higher theta limit + inline static const std::string& THETAMAX_ID() + { + static const std::string MY_THETAMAX_ID("thetamax"); + return MY_THETAMAX_ID; + } + /// Returns the kind of a feature PRIMITIVESPLUGIN_EXPORT virtual const std::string& getKind() { @@ -62,6 +143,13 @@ class PrimitivesPlugin_Sphere : public ModelAPI_Feature void loadNamingDS(std::shared_ptr theSphereAlgo, std::shared_ptr theResultSphere); + /// Perform the creation of the sphere using a point and a radius + void createSphereByPtRadius(); + + /// Perform the creation of the sphere using radii (inner and outer) and angle limits + /// (theta and phi) + void createShereByDimensions(); + }; #endif // PRIMITIVESPLUGIN_SPHERE_H_