I'll preempt Robert's reply by telling you that the purpose of clone() is to permit cloning an object of unknown type. With the changes you have made, the following code will fail:
Object* a = new Transform(); Transform* b = dynamic_cast<Transform*>(a->clone()); assert(b); -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of ??????? ????? Sent: 06 June 2008 13:25 To: [email protected] Subject: [osg-submissions] osg::Object::clone Hi, Robert! I suggest to you to override type of returning value in realizations of functions osg::Object::clone and osg::Object::cloneType in derived classes. In this case one will be able to write simply "osg::Transform* sTrans = sExistentTrans->clone();" instead of "osg::Transform* sTrans = dynamic_cast<osg::Transform*>(sExistentTrans->clone());". It is very simple to realize such behavior, three changed files are attached in archive, changes are based on revision 8416. Best regards, Valery ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email ______________________________________________________________________ ______________________________________________________________________ This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email ______________________________________________________________________ _______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
