Salome HOME
Merge remote-tracking branch 'remotes/origin/HigherLevelObjectsHistory'
[modules/shaper.git] / src / BuildAPI / BuildAPI_Interpolation.h
1 // Copyright (C) 2014-2019  CEA/DEN, EDF R&D
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 BuildAPI_Interpolation_H_
21 #define BuildAPI_Interpolation_H_
22
23 #include "BuildAPI.h"
24
25 #include <BuildPlugin_Interpolation.h>
26
27 #include <ModelHighAPI_Interface.h>
28 #include <ModelHighAPI_Macro.h>
29 #include <ModelHighAPI_Selection.h>
30
31 class ModelHighAPI_Selection;
32
33 /// \class BuildAPI_Interpolation
34 /// \ingroup CPPHighAPI
35 /// \brief Interface for Interpolation feature.
36 class BuildAPI_Interpolation : public ModelHighAPI_Interface
37 {
38 public:
39   /// Constructor without values.
40   BUILDAPI_EXPORT
41     explicit BuildAPI_Interpolation(const FeaturePtr& theFeature);
42
43   /// Constructor with values.
44   BUILDAPI_EXPORT
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);
50
51   /// Constructor with base objects, closed and reorder parameters.
52   BUILDAPI_EXPORT
53     explicit BuildAPI_Interpolation(const FeaturePtr& theFeature,
54                                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
55                                     const bool theIsClosed, const bool theIsToReorder);
56
57   /// Destructor.
58   BUILDAPI_EXPORT
59   virtual ~BuildAPI_Interpolation();
60
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 */)
74
75   /// Modify base attribute of the feature.
76   BUILDAPI_EXPORT
77   void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
78
79   /// Set closed flag
80   BUILDAPI_EXPORT void setClosed(const bool theIsClosed);
81
82   /// Set reorder flag
83   BUILDAPI_EXPORT void setReorder(const bool theIsToReorder);
84
85   /// Set use tangents flag
86   BUILDAPI_EXPORT void setUseTangents(const bool theIsToUseTangents);
87
88   /// Set start and end tangents
89   BUILDAPI_EXPORT void setTangents(const ModelHighAPI_Selection& theStartTangent,
90                                    const ModelHighAPI_Selection& theEndTangent);
91
92   /// Dump wrapped feature
93   BUILDAPI_EXPORT
94   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
95
96 private:
97   void execIfBaseNotEmpty();
98 };
99
100 /// Pointer on Interpolation object.
101 typedef std::shared_ptr<BuildAPI_Interpolation> InterpolationPtr;
102
103 /// \ingroup CPPHighAPI
104 /// \brief Create Interpolation feature.
105 BUILDAPI_EXPORT
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);
110
111 /// \ingroup CPPHighAPI
112 /// \brief Create Interpolation feature using tangents.
113 BUILDAPI_EXPORT
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);
120
121 #endif // BuildAPI_Interpolation_H_