1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 // File: FeaturesPlugin_Placement.h
5 // Author: Artem ZHIDKOV
7 #ifndef FeaturesPlugin_Placement_H_
8 #define FeaturesPlugin_Placement_H_
10 #include "FeaturesPlugin.h"
11 #include <ModelAPI_Feature.h>
12 #include <GeomAlgoAPI_Placement.h>
14 class ModelAPI_ResultBody;
17 /**\class FeaturesPlugin_Placement
19 * \brief Feature for applying of placement operation: relative movement of Solid.
21 * Locates the selected placement_attractable_object (face, edge, vertex) of the solid into
22 * the selected placement_base_object. Faces must be planar, edges must be linear.
23 * Orientation of the placed solid depends on the underlied planes of both faces.
25 class FeaturesPlugin_Placement : public ModelAPI_Feature
29 inline static const std::string& ID()
31 static const std::string MY_PLACEMENT_ID("Placement");
32 return MY_PLACEMENT_ID;
34 /// attribute name of referenced object
35 inline static const std::string& BASE_OBJECT_ID()
37 static const std::string MY_BASE_OBJECT_ID("placement_base_object");
38 return MY_BASE_OBJECT_ID;
40 /// attribute name of attractable face
41 inline static const std::string& ATTRACT_OBJECT_ID()
43 static const std::string MY_ATTRACT_OBJECT_ID("placement_attractable_object");
44 return MY_ATTRACT_OBJECT_ID;
46 /// attribute name of flag of reverse direction
47 inline static const std::string& REVERSE_ID()
49 static const std::string MY_REVERSE_ID("placement_reverse_direction");
52 /// attribute name of flag of centering position
53 inline static const std::string& CENTERING_ID()
55 static const std::string MY_CENTERING_ID("placement_centering");
56 return MY_CENTERING_ID;
59 /// Returns the kind of a feature
60 FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
62 static std::string MY_KIND = FeaturesPlugin_Placement::ID();
66 /// Creates a new part document if needed
67 FEATURESPLUGIN_EXPORT virtual void execute();
69 /// Request for initialization of data model of the feature: adding all attributes
70 FEATURESPLUGIN_EXPORT virtual void initAttributes();
72 /// Use plugin manager for features creation
73 FeaturesPlugin_Placement();
75 /// Load Naming data structure of the feature to the document
76 void LoadNamingDS(GeomAlgoAPI_Placement& theFeature,
77 std::shared_ptr<ModelAPI_ResultBody> theResultBody,
78 std::shared_ptr<GeomAPI_Shape> theSlaveObject);