RE: [Plib-devel] RE: Model Formats
Brought to you by:
sjbaker
From: Vallevand, M. K <Mar...@UN...> - 2000-07-11 15:48:27
|
Good. I couldn't believe that it wouldn't work, but couldn't see how it was done. Regards. Mark K Vallevand ma...@rs... Outside of a dog, a book is man's best friend. Inside of a dog, its too dark to read. - Groucho > > "Vallevand, Mark K" wrote: > > > > I was looking at the SSG code for save and load. It looks > like object > > that are in the scene graph more than once are written more > that once. > > So, when the load is done, one object becomes many. > > I don't think so. > > Check out line 309 or so of plib/src/ssg/ssgBranch.cxx, > it uses the 'spare' field of the database node (which is > re-used for all sorts of short-term tree-walking kinds of > things). As a node is written out, we set the spare field > to a consecutively incrementing non-zero value. When we > try to write it out the second time, the ssgBranch code > notices that the spare field is non-zero and instead > writes out a special 'BACKWARDS REFERENCE' node that > contains the 'spare' value. > > When the model is reloaded, we build an ssgList of all > the entities that are loaded - if we see a 'BACKWARDS REFERENCE' > node - then we just link to the entry in the table pointed > to by that 'spare' field. > > This same mechanism is used to save writing out the same > ssgState many times...and possibly other node types also. > > > Is this correct, or am I dropping bits in my memory? > > I *hope* you are incorrect - I went to some trouble to > ensure that things wouldn't be written out more than once. > > If this isn't working for you, please send me a concrete > example of it failing. > > -- > Steve Baker HomeEmail: <sjb...@ai...> > WorkEmail: <sj...@li...> > HomePage : http://web2.airmail.net/sjbaker1 > Projects : http://plib.sourceforge.net > http://tuxaqfh.sourceforge.net > http://tuxkart.sourceforge.net > http://prettypoly.sourceforge.net > > > > _______________________________________________ > plib-devel mailing list > pli...@li... > http://lists.sourceforge.net/mailman/listinfo/plib-devel > |