Hi, > Hi, > > I'm trying to use the Terrain class (from libOSGContrib) in a cluster > environment. I wrote a small test program, derived from > 13ClusterClient.cpp > and testTerrain.cpp, which runs fine in a stand-alone version (i.e. in a > GLUTWindow). However, when I run it in a MultiDisplayWindow, the > ClusterServer (unchanged 12ClusterServer), the cluster server crashes. > > Here is what I found to be the reason for the crash: > Terrain::changed gets called by RemoteAspect::receiveSync before all > fields of > the Terrain object are received (Terrain::_sfHeightData, which should > point > to the Image containing the height data, points to a fresh instance of > Image > that has a size of 0 and was not yet filled with data). Since the Terrain > class computes its mesh from the height field Image in the > Terrain::changed > method, and the Image data is not there, it crashes. The same problem > occurs > when I write the Terrain node to a BIN file and try to load it from this > BIN > file again. > > What surprises me when I trace the serialization process in a debugger is > that > in _sfHeightData.copyToBin (called from TerrainBase::copyToBin), only an > ID > for the height data Image is written to the stream, but no image data. As > far > as I understand the process (maybe I'm wrong, I'm quite new to OpenSG), > the > ID just identifies the Image object that _sfHeightData points to, so the > receiver of the stream can create a pointer to the equivalent Image object > on > its side. However, the actual Image object seems to get serialized after > the > Terrain object, so at the time the Terrain object gets instantiated by the > receiver, the data of the Image object is not there. > > Can I somehow force the Image object to get serialized before the Terrain > object, or am I wrong about the problem? Any hints on displaying a Terrain > object on a cluster server would be appreciated. >
This is a conceptual bug in current OpenSG and it will be fixed in 2.0. You can try to call beginEditCP(image) before calling beginEditCP(terrain). The Problem is that changed is called whenn all field changes of a single container are done. But this only means that the image points to the rigth image. The contents of the image can be filled earlier or later. Marcus ------------------------------------------------------- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today Register for a JBoss Training Course. Free Certification Exam for All Training Attendees Through End of 2005. For more info visit: http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click _______________________________________________ Opensg-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensg-users
