1 // Copyright (C) 2014-2016 CEA/DEN, EDF R&D
3 // File: FeaturesPlugin_Symmetry.h
4 // Created: 30 Nov 2016
5 // Author: Clarisse Genrault (CEA)
7 #ifndef FEATURESPLUGIN_SYMMETRY_H_
8 #define FEATURESPLUGIN_SYMMETRY_H_
10 #include <FeaturesPlugin.h>
12 #include <ModelAPI_Feature.h>
14 #include <GeomAlgoAPI_Symmetry.h>
16 /** \class FeaturesPlugin_Symmetry
18 * \brief Feature that performs reflection with respect to a point, axis, or plane.
20 class FeaturesPlugin_Symmetry : public ModelAPI_Feature
24 inline static const std::string& ID()
26 static const std::string MY_SYMMETRY_ID("Symmetry");
27 return MY_SYMMETRY_ID;
30 /// Attribute name for creation method.
31 inline static const std::string& CREATION_METHOD()
33 static const std::string MY_CREATION_METHOD_ID("CreationMethod");
34 return MY_CREATION_METHOD_ID;
37 /// Attribute name for creation method "ByPoint".
38 inline static const std::string& CREATION_METHOD_BY_POINT()
40 static const std::string MY_CREATION_METHOD_ID("ByPoint");
41 return MY_CREATION_METHOD_ID;
44 /// Attribute name for creation method "ByAxis".
45 inline static const std::string& CREATION_METHOD_BY_AXIS()
47 static const std::string MY_CREATION_METHOD_ID("ByAxis");
48 return MY_CREATION_METHOD_ID;
51 /// Attribute name for creation method "ByPlane".
52 inline static const std::string& CREATION_METHOD_BY_PLANE()
54 static const std::string MY_CREATION_METHOD_ID("ByPlane");
55 return MY_CREATION_METHOD_ID;
58 /// Attribute name of referenced objects.
59 inline static const std::string& OBJECTS_LIST_ID()
61 static const std::string MY_OBJECTS_LIST_ID("main_objects");
62 return MY_OBJECTS_LIST_ID;
65 /// Attribute name of a point.
66 inline static const std::string& POINT_OBJECT_ID()
68 static const std::string MY_POINT_OBJECT_ID("point_object");
69 return MY_POINT_OBJECT_ID;
72 /// Attribute name of an axis.
73 inline static const std::string& AXIS_OBJECT_ID()
75 static const std::string MY_AXIS_OBJECT_ID("axis_object");
76 return MY_AXIS_OBJECT_ID;
79 /// Attribute name of a plane.
80 inline static const std::string& PLANE_OBJECT_ID()
82 static const std::string MY_PLANE_OBJECT_ID("plane_object");
83 return MY_PLANE_OBJECT_ID;
86 /// \return the kind of a feature.
87 FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
89 static std::string MY_KIND = FeaturesPlugin_Symmetry::ID();
93 /// Creates a new part document if needed.
94 FEATURESPLUGIN_EXPORT virtual void execute();
96 /// Request for initialization of data model of the feature: adding all attributes.
97 FEATURESPLUGIN_EXPORT virtual void initAttributes();
99 /// Use plugin manager for features creation.
100 FeaturesPlugin_Symmetry();
103 /// Perform symmetry with respect to a point.
104 void performSymmetryByPoint();
106 /// Perform symmetry with respect to an axis.
107 void performSymmetryByAxis();
109 /// Perform symmetry with respect to a plane.
110 void performSymmetryByPlane();
112 /// Perform the naming
113 void loadNamingDS(GeomAlgoAPI_Symmetry& theSymmetryAlgo,
114 std::shared_ptr<ModelAPI_ResultBody> theResultBody,
115 std::shared_ptr<GeomAPI_Shape> theBaseShape);
118 #endif // FEATURESPLUGIN_SYMMETRY_H_