OpenVDB  12.0.0
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
OpenVDBOpFactory Class Reference

Use this class to register a new OpenVDB operator (SOP, POP, etc.) More...

#include <openvdb_houdini/SOP_NodeVDB.h>

Inherits OpFactory.

Public Types

enum  OpFlavor {
  SOP, POP, ROP, VOP,
  HDA
}
 
using CacheAllocFunc = std::function< SOP_NodeCache *(void)>
 Functor that returns newly-allocated node caches for instances of this operator. More...
 

Public Member Functions

 OpenVDBOpFactory (const std::string &english, OP_Constructor, houdini_utils::ParmList &, OP_OperatorTable &, houdini_utils::OpFactory::OpFlavor=SOP)
 Construct an OpFactory that on destruction registers a new OpenVDB operator type. More...
 
OpenVDBOpFactorysetNativeName (const std::string &name)
 Set the name of the equivalent native operator as shipped with Houdini. More...
 
OpFlavor flavor () const
 Return the new operator's flavor (SOP, POP, etc.). More...
 
std::string flavorString () const
 Return the new operator's flavor as a string ("SOP", "POP", etc.). More...
 
const std::string & name () const
 Return the new operator's type name. More...
 
const std::string & english () const
 Return the new operator's UI name. More...
 
const std::string & iconName () const
 Return the new operator's icon name. More...
 
const std::string & helpURL () const
 Return the new operator's help URL. More...
 
const std::string & documentation () const
 Return the new operator's documentation. More...
 
const OP_OperatorTable & table () const
 Return the operator table with which this factory is associated. More...
 
OpFactoryaddAlias (const std::string &english)
 Construct a type name for this operator from the given English name and add it as an alias. More...
 
OpFactoryaddAliasVerbatim (const std::string &name)
 Add an alias for this operator. More...
 
OpFactorysetDocumentation (const std::string &)
 Add documentation for this operator. More...
 
OpFactoryaddInput (const std::string &name)
 Add a required input with the given name. More...
 
OpFactoryaddOptionalInput (const std::string &name)
 Add an optional input with the given name. More...
 
OpFactorysetMaxInputs (unsigned=9999)
 Set the maximum number of inputs allowed by this operator. More...
 
OpFactorysetObsoleteParms (const ParmList &)
 Specify obsolete parameters to this operator. More...
 
OpFactorysetLocalVariables (CH_LocalVariable *)
 Add one or more local variables to this operator. More...
 
OpFactorysetFlags (unsigned)
 
OpFactorysetInternalName (const std::string &name)
 
OpFactorysetOperatorTable (const std::string &name)
 
OpFactorysetVerb (SOP_NodeVerb::CookMode cookMode, const CacheAllocFunc &allocator)
 Register this operator as a compilable SOP. More...
 
OpFactorysetInvisible ()
 Mark this node as hidden from the UI tab menu. More...
 
OpFactoryaddSpareData (const SpareDataMap &)
 Specify (key, value) pairs of spare data for this operator. More...
 

Static Public Member Functions

static std::string flavorToString (OpFlavor)
 Return "SOP" for the SOP flavor, "POP" for the POP flavor, etc. More...
 

Protected Member Functions

OP_OperatorTable & table ()
 Return the operator table with which this factory is associated. More...
 

Detailed Description

Use this class to register a new OpenVDB operator (SOP, POP, etc.)

This class ensures that the operator uses the appropriate OpPolicy.

See also
houdini_utils::OpFactory, houdini_utils::OpPolicy

Member Typedef Documentation

using CacheAllocFunc = std::function<SOP_NodeCache* (void)>
inherited

Functor that returns newly-allocated node caches for instances of this operator.

A node cache encapsulates a SOP's cooking logic for thread safety. Input geometry and parameter values are baked into the cache.

Member Enumeration Documentation

enum OpFlavor
inherited
Enumerator
SOP 
POP 
ROP 
VOP 
HDA 

Constructor & Destructor Documentation

OpenVDBOpFactory ( const std::string &  english,
OP_Constructor  ,
houdini_utils::ParmList ,
OP_OperatorTable &  ,
houdini_utils::OpFactory::OpFlavor  = SOP 
)

Construct an OpFactory that on destruction registers a new OpenVDB operator type.

