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

Abstract interface for managing slapcomp. More...

#include <COP_SlapCompProgramManager.h>

+ Inheritance diagram for COP_SlapCompManager:

Classes

struct  Callbacks
 
struct  Output
 

Public Member Functions

 COP_SlapCompManager ()=default
 
 COP_SlapCompManager (const COP_SlapCompManager &)=delete
 
 COP_SlapCompManager (COP_SlapCompManager &&)=default
 
COP_SlapCompManageroperator= (const COP_SlapCompManager &)=delete
 
COP_SlapCompManageroperator= (COP_SlapCompManager &&)=default
 
virtual ~COP_SlapCompManager ()=default
 
virtual void setStage (const UT_Span< const int > &target_nodes, const OP_Context &)=0
 Set the image filters defined on the USD Stage. More...
 
virtual void setViewport (const OP_Node *node, const OP_Context &ctx)=0
 
void clearAllFilters ()
 Clear all filters. More...
 
void enable ()
 
void disable ()
 Disable all slapcomp. More...
 
void setEnabled (bool state)
 
virtual void updateEnableState ()=0
 Called when slapcomp is enabled disabled. More...
 
bool isEnabled () const
 Returns the on-off state of slapcomp. More...
 
bool getEnableState () const
 Returns the enable state. More...
 
virtual bool hasStageFilters () const =0
 Returns whether the viewport slapcomp is enabled. More...
 
virtual bool hasViewportFilters () const =0
 Returns whether the viewport slapcomp is enabled. More...
 
virtual bool hasErrors () const =0
 Returns true if the last run of slapcomp had errors. More...
 
virtual UT_Array< intgetStageTargetNodes () const =0
 
virtual int getViewportTargetNode () const =0
 Return the viewport target node. More...
 
virtual void setErrorCallback (void(*cb)(void *, const char *), void *data)=0
 Sets a callback that gets called when reporting slapcomp errors. More...
 
virtual void setWarningCallback (void(*cb)(void *, const char *), void *data)=0
 Sets a callback that gets called when reporting slapcomp warnings. More...
 
virtual void setRunCallback (void(*cb)(void *), void *data)=0
 Sets a callback that gets called when slapcomp is run. More...
 
virtual void setUpdateCallback (void(*cb)(void *), void *data)=0
 Sets a callback that gets called when slapcomp changes. More...
 
virtual bool isSlapCompAOV (const UT_StringHolder &name) const =0
 
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...
 
virtual bool buildForInputs (const COP_CableStructure &inputs, const OP_Context &context)=0
 Prepares for applying slapcomp for inputs of the given types. More...
 
virtual void runSlapCompImpl (COP_SlapCompInputFetcher &input_fetcher, const OP_Context &context)=0
 Should run slapcomp with the specified inputs and context. More...
 
virtual COP_CableStructure getOutputStructure () const =0
 Should return the outputs that this slapcomp produces. More...
 
virtual IMX_LayerPtr getOutputLayer (const UT_StringHolder &name) const =0
 Returns a particular output by name. More...
 
virtual int getVersion () const =0
 
virtual bool hasStateChanged () const =0
 
UT_StringMap< OutputgetOutputs () const
 
void setCallbacks (const Callbacks &cbs)
 Set all callbacks using a struct. More...
 
virtual void setVersion (int version)=0
 

Protected Member Functions

virtual void reportError (const char *message)=0
 Reports an error (through the callback if possible). More...
 
virtual void reportWarning (const char *message)=0
 Reports a warning (through the callback if possible). More...
 
void reportAllErrorManagerErrors (const UT_ErrorManager &)
 Relays all warnings and messages from the error manager. More...
 

Detailed Description

Abstract interface for managing slapcomp.

Definition at line 19 of file COP_SlapCompProgramManager.h.

Constructor & Destructor Documentation

COP_SlapCompManager::COP_SlapCompManager ( )
default
COP_SlapCompManager::COP_SlapCompManager ( const COP_SlapCompManager )
delete
COP_SlapCompManager::COP_SlapCompManager ( COP_SlapCompManager &&  )
default
virtual COP_SlapCompManager::~COP_SlapCompManager ( )
virtualdefault

