Hi,

I'm trying to reconstruct the scenegraph tree (graph) from the
osgIntrospection information, and I'm having some problems with arrays
and maps, as they are duplicated, or introduce a lot of unnecesary?
indirection levels.
For example, for the Geodes, this is the output of osgintrospection
sample program:

osg::Geode
        derived from: osg::Node
        * public methods:
            [...]
        * properties:
            {G   }  BoundingBox (const osg::BoundingBox &)
            {GSCA}  Drawable (osg::Drawable *)   [ARRAY]
            {G   }  DrawableList (const std::vector< osg::ref_ptr<
osg::Drawable > > &)
            { S  }  ThreadSafeRefUnref (bool)

As you can see, there are two paths to get the drawables of a geode
(Drawable and DrawableList properties). It happens with other things,
like the clipping planes of osg::ClipNode, the primitiveSets of
osg::Geometry,  the positions of osg::Billboard and the texture modes of
osg::StateSet. It doesn't happen in the osg::Group with the children,
though.

Is this really necessary? Or could one of the paths be removed? I would
like to keep the ARRAY path and remove the other one, the ARRAY fits
better with the reflection API.

For another part, the StateSet reflection is too much complicated. To
get the state attributes I must navigate through 4 objects:

*** osg::StateSet
        derived from: osg::Object
        * properties:
            {GS  }  AttributeList (std::map<
osg::StateAttribute::TypeMemberPair, osg::StateSet::RefAttributePair >
&)
            [...]

*** std::map< osg::StateAttribute::TypeMemberPair,
osg::StateSet::RefAttributePair >
        * properties:
            {GS  }  Item (std::pair< osg::ref_ptr< osg::StateAttribute
>, osg::StateAttribute::OverrideValue >)   [INDEXED]
                        [...]

*** std::pair< osg::ref_ptr< osg::StateAttribute >,
osg::StateAttribute::OverrideValue >
        * properties:
            {GS  }  first (osg::ref_ptr< osg::StateAttribute >)
            {GS  }  second (unsigned int)

*** osg::ref_ptr< osg::StateAttribute >
        * properties:
            {G   }   (osg::StateAttribute *)

I think that the first "AttributeList" property should be directly
indexed, and the "first" attribute of the std::pair... should be a
pointer, this would remove two levels of indirection. Is this possible?
Can something similar be applied to the texture attributes also? They
have two more indirection levels for the texture units when only one
more should be needed :(

Thanks in advance.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to