SplineData Class Reference

#include <customgui_splinecontrol.h>

Inheritance diagram for SplineData:

Private Member Functions

 SplineData ()
 
 ~SplineData ()
 

Alloc/Free

static SplineDataAlloc ()
 
static void Free (SplineData *&pData)
 

Knot

Int32 GetKnotCount () const
 
CustomSplineKnotGetKnot (Int32 l)
 
Bool SetKnot (Int32 l, const CustomSplineKnot &knot)
 
Int32 InsertKnot (Float x, Float y, Int32 lFlagsSettings=0)
 
Bool DeleteKnot (Int32 a)
 
void SortKnots (Int32 &lActiveKnot)
 
Int32 GetSelectCount () const
 
void DeleteAllPoints ()
 

Make Spline

Bool MakePointBuffer (Int32 lPoints=-1)
 
Bool MakeLinearSplineLinear (Int32 lPoints=-1)
 
Bool MakeLinearSplineBezier (Int32 lPoints=-1)
 
Bool MakeSquareSpline (Int32 lPoints=-1)
 
Bool MakeCubicSpline (Int32 lPoints=-1)
 
Bool MakeRootSpline (Int32 lPoints=-1)
 
Bool MakeInversSpline (Int32 lPoints=-1)
 
Bool MakeSinSpline (Int32 lPoints=-1)
 
Bool MakeAbsCosSpline (Int32 lPoints=-1)
 

Spline Knots Manipulation

void SelectAll ()
 
void Flip ()
 
void Mirror ()
 
void Maximum ()
 
void Minimum ()
 

Set Type/Zero

Bool SetType (Int32 id, Bool bAll=false)
 
Bool SetZero (Bool bY, Bool bAll=false)
 

Range

Bool GetRange (Float *xmin, Float *xmax, Float *xsteps, Float *ymin, Float *ymax, Float *ysteps) const
 
void SetRange (Float xmin, Float xmax, Float xsteps, Float ymin, Float ymax, Float ysteps)
 
void AdaptRange (Float xmin, Float xmax, Float xsteps, Float ymin, Float ymax, Float ysteps)
 

Miscellaneous

Bool CopyTo (SplineData *pDest)
 

Detailed Description

Spline data type (CUSTOMDATATYPE_SPLINE).

Note
Has to be created with Alloc() and destroyed with Free().

Constructor & Destructor Documentation

◆ SplineData()

SplineData ( )
private

◆ ~SplineData()

~SplineData ( )
private

Member Function Documentation

◆ Alloc()

static SplineData* Alloc ( )
static

Allocates a spline data. Destroy the allocated spline data with Free().

Returns
The allocated spline data, or nullptr if the allocation failed.

◆ Free()

static void Free ( SplineData *&  pData)
static

Destructs spline data allocated with Alloc().

Parameters
[in,out]pDataThe spline data to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards.

◆ GetKnotCount()

Int32 GetKnotCount ( ) const

Gets the number of knots.

Returns
The knot count.

◆ GetKnot()

CustomSplineKnot* GetKnot ( Int32  l)

Gets the spline knot at position l.

Parameters
[in]lThe position index. 0 <= l < GetKnotCount()
Returns
The spline knot.

◆ SetKnot()

Bool SetKnot ( Int32  l,
const CustomSplineKnot knot 
)

Sets the spline knot at position l.

Parameters
[in]lThe knot index. 0 <= l < GetKnotCount()
[in]knotThe spline knot.
Returns
true if the spline knot was successfully set, otherwise false.

◆ InsertKnot()

Int32 InsertKnot ( Float  x,
Float  y,
Int32  lFlagsSettings = 0 
)

Inserts a knot.

Parameters
[in]xThe X coordinate.
[in]yThe Y coordinate.
[in]lFlagsSettingsThe knot flags: FLAG_KNOT.
Returns
The index of the inserted knot.

◆ DeleteKnot()

Bool DeleteKnot ( Int32  a)

Deletes a knot.

Parameters
[in]aThe knot index to delete. 0 <= a < GetKnotCount()
Returns
true if successful, otherwise false.

◆ SortKnots()

void SortKnots ( Int32 lActiveKnot)

Sorts the knots.

Parameters
[out]lActiveKnotAssigned the new index of the active knot.

◆ GetSelectCount()

Int32 GetSelectCount ( ) const

Gets the number of selected knots.

Returns
The selected knot count.

◆ DeleteAllPoints()

void DeleteAllPoints ( )

Deletes all points.

◆ MakePointBuffer()

Bool MakePointBuffer ( Int32  lPoints = -1)

Makes an uninitialized spline with lPoints points.

Parameters
[in]lPointsThe number of points, or -1 to get the default value.
Returns
true if successful, otherwise false.

◆ MakeLinearSplineLinear()

Bool MakeLinearSplineLinear ( Int32  lPoints = -1)

