1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: FeaturesPlugin_Translation.h
4 // Created: 8 June 2015
5 // Author: Dmitry Bobylev
7 #ifndef FeaturesPlugin_Translation_H_
8 #define FeaturesPlugin_Translation_H_
10 #include <FeaturesPlugin.h>
12 #include <ModelAPI_Feature.h>
14 #include <GeomAlgoAPI_Translation.h>
16 /// \class FeaturesPlugin_Translation
18 /// \brief Feature for translation objects along the axis.
19 class FeaturesPlugin_Translation : public ModelAPI_Feature
23 inline static const std::string& ID()
25 static const std::string MY_TRANSLATION_ID("Translation");
26 return MY_TRANSLATION_ID;
29 /// Attribute name of referenced objects.
30 inline static const std::string& OBJECTS_LIST_ID()
32 static const std::string MY_OBJECTS_LIST_ID("main_objects");
33 return MY_OBJECTS_LIST_ID;
36 /// Attribute name of an axis.
37 inline static const std::string& AXIS_OBJECT_ID()
39 static const std::string MY_AXIS_OBJECT_ID("axis_object");
40 return MY_AXIS_OBJECT_ID;
43 /// Attribute name of distance.
44 inline static const std::string& DISTANCE_ID()
46 static const std::string MY_DISTANCE_ID("distance");
47 return MY_DISTANCE_ID;
50 /// \return the kind of a feature.
51 FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
53 static std::string MY_KIND = FeaturesPlugin_Translation::ID();
57 /// Creates a new part document if needed.
58 FEATURESPLUGIN_EXPORT virtual void execute();
60 /// Request for initialization of data model of the feature: adding all attributes.
61 FEATURESPLUGIN_EXPORT virtual void initAttributes();
63 /// Use plugin manager for features creation.
64 FeaturesPlugin_Translation();
67 void loadNamingDS(GeomAlgoAPI_Translation& theTranslationAlgo,
68 std::shared_ptr<ModelAPI_ResultBody> theResultBody,
69 std::shared_ptr<GeomAPI_Shape> theBaseShape);