#include <kfcurvenode.h>
It is a composite class that contains curve node tree management services in itself. Cyclic graphs are forbidden in a curve node hierarchy.
Definition at line 359 of file kfcurvenode.h.
Constructors and Destructor |
|
KFCurveNode (char *pNodeName, char *pTimeWarpName, HKDataType pDataType, int pLayerType=KFCL_NOLAYER, int pLayerID=0) | |
Constructor. |
|
KFCurveNode (HKFCurveNode pTemplateCurveNode) | |
Template constructor. |
|
virtual | ~KFCurveNode () |
Destructor. |
|
FCurve Creation |
|
void | CreateFCurve () |
Create the FCurve for this node. |
|
bool | FCurveCreated () |
Test to know if the FCurve is created.
|
|
Cloning and Copy Functions |
|
HKFCurveNode | Clone (bool pKeepAttached) |
Return a duplicate of this node. |
|
HKFCurveNode | CloneTemplate (bool pKeepAttached=false, bool pCloneFCurves=false, bool pCreateCurves=false, int pLayerID=-1) |
Return a duplicate of this node. |
|
void | CopyFrom (HKFCurveNode pSource, bool pTransferCurve=false) |
Copy the function curve contained in the
given curve node. |
|
HKFCurveNode | Copy (KTime pStart=KTIME_MINUS_INFINITE, KTime pStop=KTIME_INFINITE) |
Create a copy of the current curve node.
|
|
Node Identification |
|
char * | GetName () const |
Retrieve the node's name. |
|
char * | GetTimeWarpName () const |
Retrieve the node's time warp name. |
|
char * | GetTypeName () const |
Retrieve the node type name. |
|
Function Curve Management |
|
HKFCurve | FCurveGet () const |
Get pointer to the node's function curve.
|
|
KFCurve * | FCurveSet (KFCurve *pCurve, bool pDestroyOldCurve=false) |
Set the function curve of this curve node.
|
|
void | FCurveReplace (KFCurve *pCurve) |
Replace the function curve of this curve
node. |
|
bool | GetTransformCurves (KFCurve *pT[3], KFCurve *pR[3], KFCurve *pS[3]) |
Return translation, rotation and scaling
curves of the children of this curve node. |
|
Curve Node Management |
|
virtual void | Clear () |
Clear this node. |
|
virtual int | Add (HKFCurveNode pCurveNode) |
Add a child curve node to this node.
|
|
virtual void | Remove (int pIndex) |
Remove a child curve node by index. |
|
virtual void | Delete (int pIndex) |
Remove and delete a child curve node by
index. |
|
virtual int | GetCount () const |
Get children curve nodes count. |
|
virtual HKFCurveNode | Get (int pIndex) const |
Get pointer to child curve node by index.
|
|
virtual bool | IsChild (KFCurveNode *pCurveNode, bool pRecursive=false) const |
Ask if a given curve node is a child of the
current curve node. |
|
virtual int | Find (char *pName) const |
Get index of child curve node by name.
|
|
virtual int | Find (HKFCurveNode pNode) const |
Get index of child curve node by pointer.
|
|
HKFCurveNode | FindRecursive (char *pName) const |
Recursively find the first child curve node
by name. |
|
HKFCurveNode | FindOrCreate (char *pName, bool pFindOrCreateCurve=true) |
Find a child node by name or create it if it
can not be found. |
|
virtual void | SetParent (HKFCurveNode pParent) |
Set the parent curve node. |
|
virtual HKFCurveNode | GetParent () const |
Get the parent curve node. |
|
Key Management |
|
int | KeyGetCount (bool pRecursiveInLayers=false) const |
Get the number of animation keys. |
|
void | KeyGetCount (int &pCurveCount, int &pTotalCount, int &pMinCount, int &pMaxCount) const |
Get the number of animation keys. |
|
void | GetCurveWithFirstKey (KFCurve *&lCurveWithFirstKey, bool *pCurveMask, bool pRecursiveInLayers) const |
Get the fcurve that has the earliest key.
|
|
void | GetCurveWithLastKey (KFCurve *&lCurveWithLastKey, bool *pCurveMask, bool pRecursiveInLayers) const |
Get the fcurve that has the latest key.
|
|
KTime | GetFirstKeyTime (bool *pCurveMask=NULL, bool pRecursiveInLayers=false) const |
Get the first key time in the children
specified by the curve mask (NULL = all children) If there is no
key, return KTIME_MINUS_INFINITE. |
|
KTime | GetLastKeyTime (bool *pCurveMask=NULL, bool pRecursiveInLayers=false) const |
Get the last key time in the children
specified by the curve mask (NULL = all children) If there is no
key, return KTIME_INFINITE. |
|
double * | KeyAdd (KTime pTime, double *pValue) |
Recursively add a set of keys in the curve
node tree. |
|
double * | KeyAppend (KTime pTime, double *pValue, bool pCheckForContinuousRotation=false) |
Recursively append a set of keys in the
curve node tree. |
|
bool | GetAnimationInterval (KTime &pStart, KTime &pStop) const |
Find out start and stop time of the
animation for a curve node and recursively in its children.
|
|
void | GetTimeSpan (KTime &pStart, KTime &pStop) const |
Find out start and stop time of the
animation for a curve node and recursively in it's children.
|
|
int | IsKey (KTime &pTime, int *pLast, bool *pCurveMask=NULL, double pKeyIndexTolerance=0.0, double pMin=-K_DOUBLE_MAX, double pMax=K_DOUBLE_MAX) const |
Recursively check if keys exist at a given
time in the curve node tree. |
|
bool | DeleteKey (KTime &pTime, bool *pCurveMask=NULL, double pKeyIndexTolerance=0.0) |
Recursively delete keys at a given time in
the curve node tree. |
|
KTime | GetNextKeyTime (KTime pTime, bool *pCurveMask=NULL, bool pRecursiveInLayers=false) const |
Recursively find the closest later time at
which a key can be found compared to a given time. |
|
KTime | GetPrevKeyTime (KTime pTime, bool *pCurveMask=NULL) const |
Recursively find the closest earlier time at
which a key can be found compared to a given time. |
|
double * | Evaluate (double *pValue, KTime pTime, kFCurveIndex *pLast=NULL) |
Recursively evaluate the curve node tree.
|
|
double * | GetValue (double *pValue) const |
Recursively get the default values of the
curve node tree. |
|
double * | SetValue (double *pValue) |
Recursively set the default values of the
curve node tree. |
|
void | Delete (KTime pStart=KTIME_MINUS_INFINITE, KTime pStop=KTIME_INFINITE) |
Delete all the keys found within a given
time range. |
|
void | Replace (HKFCurveNode pSource, KTime pStart=KTIME_MINUS_INFINITE, KTime pStop=KTIME_INFINITE, bool pUseGivenSpan=false, bool pKeyStartEndOnNoKey=true, KTime pTimeSpanOffset=KTIME_ZERO) |
Replace all the keys found within a given
time range. |
KFCurveNode | ( | char * | pNodeName, | |
char * | pTimeWarpName, | |||
HKDataType | pDataType, | |||
int | pLayerType =
KFCL_NOLAYER , |
|||
int | pLayerID = 0 |
|||
) |
Constructor.
pNodeName | Curve node name. | |
pTimeWarpName | Curve node. | |
pDataType | Curve node type. | |
pLayerType | LayerType. | |
pLayerID | LayerID. |
KFCurveNode | ( | HKFCurveNode | pTemplateCurveNode | ) |
Template constructor.
pTemplateCurveNode | Template curve node. |
virtual ~KFCurveNode | ( | ) | [virtual] |
Destructor.
void CreateFCurve | ( | ) |
Create the FCurve for this node.
This function is called recursively for all children curve nodes.
bool FCurveCreated | ( | ) |
Test to know if the FCurve is created.
This function is called recursively for all children curve nodes. It returns false as soon as one child does not have its FCurve.
HKFCurveNode Clone | ( | bool | pKeepAttached | ) |
Return a duplicate of this node.
This function is called recursively for all children curve nodes. The function curve is copied in the new curve node.
pKeepAttached | If true , the created object will share a structure
that defines the node name, node display name and node type name.
Otherwise, this structure is copied. |
pCloneFCurves
set to
true
.HKFCurveNode CloneTemplate | ( | bool | pKeepAttached =
false , |
|
bool | pCloneFCurves =
false , |
|||
bool | pCreateCurves =
false , |
|||
int | pLayerID = -1 |
|||
) |
Return a duplicate of this node.
This function is called recursively for all children curve nodes.
pKeepAttached | If true , the created object will share a structure
that defines the node name, node display name and node type name.
Otherwise, this structure is copied. |
|
pCloneFCurves | If true and the current curve node has a function
curve, the function curve is copied in the new curve node. |
|
pCreateCurves | If true , pCloneFCurve is set to
false and the current curve node has a function curve,
an empty function curve is created in the new curve node. |
|
pLayerID | LayerID. |
void CopyFrom | ( | HKFCurveNode | pSource, | |
bool | pTransferCurve =
false |
|||
) |
Copy the function curve contained in the given curve node.
pSource | Given curve node to copy the function curve from. | |
pTransferCurve | If true , curve data is transferred instead of
being copied. |
pSource
is copied in the first child curve node of
the current object and so on.Create a copy of the current curve node.
The structure defining the node name, node display name and node type name is copied, not shared. Only the animation keys in a given time range are copied.
pStart | Start time for range of animation keys copied. | |
pStop | Stop time for range of animation keys copied. |
char* GetName | ( | ) | const |
Retrieve the node's name.
char* GetTimeWarpName | ( | ) | const |
Retrieve the node's time warp name.
char* GetTypeName | ( | ) | const |
Retrieve the node type name.
HKFCurve FCurveGet | ( | ) | const |
Get pointer to the node's function curve.
NULL
pointer if there's
none.Set the function curve of this curve node.
pCurve | New function curve. | |
pDestroyOldCurve | Set to true to delete the function curve already
contained in the curve node. |
pDestroyOldCurve
is set to
false
. Otherwise, NULL
is returned.void FCurveReplace | ( | KFCurve * | pCurve | ) |
Replace the function curve of this curve node.
Previous function curve is automatically destroyed.
pCurve | New function curve. |
pDestroyOldCurve
set to
true
.Return translation, rotation and scaling curves of the children of this curve node.
This function is meant to be called on the root KFCurveNode object found in class KFbxTakeNode.
pT | Array to receive X, Y and Z translation function curves. | |
pR | Array to receive X, Y and Z rotation function curves. | |
pS | Array to receive X, Y and Z scaling function curves. |
true
if all function curves have been found,
false
otherwise.virtual void Clear | ( | ) | [virtual] |
Clear this node.
Delete the function curve and all the children curve nodes.
virtual int Add | ( | HKFCurveNode | pCurveNode | ) | [virtual] |
Add a child curve node to this node.
pCurveNode | The child curve node to be added. |
virtual void Remove | ( | int | pIndex | ) | [virtual] |
Remove a child curve node by index.
pIndex | Index of child curve node to be removed. |
virtual void Delete | ( | int | pIndex | ) | [virtual] |
Remove and delete a child curve node by index.
pIndex | Index of child curve node to be deleted. |
virtual int GetCount | ( | ) | const [virtual] |
Get children curve nodes count.
virtual HKFCurveNode Get | ( | int | pIndex | ) | const [virtual] |
Get pointer to child curve node by index.
pIndex | Index of child curve node. |
NULL
is index is
out of bounds.virtual bool IsChild | ( | KFCurveNode * | pCurveNode, | |
bool | pRecursive = false |
|||
) | const [virtual] |
Ask if a given curve node is a child of the current curve node.
pCurveNode | Curve node searched. | |
pRecursive | Set to true to search recursively. Set to
false to search only in the immediate children curve
nodes. |
true
if the curve node searched is found,
false
otherwise.virtual int Find | ( | char * | pName | ) | const [virtual] |
Get index of child curve node by name.
pName | Name of searched child curve node. |
virtual int Find | ( | HKFCurveNode | pNode | ) | const [virtual] |
Get index of child curve node by pointer.
pNode | Pointer to searched child curve node. |
HKFCurveNode FindRecursive | ( | char * | pName | ) | const |
Recursively find the first child curve node by name.
pName | Name of searched child curve node. |
NULL
if this name
could not be found.HKFCurveNode FindOrCreate | ( | char * | pName, | |
bool | pFindOrCreateCurve =
true |
|||
) |
Find a child node by name or create it if it can not be found.
pName | Name of child node to find. | |
pFindOrCreateCurve | If true and the function curve does not exist,
create one in the curve node found or created. |
virtual void SetParent | ( | HKFCurveNode | pParent | ) | [inline, virtual] |
Set the parent curve node.
pParent | The parent curve node to be set. |
Definition at line 613 of file kfcurvenode.h.
virtual HKFCurveNode GetParent | ( | ) | const [inline, virtual] |
Get the parent curve node.
NULL
if there
is none.Definition at line 618 of file kfcurvenode.h.
int KeyGetCount | ( | bool | pRecursiveInLayers =
false |
) | const |
Get the number of animation keys.
pRecursiveInLayers | Return the total number of keys contained in the function curves included in the current node and its children curve nodes. |
Get the number of animation keys.
pCurveCount | returns the number of fcurves held by this node | |
pTotalCount | returns the number of keys on all the fcurves held by this node | |
pMinCount | returns the minimum number of keys on an fcurve held by this node | |
pMaxCount | returns the maximum number of keys on an fcurve held by this node |
void GetCurveWithFirstKey | ( | KFCurve *& | lCurveWithFirstKey, | |
bool * | pCurveMask, | |||
bool | pRecursiveInLayers | |||
) | const |
Get the fcurve that has the earliest key.
If many fcurves has a key at the earliest time, returns one of the fcurves.
lCurveWithFirstKey | The fcurve has the earliest key. | |
pCurveMask | Allows you to use only specific children in the CurveNode. NULL means all of them. | |
pRecursiveInLayers |
void GetCurveWithLastKey | ( | KFCurve *& | lCurveWithLastKey, | |
bool * | pCurveMask, | |||
bool | pRecursiveInLayers | |||
) | const |
Get the fcurve that has the latest key.
If many fcurves has a key at the latest time, returns one of the fcurves.
lCurveWithLastKey | The fcurve has last key. | |
pCurveMask | Allows you to use only specific children in the CurveNode. NULL means all of them. | |
pRecursiveInLayers |
KTime GetFirstKeyTime | ( | bool * | pCurveMask = NULL , |
|
bool | pRecursiveInLayers =
false |
|||
) | const |
Get the first key time in the children specified by the curve mask (NULL = all children) If there is no key, return KTIME_MINUS_INFINITE.
pCurveMask | Allows you to use only specific children in the CurveNode. NULL means all of them. | |
pRecursiveInLayers |
KTime GetLastKeyTime | ( | bool * | pCurveMask = NULL , |
|
bool | pRecursiveInLayers =
false |
|||
) | const |
Get the last key time in the children specified by the curve mask (NULL = all children) If there is no key, return KTIME_INFINITE.
pCurveMask | Allows you to use only specific children in the CurveNode. NULL means all of them. | |
pRecursiveInLayers |
Recursively add a set of keys in the curve node tree.
Depth first key adding in the function curves included in the current node and its children curve nodes.
pTime | Time to add the keys. | |
pValue | Array containing all the key values. This array must contain as many elements as the number of function curves included in the current node and its children curve nodes. |
pValue
added with an offset
equal to the number of affected function curves times
sizeof(kDouble)
.Recursively append a set of keys in the curve node tree.
Depth first key appending in the function curves included in the current node and its children curve nodes.
pTime | Time set in the appended keys. Make sure this time has a greater value than any of the last keys in the affected function curves. | |
pValue | Array containing all the key values. This array must contain as many elements as the number of function curves included in the current node and its children curve nodes. | |
pCheckForContinuousRotation | Flag, when set to true we will check for continuous rotation values. This is like an unroll filter on the fly. Relevant only for rotation fcurve nodes. |
pValue
added with an offset
equal to the number of function curves affected times
sizeof(kDouble)
.Find out start and stop time of the animation for a curve node and recursively in its children.
pStart | Reference to store start time. pStart is
overwritten only if the start time found is lower than
pStart value. Initialize to KTIME_INFINITE to make
sure the start time is overwritten in any case. |
|
pStop | Reference to store end time. pStop is overwritten
only if the stop time found is higher than pStop
value. Initialize to KTIME_MINUS_INFINITE to make sure the stop
time is overwritten in any case. |
true
if at least one key has been found in all the
function curves scanned.Find out start and stop time of the animation for a curve node and recursively in it's children.
pStart | Reference to receive the smaller key time, set to KTIME_INFINITE if no key could be found. | |
pStop | Reference to receive the larger key time, set to KTIME_MINUS_INFINITE if no key could be found. |
int IsKey | ( | KTime & | pTime, | |
int * | pLast, | |||
bool * | pCurveMask = NULL , |
|||
double | pKeyIndexTolerance =
0.0 , |
|||
double | pMin =
-K_DOUBLE_MAX , |
|||
double | pMax =
K_DOUBLE_MAX |
|||
) | const |
Recursively check if keys exist at a given time in the curve node tree.
Check if a key exists at the given time in the function curves included in the current node and its children curve nodes.
pTime | Given time to check key occurrence. | |
pLast | Function curve index to speed up search. If this function is called in a loop, initialize this value to 0 and let it be updated by each call. | |
pCurveMask | allows you to use only specific children in the CurveNode. NULL means all of them. | |
pKeyIndexTolerance | allows the test to be less strict when matching the time with a key index. | |
pMin | Minimal Value to Consider the Key. | |
pMax | Maximal Value to Consider the Key. |
ISKEY_NONE
if no function curve has a key at the
given time, ISKEY_SOME
if some function curves have a
key at the given time or ISKEY_ALL
if all function
curves have a key at the given time.Recursively delete keys at a given time in the curve node tree.
Delete keys at the given time in the function curves included in the current node and its children curve nodes.
pTime | Given time to delete keys. | |
pCurveMask | allows you to use only specific children in the CurveNode. NULL means all of them. | |
pKeyIndexTolerance | allows to be less strict when matching the time with a key index. |
true
if at least one key has been found at the
given time and deleted.KTime GetNextKeyTime | ( | KTime | pTime, | |
bool * | pCurveMask = NULL , |
|||
bool | pRecursiveInLayers =
false |
|||
) | const |
Recursively find the closest later time at which a key can be found compared to a given time.
Find the closest but later time at which a key can be found compared to a given time in the function curves included in the current node and its children curve nodes.
pTime | Given time to search the next key time. | |
pCurveMask | allows you to use only specific children in the CurveNode. NULL means all of them. | |
pRecursiveInLayers |
Recursively find the closest earlier time at which a key can be found compared to a given time.
Find the closest earlier time at which a key can be found compared to a given time in the function curves included in the current node and its children curve nodes.
pTime | Given time to search the previous key time. | |
pCurveMask | allows you to use only specific children in the CurveNode. NULL means all of them. |
double* Evaluate | ( | double * | pValue, | |
KTime | pTime, | |||
kFCurveIndex * | pLast = NULL |
|||
) |
Recursively evaluate the curve node tree.
Depth first evaluation of the function curves included in the current node and its children curve nodes.
pValue | Array to receive all the function curve evaluations. This array must be long enough to contain as many elements as the number of function curves included in the current node and its children curve nodes. | |
pTime | Time of evaluation. | |
pLast | Function curve index to speed up evaluation. If this function is called in a loop, initialize this value to 0 and let it be updated by each call. |
pValue
added with an offset
equal to the number of function curves evaluated times
sizeof(double)
.Recursively get the default values of the curve node tree.
Depth first access to the default values of the function curves included in the current node and its children curve nodes.
pValue | Array to receive all the function curve default values. This array must be long enough to contain as many elements as the number of function curves included in the current node and its children curve nodes. |
pValue
added with an offset
equal to the number of function curves accessed times
sizeof(double)
.Recursively set the default values of the curve node tree.
Depth first setting of the default values of the function curves included in the current node and its children curve nodes.
pValue | Array containing all the function curve default values. This array must contain as many elements as the number of function curves included in the current node and its children curve nodes. |
pValue
added with an offset
equal to the number of function curves set times
sizeof(double)
.Delete all the keys found within a given time range.
Delete all the keys found within a given time range in the function curves included in the current node and its children curve nodes.
pStart | Beginning of time range. | |
pStop | End of time range. |
void Replace | ( | HKFCurveNode | pSource, | |
KTime | pStart =
KTIME_MINUS_INFINITE , |
|||
KTime | pStop =
KTIME_INFINITE , |
|||
bool | pUseGivenSpan =
false , |
|||
bool | pKeyStartEndOnNoKey =
true , |
|||
KTime | pTimeSpanOffset =
KTIME_ZERO |
|||
) |
Replace all the keys found within a given time range.
Replace all the keys found within a given time range in the function curves included in the current node and its children curve nodes.
pSource | Source node tree containing the replacement keys. The curve
node tree below pSource must be identical to the curve
node tree below the current node. |
|
pStart | Beginning of time range. | |
pStop | End of time range. | |
pUseGivenSpan | false = original behavior where the time of the first and last key was used | |
pKeyStartEndOnNoKey | Inserts a key at the beginning and at the end of the range if there is no key to insert. | |
pTimeSpanOffset |