24QString QgsTessellateAlgorithm::name()
const
26 return QStringLiteral(
"tessellate" );
29QString QgsTessellateAlgorithm::displayName()
const
31 return QObject::tr(
"Tessellate" );
34QStringList QgsTessellateAlgorithm::tags()
const
36 return QObject::tr(
"3d,triangle" ).split(
',' );
39QString QgsTessellateAlgorithm::group()
const
41 return QObject::tr(
"Vector geometry" );
44QString QgsTessellateAlgorithm::groupId()
const
46 return QStringLiteral(
"vectorgeometry" );
49QString QgsTessellateAlgorithm::outputName()
const
51 return QObject::tr(
"Tessellated" );
61 Q_UNUSED( inputWkbType )
65QString QgsTessellateAlgorithm::shortHelpString()
const
67 return QObject::tr(
"This algorithm tessellates a polygon geometry layer, dividing the geometries into triangular components." )
68 + QStringLiteral(
"\n\n" )
69 + QObject::tr(
"The output layer consists of multipolygon geometries for each input feature, with each multipolygon consisting of multiple triangle component polygons." );
72QList<int> QgsTessellateAlgorithm::inputLayerTypes()
const
77QgsTessellateAlgorithm *QgsTessellateAlgorithm::createInstance()
const
79 return new QgsTessellateAlgorithm();
99 const std::unique_ptr< QgsPolygon > p( qgsgeometry_cast< QgsPolygon * >( ms->
geometryN( i )->
segmentize() ) );
100 t.addPolygon( *p, 0 );
106 t.addPolygon( *p, 0 );
115 feedback->
reportError( QObject::tr(
"Feature ID %1 could not be divided into triangular components." ).arg( f.
id() ) );
virtual QgsAbstractGeometry * segmentize(double tolerance=M_PI/180., SegmentationToleranceType toleranceType=MaximumAngle) const
Returns a version of the geometry without curves.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
void clearGeometry()
Removes any geometry associated with the feature.
bool hasGeometry() const
Returns true if the feature has an associated geometry.
void setGeometry(const QgsGeometry &geometry)
Set the feature's geometry.
int numGeometries() const SIP_HOLDGIL
Returns the number of geometries within the collection.
const QgsAbstractGeometry * geometryN(int n) const
Returns a const reference to a geometry from within the collection.
A geometry is the spatial representation of a feature.
const QgsAbstractGeometry * constGet() const SIP_HOLDGIL
Returns a non-modifiable (const) reference to the underlying abstract geometry primitive.
QgsWkbTypes::Type wkbType() const SIP_HOLDGIL
Returns type of the geometry as a WKB type (point / linestring / polygon etc.)
bool isMultipart() const SIP_HOLDGIL
Returns true if WKB of the geometry is of WKBMulti* type.
QgsRectangle boundingBox() const
Returns the bounding box of the geometry.
Multi surface geometry collection.
Contains information about the context in which a processing algorithm is executed.
Base class for providing feedback from a processing algorithm.
virtual void reportError(const QString &error, bool fatalError=false)
Reports that the algorithm encountered an error while executing.
SourceType
Data source types enum.
@ TypeVectorPolygon
Vector polygon layers.
A rectangle specified with double values.
double xMinimum() const SIP_HOLDGIL
Returns the x minimum value (left side of rectangle).
double yMinimum() const SIP_HOLDGIL
Returns the y minimum value (bottom side of rectangle).
Class that takes care of tessellation of polygons into triangles.
static GeometryType geometryType(Type type) SIP_HOLDGIL
Returns the geometry type for a WKB type, e.g., both MultiPolygon and CurvePolygon would have a Polyg...
Type
The WKB type describes the number of dimensions a geometry has.
QList< QgsFeature > QgsFeatureList