]> SALOME platform Git repositories - modules/shaper.git/blob - src/FeaturesPlugin/FeaturesPlugin_Placement.h
Salome HOME
Speed up the redraw of sketch with constraints moved by the point of the line
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_Placement.h
1 // File:        FeaturesPlugin_Placement.h
2 // Created:     2 Dec 2014
3 // Author:      Artem ZHIDKOV
4
5 #ifndef FeaturesPlugin_Placement_H_
6 #define FeaturesPlugin_Placement_H_
7
8 #include "FeaturesPlugin.h"
9 #include <ModelAPI_Feature.h>
10 #include <GeomAlgoAPI_Placement.h>
11
12 class ModelAPI_ResultBody;
13 class GeomAPI_Shape;
14
15 class FeaturesPlugin_Placement : public ModelAPI_Feature
16 {
17  public:
18   /// Placement kind
19   inline static const std::string& ID()
20   {
21     static const std::string MY_PLACEMENT_ID("Placement");
22     return MY_PLACEMENT_ID;
23   }
24   /// attribute name of referenced face
25   inline static const std::string& BASE_FACE_ID()
26   {
27     static const std::string MY_BASE_FACE_ID("placement_base_face");
28     return MY_BASE_FACE_ID;
29   }
30   /// attribute name of attractable face
31   inline static const std::string& ATTRACT_FACE_ID()
32   {
33     static const std::string MY_ATTRACT_FACE_ID("placement_attractable_face");
34     return MY_ATTRACT_FACE_ID;
35   }
36
37   /// Returns the kind of a feature
38   FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
39   {
40     static std::string MY_KIND = FeaturesPlugin_Placement::ID();
41     return MY_KIND;
42   }
43
44   /// Creates a new part document if needed
45   FEATURESPLUGIN_EXPORT virtual void execute();
46
47   /// Request for initialization of data model of the feature: adding all attributes
48   FEATURESPLUGIN_EXPORT virtual void initAttributes();
49
50   /// Use plugin manager for features creation
51   FeaturesPlugin_Placement();
52 private:
53   /// Load Naming data structure of the feature to the document
54   void LoadNamingDS(GeomAlgoAPI_Placement& theFeature,
55                     std::shared_ptr<ModelAPI_ResultBody> theResultBody,
56                     std::shared_ptr<GeomAPI_Shape> theSlaveObject);
57 };
58
59 #endif