#include <customgui_splinecontrol.h>
Spline data type (CUSTOMDATATYPE_SPLINE) for SplineCustomGui.
Private Member Functions | |
SplineData () | |
~SplineData () | |
Alloc/Free | |
static SplineData * | Alloc () |
static void | Free (SplineData *&pData) |
Knot | |
Int32 | GetKnotCount () const |
CustomSplineKnot * | GetKnot (Int32 l) |
const CustomSplineKnot * | GetKnot (Int32 l) const |
Bool | SetKnot (Int32 l, const CustomSplineKnot &knot) |
Int32 | InsertKnot (Float x, Float y, Int32 lFlags=0) |
Bool | DeleteKnot (Int32 a) |
void | SortKnots (Int32 &lActiveKnot) |
Int32 | GetSelectCount () const |
Point | |
Vector | GetPoint (Float r) 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) |
Bool | MakeUserSpline (const maxon::String &str, Int32 lPoints=-1) |
Spline Knots Manipulation | |
void | SelectAll () |
void | Flip () |
void | Mirror () |
void | Minimum () |
void | Maximum () |
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) |
Tension | |
Float | GetTension () const |
void | SetTension (Float tension) |
User Callback | |
SplineDataCallback | GetUserCallback (void *&pData) const |
void | SetUserCallback (SplineDataCallback fn, void *pData) |
Miscellaneous | |
Bool | CopyTo (SplineData *pDest) const |
Bool | InitDefaultFlag (Int32 flag) |
maxon::Result< void > | GetSplineMapper (maxon::SplineMapper &splineMapper) const |
Additional Inherited Members | |
Static Public Attributes inherited from CustomDataTypeT< 1009060 > | |
static constexpr Int32 | DATATYPEID |
|
private |
|
private |
|
static |
|
static |
Int32 GetKnotCount | ( | ) | const |
Gets the number of knots .
CustomSplineKnot* GetKnot | ( | Int32 | l | ) |
Gets the spline knot at position l.
[in] | l | The position index. 0 <= l < GetKnotCount() |
const CustomSplineKnot* GetKnot | ( | Int32 | l | ) | const |
Bool SetKnot | ( | Int32 | l, |
const CustomSplineKnot & | knot | ||
) |
Sets the spline knot at position l.
[in] | l | The knot index. 0 <= l < GetKnotCount() |
[in] | knot | The spline knot. |
Inserts a knot.
[in] | x | The X coordinate. |
[in] | y | The Y coordinate. |
[in] | lFlags | The knot flags: FLAG_KNOT |
Deletes a knot.
[in] | a | The index of the knot to delete. 0 <= a < GetKnotCount() |
void SortKnots | ( | Int32 & | lActiveKnot | ) |
Sorts the knots.
[out] | lActiveKnot | Assigned the new index of the active knot. |
Int32 GetSelectCount | ( | ) | const |
Gets the number of selected knots.
Gets a point from its X coordinate.
[in] | r | The X coordinate. |
void DeleteAllPoints | ( | ) |
Deletes all points.
Makes an uninitialized spline with lPoints points.
[in] | lPoints | The number of points, or -1 to get the default value. |
Makes a linear spline with lPoints points. The spline knots' is linear.
[in] | lPoints | The number of points, or -1 to get the default value. |
Makes a linear spline with lPoints points. The spline knots' interpolation is Bezier.
[in] | lPoints | The number of points, or -1 to get the default value. |
Makes a square spline with lPoints points.
[in] | lPoints | The number of points, or -1 to get the default value. |
Makes a cubic spline with lPoints points.
[in] | lPoints | The number of points, or -1 to get the default value. |
Makes a root spline with lPoints points.
[in] | lPoints | The number of points, or -1 to get the default value. |
Makes an inverse spline with lPoints points.
[in] | lPoints | The number of points, or -1 to get the default value. |
Makes a sinus spline with lPoints points.
[in] | lPoints | The number of points, or -1 to get the default value. |
Makes an absolute cosine spline with lPoints points.
[in] | lPoints | The number of points, or -1 to get the default value. |
Bool MakeUserSpline | ( | const maxon::String & | str, |
Int32 | lPoints = -1 |
||
) |
Makes a user spline from str with lPoints number of points.
[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. |
void SelectAll | ( | ) |
Selects all points.
void Flip | ( | ) |
Flips the spline.
void Mirror | ( | ) |
Mirrors the spline.
void Minimum | ( | ) |
Makes all Y coordinates greater than or equal to 0.
void Maximum | ( | ) |
Makes all Y coordinates less than or equal to 1.
Sets the interpolation type of the selected knots.
[in] | id | The interpolation type: SPLINE_TYPE |
[in] | bAll | Pass true to set all knots, false to set selected knots only. |
Sets the tangents of the selected knots to zero.
[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. |
Bool GetRange | ( | Float * | xmin, |
Float * | xmax, | ||
Float * | xsteps, | ||
Float * | ymin, | ||
Float * | ymax, | ||
Float * | ysteps | ||
) | const |
Gets the range of the spline.
[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. |
Sets the range of the spline.
[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. |
Adapts the internal [0, 1] range of the old spline GUI to the range set by [xmin, xmax, ymin, ymax].
[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. |
Float GetTension | ( | ) | const |
Gets the tension value.
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)
[in] | tension | The new tension value. |
SplineDataCallback GetUserCallback | ( | void *& | pData | ) | const |
Gets the user callback function pointer.
[out] | pData | Assigned the user data of the callback. |
void SetUserCallback | ( | SplineDataCallback | fn, |
void * | pData | ||
) |
Sets the callback function to be called for events on the instance.
The callback must be setup each time a SplineData parameter is being initialized or gets a new instance assigned. See example below for details.
[in] | fn | The pointer to the callback function. |
[in] | pData | The callback data. In most cases it is best, to pass in nullptr and let Cinema 4D fill in the data on callbacks. |
Bool CopyTo | ( | SplineData * | pDest | ) | const |
Copies this spline dat values into the destination spline data pDest.
[in] | pDest | The destination spline data. The caller owns the pointed spline data. |
Initializes the knot flag for selected knots.
[in] | flag | A combination of these flags: FLAG_KNOT |
maxon::Result<void> GetSplineMapper | ( | maxon::SplineMapper & | splineMapper | ) | const |
Get the SplineMapper object for this spline.