1 // Copyright (C) 2017-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 FeaturesAPI_Chamfer_H_
21 #define FeaturesAPI_Chamfer_H_
23 #include "FeaturesAPI.h"
25 #include <FeaturesPlugin_Chamfer.h>
27 #include <ModelHighAPI_Interface.h>
28 #include <ModelHighAPI_Macro.h>
30 class ModelHighAPI_Double;
31 class ModelHighAPI_Selection;
33 /// \class FeaturesAPI_Chamfer
34 /// \ingroup CPPHighAPI
35 /// \brief Interface for Chamfer feature.
36 class FeaturesAPI_Chamfer: public ModelHighAPI_Interface
39 /// Constructor without values.
41 explicit FeaturesAPI_Chamfer(const std::shared_ptr<ModelAPI_Feature>& theFeature);
43 /// Constructor with values.
45 explicit FeaturesAPI_Chamfer(const std::shared_ptr<ModelAPI_Feature>& theFeature,
46 const std::list<ModelHighAPI_Selection>& theBaseObjects,
47 const bool performDistances,
48 const ModelHighAPI_Double& aVal1,
49 const ModelHighAPI_Double& aVal2);
53 virtual ~FeaturesAPI_Chamfer();
55 INTERFACE_6(FeaturesPlugin_Chamfer::ID(),
56 creationMethod, FeaturesPlugin_Chamfer::CREATION_METHOD(),
57 ModelAPI_AttributeString,
58 /** Creation method */,
59 baseObjects, FeaturesPlugin_Chamfer::OBJECT_LIST_ID(),
60 ModelAPI_AttributeSelectionList,
62 d1, FeaturesPlugin_Chamfer::D1_ID(),
63 ModelAPI_AttributeDouble,
64 /** Value of the first distance chamfer */,
65 d2, FeaturesPlugin_Chamfer::D2_ID(),
66 ModelAPI_AttributeDouble,
67 /** Value of the second distance chamfer */,
68 d, FeaturesPlugin_Chamfer::D_ID(),
69 ModelAPI_AttributeDouble,
70 /** Value of the distance chamfer */,
71 angle, FeaturesPlugin_Chamfer::ANGLE_ID(),
72 ModelAPI_AttributeDouble,
75 /// Modify base objects of the chamfer.
77 void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
79 /// Modify chamfer to have two distances
81 void setDistances(const ModelHighAPI_Double& theD1, const ModelHighAPI_Double& theD2);
83 /// Modify chamfer to have distance and angle
85 void setDistAngle(const ModelHighAPI_Double& theDistance, const ModelHighAPI_Double& theAngle);
87 /// Dump wrapped feature
89 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
92 void execIfBaseNotEmpty();
95 /// Pointer on Chamfer object.
96 typedef std::shared_ptr<FeaturesAPI_Chamfer> ChamferPtr;
98 /// \ingroup CPPHighAPI
99 /// \brief Create Chamfer feature.
101 ChamferPtr addChamfer(const std::shared_ptr<ModelAPI_Document>& thePart,
102 const std::list<ModelHighAPI_Selection>& theBaseObjects,
103 const bool performDistances,
104 const ModelHighAPI_Double& theVal1,
105 const ModelHighAPI_Double& theVal2,
106 const bool keepSubResults = false);
108 #endif // FeaturesAPI_Chamfer_H_