Hello all,

I am working on a driver very similar to the '.net' one. This driver just uses 
a different
network protocol (not the http/get of the net driver but a proprietary one).

I have used the code of the net driver as a starting point for my driver.
I have just removed the cache mecanism ( later, i will use the cache managed by 
my application )
and I have changed the download stuff in order to use my protocol.

I can successfully use my driver with osgviewer :

    ./osgviewerd.exe sp3d://localhost:2468/3d/747.ive.sp3d

The problem I have concerns osg archive.
This works locally :

    ./osgviewerd.exe ./archive.osga                              load the 
archive and display the first file
    ./osgviewerd.exe ./archive.osga/747.ive                load the archive and 
display the file 747.ive
    ./osgviewerd.exe ./archive.osga/capitole_p2.ive  load the archive and 
display the file capitole_p2.ive

but this fails with both my driver and the .net one.

I have seen that  in net driver do some stuff about archive processing :

      virtual ReadResult openArchive(const string& fileName,ArchiveStatus 
status, unsigned int , const Options* options)
const {
             osg::notify(osg::NOTICE) << "osgPlugin::openArchive " << fileName 
<< endl;
             if (status!=READ)
               return ReadResult(ReadResult::FILE_NOT_HANDLED);
             else
               return readFile(ARCHIVE,fileName,options);
      }

        ReadResult readFile(ObjectType objectType, osgDB::ReaderWriter* rw, 
std::istream& fin, const Options *options)
const
        {
            switch(objectType)
            {
            case(OBJECT): return rw->readObject(fin,options);
            case(ARCHIVE): return rw->openArchive(fin,options);
            case(IMAGE): return rw->readImage(fin,options);
            case(HEIGHTFIELD): return rw->readHeightField(fin,options);
            case(NODE): return rw->readNode(fin,options);
            default: break;
            }
            return ReadResult::FILE_NOT_HANDLED;
        }

...

       if (objectType==ARCHIVE && readResult.validArchive())
            {
                // attach the socket istream to the archive to keep it alive.
                osgDB::Archive* archive = readResult.getArchive();
                archive->setUserData(sio.get());
            }

...

and I have replicated this in my driver. The problem is that I can't load an 
archive neither
with the net driver nor with mine (.sp3d).

./osgviewerd.exe http://localhost/geogp/archive.osga

doesn't work.

Another thing I do not understand is that the net driver is loaded 
automatically with the following url :

http://localhost/geogp/toto.ive    (note that no .net needs to be appended).

Is it possible to automatically load my driver for this type of url :

sp3d://localhost/toto.ive

for now I have to append the .sp3d extension.

Thanks in advance for any help, I am totally new to OSG  and this is a really 
large
library. I don't know how to search first...

I hope my poor english will be understood :(

_________________________________________________________________
Frédéric Trastour - SpacEyes - [EMAIL PROTECTED]

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

Reply via email to