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
|
// Resizing causes a new texture to be created so we need to reapply all
|
||||||
// existing placements
|
// existing placements
|
||||||
for(size_t i = 0; i < _placements.size(); ++i)
|
reloadPlacements();
|
||||||
{
|
|
||||||
if( !_placements[i].empty() )
|
|
||||||
_dirty_placements.push_back( _placements[i].front()->getProps() );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
osg::Camera* camera = _texture.getCamera();
|
osg::Camera* camera = _texture.getCamera();
|
||||||
@ -491,6 +487,24 @@ namespace canvas
|
|||||||
return _cull_callback;
|
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,
|
void Canvas::addPlacementFactory( const std::string& type,
|
||||||
PlacementFactory factory )
|
PlacementFactory factory )
|
||||||
|
@ -130,6 +130,7 @@ namespace canvas
|
|||||||
|
|
||||||
CullCallbackPtr getCullCallback() const;
|
CullCallbackPtr getCullCallback() const;
|
||||||
|
|
||||||
|
void reloadPlacements( const std::string& type = std::string() );
|
||||||
static void addPlacementFactory( const std::string& type,
|
static void addPlacementFactory( const std::string& type,
|
||||||
PlacementFactory factory );
|
PlacementFactory factory );
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user