Re: [osg-users] OSG Serialization - changes on custom Classes

2012-09-17 Thread Regina Howard
Interesting. The mechanism is nice and fits it.

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=49672#49672





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OSG Serialization - changes on custom Classes

2012-08-25 Thread Wang Rui
Hi Peter,

I've just submitted a patch which adds user version to the serializers.
Could you please have a look at it in the osg-submissions archive and test
if it could work for your cases?

Thank you,

Wang Rui


2012/8/21 Peter Bako osgfo...@tevs.eu

 Hi mr. Rui Wang.

 Thank you for your help.
 It would be nice if we can set an auxiliary version number manually, when
 writing or reading files.
 This mechanism would be perfect!
 Can I assume that this modification will be implemented in the next month?
 Or what do you suggest to me to do? It is not time critical in the next
 month, but then it will be :-).


 This is a little off-topic, but why is the osg web page inaccessible?
 Trac detected an internal error:
 OperationalError: database is locked



 Thank you!

 Cheers,
 Peter

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=49384#49384





 ___
 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] OSG Serialization - changes on custom Classes

2012-08-23 Thread Robert Osfield
Hi Peter and Rui,

On 21 August 2012 12:59, Peter Bako osgfo...@tevs.eu wrote:
 It would be nice if we can set an auxiliary version number manually, when 
 writing or reading files.
 This mechanism would be perfect!
 Can I assume that this modification will be implemented in the next month?
 Or what do you suggest to me to do? It is not time critical in the next 
 month, but then it will be :-).

As I have plenty of other work on my plate I'll defer to Rui to come
up with a suggested solution, or yourself if you fancy rolling up your
sleeves up.  I do wonder if a user definable format key/string might
be appropriate - I guess the schema and present version number take us
a bit down this route, but perhaps one needs a list of schema or
versions so that multiple layers can be added on for 3rd party libs
can add their own feature set and rev it independently from the OSG
versioning.


 This is a little off-topic, but why is the osg web page inaccessible?
 Trac detected an internal error:
 OperationalError: database is locked

The openscenegraph.org server has been rather beset by problems so we
are working on a replacement.  Try the new openscenegraph.com when the
.org version is down.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OSG Serialization - changes on custom Classes

2012-08-23 Thread Wang Rui
Hi Peter and Robert,

I'm glad to consider a backward-compatible way to add custom versioning
mechanism to current plugin. I would submit it as soon as possible so Peter
and everyone else could test it and see if it suitable for pratical uses.

Wang Rui


2012/8/23 Robert Osfield robert.osfi...@gmail.com

 Hi Peter and Rui,

 On 21 August 2012 12:59, Peter Bako osgfo...@tevs.eu wrote:
  It would be nice if we can set an auxiliary version number manually,
 when writing or reading files.
  This mechanism would be perfect!
  Can I assume that this modification will be implemented in the next
 month?
  Or what do you suggest to me to do? It is not time critical in the next
 month, but then it will be :-).

 As I have plenty of other work on my plate I'll defer to Rui to come
 up with a suggested solution, or yourself if you fancy rolling up your
 sleeves up.  I do wonder if a user definable format key/string might
 be appropriate - I guess the schema and present version number take us
 a bit down this route, but perhaps one needs a list of schema or
 versions so that multiple layers can be added on for 3rd party libs
 can add their own feature set and rev it independently from the OSG
 versioning.


  This is a little off-topic, but why is the osg web page inaccessible?
  Trac detected an internal error:
  OperationalError: database is locked

 The openscenegraph.org server has been rather beset by problems so we
 are working on a replacement.  Try the new openscenegraph.com when the
 .org version is down.

 Robert.
 ___
 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] OSG Serialization - changes on custom Classes

2012-08-21 Thread Peter Bako
Hi mr. Wang Rui.

Thank you for your response. I am actually an owner of your OSG book :-).
I tried your suggestion, it works, but the limitation is that we can have only 
2 versions of osgb files (old format - with the schema) and the new (actual 
format).
Does this mean that there is no way to make more versions readable for my 
application? For example, could we generate schema for every version and try to 
load the file with the schema from the oldest version, if not succeed, then 
with the newer version, then with newer and so on until the load is successful 
(loaded component is not NULL).
I don't see under the hood of binary serialization, I couldn't find the correct 
file.

