Salome HOME
Update the doxygen documentation for plugins
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_Placement.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:        FeaturesPlugin_Placement.h
4 // Created:     2 Dec 2014
5 // Author:      Artem ZHIDKOV
6
7 #ifndef FeaturesPlugin_Placement_H_
8 #define FeaturesPlugin_Placement_H_
9
10 #include "FeaturesPlugin.h"
11 #include <ModelAPI_Feature.h>
12 #include <GeomAlgoAPI_Placement.h>
13
14 class ModelAPI_ResultBody;
15 class GeomAPI_Shape;
16
17 /**\class FeaturesPlugin_Placement
18  * \ingroup Plugins
19  * \brief Feature for applying of placement operation: relative movement of Solid.
20  *
21  * Locates the selected attractable_face of the solid in the middle of the selected
22  * placement_base face. Faces must be planar. Orientation of the placed solid is
23  * depended on the underlied planes of both faces.
24  */
25 class FeaturesPlugin_Placement : public ModelAPI_Feature
26 {
27  public:
28   /// Placement kind
29   inline static const std::string& ID()
30   {
31     static const std::string MY_PLACEMENT_ID("Placement");
32     return MY_PLACEMENT_ID;
33   }
34   /// attribute name of referenced face
35   inline static const std::string& BASE_FACE_ID()
36   {
37     static const std::string MY_BASE_FACE_ID("placement_base_face");
38     return MY_BASE_FACE_ID;
39   }
40   /// attribute name of attractable face
41   inline static const std::string& ATTRACT_FACE_ID()
42   {
43     static const std::string MY_ATTRACT_FACE_ID("placement_attractable_face");
44     return MY_ATTRACT_FACE_ID;
45   }
46
47   /// Returns the kind of a feature
48   FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
49   {
50     static std::string MY_KIND = FeaturesPlugin_Placement::ID();
51     return MY_KIND;
52   }
53
54   /// Creates a new part document if needed
55   FEATURESPLUGIN_EXPORT virtual void execute();
56
57   /// Request for initialization of data model of the feature: adding all attributes
58   FEATURESPLUGIN_EXPORT virtual void initAttributes();
59
60   /// Use plugin manager for features creation
61   FeaturesPlugin_Placement();
62 private:
63   /// Load Naming data structure of the feature to the document
64   void LoadNamingDS(GeomAlgoAPI_Placement& theFeature,
65                     std::shared_ptr<ModelAPI_ResultBody> theResultBody,
66                     std::shared_ptr<GeomAPI_Shape> theSlaveObject);
67 };
68
69 #endif