SplineData Class Reference

#include <customgui_splinecontrol.h>

Inheritance diagram for SplineData:

详细描述

Spline data type ( CUSTOMDATATYPE_SPLINE ) for SplineCustomGui .

注意
Has to be created with Alloc() and destroyed with Free() 。使用 AutoAlloc to automate the allocation and destruction based on scope.

私有成员函数

  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

向量   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  镜像 ()
void  最小 ()
void  最大 ()

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)

杂项

Bool   CopyTo ( SplineData *pDest)
Bool   InitDefaultFlag ( Int32 flag)

构造函数 & 析构函数文档编制

◆  SplineData()

SplineData () private

◆  ~SplineData()

~ SplineData () private

成员函数文档编制

◆  Alloc()

static SplineData * Alloc ( )
static

Allocates a spline data. Destroy the allocated spline data with Free() 。使用 AutoAlloc to automate the allocation and destruction based on scope.

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

◆  Free()

static void Free ( SplineData *&  pData )
static

Destructs spline data allocated with Alloc() 。使用 AutoAlloc to automate the allocation and destruction based on scope.

参数
[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.

返回
The knot count.

◆  GetKnot() [1/2]

CustomSplineKnot * GetKnot ( Int32   l )

Gets the spline knot at position l .

参数
[in] l The position index. 0 <= l < GetKnotCount()
返回
The spline knot.

◆  GetKnot() [2/2]

const CustomSplineKnot * GetKnot ( Int32   l ) const

◆  SetKnot()

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.
返回
true if the spline knot was successfully set, otherwise false .

◆  InsertKnot()

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

Inserts a knot.

参数
[in] x The X coordinate.
[in] y The Y coordinate.
[in] lFlags The knot flags: FLAG_KNOT
返回
The index of the inserted knot.

◆  DeleteKnot()

Bool DeleteKnot ( Int32   a )

Deletes a knot.

参数
[in] a The index of the knot to delete. 0 <= a < GetKnotCount()
返回
true if the knot was deleted successfully, otherwise false .

◆  SortKnots()

void SortKnots ( Int32 lActiveKnot )

Sorts the knots.

参数
[out] lActiveKnot Assigned the new index of the active knot.

◆  GetSelectCount()

Int32 GetSelectCount ( ) const

Gets the number of selected knots.

返回
The selected knot count.

◆  GetPoint()

向量 GetPoint ( Float   r ) const

Gets a point from its X coordinate.

参数
[in] r The X coordinate.
返回
The retrieved point.

◆  DeleteAllPoints()

void DeleteAllPoints ( )

Deletes all points.

◆  MakePointBuffer()

Bool MakePointBuffer ( Int32   lPoints = -1 )

Makes an uninitialized spline with lPoints points.

参数
[in] lPoints The number of points, or -1 to get the default value.
返回
true if successful, otherwise false .

◆  MakeLinearSplineLinear()

Bool MakeLinearSplineLinear ( Int32   lPoints = -1 )

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.
返回
true if successful, otherwise false .

◆  MakeLinearSplineBezier()

Bool MakeLinearSplineBezier ( Int32   lPoints = -1 )

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.
返回
true if successful, otherwise false .

◆  MakeSquareSpline()

Bool MakeSquareSpline ( Int32   lPoints = -1 )

Makes a square spline with lPoints points.

参数
[in] lPoints The number of points, or -1 to get the default value.
返回
true if successful, otherwise false .

◆  MakeCubicSpline()

Bool MakeCubicSpline ( Int32   lPoints = -1 )

Makes a cubic spline with lPoints points.

参数
[in] lPoints The number of points, or -1 to get the default value.
返回
true if successful, otherwise false .

◆  MakeRootSpline()

Bool MakeRootSpline ( Int32   lPoints = -1 )

Makes a root spline with lPoints points.

参数
[in] lPoints The number of points, or -1 to get the default value.
返回
true if successful, otherwise false .

◆  MakeInversSpline()

Bool MakeInversSpline ( Int32   lPoints = -1 )

Makes an inverse spline with lPoints points.

参数
[in] lPoints The number of points, or -1 to get the default value.
返回
true if successful, otherwise false .

◆  MakeSinSpline()

Bool MakeSinSpline ( Int32   lPoints = -1 )

Makes a sinus spline with lPoints points.

参数
[in] lPoints The number of points, or -1 to get the default value.
返回
true if successful, otherwise false .

◆  MakeAbsCosSpline()

Bool MakeAbsCosSpline ( Int32   lPoints = -1 )

Makes an absolute cosine spline with lPoints points.

参数
[in] lPoints The number of points, or -1 to get the default value.
返回
true if successful, otherwise false .

◆  MakeUserSpline()

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.
返回
true if successful, otherwise false .

◆  SelectAll()

void SelectAll ( )

Selects all points.

◆  Flip()

void Flip ( )

Flips the spline.

◆  Mirror()

void Mirror ( )

Mirrors the spline.

◆  Minimum()

void Minimum ( )

Makes all Y coordinates greater than or equal to 0 .

◆  Maximum()

void Maximum ( )

Makes all Y coordinates less than or equal to 1 .

◆  SetType()

Bool SetType ( Int32   id ,
Bool   bAll = false  
)

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.
返回
true if successful, otherwise false .

◆  SetZero()

Bool SetZero ( Bool   bY ,
Bool   bAll = false  
)

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.
返回
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.

警告
Only valid if the spline is shown in the spline GUI.
参数
[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.
返回
true if successful, otherwise false .

◆  SetRange()

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

Sets the range of the spline.

警告
Only valid if the spline is shown in the spline GUI.
参数
[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()

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

警告
Only valid if the spline is shown in the spline GUI.
参数
[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.

返回
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)

参数
[in] tension The new tension value.

◆  GetUserCallback()

SplineDataCallback GetUserCallback ( void *&  pData ) const

Gets the user callback function pointer.

参数
[out] pData Assigned the user data of the callback.
返回
The user callback.

◆  SetUserCallback()

void SetUserCallback ( SplineDataCallback   fn ,
void *  pData  
)

Sets the user callback function.

参数
[in] fn The pointer to the callback function.
[in] pData The user data passed to the callback function.

◆  CopyTo()

Bool CopyTo ( SplineData pDest )

Copies this spline dat values into the destination spline data pDest .

参数
[in] pDest The destination spline data. The caller owns the pointed spline data.
返回
true if this spline data was successfully copied to pDest , otherwise false .

◆  InitDefaultFlag()

Bool InitDefaultFlag ( Int32   flag )

Initializes the knot flag for selected knots.

参数
[in] flag A combination of these flags: FLAG_KNOT
返回
true if successful, otherwise false .