Constructs a new stencil buffer manager.
Note: This class is only intended to be constructed by a viewer.
The viewer for this manager.
Fetches a stencil buffer for the last rendered frame. Returns undefined
if the last frame does not have stencil information.
Returns a promise that resolves with the last generated stencil buffer, or fetches a new stencil buffer if the frame has changed since the last stencil buffer was fetched. Because the stencil buffer is cached by the manager, this method can be called multiple times without performing a network request.
StencilBufferManager.latestAfterInteraction to wait for requesting a stencil buffer after an interaction has finished.
Returns a promise that resolves with the latest stencil buffer, once any interaction is being performed. If no interaction is being performed, then the promise will resolve immediately with the latest stencil buffer.
This method is useful for components to fetch the most up-to-date stencil buffer. Because the stencil buffer is cached by the manager, components can call this method multiple times without performing a network request.
StencilBufferManager.latest - used internally by this method.
The
StencilBufferManagermanages the stencil buffer state for the viewer. Stencil buffers are represented as images and contain additional information related to the rendered frame. Examples of information contained within a stencil buffer include: cross section and feature edge positions.This class contains methods for fetching a stencil buffer for the currently rendered frame, as well as helpers that components can use to get an up-to-date stencil buffer after any interactions are performed.