Tulip  5.1.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 
22 #include <tulip/GlOpenUniformCubicBSpline.h>
23 
24 namespace tlp {
25 
26 /**
27  * A class to draw a curve interpolating a set of points with C^2 continuity
28  *
29  * This class allows to draw a cubic B-spline interpolating a set of points. The resulting curve
30  * is C^2 continous, so there is no discontinuities in curvature.
31  */
32 class TLP_GL_SCOPE GlCubicBSplineInterpolation : public GlOpenUniformCubicBSpline {
33 
34 public :
35 
36  /**
37  * GlCubicBSplineInterpolation constructor
38  *
39  * \param pointsToInterpolate the set of points to interpolate
40  * \param startColor the color at the start of the curve
41  * \param endColor the color at the end of the curve
42  * \param startSize the width at the start of the curve
43  * \param endSize the width at the end of the curve
44  * \param nbCurvePoints the number of curve points to generate
45  */
46  GlCubicBSplineInterpolation(const std::vector<Coord> &pointsToInterpolate, const Color &startColor, const Color &endColor,
47  const float startSize, const float endSize, const unsigned int nbCurvePoints = 100);
48 
49 
50 private :
51 
52  std::vector<Coord> constructInterpolatingCubicBSpline(const std::vector<Coord> &pointsToInterpolate);
53 
54 };
55 
56 }
57 ///@endcond