Skip to content

Commit

Permalink
Add spell check variants for tessellate
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Nov 26, 2017
1 parent 006da6e commit 41089f2
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 35 deletions.
6 changes: 6 additions & 0 deletions scripts/spell_check/spelling.dat
Original file line number Diff line number Diff line change
Expand Up @@ -6880,6 +6880,12 @@ terriory:territory
territorist:terrorist
territoy:territory
terroist:terrorist
tesellate:tessellate
tesselate:tessellate
tesellation:tessellation
tesselation:tessellation
tesellator:tessellator
tesselator:tessellator
testiclular:testicular
testomony:testimony
texual:textual
Expand Down
2 changes: 1 addition & 1 deletion src/3d/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ SET(QGIS_3D_SRCS
chunks/qgschunkqueuejob_p.cpp

processing/qgs3dalgorithms.cpp
processing/qgsalgorithmtesselate.cpp
processing/qgsalgorithmtessellate.cpp

symbols/qgsabstract3dsymbol.cpp
symbols/qgsline3dsymbol.cpp
Expand Down
4 changes: 2 additions & 2 deletions src/3d/processing/qgs3dalgorithms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
***************************************************************************/

#include "qgs3dalgorithms.h"
#include "qgsalgorithmtesselate.h"
#include "qgsalgorithmtessellate.h"
#include "qgsapplication.h"

///@cond PRIVATE
Expand Down Expand Up @@ -52,7 +52,7 @@ bool Qgs3DAlgorithms::supportsNonFileBasedOutput() const

void Qgs3DAlgorithms::loadAlgorithms()
{
addAlgorithm( new QgsTesselateAlgorithm() );
addAlgorithm( new QgsTessellateAlgorithm() );
}


Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/***************************************************************************
qgsalgorithmtesselate.cpp
qgsalgorithmtessellate.cpp
---------------------
begin : November 2017
copyright : (C) 2017 by Nyall Dawson
Expand All @@ -15,66 +15,66 @@
* *
***************************************************************************/

#include "qgsalgorithmtesselate.h"
#include "qgsalgorithmtessellate.h"
#include "qgstessellator.h"
#include "qgsmultipolygon.h"
#include "qgstriangle.h"
///@cond PRIVATE

QString QgsTesselateAlgorithm::name() const
QString QgsTessellateAlgorithm::name() const
{
return QStringLiteral( "tesselate" );
return QStringLiteral( "tessellate" );
}

QString QgsTesselateAlgorithm::displayName() const
QString QgsTessellateAlgorithm::displayName() const
{
return QObject::tr( "Tesselate geometry" );
return QObject::tr( "Tessellate geometry" );
}

QStringList QgsTesselateAlgorithm::tags() const
QStringList QgsTessellateAlgorithm::tags() const
{
return QObject::tr( "3d,triangle" ).split( ',' );
}

QString QgsTesselateAlgorithm::group() const
QString QgsTessellateAlgorithm::group() const
{
return QObject::tr( "Vector geometry" );
}

QString QgsTesselateAlgorithm::outputName() const
QString QgsTessellateAlgorithm::outputName() const
{
return QObject::tr( "Tesselated" );
return QObject::tr( "Tessellated" );
}

QgsProcessing::SourceType QgsTesselateAlgorithm::outputLayerType() const
QgsProcessing::SourceType QgsTessellateAlgorithm::outputLayerType() const
{
return QgsProcessing::TypeVectorPolygon;
}

QgsWkbTypes::Type QgsTesselateAlgorithm::outputWkbType( QgsWkbTypes::Type inputWkbType ) const
QgsWkbTypes::Type QgsTessellateAlgorithm::outputWkbType( QgsWkbTypes::Type inputWkbType ) const
{
Q_UNUSED( inputWkbType );
return QgsWkbTypes::MultiPolygonZ;
}

QString QgsTesselateAlgorithm::shortHelpString() const
QString QgsTessellateAlgorithm::shortHelpString() const
{
return QObject::tr( "This algorithm tesselates a polygon geometry layer, dividing the geometries into triangular components." )
return QObject::tr( "This algorithm tessellates a polygon geometry layer, dividing the geometries into triangular components." )
+ QStringLiteral( "\n\n" )
+ QObject::tr( "The output layer consists of multipolygon geometries for each input feature, with each multipolygon consisting of multiple triangle component polygons." );
}

QList<int> QgsTesselateAlgorithm::inputLayerTypes() const
QList<int> QgsTessellateAlgorithm::inputLayerTypes() const
{
return QList<int>() << QgsProcessing::TypeVectorPolygon;
}

QgsTesselateAlgorithm *QgsTesselateAlgorithm::createInstance() const
QgsTessellateAlgorithm *QgsTessellateAlgorithm::createInstance() const
{
return new QgsTesselateAlgorithm();
return new QgsTessellateAlgorithm();
}

QgsFeature QgsTesselateAlgorithm::processFeature( const QgsFeature &feature, QgsProcessingFeedback * )
QgsFeature QgsTessellateAlgorithm::processFeature( const QgsFeature &feature, QgsProcessingFeedback * )
{
QgsFeature f = feature;
if ( f.hasGeometry() )
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/***************************************************************************
qgsalgorithmtesselate.h
qgsalgorithmtessellate.h
---------------------
begin : November 2017
copyright : (C) 2017 by Nyall Dawson
Expand All @@ -15,8 +15,8 @@
* *
***************************************************************************/

#ifndef QGSALGORITHMTESSELATE_H
#define QGSALGORITHMTESSELATE_H
#ifndef QGSALGORITHMTESSELLATE_H
#define QGSALGORITHMTESSELLATE_H

#define SIP_NO_FILE

Expand All @@ -26,21 +26,21 @@
///@cond PRIVATE

/**
* Native tesselate algorithm.
* Native tessellate algorithm.
*/
class QgsTesselateAlgorithm : public QgsProcessingFeatureBasedAlgorithm
class QgsTessellateAlgorithm : public QgsProcessingFeatureBasedAlgorithm
{

public:

QgsTesselateAlgorithm() = default;
QgsTessellateAlgorithm() = default;
QString name() const override;
QString displayName() const override;
virtual QStringList tags() const override;
QString group() const override;
QString shortHelpString() const override;
QList<int> inputLayerTypes() const override;
QgsTesselateAlgorithm *createInstance() const override SIP_FACTORY;
QgsTessellateAlgorithm *createInstance() const override SIP_FACTORY;

protected:
QString outputName() const override;
Expand All @@ -54,6 +54,6 @@ class QgsTesselateAlgorithm : public QgsProcessingFeatureBasedAlgorithm

///@endcond PRIVATE

#endif // QGSALGORITHMTESSELATE_H
#endif // QGSALGORITHMTESSELLATE_H


8 changes: 4 additions & 4 deletions src/3d/qgstessellatedpolygongeometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,16 @@ void QgsTessellatedPolygonGeometry::setPolygons( const QList<QgsPolygon *> &poly
qDeleteAll( mPolygons );
mPolygons = polygons;

QgsTessellator tesselator( origin.x(), origin.y(), mWithNormals );
QgsTessellator tessellator( origin.x(), origin.y(), mWithNormals );
for ( int i = 0; i < polygons.count(); ++i )
{
QgsPolygon *polygon = polygons.at( i );
float extr = extrusionHeightPerPolygon.isEmpty() ? extrusionHeight : extrusionHeightPerPolygon.at( i );
tesselator.addPolygon( *polygon, extr );
tessellator.addPolygon( *polygon, extr );
}

QByteArray data( ( const char * )tesselator.data().constData(), tesselator.data().count() * sizeof( float ) );
int nVerts = data.count() / tesselator.stride();
QByteArray data( ( const char * )tessellator.data().constData(), tessellator.data().count() * sizeof( float ) );
int nVerts = data.count() / tessellator.stride();

mVertexBuffer->setData( data );
mPositionAttribute->setCount( nVerts );
Expand Down
2 changes: 1 addition & 1 deletion src/3d/qgstessellator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ void QgsTessellator::addPolygon( const QgsPolygon &polygon, float extrusionHeigh

QgsPoint getPointFromData( QVector< float >::const_iterator &it )
{
// tesselator geometry is x, z, -y
// tessellator geometry is x, z, -y
double x = *it;
++it;
double z = *it;
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/processing/qgsalgorithmsubdivide.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ QString QgsSubdivideAlgorithm::displayName() const

QStringList QgsSubdivideAlgorithm::tags() const
{
return QObject::tr( "subdivide,segmentize,split,tesselate" ).split( ',' );
return QObject::tr( "subdivide,segmentize,split,tessellate" ).split( ',' );
}

QString QgsSubdivideAlgorithm::group() const
Expand Down

0 comments on commit 41089f2

Please sign in to comment.