Retrieve errors from pointcloud_search()
elizabeth.bonnefoy@...
Hi everyone!
|
|
Larry Gritz
As you probably know, some functionality (including pointcloud_search) is implemented by callbacks to the RendererServices object supplied by the renderer itself. Each renderer makes a derived class from RendererServices, and makes choices about which of the virtual functions directly inherit the default implementations in our RendererServices base class, and which override with renderer-specific functionality.
The default RendererServices::pointcloud_search (see src/liboslexec/pointcloud.cpp) issues an error message if there is no pointcloud file at all, but then returns control back to the shader. You could have YourRendererServices::pointcloud_search supply a different implementation. Say, copy ours, but modify it so that in the cases of a missing or broken ptc file, instead of merely issuing an error and returning 0, it could do something more drastic, signalling the renderer to terminate early. There may be a simpler way -- many renderers have an option to terminate at the first error (or after some fixed number of errors), and given that the default RendererServices::pointcloud_search does issue an error that gets bubbled back to the renderer, maybe enabling this option is enough? But if your renderer doesn't have an "early terminate on any error" option, or if you really need to terminate for this particular error but not for other errors, then suppling a replacement RS::pointcloud_search that handles the error in a custom way is probably the best approach. -- lg
|
|