Cortex
10.0.0-a4
|
#include <ParameterHandler.h>
Public Types | |
enum | ValueSource { Knob, Storage } |
typedef std::vector< DD::Image::Op * >::const_iterator | InputIterator |
![]() | |
typedef size_t | RefCount |
Public Member Functions | |
virtual int | minimumInputs (const IECore::Parameter *parameter) |
virtual int | maximumInputs (const IECore::Parameter *parameter) |
virtual bool | testInput (const IECore::Parameter *parameter, int input, const DD::Image::Op *op) |
virtual void | setParameterValue (IECore::Parameter *parameter, InputIterator first, InputIterator last) |
virtual void | knobs (const IECore::Parameter *parameter, const char *knobName, DD::Image::Knob_Callback f) |
Declares knobs to represent the Parameter. | |
virtual void | setParameterValue (IECore::Parameter *parameter, ValueSource valueSource=Storage) |
virtual void | setKnobValue (const IECore::Parameter *parameter) |
Transfers the value from the Parameter back onto the nuke knob at the current time. | |
virtual IECore::ObjectPtr | getState (const IECore::Parameter *parameter) |
virtual void | setState (IECore::Parameter *parameter, const IECore::Object *state) |
Restore state previously retrieved by getState(). | |
![]() | |
IE_CORE_DECLAREMEMBERPTR (RefCounted) | |
void | addRef () const |
Add a reference to the current object. | |
void | removeRef () const |
Remove a reference from the current object. | |
RefCount | refCount () const |
Returns the current reference count. | |
Static Public Member Functions | |
static ParameterHandlerPtr | create (const IECore::Parameter *parameter) |
Factory function to create a ParameterHandler suitable for a given Parameter. | |
Protected Member Functions | |
std::string | knobLabel (const IECore::Parameter *parameter) const |
Should be called by derived classes to get a good label for the main knob. | |
void | setKnobProperties (const IECore::Parameter *parameter, DD::Image::Knob_Callback f, DD::Image::Knob *knob) const |
ParameterHandlers are responsible for mapping between IECore::Parameters and DD::Image::Knobs and DD::Image::Op inputs.
|
virtual |
ParameterHandlers may need to store state separately from the knobs they create, so that it is available to the first knobs() call when scripts are loaded. This function may be implemented to return such state, and the client must make sure it is restored via setState() before knobs() is called.
Referenced by IECoreMaya.PresetsUI::selectParameters().
|
virtual |
Returns the maximum number of inputs this Parameter needs to represent itself, also defaulting to 0. Please note that it is only possible for the last Parameter on any given node to have min!=max - warnings will be issued if this is not the case.
|
virtual |
Returns the minimum number of inputs this Parameter needs to represent itself. Defaults to 0, as most ParameterHandlers will instead use the knobs() mechanism below.
|
protected |
Should be called by derived classes to set the properties for the main knob based on userData on the parameter. This sets visibility and tooltip and applies any default expressions.
|
virtual |
Sets the value of the parameter from the inputs created based on the result of minimumInputs() and maximumInputs().
|
virtual |
Transfers the value from Nuke onto the Parameter. ValueSource may be passed a value of Knob if it is known that Nuke hasn't stored knob values yet - for instance in a knob_changed() method with a KNOB_CHANGED_ALWAYS knob. This causes the value to be retrieved directly from the knob at the current time, rather than from the value stored by the knob.
|
virtual |
Returns true if the specified op is suitable for connection for the specified input. Here the input number is relative to the ParameterHandler rather than being absolute for the Node. Default implementation returns false.