#include <xsi_shaderarrayparameter.h>
Represents an array parameter for a Shader.
An array parameter is a specialization of the
ShaderParameter class which contains a set of ShaderParameter
objects. These types of parameters are useful for supporting a
dynamic number of instances of parameters. For example, the Volume
Effects shader defines an array parameter of light references
labeled scatter_lights_input
that allows you to add
any number of lights.
It can contain any number of sub-parameters, all of the same type. Its contents can be moved around, new parameters added and old ones removed.
These type of parameters can be defined using the ShaderArrayParamDef interface.
Public Member Functions |
|
ShaderArrayParameter () | |
~ShaderArrayParameter () | |
ShaderArrayParameter (const CRef &in_ref) | |
ShaderArrayParameter (const ShaderArrayParameter &in_obj) | |
bool | IsA (siClassID in_ClassID) const |
siClassID | GetClassID () const |
ShaderArrayParameter & | operator= (const ShaderArrayParameter &in_obj) |
ShaderArrayParameter & | operator= (const CRef &in_ref) |
ShaderParameter | operator[] (LONG in_index) |
LONG | GetCount () const |
ShaderParameter | Add () |
CStatus | Remove (LONG in_lIndex) |
CStatus | Remove (const ShaderParameter &in_parameter) |
CStatus | Clear () |
CStatus | Move (LONG in_lIndex, LONG in_lUpDown) |
CStatus | Move (const ShaderParameter &in_parameter, LONG in_lUpDown) |
Constructs an ShaderArrayParameter object.
~ShaderArrayParameter | ( | ) |
Destroys an ShaderArrayParameter object.
ShaderArrayParameter | ( | const CRef & | in_ref | ) |
Constructs an ShaderArrayParameter object from a reference to another ShaderArrayParameter object.
in_ref | A reference to a group. |
ShaderArrayParameter | ( | const ShaderArrayParameter & | in_obj | ) |
Constructs a new ShaderArrayParameter object from an existing ShaderArrayParameter object.
bool IsA | ( | siClassID | in_ClassID | ) | const [virtual] |
Returns true if this object supports the functionality of a specified class. For example, an ShaderArrayParameter is a type of ShaderParameter, so an ShaderArrayParameter object supports ShaderParameter functionality.
in_ClassID | Test if this object supports this class. |
Reimplemented from ShaderParameter.
siClassID GetClassID | ( | ) | const [virtual] |
ShaderArrayParameter& operator= | ( | const ShaderArrayParameter & | in_obj | ) |
Assigns an ShaderArrayParameter object to an existing ShaderArrayParameter object.
in_obj | An ShaderArrayParameter object to be copied into this object. |
ShaderArrayParameter& operator= | ( | const CRef & | in_ref | ) |
Assigns a CRef to this ShaderArrayParameter object. The ShaderArrayParameter object is cleared if the CRef is not a reference to an object that supports the ShaderArrayParameter class.
in_ref | A reference to an object that supports the ShaderArrayParameter class. |
Reimplemented from ShaderParameter.
ShaderParameter operator[] | ( | LONG | in_index | ) |
Returns the parameter at a given index. If the index is out of bounds, this operator returns an empty, invalid ShaderParameter object.
in_index | Integer index of the parameter to get. |
LONG GetCount | ( | ) | const |
Returns the size of the array. If the array is empty or invalid,
0
is returned.
ShaderParameter Add | ( | ) |
Appends a new parameter to this array. The type of the new parameter is determined by the definition of the array parameter. This corresponds to clicking the Add button for the shader array parameter section on the shader's property page.
CStatus Remove | ( | LONG | in_lIndex | ) |
Removes the item from this array that matches the specified index. This corresponds to choosing Remove from an item's context menu in the UI.
in_lIndex | The index of the parameter to remove. |
CStatus Remove | ( | const ShaderParameter & | in_parameter | ) |
Removes the specified item from this array. This corresponds to choosing Remove from an item's context menu in the UI.
in_parameter | ShaderParameter to remove. |
CStatus Clear | ( | ) |
Removes all items from this array. This corresponds to clicking the Clear button for the shader array parameter section on the shader's property page.
Reimplemented from CBase.
CStatus Move | ( | LONG | in_lIndex, |
LONG | in_lUpDown | ||
) |
Moves a parameter up or down in the array relative to its
current position. The new position of the parameter is calculated
by adding in_lUpDown
to the current index and clamping
the result to the array boundaries (0 to
ShaderArrayParameter::GetCount - 1).
in_lIndex | The index of the parameter to move. |
in_lUpDown | Positive or negative amount to move the parameter. |
CStatus Move | ( | const ShaderParameter & | in_parameter, |
LONG | in_lUpDown | ||
) |
Moves a given parameter up or down in the array relative to its
current position. The new position of the parameter is calculated
by adding in_lUpDown
to the current index and clamping
the result to the array boundaries (0 to
ShaderArrayParameter::GetCount - 1).
in_parameter | The parameter to move. |
in_lUpDown | Positive or negative amount to move the parameter. |