Re: [osg-users] How to implement pagedLOD without reading from files?
Hi Werner, There isn't any need to put ReaderWriter's in plugins as the osgDB::ReaderWriter architecture has been designed to allow them to be placed in plugins on just directly in applications. All you need to do is include the custom ReaderWiter's soure file into your application and then register an instance of it using the REGISTER_OSGPLUGIN(..) macro to create the required proxy object that will register an instance of your ReaderWriter with osgDB::Registry. Robert. On 16 November 2016 at 15:51, Werner Modenbach wrote: > Hi Robert, > > I think I have all the coding done and in my opinion it should work. > But it doesn't and I figured out why. > When using osgDB with my own ReaderWriter it automatically uses the > dynamic load feature and the ReaderWriter is expected to be a dll in the > plugins folder. > Unfortunately my ReaderWriter is very much depending on many classes I have > in my > project and also has dependencies to Qt. > Creating such a dll would be a complete overkill of link dependencies. > Is there any way avoiding the dynamic load mechanism and using an instance > of a > class being part of my static libs? > > Thanks in advance for any hints. > > - Werner - > > Am 11.11.2016 um 12:47 schrieb Robert Osfield: > > Hi Wener, > > On 11 November 2016 at 11:32, Werner Modenbach > wrote: > > just one more small question. > As to my understanding the ReaderWriter classes are instantiated > automatically > according to the "file extensions". So I get no hands on the instances of > the reader. > How can I give the reader class a reference to my data structures? > > You can pass data into a plugin via the osgDB::Options object that you > can pass along with the string used for the filename. The Options > object can store user data as well be subclassed. > > Robert. > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > > -- > TEXION Software Solutions, Rotter Bruch 26a, D-52068 Aachen > Phone: +49 241 475757-0 > Fax: +49 241 475757-29 > Web: http://texion.eu > eMail: i...@texion.eu > > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to implement pagedLOD without reading from files?
Hi Werner, I think you may try using osg::Registry::instance()->addReaderWriter( YourReaderWriterInstance ) to add your own localy defined RW. Your RW will need to override supportedExtensions() and/or acceptsExtension() virtual methods. But I guess you must have already done that Cheers, Wojtek 2016-11-16 16:51 GMT+01:00 Werner Modenbach : > Hi Robert, > > I think I have all the coding done and in my opinion it should work. > But it doesn't and I figured out why. > When using osgDB with my own ReaderWriter it automatically uses the > dynamic load feature and the ReaderWriter is expected to be a dll in the > plugins folder. > Unfortunately my ReaderWriter is very much depending on many classes I > have in my > project and also has dependencies to Qt. > Creating such a dll would be a complete overkill of link dependencies. > Is there any way avoiding the dynamic load mechanism and using an instance > of a > class being part of my static libs? > > Thanks in advance for any hints. > > - Werner - > > Am 11.11.2016 um 12:47 schrieb Robert Osfield: > > Hi Wener, > > On 11 November 2016 at 11:32, Werner Modenbach > wrote: > > just one more small question. > As to my understanding the ReaderWriter classes are instantiated > automatically > according to the "file extensions". So I get no hands on the instances of > the reader. > How can I give the reader class a reference to my data structures? > > You can pass data into a plugin via the osgDB::Options object that you > can pass along with the string used for the filename. The Options > object can store user data as well be subclassed. > > Robert. > ___ > osg-users mailing > listosg-users@lists.openscenegraph.orghttp://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > > -- > *TEXION Software Solutions*, Rotter Bruch 26a, D-52068 Aachen > Phone: +49 241 475757-0 > Fax: +49 241 475757-29 > Web: http://texion.eu > eMail: i...@texion.eu > > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to implement pagedLOD without reading from files?
Hi Robert, I think I have all the coding done and in my opinion it should work. But it doesn't and I figured out why. When using osgDB with my own ReaderWriter it automatically uses the dynamic load feature and the ReaderWriter is expected to be a dll in the plugins folder. Unfortunately my ReaderWriter is very much depending on many classes I have in my project and also has dependencies to Qt. Creating such a dll would be a complete overkill of link dependencies. Is there any way avoiding the dynamic load mechanism and using an instance of a class being part of my static libs? Thanks in advance for any hints. - Werner - Am 11.11.2016 um 12:47 schrieb Robert Osfield: > Hi Wener, > > On 11 November 2016 at 11:32, Werner Modenbach > wrote: >> just one more small question. >> As to my understanding the ReaderWriter classes are instantiated >> automatically >> according to the "file extensions". So I get no hands on the instances of >> the reader. >> How can I give the reader class a reference to my data structures? > You can pass data into a plugin via the osgDB::Options object that you > can pass along with the string used for the filename. The Options > object can store user data as well be subclassed. > > Robert. > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- *TEXION Software Solutions*, Rotter Bruch 26a, D-52068 Aachen Phone: +49 241 475757-0 Fax: +49 241 475757-29 Web: http://texion.eu eMail: i...@texion.eu ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to implement pagedLOD without reading from files?
Thanks Robert. I think I should use the PluginDataMap to provide pointers to classes or structures. Right? Thanks again. Very quick and good help! - Werner - Am 11.11.2016 um 12:47 schrieb Robert Osfield: > Hi Wener, > > On 11 November 2016 at 11:32, Werner Modenbach > wrote: >> just one more small question. >> As to my understanding the ReaderWriter classes are instantiated >> automatically >> according to the "file extensions". So I get no hands on the instances of >> the reader. >> How can I give the reader class a reference to my data structures? > You can pass data into a plugin via the osgDB::Options object that you > can pass along with the string used for the filename. The Options > object can store user data as well be subclassed. > > Robert. > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- *TEXION Software Solutions*, Rotter Bruch 26a, D-52068 Aachen Phone: +49 241 475757-0 Fax: +49 241 475757-29 Web: http://texion.eu eMail: i...@texion.eu ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to implement pagedLOD without reading from files?
Hi Wener, On 11 November 2016 at 11:32, Werner Modenbach wrote: > just one more small question. > As to my understanding the ReaderWriter classes are instantiated > automatically > according to the "file extensions". So I get no hands on the instances of > the reader. > How can I give the reader class a reference to my data structures? You can pass data into a plugin via the osgDB::Options object that you can pass along with the string used for the filename. The Options object can store user data as well be subclassed. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to implement pagedLOD without reading from files?
Hi Chris, just one more small question. As to my understanding the ReaderWriter classes are instantiated automatically according to the "file extensions". So I get no hands on the instances of the reader. How can I give the reader class a reference to my data structures? Thanks - Werner - Hi Chris, thanks a lot. I knew it must be easy somehow but I was blind for the solution. Yes, I have to subclass ReaderWriter and that's it. Wow! - Werner - Am 09.11.2016 um 18:43 schrieb Chris Hanson: > Basically you make a custom URI scheme to name each "file" in the > PagedLOD object, like > > 12345567890.werner_texion_tile > > Then you create and register a pseudoloader that accepts requests for > "files" ending in the ".werner_texion_tile" extension. But when your > pseudoloader is called to "load" one of these "files", you simply > parse the "filename" to get the tile ID from it, and then construct > the resulting subgraph using the assets already available in memory > (or over a network, or however you wish to get the real data to make > the subgraph) and return it as if you had just loaded it from disk. > > There's nothing "disk" specific about the URI system in the PagedLOD > subsystem. > > > > > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to implement pagedLOD without reading from files?
Hi Chris, thanks a lot. I knew it must be easy somehow but I was blind for the solution. Yes, I have to subclass ReaderWriter and that's it. Wow! - Werner - Am 09.11.2016 um 18:43 schrieb Chris Hanson: > Basically you make a custom URI scheme to name each "file" in the > PagedLOD object, like > > 12345567890.werner_texion_tile > > Then you create and register a pseudoloader that accepts requests for > "files" ending in the ".werner_texion_tile" extension. But when your > pseudoloader is called to "load" one of these "files", you simply > parse the "filename" to get the tile ID from it, and then construct > the resulting subgraph using the assets already available in memory > (or over a network, or however you wish to get the real data to make > the subgraph) and return it as if you had just loaded it from disk. > > There's nothing "disk" specific about the URI system in the PagedLOD > subsystem. > > > > > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to implement pagedLOD without reading from files?
Basically you make a custom URI scheme to name each "file" in the PagedLOD object, like 12345567890.werner_texion_tile Then you create and register a pseudoloader that accepts requests for "files" ending in the ".werner_texion_tile" extension. But when your pseudoloader is called to "load" one of these "files", you simply parse the "filename" to get the tile ID from it, and then construct the resulting subgraph using the assets already available in memory (or over a network, or however you wish to get the real data to make the subgraph) and return it as if you had just loaded it from disk. There's nothing "disk" specific about the URI system in the PagedLOD subsystem. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org