|
QGIS API Documentation 3.99.0-Master (18a1e75d814)
|
Tessellates polygons into triangles. More...
#include <qgstessellator.h>
Public Member Functions | |
| QgsTessellator () | |
| Q_DECL_DEPRECATED | QgsTessellator (const QgsRectangle &bounds, bool addNormals, bool invertNormals=false, bool addBackFaces=false, bool noZ=false, bool addTextureCoords=false, int facade=3, float textureRotation=0.0f) |
| Creates tessellator with a specified bounds of input geometry coordinates. | |
| Q_DECL_DEPRECATED | QgsTessellator (double originX, double originY, bool addNormals, bool invertNormals=false, bool addBackFaces=false, bool noZ=false, bool addTextureCoords=false, int facade=3, float textureRotation=0.0f) |
| Creates tessellator with a specified origin point of the world (in map coordinates). | |
| void | addPolygon (const QgsPolygon &polygon, float extrusionHeight) |
| Tessellates a triangle and adds its vertex entries to the output data array. | |
| std::unique_ptr< QgsMultiPolygon > | asMultiPolygon () const |
| Returns the triangulation as a multipolygon geometry. | |
| Q_DECL_DEPRECATED QVector< float > | data () const |
| Returns array of triangle vertex data. | |
| int | dataVerticesCount () const |
| Returns the number of vertices stored in the output data array. | |
| QString | error () const |
| Returns a descriptive error string if the tessellation failed. | |
| Qgis::ExtrusionFaces | extrusionFaces () const |
| Returns which faces are generated during extrusion. | |
| bool | hasBackFacesEnabled () const |
Returns whether back faces are being added to the output data (true) or not (false). | |
| bool | hasInvertedNormals () const |
Returns whether normals are inverted (true) or not (false). | |
| bool | hasNormals () const |
Returns whether normals are being added to the output data (true) or not (false). | |
| bool | hasTextureUVs () const |
Returns whether texture UV coordinates are being added to the output data (true) or not (false). | |
| QByteArray | indexBuffer () const |
| Returns index buffer for the generated points. | |
| int | indexStride () const |
| Returns size of one index entry in bytes. | |
| bool | isOutputZUp () const |
Returns whether the "up" direction should be the Z axis on output (true), otherwise the "up" direction will be the Y axis (false). | |
| bool | isZValueIgnored () const |
Returns whether Z values from the input geometries are ignored (true) or not (false). | |
| QgsVector3D | origin () const |
| Returns the origin point of the map. | |
| void | setAddNormals (bool addNormals) |
Sets whether normals should be added to the output data (true) or not (false). | |
| void | setAddTextureUVs (bool addTextureUVs) |
Sets whether texture UV coordinates should be added to the output data (true) or not (false). | |
| void | setBackFacesEnabled (bool addBackFaces) |
Sets whether back faces should be added to the output data (true) or not (false). | |
| void | setBounds (const QgsRectangle &bounds) |
| Sets scaling and the bounds of the input geometry coordinates. | |
| void | setExtrusionFaces (Qgis::ExtrusionFaces faces) |
| Sets which faces should be generated during extrusion. | |
| void | setInputZValueIgnored (bool ignore) |
Sets whether Z values from the input geometries are ignored (true) or not (false). | |
| void | setInvertNormals (bool invertNormals) |
Sets whether normals should be inverted (true) or not (false). | |
| void | setOrigin (const QgsVector3D &origin) |
| Sets the origin point of the map. | |
| void | setOutputZUp (bool zUp) |
Sets whether the "up" direction should be the Z axis on output (true), otherwise the "up" direction will be the Y axis (false). | |
| void | setTextureRotation (float rotation) |
| Sets the rotation of texture UV coordinates (in degrees). | |
| void | setTriangulationAlgorithm (Qgis::TriangulationAlgorithm algorithm) |
| Sets the triangulation algorithm. | |
| int | stride () const |
| Returns size of one vertex entry in bytes. | |
| float | textureRotation () const |
| Returns the rotation of texture UV coordinates (in degrees). | |
| Qgis::TriangulationAlgorithm | triangulationAlgorithm () const |
| Returns the algorithm used for triangulation. | |
| int | uniqueVertexCount () const |
| Returns unique vertex count. | |
| QByteArray | vertexBuffer () const |
| Returns vertex buffer for the generated points. | |
| float | zMaximum () const |
| Returns maximal Z value of the data (in world coordinates). | |
| float | zMinimum () const |
| Returns minimal Z value of the data (in world coordinates). | |
Friends | |
| uint | qHash (const VertexPoint &key) |
Tessellates polygons into triangles.
It is expected that client code will create the tessellator object, then repeatedly call addPolygon() method that will generate triangles, and finally call data() to get final vertex data.
Optionally provides extrusion by adding triangles that serve as walls when extrusion height is non-zero.
Definition at line 40 of file qgstessellator.h.
|
default |
| QgsTessellator::QgsTessellator | ( | double | originX, |
| double | originY, | ||
| bool | addNormals, | ||
| bool | invertNormals = false, | ||
| bool | addBackFaces = false, | ||
| bool | noZ = false, | ||
| bool | addTextureCoords = false, | ||
| int | facade = 3, | ||
| float | textureRotation = 0.0f ) |
Creates tessellator with a specified origin point of the world (in map coordinates).
Definition at line 169 of file qgstessellator.cpp.
| QgsTessellator::QgsTessellator | ( | const QgsRectangle & | bounds, |
| bool | addNormals, | ||
| bool | invertNormals = false, | ||
| bool | addBackFaces = false, | ||
| bool | noZ = false, | ||
| bool | addTextureCoords = false, | ||
| int | facade = 3, | ||
| float | textureRotation = 0.0f ) |
Creates tessellator with a specified bounds of input geometry coordinates.
This constructor allows the tessellator to map input coordinates to a desirable range for numerical stability during calculations.
If noZ is true, then a 2-dimensional tessellation only will be performed and all z coordinates will be ignored.
Definition at line 182 of file qgstessellator.cpp.
| void QgsTessellator::addPolygon | ( | const QgsPolygon & | polygon, |
| float | extrusionHeight ) |
Tessellates a triangle and adds its vertex entries to the output data array.
Definition at line 764 of file qgstessellator.cpp.
| std::unique_ptr< QgsMultiPolygon > QgsTessellator::asMultiPolygon | ( | ) | const |
Returns the triangulation as a multipolygon geometry.
Definition at line 961 of file qgstessellator.cpp.
| QVector< float > QgsTessellator::data | ( | ) | const |
Returns array of triangle vertex data.
Vertice coordinates are stored as (x, z, -y)
Definition at line 997 of file qgstessellator.cpp.
| int QgsTessellator::dataVerticesCount | ( | ) | const |
Returns the number of vertices stored in the output data array.
Definition at line 956 of file qgstessellator.cpp.
|
inline |
Returns a descriptive error string if the tessellation failed.
Definition at line 254 of file qgstessellator.h.
|
inline |
Returns which faces are generated during extrusion.
Definition at line 106 of file qgstessellator.h.
|
inline |
Returns whether back faces are being added to the output data (true) or not (false).
Definition at line 154 of file qgstessellator.h.
|
inline |
Returns whether normals are inverted (true) or not (false).
Definition at line 166 of file qgstessellator.h.
|
inline |
Returns whether normals are being added to the output data (true) or not (false).
Definition at line 142 of file qgstessellator.h.
|
inline |
Returns whether texture UV coordinates are being added to the output data (true) or not (false).
Definition at line 130 of file qgstessellator.h.
| QByteArray QgsTessellator::indexBuffer | ( | ) | const |
Returns index buffer for the generated points.
Definition at line 547 of file qgstessellator.cpp.
|
inline |
Returns size of one index entry in bytes.
Definition at line 230 of file qgstessellator.h.
|
inline |
Returns whether the "up" direction should be the Z axis on output (true), otherwise the "up" direction will be the Y axis (false).
The default value is false (to keep compatibility for existing tessellator use cases).
Definition at line 194 of file qgstessellator.h.
|
inline |
Returns whether Z values from the input geometries are ignored (true) or not (false).
Definition at line 94 of file qgstessellator.h.
|
inline |
| void QgsTessellator::setAddNormals | ( | bool | addNormals | ) |
Sets whether normals should be added to the output data (true) or not (false).
Definition at line 255 of file qgstessellator.cpp.
| void QgsTessellator::setAddTextureUVs | ( | bool | addTextureUVs | ) |
Sets whether texture UV coordinates should be added to the output data (true) or not (false).
Definition at line 261 of file qgstessellator.cpp.
| void QgsTessellator::setBackFacesEnabled | ( | bool | addBackFaces | ) |
Sets whether back faces should be added to the output data (true) or not (false).
Definition at line 245 of file qgstessellator.cpp.
| void QgsTessellator::setBounds | ( | const QgsRectangle & | bounds | ) |
Sets scaling and the bounds of the input geometry coordinates.
Definition at line 200 of file qgstessellator.cpp.
| void QgsTessellator::setExtrusionFaces | ( | Qgis::ExtrusionFaces | faces | ) |
Sets which faces should be generated during extrusion.
Definition at line 211 of file qgstessellator.cpp.
| void QgsTessellator::setInputZValueIgnored | ( | bool | ignore | ) |
Sets whether Z values from the input geometries are ignored (true) or not (false).
By default, this is false.
Definition at line 206 of file qgstessellator.cpp.
| void QgsTessellator::setInvertNormals | ( | bool | invertNormals | ) |
Sets whether normals should be inverted (true) or not (false).
Definition at line 250 of file qgstessellator.cpp.
| void QgsTessellator::setOrigin | ( | const QgsVector3D & | origin | ) |
|
inline |
Sets whether the "up" direction should be the Z axis on output (true), otherwise the "up" direction will be the Y axis (false).
The default value is false (to keep compatibility for existing tessellator use cases).
Definition at line 186 of file qgstessellator.h.
| void QgsTessellator::setTextureRotation | ( | float | rotation | ) |
Sets the rotation of texture UV coordinates (in degrees).
Definition at line 240 of file qgstessellator.cpp.
| void QgsTessellator::setTriangulationAlgorithm | ( | Qgis::TriangulationAlgorithm | algorithm | ) |
|
inline |
Returns size of one vertex entry in bytes.
Definition at line 224 of file qgstessellator.h.
|
inline |
Returns the rotation of texture UV coordinates (in degrees).
Definition at line 118 of file qgstessellator.h.
|
inline |
Returns the algorithm used for triangulation.
Definition at line 178 of file qgstessellator.h.
| int QgsTessellator::uniqueVertexCount | ( | ) | const |
| QByteArray QgsTessellator::vertexBuffer | ( | ) | const |
Returns vertex buffer for the generated points.
Definition at line 542 of file qgstessellator.cpp.
|
inline |
Returns maximal Z value of the data (in world coordinates).
Definition at line 247 of file qgstessellator.h.
|
inline |
Returns minimal Z value of the data (in world coordinates).
Definition at line 241 of file qgstessellator.h.
|
friend |
Definition at line 275 of file qgstessellator.h.