A class to draw a Catmull-Rom curve.
More...
#include <GlCatmullRomCurve.h>
List of all members.
Public Member Functions |
| GlCatmullRomCurve () |
| 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 () |
void | setParameterizationType (const ParameterizationType paramType) |
void | drawCurve (std::vector< Coord > &controlPoints, const Color &startColor, const Color &endColor, const float startSize, const float endSize, const unsigned int nbCurvePoints=200) |
void | setClosedCurve (const bool closedCurve) |
| AbstractGlCurve (const std::string &shaderProgramName, const std::string &curveSpecificShaderCode) |
| AbstractGlCurve (const std::string &shaderProgramName, const std::string &curveSpecificShaderCode, const std::vector< Coord > &controlPoints, const Color &startColor, const Color &endColor, const float startSize, const float endSize, const unsigned int nbCurvePoints) |
virtual | ~AbstractGlCurve () |
void | draw (float lod, Camera *camera) |
void | translate (const Coord &move) |
virtual void | setTexture (const std::string &texture) |
virtual void | setOutlined (const bool outlined) |
virtual void | setOutlineColor (const Color &outlineColor) |
virtual void | setOutlineColorInterpolation (const bool outlineColorInterpolation) |
void | setLineCurve (const bool lineCurve) |
void | setCurveLineWidth (const float curveLineWidth) |
void | setCurveQuadBordersWidth (const float curveQuadBorderWidth) |
virtual void | setBillboardCurve (const bool billboardCurve) |
virtual void | setLookDir (const Coord &lookDir) |
void | getXML (xmlNodePtr rootNode) |
void | setWithXML (xmlNodePtr rootNode) |
| GlSimpleEntity () |
virtual | ~GlSimpleEntity () |
virtual void | acceptVisitor (GlSceneVisitor *visitor) |
virtual void | setVisible (bool visible) |
bool | isVisible () |
virtual void | setStencil (int stencil) |
int | getStencil () |
void | setCheckByBoundingBoxVisitor (bool check) |
bool | isCheckByBoundingBoxVisitor () |
virtual BoundingBox | getBoundingBox () |
virtual void | addLayerParent (GlLayer *) |
virtual void | removeLayerParent (GlLayer *) |
void | addParent (GlComposite *composite) |
void | removeParent (GlComposite *composite) |
virtual | ~GlEntity () |
Additional Inherited Members |
static void | buildCurveVertexBuffers (const unsigned int nbCurvePoints, bool vboOk) |
std::string | shaderProgramName |
GlShaderProgram * | curveShaderProgramNormal |
GlShaderProgram * | curveShaderProgramBillboard |
GlShaderProgram * | curveShaderProgram |
std::vector< Coord > | controlPoints |
Color | startColor |
Color | endColor |
float | startSize |
float | endSize |
unsigned int | nbCurvePoints |
bool | outlined |
Color | outlineColor |
std::string | texture |
float | texCoordFactor |
bool | billboardCurve |
Coord | lookDir |
bool | lineCurve |
float | curveLineWidth |
float | curveQuadBordersWidth |
bool | outlineColorInterpolation |
bool | visible |
int | stencil |
bool | checkByBoundingBoxVisitor |
BoundingBox | boundingBox |
std::vector< GlComposite * > | parents |
static std::map< unsigned int,
GLfloat * > | curveVertexBuffersData |
static std::map< unsigned int,
std::vector< GLushort * > > | curveVertexBuffersIndices |
static std::map< unsigned int,
GLuint * > | curveVertexBuffersObject |
static std::map< std::string,
GlShaderProgram * > | curvesShadersMap |
static std::map< std::string,
GlShaderProgram * > | curvesBillboardShadersMap |
static GlShader * | curveVertexShaderNormalMain |
static GlShader * | curveVertexShaderBillboardMain |
static GlShader * | fisheyeDistortionVertexShader |
static bool | canUseGeometryShader |
static std::map< std::string,
std::pair< GlShaderProgram
*, GlShaderProgram * > > | curvesGeometryShadersMap |
static GlShader * | curveVertexGeometryShaderNormalMain |
static std::map< std::string,
std::pair< GlShaderProgram
*, GlShaderProgram * > > | curvesBillboardGeometryShadersMap |
Detailed Description
A class to draw a Catmull-Rom curve.
This class allow to draw a Catmull-Rom curve, a smooth curve which passes through all its control points. Catmull-Rom splines are a family of cubic interpolating splines formulated such that the tangent at each control point is calculated using the previous and next control point point of the spline. Catmull-Rom splines have C^1 continuity, local control, and interpolation, but do not lie within the convex hull of their control points.
Constructor & Destructor Documentation
tlp::GlCatmullRomCurve::GlCatmullRomCurve |
( |
| ) |
|
tlp::GlCatmullRomCurve::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
- Parameters:
-
controlPoints | a vector of control points (size must be greater or equal to 4) |
startColor | the color at the start of the curve |
endColor | the color at the end of the curve |
startSize | the width at the start of the curve |
endSize | the width at the end of the curve |
closedCurve | if true, the curve will be closed and a bezier segment will be drawn between the last and first control point |
paramType | curve parameterization type (GlCatmullRomCurve::UNIFORM | GlCatmullRomCurve::CENTRIPETAL | GlCatmullRomCurve::CHORD_LENGTH (default)) |
nbCurvePoints | the number of curve points to generate |
tlp::GlCatmullRomCurve::~GlCatmullRomCurve |
( |
| ) |
|
Member Function Documentation
Coord tlp::GlCatmullRomCurve::computeCurvePointOnCPU |
( |
const std::vector< Coord > & |
controlPoints, |
|
|
float |
t |
|
) |
| |
|
protectedvirtual |
void tlp::GlCatmullRomCurve::computeCurvePointsOnCPU |
( |
const std::vector< Coord > & |
controlPoints, |
|
|
std::vector< Coord > & |
curvePoints, |
|
|
unsigned int |
nbCurvePoints |
|
) |
| |
|
protectedvirtual |
void tlp::GlCatmullRomCurve::drawCurve |
( |
std::vector< Coord > & |
controlPoints, |
|
|
const Color & |
startColor, |
|
|
const Color & |
endColor, |
|
|
const float |
startSize, |
|
|
const float |
endSize, |
|
|
const unsigned int |
nbCurvePoints = 200 |
|
) |
| |
|
virtual |
void tlp::GlCatmullRomCurve::setClosedCurve |
( |
const bool |
closedCurve | ) |
|
|
inline |
void tlp::GlCatmullRomCurve::setCurveVertexShaderRenderingSpecificParameters |
( |
| ) |
|
|
protectedvirtual |
void tlp::GlCatmullRomCurve::setParameterizationType |
( |
const ParameterizationType |
paramType | ) |
|
|
inline |
|