20 #ifndef GLCATMULLROMCURVE_H_
21 #define GLCATMULLROMCURVE_H_
25 #include <tulip/AbstractGlCurve.h>
44 enum ParameterizationType { UNIFORM, CHORD_LENGTH, CENTRIPETAL };
64 const Color &endColor,
const float startSize,
const float endSize,
65 const bool closedCurve =
false,
const unsigned int nbCurvePoints = 200,
66 const ParameterizationType paramType = CENTRIPETAL);
70 void setParameterizationType(
const ParameterizationType paramType) {
71 this->paramType = paramType;
74 void drawCurve(std::vector<Coord> &controlPoints,
const Color &startColor,
const Color &endColor,
75 const float startSize,
const float endSize,
76 const unsigned int nbCurvePoints = 200)
override;
78 void setClosedCurve(
const bool closedCurve) {
79 this->closedCurve = closedCurve;
83 void setCurveVertexShaderRenderingSpecificParameters()
override;
85 Coord computeCurvePointOnCPU(
const std::vector<Coord> &controlPoints,
float t)
override;
87 void computeCurvePointsOnCPU(
const std::vector<Coord> &controlPoints,
88 std::vector<Coord> &curvePoints,
89 unsigned int nbCurvePoints)
override;
95 ParameterizationType paramType;
A class to draw a Catmull-Rom curve.
GlCatmullRomCurve(const std::vector< Coord > &controlPoints, const Color &startColor, const Color &endColor, const float startSize, const float endSize, const bool closedCurve=false, const unsigned int nbCurvePoints=200, const ParameterizationType paramType=CENTRIPETAL)
GlCatmullRomCurve constructor.