Public Member Functions
CParameterRefArray Class Reference

Detailed Description

An array of Parameters.

See also:
ProjectItem::GetParameters, Parameter::GetParameters, CRefArray, Parameter
Example:
        using namespace XSI;
        Application app;
        Model root = app.GetActiveSceneRoot();

        X3DObject myCube;
        root.AddGeometry( L"Cube", L"MeshSurface", CString(L"MyCube"), myCube );

        CParameterRefArray params = myCube.GetParameters();

        Parameter posx(params.GetItem( L"posx" ));
        Parameter posy(params.GetItem( L"posy" ));
        Parameter posz(params.GetItem( L"posz" ));

        posx.PutValue(5.5);
        posy.PutValue(8.0);

        app.LogMessage( L"Cube's pos parameter: " +
            CValue(posx.GetValue()).GetAsText() + L"," +
            CValue(posy.GetValue()).GetAsText() + L"," +
            CValue(posz.GetValue()).GetAsText() );

#include <xsi_parameter.h>

Inheritance diagram for CParameterRefArray:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 CParameterRefArray ()
 CParameterRefArray (const CParameterRefArray &)
 ~CParameterRefArray ()
CParameterRefArrayoperator= (const CParameterRefArray &in_refArray)
CRef GetItem (const CString &in_scriptname) const
void Add (const CRef &in_item)
void RemoveItem (const CString &in_scriptname)
CRefArray PlotAnimation (double in_startFrame=DBL_MAX, double in_stopFrame=DBL_MAX, double in_stepFrame=1, siFCurveType in_fcurveTypeToPlot=siStandardFCurve, siFCurveInterpolation in_interpolation=siCubicInterpolation, bool in_bFitValues=false, double in_fitTolerance=0.01, bool in_bProcessRotation=false, bool in_bDisplayProgressBar=true)
CValue GetValue (const CString &in_scriptname, double in_time=DBL_MAX) const
CValue GetValue (LONG in_index, double in_time=DBL_MAX) const
CStatus PutValue (const CString &in_scriptname, const CValue &in_val, double in_time=DBL_MAX)
CStatus PutValue (LONG in_index, const CValue &in_val, double in_time=DBL_MAX)

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

CParameterRefArray& operator= ( const CParameterRefArray in_refArray)

Assign a CParameterRefArray object to this one.

Parameters:
in_refArrayA constant CParameterRefArray object.
Returns:
A new reference object.
CRef GetItem ( const CString in_scriptname) const [virtual]

Returns a CRef object contained in the list given an object scripting name. If the requested parameter does not exist in the array then an invalid CRef is returned.

Parameters:
in_scriptnameThe scripting name of a parameter to retrieve.
Returns:
A new CRef object.
See also:
Parameter::GetScriptName
CRef::IsValid

Reimplemented from CRefArray.

void Add ( const CRef in_item) [virtual]

Adds a CRef object at the end of this array. The CRef must be Valid and refer to a Parameter, otherwise it is ignored. This operation does not actually add a parameter to any associated XSI object.

Parameters:
in_itemCRef object.
See also:
CustomProperty::AddParameter

Reimplemented from CRefArray.

void RemoveItem ( const CString in_scriptname)

Removes a parameter from the CParameterRefArray. This does not actually remove the parameter from any associated XSI object. No action is performed if the requested parameter is not found in the CParameterRefArray.

Parameters:
in_scriptnamescriptname of parameter.
See also:
CustomProperty::RemoveParameter
CRefArray PlotAnimation ( double  in_startFrame = DBL_MAX,
double  in_stopFrame = DBL_MAX,
double  in_stepFrame = 1,
siFCurveType  in_fcurveTypeToPlot = siStandardFCurve,
siFCurveInterpolation  in_interpolation = siCubicInterpolation,
bool  in_bFitValues = false,
double  in_fitTolerance = 0.01,
bool  in_bProcessRotation = false,
bool  in_bDisplayProgressBar = true 
)

Creates and returns an array of FCurve objects by plotting the parameters values from consecutive frames of an animation. The resulting FCurve objects are transients and not connected to any XSI components. All resulting FCurve objects are parented to the Application object.

