Skip to content

Commit 28ee440

Browse files
committed
Standardise enum capitalization and formatting
1 parent 60e98be commit 28ee440

File tree

3 files changed

+33
-26
lines changed

3 files changed

+33
-26
lines changed

src/analysis/interpolation/qgsinterpolator.h

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ class QgsVectorLayer;
2626
class QgsGeometry;
2727
class QgsFeedback;
2828

29-
struct ANALYSIS_EXPORT vertexData
29+
/**
30+
* Interpolation data for an individual source vertex.
31+
* \since QGIS 3.0
32+
*/
33+
struct ANALYSIS_EXPORT QgsInterpolatorVertexData
3034
{
3135
double x;
3236
double y;
@@ -36,17 +40,19 @@ struct ANALYSIS_EXPORT vertexData
3640
/**
3741
* \ingroup analysis
3842
* Interface class for interpolations. Interpolators take
39-
the vertices of a vector layer as base data. The z-Value
40-
can be an attribute or the z-coordinates in case of 25D types*/
43+
* the vertices of a vector layer as base data. The z-Value
44+
* can be an attribute or the z-coordinates in case of 3D types.
45+
*/
4146
class ANALYSIS_EXPORT QgsInterpolator
4247
{
4348
public:
49+
4450
//! Describes the type of input data
45-
enum InputType
51+
enum SourceType
4652
{
47-
POINTS,
48-
STRUCTURE_LINES,
49-
BREAK_LINES
53+
SourcePoints, //!< Point source
54+
SourceStructureLines, //!< Structure lines
55+
SourceBreakLines, //!< Break lines
5056
};
5157

5258
//! A layer together with the information about interpolation attribute / z-coordinate interpolation and the type (point, structure line, breakline)
@@ -55,7 +61,8 @@ class ANALYSIS_EXPORT QgsInterpolator
5561
QgsVectorLayer *vectorLayer = nullptr;
5662
bool zCoordInterpolation;
5763
int interpolationAttribute;
58-
QgsInterpolator::InputType mInputType;
64+
//! Source type
65+
QgsInterpolator::SourceType sourceType = SourcePoints;
5966
};
6067

6168
QgsInterpolator( const QList<QgsInterpolator::LayerData> &layerData );

src/analysis/interpolation/qgstininterpolator.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ void QgsTINInterpolator::initialize()
157157
}
158158
}
159159

