1 // Copyright (C) 2014-2019 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_Interface.h>
28 #include <ModelHighAPI_Macro.h>
29 #include <ModelHighAPI_Selection.h>
31 class ModelHighAPI_Selection;
33 /// \class BuildAPI_Interpolation
34 /// \ingroup CPPHighAPI
35 /// \brief Interface for Interpolation feature.
36 class BuildAPI_Interpolation : public ModelHighAPI_Interface
39 /// Constructor without values.
41 explicit BuildAPI_Interpolation(const FeaturePtr& theFeature);
43 /// Constructor with values.
45 explicit BuildAPI_Interpolation(const FeaturePtr& theFeature,
46 const std::list<ModelHighAPI_Selection>& theBaseObjects,
47 const ModelHighAPI_Selection& theStartTangent,
48 const ModelHighAPI_Selection& theEndTangent,
49 const bool theIsClosed, const bool theIsToReorder);
51 /// Constructor with base objects, closed and reorder parameters.
53 explicit BuildAPI_Interpolation(const FeaturePtr& theFeature,
54 const std::list<ModelHighAPI_Selection>& theBaseObjects,
55 const bool theIsClosed, const bool theIsToReorder);
59 virtual ~BuildAPI_Interpolation();
61 INTERFACE_6(BuildPlugin_Interpolation::ID(),
62 baseObjects, BuildPlugin_Interpolation::BASE_OBJECTS_ID(),
63 ModelAPI_AttributeSelectionList, /** Base objects */,
64 closed, BuildPlugin_Interpolation::CLOSED_ID(),
65 ModelAPI_AttributeBoolean, /** Closed flag */,
66 reorder, BuildPlugin_Interpolation::REORDER_ID(),
67 ModelAPI_AttributeBoolean, /** Reorder flag */,
68 useTangents, BuildPlugin_Interpolation::USE_TANGENTS_ID(),
69 ModelAPI_AttributeString, /** Use tangents flag */,
70 startTangent, BuildPlugin_Interpolation::TANGENT_START_ID(),
71 ModelAPI_AttributeSelection, /** Start point tangent */,
72 endTangent, BuildPlugin_Interpolation::TANGENT_END_ID(),
73 ModelAPI_AttributeSelection, /** End point tangent */)
75 /// Modify base attribute of the feature.
77 void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
80 BUILDAPI_EXPORT void setClosed(const bool theIsClosed);
83 BUILDAPI_EXPORT void setReorder(const bool theIsToReorder);
85 /// Set use tangents flag
86 BUILDAPI_EXPORT void setUseTangents(const bool theIsToUseTangents);
88 /// Set start and end tangents
89 BUILDAPI_EXPORT void setTangents(const ModelHighAPI_Selection& theStartTangent,
90 const ModelHighAPI_Selection& theEndTangent);
92 /// Dump wrapped feature
94 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
97 void execIfBaseNotEmpty();
100 /// Pointer on Interpolation object.
101 typedef std::shared_ptr<BuildAPI_Interpolation> InterpolationPtr;
103 /// \ingroup CPPHighAPI
104 /// \brief Create Interpolation feature.
106 InterpolationPtr addInterpolation(const std::shared_ptr<ModelAPI_Document>& thePart,
107 const std::list<ModelHighAPI_Selection>& theBaseObjects,
108 const bool theIsClosed = false,
109 const bool theIsToReorder = false);
111 /// \ingroup CPPHighAPI
112 /// \brief Create Interpolation feature using tangents.
114 InterpolationPtr addInterpolation(const std::shared_ptr<ModelAPI_Document>& thePart,
115 const std::list<ModelHighAPI_Selection>& theBaseObjects,
116 const ModelHighAPI_Selection& theStartTangent,
117 const ModelHighAPI_Selection& theEndTangent,
118 const bool theIsClosed = false,
119 const bool theIsToReorder = false);
121 #endif // BuildAPI_Interpolation_H_