Tulip  5.2.0
Large graphs analysis and drawing
GlCubicBSplineInterpolation.h
1 /*
2  *
3  * This file is part of Tulip (http://tulip.labri.fr)
4  *
5  * Authors: David Auber and the Tulip development Team
6  * from LaBRI, University of Bordeaux
7  *
8  * Tulip is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation, either version 3
11  * of the License, or (at your option) any later version.
12  *
13  * Tulip is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  * See the GNU General Public License for more details.
17  *
18  */
19 ///@cond DOXYGEN_HIDDEN
20 
21 #include <tulip/GlOpenUniformCubicBSpline.h>
22 
23 namespace tlp {
24 
25 /**
26  * A class to draw a curve interpolating a set of points with C^2 continuity
27  *
28  * This class allows to draw a cubic B-spline interpolating a set of points. The resulting curve
29  * is C^2 continous, so there is no discontinuities in curvature.
30  */
31 class TLP_GL_SCOPE GlCubicBSplineInterpolation : public GlOpenUniformCubicBSpline {
32 
33 public:
34  /**
35  * GlCubicBSplineInterpolation constructor
36  *
37  * \param pointsToInterpolate the set of points to interpolate
38  * \param startColor the color at the start of the curve
39  * \param endColor the color at the end of the curve
40  * \param startSize the width at the start of the curve
41  * \param endSize the width at the end of the curve
42  * \param nbCurvePoints the number of curve points to generate
43  */
44  GlCubicBSplineInterpolation(const std::vector<Coord> &pointsToInterpolate,
45  const Color &startColor, const Color &endColor, const float startSize,
46  const float endSize, const unsigned int nbCurvePoints = 100);
47 
48 private:
49  std::vector<Coord>
50  constructInterpolatingCubicBSpline(const std::vector<Coord> &pointsToInterpolate);
51 };
52 }
53 ///@endcond