|
From: Braden M. <br...@us...> - 2006-02-16 21:30:57
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5727/src/libopenvrml/openvrml Modified Files: script.cpp Log Message: Use boost::polymorphic_downcast where appropriate. Index: script.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/script.cpp,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** script.cpp 12 Feb 2006 09:40:17 -0000 1.63 --- script.cpp 16 Feb 2006 21:30:50 -0000 1.64 *************** *** 423,434 **** OPENVRML_THROW2(std::bad_alloc, std::bad_cast) { if (this->value_->type() == field_value::sfnode_id) { this->node_ ! .assign_with_self_ref_check(dynamic_cast<const sfnode &>(val), ! static_cast<sfnode &>(*this->value_)); } else if (this->value_->type() == field_value::mfnode_id) { this->node_ ! .assign_with_self_ref_check(dynamic_cast<const mfnode &>(val), ! static_cast<mfnode &>(*this->value_)); [...2731 lines suppressed...] ! &arg_sfdata.field_value()); assert(JS_GetPrivate(cx, obj)); *************** *** 10842,10848 **** sfield::sfdata & robj_sfdata = *static_cast<sfield::sfdata *>(JS_GetPrivate(cx, robj)); - assert(dynamic_cast<openvrml::sfvec3f *>(&robj_sfdata.field_value())); openvrml::sfvec3f & resultVec = ! static_cast<openvrml::sfvec3f &>(robj_sfdata.field_value()); resultVec.value(thisMat * argVec.value()); --- 10863,10869 ---- sfield::sfdata & robj_sfdata = *static_cast<sfield::sfdata *>(JS_GetPrivate(cx, robj)); openvrml::sfvec3f & resultVec = ! *boost::polymorphic_downcast<openvrml::sfvec3f *>( ! &robj_sfdata.field_value()); resultVec.value(thisMat * argVec.value()); |