LuciadCPillar 2023.1.04
luciad::Map::IRendererCallback Class Referenceabstract

This callback can be used to execute tasks on the render thread right before or right after the Map is painted by Map::Renderer. More...

#include <luciad/maps/Map.h>

Public Member Functions

virtual ~IRendererCallback ()=default
 
virtual void onAfterPaint (const std::shared_ptr< Map > &map)=0
 This method is called after the renderer has finished painting the contents of the Map. More...
 
virtual void onBeforePaint (const std::shared_ptr< Map > &map)=0
 This method is called before the renderer paints the contents of the Map. More...
 

Static Public Member Functions

static std::shared_ptr< IRendererCallbackcreate (std::function< void(const std::shared_ptr< Map > &map)> onBeforePaintFunction, std::function< void(const std::shared_ptr< Map > &map)> onAfterPaintFunction)
 Creates a default IRendererCallback instance that delegates to the given functions. More...
 

Detailed Description

This callback can be used to execute tasks on the render thread right before or right after the Map is painted by Map::Renderer.

This callback can for example be used to adapt the camera on each repaint.

You can add or remove this callback from the Map.

Since
2021.1

Constructor & Destructor Documentation

◆ ~IRendererCallback()

virtual luciad::Map::IRendererCallback::~IRendererCallback ( )
virtualdefault

Member Function Documentation

◆ create()

static std::shared_ptr< IRendererCallback > luciad::Map::IRendererCallback::create ( std::function< void(const std::shared_ptr< Map > &map)>  onBeforePaintFunction,
std::function< void(const std::shared_ptr< Map > &map)>  onAfterPaintFunction 
)
static

Creates a default IRendererCallback instance that delegates to the given functions.

This is a convenience method that allows to reduce boiler plate code, and use lambdas.

Parameters
onBeforePaintFunctionthe function that is called by IRendererCallback::onBeforePaint
onAfterPaintFunctionthe function that is called by IRendererCallback::onAfterPaint
Returns
an IRendererCallback instance based on the given functions.

◆ onAfterPaint()

virtual void luciad::Map::IRendererCallback::onAfterPaint ( const std::shared_ptr< Map > &  map)
pure virtual

This method is called after the renderer has finished painting the contents of the Map.

Parameters
mapthe map that owns the renderer

◆ onBeforePaint()

virtual void luciad::Map::IRendererCallback::onBeforePaint ( const std::shared_ptr< Map > &  map)
pure virtual

This method is called before the renderer paints the contents of the Map.

Parameters
mapthe map that owns the renderer