1 // Copyright (C) 2014-2017 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
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 #ifndef SketchPlugin_Fillet_H_
22 #define SketchPlugin_Fillet_H_
24 #include "SketchPlugin.h"
26 #include "SketchPlugin_SketchEntity.h"
28 #include <GeomAPI_IPresentable.h>
29 #include <GeomDataAPI_Point2D.h>
33 /// \class SketchPlugin_Fillet
35 /// \brief Feature for creation of a new arc filleting two objects which have
37 class SketchPlugin_Fillet: public SketchPlugin_SketchEntity, public GeomAPI_IPresentable
41 inline static const std::string& ID()
43 static const std::string MY_FEATURE_ID("SketchFillet");
47 /// Attribute name of fillet point.
48 inline static const std::string& FILLET_POINT_ID()
50 static const std::string ID("fillet_point");
54 /// \return the kind of a feature.
55 SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
57 static std::string MY_KIND = SketchPlugin_Fillet::ID();
61 /// \brief Creates a new part document if needed.
62 SKETCHPLUGIN_EXPORT virtual void execute();
64 /// \brief Request for initialization of data model of the feature: adding all attributes.
65 SKETCHPLUGIN_EXPORT virtual void initAttributes();
67 /// Returns the AIS preview
68 SKETCHPLUGIN_EXPORT virtual AISObjectPtr getAISObject(AISObjectPtr thePrevious);
70 /// Reimplemented from ModelAPI_Feature::isMacro().
72 SKETCHPLUGIN_EXPORT virtual bool isMacro() const {return true;}
74 SKETCHPLUGIN_EXPORT virtual bool isPreviewNeeded() const {return false;}
76 /// Reimplemented from SketchPlugin_Feature::move().
78 SKETCHPLUGIN_EXPORT virtual void move(const double, const double) {}
80 /// \brief Use plugin manager for features creation
81 SketchPlugin_Fillet();
84 bool calculateFilletParameters();
86 bool findFeaturesContainingFilletPoint(std::shared_ptr<GeomDataAPI_Point2D> theFilletPoint);
89 FeaturePtr myBaseFeatures[2];
90 std::string myFeatAttributes[4]; // attributes of features
92 bool myIsNotInversed[2]; // indicates which point the features share
94 std::shared_ptr<GeomAPI_XY> myCenterXY;
95 std::shared_ptr<GeomAPI_XY> myTangentXY1;
96 std::shared_ptr<GeomAPI_XY> myTangentXY2;