Expose reloading Canvas placements
This commit is contained in:
parent
235c29913a
commit
5dea221ad5
@ -168,11 +168,7 @@ namespace canvas
|
||||
{
|
||||
// Resizing causes a new texture to be created so we need to reapply all
|
||||
// existing placements
|
||||
for(size_t i = 0; i < _placements.size(); ++i)
|
||||
{
|
||||
if( !_placements[i].empty() )
|
||||
_dirty_placements.push_back( _placements[i].front()->getProps() );
|
||||
}
|
||||
reloadPlacements();
|
||||
}
|
||||
|
||||
osg::Camera* camera = _texture.getCamera();
|
||||
@ -491,6 +487,24 @@ namespace canvas
|
||||
return _cull_callback;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
void Canvas::reloadPlacements(const std::string& type)
|
||||
{
|
||||
for(size_t i = 0; i < _placements.size(); ++i)
|
||||
{
|
||||
if( _placements[i].empty() )
|
||||
continue;
|
||||
|
||||
SGPropertyNode* child = _placements[i].front()->getProps();
|
||||
if( type.empty()
|
||||
// reload if type matches or no type specified
|
||||
|| child->getStringValue("type", type.c_str()) == type )
|
||||
{
|
||||
_dirty_placements.push_back(child);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
void Canvas::addPlacementFactory( const std::string& type,
|
||||
PlacementFactory factory )
|
||||
|
@ -130,6 +130,7 @@ namespace canvas
|
||||
|
||||
CullCallbackPtr getCullCallback() const;
|
||||
|
||||
void reloadPlacements( const std::string& type = std::string() );
|
||||
static void addPlacementFactory( const std::string& type,
|
||||
PlacementFactory factory );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user