OpenSceneGraph/include
Robert Osfield c80313ccd0 From David Callu,
"
Found in the join file the fix for the bug found by Rafa.


    Problem :

        osgIntrospection::Value grp(new osg::Group);

        osgIntrospection::ValueList vlcall;
        vlcall.push_back(osgIntrospection::Value("toto"));

       const osgIntrospection::MethodInfo *m =
grp->getType.getCompatibleMethod("setName", vlcall, true);

       if (m)
       {
            m->invoke(grp, vlcall);      // ** SEGFAULT here
       }





    Algorithm explanation :

          The "invoke" method try to convert "grp", which reflect an
"osg::Group*", in a
          "osgIntrospection::Value", which reflect a "osg::Node*".
This because
          the "setName(const char *)" method found by
"grp->getType.getCompatibleMethod"
          is an "osg::Object" type method.

          When osgIntrospection do this conversion it try :
             - to found a "osgIntrospection::Converter"  to convert
               from "osg::Group*" to "osg::Node*"
             - to found a chain of "osgIntrospection::Converter" to convert
               from "osg::Group*" to "one or many type" to "osg::Node*"
             - to converte an Enum to int or unsigned int
             - to convert the value in its "value string representation",
               then converte this string in the destination value

          Else it throw a "TypeConversionException".







     Bug :

          1)
          When osgIntrospection try to found a chain of
"osgIntrospection::Converter"
          It could do any downcast or (Type to SuperType) or upcast
(SuperType to Type).
          This mean the the chain could be :
          osg::Group to osg::Transform to osg::Camera to
          osg::CullSettings to osg::CullStack to
osg::CollectOccludersVisitor to
          osg::NodeVisitor to osg::Referenced to osg::Object

         During the convertion with this chain, A METTRE failed and
the pointer in
         "grp" is set NULL. But the "grp" is always a valid
"osgIntrospection::Value"
         and so, osgIntrospection accept the conversion. Then it try
to use this pointer
         to call the "setName" function. And Bing SEGFAULT.


         2)
             In "bool Reflection::accum_conv_path( ... )"
             the convection path isn't accumulate in the recursive loop.
             this cause multi request of a conversion path, and a
slowdown in the
             conversion algorithm.

         3)
             Use of the last conversion way in a conversion from
pointer to pointer
             this mean you can do this :
             "osg::Node*" to " value string representation" to "osg::Material*"
             What a bad thing !!!




    Solution :

         1)
          Introduce the concept of dynamic_cast and static_cast.
          now, to do a conversion, osgIntrospection does this :

             - to found a "osgIntrospection::Converter"  to convert
               from "osg::Group*" to "osg::Node*"
             - to found a chain of "osgIntrospection::Converter" to convert
               from "osg::Group*" to "one or many type" to "osg::Node*"
               only with static_cast, downcast (Type to SuperType)

             - to found, if the source and the destination are two pointer,
               a chain of "osgIntrospection::Converter" to convert
               from "osg::Group*" to "one or many type" to "osg::Node*"
               only with dynamic_cast, upcast (SuperType to Type)

             - to convert an Enum to int or to unsigned int
             - to convert the value in its "value string representation",
               then convert this string in the destination value

          Else it throw a "TypeConversionException".


          Add the "enum CastType" to distinguish the static_cast or
dynamic_cast converter.
          Add file OpenSceneGraph/include/osgIntrospection/CastType

         2)
         add a line to accumulate converter in converter Path.

         3)
         add a line to check if source and destination are pointer.
"
2007-06-30 14:21:34 +00:00
..
osg Added Point::Extension::isPointSpriteCoordOriginSupported() method 2007-06-29 17:01:37 +00:00
osgDB From Paul Melis, "Here is a list of fixes to misspelled APIs. Unfortunately, more than one 2007-06-27 20:36:16 +00:00
osgFX Updated copyright years. 2006-07-18 15:21:48 +00:00
osgGA From Rafa Giatan and Robert Osfield, added support for User defined events, by adding 2007-05-19 13:39:55 +00:00
osgIntrospection From David Callu, 2007-06-30 14:21:34 +00:00
osgManipulator Change interator to const_iterator to try and avoid Solaris build failure 2007-06-05 14:37:55 +00:00
osgParticle From Paul Melis, "Here is a list of fixes to misspelled APIs. Unfortunately, more than one 2007-06-27 20:36:16 +00:00
osgShadow From Paul Melis, "Here is a list of fixes to misspelled APIs. Unfortunately, more than one 2007-06-27 20:36:16 +00:00
osgSim Fixed namespace 2007-06-15 16:08:33 +00:00
osgTerrain From Paul Melis, "Here is a list of fixes to misspelled APIs. Unfortunately, more than one 2007-06-27 20:36:16 +00:00
osgText From Paul Melis, "Here is a list of fixes to misspelled APIs. Unfortunately, more than one 2007-06-27 20:36:16 +00:00
osgUtil Addded missing namespace 2007-06-15 08:36:35 +00:00
osgViewer From Stephan Huber, "attached you'll find a first implementation of pbuffer-support for os x. 2007-06-27 20:44:12 +00:00