Public Member Functions
ShaderParamDef Class Reference

## Detailed Description

Represents the definition of a ShaderParameter object.

Shader parameter definitions are stored on the ShaderDef object in a special ShaderParamDefContainer object, which allows you to access existing parameter definitions or add new ones. To access the ShaderParamDefContainer object, call ShaderDef::GetInputParamDefs or ShaderDef::GetOutputParamDefs. From the ShaderParamDefContainer you can add new parameter definitions by calling ShaderParamDefContainer::AddParamDef or ShaderParamDefContainer::AddArrayParamDef with a set of ShaderParamDefOptions.

To access a specific shader parameter definition from an instantiated shader definition, use the ShaderParamDefContainer::GetParamDefByName function. To iterate over the entire list of input or output parameter definitions for an instantiated shader definition, use ShaderParamDefContainer::GetDefinitions.

To access existing shader parameter definitions from a ShaderParameter instance, use ShaderParameter::GetDefinition.

To add an array parameter (ShaderArrayParamDef), use ShaderParamDefContainer::AddArrayParamDef. For all other parameter types, use ShaderParamDefContainer::AddParamDef.

Note:
  This object is a generic interface. There are special accessors on the specializations of this class for the array and struct parameter types. See the ShaderArrayParamDef and ShaderStructParamDef reference pages for more details on these specializations.

See also:
  ShaderParamDefContainer::AddParamDef, ShaderParamDefContainer::AddArrayParamDef, ShaderParameter::GetDefinition, ShaderParamDefContainer, cus_shaders_Params Shader Parameter Definitions , ShaderDefinitions/netview_ShaderDefs Color Sampler example

Since:
  9.0 (2011)

`#include <xsi_shaderparamdef.h>`

Inheritance diagram for ShaderParamDef:
[legend]

List of all members.

## Public Member Functions
| ShaderParamDef ()
| ~ShaderParamDef ()
| ShaderParamDef (const CRef &in_ref)
| ShaderParamDef (const ShaderParamDef &in_obj)
bool | IsA (siClassID in_ClassID) const
siClassID | GetClassID () const
ShaderParamDef & | operator= (const ShaderParamDef &in_obj)
ShaderParamDef & | operator= (const CRef &in_ref)
ValueMap | GetAttributes () const
LONG | GetCapabilities () const
CValue | GetDefaultValue () const
CStatus | SetDefaultValue (const CValue &in_value)
CString | GetDisplayName () const
bool | HasDefaultValue () const
bool | IsArray () const
bool | IsInput () const
bool | IsOutput () const
bool | IsStructure () const
bool | GetMainPort () const
CStatus | PutMainPort (bool in_main)
CValue | GetMaxValue () const
CStatus | SetMaxValue (const CValue &in_value)
CValue | GetMinValue () const
CStatus | SetMinValue (const CValue &in_value)
siShaderParameterDataType | GetDataType () const
CValue | GetSuggestedMaxValue () const
CStatus | SetSuggestedMaxValue (const CValue &in_value)
CValue | GetSuggestedMinValue () const
CStatus | SetSuggestedMinValue (const CValue &in_value)
bool | GetTexturable () const
CStatus | SetTexturable (bool in_value)
CStatus | SetDisplayName (const CString &in_str)

## Constructor & Destructor Documentation

ShaderParamDef | ( |  | ) |

Default constructor.

~ShaderParamDef | ( |  | ) |

Default destructor.

ShaderParamDef | ( | const CRef & | in_ref | ) |

Constructor.

Parameters:

  in_ref | constant reference object.

ShaderParamDef | ( | const ShaderParamDef & | in_obj | ) |

Copy constructor.

Parameters:

  in_obj | constant class object.

## Member Function Documentation

bool IsA | ( | siClassID | in_ClassID | ) | const`[virtual]`

Returns true if a given class type is compatible with this API class.

Parameters:

  in_ClassID | class type.

Returns:
  true if the class is compatible, false otherwise.

Reimplemented from SIObject.

Reimplemented in ShaderArrayParamDef, and ShaderStructParamDef.

siClassID GetClassID | ( |  | ) | const`[virtual]`

Returns the type of the API class.

Returns:
  The class type.

Reimplemented from SIObject.

Reimplemented in ShaderArrayParamDef, and ShaderStructParamDef.

ShaderParamDef& operator= | ( | const ShaderParamDef & | in_obj | ) |

Creates an object from another object. The newly created object is set to empty if the input object is not compatible.

Parameters:

  in_obj | constant class object.

Returns:
  The new ShaderParamDef object.

ShaderParamDef& operator= | ( | const CRef & | in_ref | ) |

Creates an object from a reference object. The newly created object is set to empty if the input reference object is not compatible.

Parameters:

  in_ref | constant class object.

