Drag[en]gine Game Engine  1.21
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 (const decCurveBezier &curve)
 Create copy of 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)
 Set 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.

Member Enumeration Documentation

◆ eInterpolationModes

Interpolation modes.

Enumerator
eimConstant 

Constant interpolation.

eimLinear 

Linear interpolation.

eimBezier 

Bezier interpolation.

Constructor & Destructor Documentation

◆ decCurveBezier() [1/2]

decCurveBezier::decCurveBezier ( )

Create a new bezier curve.

◆ decCurveBezier() [2/2]

decCurveBezier::decCurveBezier ( const decCurveBezier curve)

Create copy of 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.

◆ 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.

◆ GetInterpolationMode()

eInterpolationModes decCurveBezier::GetInterpolationMode ( ) const
inline

Interpolation mode.

◆ 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.

◆ GetPointCount()

int decCurveBezier::GetPointCount ( ) const
inline

Number of points.

◆ operator!=()

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

Curves are not equal.

◆ operator=()

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

Copy another curve to this curve.

◆ operator==()

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

Curves are equal.

◆ RemoveAllPoints()

void decCurveBezier::RemoveAllPoints ( )

Remove all points.

◆ 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.

◆ SetDefaultBezier()

void decCurveBezier::SetDefaultBezier ( )

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

◆ SetDefaultLinear()

void decCurveBezier::SetDefaultLinear ( )

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

◆ SetInterpolationMode()

void decCurveBezier::SetInterpolationMode ( eInterpolationModes  mode)

Set interpolation mode.

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

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