Salome HOME
Merge commit 'f709219506b7cd587e94abc5ebed18d629df92d8'
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_MacroBSpline.h
index d3333255335118a5b3319982d9b27482f65a3238..106a3450c349dd309f459530a815a3bde662ee4b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2019-2020  CEA/DEN, EDF R&D
+// Copyright (C) 2019-2022  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
@@ -38,8 +38,7 @@ class GeomDataAPI_Point2DArray;
  * \brief Feature for creation of the new B-spline in Sketch.
  */
 class SketchPlugin_MacroBSpline : public SketchPlugin_SketchEntity,
-                                  public GeomAPI_IPresentable,
-                                  public ModelAPI_IReentrant
+                                  public GeomAPI_IPresentable
 {
 public:
   /// B-spline macro feature kind
@@ -100,10 +99,6 @@ public:
 
   SKETCHPLUGIN_EXPORT virtual bool isPreviewNeeded() const {return false;};
 
-  /// Apply information of the message to current object. It fills reference object,
-  /// tangent type and tangent point refence in case of tangent arc
-  virtual std::string processEvent(const std::shared_ptr<Events_Message>& theMessage);
-
   /// Use plugin manager for features creation
   SketchPlugin_MacroBSpline();
 
@@ -113,7 +108,12 @@ protected:
 private:
   FeaturePtr createBSplineFeature();
 
-  void createControlPolygon(FeaturePtr theBSpline, std::list<FeaturePtr>& thePoles);
+  /// Create control polygon for the B-spline and returns the list of its poles
+  static void createControlPolygon(FeaturePtr theBSpline,
+                                   bool thePeriodic,
+                                   std::list<FeaturePtr>& thePoles);
+
+  /// Create additional coincidences if other features were selected while creating the B-spline
   void constraintsForPoles(const std::list<FeaturePtr>& thePoles);
 
   /// Create Point feature coincident with the B-spline pole
@@ -129,6 +129,7 @@ private:
                                       const int thePoleIndex1,
                                       const int thePoleIndex2 = -1);
   friend class SketchPlugin_BSplineBase;
+  friend class SketchPlugin_CurveFitting;
 
 private:
   std::list<double> myKnots;
@@ -138,9 +139,9 @@ private:
 };
 
 
-/**\class SketchPlugin_MacroBSpline
+/**\class SketchPlugin_MacroBSplinePeriodic
 * \ingroup Plugins
-* \brief Feature for creation of the new B-spline in Sketch.
+* \brief Feature for creation of the new periodic B-spline in Sketch.
 */
 class SketchPlugin_MacroBSplinePeriodic : public SketchPlugin_MacroBSpline
 {
@@ -155,7 +156,7 @@ public:
   /// Returns the kind of a feature
   SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
   {
-    return SketchPlugin_MacroBSpline::ID();
+    return SketchPlugin_MacroBSplinePeriodic::ID();
   }
 
   /// Use plugin manager for features creation