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 of base objects.
43 inline static const std::string& BASE_OBJECTS_ID()
45 static const std::string MY_BASE_OBJECTS_ID("base_objects");
46 return MY_BASE_OBJECTS_ID;
49 /// Attribute name of path object.
50 inline static const std::string& PATH_OBJECT_ID()
52 static const std::string MY_PATH_OBJECT_ID("path_object");
53 return MY_PATH_OBJECT_ID;
56 /// Attribute name of Bi-Normal.
57 inline static const std::string& BINORMAL_ID()
59 static const std::string MY_BINORMAL_ID("binormal");
60 return MY_BINORMAL_ID;
63 /// Attribute name of locations.
64 inline static const std::string& LOCATIONS_ID()
66 static const std::string MY_LOCATIONS_ID("locations_objects");
67 return MY_LOCATIONS_ID;
70 /// \return the kind of a feature.
71 FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
73 static std::string MY_KIND = FeaturesPlugin_Pipe::ID();
77 /// Creates a new part document if needed
78 FEATURESPLUGIN_EXPORT virtual void execute();
80 /// Request for initialization of data model of the feature: adding all attributes
81 FEATURESPLUGIN_EXPORT virtual void initAttributes();
83 /// Use plugin manager for features creation
84 FeaturesPlugin_Pipe();
87 void storeResult(const std::shared_ptr<GeomAPI_Shape> theBaseShape,
88 GeomAlgoAPI_Pipe& thePipeAlgo,
89 const int theResultIndex = 0);
91 void storeResult(const ListOfShape& theBaseShapes,
92 GeomAlgoAPI_Pipe& thePipeAlgo,
93 const int theResultIndex = 0);
95 void storeShapes(ResultBodyPtr theResultBody,
96 const GeomAPI_Shape::ShapeType theBaseShapeType,
97 const std::shared_ptr<GeomAPI_DataMapOfShapeShape> theMapOfSubShapes,
98 const ListOfShape& theShapes,
99 const std::string theName,