Salome HOME
Issue #1309 Management of icons - INSTALL correction to use DIRECTORY instead of...
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_Wire.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        FeaturesPlugin_Wire.h
4 // Created:     14 April 2016
5 // Author:      Dmitry Bobylev
6
7 #ifndef FeaturesPlugin_Wire_H_
8 #define FeaturesPlugin_Wire_H_
9
10 #include "FeaturesPlugin.h"
11
12 #include <ModelAPI_Feature.h>
13
14 /// \class FeaturesPlugin_Wire
15 /// \ingroup Plugins
16 /// \brief Feature for creation of wire from sketch edges or existing wires.
17 class FeaturesPlugin_Wire: public ModelAPI_Feature
18 {
19 public:
20   /// Use plugin manager for features creation
21   FeaturesPlugin_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   /// \return the kind of a feature.
38   FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
39   {
40     static std::string MY_KIND = FeaturesPlugin_Wire::ID();
41     return MY_KIND;
42   }
43
44   /// Request for initialization of data model of the feature: adding all attributes.
45   FEATURESPLUGIN_EXPORT virtual void initAttributes();
46
47   /// Creates a new part document if needed.
48   FEATURESPLUGIN_EXPORT virtual void execute();
49
50   /// Performs some functionality by action id.
51   /// \param[in] theAttributeId action key id.
52   /// \return false in case if action not perfomed.
53   FEATURESPLUGIN_EXPORT virtual bool customAction(const std::string& theActionId);
54
55 private:
56   /// Action: Adds to the list of segments other segments of the sketcher connected to
57   /// the already selected ones to create a closed contour.
58   /// \return false in case if no countours have been added.
59   bool addContour();
60 };
61
62 #endif