Salome HOME
Initial version of interface 'CurveCreator_ISection' was created for the curve sections.
[modules/geom.git] / src / CurveCreator / CurveCreator_Utils.hxx
index 0494fceeffe9c70c110c283622d2dc77467dbc6d..29393fa3f2c942de66168b7ed775dac9e01b08d0 100644 (file)
@@ -29,6 +29,7 @@
 #include <gp_Pnt.hxx>
 #include <Geom_Curve.hxx>
 #include <TopoDS_Shape.hxx>
+#include <TopoDS_Wire.hxx>
 #include <TColgp_HArray1OfPnt.hxx>
 #include <Geom_BSplineCurve.hxx>
 
@@ -133,10 +134,28 @@ public:
                                                  gp_Pnt& thePoint, gp_Pnt& thePoint1,
                                                  gp_Pnt& thePoint2 );
 
+  /**
+   * The algorithm builds the cubic B-spline passing through the points that the
+   * tangent vector in each given point P is calculated by the following way:
+   * if point P is preceded by a point A and is followed by a point B then
+   * the tangent vector is equal to (P - A) / |P - A| + (B - P) / |B - P|;
+   * if point P is preceded by a point A but is not followed by any point then
+   * the tangent vector is equal to P - A;
+   * if point P is followed by a point B but is not preceded by any point then
+   * the tangent vector is equal to B - P.
+   */
   CURVECREATOR_EXPORT static bool constructBSpline( const Handle(TColgp_HArray1OfPnt)& thePoints,
                                                     const Standard_Boolean theIsClosed,
                                                     Handle(Geom_BSplineCurve)& theBSpline );
 
+  /**
+   * Constructs the wire corresponding to the section.
+   */
+  CURVECREATOR_EXPORT static TopoDS_Wire ConstructWire(
+    Handle(TColgp_HArray1OfPnt) thePoints,
+    const bool theIsPolyline,
+    const bool theIsClosed);
+
 protected:
   /*
    * Returns whether the clicked point belong to the curve or has a very near projection