Hi John,
On 10 September 2013 17:26, PCJohn <[email protected]> wrote: > - name can be ok, but the file might be broken and plugin might fail to > load > it. Might osgDB::ReadFileCallback provide the solution? I could register it > and call osgDB::read[Image|Object|Node|...]Implementation inside the > callback. > Then, I would act whenever it returns error (error message,...). > The osgDB::read*File() are effectively convenience functions that make it very quick and easy to load a file and get a object back. However, they discard all the information about failures that are passed by from the plugins. If you call: osgDB::ReaderWriter::ReadResult result = osgDB::Registry::instance()->readImage("myfile.tif"); You'll get the full ReadResult object that contains the object on success, but also the errors enum and error strings. > - I would be happy to have a chance to abort the loading process and return > failure if there are missing files. I guess, this can not be handled > directly. > But I could act after the whole loading process and check the status of my > callbacks that already saw all the error codes of all findFile and all > read*Implementations. > Such an abort process would require a scheme where plugins pool a state to know whether to throw an exception, but to do so would be horribly complicated and problem to errors. It would only be practical to implement if one did it at the file level, so aborted subsequent loads in a batch. Robert.
_______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
