Rayan,
I've found that the user data is very handy for searching for a scenegraph
objects that correspond to objects in your class design.
I.e. class MyShape may create a Shape3D object and add it to the scenegraph
and store its "this" pointer in the user data...
Later when you iterate through the children of a group looking for a MyShape
object you can compare the MyShape's this pointer with the user data stored
in the scenegraph object to retrieve the correct scenegraph object from the
group. This is particulary relevant as you can only remove group objects by
INDEX, so you have to find the index for an object in a group in a robust
manner.
Hope that helps,
Daniel Selman
Tornado Labs Ltd.
Email: [EMAIL PROTECTED]
Web: www.tornadolabs.com
Phone: +44 (0131) 343 2513
Fax: +44 07070 800 483
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Rayan
Jreije
Sent: 24 February 1999 10:11
To: Java 3D Interest Group (E-mail)
Subject: [java3d] ScenegraphObject.setUserData()?
In general,
what is the main use of user data?
What was the intention behind providing such a field?
is it right to use it to point to other Non Java3D geometric Objects?
Thanks And regards.
Rayan Jreije (Ms Eng)
Consolidated Contractors Int'l Company
Kiffisias 62B, Amaroussion 15110
Athens, Greece
Tel +30-16 182 132
Fax +30-16 182 199
Cell +30-932-415158
=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 3D Home Page: http://java.sun.com/products/java-media/3D/
=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 3D Home Page: http://java.sun.com/products/java-media/3D/