Canvas: allow removing placement factories.
This commit is contained in:
parent
01ace109ba
commit
6fe1433497
@ -588,12 +588,27 @@ namespace canvas
|
|||||||
(
|
(
|
||||||
SG_GENERAL,
|
SG_GENERAL,
|
||||||
SG_WARN,
|
SG_WARN,
|
||||||
"Canvas::addPlacementFactory: replace existing factor for type " << type
|
"Canvas::addPlacementFactory: replace existing factory '" << type << "'"
|
||||||
);
|
);
|
||||||
|
|
||||||
_placement_factories[type] = factory;
|
_placement_factories[type] = factory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
void Canvas::removePlacementFactory(const std::string& type)
|
||||||
|
{
|
||||||
|
PlacementFactoryMap::iterator it = _placement_factories.find(type);
|
||||||
|
if( it == _placement_factories.end() )
|
||||||
|
SG_LOG
|
||||||
|
(
|
||||||
|
SG_GENERAL,
|
||||||
|
SG_WARN,
|
||||||
|
"Canvas::removePlacementFactory: no such factory '" << type << "'"
|
||||||
|
);
|
||||||
|
else
|
||||||
|
_placement_factories.erase(it);
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void Canvas::setSelf(const PropertyBasedElementPtr& self)
|
void Canvas::setSelf(const PropertyBasedElementPtr& self)
|
||||||
{
|
{
|
||||||
|
@ -162,6 +162,7 @@ namespace canvas
|
|||||||
void reloadPlacements( const std::string& type = std::string() );
|
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 );
|
||||||
|
static void removePlacementFactory(const std::string& type);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user