LuciadCPillar 2026.1.02
Loading...
Searching...
No Matches
luciad::IProjectedImageryModel Class Referenceabstract

Model interface for projected imagery: single images, live video, and 360-degree panoramas. More...

#include <luciad/models/projectedimagery/IProjectedImageryModel.h>

Inheritance diagram for luciad::IProjectedImageryModel:
luciad::Model luciad::PanoramaModel luciad::ProjectedVideoModel

Public Member Functions

virtual void addObserver (std::shared_ptr< IProjectedImageryModelObserver > observer)=0
 Registers an observer that will be notified of changes to this model.
virtual std::vector< std::shared_ptr< ProjectedImagery > > getProjections () const =0
 Returns the projections held by this model.
virtual luciad::expected< ProjectionTileQueryResult, ErrorInfo > queryTile (const std::string &projectionId, const ProjectionTileCoordinate &tile, const CancellationToken &cancellationToken) const =0
 Queries a single tile of a single projection.
virtual void removeObserver (const std::shared_ptr< IProjectedImageryModelObserver > &observer)=0
 Unregisters a previously added observer.
Public Member Functions inherited from luciad::Model
virtual ~Model ()=default
virtual ModelMetadata getModelMetadata () const =0
 Returns the meta data for this model.
virtual std::shared_ptr< Bounds > queryBounds () const =0
 Returns the bounds of this model, if available.

Detailed Description

Model interface for projected imagery: single images, live video, and 360-degree panoramas.

A model exposes a set of posed projections and serves their tiles on request. A single access pattern covers every case. The layer lists the projections, requests the tiles it needs, and reacts to change notifications:

Implement this interface to supply projected imagery to a luciad::ProjectedImageryLayer, or obtain an implementation from a decoder.

Thread safety is the responsibility of the implementer. queryTile must be thread-safe: LuciadCPillar may call it from any thread. Typically, it will be called on a background thread for initial tile loads, and on the render thread when a projection is invalidated (see luciad::IProjectedImageryModelObserver::onImageryInvalidated), for example for every video frame. It is also recommended to make addObserver / removeObserver thread-safe so that the layer can safely subscribe and unsubscribe from any thread.

Related article: Projecting images, video and panoramas onto the map

Since
2026.1

Member Function Documentation

◆ addObserver()

virtual void luciad::IProjectedImageryModel::addObserver ( std::shared_ptr< IProjectedImageryModelObserver > observer)
pure virtual

Registers an observer that will be notified of changes to this model.

Parameters
observerthe observer to add. Must not be nullptr.

Implemented in luciad::PanoramaModel, and luciad::ProjectedVideoModel.

◆ getProjections()

virtual std::vector< std::shared_ptr< ProjectedImagery > > luciad::IProjectedImageryModel::getProjections ( ) const
pure virtual

Returns the projections held by this model.

Returns
the projections.

Implemented in luciad::PanoramaModel, and luciad::ProjectedVideoModel.

◆ queryTile()

virtual luciad::expected< ProjectionTileQueryResult, ErrorInfo > luciad::IProjectedImageryModel::queryTile ( const std::string & projectionId,
const ProjectionTileCoordinate & tile,
const CancellationToken & cancellationToken ) const
pure virtual

Queries a single tile of a single projection.

This method must be thread-safe. It may be called on a background thread, for example for an initial tile load, but also on the render thread, for example when a projection is invalidated. A projection that fires luciad::IProjectedImageryModelObserver::onImageryInvalidated must serve its tiles cheaply and synchronously. Honor the cancellation token for long-running work.

The possible outcomes are not interchangeable, because each one decides whether the tile is ever requested again:

  • A result holding an image supplies the tile.
  • A result without an image means the tile does not exist, and that tile is not requested again.
  • A failed retrieval also stops the tile from being requested again.
  • A canceled request is the only outcome that leaves the tile eligible for a later request.

    Report a canceled request as an ErrorInfo object with the error code Canceled. Any other error code counts as a failed retrieval, after which the tile is never requested again.

Parameters
projectionIdthe identifier of the projection, as returned by luciad::ProjectedImagery::getId.
tilethe coordinate of the requested tile.
cancellationTokena token that signals when the result is no longer needed.
Returns
the tile result, a result without an image when the tile does not exist, or an error.

Implemented in luciad::PanoramaModel, and luciad::ProjectedVideoModel.

◆ removeObserver()

virtual void luciad::IProjectedImageryModel::removeObserver ( const std::shared_ptr< IProjectedImageryModelObserver > & observer)
pure virtual

Unregisters a previously added observer.

If the given observer was not previously added, this method has no effect.

Parameters
observerthe observer to remove.

Implemented in luciad::PanoramaModel, and luciad::ProjectedVideoModel.