Hi Andrew,

If you don't have any custom nodes then you could use the .ive format,
and use the .ive plugins support istream/ostreams.

       osgDB::ReaderWriter* writer =
osgDB::Registry::instance()->getReaderWriterForExtension("ive");
      if(writer)
      {
          std::stringstream outputStream;
          osgDB::ReaderWriter::WriteResult wr =
writer->writeNode(*node,outputStream,0));
          if(wr.success()) {... do your stuff to write output the
stringstream... }

      }


Robert.


On Fri, Jun 5, 2009 at 10:27 AM, Andrew Thompson<[email protected]> wrote:
> Hi there,
>
> This is the first time I've posted on these boards, I wonder if any of you 
> guys can help me out?
>
> I am developing a CAD application that uses OpenSceneGraph and I need to 
> implement custom serialization of the CAD data to/from disk. This requires 
> saving individual nodes and their children to a custom file format along with 
> some other data from the app.
>
> Now I notice OSG has the ability to save/load multiple file formats using the 
> Plugins but what I'd really like to do is save/load a node to a memory 
> pointer, so the node data is held in memory as opposed to being written to a 
> file. This would allow me to serialize this node data inside my own custom 
> file format.
>
> Is there any way to serialize / deserialize a node to memory using the 
> existing plugins? If not, how could I go about implementing this?
>
> Thank you very much in advance,
>
> AndyB
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=13565#13565
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to