Cortex  10.0.0-a4
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
IECoreHoudini::ParameterisedHolder< BaseType > Class Template Referenceabstract

Class representing an OP node acting as a holder for the abstract Parameterised class. More...

#include <ParameterisedHolder.h>

+ Inheritance diagram for IECoreHoudini::ParameterisedHolder< BaseType >:

Public Member Functions

 ParameterisedHolder (OP_Network *net, const char *name, OP_Operator *op)
 
virtual const char * inputLabel (unsigned pos) const
 
virtual unsigned minInputs () const
 
virtual unsigned maxInputs () const
 
ParameterisedHolderInterface implementation
virtual void setParameterised (IECore::RunTimeTypedPtr p)
 
virtual void setParameterised (const std::string &className, int classVersion, const std::string &searchPathEnvVar)
 
virtual bool hasParameterised ()
 Returns whether or not this node is holding a valid parameterised object.
 
virtual IECore::RunTimeTypedPtr getParameterised ()
 Returns the parameterised object held by this node.
 
virtual bool setNodeValues ()
 
virtual void setParameterisedValues (double time)
 Sets the values of the parameters of the held Parameterised object to reflect the values.
 
- Public Member Functions inherited from IECoreHoudini::ParameterisedHolderInterface
IECore::ParameterisedInterfacegetParameterisedInterface ()
 Convenience method to return dynamic_cast<IECore::ParameterisedInterface *>( getParameterised().get() )
 

Static Public Member Functions

className/version UI functions

Dynamic menus, callbacks, and helper functions for the className/version parameters.

static void buildClassCategoryMenu (void *data, PRM_Name *menu, int maxSize, const PRM_SpareData *, const PRM_Parm *)
 
static void buildClassNameMenu (void *data, PRM_Name *menu, int maxSize, const PRM_SpareData *, const PRM_Parm *)
 
static void buildVersionMenu (void *data, PRM_Name *menu, int maxSize, const PRM_SpareData *, const PRM_Parm *)
 
static int reloadClassCallback (void *data, int index, float time, const PRM_Template *tplate)
 
static int reloadButtonCallback (void *data, int index, float time, const PRM_Template *tplate)
 
static void classNames (const std::string searchPathEnvVar, const std::string &matchString, std::vector< std::string > &names)
 
static void classVersions (const std::string className, const std::string searchPathEnvVar, std::vector< int > &versions)
 
static int defaultClassVersion (const std::string className, const std::string searchPathEnvVar)
 

Static Public Attributes

static PRM_Template parameters []
 
static CH_LocalVariable variables []
 
static PRM_Name pParameterisedClassCategory
 
static PRM_Name pParameterisedClassName
 
static PRM_Name pParameterisedVersion
 
static PRM_Name pParameterisedSearchPathEnvVar
 
static PRM_Name pMatchString
 
static PRM_Name pReloadButton
 
static PRM_Name pEvaluateParameters
 
static PRM_Name pSwitcher
 
static PRM_Default matchStringDefault
 
static PRM_Default switcherDefaults []
 
static PRM_ChoiceList classCategoryMenu
 
static PRM_ChoiceList classNameMenu
 
static PRM_ChoiceList classVersionMenu
 

Protected Member Functions

virtual bool load (UT_IStream &is, const char *ext, const char *path)
 
virtual IECore::MessageHandlergetMessageHandler ()
 
virtual void setMessageHandler (IECore::MessageHandler *handler)
 
void updateParameter (IECore::ParameterPtr parm, float now, std::string prefix="", bool top_level=false)
 
virtual void setInputParameterValues (float now)=0
 
virtual void refreshInputConnections ()=0
 updates the input connections to match the current loaded parameters
 

Protected Attributes

IECore::CompoundParameter::ParameterVector m_inputParameters
 
bool m_dirty
 Determines if the node is dirty.
 

Detailed Description

template<typename BaseType>
class IECoreHoudini::ParameterisedHolder< BaseType >

Class representing an OP node acting as a holder for the abstract Parameterised class.

Member Function Documentation

template<typename BaseType>
static void IECoreHoudini::ParameterisedHolder< BaseType >::buildClassCategoryMenu ( void *  data,
PRM_Name *  menu,
int  maxSize,
const PRM_SpareData *  ,
const PRM_Parm *   
)
static
Todo:
: the concept of class category is a hack to make the UI usable. remove this when Houdini supports cascading menus for parameters.
template<typename BaseType>
virtual bool IECoreHoudini::ParameterisedHolder< BaseType >::load ( UT_IStream &  is,
const char *  ext,
const char *  path 
)
protectedvirtual

Load the node from disk. It checks for className/version/searchPath values on the node and attempts to reload the parameterised class from disk

template<typename BaseType>
virtual void IECoreHoudini::ParameterisedHolder< BaseType >::setInputParameterValues ( float  now)
protectedpure virtual

Pushes the data from the incomming connections into the associated Cortex parameters. Derived classes should implement this method in a way appropriate to the context.

Implemented in IECoreHoudini::SOP_ParameterisedHolder.

template<typename BaseType>
virtual bool IECoreHoudini::ParameterisedHolder< BaseType >::setNodeValues ( )
virtual
Todo:
: actually implement this once parameter handling is in c++

Implements IECoreHoudini::ParameterisedHolderInterface.

template<typename BaseType>
virtual void IECoreHoudini::ParameterisedHolder< BaseType >::setParameterised ( IECore::RunTimeTypedPtr  p)
virtual

Set the node to hold a particular Parameterised object. When using this version of setParameterised the node will not be able to preserve the object across scene save/load - this becomes your responsibility if it's necessary.

Implements IECoreHoudini::ParameterisedHolderInterface.

template<typename BaseType>
virtual void IECoreHoudini::ParameterisedHolder< BaseType >::setParameterised ( const std::string &  className,
int  classVersion,
const std::string &  searchPathEnvVar 
)
virtual

Sets the Parameterised object this node is holding. An IECore.ClassLoader object will be used with searchpaths obtained from the specified environment variable to actually load the Parameterised object. This mechanism is used rather than passing a ParameterisedPtr as it allows the Parameterised object to be loaded again when a houdini scene is opened.

Implements IECoreHoudini::ParameterisedHolderInterface.

template<typename BaseType>
void IECoreHoudini::ParameterisedHolder< BaseType >::updateParameter ( IECore::ParameterPtr  parm,
float  now,
std::string  prefix = "",
bool  top_level = false 
)
protected

Update a specific Cortex parameter using values from the corresponding Houdini node parameter.

Parameters
prefixA string prefix for the houdini parameter name
top_levelThis should be true if you know the parm is the top-level CompoundParameter

Member Data Documentation

template<typename BaseType>
IECore::CompoundParameter::ParameterVector IECoreHoudini::ParameterisedHolder< BaseType >::m_inputParameters
protected

A vector of IECore::Parameters which are passed through node inputs rather than PRM_Templates Should be filled by refreshInputConnections() if input parameters make sense for this context.


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