Salome HOME
Merge branch 'CPPHighAPI'
[modules/shaper.git] / src / BuildPlugin / BuildPlugin_Wire.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        BuildPlugin_Wire.h
4 // Created:     14 April 2016
5 // Author:      Dmitry Bobylev
6
7 #ifndef BuildPlugin_Wire_H_
8 #define BuildPlugin_Wire_H_
9
10 #include "BuildPlugin.h"
11
12 #include <ModelAPI_Feature.h>
13
14 /// \class BuildPlugin_Wire
15 /// \ingroup Plugins
16 /// \brief Feature for creation of wire from sketch edges or existing wires.
17 class BuildPlugin_Wire: public ModelAPI_Feature
18 {
19 public:
20   /// Use plugin manager for features creation
21   BuildPlugin_Wire();
22
23   /// Feature kind.
24   inline static const std::string& ID()
25   {
26     static const std::string MY_ID("Wire");
27     return MY_ID;
28   }
29
30   /// Attribute name of base objects.
31   inline static const std::string& BASE_OBJECTS_ID()
32   {
33     static const std::string MY_BASE_OBJECTS_ID("base_objects");
34     return MY_BASE_OBJECTS_ID;
35   }
36
37   /// Attribute name of base objects.
38   inline static const std::string& ADD_CONTOUR_ACTION_ID()
39   {
40     static const std::string MY_ADD_CONTOUR_ACTION_ID("add_contour");
41     return MY_ADD_CONTOUR_ACTION_ID;
42   }
43
44   /// \return the kind of a feature.
45   BUILDPLUGIN_EXPORT virtual const std::string& getKind()
46   {
47     static std::string MY_KIND = BuildPlugin_Wire::ID();
48     return MY_KIND;
49   }
50
51   /// Request for initialization of data model of the feature: adding all attributes.
52   BUILDPLUGIN_EXPORT virtual void initAttributes();
53
54   /// Creates a new part document if needed.
55   BUILDPLUGIN_EXPORT virtual void execute();
56
57   /// Performs some functionality by action id.
58   /// \param[in] theAttributeId action key id.
59   /// \return false in case if action not perfomed.
60   BUILDPLUGIN_EXPORT virtual bool customAction(const std::string& theActionId);
61
62 private:
63   /// Action: Adds to the list of segments other segments of the sketcher connected to
64   /// the already selected ones to create a closed contour.
65   /// \return false in case if no countours have been added.
66   bool addContour();
67 };
68
69 #endif