Drag[en]gine Game Engine  1.0
decCurveBezier Class Reference

Bezier Curve. More...

#include <decCurveBezier.h>

Public Types

enum  eInterpolationModes { eimConstant, eimLinear, eimBezier }
 Interpolation modes. More...
 

Public Member Functions

Constructors and Destructors
 decCurveBezier ()
 Create a new bezier curve. More...
 
 ~decCurveBezier ()
 Clean up the bezier curve. More...
 
Management
int GetPointCount () const
 Number of points. More...
 
const decCurveBezierPointGetPointAt (int position) const
 Point at position. More...
 
int FindPointPriorTo (float coordinate) const
 Index of the point with matching x coordinates or the point closest on the smaller side. More...
 
int AddPoint (const decCurveBezierPoint &point)
 Add point returning the index where it has been added. More...
 
void RemovePointFrom (int position)
 Remove point from the given position. More...
 
void RemoveAllPoints ()
 Remove all points. More...
 
eInterpolationModes GetInterpolationMode () const
 Interpolation mode. More...
 
void SetInterpolationMode (eInterpolationModes mode)
 Sets the interpolation mode. More...
 
void SetDefaultLinear ()
 Set curve to linear mapping from (0,0) to (1,1). More...
 
void SetDefaultBezier ()
 Set curve to default bezier curve from (0,0) to (1,1). More...
 
Operators
bool operator== (const decCurveBezier &curve) const
 Curves are equal. More...
 
bool operator!= (const decCurveBezier &curve) const
 Curves are not equal. More...
 
decCurveBezieroperator= (const decCurveBezier &curve)
 Copy another curve to this curve. More...
 

Detailed Description

Bezier Curve.

Author
Roland Pl├╝ss
Version
1.0
Date
2015

Member Enumeration Documentation

◆ eInterpolationModes

Interpolation modes.

Enumerator
eimConstant 

Constant interpolation.

eimLinear 

Linear interpolation.

eimBezier 

Bezier interpolation.

Constructor & Destructor Documentation

◆ decCurveBezier()

decCurveBezier::decCurveBezier ( )

Create a new bezier curve.

◆ ~decCurveBezier()

decCurveBezier::~decCurveBezier ( )

Clean up the bezier curve.

Member Function Documentation

◆ AddPoint()

int decCurveBezier::AddPoint ( const decCurveBezierPoint point)

Add point returning the index where it has been added.

Referenced by GetPointCount().

◆ FindPointPriorTo()

int decCurveBezier::FindPointPriorTo ( float  coordinate) const

Index of the point with matching x coordinates or the point closest on the smaller side.

This method can be used to find the interval a point is located in by returning the most prior point. Retrieves -1 if there are no points satisfying this criteria.

Referenced by GetPointCount().

◆ GetInterpolationMode()

eInterpolationModes decCurveBezier::GetInterpolationMode ( ) const
inline

◆ GetPointAt()

const decCurveBezierPoint& decCurveBezier::GetPointAt ( int  position) const

Point at position.

Exceptions
deeInvalidParamposition is less than 0.
deeInvalidParamposition is larger or equal to GetPointCount()-1.

Referenced by GetPointCount().

◆ GetPointCount()

int decCurveBezier::GetPointCount ( ) const
inline

◆ operator!=()

bool decCurveBezier::operator!= ( const decCurveBezier curve) const

Curves are not equal.

Referenced by GetInterpolationMode().

◆ operator=()

decCurveBezier& decCurveBezier::operator= ( const decCurveBezier curve)

Copy another curve to this curve.

Referenced by GetInterpolationMode().

◆ operator==()

bool decCurveBezier::operator== ( const decCurveBezier curve) const

Curves are equal.

Referenced by GetInterpolationMode().

◆ RemoveAllPoints()

void decCurveBezier::RemoveAllPoints ( )

Remove all points.

Referenced by GetPointCount().

◆ RemovePointFrom()

void decCurveBezier::RemovePointFrom ( int  position)

Remove point from the given position.

Exceptions
deeInvalidParamposition is less than 0.
deeInvalidParamposition is larger or equal to GetPointCount()-1.

Referenced by GetPointCount().

◆ SetDefaultBezier()

void decCurveBezier::SetDefaultBezier ( )

Set curve to default bezier curve from (0,0) to (1,1).

Referenced by GetInterpolationMode().

◆ SetDefaultLinear()

void decCurveBezier::SetDefaultLinear ( )

Set curve to linear mapping from (0,0) to (1,1).

Referenced by GetInterpolationMode().

◆ SetInterpolationMode()

void decCurveBezier::SetInterpolationMode ( eInterpolationModes  mode)

Sets the interpolation mode.

Exceptions
deeInvalidParammode is not a member of decCurveBezier::eInterpolationModes.

Referenced by GetInterpolationMode().


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