typedef osg::ref_ptr<osgText::Font> FontPtr;
typedef std::vector<PlacementPtr> Placements;
- typedef boost::function<Placements( const SGPropertyNode*,
+ typedef boost::function<Placements( SGPropertyNode*,
CanvasPtr )> PlacementFactory;
} // namespace canvas
}
void
-SGPropertyNode::fireCreatedRecursive()
+SGPropertyNode::fireCreatedRecursive(bool fire_self)
{
- _parent->fireChildAdded(this);
+ if( fire_self )
+ {
+ _parent->fireChildAdded(this);
- if( _children.empty() && getType() != simgear::props::NONE )
- return fireValueChanged();
+ if( _children.empty() && getType() != simgear::props::NONE )
+ return fireValueChanged();
+ }
for(size_t i = 0; i < _children.size(); ++i)
- _children[i]->fireCreatedRecursive();
+ _children[i]->fireCreatedRecursive(true);
}
void
/**
* Trigger a child-added and value-changed event for every child (Unlimited
- * depth) and the node itself.
+ * depth).
+ *
+ * @param fire_self Whether to trigger the events also for the node itself.
*
* It can be used to simulating the creation of a property tree, eg. for
* (re)initializing a subsystem which is controlled through the property tree.
*/
- void fireCreatedRecursive();
+ void fireCreatedRecursive(bool fire_self = false);
/**
* Fire a child-removed event to all listeners.