1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 // File: SketchPlugin_Fillet.h
4 // Created: 19 Mar 2015
5 // Author: Artem ZHIDKOV
7 #ifndef SketchPlugin_Fillet_H_
8 #define SketchPlugin_Fillet_H_
10 #include "SketchPlugin.h"
12 #include "SketchPlugin_SketchEntity.h"
14 #include <GeomAPI_IPresentable.h>
15 #include <GeomDataAPI_Point2D.h>
19 /// \class SketchPlugin_Fillet
21 /// \brief Feature for creation of a new arc filleting two objects which have
23 class SketchPlugin_Fillet: public SketchPlugin_SketchEntity, public GeomAPI_IPresentable
27 inline static const std::string& ID()
29 static const std::string MY_FEATURE_ID("SketchFillet");
33 /// Attribute name of fillet point.
34 inline static const std::string& FILLET_POINT_ID()
36 static const std::string ID("fillet_point");
40 /// \return the kind of a feature.
41 SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
43 static std::string MY_KIND = SketchPlugin_Fillet::ID();
47 /// \brief Creates a new part document if needed.
48 SKETCHPLUGIN_EXPORT virtual void execute();
50 /// \brief Request for initialization of data model of the feature: adding all attributes.
51 SKETCHPLUGIN_EXPORT virtual void initAttributes();
53 /// Returns the AIS preview
54 SKETCHPLUGIN_EXPORT virtual AISObjectPtr getAISObject(AISObjectPtr thePrevious);
56 /// Reimplemented from ModelAPI_Feature::isMacro().
58 SKETCHPLUGIN_EXPORT virtual bool isMacro() const {return true;};
60 SKETCHPLUGIN_EXPORT virtual bool isPreviewNeeded() const {return false;};
62 /// Reimplemented from SketchPlugin_Feature::move().
64 SKETCHPLUGIN_EXPORT virtual void move(const double theDeltaX, const double theDeltaY) {};
66 /// \brief Use plugin manager for features creation
67 SketchPlugin_Fillet();
70 bool calculateFilletParameters();
72 bool findFeaturesContainingFilletPoint(std::shared_ptr<GeomDataAPI_Point2D> theFilletPoint);
75 FeaturePtr myBaseFeatures[2];
76 std::string myFeatAttributes[4]; // attributes of features
78 bool myIsNotInversed[2]; // indicates which point the features share
80 std::shared_ptr<GeomAPI_XY> myCenterXY;
81 std::shared_ptr<GeomAPI_XY> myTangentXY1;
82 std::shared_ptr<GeomAPI_XY> myTangentXY2;