Overview     Modules     Class Hierarchy     Classes     Members  
tlp::GlOpenUniformCubicBSpline Class Reference

A class to draw open uniform cubic B-splines. More...

#include <GlOpenUniformCubicBSpline.h>

Inheritance diagram for tlp::GlOpenUniformCubicBSpline:
Collaboration diagram for tlp::GlOpenUniformCubicBSpline:

List of all members.

Public Member Functions

 GlOpenUniformCubicBSpline ()
 GlOpenUniformCubicBSpline (const std::vector< Coord > &controlPoints, const Color &startColor, const Color &endColor, const float startSize, const float endSize, const unsigned int nbCurvePoints=200)
 ~GlOpenUniformCubicBSpline ()
void drawCurve (std::vector< Coord > &controlPoints, const Color &startColor, const Color &endColor, const float startSize, const float endSize, const unsigned int nbCurvePoints=200)
- Public Member Functions inherited from tlp::AbstractGlCurve
 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)
- Public Member Functions inherited from tlp::GlSimpleEntity
 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)
- Public Member Functions inherited from tlp::GlEntity
virtual ~GlEntity ()

Protected Member Functions

void setCurveVertexShaderRenderingSpecificParameters ()
Coord computeCurvePointOnCPU (const std::vector< Coord > &controlPoints, float t)
void computeCurvePointsOnCPU (const std::vector< Coord > &controlPoints, std::vector< Coord > &curvePoints, unsigned int nbCurvePoints)
- Protected Member Functions inherited from tlp::AbstractGlCurve
virtual void cleanupAfterCurveVertexShaderRendering ()
void initShader (const std::string &shaderProgramName, const std::string &curveSpecificShaderCode)

Additional Inherited Members

- Static Protected Member Functions inherited from tlp::AbstractGlCurve
static void buildCurveVertexBuffers (const unsigned int nbCurvePoints, bool vboOk)
- Protected Attributes inherited from tlp::AbstractGlCurve
std::string shaderProgramName
GlShaderProgramcurveShaderProgramNormal
GlShaderProgramcurveShaderProgramBillboard
GlShaderProgramcurveShaderProgram
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
- Protected Attributes inherited from tlp::GlSimpleEntity
bool visible
int stencil
bool checkByBoundingBoxVisitor
BoundingBox boundingBox
std::vector< GlComposite * > parents
- Static Protected Attributes inherited from tlp::AbstractGlCurve
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 GlShadercurveVertexShaderNormalMain
static GlShadercurveVertexShaderBillboardMain
static GlShaderfisheyeDistortionVertexShader
static bool canUseGeometryShader
static std::map< std::string,
std::pair< GlShaderProgram
*, GlShaderProgram * > > 
curvesGeometryShadersMap
static GlShadercurveVertexGeometryShaderNormalMain
static std::map< std::string,
std::pair< GlShaderProgram
*, GlShaderProgram * > > 
curvesBillboardGeometryShadersMap

Detailed Description

A class to draw open uniform cubic B-splines.

A B-spline is a convenient form for representing complicated, smooth curves. A cubic uniform B-spline is a piecewise collection of cubic Bézier curves, connected end to end. A cubic B-spline is C^2 continuous, meaning there is no discontinuities in curvature. B-splines have local control : parameters of a B-spline only affect a small part of the entire spline. A B-spline is qualified as open when it passes through its first and last control points.


Constructor & Destructor Documentation

tlp::GlOpenUniformCubicBSpline::GlOpenUniformCubicBSpline ( )
tlp::GlOpenUniformCubicBSpline::GlOpenUniformCubicBSpline ( const std::vector< Coord > &  controlPoints,
const Color &  startColor,
const Color &  endColor,
const float  startSize,
const float  endSize,
const unsigned int  nbCurvePoints = 200 
)

GlOpenUniformCubicBSpline constructor

Parameters:
controlPointsa vector of control points (size must be greater or equal to 4)
startColorthe color at the start of the curve
endColorthe color at the end of the curve
startSizethe width at the start of the curve
endSizethe width at the end of the curve
nbCurvePointsthe number of curve points to generate
tlp::GlOpenUniformCubicBSpline::~GlOpenUniformCubicBSpline ( )

Member Function Documentation

Coord tlp::GlOpenUniformCubicBSpline::computeCurvePointOnCPU ( const std::vector< Coord > &  controlPoints,
float  t 
)
protectedvirtual

Implements tlp::AbstractGlCurve.

void tlp::GlOpenUniformCubicBSpline::computeCurvePointsOnCPU ( const std::vector< Coord > &  controlPoints,
std::vector< Coord > &  curvePoints,
unsigned int  nbCurvePoints 
)
protectedvirtual

Implements tlp::AbstractGlCurve.

void tlp::GlOpenUniformCubicBSpline::drawCurve ( std::vector< Coord > &  controlPoints,
const Color &  startColor,
const Color &  endColor,
const float  startSize,
const float  endSize,
const unsigned int  nbCurvePoints = 200 
)
virtual

Reimplemented from tlp::AbstractGlCurve.

void tlp::GlOpenUniformCubicBSpline::setCurveVertexShaderRenderingSpecificParameters ( )
protectedvirtual

Reimplemented from tlp::AbstractGlCurve.



Tulip Software by LaBRI Visualization Team    2001 - 2012