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>
13 #include <GeomAlgoAPI_Transform.h>
15 class ModelAPI_ResultBody;
18 /**\class FeaturesPlugin_Placement
20 * \brief Feature for applying of placement operation: relative movement of Solid.
22 * Locates the selected placement_attractable_object (face, edge, vertex) of the solid into
23 * the selected placement_base_object. Faces must be planar, edges must be linear.
24 * Orientation of the placed solid depends on the underlied planes of both faces.
26 class FeaturesPlugin_Placement : public ModelAPI_Feature
30 inline static const std::string& ID()
32 static const std::string MY_PLACEMENT_ID("Placement");
33 return MY_PLACEMENT_ID;
36 /// attribute name of references sketch entities list, it should contain a sketch result or
37 /// a pair a sketch result to sketch face
38 inline static const std::string& OBJECTS_LIST_ID()
40 static const std::string MY_OBJECTS_LIST_ID("placement_objects_list");
41 return MY_OBJECTS_LIST_ID;
44 /// attribute name of referenced object
45 inline static const std::string& START_SHAPE_ID()
47 static const std::string MY_START_SHAPE_ID("placement_start_shape");
48 return MY_START_SHAPE_ID;
50 /// attribute name of attractable face
51 inline static const std::string& END_SHAPE_ID()
53 static const std::string MY_END_SHAPE_ID("placement_end_shape");
54 return MY_END_SHAPE_ID;
56 /// attribute name of flag of reverse direction
57 inline static const std::string& REVERSE_ID()
59 static const std::string MY_REVERSE_ID("placement_reverse_direction");
62 /// attribute name of flag of centering position
63 inline static const std::string& CENTERING_ID()
65 static const std::string MY_CENTERING_ID("placement_centering");
66 return MY_CENTERING_ID;
69 /// Returns the kind of a feature
70 FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
72 static std::string MY_KIND = FeaturesPlugin_Placement::ID();
76 /// Creates a new part document if needed
77 FEATURESPLUGIN_EXPORT virtual void execute();
79 /// Request for initialization of data model of the feature: adding all attributes
80 FEATURESPLUGIN_EXPORT virtual void initAttributes();
82 /// Use plugin manager for features creation
83 FeaturesPlugin_Placement();
85 /// Load Naming data structure of the feature to the document
86 void loadNamingDS(GeomAlgoAPI_Transform& theTransformAlgo,
87 std::shared_ptr<ModelAPI_ResultBody> theResultBody,
88 std::shared_ptr<GeomAPI_Shape> theBaseShape);