Member Function Documentation

bool COP_SlapCompManager::build ( const COP_SlapCompInputFetcher input_fetcher,
const OP_Context context 
)
inline

Prepares for applying slapcomp for the provided set of inputs.

Definition at line 121 of file COP_SlapCompProgramManager.h.

virtual bool COP_SlapCompManager::buildForInputs ( const COP_CableStructure inputs,
const OP_Context context 
)
pure virtual

Prepares for applying slapcomp for inputs of the given types.

Implemented in COP_SlapCompProgramManager, and COP_SlapCompDispatcher.

void COP_SlapCompManager::clearAllFilters ( )
inline

Clear all filters.

Definition at line 40 of file COP_SlapCompProgramManager.h.

void COP_SlapCompManager::disable ( )
inline

Disable all slapcomp.

Definition at line 55 of file COP_SlapCompProgramManager.h.

void COP_SlapCompManager::enable ( )
inline

Enable all/any slapcomp. This sets the state (whether there are actually filters to be run or not).

Definition at line 49 of file COP_SlapCompProgramManager.h.

virtual bool COP_SlapCompManager::expectsLayerCameras ( ) const
inlinevirtual

Should return true if this slapcomp requires the input layers to bring in their cameras.

Reimplemented in COP_SlapCompProgramManager, and COP_SlapCompDispatcher.

Definition at line 106 of file COP_SlapCompProgramManager.h.

bool COP_SlapCompManager::getEnableState ( ) const
inline

Returns the enable state.

Definition at line 77 of file COP_SlapCompProgramManager.h.

virtual IMX_LayerPtr COP_SlapCompManager::getOutputLayer ( const UT_StringHolder name) const
pure virtual

Returns a particular output by name.

Implemented in COP_SlapCompProgramManager, and COP_SlapCompDispatcher.

UT_StringMap<Output> COP_SlapCompManager::getOutputs ( ) const

Returns an output map constructed from the outputs of the last execution of the slapcomp program. This map is safe to use even after the program outputs change as a result of building or running it. If the program is not enabled or in an error state, the returned map will be empty.

virtual COP_CableStructure COP_SlapCompManager::getOutputStructure ( ) const
pure virtual

Should return the outputs that this slapcomp produces.

Implemented in COP_SlapCompProgramManager, and COP_SlapCompDispatcher.

virtual UT_Array<int> COP_SlapCompManager::getStageTargetNodes ( ) const
pure virtual

Return target nodes the slapcomp programs this was built for (typically size==1, but may be mode if there are chained programs).

Implemented in COP_SlapCompProgramManager, and COP_SlapCompDispatcher.

virtual int COP_SlapCompManager::getVersion ( ) const
pure virtual

Returns a version number, which is incremented every time the program is rebuilt.

Implemented in COP_SlapCompProgramManager, and COP_SlapCompDispatcher.

virtual int COP_SlapCompManager::getViewportTargetNode ( ) const
pure virtual

Return the viewport target node.

Implemented in COP_SlapCompProgramManager, and COP_SlapCompDispatcher.

virtual bool COP_SlapCompManager::hasErrors ( ) const
pure virtual

Returns true if the last run of slapcomp had errors.

Implemented in COP_SlapCompProgramManager, and COP_SlapCompDispatcher.

virtual bool COP_SlapCompManager::hasStageFilters ( ) const
pure virtual

Returns whether the viewport slapcomp is enabled.

Implemented in COP_SlapCompProgramManager, and COP_SlapCompDispatcher.

virtual bool COP_SlapCompManager::hasStateChanged ( ) const
pure virtual

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.

Implemented in COP_SlapCompProgramManager, and COP_SlapCompDispatcher.

virtual bool COP_SlapCompManager::hasViewportFilters ( ) const
pure virtual

Returns whether the viewport slapcomp is enabled.

Implemented in COP_SlapCompProgramManager, and COP_SlapCompDispatcher.

bool COP_SlapCompManager::isEnabled ( ) const
inline

Returns the on-off state of slapcomp.

Definition at line 72 of file COP_SlapCompProgramManager.h.

