QGIS API Documentation 3.41.0-Master (45a0abf3bec)
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
Qgs3DRenderContext Class Reference

3 More...

#include <qgs3drendercontext.h>

Inheritance diagram for Qgs3DRenderContext:
Inheritance graph
[legend]

Public Member Functions

 Qgs3DRenderContext ()=default
 
QgsCoordinateReferenceSystem crs () const
 Returns the coordinate reference system used in the 3D scene.
 
QgsExpressionContextexpressionContext ()
 Gets the expression context.
 
const QgsExpressionContextexpressionContext () const
 Gets the expression context (const version).
 
QgsRectangle extent () const
 Returns the 3D scene's 2D extent in the 3D scene's CRS.
 
float fieldOfView () const
 Returns the camera lens' field of view.
 
QgsVector3D mapToWorldCoordinates (const QgsVector3D &mapCoords) const
 Converts map coordinates to 3D world coordinates (applies offset and turns (x,y,z) into (x,-z,y)).
 
QgsVector3D origin () const
 Returns coordinates in map CRS at which 3D scene has origin (0,0,0)
 
double outputDpi () const
 Returns DPI used for conversion between real world units (e.g.
 
QColor selectionColor () const
 Returns color used for selected features.
 
void setExpressionContext (const QgsExpressionContext &context)
 Sets the expression context.
 
const QgsDateTimeRangetemporalRange () const
 Returns the temporal range for the map.
 
QgsTerrainGeneratorterrainGenerator () const
 Returns the terrain generator.
 
bool terrainRenderingEnabled () const
 Returns whether the 2D terrain surface will be rendered.
 
double terrainVerticalScale () const
 Returns vertical scale (exaggeration) of terrain.
 
QgsCoordinateTransformContext transformContext () const
 Returns the coordinate transform context, which stores various information regarding which datum transforms should be used when transforming points from a source to destination coordinate reference system.
 
QgsVector3D worldToMapCoordinates (const QgsVector3D &worldCoords) const
 Converts 3D world coordinates to map coordinates (applies offset and turns (x,y,z) into (x,-z,y)).
 

Static Public Member Functions

static Qgs3DRenderContext fromMapSettings (const Qgs3DMapSettings *mapSettings)
 Creates an initialized Qgs3DRenderContext instance from given Qgs3DMapSettings.
 

Detailed Description

3

Rendering context for preparation of 3D entities.

Contains a snapshot of properties from Qgs3DMapSettings, in a thread-safe, cheap-to-copy structure.

Warning
For thread safety, no QObject based properties should be attached to this class.
Note
Not available in Python bindings.
Since
QGIS 3.40

Definition at line 46 of file qgs3drendercontext.h.

Constructor & Destructor Documentation

◆ Qgs3DRenderContext()

Qgs3DRenderContext::Qgs3DRenderContext ( )
default

Member Function Documentation

◆ crs()

QgsCoordinateReferenceSystem Qgs3DRenderContext::crs ( ) const
inline

Returns the coordinate reference system used in the 3D scene.

Definition at line 61 of file qgs3drendercontext.h.

◆ expressionContext() [1/2]

QgsExpressionContext & Qgs3DRenderContext::expressionContext ( )
inline

Gets the expression context.

This context should be used for all expression evaluation associated with this render context.

See also
setExpressionContext()

Definition at line 144 of file qgs3drendercontext.h.

◆ expressionContext() [2/2]

const QgsExpressionContext & Qgs3DRenderContext::expressionContext ( ) const
inline

Gets the expression context (const version).

This context should be used for all expression evaluation associated with this render context.

See also
setExpressionContext()
Note
not available in Python bindings

Definition at line 152 of file qgs3drendercontext.h.

◆ extent()

QgsRectangle Qgs3DRenderContext::extent ( ) const
inline

Returns the 3D scene's 2D extent in the 3D scene's CRS.

See also
crs()

Definition at line 75 of file qgs3drendercontext.h.

◆ fieldOfView()

float Qgs3DRenderContext::fieldOfView ( ) const
inline

Returns the camera lens' field of view.

Definition at line 101 of file qgs3drendercontext.h.

◆ fromMapSettings()

Qgs3DRenderContext Qgs3DRenderContext::fromMapSettings ( const Qgs3DMapSettings mapSettings)
static

Creates an initialized Qgs3DRenderContext instance from given Qgs3DMapSettings.

Definition at line 20 of file qgs3drendercontext.cpp.

◆ mapToWorldCoordinates()

QgsVector3D Qgs3DRenderContext::mapToWorldCoordinates ( const QgsVector3D mapCoords) const

Converts map coordinates to 3D world coordinates (applies offset and turns (x,y,z) into (x,-z,y)).

See also
worldToMapCoordinates()

Definition at line 39 of file qgs3drendercontext.cpp.

◆ origin()

QgsVector3D Qgs3DRenderContext::origin ( ) const
inline

Returns coordinates in map CRS at which 3D scene has origin (0,0,0)

Definition at line 80 of file qgs3drendercontext.h.

◆ outputDpi()

double Qgs3DRenderContext::outputDpi ( ) const
inline

Returns DPI used for conversion between real world units (e.g.

mm) and pixels Default value is 96

Definition at line 96 of file qgs3drendercontext.h.

◆ selectionColor()

QColor Qgs3DRenderContext::selectionColor ( ) const
inline

Returns color used for selected features.

Definition at line 90 of file qgs3drendercontext.h.

◆ setExpressionContext()

void Qgs3DRenderContext::setExpressionContext ( const QgsExpressionContext context)
inline

Sets the expression context.

This context is used for all expression evaluation associated with this render context.

See also
expressionContext()

Definition at line 137 of file qgs3drendercontext.h.

◆ temporalRange()

const QgsDateTimeRange & Qgs3DRenderContext::temporalRange ( ) const
inline

Returns the temporal range for the map.

Definition at line 85 of file qgs3drendercontext.h.

◆ terrainGenerator()

QgsTerrainGenerator * Qgs3DRenderContext::terrainGenerator ( ) const
inline

Returns the terrain generator.

Definition at line 130 of file qgs3drendercontext.h.

◆ terrainRenderingEnabled()

bool Qgs3DRenderContext::terrainRenderingEnabled ( ) const
inline

Returns whether the 2D terrain surface will be rendered.

Definition at line 120 of file qgs3drendercontext.h.

◆ terrainVerticalScale()

double Qgs3DRenderContext::terrainVerticalScale ( ) const
inline

Returns vertical scale (exaggeration) of terrain.

Definition at line 125 of file qgs3drendercontext.h.

◆ transformContext()

QgsCoordinateTransformContext Qgs3DRenderContext::transformContext ( ) const
inline

Returns the coordinate transform context, which stores various information regarding which datum transforms should be used when transforming points from a source to destination coordinate reference system.

Definition at line 68 of file qgs3drendercontext.h.

◆ worldToMapCoordinates()

QgsVector3D Qgs3DRenderContext::worldToMapCoordinates ( const QgsVector3D worldCoords) const

Converts 3D world coordinates to map coordinates (applies offset and turns (x,y,z) into (x,-z,y)).

See also
mapToWorldCoordinates()

Definition at line 44 of file qgs3drendercontext.cpp.


The documentation for this class was generated from the following files: