1 // Copyright (C) 2014-201x CEA/DEN, EDF R&D
3 // File: PrimitivesPlugin_Sphere.h
4 // Created: 15 Mar 2017
5 // Author: Clarisse Genrault (CEA)
7 #ifndef PRIMITIVESPLUGIN_SPHERE_H_
8 #define PRIMITIVESPLUGIN_SPHERE_H_
10 #include <PrimitivesPlugin.h>
11 #include <ModelAPI_Feature.h>
12 #include <GeomAlgoAPI_Sphere.h>
14 /**\class PrimitivesPlugin_Sphere
16 * \brief Feature for creation of a sphere.
18 * Creates a sphere from a radius and a center point defaulting to the origin
20 class PrimitivesPlugin_Sphere : public ModelAPI_Feature
24 inline static const std::string& ID()
26 static const std::string MY_SPHERE_ID("Sphere");
30 /// Attribute name of the base point
31 inline static const std::string& CENTER_POINT_ID()
33 static const std::string MY_CENTER_POINT_ID("center_point");
34 return MY_CENTER_POINT_ID;
37 /// Attribute name of the radius
38 inline static const std::string& RADIUS_ID()
40 static const std::string MY_RADIUS_ID("radius");
44 /// Returns the kind of a feature
45 PRIMITIVESPLUGIN_EXPORT virtual const std::string& getKind()
47 static std::string MY_KIND = PrimitivesPlugin_Sphere::ID();
51 /// Creates a new part document if needed
52 PRIMITIVESPLUGIN_EXPORT virtual void execute();
54 /// Request for initialization of data model of the feature: adding all attributes
55 PRIMITIVESPLUGIN_EXPORT virtual void initAttributes();
57 /// Use plugin manager for features creation
58 PrimitivesPlugin_Sphere();
61 /// Load Naming data structure of the feature to the document
62 void loadNamingDS(std::shared_ptr<GeomAlgoAPI_Sphere> theSphereAlgo,
63 std::shared_ptr<ModelAPI_ResultBody> theResultSphere);
67 #endif // PRIMITIVESPLUGIN_SPHERE_H_