QGIS API Documentation
3.6.0-Noosa (5873452)
|
3 Miscellaneous utility functions used from 3D code. More...
#include <qgs3dutils.h>
Static Public Member Functions | |
static Qgs3DTypes::AltitudeBinding | altBindingFromString (const QString &str) |
Converts a string to a value from AltitudeBinding enum. More... | |
static QString | altBindingToString (Qgs3DTypes::AltitudeBinding altBind) |
Converts a value from AltitudeBinding enum to a string. More... | |
static Qgs3DTypes::AltitudeClamping | altClampingFromString (const QString &str) |
Converts a string to a value from AltitudeClamping enum. More... | |
static QString | altClampingToString (Qgs3DTypes::AltitudeClamping altClamp) |
Converts a value from AltitudeClamping enum to a string. More... | |
static QImage | captureSceneImage (QgsAbstract3DEngine &engine, Qgs3DMapScene *scene) |
Captures image of the current 3D scene of a 3D engine. More... | |
static float | clampAltitude (const QgsPoint &p, Qgs3DTypes::AltitudeClamping altClamp, Qgs3DTypes::AltitudeBinding altBind, float height, const QgsPoint ¢roid, const Qgs3DMapSettings &map) |
Clamps altitude of a vertex according to the settings, returns Z value. More... | |
static void | clampAltitudes (QgsLineString *lineString, Qgs3DTypes::AltitudeClamping altClamp, Qgs3DTypes::AltitudeBinding altBind, const QgsPoint ¢roid, float height, const Qgs3DMapSettings &map) |
Clamps altitude of vertices of a linestring according to the settings. More... | |
static bool | clampAltitudes (QgsPolygon *polygon, Qgs3DTypes::AltitudeClamping altClamp, Qgs3DTypes::AltitudeBinding altBind, float height, const Qgs3DMapSettings &map) |
Clamps altitude of vertices of a polygon according to the settings. More... | |
static Qgs3DTypes::CullingMode | cullingModeFromString (const QString &str) |
Converts a string to a value from CullingMode enum. More... | |
static QString | cullingModeToString (Qgs3DTypes::CullingMode mode) |
Converts a value from CullingMode enum to a string. More... | |
static void | extractPointPositions (QgsFeature &f, const Qgs3DMapSettings &map, Qgs3DTypes::AltitudeClamping altClamp, QVector< QVector3D > &positions) |
Calculates (x,y,z) positions of (multi)point from the given feature. More... | |
static QgsExpressionContext | globalProjectLayerExpressionContext (QgsVectorLayer *layer) |
Returns expression context for use in preparation of 3D data of a layer. More... | |
static bool | isCullable (const QgsAABB &bbox, const QMatrix4x4 &viewProjectionMatrix) |
Returns true if bbox is completely outside the current viewing volume. More... | |
static QgsVector3D | mapToWorldCoordinates (const QgsVector3D &mapCoords, const QgsVector3D &origin) |
Converts map coordinates to 3D world coordinates (applies offset and turns (x,y,z) into (x,-z,y)) More... | |
static QString | matrix4x4toString (const QMatrix4x4 &m) |
Converts a 4x4 transform matrix to a string. More... | |
static int | maxZoomLevel (double tile0width, double tileResolution, double maxError) |
Calculates the highest needed zoom level for tiles in quad-tree given width of the base tile (zoom level 0) in map units, resolution of the tile (e.g. More... | |
static Qt3DExtras::QPhongMaterial * | phongMaterial (const QgsPhongMaterialSettings &settings) |
Returns phong material object based on the material settings. More... | |
static QMatrix4x4 | stringToMatrix4x4 (const QString &str) |
Convert a string to a 4x4 transform matrix. More... | |
static std::unique_ptr< QgsAbstract3DSymbol > | symbolForGeometryType (QgsWkbTypes::GeometryType geomType) |
Returns a new 3D symbol based on given geometry type (or null pointer if geometry type is not supported) More... | |
static QgsVector3D | transformWorldCoordinates (const QgsVector3D &worldPoint1, const QgsVector3D &origin1, const QgsCoordinateReferenceSystem &crs1, const QgsVector3D &origin2, const QgsCoordinateReferenceSystem &crs2, const QgsCoordinateTransformContext &context) |
Transforms a world point from (origin1, crs1) to (origin2, crs2) More... | |
static QgsVector3D | worldToMapCoordinates (const QgsVector3D &worldCoords, const QgsVector3D &origin) |
Converts 3D world coordinates to map coordinates (applies offset and turns (x,y,z) into (x,-z,y)) More... | |
3 Miscellaneous utility functions used from 3D code.
Definition at line 46 of file qgs3dutils.h.
|
static |
Converts a string to a value from AltitudeBinding enum.
Definition at line 127 of file qgs3dutils.cpp.
|
static |
Converts a value from AltitudeBinding enum to a string.
Definition at line 116 of file qgs3dutils.cpp.
|
static |
Converts a string to a value from AltitudeClamping enum.
Definition at line 105 of file qgs3dutils.cpp.
|
static |
Converts a value from AltitudeClamping enum to a string.
Definition at line 93 of file qgs3dutils.cpp.
|
static |
Captures image of the current 3D scene of a 3D engine.
The function waits until the scene is not fully loaded/updated before capturing the image.
Definition at line 38 of file qgs3dutils.cpp.
|
static |
Clamps altitude of a vertex according to the settings, returns Z value.
Definition at line 159 of file qgs3dutils.cpp.
|
static |
Clamps altitude of vertices of a linestring according to the settings.
Definition at line 174 of file qgs3dutils.cpp.
|
static |
Clamps altitude of vertices of a polygon according to the settings.
Definition at line 204 of file qgs3dutils.cpp.
|
static |
Converts a string to a value from CullingMode enum.
Definition at line 147 of file qgs3dutils.cpp.
|
static |
Converts a value from CullingMode enum to a string.
Definition at line 135 of file qgs3dutils.cpp.
|
static |
Calculates (x,y,z) positions of (multi)point from the given feature.
Definition at line 253 of file qgs3dutils.cpp.
|
static |
Returns expression context for use in preparation of 3D data of a layer.
Definition at line 388 of file qgs3dutils.cpp.
|
static |
Returns true if bbox is completely outside the current viewing volume.
coarse box vs frustum test for culling.
This is used to perform object culling checks.
corners of oriented box are transformed to clip space and there is a test that all points are on the wrong side of the same plane see http://www.lighthouse3d.com/tutorials/view-frustum-culling/geometric-approach-testing-boxes/
should be equivalent to https://searchcode.com/codesearch/view/35195518/ qt3d /src/threed/painting/qglpainter.cpp bool QGLPainter::isCullable(const QBox3D& box) const
Definition at line 319 of file qgs3dutils.cpp.
|
static |
Converts map coordinates to 3D world coordinates (applies offset and turns (x,y,z) into (x,-z,y))
Definition at line 337 of file qgs3dutils.cpp.
|
static |
Converts a 4x4 transform matrix to a string.
Definition at line 233 of file qgs3dutils.cpp.
|
static |
Calculates the highest needed zoom level for tiles in quad-tree given width of the base tile (zoom level 0) in map units, resolution of the tile (e.g.
tile's texture width) and desired maximum error in map units.
Definition at line 80 of file qgs3dutils.cpp.
|
static |
Returns phong material object based on the material settings.
Definition at line 397 of file qgs3dutils.cpp.
|
static |
Convert a string to a 4x4 transform matrix.
Definition at line 243 of file qgs3dutils.cpp.
|
static |
Returns a new 3D symbol based on given geometry type (or null pointer if geometry type is not supported)
Definition at line 373 of file qgs3dutils.cpp.
|
static |
Transforms a world point from (origin1, crs1) to (origin2, crs2)
Definition at line 352 of file qgs3dutils.cpp.
|
static |
Converts 3D world coordinates to map coordinates (applies offset and turns (x,y,z) into (x,-z,y))
Definition at line 345 of file qgs3dutils.cpp.