|
HDK
|
#include <COP_SlapCompDispatcher.h>
Inheritance diagram for COP_SlapCompDispatcher:Public Types | |
| using | Callbacks = COP_SlapCompManager::Callbacks |
| using | CheckFunction = bool(*)(const OP_Node *) |
| Should return true for nodes that are supported by the slapcomp type. More... | |
| using | AllocationFunction ) = COP_SlapCompManager *(*)( |
Public Member Functions | |
| COP_SlapCompDispatcher () | |
| COP_SlapCompDispatcher (const COP_SlapCompDispatcher &)=delete | |
| COP_SlapCompDispatcher (COP_SlapCompDispatcher &&) | |
| COP_SlapCompDispatcher & | operator= (const COP_SlapCompDispatcher &)=delete |
| COP_SlapCompDispatcher & | operator= (COP_SlapCompDispatcher &&) |
| void | copyFrom (const COP_SlapCompDispatcher &other, const OP_Context &context) |
| Makes this object a copy of other, including the enable state. More... | |
| void | setStage (const UT_Span< const int > &node_ids, const OP_Context &) override |
| Set the image filters defined on the USD Stage. More... | |
| void | setViewport (const OP_Node *cop, const OP_Context &) override |
| bool | hasStageFilters () const override |
| Returns whether the viewport slapcomp is enabled. More... | |
| bool | hasViewportFilters () const override |
| Returns whether the viewport slapcomp is enabled. More... | |
| void | updateEnableState () override |
| Called when slapcomp is enabled disabled. More... | |
| bool | hasErrors () const override |
| Returns true if the last run of slapcomp had errors. More... | |
| UT_Array< int > | getStageTargetNodes () const override |
| int | getViewportTargetNode () const override |
| Return the viewport target node. More... | |
| void | setErrorCallback (void(*cb)(void *, const char *), void *data) override |
| Sets a callback that gets called when reporting slapcomp errors. More... | |
| void | setWarningCallback (void(*cb)(void *, const char *), void *data) override |
| Sets a callback that gets called when reporting slapcomp warnings. More... | |
| void | setRunCallback (void(*cb)(void *), void *data) override |
| Sets a callback that gets called when slapcomp is run. More... | |
| void | setUpdateCallback (void(*cb)(void *), void *data) override |
| Sets a callback that gets called when slapcomp changes. More... | |
| bool | isSlapCompAOV (const UT_StringHolder &name) const override |
| bool | buildForInputs (const COP_CableStructure &inputs, const OP_Context &context) override |
| Prepares for applying slapcomp for inputs of the given types. More... | |
| void | runSlapCompImpl (COP_SlapCompInputFetcher &input_fetcher, const OP_Context &context) override |
| Should run slapcomp with the specified inputs and context. More... | |
| COP_CableStructure | getOutputStructure () const override |
| Should return the outputs that this slapcomp produces. More... | |
| IMX_LayerPtr | getOutputLayer (const UT_StringHolder &name) const override |
| Returns a particular output by name. More... | |
| int | getVersion () const override |
| bool | hasStateChanged () const override |
| void | setVersion (int version) override |
Public Member Functions inherited from COP_SlapCompManager | |
| COP_SlapCompManager ()=default | |
| COP_SlapCompManager (const COP_SlapCompManager &)=delete | |
| COP_SlapCompManager (COP_SlapCompManager &&)=default | |
| COP_SlapCompManager & | operator= (const COP_SlapCompManager &)=delete |
| COP_SlapCompManager & | operator= (COP_SlapCompManager &&)=default |
| virtual | ~COP_SlapCompManager ()=default |
| void | clearAllFilters () |
| Clear all filters. More... | |
| void | enable () |
| void | disable () |
| Disable all slapcomp. More... | |
| void | setEnabled (bool state) |
| bool | isEnabled () const |
| Returns the on-off state of slapcomp. More... | |
| bool | getEnableState () const |
| Returns the enable state. More... | |
| virtual bool | expectsLayerCameras () const |
| bool | runSlapComp (COP_SlapCompInputFetcher &input_fetcher, const OP_Context &context, bool should_build=true) |
| bool | build (const COP_SlapCompInputFetcher &input_fetcher, const OP_Context &context) |
| Prepares for applying slapcomp for the provided set of inputs. More... | |
| UT_StringMap< Output > | getOutputs () const |
| void | setCallbacks (const Callbacks &cbs) |
| Set all callbacks using a struct. More... | |
Static Public Member Functions | |
| static void | installFactory (CheckFunction checker, AllocationFunction allocator) |
Protected Member Functions | |
| void | reportError (const char *message) override |
| Reports an error (through the callback if possible). More... | |
| void | reportWarning (const char *message) override |
| Reports a warning (through the callback if possible). More... | |
| void | clearManager () |
Protected Member Functions inherited from COP_SlapCompManager | |
| void | reportAllErrorManagerErrors (const UT_ErrorManager &) |
| Relays all warnings and messages from the error manager. More... | |
Protected Attributes | |
| Callbacks | myCallbacks |
| UT_UniquePtr< COP_SlapCompManager > | myManager |
| int | myCurrentType = -1 |
| int | myVersion = 0 |
This class is a polymorphic slapcomp manager that can be used to interface with different types of slapcomps. To this end, a factory must be registered with the static installFactory() method, with a checker and an allocator. When a manager gets enabled with a specific node, the first factory (i.e. one registered earliest) whose check the node passes will be used to run it.
Definition at line 19 of file COP_SlapCompDispatcher.h.
| using COP_SlapCompDispatcher::AllocationFunction = COP_SlapCompManager* (*)( |
Should dynamically allocate a new slapcomp manager for the slapcomp type.
Definition at line 28 of file COP_SlapCompDispatcher.h.
Definition at line 22 of file COP_SlapCompDispatcher.h.
| using COP_SlapCompDispatcher::CheckFunction = bool (*)(const OP_Node*) |
Should return true for nodes that are supported by the slapcomp type.
Definition at line 25 of file COP_SlapCompDispatcher.h.
|
inline |
Definition at line 49 of file COP_SlapCompDispatcher.h.
|
delete |
| COP_SlapCompDispatcher::COP_SlapCompDispatcher | ( | COP_SlapCompDispatcher && | ) |
|
overridevirtual |
Prepares for applying slapcomp for inputs of the given types.
Implements COP_SlapCompManager.
|
protected |
| void COP_SlapCompDispatcher::copyFrom | ( | const COP_SlapCompDispatcher & | other, |
| const OP_Context & | context | ||
| ) |
Makes this object a copy of other, including the enable state.
|
overridevirtual |
Returns a particular output by name.
Implements COP_SlapCompManager.
|
overridevirtual |
Should return the outputs that this slapcomp produces.
Implements COP_SlapCompManager.
Return target nodes the slapcomp programs this was built for (typically size==1, but may be mode if there are chained programs).
Implements COP_SlapCompManager.
|
inlineoverridevirtual |
Returns a version number, which is incremented every time the program is rebuilt.
Implements COP_SlapCompManager.
Definition at line 84 of file COP_SlapCompDispatcher.h.
|
overridevirtual |
Return the viewport target node.
Implements COP_SlapCompManager.
|
overridevirtual |
Returns true if the last run of slapcomp had errors.
Implements COP_SlapCompManager.
|
overridevirtual |
Returns whether the viewport slapcomp is enabled.
Implements COP_SlapCompManager.
|
inlineoverridevirtual |
Returns true if the last attempted application of slapcomp may have changed the possible outputs. This flag is is reset before each application of slapcomp.
Implements COP_SlapCompManager.
Definition at line 90 of file COP_SlapCompDispatcher.h.
|
overridevirtual |
Returns whether the viewport slapcomp is enabled.
Implements COP_SlapCompManager.
|
static |
Call this function to register a slapcomp factory. The checker function should return true for a node if that slapcomp manager should be used for it.
|
overridevirtual |
Returns true if the slapcomp program ouputs an AOV with the given name. Should accept "color" as an alias for the "C" AOV.
Implements COP_SlapCompManager.
|
delete |
| COP_SlapCompDispatcher& COP_SlapCompDispatcher::operator= | ( | COP_SlapCompDispatcher && | ) |
|
overrideprotectedvirtual |
Reports an error (through the callback if possible).
Implements COP_SlapCompManager.
|
overrideprotectedvirtual |
Reports a warning (through the callback if possible).
Implements COP_SlapCompManager.
|
overridevirtual |
Should run slapcomp with the specified inputs and context.
Implements COP_SlapCompManager.
|
overridevirtual |
Sets a callback that gets called when reporting slapcomp errors.
Implements COP_SlapCompManager.
Sets a callback that gets called when slapcomp is run.
Implements COP_SlapCompManager.
|
overridevirtual |
Set the image filters defined on the USD Stage.
Implements COP_SlapCompManager.
Sets a callback that gets called when slapcomp changes.
Implements COP_SlapCompManager.
This should really be private, but due to difficult visibility rules, we just settle for this... This should only be called by higher-level managers that interface with other managers.
Implements COP_SlapCompManager.
Definition at line 98 of file COP_SlapCompDispatcher.h.
|
overridevirtual |
Set the image filter from the viewport control (which gets applied after the stage filters)
Implements COP_SlapCompManager.
|
overridevirtual |
Sets a callback that gets called when reporting slapcomp warnings.
Implements COP_SlapCompManager.
|
overridevirtual |
Called when slapcomp is enabled disabled.
Implements COP_SlapCompManager.
|
protected |
Definition at line 110 of file COP_SlapCompDispatcher.h.
|
protected |
Definition at line 112 of file COP_SlapCompDispatcher.h.
|
protected |
Definition at line 111 of file COP_SlapCompDispatcher.h.
|
protected |
Definition at line 119 of file COP_SlapCompDispatcher.h.