Public Member Functions
CFCurveKeyRefArray Class Reference

Detailed Description

This class represents an array of keys on a function curve (FCurve). Duplicate keys are not allowed and a single array can only hold keys from the same fcurve.

See also:
CRefArray, FCurveKeys, FCurve::GetKeys, FCurve::GetKeysBetween
Since:
6.0
Example:
This example demonstrates how to get a list of references to all keys in an FCurve
        using namespace XSI;
        Application app;
        Model root = app.GetActiveSceneRoot();

        Null myNull;
        root.AddNull( L"", myNull );
        Parameter posx( myNull.GetParameter( L"posx" ) );

        // Create and connect an function curve to the position x
        FCurve fcrv;
        posx.AddFCurve( siUnknownFCurve, fcrv );

        // Set the keys
        LONG i = 0;
        CTimeArray timeArray(3);
        CValueArray valueArray(3);

        timeArray[i] = 1;   valueArray[i] = (double)10; i++;
        timeArray[i] = 50;  valueArray[i] = (double)0; i++;
        timeArray[i] = 100; valueArray[i] = (double)10; i++;

        fcrv.SetKeys(timeArray,valueArray);

        // Get the keys
        CFCurveKeyRefArray keys = fcrv.GetKeys();

#include <xsi_fcurvekey.h>

Inheritance diagram for CFCurveKeyRefArray:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 CFCurveKeyRefArray ()
 CFCurveKeyRefArray (const CFCurveKeyRefArray &)
 ~CFCurveKeyRefArray ()
CFCurveKeyRefArrayoperator= (const CFCurveKeyRefArray &in_refArray)
CFCurveKeyRefArrayoperator+= (const CFCurveKeyRefArray &in_refArray)
virtual void Add (const CRef &in_item)
void AddItems (const CFCurveKeyRefArray &in_keys)
void RemoveAt (LONG in_index)
CTime GetMinKeyFrame (void) const
CTime GetMidKeyFrame (void) const
CTime GetMaxKeyFrame (void) const
CValue GetMinKeyValue (void) const
CValue GetMidKeyValue (void) const
CValue GetMaxKeyValue (void) const

Constructor & Destructor Documentation

Default constructor.

Copy constructor. Performs a shallow copy, so any change to one instance will appear in any of the copies.

Default destructor.


Member Function Documentation

CFCurveKeyRefArray& operator= ( const CFCurveKeyRefArray in_refArray)

Assigns a CFCurveKeyRefArray object to this one.

Parameters:
in_refArrayA constant CFCurveKeyRefArray object.
Returns:
A new reference array.
Since:
6.0
CFCurveKeyRefArray& operator+= ( const CFCurveKeyRefArray in_refArray)

Adds a CFCurveKeyRefArray object to this one.

Parameters:
in_refArrayA constant CFCurveKeyRefArray object.
Returns:
A new reference object.
virtual void Add ( const CRef in_item) [virtual]

Adds another FCurveKey to this array. The item will be added only if it is not already in the array and it belongs to the same FCurve as existing keys. CFCurveKeyRefArray will add keys to the array so that the array is sorted by frame time.

Parameters:
in_itemThe reference to an FCurveKey to be added.
Since:
6.0

Reimplemented from CRefArray.

void AddItems ( const CFCurveKeyRefArray in_keys)

Adds the keys from another CFCurveKeyRefArray into this array. The keys will be added to this array only if they are not already in the array and they belong to the same FCurve as existing keys.

Keys will be added to the array sorted by frame time.

Parameters:
in_keysArray of references to FCurveKey objects to add
Since:
6.0
void RemoveAt ( LONG  in_index)

Removes an item from the specified location in the array.

Parameters:
in_indexIndex of item to remove
Since:
6.0
CTime GetMinKeyFrame ( void  ) const

Returns the smallest key time in the CFCurveKeyRefArray.

Returns:
Minimum key time
CStatus::Fail If the array has no keys
Since:
6.0
CTime GetMidKeyFrame ( void  ) const

Returns the average of the first and last key times in the array.

Returns:
Center key time
CStatus::Fail If the array has no keys
Since:
6.0
CTime GetMaxKeyFrame ( void  ) const

Returns the largest key time in the array.

Returns:
Maximum key time
CStatus::Fail If the array has no keys
Since:
6.0
CValue GetMinKeyValue ( void  ) const

Returns the smallest key value in the array.

Returns:
Minimum key value
CStatus::Fail If the array has no keys
Since:
6.0
CValue GetMidKeyValue ( void  ) const

Returns the average of the largest and smallest key values in the array.

Returns:
Center key value
CStatus::Fail If the array has no keys
Since:
6.0
CValue GetMaxKeyValue ( void  ) const

Returns the largest key value in the array.

Returns:
Maximum key value
CStatus::Fail If the array has no keys
Since:
6.0

The documentation for this class was generated from the following file: