LuciadCPillar 2024.0.08
luciad::Map::Renderer Class Referenceabstract

The Map renderer. More...

#include <luciad/maps/Map.h>

Public Member Functions

virtual ~Renderer ()=default
 
virtual void destroy ()=0
 Disposes the Renderer. More...
 
virtual bool paint ()=0
 To be called by the host widget/component to paint. More...
 
virtual Coordinate projectPointOnTerrain (const Coordinate &mapPoint) const =0
 Projects the given point by moving it up or down towards the terrain. More...
 
virtual std::shared_ptr< ImagetoImage ()=0
 Copies the current contents of the Map to an Image. More...
 

Detailed Description

The Map renderer.

This class allows you to paint the Map.

Note: all methods must be called on the render thread. See here for more details on the threading rules.

Constructor & Destructor Documentation

◆ ~Renderer()

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

Member Function Documentation

◆ destroy()

virtual void luciad::Map::Renderer::destroy ( )
pure virtual

Disposes the Renderer.

This method disposes all graphics related resources, and should be called when the OpenGL context is current. This method needs to be called before the Map instance is deleted.

◆ paint()

virtual bool luciad::Map::Renderer::paint ( )
pure virtual

To be called by the host widget/component to paint.

For OpenGL you must ensure that we have a current context.

The invalidation callback mechanism (Map::setMapInvalidationCallback) provides information on when something has changed on the Map, and a repaint is needed. This allows to only call the paint() method when it is needed.

Returns
whether the Map is idle. Idle means that no background processes are executing inside the Map, and that the result of the painting completely reflects the state of the Map.

◆ projectPointOnTerrain()

virtual Coordinate luciad::Map::Renderer::projectPointOnTerrain ( const Coordinate mapPoint) const
pure virtual

Projects the given point by moving it up or down towards the terrain.

The projection is done along the axis that runs perpendicular to the ellipsoid surface at that point. If no terrain is available, the point is projected on the ellipsoid of the map reference.

Parameters
mapPointa point in map coordinates
Returns
the projected location, in map coordinates.
Since
2021.1

◆ toImage()

virtual std::shared_ptr< Image > luciad::Map::Renderer::toImage ( )
pure virtual

Copies the current contents of the Map to an Image.

For OpenGL you must ensure that we have a current context. This method will not wait until all processing is done.

The image size is equal to the map size, multiplied by the display scale.

Returns
an Image that contains the content of the Map.
Since
2020.0