virtual bool COP_SlapCompManager::isSlapCompAOV ( const UT_StringHolder name) const
pure virtual

Returns true if the slapcomp program ouputs an AOV with the given name. Should accept "color" as an alias for the "C" AOV.

Implemented in COP_SlapCompProgramManager, and COP_SlapCompDispatcher.

COP_SlapCompManager& COP_SlapCompManager::operator= ( const COP_SlapCompManager )
delete
COP_SlapCompManager& COP_SlapCompManager::operator= ( COP_SlapCompManager &&  )
default
void COP_SlapCompManager::reportAllErrorManagerErrors ( const UT_ErrorManager )
protected

Relays all warnings and messages from the error manager.

virtual void COP_SlapCompManager::reportError ( const char *  message)
protectedpure virtual

Reports an error (through the callback if possible).

Implemented in COP_SlapCompProgramManager, and COP_SlapCompDispatcher.

virtual void COP_SlapCompManager::reportWarning ( const char *  message)
protectedpure virtual

Reports a warning (through the callback if possible).

Implemented in COP_SlapCompProgramManager, and COP_SlapCompDispatcher.

bool COP_SlapCompManager::runSlapComp ( COP_SlapCompInputFetcher input_fetcher,
const OP_Context context,
bool  should_build = true 
)
inline

Optionally builds and then runs slapcomp with the specified inputs and context. Returns successfulness.

Definition at line 110 of file COP_SlapCompProgramManager.h.

virtual void COP_SlapCompManager::runSlapCompImpl ( COP_SlapCompInputFetcher input_fetcher,
const OP_Context context 
)
pure virtual

Should run slapcomp with the specified inputs and context.

Implemented in COP_SlapCompProgramManager, and COP_SlapCompDispatcher.

void COP_SlapCompManager::setCallbacks ( const Callbacks cbs)
inline

Set all callbacks using a struct.

Definition at line 189 of file COP_SlapCompProgramManager.h.

void COP_SlapCompManager::setEnabled ( bool  state)
inline

Definition at line 60 of file COP_SlapCompProgramManager.h.

virtual void COP_SlapCompManager::setErrorCallback ( void(*)(void *, const char *)  cb,
void data 
)
pure virtual

Sets a callback that gets called when reporting slapcomp errors.

Implemented in COP_SlapCompProgramManager, and COP_SlapCompDispatcher.

virtual void COP_SlapCompManager::setRunCallback ( void(*)(void *)  cb,
void data 
)
pure virtual

Sets a callback that gets called when slapcomp is run.

Implemented in COP_SlapCompProgramManager, and COP_SlapCompDispatcher.

virtual void COP_SlapCompManager::setStage ( const UT_Span< const int > &  target_nodes,
const OP_Context  
)
pure virtual

Set the image filters defined on the USD Stage.

Implemented in COP_SlapCompProgramManager, and COP_SlapCompDispatcher.

virtual void COP_SlapCompManager::setUpdateCallback ( void(*)(void *)  cb,
void data 
)
pure virtual

Sets a callback that gets called when slapcomp changes.

Implemented in COP_SlapCompProgramManager, and COP_SlapCompDispatcher.

virtual void COP_SlapCompManager::setVersion ( int  version)
pure virtual

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.

Implemented in COP_SlapCompProgramManager, and COP_SlapCompDispatcher.

virtual void COP_SlapCompManager::setViewport ( const OP_Node node,
const OP_Context ctx 
)
pure virtual

Set the image filter from the viewport control (which gets applied after the stage filters)

Implemented in COP_SlapCompProgramManager, and COP_SlapCompDispatcher.

virtual void COP_SlapCompManager::setWarningCallback ( void(*)(void *, const char *)  cb,
void data 
)
pure virtual

Sets a callback that gets called when reporting slapcomp warnings.

Implemented in COP_SlapCompProgramManager, and COP_SlapCompDispatcher.

virtual void COP_SlapCompManager::updateEnableState ( )
pure virtual

Called when slapcomp is enabled disabled.

Implemented in COP_SlapCompProgramManager, and COP_SlapCompDispatcher.


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