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.
21 /// It produces the following results from objects:\n
26 class FeaturesPlugin_Pipe : public ModelAPI_Feature
30 inline static const std::string& ID()
32 static const std::string MY_FEATURE_ID("Pipe");
36 /// Attribute name for creation method.
37 inline static const std::string& CREATION_METHOD()
39 static const std::string MY_CREATION_METHOD("creation_method");
40 return MY_CREATION_METHOD;
43 /// Attribute name for creation method.
44 inline static const std::string& CREATION_METHOD_SIMPLE()
46 static const std::string MY_CREATION_METHOD("simple");
47 return MY_CREATION_METHOD;
50 /// Attribute name for creation method.
51 inline static const std::string& CREATION_METHOD_BINORMAL()
53 static const std::string MY_CREATION_METHOD("binormal");
54 return MY_CREATION_METHOD;
57 /// Attribute name for creation method.
58 inline static const std::string& CREATION_METHOD_LOCATIONS()
60 static const std::string MY_CREATION_METHOD("locations");
61 return MY_CREATION_METHOD;
64 /// Attribute name of base objects.
65 inline static const std::string& BASE_OBJECTS_ID()
67 static const std::string MY_BASE_OBJECTS_ID("base_objects");
68 return MY_BASE_OBJECTS_ID;
71 /// Attribute name of path object.
72 inline static const std::string& PATH_OBJECT_ID()
74 static const std::string MY_PATH_OBJECT_ID("path_object");
75 return MY_PATH_OBJECT_ID;
78 /// Attribute name of Bi-Normal.
79 inline static const std::string& BINORMAL_ID()
81 static const std::string MY_BINORMAL_ID("binormal");
82 return MY_BINORMAL_ID;
85 /// Attribute name of locations.
86 inline static const std::string& LOCATIONS_ID()
88 static const std::string MY_LOCATIONS_ID("locations_objects");
89 return MY_LOCATIONS_ID;
92 /// \return the kind of a feature.
93 FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
95 static std::string MY_KIND = FeaturesPlugin_Pipe::ID();
99 /// Creates a new part document if needed
100 FEATURESPLUGIN_EXPORT virtual void execute();
102 /// Request for initialization of data model of the feature: adding all attributes
103 FEATURESPLUGIN_EXPORT virtual void initAttributes();
105 /// Use plugin manager for features creation
106 FeaturesPlugin_Pipe();
109 void storeResult(const std::shared_ptr<GeomAPI_Shape> theBaseShape,
110 GeomAlgoAPI_Pipe& thePipeAlgo,
111 const int theResultIndex = 0);
113 void storeResult(const ListOfShape& theBaseShapes,
114 GeomAlgoAPI_Pipe& thePipeAlgo,
115 const int theResultIndex = 0);
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,