30 virtual void enable(
int target_node_id,
const OP_Context&) = 0;
34 virtual void disable() = 0;
36 virtual bool isEnabled()
const = 0;
38 virtual bool hasErrors()
const = 0;
40 virtual int getTargetNode()
const = 0;
43 virtual void setErrorCallback(
void (*cb)(
void*,
const char*),
46 virtual void setWarningCallback(
void (*cb)(
void*,
const char*),
49 virtual void setRunCallback(
void (*cb)(
void*),
void *
data) = 0;
51 virtual void setUpdateCallback(
void (*cb)(
void*),
void *
data) = 0;
64 bool should_build=
true)
66 if (should_build && !build(input_fetcher, context))
68 runSlapcompImpl(input_fetcher, context);
88 getOutputStructure()
const = 0;
100 virtual bool hasStateChanged()
const = 0;
104 virtual void reportError(
const char *
message) = 0;
106 virtual void reportWarning(
const char *
message) = 0;
112 void (*myErrorCB)(
void*,
const char*) =
nullptr;
114 void *myErrorCBData =
nullptr;
116 void (*myWarningCB)(
void*,
const char*) =
nullptr;
118 void *myWarningCBData =
nullptr;
120 void (*myRunCB)(
void*) =
nullptr;
122 void *myRunCBData =
nullptr;
124 void (*myUpdateCB)(
void*) =
nullptr;
126 void *myUpdateCBData =
nullptr;
177 void enable(
int target_node_id,
223 {
return myStateChanged; }
228 {
return myVersion; }
234 myCallbacks.myErrorCB = cb;
235 myCallbacks.myErrorCBData =
data;
241 myCallbacks.myWarningCB = cb;
242 myCallbacks.myWarningCBData =
data;
247 myCallbacks.myRunCB = cb;
248 myCallbacks.myRunCBData =
data;
253 myCallbacks.myUpdateCB = cb;
254 myCallbacks.myUpdateCBData =
data;
274 void reportOutputSizeErrors(
290 Callbacks myCallbacks;
virtual IMX_LayerPtr getOutputLayer(const UT_StringHolder &name) const =0
Returns a particular output by name.
void * myErrorCBData
Data to send to the error reporting callback.
GLuint GLsizei const GLchar * message
int getVersion(int version)
bool build(const COP_SlapcompInputFetcher &input_fetcher, const OP_Context &context)
Prepares for applying slapcomp for the provided set of inputs.
virtual COP_CableStructure getOutputStructure() const =0
Should return the outputs that this slapcomp produces.
void(* myErrorCB)(void *, const char *)
Callback function to report errors to the outside world.
COP_SlapcompManager & operator=(const COP_SlapcompManager &)=delete
void setVersion(int version) override
const COP_ApexProgram & getProgram() const
Get the managed slapcomp program.
void(* myRunCB)(void *)
Callback function for when the slapcomp program is run.
void * myWarningCBData
Data to send to the warning reporting callback.
void * myUpdateCBData
Data to send to the update callback.
void setRunCallback(void(*cb)(void *), void *data) override
Sets a callback that gets called when the slapcomp program is run.
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
bool hasErrors() const override
Returns true if the last run of slapcomp had errors.
void setWarningCallback(void(*cb)(void *, const char *), void *data) override
Sets a callback that gets called when reporting warnings.
bool isEnabled() const override
Returns true if slapcomp is enabled.
UT_SharedPtr< const IMX_Layer > IMX_LayerConstPtr
bool runSlapcomp(COP_SlapcompInputFetcher &input_fetcher, const OP_Context &context, bool should_build=true)
IMX_LayerConstPtr myLayer
OPENVDB_API void setVersion(std::ios_base &, const VersionId &libraryVersion, uint32_t fileVersion)
Associate specific file format and library version numbers with the given stream. ...
void setCallbacks(const Callbacks &cbs)
Set all callbacks using a struct.
void * myRunCBData
Data to send to the run callback.
GLuint const GLchar * name
virtual void reportWarning(const char *message)=0
Reports a warning (through the callback if possible).
Abstract interface for managing slapcomp.
virtual void reportError(const char *message)=0
Reports an error (through the callback if possible).
GT_API const UT_StringHolder version
virtual bool isSlapcompAOV(const UT_StringHolder &name) const =0
int getVersion() const override
COP_Type
Types of basic data that are passed around a COP network.
LeafData & operator=(const LeafData &)=delete
virtual bool expectsLayerCameras() const
A global error manager scope.
virtual void enable(int target_node_id, const OP_Context &)=0
Enable slapcomp with the given node.
void setErrorCallback(void(*cb)(void *, const char *), void *data) override
Sets a callback that gets called when reporting errors.
virtual bool buildForInputs(const COP_CableStructure &inputs, const OP_Context &context)=0
Prepares for applying slapcomp for inputs of the given types.
void setUpdateCallback(void(*cb)(void *), void *data) override
Sets a callback that gets called when the slapcomp program is updated.
void enable(OP_Node *const node, const OP_Context &ctx)
virtual void disable()=0
Disable slapcomp.
virtual int getTargetNode() const =0
Returns the id of the node slapcomp was built from.
void(* myWarningCB)(void *, const char *)
Callback function to report warnings to the outside world.
bool hasStateChanged() const override
UT_SharedPtr< IMX_Layer > IMX_LayerPtr
void(* myUpdateCB)(void *)
Callback function for when the slapcomp program is updated.
virtual void runSlapcompImpl(COP_SlapcompInputFetcher &input_fetcher, const OP_Context &context)=0
Should run slapcomp with the specified inputs and context.