I need this functionality because I know, that my application will grow after 
release and maybe we will need to change the serialization after the release to 
the customers.
Do you have any other idea to make this possible?

Thank you once more!

Cheers,
Peter

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=49376#49376





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OSG Serialization - changes on custom Classes

2012-08-21 Thread Wang Rui
Hi Peter,

Oh there is another feature of the osgb plugin that I almost forget. :-) It
supports serializer control using the version number. You may read about it
at this page:
http://lists.openscenegraph.org/pipermail/osg-submissions-openscenegraph.org/2010-November/007273.html


Unfortunately the version number mentioned above will automatically be set
to OPENSCENEGRAPH_SOVERSION, so unless the OSG soversion changed, all your
modifications to your own serializers will not be separated. I guess we may
have to modify the plugin source code slightly to add an option to allow
setting the version number (or just an auxiliary version number) manually
when writing/reading files to achieve your goal.

Regards,

Wang Rui


2012/8/21 Peter Bako osgfo...@tevs.eu

 Hi mr. Wang Rui.

 Thank you for your response. I am actually an owner of your OSG book :-).
 I tried your suggestion, it works, but the limitation is that we can have
 only 2 versions of osgb files (old format - with the schema) and the new
 (actual format).
 Does this mean that there is no way to make more versions readable for my
 application? For example, could we generate schema for every version and
 try to load the file with the schema from the oldest version, if not
 succeed, then with the newer version, then with newer and so on until the
 load is successful (loaded component is not NULL).
 I don't see under the hood of binary serialization, I couldn't find the
 correct file.

 I need this functionality because I know, that my application will grow
 after release and maybe we will need to change the serialization after the
 release to the customers.
 Do you have any other idea to make this possible?

 Thank you once more!

 Cheers,
 Peter

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=49376#49376





 ___
 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] OSG Serialization - changes on custom Classes

2012-08-20 Thread Peter Bako
Hello guys,

I am using OSG serialization on my custom classes derived from 
osg::MatrixTransform and osg::Geometry.
I already use this serialization for some time, so I have many .osgb files 
exported on my disk, but now, I want to add some new properties to my Class and 
serialize them (new ADD_BOOL_SERIALIZER). The problem is, that I cannot load 
the old .osgb files anymore. It works only on .osgt files.
Is there any way, how to extend my serialization, while the old files will be 
still loadable?

Thank you!

Cheers,
Peter

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=49338#49338





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OSG Serialization - changes on custom Classes

2012-08-20 Thread Wang Rui
Hi Peter,

Yes, there is a schema mechanism in the osg plugin which could record a
serializer name list (a schema) at the beginning of every .osgb file and
the reader will automatically check and read the schema to decide each
serializer order and existence.

For your situation, the best way I think is to generate a schema file first
using the option:
writeNodeFile(*node, file.osgb, new
osgDB::Options(SchemaFile=old_version_format.txt));

This could be done only once when you save a .osgb file. Note that the
schema file should be created with the old version of plugin.

And then you may read all old .osgb files with the new version of plugin,
using the same option:
readNodeFile(file.osgb, new
osgDB::Options(SchemaFile=old_version_format.txt));

And the schema will be used to load old version files correctly.

Wang Rui


2012/8/20 Peter Bako osgfo...@tevs.eu

 Hello guys,

 I am using OSG serialization on my custom classes derived from
 osg::MatrixTransform and osg::Geometry.
 I already use this serialization for some time, so I have many .osgb files
 exported on my disk, but now, I want to add some new properties to my Class
 and serialize them (new ADD_BOOL_SERIALIZER). The problem is, that I cannot
 load the old .osgb files anymore. It works only on .osgt files.
 Is there any way, how to extend my serialization, while the old files will
 be still loadable?

 Thank you!

 Cheers,
 Peter

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=49338#49338





 ___
 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