+ //----------------------------------------------------------------------------
+ bool Group::setStyle(const SGPropertyNode* style)
+ {
+ // Don't propagate styles directly applicable to this group
+ if( Element::setStyle(style) )
+ return true;
+
+ if( style->getParent() != _node
+ && _style.find(style->getNameString()) != _style.end() )
+ return false;
+
+ bool handled = false;
+ BOOST_FOREACH( ChildList::value_type child, _children )
+ {
+ if( child.second->setStyle(style) )
+ handled = true;
+ }
+
+ return handled;
+ }
+
+ //----------------------------------------------------------------------------
+ osg::BoundingBox Group::getTransformedBounds(const osg::Matrix& m) const
+ {
+ osg::BoundingBox bb;
+
+ BOOST_FOREACH( ChildList::value_type child, _children )
+ {
+ if( !child.second->getMatrixTransform()->getNodeMask() )
+ continue;
+
+ bb.expandBy
+ (
+ child.second->getTransformedBounds
+ (
+ child.second->getMatrixTransform()->getMatrix() * m
+ )
+ );
+ }
+
+ return bb;
+ }
+