|
LuciadCPillar 2026.1.02
|
Model interface for projected imagery: single images, live video, and 360-degree panoramas. More...
#include <luciad/models/projectedimagery/IProjectedImageryModel.h>
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. | |
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
|
pure virtual |
Registers an observer that will be notified of changes to this model.
| observer | the observer to add. Must not be nullptr. |
Implemented in luciad::PanoramaModel, and luciad::ProjectedVideoModel.
|
pure virtual |
Returns the projections held by this model.
Implemented in luciad::PanoramaModel, and luciad::ProjectedVideoModel.
|
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 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.
| projectionId | the identifier of the projection, as returned by luciad::ProjectedImagery::getId. |
| tile | the coordinate of the requested tile. |
| cancellationToken | a token that signals when the result is no longer needed. |
Implemented in luciad::PanoramaModel, and luciad::ProjectedVideoModel.
|
pure virtual |
Unregisters a previously added observer.
If the given observer was not previously added, this method has no effect.
| observer | the observer to remove. |
Implemented in luciad::PanoramaModel, and luciad::ProjectedVideoModel.