Hi Marcus,
On Tue, 2005-04-19 at 10:12 +0200, Marcus Lindblom wrote:
> Dirk Reiners wrote:
> > if(node->getCore()->getType().isDerivedFrom(Geometry::getClassType()))
> > {
> > GeometryPtr g = GeometryPtr::dcast(node->getCore());
> >
> > doMaterial(g->getMaterial());
> > }
>
> Just a small thought w.r.t. the above code. Since FCPtr<>::dcast does a
> dynamic_cast<>, which essentially is a 'isDerivedFrom' check, whouldn't
> it be more efficient just ot use that and see if g is NullFC or not?
>
> (Or is it not right to do so?)
That's fine to do. I took this from an example that I wrote for the
different ways to check inheritance, but either way works fine.
Dirk
--
-- Dirk Reiners OpenSG Forum [EMAIL PROTECTED]
-- The OpenSG Open Source Scenegraph: http://www.opensg.org
-- Join the list at http://lists.sf.net/lists/listinfo/opensg-users
-------------------------------------------------------
This SF.Net email is sponsored by: New Crystal Reports XI.
Version 11 adds new functionality designed to reduce time involved in
creating, integrating, and deploying reporting solutions. Free runtime info,
new features, or free trial, at: http://www.businessobjects.com/devxi/728
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users