Parameters:
in_startFrameFirst frame to plot. Use DBL_MAX to specify the first frame in the timeline. Defaults to DBL_MAX.
in_stopFrameLast frame to plot. Use DBL_MAX to specify the last frame in the timeline. Defaults to DBL_MAX.
in_stepFrameStep between frames. Defaults to 1.
in_fcurveTypeToPlotType of fcurve required for plotting. Defaults to siStandardFCurve.
in_interpolationType of interpolation required for the resulting fcurves. This argument is only relevant if in_fcurveTypeToPlot is siStandardFCurve. Defauts to siCubicInterpolation.
in_bFitValuesFits the fcurves through the plotted values. Defaults to false.
in_fitToleranceTolerance value used for fitting the fcurves through the plotted values. Defaults to 0.01.
in_bProcessRotationProcesses the rotation curves to ensure their continuity. Defaults to false. For processing continuous rotations the rotation channels must be listed consecutively. e.g. cube.local.rotx, cube.local.roty, cube.local.rotz otherwise the rotation for that object will not be processed.
in_bDisplayProgressBarDisplay a progress bar control to indicates the progress of the plot operation. Defaults to true.
Returns:
Array of FCurve objects. The returned array of FCurve objects matches the parameters in size. Parameters that are filtered out (e.g. invalid parameter to plot) have an invalid FCurve object in the returned array.
See also:
FCurve
Since:
5.0
CValue GetValue ( const CString in_scriptname,
double  in_time = DBL_MAX 
) const

Returns the value of a parameter identified with a scripting name. The value returned is empty if the input name is invalid.

Note:
This function can be more efficient than getting a Parameter object and then calling Parameter::GetValue to get the value. Use this function in cases where you only need to get the value on a parameter.
Parameters:
in_scriptnameThe parameter scripting name (see Parameter::GetScriptName).
in_timeTime in frame defaults to the current frame if in_time is set with DBL_MAX.
Returns:
The parameter value.
Since:
5.1
CValue GetValue ( LONG  in_index,
double  in_time = DBL_MAX 
) const

Returns the value of a parameter at a specific position in the array. The value returned is empty if the index is out of bounds.

Note:
This function can be more efficient than getting a Parameter object and then calling Parameter::GetValue to get the value. Use this function in cases where you only need to get the value on a parameter.
Parameters:
in_indexThe position of the parameter in the array.
in_timeTime in frames. Defaults to the current frame if in_time is set with DBL_MAX.
Returns:
The parameter value.
Since:
6.0
CStatus PutValue ( const CString in_scriptname,
const CValue in_val,
double  in_time = DBL_MAX 
)

Sets a parameter value by scripting name. If you try to set a read-only parameter, an error (CStatus::Unexpected) occurs. You can check if a parameter is read-only by checking the condition:

Tip:
You can set a custom property parameter even if it is created with the read-only capability.
Note:
This function can be more efficient than getting a Parameter object and then calling Parameter::PutValue to set the value. Use this function in cases where you only need to set the value on a parameter.
Parameters:
in_scriptnameThe parameter scripting name.
in_valThe parameter value to set.
in_timeTime in frame defaults to the current frame if in_time is set with DBL_MAX.
Returns:
CStatus::OK success
CStatus::Fail other failure
CStatus::Unexpected Trying to set a read-only parameter.
CStatus::BadVarType Invalid input value type. Usually happens if in_val cannot be converted to the parameter type.
Since:
5.1
CStatus PutValue ( LONG  in_index,
const CValue in_val,
double  in_time = DBL_MAX 
)

Sets the value of the parameter at a given position in the array. If you try to set a read-only parameter, an error (CStatus::Unexpected) occurs. You can check if a parameter is read-only by checking the condition:

 Parameter::GetCapabilities && siReadOnly == siReadOnly 
Tip:
You can set a custom property parameter even if it is created with the read-only capability.
Note:
This function can be more efficient than getting a Parameter object and then calling Parameter::PutValue to set the value. Use this function in cases where you only need to set the value on a parameter.
Parameters:
in_indexThe position of the parameter in the array.
in_valThe parameter value to set.
in_timeTime in frame defaults to the current frame if in_time is set with DBL_MAX.
Returns:
CStatus::OK success
CStatus::Fail other failure
CStatus::Unexpected Trying to set a read-only parameter.
CStatus::BadVarType Invalid input value type. Usually happens if in_val cannot get converted to the parameter type.
Since:
6.0

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