HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_NodeVerb Class Referenceabstract

#include <SOP_NodeVerb.h>

+ Inheritance diagram for SOP_NodeVerb:

Classes

class  CookParms
 
class  InputParms
 
class  NodeExecuteInfo
 
class  NodeInputs
 
class  PreCookedNodeInputs
 
class  ScopeForbiddenNodes
 

Public Types

enum  CookMode {
  COOK_INPLACE, COOK_DUPLICATE, COOK_GENERATOR, COOK_INSTANCE,
  COOK_GENERIC, COOK_PASSTHROUGH
}
 
typedef UT_Map< const OP_Node
*, NodeExecuteInfo
ForbiddenNodeMap
 

Public Member Functions

 SOP_NodeVerb ()
 
virtual SOP_NodeCacheallocCache () const
 
virtual SOP_NodeParmsallocParms () const =0
 
OP_NodeCachebaseAllocCache () const overridefinal
 
OP_NodeParmsbaseAllocParms () const overridefinal
 
OP_OpTypeId category () const override
 
virtual bool doPartialInputCook () const
 
virtual bool doExprInputCook () const
 
virtual bool cookInputs (const InputParms &parms) const
 
virtual void setupLocalVariables (SOP_Node *sop, const UT_Array< GU_ConstDetailHandle > &inputs) const
 
virtual void resetLocalVariables (SOP_Node *sop) const
 
virtual bool evaluatesParametersDuringCook () const
 
virtual CookMode cookMode (const SOP_NodeParms *parms) const
 
virtual bool requiresCEFlush () const
 
virtual bool usesCE () const
 
virtual void cook (const CookParms &cookparms) const =0
 Compute the output geometry. More...
 
void notifyGroupParmListeners (SOP_Node *oldsop, int groupparm_idx, int grouptype_idx, const GU_Detail *gdp, const GA_Group *group) const
 
- Public Member Functions inherited from OP_NodeVerb
 OP_NodeVerb ()
 
virtual ~OP_NodeVerb ()
 
 OP_NodeVerb (const OP_NodeVerb &)=delete
 
OP_NodeVerboperator= (const OP_NodeVerb &)=delete
 
virtual UT_StringHolder name () const =0
 

Static Public Member Functions

static const SOP_NodeVerblookupVerb (const UT_StringRef &name)
 Finds a verb which matches the given name. More...
 
static void listVerbs (UT_StringArray &verbnames)
 
static const ForbiddenNodeMapforbiddenNodes ()
 
static const ForbiddenNodeMapforbiddenNodes (int thread)
 
- Static Public Member Functions inherited from OP_NodeVerb
static const OP_NodeVerblookupCategoryVerb (OP_OpTypeId cat, const UT_StringRef &name)
 Finds a verb which matches the given name. More...
 
static void listCategoryVerbs (OP_OpTypeId cat, UT_StringArray &verbnames)
 
static void registerVerb (OP_NodeVerb *verb)
 
static void unregisterVerb (OP_NodeVerb *verb)
 

Detailed Description

SOP_NodeVerb

This should be a singleton class. Build it with the Register template to allow it to be discoverable by name.

Definition at line 87 of file SOP_NodeVerb.h.

Member Typedef Documentation

Definition at line 132 of file SOP_NodeVerb.h.

Member Enumeration Documentation

Enumerator
COOK_INPLACE 
COOK_DUPLICATE 
COOK_GENERATOR 
COOK_INSTANCE 
COOK_GENERIC 
COOK_PASSTHROUGH 

Definition at line 158 of file SOP_NodeVerb.h.

Constructor & Destructor Documentation

SOP_NodeVerb::SOP_NodeVerb ( )
inline

Definition at line 90 of file SOP_NodeVerb.h.

Member Function Documentation

virtual SOP_NodeCache* SOP_NodeVerb::allocCache ( ) const
inlinevirtual
OP_NodeCache* SOP_NodeVerb::baseAllocCache ( ) const
inlinefinaloverridevirtual

When working with a specific category one will use allocCache and allocParms, which these should chain to in the category baseclass.

