Hello Johannes,
Johannes Brunen wrote:
> I have the following problem. Currently I'm porting an application from
> OpenSG 1.8 to OpenSG 2.0. Simuntanously, I'm bringing it into a 64Bit
> compatible state.
>
> Now I have encountered the case, that I have once written an Attachement
> derived class which just holds an multi field of type UInt32. You may
> expecting it already, this field contains application specific pointer
> information. I should have gone with an UInt64 multi field in the first
> place and would now not ask this question.
> Is there any possibilty to change this class so that is uses UInt64
> instead of UInt32 for the multi field?
> Is there any versioning mechanism I could use so that I could read old
> models written with the UInt32 implementation without corrupting the
> stream?
>
> I know that I could clean the situation by introducing a new Attachment
> derived class and convert my old models after reading. But I would like
> to go for a solution intrinsic to the already established class.
you can extend the OSB loader to have some special handling of old
classes instead of just using the default code path for your attachment.
We use this for example to convert TextureChunk to a pair of
TextureObjChunk and TextureEnvChunk.
One thing that is a bit tricky about the OSB loader is the way pointers
are stored/handled. On disc a pointer is stored as the id of the
pointed-to container, when loading a map between on-disc ids and system
ids is built and for each pointer field a data structure with the on
disc ids is filled. After loading the on disc ids are resolved to system
ids and the pointer fields of the containers are filled with the correct
values.
Please let me know if you need more info on the OSB loader and/or how to
extend it to handle your case.
Cheers,
Carsten
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users