1 // Copyright (C) 2014-2021 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef BuildAPI_Interpolation_H_
21 #define BuildAPI_Interpolation_H_
25 #include <BuildPlugin_Interpolation.h>
27 #include <ModelHighAPI_Double.h>
28 #include <ModelHighAPI_Integer.h>
29 #include <ModelHighAPI_Interface.h>
30 #include <ModelHighAPI_Macro.h>
31 #include <ModelHighAPI_Selection.h>
33 class ModelHighAPI_Selection;
35 /// \class BuildAPI_Interpolation
36 /// \ingroup CPPHighAPI
37 /// \brief Interface for Interpolation feature.
38 class BuildAPI_Interpolation : public ModelHighAPI_Interface
41 /// Constructor without values.
43 explicit BuildAPI_Interpolation(const FeaturePtr& theFeature);
45 /// Constructor with values.
47 explicit BuildAPI_Interpolation(const FeaturePtr& theFeature,
48 const std::list<ModelHighAPI_Selection>& theBaseObjects,
49 const ModelHighAPI_Selection& theStartTangent,
50 const ModelHighAPI_Selection& theEndTangent,
51 const bool theIsClosed, const bool theIsToReorder);
53 /// Constructor with base objects, closed and reorder parameters.
55 explicit BuildAPI_Interpolation(const FeaturePtr& theFeature,
56 const std::list<ModelHighAPI_Selection>& theBaseObjects,
57 const bool theIsClosed, const bool theIsToReorder);
59 /// Constructor with expression analytical of X,Y andZ
61 explicit BuildAPI_Interpolation(const FeaturePtr& theFeature,
62 const std::string & theXTexpression,
63 const std::string & theYTexpression,
64 const std::string & theZTexpression,
65 const ModelHighAPI_Double& theMinT,
66 const ModelHighAPI_Double& theMaxT,
67 const ModelHighAPI_Integer& theNbStep);
71 virtual ~BuildAPI_Interpolation();
73 INTERFACE_13(BuildPlugin_Interpolation::ID(),
74 baseObjects, BuildPlugin_Interpolation::BASE_OBJECTS_ID(),
75 ModelAPI_AttributeSelectionList, /** Base objects */,
76 closed, BuildPlugin_Interpolation::CLOSED_ID(),
77 ModelAPI_AttributeBoolean, /** Closed flag */,
78 reorder, BuildPlugin_Interpolation::REORDER_ID(),
79 ModelAPI_AttributeBoolean, /** Reorder flag */,
80 useTangents, BuildPlugin_Interpolation::USE_TANGENTS_ID(),
81 ModelAPI_AttributeString, /** Use tangents flag */,
82 startTangent, BuildPlugin_Interpolation::TANGENT_START_ID(),
83 ModelAPI_AttributeSelection, /** Start point tangent */,
84 endTangent, BuildPlugin_Interpolation::TANGENT_END_ID(),
85 ModelAPI_AttributeSelection, /** End point tangent */,
86 xt, BuildPlugin_Interpolation::XT_ID(),
87 ModelAPI_AttributeString, /** xt expression*/,
88 yt, BuildPlugin_Interpolation::YT_ID(),
89 ModelAPI_AttributeString, /** yt expression*/,
90 zt, BuildPlugin_Interpolation::ZT_ID(),
91 ModelAPI_AttributeString, /** zt expression*/,
92 mint, BuildPlugin_Interpolation::MINT_ID(),
93 ModelAPI_AttributeDouble, /** Min*/,
94 maxt, BuildPlugin_Interpolation::MAXT_ID(),
95 ModelAPI_AttributeDouble, /** Max*/,
96 numstep, BuildPlugin_Interpolation::NUMSTEP_ID(),
97 ModelAPI_AttributeInteger, /** Number of steps*/,
98 creationmethod, BuildPlugin_Interpolation::CREATION_METHOD_ID(),
99 ModelAPI_AttributeString, /** Creation method*/)
101 /// Modify base attribute of the feature.
103 void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
106 BUILDAPI_EXPORT void setClosed(const bool theIsClosed);
109 BUILDAPI_EXPORT void setReorder(const bool theIsToReorder);
111 /// Set use tangents flag
112 BUILDAPI_EXPORT void setUseTangents(const bool theIsToUseTangents);
114 /// Set start and end tangents
115 BUILDAPI_EXPORT void setTangents(const ModelHighAPI_Selection& theStartTangent,
116 const ModelHighAPI_Selection& theEndTangent);
118 /// Dump wrapped feature
120 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
123 void execIfBaseNotEmpty();
126 /// Pointer on Interpolation object.
127 typedef std::shared_ptr<BuildAPI_Interpolation> InterpolationPtr;
129 /// \ingroup CPPHighAPI
130 /// \brief Create Interpolation feature.
132 InterpolationPtr addInterpolation(const std::shared_ptr<ModelAPI_Document>& thePart,
133 const std::list<ModelHighAPI_Selection>& theBaseObjects,
134 const bool theIsClosed = false,
135 const bool theIsToReorder = false);
137 /// \ingroup CPPHighAPI
138 /// \brief Create Interpolation feature using tangents.
140 InterpolationPtr addInterpolation(const std::shared_ptr<ModelAPI_Document>& thePart,
141 const std::list<ModelHighAPI_Selection>& theBaseObjects,
142 const ModelHighAPI_Selection& theStartTangent,
143 const ModelHighAPI_Selection& theEndTangent,
144 const bool theIsClosed = false,
145 const bool theIsToReorder = false);
147 /// \ingroup CPPHighAPI
148 /// \brief Create Interpolation feature using tangents.
150 InterpolationPtr addInterpolation(const std::shared_ptr<ModelAPI_Document>& thePart,
151 const std::string & theXTexpression,
152 const std::string & theYTexpression,
153 const std::string & theZTexpression,
154 const ModelHighAPI_Double& theMinT,
155 const ModelHighAPI_Double& theMaxT,
156 const ModelHighAPI_Integer& theNbStep);
158 #endif // BuildAPI_Interpolation_H_