160-
int QgsTINInterpolator::insertData( QgsFeature *f, bool zCoord, int attr, InputType type )
160+
int QgsTINInterpolator::insertData( QgsFeature *f, bool zCoord, int attr, SourceType type )
161161
{
162162
if ( !f )
163163
{
@@ -249,7 +249,7 @@ int QgsTINInterpolator::insertData( QgsFeature *f, bool zCoord, int attr, InputT
249249
FALLTHROUGH;
250250
case QgsWkbTypes::LineString:
251251
{
252-
if ( type != POINTS )
252+
if ( type != SourcePoints )
253253
{
254254
line = new Line3D();
255255
}
@@ -267,7 +267,7 @@ int QgsTINInterpolator::insertData( QgsFeature *f, bool zCoord, int attr, InputT
267267
z = attributeValue;
268268
}
269269

270-
if ( type == POINTS )
270+
if ( type == SourcePoints )
271271
{
272272
//todo: handle error code -100
273273
mTriangulation->addPoint( new QgsPoint( x, y, z ) );
@@ -278,9 +278,9 @@ int QgsTINInterpolator::insertData( QgsFeature *f, bool zCoord, int attr, InputT
278278
}
279279
}
280280

281-
if ( type != POINTS )
281+
if ( type != SourcePoints )
282282
{
283-
mTriangulation->addLine( line, type == BREAK_LINES );
283+
mTriangulation->addLine( line, type == SourceBreakLines );
284284
}
285285
break;
286286
}
@@ -293,7 +293,7 @@ int QgsTINInterpolator::insertData( QgsFeature *f, bool zCoord, int attr, InputT
293293
currentWkbPtr >> nLines;
294294
for ( int index = 0; index < nLines; ++index )
295295
{
296-
if ( type != POINTS )
296+
if ( type != SourcePoints )
297297
{
298298
line = new Line3D();
299299
}
@@ -311,7 +311,7 @@ int QgsTINInterpolator::insertData( QgsFeature *f, bool zCoord, int attr, InputT
311311
z = attributeValue;
312312
}
313313

314-
if ( type == POINTS )
314+
if ( type == SourcePoints )
315315
{
316316
//todo: handle error code -100
317317
mTriangulation->addPoint( new QgsPoint( x, y, z ) );
@@ -321,9 +321,9 @@ int QgsTINInterpolator::insertData( QgsFeature *f, bool zCoord, int attr, InputT
321321
line->insertPoint( new QgsPoint( x, y, z ) );
322322
}
323323
}
324-
if ( type != POINTS )
324+
if ( type != SourcePoints )
325325
{
326-
mTriangulation->addLine( line, type == BREAK_LINES );
326+
mTriangulation->addLine( line, type == SourceBreakLines );
327327
}
328328
}
329329
break;
@@ -337,7 +337,7 @@ int QgsTINInterpolator::insertData( QgsFeature *f, bool zCoord, int attr, InputT
337337
currentWkbPtr >> nRings;
338338
for ( int index = 0; index < nRings; ++index )
339339
{
340-
if ( type != POINTS )
340+
if ( type != SourcePoints )
341341
{
342342
line = new Line3D();
343343
}
@@ -355,7 +355,7 @@ int QgsTINInterpolator::insertData( QgsFeature *f, bool zCoord, int attr, InputT
355355
{
356356
z = attributeValue;
357357
}
358-
if ( type == POINTS )
358+
if ( type == SourcePoints )
359359
{
360360
//todo: handle error code -100
361361
mTriangulation->addPoint( new QgsPoint( x, y, z ) );
@@ -366,9 +366,9 @@ int QgsTINInterpolator::insertData( QgsFeature *f, bool zCoord, int attr, InputT
366366
}
367367
}
368368

369-
if ( type != POINTS )
369+
if ( type != SourcePoints )
370370
{
371-
mTriangulation->addLine( line, type == BREAK_LINES );
371+
mTriangulation->addLine( line, type == SourceBreakLines );
372372
}
373373
}
374374
break;
@@ -388,7 +388,7 @@ int QgsTINInterpolator::insertData( QgsFeature *f, bool zCoord, int attr, InputT
388388
currentWkbPtr >> nRings;
389389
for ( int index2 = 0; index2 < nRings; ++index2 )
390390
{
391-
if ( type != POINTS )
391+
if ( type != SourcePoints )
392392
{
393393
line = new Line3D();
394394
}
@@ -405,7 +405,7 @@ int QgsTINInterpolator::insertData( QgsFeature *f, bool zCoord, int attr, InputT
405405
{
406406
z = attributeValue;
407407
}
408-
if ( type == POINTS )
408+
if ( type == SourcePoints )
409409
{
410410
//todo: handle error code -100
411411
mTriangulation->addPoint( new QgsPoint( x, y, z ) );
@@ -415,9 +415,9 @@ int QgsTINInterpolator::insertData( QgsFeature *f, bool zCoord, int attr, InputT
415415
line->insertPoint( new QgsPoint( x, y, z ) );
416416
}
417417
}
418-
if ( type != POINTS )
418+
if ( type != SourcePoints )
419419
{
420-
mTriangulation->addLine( line, type == BREAK_LINES );
420+
mTriangulation->addLine( line, type == SourceBreakLines );
421421
}
422422
}
423423
}

src/analysis/interpolation/qgstininterpolator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class ANALYSIS_EXPORT QgsTINInterpolator: public QgsInterpolator
9393
\param attr interpolation attribute index (if zCoord is false)
9494
\param type point/structure line, break line
9595
\returns 0 in case of success, -1 if the feature could not be inserted because of numerical problems*/
96-
int insertData( QgsFeature *f, bool zCoord, int attr, InputType type );
96+
int insertData( QgsFeature *f, bool zCoord, int attr, SourceType type );
9797
};
9898

9999
#endif

0 commit comments

Comments
 (0)