Cortex  10.0.0-a4
Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Friends | List of all members
IECoreMaya::ParameterHandler Class Referenceabstract

#include <ParameterHandler.h>

+ Inheritance diagram for IECoreMaya::ParameterHandler:

Static Public Member Functions

static MPlug create (IECore::ConstParameterPtr parameter, const MString &plugName, MObject &node)
 
static MStatus update (IECore::ConstParameterPtr parameter, MPlug &plug)
 
static MStatus setValue (IECore::ConstParameterPtr parameter, MPlug &plug)
 Sets the value of plug to reflect the value of parameter.
 
static MStatus setValue (const MPlug &plug, IECore::ParameterPtr parameter)
 Sets the value of parameter to reflect the value of plug.
 
static MStatus restore (const MPlug &plug, IECore::ParameterPtr parameter)
 

Protected Member Functions

MPlug finishCreating (IECore::ConstParameterPtr parameter, MPlug &plug) const
 
MPlug finishCreating (IECore::ConstParameterPtr parameter, MObject &attribute, MObject &node) const
 An overload for the above function which accepts an attribute for which a plug needs to be made.
 
MStatus finishUpdating (IECore::ConstParameterPtr parameter, MPlug &plug) const
 
MStatus finishUpdating (IECore::ConstParameterPtr parameter, MObject &attribute, MObject &node) const
 An overload for the above function which accepts an attribute for which a plug needs to be made.
 
virtual MPlug doCreate (IECore::ConstParameterPtr parameter, const MString &plugName, MObject &node) const =0
 
virtual MStatus doUpdate (IECore::ConstParameterPtr parameter, MPlug &plug) const =0
 
virtual MStatus doSetValue (IECore::ConstParameterPtr parameter, MPlug &plug) const =0
 
virtual MStatus doSetValue (const MPlug &plug, IECore::ParameterPtr parameter) const =0
 
virtual MStatus doRestore (const MPlug &plug, IECore::ParameterPtr parameter) const
 

Static Protected Member Functions

static ConstParameterHandlerPtr create (IECore::ConstParameterPtr parameter)
 Return a handler which can deal with the given parameter.
 
static ConstParameterHandlerPtr create (IECore::ConstObjectPtr object)
 Return a handler which can deal with the given object.
 
static ConstParameterHandlerPtr create (IECore::TypeId id)
 Return a handler which can deal with an object or parameter of the given type id.
 

Friends

class ObjectParameterHandler
 

Additional Inherited Members

- Public Types inherited from IECore::RefCounted
typedef size_t RefCount
 
- 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.
 

Detailed Description

The ParameterHandler class provides a mapping between IECore::Parameters and maya attributes. It is used by the IECoreMaya::ParameterisedHolder classes.

Member Function Documentation

static MPlug IECoreMaya::ParameterHandler::create ( IECore::ConstParameterPtr  parameter,
const MString &  plugName,
MObject &  node 
)
static

Creates and returns an MPlug capable of representing the specified parameter. The plug will have the specified name and be added to the specified node. In the case of a failure MPlug::isNull() will be true for the return value.

Todo:
: return an MStatus like the other methods, and pass a plug reference as an argument (Cortex 8)
MPlug IECoreMaya::ParameterHandler::finishCreating ( IECore::ConstParameterPtr  parameter,
MPlug &  plug 
) const
protected

Performs common actions which all handlers should apply to newly created plugs, including creating any default connections requested in the parameter userData. This function should be called at the end of all doCreate() implementations.

MStatus IECoreMaya::ParameterHandler::finishUpdating ( IECore::ConstParameterPtr  parameter,
MPlug &  plug 
) const
protected

Performs common actions which all handlers should apply to updated plugs, including the setting of any Attribute properties as requested in the parameter userData. Currently, only 'storable' is supported. This function should be called at the end of all doUpdate() implementations, and doCreate() if doUpdate() isn't called as part of doCreate()

static MStatus IECoreMaya::ParameterHandler::restore ( const MPlug &  plug,
IECore::ParameterPtr  parameter 
)
static

Called to restore a parameter's properties when a file is loaded or the version of a held class has been updated.

static MStatus IECoreMaya::ParameterHandler::update ( IECore::ConstParameterPtr  parameter,
MPlug &  plug 
)
static

Updates a previously created plug to reflect changes on the specified parameter. Returns MStatus::kFailure if the plug is not suitable for the parameter.

Bug:
Maya doesn't seem to correctly store default values for dynamic string attributes when saving the scene - so this method doesn't set the default value appropriately for StringParameter and its derived classes (tested in maya 7.0.1).

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