Tulip  4.6.0
Better Visualization Through Research
library/tulip-ogl/include/tulip/GlCubicBSplineInterpolation.h
00001 /*
00002  *
00003  * This file is part of Tulip (www.tulip-software.org)
00004  *
00005  * Authors: David Auber and the Tulip development Team
00006  * from LaBRI, University of Bordeaux
00007  *
00008  * Tulip is free software; you can redistribute it and/or modify
00009  * it under the terms of the GNU Lesser General Public License
00010  * as published by the Free Software Foundation, either version 3
00011  * of the License, or (at your option) any later version.
00012  *
00013  * Tulip is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00016  * See the GNU General Public License for more details.
00017  *
00018  */
00019 ///@cond DOXYGEN_HIDDEN
00020 
00021 
00022 #include <tulip/GlOpenUniformCubicBSpline.h>
00023 
00024 namespace tlp {
00025 
00026 /**
00027  * A class to draw a curve interpolating a set of points with C^2 continuity
00028  *
00029  * This class allows to draw a cubic B-spline interpolating a set of points. The resulting curve
00030  * is C^2 continous, so there is no discontinuities in curvature.
00031  */
00032 class TLP_GL_SCOPE GlCubicBSplineInterpolation : public GlOpenUniformCubicBSpline {
00033 
00034 public :
00035 
00036   /**
00037    * GlCubicBSplineInterpolation constructor
00038    *
00039    * \param pointsToInterpolate the set of points to interpolate
00040    * \param startColor the color at the start of the curve
00041    * \param endColor the color at the end of the curve
00042    * \param startSize the width at the start of the curve
00043    * \param endSize the width at the end of the curve
00044    * \param nbCurvePoints the number of curve points to generate
00045    */
00046   GlCubicBSplineInterpolation(const std::vector<Coord> &pointsToInterpolate, const Color &startColor, const Color &endColor,
00047                               const float startSize, const float endSize, const unsigned int nbCurvePoints = 100);
00048 
00049 
00050 private :
00051 
00052   std::vector<Coord> constructInterpolatingCubicBSpline(const std::vector<Coord> &pointsToInterpolate);
00053 
00054 };
00055 
00056 }
00057 ///@endcond
 All Classes Files Functions Variables Enumerations Enumerator Properties