Reimplemented from OP_NodeVerb.

Definition at line 96 of file SOP_NodeVerb.h.

OP_NodeParms* SOP_NodeVerb::baseAllocParms ( ) const
inlinefinaloverridevirtual

Implements OP_NodeVerb.

Definition at line 98 of file SOP_NodeVerb.h.

OP_OpTypeId SOP_NodeVerb::category ( ) const
inlineoverridevirtual

Implements OP_NodeVerb.

Definition at line 103 of file SOP_NodeVerb.h.

virtual bool SOP_NodeVerb::cookInputs ( const InputParms parms) const
inlinevirtual

Definition at line 695 of file SOP_NodeVerb.h.

virtual bool SOP_NodeVerb::doExprInputCook ( ) const
inlinevirtual

If doExprInputCook is true, we will also cook all expression inputs in cookInputs using the default method.

Definition at line 693 of file SOP_NodeVerb.h.

virtual bool SOP_NodeVerb::doPartialInputCook ( ) const
inlinevirtual

If doPartialInputCook is false, we do assume cookInputs() will apply to all inputs regardless of node parameters. If local variables require the inputs, it is required for this to be false for the inputs to be available when parameters are evaluated.

Definition at line 689 of file SOP_NodeVerb.h.

virtual bool SOP_NodeVerb::evaluatesParametersDuringCook ( ) const
inlinevirtual

Traditional nodes may evaluate parameters while cooking, this is required for dynamic local variables. If this is true, no pre-cooking of the parameter struture will be done in the traditional cook path avoiding double cooking parameters. Remember other cook paths will not have access to the sop so should use the parameter structure!

Definition at line 728 of file SOP_NodeVerb.h.

static const ForbiddenNodeMap* SOP_NodeVerb::forbiddenNodes ( )
static

During execution of a verb chain you may wish to disable the traditional cooking of nodes. This provides a set of nodes you do not want recursed into during the verb cook. It will be NULL if there are none or this thread isn't in a compiled execution path.

static const ForbiddenNodeMap* SOP_NodeVerb::forbiddenNodes ( int  thread)
static
static void SOP_NodeVerb::listVerbs ( UT_StringArray verbnames)
static
static const SOP_NodeVerb* SOP_NodeVerb::lookupVerb ( const UT_StringRef name)
static

Finds a verb which matches the given name.

void SOP_NodeVerb::notifyGroupParmListeners ( SOP_Node oldsop,
int  groupparm_idx,
int  grouptype_idx,
const GU_Detail gdp,
const GA_Group group 
) const

This is used to update handles, it only has an effect if oldsop is non-null, ie, we are in the old cook path. Neither the group nor the gdp have to persist beyond this call. Pass -1 for the grouptype if there is no grouptype parameter.

virtual bool SOP_NodeVerb::requiresCEFlush ( ) const
inlinevirtual

Attributes can end up cached on the GPU. Some SOPs are able to handle this. Some are ambivalent (such as switch or null) And some expect all GPU buffers to be flushed prior to operating. If a node requires a CE flush, all inputs will be clean.

Definition at line 737 of file SOP_NodeVerb.h.

virtual void SOP_NodeVerb::resetLocalVariables ( SOP_Node sop) const
inlinevirtual

Definition at line 721 of file SOP_NodeVerb.h.

virtual void SOP_NodeVerb::setupLocalVariables ( SOP_Node sop,
const UT_Array< GU_ConstDetailHandle > &  inputs 
) const
inlinevirtual

These are for the old-cook path to allow nodes to store relevant local variable information inside the SOP for callbacks. The evalVariableValue() should be guarded to ensure it doesn't run from a forbidden node. These can be used if the local variables depend only on the inputs and are not change for every parameter. If they change for every parameter, traditional cook paths will need to setup & evaluate explicitly in the cook method.

Definition at line 720 of file SOP_NodeVerb.h.

virtual bool SOP_NodeVerb::usesCE ( ) const
inlinevirtual

Definition at line 738 of file SOP_NodeVerb.h.


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