-
首页
-
C4D R23.110 C++ SDK
SplineData Class Reference
#include <customgui_splinecontrol.h>
详细描述
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.
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)
|
构造函数 & 析构函数文档编制
◆
SplineData()
◆
~SplineData()
成员函数文档编制
◆
Alloc()
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()
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]
Gets the spline knot at position
l
.
-
参数
-
-
返回
-
The spline knot.
◆
GetKnot()
[2/2]
◆
SetKnot()
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()
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()
Deletes a knot.
-
参数
-
-
返回
-
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()
Gets a point from its X coordinate.
-
参数
-
-
返回
-
The retrieved point.
◆
DeleteAllPoints()
Deletes all points.
◆
MakePointBuffer()
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()
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()
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()
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()
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()
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()
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()
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()
Selects all points.
◆
Flip()
Flips the spline.
◆
Mirror()
Mirrors the spline.
◆
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.
-
参数
-
[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()
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()
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()
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()
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()
Gets the user callback function pointer.
-
参数
-
[out]
|
pData
|
Assigned the user data of the callback.
|
-
返回
-
The user callback.
◆
SetUserCallback()
Sets the user callback function.
-
参数
-
[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
.
-
参数
-
[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()
Initializes the knot flag for selected knots.
-
参数
-
[in]
|
flag
|
A combination of these flags:
FLAG_KNOT
|
-
返回
-
true
if successful, otherwise
false
.