Member Function Documentation

OpFactory& addAlias ( const std::string &  english)
inherited

Construct a type name for this operator from the given English name and add it as an alias.

For backward compatibility when an operator needs to be renamed, add the old name as an alias.

OpFactory& addAliasVerbatim ( const std::string &  name)
inherited

Add an alias for this operator.

For backward compatibility when an operator needs to be renamed, add the old name as an alias.

Note
This variant takes an operator type name rather than an English name.
OpFactory& addInput ( const std::string &  name)
inherited

Add a required input with the given name.

OpFactory& addOptionalInput ( const std::string &  name)
inherited

Add an optional input with the given name.

OpFactory& addSpareData ( const SpareDataMap )
inherited

Specify (key, value) pairs of spare data for this operator.

If a key already exists, its corresponding value will be overwritten with the new value.

See also
addOperatorSpareData, getOperatorSpareData
const std::string& documentation ( ) const
inherited

Return the new operator's documentation.

Note
If the help URL is nonempty, the URL takes precedence over any help text.
See also
helpURL(), setDocumentation()
const std::string& english ( ) const
inherited

Return the new operator's UI name.

This accessor is mainly for use by OpPolicy objects.

OpFlavor flavor ( ) const
inherited

Return the new operator's flavor (SOP, POP, etc.).

This accessor is mainly for use by OpPolicy objects.

std::string flavorString ( ) const
inherited

Return the new operator's flavor as a string ("SOP", "POP", etc.).

This accessor is mainly for use by OpPolicy objects.

static std::string flavorToString ( OpFlavor  )
staticinherited

Return "SOP" for the SOP flavor, "POP" for the POP flavor, etc.

Useful in OpPolicy classes for constructing type and icon names.

const std::string& helpURL ( ) const
inherited

Return the new operator's help URL.

This accessor is mainly for use by OpPolicy objects.

Note
A help URL takes precedence over help text.
See also
helpText(), setHelpText()
const std::string& iconName ( ) const
inherited

Return the new operator's icon name.

This accessor is mainly for use by OpPolicy objects.

const std::string& name ( ) const
inherited

Return the new operator's type name.

This accessor is mainly for use by OpPolicy objects.

OpFactory& setDocumentation ( const std::string &  )
inherited

Add documentation for this operator.

The text is parsed as wiki markup.

Note
If this factory's OpPolicy specifies a help URL, that URL takes precedence over documentation supplied with this method.
OpFactory& setFlags ( unsigned  )
inherited
OpFactory& setInternalName ( const std::string &  name)
inherited
OpFactory& setInvisible ( )
inherited

Mark this node as hidden from the UI tab menu.

This is equivalent to using the hscript ophide method.

OpFactory& setLocalVariables ( CH_LocalVariable *  )
inherited

Add one or more local variables to this operator.

OpFactory& setMaxInputs ( unsigned  = 9999)
inherited

Set the maximum number of inputs allowed by this operator.

Note
It is only necessary to set this limit if there are inputs that have not been named with addInput() or addOptionalInput().
OpenVDBOpFactory& setNativeName ( const std::string &  name)

Set the name of the equivalent native operator as shipped with Houdini.

This is only needed where the native name policy doesn't provide the correct name. Pass an empty string to indicate that there is no equivalent native operator.

OpFactory& setObsoleteParms ( const ParmList )
inherited

Specify obsolete parameters to this operator.

OpFactory& setOperatorTable ( const std::string &  name)
inherited
OpFactory& setVerb ( SOP_NodeVerb::CookMode  cookMode,
const CacheAllocFunc allocator 
)
inherited

Register this operator as a compilable SOP.

"Verbifying" a SOP separates its input and parameter management from its cooking logic so that cooking can be safely threaded.

Parameters
cookModehow to initialize the output detail
allocatora node cache allocator for instances of this operator
Exceptions
std::runtime_errorif this operator is not a SOP
std::invalid_argumentif allocator is empty
const OP_OperatorTable& table ( ) const
inherited

Return the operator table with which this factory is associated.

This accessor is mainly for use by OpPolicy objects.

OP_OperatorTable& table ( )
protectedinherited

Return the operator table with which this factory is associated.

This accessor is mainly for use by derived OpFactory classes.