Skip to content

Commit

Permalink
Standardise enum capitalization and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Nov 2, 2017
1 parent 60e98be commit 28ee440
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 26 deletions.
23 changes: 15 additions & 8 deletions src/analysis/interpolation/qgsinterpolator.h
Expand Up @@ -26,7 +26,11 @@ class QgsVectorLayer;
class QgsGeometry;
class QgsFeedback;

struct ANALYSIS_EXPORT vertexData
/**
* Interpolation data for an individual source vertex.
* \since QGIS 3.0
*/
struct ANALYSIS_EXPORT QgsInterpolatorVertexData
{
double x;
double y;
Expand All @@ -36,17 +40,19 @@ struct ANALYSIS_EXPORT vertexData
/**
* \ingroup analysis
* Interface class for interpolations. Interpolators take
the vertices of a vector layer as base data. The z-Value
can be an attribute or the z-coordinates in case of 25D types*/
* the vertices of a vector layer as base data. The z-Value
* can be an attribute or the z-coordinates in case of 3D types.
*/
class ANALYSIS_EXPORT QgsInterpolator
{
public:

//! Describes the type of input data
enum InputType
enum SourceType
{
POINTS,
STRUCTURE_LINES,
BREAK_LINES
SourcePoints, //!< Point source
SourceStructureLines, //!< Structure lines
SourceBreakLines, //!< Break lines
};

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

QgsInterpolator( const QList<QgsInterpolator::LayerData> &layerData );
Expand Down
34 changes: 17 additions & 17 deletions src/analysis/interpolation/qgstininterpolator.cpp
Expand Up @@ -157,7 +157,7 @@ void QgsTINInterpolator::initialize()
}
}

int QgsTINInterpolator::insertData( QgsFeature *f, bool zCoord, int attr, InputType type )
int QgsTINInterpolator::insertData( QgsFeature *f, bool zCoord, int attr, SourceType type )
{
if ( !f )
{
Expand Down Expand Up @@ -249,7 +249,7 @@ int QgsTINInterpolator::insertData( QgsFeature *f, bool zCoord, int attr, InputT
FALLTHROUGH;
case QgsWkbTypes::LineString:
{
if ( type != POINTS )
if ( type != SourcePoints )
{
line = new Line3D();
}
Expand All @@ -267,7 +267,7 @@ int QgsTINInterpolator::insertData( QgsFeature *f, bool zCoord, int attr, InputT
z = attributeValue;
}

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

if ( type != POINTS )
if ( type != SourcePoints )
{
mTriangulation->addLine( line, type == BREAK_LINES );
mTriangulation->addLine( line, type == SourceBreakLines );
}
break;
}
Expand All @@ -293,7 +293,7 @@ int QgsTINInterpolator::insertData( QgsFeature *f, bool zCoord, int attr, InputT
currentWkbPtr >> nLines;
for ( int index = 0; index < nLines; ++index )
{
if ( type != POINTS )
if ( type != SourcePoints )
{
line = new Line3D();
}
Expand All @@ -311,7 +311,7 @@ int QgsTINInterpolator::insertData( QgsFeature *f, bool zCoord, int attr, InputT
z = attributeValue;
}

if ( type == POINTS )
if ( type == SourcePoints )
{
//todo: handle error code -100
mTriangulation->addPoint( new QgsPoint( x, y, z ) );
Expand All @@ -321,9 +321,9 @@ int QgsTINInterpolator::insertData( QgsFeature *f, bool zCoord, int attr, InputT
line->insertPoint( new QgsPoint( x, y, z ) );
}
}
if ( type != POINTS )
if ( type != SourcePoints )
{
mTriangulation->addLine( line, type == BREAK_LINES );
mTriangulation->addLine( line, type == SourceBreakLines );
}
}
break;
Expand All @@ -337,7 +337,7 @@ int QgsTINInterpolator::insertData( QgsFeature *f, bool zCoord, int attr, InputT
currentWkbPtr >> nRings;
for ( int index = 0; index < nRings; ++index )
{
if ( type != POINTS )
if ( type != SourcePoints )
{
line = new Line3D();
}
Expand All @@ -355,7 +355,7 @@ int QgsTINInterpolator::insertData( QgsFeature *f, bool zCoord, int attr, InputT
{
z = attributeValue;
}
if ( type == POINTS )
if ( type == SourcePoints )
{
//todo: handle error code -100
mTriangulation->addPoint( new QgsPoint( x, y, z ) );
Expand All @@ -366,9 +366,9 @@ int QgsTINInterpolator::insertData( QgsFeature *f, bool zCoord, int attr, InputT
}
}

if ( type != POINTS )
if ( type != SourcePoints )
{
mTriangulation->addLine( line, type == BREAK_LINES );
mTriangulation->addLine( line, type == SourceBreakLines );
}
}
break;
Expand All @@ -388,7 +388,7 @@ int QgsTINInterpolator::insertData( QgsFeature *f, bool zCoord, int attr, InputT
currentWkbPtr >> nRings;
for ( int index2 = 0; index2 < nRings; ++index2 )
{
if ( type != POINTS )
if ( type != SourcePoints )
{
line = new Line3D();
}
Expand All @@ -405,7 +405,7 @@ int QgsTINInterpolator::insertData( QgsFeature *f, bool zCoord, int attr, InputT
{
z = attributeValue;
}
if ( type == POINTS )
if ( type == SourcePoints )
{
//todo: handle error code -100
mTriangulation->addPoint( new QgsPoint( x, y, z ) );
Expand All @@ -415,9 +415,9 @@ int QgsTINInterpolator::insertData( QgsFeature *f, bool zCoord, int attr, InputT
line->insertPoint( new QgsPoint( x, y, z ) );
}
}
if ( type != POINTS )
if ( type != SourcePoints )
{
mTriangulation->addLine( line, type == BREAK_LINES );
mTriangulation->addLine( line, type == SourceBreakLines );
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/interpolation/qgstininterpolator.h
Expand Up @@ -93,7 +93,7 @@ class ANALYSIS_EXPORT QgsTINInterpolator: public QgsInterpolator
\param attr interpolation attribute index (if zCoord is false)
\param type point/structure line, break line
\returns 0 in case of success, -1 if the feature could not be inserted because of numerical problems*/
int insertData( QgsFeature *f, bool zCoord, int attr, InputType type );
int insertData( QgsFeature *f, bool zCoord, int attr, SourceType type );
};

#endif

0 comments on commit 28ee440

Please sign in to comment.