SHAPER  9.12.0
FeaturesAPI_Chamfer.h
1 // Copyright (C) 2017-2023 CEA, EDF
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 FeaturesAPI_Chamfer_H_
21 #define FeaturesAPI_Chamfer_H_
22 
23 #include "FeaturesAPI.h"
24 
25 #include <FeaturesPlugin_Chamfer.h>
26 
27 #include <ModelHighAPI_Interface.h>
28 #include <ModelHighAPI_Macro.h>
29 
32 
37 {
38 public:
40  FEATURESAPI_EXPORT
41  explicit FeaturesAPI_Chamfer(const std::shared_ptr<ModelAPI_Feature>& theFeature);
42 
44  FEATURESAPI_EXPORT
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);
50 
52  FEATURESAPI_EXPORT
53  virtual ~FeaturesAPI_Chamfer();
54 
55  INTERFACE_6(FeaturesPlugin_Chamfer::ID(),
56  creationMethod, FeaturesPlugin_Chamfer::CREATION_METHOD(),
74 
75 
76  FEATURESAPI_EXPORT
77  void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
78 
80  FEATURESAPI_EXPORT
81  void setDistances(const ModelHighAPI_Double& theD1, const ModelHighAPI_Double& theD2);
82 
84  FEATURESAPI_EXPORT
85  void setDistAngle(const ModelHighAPI_Double& theDistance, const ModelHighAPI_Double& theAngle);
86 
88  FEATURESAPI_EXPORT
89  virtual void dump(ModelHighAPI_Dumper& theDumper) const;
90 
91 private:
92  void execIfBaseNotEmpty();
93 };
94 
96 typedef std::shared_ptr<FeaturesAPI_Chamfer> ChamferPtr;
97 
100 FEATURESAPI_EXPORT
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);
107 
108 #endif // FeaturesAPI_Chamfer_H_
Interface for Chamfer feature.
Definition: FeaturesAPI_Chamfer.h:37
virtual ~FeaturesAPI_Chamfer()
Destructor.
Definition: FeaturesAPI_Chamfer.cpp:55
virtual std::shared_ptr< ModelAPI_AttributeString > creationMethod() const
Creation method.
Definition: FeaturesAPI_Chamfer.h:73
void setBase(const std::list< ModelHighAPI_Selection > &theBaseObjects)
Modify base objects of the chamfer.
Definition: FeaturesAPI_Chamfer.cpp:60
virtual void dump(ModelHighAPI_Dumper &theDumper) const
Dump wrapped feature.
Definition: FeaturesAPI_Chamfer.cpp:88
void setDistAngle(const ModelHighAPI_Double &theDistance, const ModelHighAPI_Double &theAngle)
Modify chamfer to have distance and angle.
Definition: FeaturesAPI_Chamfer.cpp:78
virtual std::shared_ptr< ModelAPI_AttributeDouble > d1() const
Value of the first distance chamfer.
Definition: FeaturesAPI_Chamfer.h:73
virtual std::shared_ptr< ModelAPI_AttributeDouble > d2() const
Value of the second distance chamfer.
Definition: FeaturesAPI_Chamfer.h:73
void setDistances(const ModelHighAPI_Double &theD1, const ModelHighAPI_Double &theD2)
Modify chamfer to have two distances.
Definition: FeaturesAPI_Chamfer.cpp:68
FeaturesAPI_Chamfer(const std::shared_ptr< ModelAPI_Feature > &theFeature)
Constructor without values.
Definition: FeaturesAPI_Chamfer.cpp:26
virtual std::shared_ptr< ModelAPI_AttributeSelectionList > baseObjects() const
Base objects.
Definition: FeaturesAPI_Chamfer.h:73
virtual std::shared_ptr< ModelAPI_AttributeDouble > angle() const
Angle chamfer.
Definition: FeaturesAPI_Chamfer.h:73
virtual std::shared_ptr< ModelAPI_AttributeDouble > d() const
Value of the distance chamfer.
Definition: FeaturesAPI_Chamfer.h:73
static const std::string & ANGLE_ID()
Attribute name of Angle.
Definition: FeaturesPlugin_Chamfer.h:93
static const std::string & OBJECT_LIST_ID()
Attribute name of main objects.
Definition: FeaturesPlugin_Chamfer.h:65
static const std::string & D2_ID()
Attribute name of D2.
Definition: FeaturesPlugin_Chamfer.h:79
static const std::string & D1_ID()
Attribute name of D1.
Definition: FeaturesPlugin_Chamfer.h:72
static const std::string & ID()
Feature kind.
Definition: FeaturesPlugin_Chamfer.h:33
static const std::string & D_ID()
Attribute name of D.
Definition: FeaturesPlugin_Chamfer.h:86
Attribute that contains real value with double precision.
Definition: ModelAPI_AttributeDouble.h:34
Attribute that contains list of references to the sub-shapes with possibility to manage them.
Definition: ModelAPI_AttributeSelectionList.h:37
API for the attribute that contains std (null terminated) string.
Definition: ModelAPI_AttributeString.h:33
Class for filling ModelAPI_AttributeDouble.
Definition: ModelHighAPI_Double.h:37
Dump engine for the model.
Definition: ModelHighAPI_Dumper.h:81
Base class for feature interfaces.
Definition: ModelHighAPI_Interface.h:42
Class for filling ModelAPI_AttributeSelection.
Definition: ModelHighAPI_Selection.h:49
ChamferPtr addChamfer(const std::shared_ptr< ModelAPI_Document > &thePart, const std::list< ModelHighAPI_Selection > &theBaseObjects, const bool performDistances, const ModelHighAPI_Double &theVal1, const ModelHighAPI_Double &theVal2, const bool keepSubResults=false)
Create Chamfer feature.
Definition: FeaturesAPI_Chamfer.cpp:125