Skip to content
Permalink
Browse files

Standardise enum capitalization and formatting

  • Loading branch information
nyalldawson committed Nov 2, 2017
1 parent 60e98be commit 28ee4408c314a9fed05e4fb0ade3dd0eb5ddf388
@@ -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;
@@ -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)
@@ -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 );
@@ -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 )
{
@@ -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();
}
@@ -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 ) );
@@ -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;
}
@@ -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();
}
@@ -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 ) );
@@ -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;
@@ -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();
}
@@ -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 ) );
@@ -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;
@@ -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();
}
@@ -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 ) );
@@ -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 );
}
}
}
@@ -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.
You can’t perform that action at this time.