Salome HOME
bos #20661 EDF 22847 - Move to the end
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_MacroBSpline.h
index 860c34f9de67397db0a9205fdde1b0d76b7d5c69..1c3aca6d7d7078e3b55eebf0dfc808af6851a9f6 100644 (file)
@@ -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
@@ -123,7 +123,13 @@ private:
   static void createAuxiliarySegment(std::shared_ptr<GeomDataAPI_Point2DArray> theBSplinePoles,
                                      const int thePoleIndex1,
                                      const int thePoleIndex2);
+  /// Set name of auxiliary feature representing the control polygon
+  static void assignDefaultNameForAux(FeaturePtr theAuxFeature,
+                                      std::shared_ptr<GeomDataAPI_Point2DArray> theBSplinePoles,
+                                      const int thePoleIndex1,
+                                      const int thePoleIndex2 = -1);
   friend class SketchPlugin_BSplineBase;
+  friend class SketchPlugin_CurveFitting;
 
 private:
   std::list<double> myKnots;
@@ -133,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
 {
@@ -150,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