QGIS API Documentation 3.41.0-Master (af5edcb665c)
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
 
 Qgs3DRenderContext (const Qgs3DRenderContext &other)
 
 ~Qgs3DRenderContext ()
 
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)).
 
Qgs3DRenderContextoperator= (const Qgs3DRenderContext &other)
 
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.
 
const QgsAbstractTerrainSettingsterrainSettings () const
 Returns the terrain settings.
 
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 47 of file qgs3drendercontext.h.

Constructor & Destructor Documentation

◆ Qgs3DRenderContext() [1/2]

Qgs3DRenderContext::Qgs3DRenderContext ( )
default

◆ ~Qgs3DRenderContext()

Qgs3DRenderContext::~Qgs3DRenderContext ( )
default

◆ Qgs3DRenderContext() [2/2]

Qgs3DRenderContext::Qgs3DRenderContext ( const Qgs3DRenderContext other)

Definition at line 21 of file qgs3drendercontext.cpp.

Member Function Documentation

◆ crs()

QgsCoordinateReferenceSystem Qgs3DRenderContext::crs ( ) const
inline

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

Definition at line 63 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 146 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 154 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 77 of file qgs3drendercontext.h.

◆ fieldOfView()

float Qgs3DRenderContext::fieldOfView ( ) const
inline

Returns the camera lens' field of view.

Definition at line 103 of file qgs3drendercontext.h.

◆ fromMapSettings()

Qgs3DRenderContext Qgs3DRenderContext::fromMapSettings ( const Qgs3DMapSettings mapSettings)
static

Creates an initialized Qgs3DRenderContext instance from given Qgs3DMapSettings.

Definition at line 59 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 78 of file qgs3drendercontext.cpp.

◆ operator=()

Qgs3DRenderContext & Qgs3DRenderContext::operator= ( const Qgs3DRenderContext other)

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 82 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 98 of file qgs3drendercontext.h.

◆ selectionColor()

QColor Qgs3DRenderContext::selectionColor ( ) const
inline

Returns color used for selected features.

Definition at line 92 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 139 of file qgs3drendercontext.h.

◆ temporalRange()

const QgsDateTimeRange & Qgs3DRenderContext::temporalRange ( ) const
inline

Returns the temporal range for the map.

Definition at line 87 of file qgs3drendercontext.h.

◆ terrainGenerator()

QgsTerrainGenerator * Qgs3DRenderContext::terrainGenerator ( ) const
inline

Returns the terrain generator.

Definition at line 132 of file qgs3drendercontext.h.

◆ terrainRenderingEnabled()

bool Qgs3DRenderContext::terrainRenderingEnabled ( ) const
inline

Returns whether the 2D terrain surface will be rendered.

Definition at line 122 of file qgs3drendercontext.h.

◆ terrainSettings()

const QgsAbstractTerrainSettings * Qgs3DRenderContext::terrainSettings ( ) const

Returns the terrain settings.

Definition at line 88 of file qgs3drendercontext.cpp.

◆ 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 70 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 83 of file qgs3drendercontext.cpp.


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