Bezier Class Reference

Class for Bezier curves. More...

Inheritance diagram for Bezier:

Inheritance graph
[legend]
Collaboration diagram for Bezier:

Collaboration graph
[legend]

Public Types

enum  Flag_t { kCoordsBoth, kCoordsX, kCoordsY }
 Values to indicate which coordinate(s) must be checked to consider that two points are distinct. More...

Public Member Functions

 Bezier (intf_thread_t *p_intf, const vector< float > &pAbscissas, const vector< float > &pOrdinates, Flag_t flag=kCoordsBoth)
 ~Bezier ()
int getNbCtrlPoints () const
 Get the number of control points used to define the curve.
float getNearestPercent (int x, int y) const
 Return the percentage (between 0 and 1) of the curve point nearest from (x, y).
float getMinDist (int x, int y, float xScale=1.0f, float yScale=1.0f) const
 Return the distance of (x, y) to the curve, corrected by the (optional) given scale factors.
void getPoint (float t, int &x, int &y) const
 Get the coordinates of the point at t percent of the curve (t must be between 0 and 1).
int getWidth () const
 Get the width (maximum abscissa) of the curve.
int getHeight () const
 Get the height (maximum ordinate) of the curve.

Detailed Description

Class for Bezier curves.

Member Enumeration Documentation

Values to indicate which coordinate(s) must be checked to consider that two points are distinct.

Enumerator:
kCoordsBoth 
kCoordsX 
kCoordsY 


Constructor & Destructor Documentation

Bezier::Bezier ( intf_thread_t p_intf,
const vector< float > &  pAbscissas,
const vector< float > &  pOrdinates,
Flag_t  flag = kCoordsBoth 
)

Bezier::~Bezier (  )  [inline]


Member Function Documentation

int Bezier::getNbCtrlPoints (  )  const [inline]

Get the number of control points used to define the curve.

Referenced by Anchor::isPoint().

float Bezier::getNearestPercent ( int  x,
int  y 
) const

Return the percentage (between 0 and 1) of the curve point nearest from (x, y).

Referenced by Anchor::canHang(), and CtrlSliderBg::handleEvent().

float Bezier::getMinDist ( int  x,
int  y,
float  xScale = 1.0f,
float  yScale = 1.0f 
) const

Return the distance of (x, y) to the curve, corrected by the (optional) given scale factors.

Referenced by Anchor::canHang(), Anchor::isHanging(), and CtrlSliderBg::mouseOver().

void Bezier::getPoint ( float  t,
int &  x,
int &  y 
) const

Get the coordinates of the point at t percent of the curve (t must be between 0 and 1).

Referenced by Anchor::canHang(), CtrlSliderCursor::draw(), and CtrlSliderCursor::mouseOver().

int Bezier::getWidth (  )  const

Get the width (maximum abscissa) of the curve.

References i.

int Bezier::getHeight (  )  const

Get the height (maximum ordinate) of the curve.

References i.


The documentation for this class was generated from the following files:

Generated on Tue May 25 08:05:48 2010 for VLC by  doxygen 1.5.6