1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 // File: FeaturesPlugin_Pipe.h
4 // Created: 16 March 2016
5 // Author: Dmitry Bobylev
7 #ifndef FeaturesPlugin_Pipe_H_
8 #define FeaturesPlugin_Pipe_H_
10 #include "FeaturesPlugin.h"
12 #include <GeomAlgoAPI_Pipe.h>
14 #include <ModelAPI_Feature.h>
15 #include <ModelAPI_ResultBody.h>
17 /// \class FeaturesPlugin_Pipe
19 /// \brief Feature for creation of extrusion along a path.
20 /// Pipe creates extrusion of objects along a path. It produces the following results from objects:\n
25 class FeaturesPlugin_Pipe : public ModelAPI_Feature
29 inline static const std::string& ID()
31 static const std::string MY_FEATURE_ID("Pipe");
35 /// Attribute name for creation method.
36 inline static const std::string& CREATION_METHOD()
38 static const std::string MY_CREATION_METHOD("creation_method");
39 return MY_CREATION_METHOD;
42 /// Attribute name for creation method.
43 inline static const std::string& CREATION_METHOD_SIMPLE()
45 static const std::string MY_CREATION_METHOD("simple");
46 return MY_CREATION_METHOD;
49 /// Attribute name for creation method.
50 inline static const std::string& CREATION_METHOD_BINORMAL()
52 static const std::string MY_CREATION_METHOD("binormal");
53 return MY_CREATION_METHOD;
56 /// Attribute name for creation method.
57 inline static const std::string& CREATION_METHOD_LOCATIONS()
59 static const std::string MY_CREATION_METHOD("locations");
60 return MY_CREATION_METHOD;
63 /// Attribute name of base objects.
64 inline static const std::string& BASE_OBJECTS_ID()
66 static const std::string MY_BASE_OBJECTS_ID("base_objects");
67 return MY_BASE_OBJECTS_ID;
70 /// Attribute name of path object.
71 inline static const std::string& PATH_OBJECT_ID()
73 static const std::string MY_PATH_OBJECT_ID("path_object");
74 return MY_PATH_OBJECT_ID;
77 /// Attribute name of Bi-Normal.
78 inline static const std::string& BINORMAL_ID()
80 static const std::string MY_BINORMAL_ID("binormal");
81 return MY_BINORMAL_ID;
84 /// Attribute name of locations.
85 inline static const std::string& LOCATIONS_ID()
87 static const std::string MY_LOCATIONS_ID("locations_objects");
88 return MY_LOCATIONS_ID;
91 /// \return the kind of a feature.
92 FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
94 static std::string MY_KIND = FeaturesPlugin_Pipe::ID();
98 /// Creates a new part document if needed
99 FEATURESPLUGIN_EXPORT virtual void execute();
101 /// Request for initialization of data model of the feature: adding all attributes
102 FEATURESPLUGIN_EXPORT virtual void initAttributes();
104 /// Use plugin manager for features creation
105 FeaturesPlugin_Pipe();
108 void storeResult(const std::shared_ptr<GeomAPI_Shape> theBaseShape,
109 GeomAlgoAPI_Pipe& thePipeAlgo,
110 const int theResultIndex = 0);
112 void storeResult(const ListOfShape& theBaseShapes,
113 GeomAlgoAPI_Pipe& thePipeAlgo,
114 const int theResultIndex = 0);
116 void storeShapes(ResultBodyPtr theResultBody,
117 const GeomAPI_Shape::ShapeType theBaseShapeType,
118 const std::shared_ptr<GeomAPI_DataMapOfShapeShape> theMapOfSubShapes,
119 const ListOfShape& theShapes,
120 const std::string theName,