QGIS API Documentation  3.2.0-Bonn (bc43194)
Public Member Functions | List of all members
QgsTessellator Class Reference

3 Class that takes care of tessellation of polygons into triangles. More...

#include <qgstessellator.h>

Public Member Functions

 QgsTessellator (double originX, double originY, bool addNormals, bool invertNormals=false, bool addBackFaces=false)
 Creates tessellator with a specified origin point of the world (in map coordinates) More...
 
void addPolygon (const QgsPolygon &polygon, float extrusionHeight)
 Tessellates a triangle and adds its vertex entries to the output data array. More...
 
std::unique_ptr< QgsMultiPolygonasMultiPolygon () const
 Returns the triangulation as a multipolygon geometry. More...
 
QVector< float > data () const
 Returns array of triangle vertex data. More...
 
int stride () const
 Returns size of one vertex entry in bytes. More...
 

Detailed Description

3 Class that takes care of tessellation of 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.

Since
QGIS 3.0

Definition at line 38 of file qgstessellator.h.

Constructor & Destructor Documentation

◆ QgsTessellator()

QgsTessellator::QgsTessellator ( double  originX,
double  originY,
bool  addNormals,
bool  invertNormals = false,
bool  addBackFaces = false 
)

Creates tessellator with a specified origin point of the world (in map coordinates)

Definition at line 69 of file qgstessellator.cpp.

Member Function Documentation

◆ addPolygon()

void QgsTessellator::addPolygon ( const QgsPolygon polygon,
float  extrusionHeight 
)

Tessellates a triangle and adds its vertex entries to the output data array.

Definition at line 353 of file qgstessellator.cpp.

◆ asMultiPolygon()

std::unique_ptr< QgsMultiPolygon > QgsTessellator::asMultiPolygon ( ) const

Returns the triangulation as a multipolygon geometry.

Definition at line 543 of file qgstessellator.cpp.

◆ data()

QVector<float> QgsTessellator::data ( ) const
inline

Returns array of triangle vertex data.

Definition at line 48 of file qgstessellator.h.

◆ stride()

int QgsTessellator::stride ( ) const
inline

Returns size of one vertex entry in bytes.

Definition at line 50 of file qgstessellator.h.


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