SHAPER 9.16.0
FeaturesPlugin_Pipe.h
1// Copyright (C) 2014-2026 CEA, EDF
2//
3// This library is free software; you can redistribute it and/or
4// modify it under the terms of the GNU Lesser General Public
5// License as published by the Free Software Foundation; either
6// version 2.1 of the License, or (at your option) any later version.
7//
8// This library is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11// Lesser General Public License for more details.
12//
13// You should have received a copy of the GNU Lesser General Public
14// License along with this library; if not, write to the Free Software
15// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16//
17// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18//
19
20#ifndef FeaturesPlugin_Pipe_H_
21#define FeaturesPlugin_Pipe_H_
22
23#include "FeaturesPlugin.h"
24
25#include <GeomAlgoAPI_Pipe.h>
26
27#include <ModelAPI_Feature.h>
28#include <ModelAPI_ResultBody.h>
29
40{
41public:
43 inline static const std::string& ID()
44 {
45 static const std::string MY_FEATURE_ID("Pipe");
46 return MY_FEATURE_ID;
47 }
48
50 inline static const std::string& CREATION_METHOD()
51 {
52 static const std::string MY_CREATION_METHOD("creation_method");
53 return MY_CREATION_METHOD;
54 }
55
57 inline static const std::string& CREATION_METHOD_SIMPLE()
58 {
59 static const std::string MY_CREATION_METHOD("simple");
60 return MY_CREATION_METHOD;
61 }
62
64 inline static const std::string& CREATION_METHOD_BINORMAL()
65 {
66 static const std::string MY_CREATION_METHOD("binormal");
67 return MY_CREATION_METHOD;
68 }
69
71 inline static const std::string& CREATION_METHOD_LOCATIONS()
72 {
73 static const std::string MY_CREATION_METHOD("locations");
74 return MY_CREATION_METHOD;
75 }
76
78 inline static const std::string& BASE_OBJECTS_ID()
79 {
80 static const std::string MY_BASE_OBJECTS_ID("base_objects");
81 return MY_BASE_OBJECTS_ID;
82 }
83
85 inline static const std::string& PATH_OBJECT_ID()
86 {
87 static const std::string MY_PATH_OBJECT_ID("path_object");
88 return MY_PATH_OBJECT_ID;
89 }
90
92 inline static const std::string& BINORMAL_ID()
93 {
94 static const std::string MY_BINORMAL_ID("binormal");
95 return MY_BINORMAL_ID;
96 }
97
99 inline static const std::string& LOCATIONS_ID()
100 {
101 static const std::string MY_LOCATIONS_ID("locations_objects");
102 return MY_LOCATIONS_ID;
103 }
104
106 FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
107 {
108 static std::string MY_KIND = FeaturesPlugin_Pipe::ID();
109 return MY_KIND;
110 }
111
113 FEATURESPLUGIN_EXPORT virtual void execute();
114
116 FEATURESPLUGIN_EXPORT virtual void initAttributes();
117
120
121private:
122 void storeResult(const std::shared_ptr<GeomAPI_Shape> theBaseShape,
123 const std::shared_ptr<GeomAPI_Shape> thePathShape,
124 const std::shared_ptr<GeomAlgoAPI_Pipe> thePipeAlgo,
125 const int theResultIndex = 0);
126
127 void storeResult(const ListOfShape& theBaseShapes,
128 const std::shared_ptr<GeomAPI_Shape> thePathShape,
129 const std::shared_ptr<GeomAlgoAPI_Pipe> thePipeAlgo,
130 const int theResultIndex = 0);
131
132 void storeShapes(ResultBodyPtr theResultBody,
133 const GeomAPI_Shape::ShapeType theBaseShapeType,
134 const ListOfShape& theShapes,
135 const std::string theName);
136};
137
138#endif
Feature for creation of extrusion along a path.
Definition: FeaturesPlugin_Pipe.h:40
static const std::string & PATH_OBJECT_ID()
Attribute name of path object.
Definition: FeaturesPlugin_Pipe.h:85
static const std::string & LOCATIONS_ID()
Attribute name of locations.
Definition: FeaturesPlugin_Pipe.h:99
static const std::string & BINORMAL_ID()
Attribute name of Bi-Normal.
Definition: FeaturesPlugin_Pipe.h:92
static const std::string & ID()
Feature kind.
Definition: FeaturesPlugin_Pipe.h:43
static const std::string & BASE_OBJECTS_ID()
Attribute name of base objects.
Definition: FeaturesPlugin_Pipe.h:78
static const std::string & CREATION_METHOD_LOCATIONS()
Attribute name for creation method.
Definition: FeaturesPlugin_Pipe.h:71
FeaturesPlugin_Pipe()
Use plugin manager for features creation.
Definition: FeaturesPlugin_Pipe.cpp:47
virtual void execute()
Performs the algorithm and stores results it in the data structure.
Definition: FeaturesPlugin_Pipe.cpp:66
virtual const std::string & getKind()
Definition: FeaturesPlugin_Pipe.h:106
static const std::string & CREATION_METHOD_BINORMAL()
Attribute name for creation method.
Definition: FeaturesPlugin_Pipe.h:64
static const std::string & CREATION_METHOD_SIMPLE()
Attribute name for creation method.
Definition: FeaturesPlugin_Pipe.h:57
virtual void initAttributes()
Request for initialization of data model of the feature: adding all attributes.
Definition: FeaturesPlugin_Pipe.cpp:52
static const std::string & CREATION_METHOD()
Attribute name for creation method.
Definition: FeaturesPlugin_Pipe.h:50
ShapeType
Shape type enum.
Definition: GeomAPI_Shape.h:46
Feature function that represents the particular functionality of this operation.
Definition: ModelAPI_Feature.h:41