Layers may be group in layer containers (LayerContainer). Each Layer belongs to a single LayerContainer, accessible via the method Layer::Container. A layer container maintains a hierarchy of parent-child relationships between layers.
To change which container a layer belongs to is done through the layer container methods.
A layer container can also be used to create layers via the LayerContainer::CreateLayer() method.
Texture Pools and Layer Containers
A TexturePool may be converted to a LayerContainer and vice versa:
LayerContainer* TexturePoolToLayerContainer(TexturePool* tp) {
Node* n = tp;
return dynamic_cast<LayerContainer*>(n);
}
TexturePool* LayerContainerToTexturePool(LayerContainer* lc) {
Node* n = lc;
return dynamic_cast<TexturePool*>(n);
}