Salome HOME
Fix for the issue #2753 : error when dump/load script
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_Fillet.h
index b25e0257d0f1a2d05021032350c4e72d4cf86385..14ea9f8d61e75f790cee965ff6fe906721882286 100644 (file)
@@ -1,8 +1,22 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
-
-// File:    SketchPlugin_Fillet.h
-// Created: 19 Mar 2015
-// Author:  Artem ZHIDKOV
+// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or
+// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+//
 
 #ifndef SketchPlugin_Fillet_H_
 #define SketchPlugin_Fillet_H_
@@ -12,6 +26,7 @@
 #include "SketchPlugin_SketchEntity.h"
 
 #include <GeomAPI_IPresentable.h>
+#include <GeomDataAPI_Point2D.h>
 
 class GeomAPI_XY;
 
@@ -54,17 +69,36 @@ class SketchPlugin_Fillet: public SketchPlugin_SketchEntity, public GeomAPI_IPre
 
   /// Reimplemented from ModelAPI_Feature::isMacro().
   /// \returns true
-  SKETCHPLUGIN_EXPORT virtual bool isMacro() const {return true;};
+  SKETCHPLUGIN_EXPORT virtual bool isMacro() const {return true;}
 
-  SKETCHPLUGIN_EXPORT virtual bool isPreviewNeeded() const {return false;};
+  SKETCHPLUGIN_EXPORT virtual bool isPreviewNeeded() const {return false;}
 
   /// Reimplemented from SketchPlugin_Feature::move().
   /// Do nothing.
-  SKETCHPLUGIN_EXPORT virtual void move(const double theDeltaX, const double theDeltaY) {};
+  SKETCHPLUGIN_EXPORT virtual void move(const double, const double) {}
 
   /// \brief Use plugin manager for features creation
   SketchPlugin_Fillet();
 
+private:
+  bool calculateFilletParameters();
+
+  /// Create new feature presenting a fillet arc and initialize its parameters
+  FeaturePtr createFilletArc();
+
+  /// Create point representing fillet apex and additional coincidences with fillet features
+  FeaturePtr createFilletApex(const std::shared_ptr<GeomAPI_Pnt2d>& theCoordinates);
+
+  /// Remove references to a feature participating in fillet,
+  /// but transfer "distance" constraints to features after fillet
+  /// \param[in, out] theFeaturesToRemove  features referred to fillet edges
+  ///                 (all distances will be processed and removed from this list)
+  /// \param[in]      theFilletPoints      fillet points from participating features
+  void  removeReferencesButKeepDistances(std::set<FeaturePtr>& theFeaturesToRemove,
+                                         const AttributePoint2DPtr theFilletPoints[2]);
+
+  bool findFeaturesContainingFilletPoint(std::shared_ptr<GeomDataAPI_Point2D> theFilletPoint);
+
 private:
     FeaturePtr myBaseFeatures[2];
     std::string myFeatAttributes[4]; // attributes of features