Returns:
  The new ShaderParamDef object.

Reimplemented from SIObject.

Reimplemented in ShaderArrayParamDef, and ShaderStructParamDef.

ValueMap GetAttributes | ( |  | ) | const

Returns the list of attributes available on this parameter.

Returns:
  attribute list

See also:
  ShaderDef::GetAttributes

Since:
  9.0 (2011)

LONG GetCapabilities | ( |  | ) | const

Returns a number (see siCapabilities) which is a bitfield of all the parameter's capabilities. For convenience, the texturable capability is exposed directly as ShaderParamDef::GetTexturable.

To set the texturable, inspectable, and animatable capabilities on the shader parameter definition, you need to set them on the ShaderParamDefOptions object before calling the ShaderParamDefContainer::AddParamDef or ShaderParamDefContainer::AddArrayParamDef methods. For the texturable capability, the convenience method ShaderParamDef::SetTexturable is also available.

Returns:
  the capability flags

See also:
  ShaderParamDef::GetTexturable, ShaderParamDef::SetTexturable, Parameter::PutCapabilityFlag, Parameter::GetCapabilities, ShaderParamDefOptions::SetAnimatable, ShaderParamDefOptions::SetTexturable, ShaderParamDefOptions::SetInspectable

Since:
  9.0 (2011)

CValue GetDefaultValue | ( |  | ) | const

Returns the default value for this parameter.

Returns:
  the default value

Since:
  9.0 (2011)

CStatus SetDefaultValue | ( | const CValue & | in_value | ) |

Sets the default value for this parameter.

Returns:
  the default value

See also:
  ShaderParamDef::HasDefaultValue, ShaderParamDefOptions::SetDefaultValue, Parameter::GetValue, Parameter::PutValue

Since:
  9.0 (2011)

CString GetDisplayName | ( |  | ) | const

Returns the short name for this parameter definition. This is the name that appears in the Scene Explorer (with the `View > Use Script Names` option turned `OFF`). It is also the same value that the SIObject::GetName property returns on the instance (ShaderParameter).

Returns:
  the port display name.

See also:
  ShaderParamDefOptions::SetShortName, SIObject::GetName

Since:
  9.0 (2011)

bool HasDefaultValue | ( |  | ) | const

Indicates whether or not the parameter has a default value.

Returns:
  true if the parameter has a default value
  false otherwise

See also:
  ShaderParamDef::GetDefaultValue, ShaderParamDef::SetDefaultValue, ShaderParamDefOptions::SetDefaultValue, Parameter::GetValue, Parameter::PutValue

Since:
  9.0 (2011)

bool IsArray | ( |  | ) | const

Indicates whether or not the parameter is an array parameter (defined as ShaderArrayParamDef, or ShaderArrayParameter when instantiated). This is a convenience method for testing the following:

     ShaderParamDef::GetDataType == siShaderDataTypeArray

Returns:
  true if the parameter is an array parameter
  false otherwise

See also:
  ShaderArrayParamDef, ShaderParamDefContainer::AddArrayParamDef, ShaderArrayParameter

Since:
  9.0 (2011)

bool IsInput | ( |  | ) | const

Indicates whether or not the parameter is an input parameter.

Returns:
  true if the parameter is an input parameter
  false otherwise

See also:
  ShaderDef::GetInputParamDefs, ShaderParamDef::IsOutput

Since:
  9.0 (2011)

bool IsOutput | ( |  | ) | const

Indicates whether or not the parameter is an output parameter.

Returns:
  true if the parameter is an output parameter
  false otherwise

See also:
  ShaderDef::GetOutputParamDefs, ShaderParamDef::IsInput

Since:
  9.0 (2011)

bool IsStructure | ( |  | ) | const

Indicates whether or not the parameter is a structure parameter (true if it is). This is a convenience method for testing the following:

     ShaderParamDef::GetDataType == siShaderDataTypeStructure

Returns:
  true if the parameter is a structure parameter.
  false otherwise

See also:
  ShaderStructParamDef

Since:
  9.0 (2011)

bool GetMainPort | ( |  | ) | const

Indicates whether or not the port is the main port.

Returns:
  true if the port is the main port
  false otherwise

Since:
  9.0 (2011)

CStatus PutMainPort | ( | bool | in_main | ) |

Sets this port as the main port.

Parameters:

  in_main | true if the port is the main port; false otherwise

Since:
  9.0 (2011)

CValue GetMaxValue | ( |  | ) | const

Returns the maximum allowable value for this parameter.

Returns:
  the maximum value

See also:
  ShaderParamDefOptions::SetHardLimit, ShaderParamDef::SetMaxValue, ShaderParamDef::GetMinValue, ShaderParamDef::GetSuggestedMaxValue, Parameter::GetMax