Makes a linear spline with lPoints points. The spline knots' is linear.

Parameters
[in]lPointsThe number of points, or -1 to get the default value.
Returns
true if successful, otherwise false.

◆ MakeLinearSplineBezier()

Bool MakeLinearSplineBezier ( Int32  lPoints = -1)

Makes a linear spline with lPoints points. The spline knots' interpolation is Bezier.

Parameters
[in]lPointsThe number of points, or -1 to get the default value.
Returns
true if successful, otherwise false.

◆ MakeSquareSpline()

Bool MakeSquareSpline ( Int32  lPoints = -1)

Makes a square spline with lPoints points.

Parameters
[in]lPointsThe number of points, or -1 to get the default value.
Returns
true if successful, otherwise false.

◆ MakeCubicSpline()

Bool MakeCubicSpline ( Int32  lPoints = -1)

Makes a cubic spline with lPoints points.

Parameters
[in]lPointsThe number of points, or -1 to get the default value.
Returns
true if successful, otherwise false.

◆ MakeRootSpline()

Bool MakeRootSpline ( Int32  lPoints = -1)

Makes a root spline with lPoints points.

Parameters
[in]lPointsThe number of points, or -1 to get the default value.
Returns
true if successful, otherwise false.

◆ MakeInversSpline()

Bool MakeInversSpline ( Int32  lPoints = -1)

Makes an inverse spline with lPoints points.

Parameters
[in]lPointsThe number of points, or -1 to get the default value.
Returns
true if successful, otherwise false.

◆ MakeSinSpline()

Bool MakeSinSpline ( Int32  lPoints = -1)

Makes a sinus spline with lPoints points.

Parameters
[in]lPointsThe number of points, or -1 to get the default value.
Returns
true if successful, otherwise false.

◆ MakeAbsCosSpline()

Bool MakeAbsCosSpline ( Int32  lPoints = -1)

Makes an absolute cosinus spline with lPoints points.

Parameters
[in]lPointsThe number of points, or -1 to get the default value.
Returns
true if successful, otherwise false.

◆ SelectAll()

void SelectAll ( )

Selects all points.

◆ Flip()

void Flip ( )

Flips the spline.

◆ Mirror()

void Mirror ( )

Mirrors the spline.

◆ Maximum()

void Maximum ( )

Makes all Y coordinates less than or equal to 1.

◆ Minimum()

void Minimum ( )

Makes all Y coordinates greater than or equal to 0.

◆ SetType()

Bool SetType ( Int32  id,
Bool  bAll = false 
)

Sets the interpolation type of the selected knots.

Parameters
[in]idThe interpolation type: CustomSplineKnotInterpolation.
[in]bAlltrue to set all knots, false to set selected knots only.
Returns
true if successful, otherwise false.

◆ SetZero()

Bool SetZero ( Bool  bY,
Bool  bAll = false 
)

Sets the tangents of the selected knots to zero.

Parameters
[in]bYtrue to set the tangents' Y coordinate to zero, false to set the X coordinate.
[in]bAlltrue to set all tangents, false to set the tangents of selected knots only.
Returns
true if successful, otherwise false.

◆ GetRange()

Bool GetRange ( Float xmin,
Float xmax,
Float xsteps,
Float ymin,
Float ymax,
Float ysteps 
) const

Gets the range of the spline.

Parameters
[out]xminThe minimum X value.
[out]xmaxThe maximum X value.
[out]xstepsThe X steps value.
[out]yminThe minimum Y value.
[out]ymaxThe maximum Y value.
[out]ystepsThe Y steps value.
Returns
true if the range of the spline data was successfully retrieved, otherwise false.

◆ SetRange()

void SetRange ( Float  xmin,
Float  xmax,
Float  xsteps,
Float  ymin,
Float  ymax,
Float  ysteps 
)

Sets the range of the spline.

Parameters
[in]xminThe minimum X value.
[in]xmaxThe maximum X value.
[in]xstepsThe X steps value.
[in]yminThe minimum Y value.
[in]ymaxThe maximum Y value.
[in]ystepsThe Y steps value.

◆ AdaptRange()

void AdaptRange ( Float  xmin,
Float  xmax,
Float  xsteps,
Float  ymin,
Float  ymax,
Float  ysteps 
)

Adapts the internal [0, 1] range of the old spline GUI to the range set by [xmin, xmax, ymin, ymax].

Parameters
[in]xminThe minimum X value.
[in]xmaxThe maximum X value.
[in]xstepsThe X steps value.
[in]yminThe minimum Y value.
[in]ymaxThe maximum Y value.
[in]ystepsThe Y steps value.

◆ CopyTo()

Bool CopyTo ( SplineData pDest)

Copies the SplineData values into the destination spline data pDest.

Parameters
[in]pDestThe destination spline data. The caller owns the pointed spline data.
Returns
true if the spline data was successfully copied to pDest, otherwise false.