1 // Copyright (C) 2014-2017 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
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 #ifndef BuildAPI_Interpolation_H_
22 #define BuildAPI_Interpolation_H_
26 #include <BuildPlugin_Interpolation.h>
28 #include <ModelHighAPI_Interface.h>
29 #include <ModelHighAPI_Macro.h>
30 #include <ModelHighAPI_Selection.h>
32 class ModelHighAPI_Selection;
34 /// \class BuildAPI_Interpolation
35 /// \ingroup CPPHighAPI
36 /// \brief Interface for Interpolation feature.
37 class BuildAPI_Interpolation : public ModelHighAPI_Interface
40 /// Constructor without values.
42 explicit BuildAPI_Interpolation(const FeaturePtr& theFeature);
44 /// Constructor with values.
46 explicit BuildAPI_Interpolation(const FeaturePtr& theFeature,
47 const std::list<ModelHighAPI_Selection>& theBaseObjects,
48 const ModelHighAPI_Selection& theStartTangent,
49 const ModelHighAPI_Selection& theEndTangent,
50 const bool theIsClosed, const bool theIsToReorder);
52 /// Constructor with base objects, closed and reorder parameters.
54 explicit BuildAPI_Interpolation(const FeaturePtr& theFeature,
55 const std::list<ModelHighAPI_Selection>& theBaseObjects,
56 const bool theIsClosed, const bool theIsToReorder);
60 virtual ~BuildAPI_Interpolation();
62 INTERFACE_6(BuildPlugin_Interpolation::ID(),
63 baseObjects, BuildPlugin_Interpolation::BASE_OBJECTS_ID(),
64 ModelAPI_AttributeSelectionList, /** Base objects */,
65 closed, BuildPlugin_Interpolation::CLOSED_ID(),
66 ModelAPI_AttributeBoolean, /** Closed flag */,
67 reorder, BuildPlugin_Interpolation::REORDER_ID(),
68 ModelAPI_AttributeBoolean, /** Reorder flag */,
69 useTangents, BuildPlugin_Interpolation::USE_TANGENTS_ID(),
70 ModelAPI_AttributeString, /** Use tangents flag */,
71 startTangent, BuildPlugin_Interpolation::TANGENT_START_ID(),
72 ModelAPI_AttributeSelection, /** Start point tangent */,
73 endTangent, BuildPlugin_Interpolation::TANGENT_END_ID(),
74 ModelAPI_AttributeSelection, /** End point tangent */)
76 /// Modify base attribute of the feature.
78 void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
81 BUILDAPI_EXPORT void setClosed(const bool theIsClosed);
84 BUILDAPI_EXPORT void setReorder(const bool theIsToReorder);
86 /// Set use tangents flag
87 BUILDAPI_EXPORT void setUseTangents(const bool theIsToUseTangents);
89 /// Set start and end tangents
90 BUILDAPI_EXPORT void setTangents(const ModelHighAPI_Selection& theStartTangent,
91 const ModelHighAPI_Selection& theEndTangent);
93 /// Dump wrapped feature
95 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
98 void execIfBaseNotEmpty();
101 /// Pointer on Interpolation object.
102 typedef std::shared_ptr<BuildAPI_Interpolation> InterpolationPtr;
104 /// \ingroup CPPHighAPI
105 /// \brief Create Interpolation feature.
107 InterpolationPtr addInterpolation(const std::shared_ptr<ModelAPI_Document>& thePart,
108 const std::list<ModelHighAPI_Selection>& theBaseObjects,
109 const bool theIsClosed = false,
110 const bool theIsToReorder = false);
112 /// \ingroup CPPHighAPI
113 /// \brief Create Interpolation feature using tangents.
115 InterpolationPtr addInterpolation(const std::shared_ptr<ModelAPI_Document>& thePart,
116 const std::list<ModelHighAPI_Selection>& theBaseObjects,
117 const ModelHighAPI_Selection& theStartTangent,
118 const ModelHighAPI_Selection& theEndTangent,
119 const bool theIsClosed = false,
120 const bool theIsToReorder = false);
122 #endif // BuildAPI_Interpolation_H_