Layer Visibility

Layer visibility indicates whether the objects within a certain layer should be visible to the user. This notion of layer visibility is not as simple as it seems because a layer can be hidden in several different ways:

  • Globally - Hidden in all the manager views.

  • Locally - Hidden in one or several manager views.

  • Contextually - Hidden by an application visibility filter.

A layer is displayed in a view if it is not hidden in any of these ways.

Global Visibility

If a layer is hidden globally, it will not be displayed in any of the manager views. The following IlvManager member functions allow you to get or set the global visibility of a layer:

  • setVisible (int layer, IlBoolean val)

  • isVisible (int layer)

Local Visibility

Use the following IlvManager member functions to get or set the visibility of a layer for a given manager view:

  • setVisible (const IlvView* view, int layer, IlBoolean visible)

  • isVisible (const IlvView* view, int layer)

Visibility Filter

IlvLayerVisibilityFilter is an abstract class. Subclasses must redefine the virtual member function isVisible to return the visibility status of the layer.

Each manager layer handles a list of visibility filters. When a layer must be drawn in a view, the manager calls the member function isVisible for all the filters of the layer; if a visibility filter returns IlFalse, the layer is not displayed. This mechanism only allows the application to hide layers that would be otherwise visible; it does not allow you to show hidden layers.

To add a visibility filter to a layer, use addVisibilityFilter.