16#ifndef QGSTESSELLATOR_H
17#define QGSTESSELLATOR_H
49 Q_DECL_DEPRECATED
QgsTessellator(
double originX,
double originY,
bool addNormals,
bool invertNormals =
false,
bool addBackFaces =
false,
bool noZ =
false,
62 Q_DECL_DEPRECATED
QgsTessellator( const
QgsRectangle &bounds,
bool addNormals,
bool invertNormals = false,
bool addBackFaces = false,
bool noZ = false,
88 void setInputZValueIgnored(
bool ignore );
112 void setTextureRotation(
float rotation );
124 void setAddTextureUVs(
bool addTextureUVs );
136 void setAddNormals(
bool addNormals );
148 void setBackFacesEnabled(
bool addBackFaces );
160 void setInvertNormals(
bool invertNormals );
197 void addPolygon(
const QgsPolygon &polygon,
float extrusionHeight );
212 QByteArray indexBuffer() const;
218 QByteArray vertexBuffer() const;
221 int dataVerticesCount() const;
235 std::unique_ptr< QgsMultiPolygon > asMultiPolygon() const
SIP_SKIP;
254 QString
error()
const {
return mError; }
260 int uniqueVertexCount()
const;
268 inline bool operator==(
const VertexPoint &other )
const
270 return position == other.position
271 && normal == other.normal;
275 friend uint
qHash(
const VertexPoint &key )
277 return qHash( key.position.x() ) ^
qHash( key.position.y() ) ^
qHash( key.position.z() )
278 ^
qHash( key.normal.x() ) ^
qHash( key.normal.y() ) ^
qHash( key.normal.z() );
281 QVector<uint32_t> mIndexBuffer;
284 void setExtrusionFacesLegacy(
int facade );
285 void calculateBaseTransform(
const QVector3D &pNormal, QMatrix4x4 *base )
const;
286 QVector3D applyTransformWithExtrusion(
const QVector3D point,
float extrusionHeight, QMatrix4x4 *transformMatrix,
const QgsPoint *originOffset );
287 void addVertex(
const QVector3D &point,
const QVector3D &normal,
float extrusionHeight, QMatrix4x4 *transformMatrix,
const QgsPoint *originOffset, QHash<VertexPoint, unsigned int> *vertexBuffer,
const size_t &vertexBufferOffset );
288 void addVertex(
const QVector3D &point,
const QVector3D &normal,
float extrusionHeight, QMatrix4x4 *transformMatrix,
const QgsPoint *originOffset );
289 void makeWalls(
const QgsLineString &ring,
bool ccw,
float extrusionHeight );
290 void addExtrusionWallQuad(
const QVector3D &pt1,
const QVector3D &pt2,
float height );
291 void ringToEarcutPoints(
const QgsLineString *ring, std::vector<std::array<double, 2>> &polyline, QHash<std::array<double, 2>*,
float> *zHash );
292 std::vector<QVector3D> generateConstrainedDelaunayTriangles(
const QgsPolygon *polygonNew );
293 std::vector<QVector3D> generateEarcutTriangles(
const QgsPolygon *polygonNew );
296 bool mAddNormals =
false;
297 bool mInvertNormals =
false;
298 bool mAddBackFaces =
false;
299 bool mAddTextureCoords =
false;
300 bool mOutputZUp =
false;
301 QVector<float> mData;
302 int mStride = 3 *
sizeof( float );
303 bool mInputZValueIgnored =
false;
306 float mTextureRotation = 0.0f;
310 float mZMin = std::numeric_limits<float>::max();
311 float mZMax = -std::numeric_limits<float>::max();
TriangulationAlgorithm
Triangulation algorithms.
QFlags< ExtrusionFace > ExtrusionFaces
Tessellator extrusion face types.
Line string geometry type, with support for z-dimension and m-values.
Multi polygon geometry collection.
Point geometry type, with support for z-dimension and m-values.
A rectangle specified with double values.
float textureRotation() const
Returns the rotation of texture UV coordinates (in degrees).
bool hasTextureUVs() const
Returns whether texture UV coordinates are being added to the output data (true) or not (false).
void setOrigin(const QgsVector3D &origin)
Sets the origin point of the map.
bool isZValueIgnored() const
Returns whether Z values from the input geometries are ignored (true) or not (false).
int stride() const
Returns size of one vertex entry in bytes.
int indexStride() const
Returns size of one index entry in bytes.
bool hasBackFacesEnabled() const
Returns whether back faces are being added to the output data (true) or not (false).
float zMinimum() const
Returns minimal Z value of the data (in world coordinates).
Qgis::ExtrusionFaces extrusionFaces() const
Returns which faces are generated during extrusion.
QgsVector3D origin() const
Returns the origin point of the map.
friend uint qHash(const VertexPoint &key)
QString error() const
Returns a descriptive error string if the tessellation failed.
Qgis::TriangulationAlgorithm triangulationAlgorithm() const
Returns the algorithm used for triangulation.
void setOutputZUp(bool zUp)
Sets whether the "up" direction should be the Z axis on output (true), otherwise the "up" direction w...
bool isOutputZUp() const
Returns whether the "up" direction should be the Z axis on output (true), otherwise the "up" directio...
bool hasNormals() const
Returns whether normals are being added to the output data (true) or not (false).
bool hasInvertedNormals() const
Returns whether normals are inverted (true) or not (false).
float zMaximum() const
Returns maximal Z value of the data (in world coordinates).
A 3D vector (similar to QVector3D) with the difference that it uses double precision instead of singl...
As part of the API refactoring and improvements which landed in the Processing API was substantially reworked from the x version This was done in order to allow much of the underlying Processing framework to be ported into allowing algorithms to be written in pure substantial changes are required in order to port existing x Processing algorithms for QGIS x The most significant changes are outlined not GeoAlgorithm For algorithms which operate on features one by consider subclassing the QgsProcessingFeatureBasedAlgorithm class This class allows much of the boilerplate code for looping over features from a vector layer to be bypassed and instead requires implementation of a processFeature method Ensure that your algorithm(or algorithm 's parent class) implements the new pure virtual createInstance(self) call
uint qHash(const QVariant &variant)
Hash for QVariant.
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)