#include <customgui_splinecontrol.h>
Spline data type (CUSTOMDATATYPE_SPLINE) for SplineCustomGui.
- Note
- Has to be created with Alloc() and destroyed with Free(). Use AutoAlloc to automate the allocation and destruction based on scope.
|
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) |
|
◆ SplineData()
◆ ~SplineData()
◆ Alloc()
Allocates a spline data. Destroy the allocated spline data with Free(). Use AutoAlloc to automate the allocation and destruction based on scope.
- Returns
- The allocated spline data, or nullptr if the allocation failed.
◆ Free()
Destructs spline data allocated with Alloc(). Use AutoAlloc to automate the allocation and destruction based on scope.
- Parameters
-
[in,out] | pData | The 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()
Gets the spline knot at position l.
- Parameters
-
- Returns
- The spline knot.
◆ SetKnot()
Sets the spline knot at position l.
- Parameters
-
- Returns
- true if the spline knot was successfully set, otherwise false.
◆ InsertKnot()
Inserts a knot.
- Parameters
-
[in] | x | The X coordinate. |
[in] | y | The Y coordinate. |
[in] | lFlags | The knot flags: FLAG_KNOT |
- Returns
- The index of the inserted knot.
◆ DeleteKnot()
Deletes a knot.
- Parameters
-
- Returns
- true if the knot was deleted successfully, otherwise false.
◆ SortKnots()
void SortKnots |
( |
Int32 & |
lActiveKnot | ) |
|
Sorts the knots.
- Parameters
-
[out] | lActiveKnot | Assigned the new index of the active knot. |
◆ GetSelectCount()
Int32 GetSelectCount |
( |
| ) |
const |
Gets the number of selected knots.
- Returns
- The selected knot count.
◆ GetPoint()
Gets a point from its X coordinate.
- Parameters
-
- Returns
- The retrieved point.
◆ DeleteAllPoints()
◆ MakePointBuffer()
Makes an uninitialized spline with lPoints points.
- Parameters
-
[in] | lPoints | The 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] | lPoints | The 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] | lPoints | The number of points, or -1 to get the default value. |
- Returns
- true if successful, otherwise false.
◆ MakeSquareSpline()
Makes a square spline with lPoints points.
- Parameters
-
[in] | lPoints | The number of points, or -1 to get the default value. |
- Returns
- true if successful, otherwise false.
◆ MakeCubicSpline()
Makes a cubic spline with lPoints points.
- Parameters
-
[in] | lPoints | The number of points, or -1 to get the default value. |
- Returns
- true if successful, otherwise false.
◆ MakeRootSpline()
Makes a root spline with lPoints points.
- Parameters
-
[in] | lPoints | The number of points, or -1 to get the default value. |
- Returns
- true if successful, otherwise false.
◆ MakeInversSpline()
Makes an inverse spline with lPoints points.
- Parameters
-
[in] | lPoints | The number of points, or -1 to get the default value. |
- Returns
- true if successful, otherwise false.
◆ MakeSinSpline()
Makes a sinus spline with lPoints points.
- Parameters
-
[in] | lPoints | The number of points, or -1 to get the default value. |
- Returns
- true if successful, otherwise false.
◆ MakeAbsCosSpline()
Makes an absolute cosine spline with lPoints points.
- Parameters
-
[in] | lPoints | The number of points, or -1 to get the default value. |
- Returns
- true if successful, otherwise false.
◆ MakeUserSpline()
Makes a user spline from str with lPoints number of points.
- Parameters
-
[in] | str | The user spline string. Any valid formula can be used. |
[in] | lPoints | The number of points, or -1 to get the default value. |
- Returns
- true if successful, otherwise false.
◆ SelectAll()
◆ Flip()
◆ Mirror()
◆ Minimum()
Makes all Y coordinates greater than or equal to 0.
◆ Maximum()
Makes all Y coordinates less than or equal to 1.
◆ SetType()
Sets the interpolation type of the selected knots.
- Parameters
-
[in] | id | The interpolation type: SPLINE_TYPE |
[in] | bAll | Pass true to set all knots, false to set selected knots only. |
- Returns
- true if successful, otherwise false.
◆ SetZero()
Sets the tangents of the selected knots to zero.
- Parameters
-
[in] | bY | Pass true to set the tangents' Y coordinate to zero, false to set the X coordinate. |
[in] | bAll | Pass true to set all tangents, false to set the tangents of selected knots only. |
- Returns
- true if successful, otherwise false.
◆ GetRange()
Gets the range of the spline.
- Warning
- Only valid if the spline is shown in the spline GUI.
- Parameters
-
[out] | xmin | Assigned the minimum X value. |
[out] | xmax | Assigned the maximum X value. |
[out] | xsteps | Assigned the X steps value. |
[out] | ymin | Assigned the minimum Y value. |
[out] | ymax | Assigned the maximum Y value. |
[out] | ysteps | Assigned the Y steps value. |
- Returns
- true if successful, otherwise false.
◆ SetRange()
Sets the range of the spline.
- Warning
- Only valid if the spline is shown in the spline GUI.
- Parameters
-
[in] | xmin | The minimum X value. |
[in] | xmax | The maximum X value. |
[in] | xsteps | The X steps value. |
[in] | ymin | The minimum Y value. |
[in] | ymax | The maximum Y value. |
[in] | ysteps | The Y steps value. |
◆ AdaptRange()
Adapts the internal [0, 1] range of the old spline GUI to the range set by [xmin, xmax, ymin, ymax].
- Warning
- Only valid if the spline is shown in the spline GUI.
- Parameters
-
[in] | xmin | The minimum X value. |
[in] | xmax | The maximum X value. |
[in] | xsteps | The X steps value. |
[in] | ymin | The minimum Y value. |
[in] | ymax | The maximum Y value. |
[in] | ysteps | The Y steps value. |
◆ GetTension()
Float GetTension |
( |
| ) |
const |
Gets the tension value.
- Returns
- The tension value.
◆ SetTension()
void SetTension |
( |
Float |
tension | ) |
|
Sets the tension value. Effective range goes from 0.0 (no tension - softer splines) to 1.0 (full tension - harder splines)
- Parameters
-
[in] | tension | The new tension value. |
◆ GetUserCallback()
Gets the user callback function pointer.
- Parameters
-
[out] | pData | Assigned the user data of the callback. |
- Returns
- The user callback.
◆ SetUserCallback()
Sets the user callback function.
- Parameters
-
[in] | fn | The pointer to the callback function. |
[in] | pData | The user data passed to the callback function. |
◆ CopyTo()
Copies this spline dat values into the destination spline data pDest.
- Parameters
-
[in] | pDest | The destination spline data. The caller owns the pointed spline data. |
- Returns
- true if this spline data was successfully copied to pDest, otherwise false.
◆ InitDefaultFlag()
Initializes the knot flag for selected knots.
- Parameters
-
[in] | flag | A combination of these flags: FLAG_KNOT |
- Returns
- true if successful, otherwise false.