LuciadCPillar C# 2024.0.08
Luciad.Layers.LayerList Class Reference

Represents an ordered list of layers. More...

Inheritance diagram for Luciad.Layers.LayerList:

Public Member Functions

 LayerList ()
 Constructs an empty layer list. More...
 
void Add (Luciad.Layers.Layer layer)
 Adds the given layer to this layer list. More...
 
void Add (Luciad.Layers.Layer layer, uint targetIndex)
 Adds the given layer to this layer list. More...
 
void AddObserver (Luciad.Layers.ILayerListObserver observer, bool seedObserver=false)
 Adds an observer to be notified of changes to this layer list. More...
 
void Dispose ()
 
Luciad.Layers.Layer FindLayerById (ulong layerId)
 Searches for the layer with a provided id in the layer list. More...
 
void Move (ulong layerId, uint targetIndex)
 Moves the layer with the given id to the target index. More...
 
void Remove (ulong layerId)
 Removes the layer with the given id. More...
 
void RemoveObserver (Luciad.Layers.ILayerListObserver observer)
 Removes the given observer. More...
 

Properties

System.Collections.Generic.IList< Luciad.Layers.LayerLayers [get]
 The vector that represents the ordering of all layers in this layer list. More...
 

Detailed Description

Represents an ordered list of layers.

The order within this list determines the order in which layers are painted.

Note that this class tracks on which thread it is constructed. This is done so that, in subsequent calls, it can verify that the same threads are used consistently. When an inconsistency is detected, an assertion is triggered. This means that all functions on LayerList must be called on the thread on which the Map was constructed (the "UI" thread). The only exception is adding and removing observers. Related article: Threading rules for the Map

Constructor & Destructor Documentation

◆ LayerList()

Luciad.Layers.LayerList.LayerList ( )
inline

Constructs an empty layer list.

Member Function Documentation

◆ Add() [1/2]

void Luciad.Layers.LayerList.Add ( Luciad.Layers.Layer  layer)
inline

Adds the given layer to this layer list.

Parameters
layera layer
Exceptions
System.ArgumentExceptionwhen the layer has already been added.
System.ArgumentNullExceptionwhen the layer is null.

◆ Add() [2/2]

void Luciad.Layers.LayerList.Add ( Luciad.Layers.Layer  layer,
uint  targetIndex 
)
inline

Adds the given layer to this layer list.

Parameters
layera layer
targetIndexthe index at which to add the layer
Exceptions
System.ArgumentExceptionexception when the layer has already been added or when the target index is not in range.
System.ArgumentNullExceptionwhen the layer is null.

◆ AddObserver()

void Luciad.Layers.LayerList.AddObserver ( Luciad.Layers.ILayerListObserver  observer,
bool  seedObserver = false 
)
inline

Adds an observer to be notified of changes to this layer list.

Adding the same observer twice is forbidden, and will cause an exception to be thrown.

Parameters
observeran observer, must not be null
seedObserverwhether to inform the observer about the layers that are currently present
Exceptions
System.ArgumentExceptionwhen the observer was already added.
System.ArgumentNullExceptionwhen the observer is null.

◆ Dispose()

void Luciad.Layers.LayerList.Dispose ( )
inline

◆ FindLayerById()

Luciad.Layers.Layer Luciad.Layers.LayerList.FindLayerById ( ulong  layerId)
inline

Searches for the layer with a provided id in the layer list.

Parameters
layerIda layer id
Returns
the layer that corresponds with the given id, or null.

◆ Move()

void Luciad.Layers.LayerList.Move ( ulong  layerId,
uint  targetIndex 
)
inline

Moves the layer with the given id to the target index.

Parameters
layerIdthe id of the layer to move
targetIndexa target index
Exceptions
System.ArgumentExceptionwhen this LayerList does not contain a layer with the given id or when the target index is not in range

◆ Remove()

void Luciad.Layers.LayerList.Remove ( ulong  layerId)
inline

Removes the layer with the given id.

Parameters
layerIdthe id of the layer to remove
Exceptions
System.ArgumentExceptionwhen this LayerList does not contain a layer with the given id

◆ RemoveObserver()

void Luciad.Layers.LayerList.RemoveObserver ( Luciad.Layers.ILayerListObserver  observer)
inline

Removes the given observer.

If the given observer was never added, an exception is thrown.

Parameters
observeran observer, must not be null
Exceptions
System.ArgumentExceptionwhen the observer is not known.
System.ArgumentNullExceptionwhen the observer is null.

Property Documentation

◆ Layers

System.Collections.Generic.IList<Luciad.Layers.Layer> Luciad.Layers.LayerList.Layers
get

The vector that represents the ordering of all layers in this layer list.

[get]

Returns the vector that represents the ordering of all layers in this layer list. The order is defined as bottom-to-top. This means that the first layer in this vector is painted first (and appears at the bottom), and that the last layer of this vector is painted last (and appears at the top).