Salome HOME
Issue #1860: fix end lines with spaces
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_Pipe.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:        FeaturesPlugin_Pipe.h
4 // Created:     16 March 2016
5 // Author:      Dmitry Bobylev
6
7 #ifndef FeaturesPlugin_Pipe_H_
8 #define FeaturesPlugin_Pipe_H_
9
10 #include "FeaturesPlugin.h"
11
12 #include <GeomAlgoAPI_Pipe.h>
13
14 #include <ModelAPI_Feature.h>
15 #include <ModelAPI_ResultBody.h>
16
17 /// \class FeaturesPlugin_Pipe
18 /// \ingroup Plugins
19 /// \brief Feature for creation of extrusion along a path.
20 /// Pipe creates extrusion of objects along a path.
21 /// It produces the following results from objects:\n
22 /// Vertex -> Edge\n
23 /// Edge -> Face\n
24 /// Wire -> Shell\n
25 /// Face -> Solid
26 class FeaturesPlugin_Pipe : public ModelAPI_Feature
27 {
28 public:
29   /// Feature kind.
30   inline static const std::string& ID()
31   {
32     static const std::string MY_FEATURE_ID("Pipe");
33     return MY_FEATURE_ID;
34   }
35
36   /// Attribute name for creation method.
37   inline static const std::string& CREATION_METHOD()
38   {
39     static const std::string MY_CREATION_METHOD("creation_method");
40     return MY_CREATION_METHOD;
41   }
42
43   /// Attribute name for creation method.
44   inline static const std::string& CREATION_METHOD_SIMPLE()
45   {
46     static const std::string MY_CREATION_METHOD("simple");
47     return MY_CREATION_METHOD;
48   }
49
50   /// Attribute name for creation method.
51   inline static const std::string& CREATION_METHOD_BINORMAL()
52   {
53     static const std::string MY_CREATION_METHOD("binormal");
54     return MY_CREATION_METHOD;
55   }
56
57   /// Attribute name for creation method.
58   inline static const std::string& CREATION_METHOD_LOCATIONS()
59   {
60     static const std::string MY_CREATION_METHOD("locations");
61     return MY_CREATION_METHOD;
62   }
63
64   /// Attribute name of base objects.
65   inline static const std::string& BASE_OBJECTS_ID()
66   {
67     static const std::string MY_BASE_OBJECTS_ID("base_objects");
68     return MY_BASE_OBJECTS_ID;
69   }
70
71   /// Attribute name of path object.
72   inline static const std::string& PATH_OBJECT_ID()
73   {
74     static const std::string MY_PATH_OBJECT_ID("path_object");
75     return MY_PATH_OBJECT_ID;
76   }
77
78   /// Attribute name of Bi-Normal.
79   inline static const std::string& BINORMAL_ID()
80   {
81     static const std::string MY_BINORMAL_ID("binormal");
82     return MY_BINORMAL_ID;
83   }
84
85   /// Attribute name of locations.
86   inline static const std::string& LOCATIONS_ID()
87   {
88     static const std::string MY_LOCATIONS_ID("locations_objects");
89     return MY_LOCATIONS_ID;
90   }
91
92   /// \return the kind of a feature.
93   FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
94   {
95     static std::string MY_KIND = FeaturesPlugin_Pipe::ID();
96     return MY_KIND;
97   }
98
99   /// Creates a new part document if needed
100   FEATURESPLUGIN_EXPORT virtual void execute();
101
102   /// Request for initialization of data model of the feature: adding all attributes
103   FEATURESPLUGIN_EXPORT virtual void initAttributes();
104
105   /// Use plugin manager for features creation
106   FeaturesPlugin_Pipe();
107
108 private:
109   void storeResult(const std::shared_ptr<GeomAPI_Shape> theBaseShape,
110                    GeomAlgoAPI_Pipe& thePipeAlgo,
111                    const int theResultIndex = 0);
112
113   void storeResult(const ListOfShape& theBaseShapes,
114                    GeomAlgoAPI_Pipe& thePipeAlgo,
115                    const int theResultIndex = 0);
116
117   void storeShapes(ResultBodyPtr theResultBody,
118                    const GeomAPI_Shape::ShapeType theBaseShapeType,
119                    const std::shared_ptr<GeomAPI_DataMapOfShapeShape> theMapOfSubShapes,
120                    const ListOfShape& theShapes,
121                    const std::string theName,
122                    int& theTag);
123 };
124
125 #endif