Cortex  10.0.0-a4
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
IECoreNuke::ParameterHandler Class Reference

#include <ParameterHandler.h>

+ Inheritance diagram for IECoreNuke::ParameterHandler:

Public Types

enum  ValueSource { Knob, Storage }
 
typedef std::vector< DD::Image::Op * >::const_iterator InputIterator
 
- Public Types inherited from IECore::RefCounted
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().
 
- Public Member Functions inherited from IECore::RefCounted
 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
 

Detailed Description

ParameterHandlers are responsible for mapping between IECore::Parameters and DD::Image::Knobs and DD::Image::Op inputs.

Member Function Documentation

virtual IECore::ObjectPtr IECoreNuke::ParameterHandler::getState ( const IECore::Parameter parameter)
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 int IECoreNuke::ParameterHandler::maximumInputs ( const IECore::Parameter parameter)
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 int IECoreNuke::ParameterHandler::minimumInputs ( const IECore::Parameter parameter)
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.

void IECoreNuke::ParameterHandler::setKnobProperties ( const IECore::Parameter parameter,
DD::Image::Knob_Callback  f,
DD::Image::Knob *  knob 
) const
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 void IECoreNuke::ParameterHandler::setParameterValue ( IECore::Parameter parameter,
InputIterator  first,
InputIterator  last 
)
virtual

Sets the value of the parameter from the inputs created based on the result of minimumInputs() and maximumInputs().

virtual void IECoreNuke::ParameterHandler::setParameterValue ( IECore::Parameter parameter,
ValueSource  valueSource = Storage 
)
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 bool IECoreNuke::ParameterHandler::testInput ( const IECore::Parameter parameter,
int  input,
const DD::Image::Op *  op 
)
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.


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