Salome HOME
Issue #2026: Removal of construction lines automatically created by Fillet
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_Fillet.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:    SketchPlugin_Fillet.h
4 // Created: 19 Mar 2015
5 // Author:  Artem ZHIDKOV
6
7 #ifndef SketchPlugin_Fillet_H_
8 #define SketchPlugin_Fillet_H_
9
10 #include "SketchPlugin.h"
11
12 #include "SketchPlugin_SketchEntity.h"
13
14 #include <GeomAPI_IPresentable.h>
15
16 class GeomAPI_XY;
17
18 /// \class SketchPlugin_Fillet
19 /// \ingroup Plugins
20 /// \brief Feature for creation of a new arc filleting two objects which have
21 /// coincident point.
22 class SketchPlugin_Fillet: public SketchPlugin_SketchEntity, public GeomAPI_IPresentable
23 {
24  public:
25   /// Feature kind.
26   inline static const std::string& ID()
27   {
28     static const std::string MY_FEATURE_ID("SketchFillet");
29     return MY_FEATURE_ID;
30   }
31
32   /// Attribute name of fillet point.
33   inline static const std::string& FILLET_POINT_ID()
34   {
35     static const std::string ID("fillet_point");
36     return ID;
37   }
38
39   /// \return the kind of a feature.
40   SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
41   {
42     static std::string MY_KIND = SketchPlugin_Fillet::ID();
43     return MY_KIND;
44   }
45
46   /// \brief Creates a new part document if needed.
47   SKETCHPLUGIN_EXPORT virtual void execute();
48
49   /// \brief Request for initialization of data model of the feature: adding all attributes.
50   SKETCHPLUGIN_EXPORT virtual void initAttributes();
51
52   /// Returns the AIS preview
53   SKETCHPLUGIN_EXPORT virtual AISObjectPtr getAISObject(AISObjectPtr thePrevious);
54
55   /// Reimplemented from ModelAPI_Feature::isMacro().
56   /// \returns true
57   SKETCHPLUGIN_EXPORT virtual bool isMacro() const {return true;};
58
59   SKETCHPLUGIN_EXPORT virtual bool isPreviewNeeded() const {return false;};
60
61   /// Reimplemented from SketchPlugin_Feature::move().
62   /// Do nothing.
63   SKETCHPLUGIN_EXPORT virtual void move(const double theDeltaX, const double theDeltaY) {};
64
65   /// \brief Use plugin manager for features creation
66   SketchPlugin_Fillet();
67
68 private:
69     FeaturePtr myBaseFeatures[2];
70     std::string myFeatAttributes[4]; // attributes of features
71     bool myIsReversed;
72     bool myIsNotInversed[2]; // indicates which point the features share
73     bool myFilletCreated;
74     std::shared_ptr<GeomAPI_XY> myCenterXY;
75     std::shared_ptr<GeomAPI_XY> myTangentXY1;
76     std::shared_ptr<GeomAPI_XY> myTangentXY2;
77 };
78
79 #endif