SHAPER 9.16.0
BuildPlugin_Interpolation.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 BuildPlugin_Interpolation_H_
21#define BuildPlugin_Interpolation_H_
22
23#include "BuildPlugin.h"
24
25#include <ModelAPI_Feature.h>
26
31{
32public:
35
37 inline static const std::string& ID()
38 {
39 static const std::string MY_ID("Interpolation");
40 return MY_ID;
41 }
42
44 inline static const std::string& CREATION_METHOD_ID()
45 {
46 static const std::string MY_CREATION_METHOD_ID("interpolation_method");
47 return MY_CREATION_METHOD_ID;
48 }
49
51 inline static const std::string& CREATION_METHOD_BY_SELECTION_ID()
52 {
53 static const std::string MY_CREATION_METHOD_BY_SELECTION_ID("by_selection");
54 return MY_CREATION_METHOD_BY_SELECTION_ID;
55 }
56
58 inline static const std::string& CREATION_METHOD_ANALYTICAL_ID()
59 {
60 static const std::string MY_CREATION_METHOD_ANALYTICAL_ID("analytical");
61 return MY_CREATION_METHOD_ANALYTICAL_ID;
62 }
63
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
72 inline static const std::string& CLOSED_ID()
73 {
74 static const std::string MY_CLOSED_ID("closed");
75 return MY_CLOSED_ID;
76 }
77
79 inline static const std::string& REORDER_ID()
80 {
81 static const std::string MY_REORDER_ID("reorder");
82 return MY_REORDER_ID;
83 }
84
86 inline static const std::string& USE_TANGENTS_ID()
87 {
88 static const std::string MY_USE_TANGENTS_ID("use_tangents");
89 return MY_USE_TANGENTS_ID;
90 }
91
93 inline static const std::string& TANGENT_START_ID()
94 {
95 static const std::string MY_TANGENT_START_ID("tangent_start");
96 return MY_TANGENT_START_ID;
97 }
98
100 inline static const std::string& TANGENT_END_ID()
101 {
102 static const std::string MY_TANGENT_END_ID("tangent_end");
103 return MY_TANGENT_END_ID;
104 }
105
107 inline static const std::string& XT_ID()
108 {
109 static const std::string MY_XT_ID("xt");
110 return MY_XT_ID;
111 }
112
114 inline static const std::string& YT_ID()
115 {
116 static const std::string MY_YT_ID("yt");
117 return MY_YT_ID;
118 }
119
121 inline static const std::string& ZT_ID()
122 {
123 static const std::string MY_ZT_ID("zt");
124 return MY_ZT_ID;
125 }
126
128 inline static const std::string& MINT_ID()
129 {
130 static const std::string MY_MINT_ID("mint");
131 return MY_MINT_ID;
132 }
133
135 inline static const std::string& MAXT_ID()
136 {
137 static const std::string MY_MAXT_ID("maxt");
138 return MY_MAXT_ID;
139 }
140
142 inline static const std::string& VARIABLE_ID()
143 {
144 static const std::string MY_VARIABLE_ID("variable");
145 return MY_VARIABLE_ID;
146 }
147
149 inline static const std::string& VALUE_ID()
150 {
151 static const std::string MY_VALUE_ID("value");
152 return MY_VALUE_ID;
153 }
154
156 inline static const std::string& EXPRESSION_ERROR_ID()
157 {
158 static const std::string MY_EXPRESSION_ERROR_ID("ExpressionError");
159 return MY_EXPRESSION_ERROR_ID;
160 }
161
163 inline static const std::string& NUMSTEP_ID()
164 {
165 static const std::string MY_NUMSTEP_ID("numstep");
166 return MY_NUMSTEP_ID;
167 }
168
170 inline static bool CLOSED_DEFAULT() { return false; }
171
173 inline static const std::string& ARGUMENTS_ID()
174 {
175 static const std::string MY_ARGUMENTS_ID("arguments");
176 return MY_ARGUMENTS_ID;
177 }
178
180 BUILDPLUGIN_EXPORT virtual const std::string& getKind()
181 {
182 static std::string MY_KIND = BuildPlugin_Interpolation::ID();
183 return MY_KIND;
184 }
185
187 BUILDPLUGIN_EXPORT virtual void initAttributes();
188
190 BUILDPLUGIN_EXPORT virtual void execute();
191
194 BUILDPLUGIN_EXPORT virtual void attributeChanged(const std::string& theID);
195
196 protected:
198 void evaluate(std::string& theError);
199
201 void updateCoordinates();
202
204 std::string outErrorMessage;
205
206};
207
208#endif
Feature for creation of interpolation curve from set of points.
Definition: BuildPlugin_Interpolation.h:31
static const std::string & VALUE_ID()
Attribute of parameter name of value.
Definition: BuildPlugin_Interpolation.h:149
static const std::string & TANGENT_END_ID()
Attribute name of tangent for end point.
Definition: BuildPlugin_Interpolation.h:100
virtual void initAttributes()
Request for initialization of data model of the feature: adding all attributes.
Definition: BuildPlugin_Interpolation.cpp:56
static const std::string & REORDER_ID()
Attribute name of reorder flag.
Definition: BuildPlugin_Interpolation.h:79
static bool CLOSED_DEFAULT()
Default value of the closed attribute.
Definition: BuildPlugin_Interpolation.h:170
BuildPlugin_Interpolation()
Use plugin manager for features creation.
Definition: BuildPlugin_Interpolation.cpp:51
static const std::string & CREATION_METHOD_ANALYTICAL_ID()
Attribute name of creation method analytical.
Definition: BuildPlugin_Interpolation.h:58
virtual void execute()
Creates a new part document if needed.
Definition: BuildPlugin_Interpolation.cpp:174
void evaluate(std::string &theError)
Evaluates the expression x(t), y(t),z(t) in value table.
Definition: BuildPlugin_Interpolation.cpp:311
static const std::string & NUMSTEP_ID()
Attribute name of number of steps.
Definition: BuildPlugin_Interpolation.h:163
void updateCoordinates()
Update coordinates x,y,z.
Definition: BuildPlugin_Interpolation.cpp:122
static const std::string & CREATION_METHOD_BY_SELECTION_ID()
Attribute name of creation method by selection.
Definition: BuildPlugin_Interpolation.h:51
static const std::string & EXPRESSION_ERROR_ID()
Attribute of parameter expression error.
Definition: BuildPlugin_Interpolation.h:156
virtual const std::string & getKind()
Definition: BuildPlugin_Interpolation.h:180
static const std::string & XT_ID()
Attribute name of x(t) equation.
Definition: BuildPlugin_Interpolation.h:107
virtual void attributeChanged(const std::string &theID)
Called on change of any argument-attribute of this object.
Definition: BuildPlugin_Interpolation.cpp:105
static const std::string & USE_TANGENTS_ID()
Attribute name of use tangents flag.
Definition: BuildPlugin_Interpolation.h:86
static const std::string & MAXT_ID()
Attribute name of max t.
Definition: BuildPlugin_Interpolation.h:135
static const std::string & YT_ID()
Attribute name of y(t) equation.
Definition: BuildPlugin_Interpolation.h:114
static const std::string & ZT_ID()
Attribute name of z(t) equation.
Definition: BuildPlugin_Interpolation.h:121
static const std::string & CREATION_METHOD_ID()
Attribute name of creation method.
Definition: BuildPlugin_Interpolation.h:44
static const std::string & CLOSED_ID()
Attribute name of closed flag.
Definition: BuildPlugin_Interpolation.h:72
static const std::string & MINT_ID()
Attribute name of min t.
Definition: BuildPlugin_Interpolation.h:128
static const std::string & ID()
Feature kind.
Definition: BuildPlugin_Interpolation.h:37
static const std::string & BASE_OBJECTS_ID()
Attribute name of base objects.
Definition: BuildPlugin_Interpolation.h:65
static const std::string & TANGENT_START_ID()
Attribute name of tangent for start point.
Definition: BuildPlugin_Interpolation.h:93
static const std::string & ARGUMENTS_ID()
List of references to the arguments of this expression.
Definition: BuildPlugin_Interpolation.h:173
std::string outErrorMessage
Output error for python interpreter.
Definition: BuildPlugin_Interpolation.h:204
static const std::string & VARIABLE_ID()
Attribute of parameter name of variable.
Definition: BuildPlugin_Interpolation.h:142
Feature function that represents the particular functionality of this operation.
Definition: ModelAPI_Feature.h:41