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 enable (int target_node_id, const OP_Context &)=0
 Enable slapcomp with the given node. More...
 
void enable (OP_Node *const node, const OP_Context &ctx)
 
virtual void disable ()=0
 Disable slapcomp. More...
 
virtual bool isEnabled () const =0
 Returns the on-off state of slapcomp. More...
 
virtual bool hasErrors () const =0
 Returns true if the last run of slapcomp had errors. More...
 
virtual int getTargetNode () const =0
 Returns the id of the node slapcomp was built from. 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 18 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 73 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.

virtual void COP_SlapcompManager::disable ( )
pure virtual

Disable slapcomp.

Implemented in COP_SlapcompProgramManager, and COP_SlapcompDispatcher.

virtual void COP_SlapcompManager::enable ( int  target_node_id,
const OP_Context  
)
pure virtual

Enable slapcomp with the given node.

Implemented in COP_SlapcompProgramManager, and COP_SlapcompDispatcher.

void COP_SlapcompManager::enable ( OP_Node *const  node,
const OP_Context ctx 
)
inline

Definition at line 31 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.

Definition at line 58 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 int COP_SlapcompManager::getTargetNode ( ) const
pure virtual

Returns the id of the node slapcomp was built from.

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 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::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::isEnabled ( ) const
pure virtual

Returns the on-off state of slapcomp.

Implemented in COP_SlapcompProgramManager, and COP_SlapcompDispatcher.

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 62 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 142 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::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::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.


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