Since:
  9.0 (2011)

CStatus SetMaxValue | ( | const CValue & | in_value | ) |

Sets the maximum allowable value for this parameter.

Parameters:

  in_value | the maximum value

Returns:
  Success/failure

See also:
  ShaderParamDefOptions::SetHardLimit, ShaderParamDef::GetMaxValue, ShaderParamDef::SetMinValue, ShaderParamDef::SetSuggestedMaxValue, Parameter::GetMax

Since:
  9.0 (2011)

CValue GetMinValue | ( |  | ) | const

Returns the minimum allowable value for this parameter.

Returns:
  the minimum value

See also:
  ShaderParamDefOptions::SetHardLimit, ShaderParamDef::SetMinValue, ShaderParamDef::GetMaxValue, ShaderParamDef::GetSuggestedMinValue, Parameter::GetMin

Since:
  9.0 (2011)

CStatus SetMinValue | ( | const CValue & | in_value | ) |

Sets the minimum allowable value for this parameter.

Parameters:

  in_value | the minimum value

Returns:
  Success/failure

See also:
  ShaderParamDefOptions::SetHardLimit, ShaderParamDef::GetMinValue, ShaderParamDef::SetMaxValue, ShaderParamDef::SetSuggestedMinValue, Parameter::GetMin

Since:
  9.0 (2011)

siShaderParameterDataType GetDataType | ( |  | ) | const

Returns one of the siShaderParameterDataType enum values corresponding to this shader parameter's type.

Returns:
  the data type

See also:
  ShaderParameter::GetDataType

Since:
  9.0 (2011)

CValue GetSuggestedMaxValue | ( |  | ) | const

Returns the suggested maximum value for this parameter.

Returns:
  the suggested maximum value.

See also:
  ShaderParamDefOptions::SetSoftLimit, ShaderParamDef::SetSuggestedMaxValue, ShaderParamDef::GetSuggestedMinValue, ShaderParamDef::GetMaxValue, Parameter::GetSuggestedMax

Since:
  9.0 (2011)

CStatus SetSuggestedMaxValue | ( | const CValue & | in_value | ) |

Sets the suggested maximum value for this parameter.

Parameters:

  in_value | the suggested maximum value

Returns:
  Success/failure

See also:
  ShaderParamDefOptions::SetSoftLimit, ShaderParamDef::GetSuggestedMaxValue, ShaderParamDef::SetSuggestedMinValue, ShaderParamDef::SetMaxValue, Parameter::GetSuggestedMax

Since:
  9.0 (2011)

CValue GetSuggestedMinValue | ( |  | ) | const

Returns the suggested minimum value for this parameter.

Returns:
  the suggested minimum value

See also:
  ShaderParamDefOptions::SetSoftLimit, ShaderParamDef::SetSuggestedMinValue, ShaderParamDef::GetSuggestedMaxValue, ShaderParamDef::GetMinValue, Parameter::GetSuggestedMin

Since:
  9.0 (2011)

CStatus SetSuggestedMinValue | ( | const CValue & | in_value | ) |

Sets the suggested minimum value for this parameter.

Parameters:

  in_value | the suggested minimum value

Returns:
  Success/failure

See also:
  ShaderParamDefOptions::SetSoftLimit, ShaderParamDef::GetSuggestedMinValue, ShaderParamDef::SetSuggestedMaxValue, ShaderParamDef::SetMinValue, Parameter::GetSuggestedMin

Since:
  9.0 (2011)

bool GetTexturable | ( |  | ) | const

Indicates whether or not the texturable capability (see siCapabilities) is set. This is a convenience for accessing it using ShaderParamDef::GetCapabilities.

Note:
  When a shader parameter is texturable, it can be connected to other shader ports in the render tree.

Returns:
  the texturable flag.

See also:
  ShaderParamDef::GetCapabilities, Parameter::GetCapabilities, Parameter::PutCapabilityFlag

Since:
  9.0 (2011)

CStatus SetTexturable | ( | bool | in_value | ) |

Sets whether or not the texturable capability (see siCapabilities) is set. This is a convenience for accessing it using ShaderParamDef::GetCapabilities.

Note:
  Making a shader parameter texturable means that it can connect to other shader ports in the render tree.

Returns:
  Success/failure

See also:
  ShaderParamDefOptions::SetTexturable, ShaderParamDef::GetCapabilities, Parameter::PutCapabilityFlag

Since:
  9.0 (2011)

CStatus SetDisplayName | ( | const CString & | in_str | ) |

Sets the short name for this parameter definition. This is the name that appears in the Scene Explorer (with the `View > Use Script Names` option turned `OFF`).

See also:
  ShaderParamDefOptions::SetShortName, SIObject::GetName

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

- xsi_shaderparamdef.h