Hi Robert,

thanks, it works now both for distant & local file (using ReadFileCallback).
I can load file in osgviewer using :
    sp3d://host:port/path/toto.ive
instead of
   sp3d://host:port/path/toto.ive.sp3d

The code was fine, I was just passing a wrong filename :( but some sessions
in the debugger has given me a better idea of how all this stuff is working :)

I'am now considering the osga 'archive' case.

 in virtual ReadResult readFile(ObjectType objectType, const string& sRawUrl, 
const Options *options) const

i do the following :

------------------------------------------------------------------------------------------------------------------------
----

if the url includes an archive (for example 
sp3d://host:2468/3D/archive.osga/titi.ive)
then
    download archive.osga
    the archive is now contained in memory in a string stream : tStringStream

    ReaderWriter *ptArchiveReader = 
Registry::instance()->getReaderWriterForExtension( "osga" ) ;
    tReadResult = ptArchiveReader->openArchive( *tStringStream, options ) ;

   if ( !tReadResult.validArchive() )
       return tReadResult;

   osgDB::Archive* ptArchive = tReadResult.getArchive();

   osg::ref_ptr<ReaderWriter::Options> options = new ReaderWriter::Options;
   options->setDatabasePath(sArchiveName);

   // sFileInArchive contains the fileame in the archive (titi.ive)
   return ptArchive->readNode(sFileInArchive,options.get());
else
    // normal file
   ... this part is working now
------------------------------------------------------------------------------------------------------------------------
----

The openArchive works but the readNode failed.
The _status member is undefined (it should be READ).
Is it possible to make it works from the stream ?

Any hints appreciated.

Frederic.
_________________________________________________________________
Frédéric Trastour - GEOIMAGE - [EMAIL PROTECTED]

----- Original Message ----- 
From: "Robert Osfield" <[EMAIL PROTECTED]>
To: "osg users" <[email protected]>
Sent: Wednesday, June 14, 2006 1:24 PM
Subject: Re: [osg-users] net driver and archive


Hi Frédéric,

I can't spot any problems with your custom callback, and your doing
things roughly how I'd tackle it, so I can't anything more than to
wish you good luck on tracing things using debugging
statements/debugger.

Robert.

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to