Skip to content

Commit

Permalink
respect CamelCase for enums and their values
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Jan 11, 2017
1 parent 6be4505 commit 4467487
Show file tree
Hide file tree
Showing 76 changed files with 968 additions and 961 deletions.
7 changes: 7 additions & 0 deletions doc/api_break.dox
Expand Up @@ -1045,6 +1045,13 @@ QgsEditorWidgetFactory {#qgis_api_break_3_0_QgsEditorWidgetFactory}
- `alignmentFlag` has been removed. Use QgsFieldFormatter::representValue() instead
- `createCache` has been removed. Use QgsFieldFormatter::representValue() instead


QgsGeometryUtils {#qgis_api_break_3_0_QgsGeometryUtils}
----------------

- componentType enum has been renamed to ComponentType and its members were CamelCased too: VERTEX, RING and PART become Vertex, Ring and Part, respectively.


QgsGPSConnectionRegistry {#qgis_api_break_3_0_QgsGPSConnectionRegistry}
------------------------

Expand Down
14 changes: 7 additions & 7 deletions python/analysis/interpolation/NormVecDecorator.sip
Expand Up @@ -5,8 +5,8 @@ class NormVecDecorator : TriDecorator
%End

public:
/** Enumeration for the state of a point. NORMAL means, that the point is not on a breakline, BREAKLINE means that the point is on a breakline (but not an endpoint of it) and ENDPOINT means, that it is an endpoint of a breakline*/
enum pointState {NORMAL, BREAKLINE, ENDPOINT};
//! Enumeration for the state of a point. Normal means, that the point is not on a BreakLine, BreakLine means that the point is on a breakline (but not an end point of it) and EndPoint means, that it is an endpoint of a breakline
enum PointState {Normal, BreakLine, EndPoint};
NormVecDecorator();
NormVecDecorator( Triangulation* tin );
virtual ~NormVecDecorator();
Expand All @@ -28,12 +28,12 @@ class NormVecDecorator : TriDecorator
Vector3D* getNormal( int n ) const;
/** Finds out, in which triangle a point with coordinates x and y is and assigns the triangle points to p1, p2, p3 and the estimated normals to v1, v2, v3. The vectors are normaly taken from 'mNormVec', exept if p1, p2 or p3 is a point on a breakline. In this case, the normal is calculated on-the-fly. Returns false, if something went wrong and true otherwise*/
bool getTriangle( double x, double y, Point3D* p1 /Out/, Vector3D* v1 /Out/, Point3D* p2 /Out/, Vector3D* v2 /Out/, Point3D* p3 /Out/, Vector3D* v3 /Out/ );
/** This function behaves similar to the one above. Additionally, the numbers of the points are returned (ptn1, ptn2, ptn3) as well as the pointStates of the triangle points (state1, state2, state3)
/** This function behaves similar to the one above. Additionally, the numbers of the points are returned (ptn1, ptn2, ptn3) as well as the PointStates of the triangle points (state1, state2, state3)
* @note not available in Python bindings
*/
//bool getTriangle( double x, double y, Point3D* p1 /Out/, int* ptn1 /Out/, Vector3D* v1 /Out/, pointState* state1 /Out/, Point3D* p2 /Out/, int* ptn2 /Out/, Vector3D* v2 /Out/, pointState* state2 /Out/, Point3D* p3 /Out/, int* ptn3 /Out/, Vector3D* v3 /Out/, pointState* state3 /Out/);
//bool getTriangle( double x, double y, Point3D* p1 /Out/, int* ptn1 /Out/, Vector3D* v1 /Out/, PointState* state1 /Out/, Point3D* p2 /Out/, int* ptn2 /Out/, Vector3D* v2 /Out/, PointState* state2 /Out/, Point3D* p3 /Out/, int* ptn3 /Out/, Vector3D* v3 /Out/, PointState* state3 /Out/);
/** Returns the state of the point with the number 'pointno'*/
pointState getState( int pointno ) const;
PointState getState( int pointno ) const;
/** Sets an interpolator*/
void setTriangleInterpolator( TriangleInterpolator* inter );
/** Swaps the edge which is closest to the point with x and y coordinates (if this is possible) and forces recalculation of the concerned normals (if alreadyestimated is true)*/
Expand All @@ -43,6 +43,6 @@ class NormVecDecorator : TriDecorator
virtual bool saveAsShapefile( const QString& fileName ) const;

protected:
/** Sets the state (BREAKLINE, NORMAL, ENDPOINT) of a point*/
void setState( int pointno, pointState s );
/** Sets the state (BreakLine, Normal, EndPoint) of a point*/
void setState( int pointno, PointState s );
};
4 changes: 2 additions & 2 deletions python/analysis/interpolation/qgstininterpolator.sip
Expand Up @@ -5,12 +5,12 @@ class QgsTINInterpolator: QgsInterpolator
%End
public:
//describes the type of interpolation
enum TIN_INTERPOLATION
enum TINInterpolation
{
Linear,
CloughTocher
};
QgsTINInterpolator( const QList<QgsInterpolator::LayerData>& inputData, TIN_INTERPOLATION interpolation = Linear, bool showProgressDialog = false );
QgsTINInterpolator( const QList<QgsInterpolator::LayerData>& inputData, TINInterpolation interpolation = Linear, bool showProgressDialog = false );
~QgsTINInterpolator();

/** Calculates interpolation value for map coordinates x, y
Expand Down
2 changes: 1 addition & 1 deletion scripts/chkspelling_ag.sh
Expand Up @@ -34,7 +34,7 @@ else
FILES="."
fi

SPELLOK='(#spellok|<!--#spellok-->)$'
SPELLOK='(#\s*spellok|<!--#\s*spellok-->)$'


exec 5>&1
Expand Down
46 changes: 23 additions & 23 deletions src/analysis/interpolation/CloughTocherInterpolator.cc
Expand Up @@ -260,7 +260,7 @@ void CloughTocherInterpolator::init( double x, double y )//version, which has th
{
Vector3D v1, v2, v3;//normals at the three data points
int ptn1, ptn2, ptn3;//numbers of the vertex points
NormVecDecorator::pointState state1, state2, state3;//states of the vertex points (NORMAL, BREAKLINE, ENDPOINT possible)
NormVecDecorator::PointState state1, state2, state3;//states of the vertex points (Normal, BreakLine, EndPoint possible)

if ( mTIN )
{
Expand Down Expand Up @@ -309,62 +309,62 @@ void CloughTocherInterpolator::init( double x, double y )//version, which has th
cp10.setY(( point1.getY() + point2.getY() + point3.getY() ) / 3 );

//set the derivatives of the points to new values if they are on a breakline
if ( state1 == NormVecDecorator::BREAKLINE )
if ( state1 == NormVecDecorator::BreakLine )
{
Vector3D target1;
if ( mTIN->calcNormalForPoint( x, y, ptn1, &target1 ) )
{
der1X = -target1.getX() / target1.getZ();
der1Y = -target1.getY() / target1.getZ();

if ( state2 == NormVecDecorator::NORMAL )
if ( state2 == NormVecDecorator::Normal )
{
//recalculate cp1
cp1.setZ( point1.getZ() + ( cp1.getX() - point1.getX() )*der1X + ( cp1.getY() - point1.getY() )*der1Y );
}
if ( state3 == NormVecDecorator::NORMAL )
if ( state3 == NormVecDecorator::Normal )
{
//recalculate cp6
cp6.setZ( point1.getZ() + ( cp6.getX() - point1.getX() )*der1X + ( cp6.getY() - point1.getY() )*der1Y );
}
}
}

if ( state2 == NormVecDecorator::BREAKLINE )
if ( state2 == NormVecDecorator::BreakLine )
{
Vector3D target2;
if ( mTIN->calcNormalForPoint( x, y, ptn2, &target2 ) )
{
der2X = -target2.getX() / target2.getZ();
der2Y = -target2.getY() / target2.getZ();

if ( state1 == NormVecDecorator::NORMAL )
if ( state1 == NormVecDecorator::Normal )
{
//recalculate cp2
cp2.setZ( point2.getZ() + ( cp2.getX() - point2.getX() )*der2X + ( cp2.getY() - point2.getY() )*der2Y );
}
if ( state3 == NormVecDecorator::NORMAL )
if ( state3 == NormVecDecorator::Normal )
{
//recalculate cp9
cp9.setZ( point2.getZ() + ( cp9.getX() - point2.getX() )*der2X + ( cp9.getY() - point2.getY() )*der2Y );
}
}
}

if ( state3 == NormVecDecorator::BREAKLINE )
if ( state3 == NormVecDecorator::BreakLine )
{
Vector3D target3;
if ( mTIN->calcNormalForPoint( x, y, ptn3, &target3 ) )
{
der3X = -target3.getX() / target3.getZ();
der3Y = -target3.getY() / target3.getZ();

if ( state1 == NormVecDecorator::NORMAL )
if ( state1 == NormVecDecorator::Normal )
{
//recalculate cp14
cp14.setZ( point3.getZ() + ( cp14.getX() - point3.getX() )*der3X + ( cp14.getY() - point3.getY() )*der3Y );
}
if ( state2 == NormVecDecorator::NORMAL )
if ( state2 == NormVecDecorator::Normal )
{
//recalculate cp16
cp16.setZ( point3.getZ() + ( cp16.getX() - point3.getX() )*der3X + ( cp16.getY() - point3.getY() )*der3Y );
Expand Down Expand Up @@ -506,7 +506,7 @@ void CloughTocherInterpolator::init( double x, double y )//version which has uni
{
Vector3D v1, v2, v3;//normals at the three data points
int ptn1, ptn2, ptn3;//numbers of the vertex points
NormVecDecorator::pointState state1, state2, state3;//states of the vertex points (NORMAL, BREAKLINE, ENDPOINT possible)
NormVecDecorator::PointState state1, state2, state3;//states of the vertex points (Normal, BreakLine, EndPoint possible)

if ( mTIN )
{
Expand Down Expand Up @@ -562,51 +562,51 @@ void CloughTocherInterpolator::init( double x, double y )//version which has uni
Vector3D tmp( 0, 0, 0 );

//point1
if ( state1 == NormVecDecorator::BREAKLINE )
if ( state1 == NormVecDecorator::BreakLine )
{
if ( mTIN->calcNormalForPoint( x, y, ptn1, &tmp ) )
{
tmpx = -tmp.getX() / tmp.getZ();
tmpy = -tmp.getY() / tmp.getZ();
if ( state3 == NormVecDecorator::NORMAL )
if ( state3 == NormVecDecorator::Normal )
{
cp6.setZ( point1.getZ() + (( point3.getX() - point1.getX() ) / 3 )*tmpx + (( point3.getY() - point1.getY() ) / 3 )*tmpy );
}
if ( state2 == NormVecDecorator::NORMAL )
if ( state2 == NormVecDecorator::Normal )
{
cp1.setZ( point1.getZ() + (( point2.getX() - point1.getX() ) / 3 )*tmpx + (( point2.getY() - point1.getY() ) / 3 )*tmpy );
}
}
}

if ( state2 == NormVecDecorator::BREAKLINE )
if ( state2 == NormVecDecorator::Breakline )
{
if ( mTIN->calcNormalForPoint( x, y, ptn2, &tmp ) )
{
tmpx = -tmp.getX() / tmp.getZ();
tmpy = -tmp.getY() / tmp.getZ();
if ( state1 == NormVecDecorator::NORMAL )
if ( state1 == NormVecDecorator::Normal )
{
cp2.setZ( point2.getZ() + (( point1.getX() - point2.getX() ) / 3 )*tmpx + (( point1.getY() - point2.getY() ) / 3 )*tmpy );
}
if ( state3 == NormVecDecorator::NORMAL )
if ( state3 == NormVecDecorator::Normal )
{
cp9.setZ( point2.getZ() + (( point3.getX() - point2.getX() ) / 3 )*tmpx + (( point3.getY() - point2.getY() ) / 3 )*tmpy );
}
}
}

if ( state3 == NormVecDecorator::BREAKLINE )
if ( state3 == NormVecDecorator::Breakline )
{
if ( mTIN->calcNormalForPoint( x, y, ptn3, &tmp ) )
{
tmpx = -tmp.getX() / tmp.getZ();
tmpy = -tmp.getY() / tmp.getZ();
if ( state1 == NormVecDecorator::NORMAL )
if ( state1 == NormVecDecorator::Normal )
{
cp14.setZ( point3.getZ() + (( point1.getX() - point3.getX() ) / 3 )*tmpx + (( point1.getY() - point3.getY() ) / 3 )*tmpy );
}
if ( state2 == NormVecDecorator::NORMAL )
if ( state2 == NormVecDecorator::Normal )
{
cp16.setZ( point3.getZ() + (( point2.getX() - point3.getX() ) / 3 )*tmpx + (( point2.getY() - point3.getY() ) / 3 )*tmpy );
}
Expand All @@ -618,7 +618,7 @@ void CloughTocherInterpolator::init( double x, double y )//version which has uni

cp3.setX( point1.getX() + ( cp10.getX() - point1.getX() ) / 3 );
cp3.setY( point1.getY() + ( cp10.getY() - point1.getY() ) / 3 );
if ( state1 == NormVecDecorator::BREAKLINE )
if ( state1 == NormVecDecorator::Breakline )
{
MathUtils::normalFromPoints( &point1, &cp1, &cp6, &normal );
//recalculate der1X and der1Y
Expand All @@ -632,7 +632,7 @@ void CloughTocherInterpolator::init( double x, double y )//version which has uni

cp5.setX( point2.getX() + ( cp10.getX() - point2.getX() ) / 3 );
cp5.setY( point2.getY() + ( cp10.getY() - point2.getY() ) / 3 );
if ( state2 == NormVecDecorator::BREAKLINE )
if ( state2 == NormVecDecorator::Breakline )
{
MathUtils::normalFromPoints( &point2, &cp9, &cp2, &normal );
//recalculate der2X and der2Y
Expand All @@ -645,7 +645,7 @@ void CloughTocherInterpolator::init( double x, double y )//version which has uni

cp15.setX( point3.getX() + ( cp10.getX() - point3.getX() ) / 3 );
cp15.setY( point3.getY() + ( cp10.getY() - point3.getY() ) / 3 );
if ( state3 == NormVecDecorator::BREAKLINE )
if ( state3 == NormVecDecorator::Breakline )
{
MathUtils::normalFromPoints( &point3, &cp14, &cp16, &normal );
//recalculate der3X and der3Y
Expand Down
14 changes: 7 additions & 7 deletions src/analysis/interpolation/NormVecDecorator.cc
Expand Up @@ -308,7 +308,7 @@ bool NormVecDecorator::getTriangle( double x, double y, Point3D* p1, Vector3D* v
}
}

NormVecDecorator::pointState NormVecDecorator::getState( int pointno ) const
NormVecDecorator::PointState NormVecDecorator::getState( int pointno ) const
{
if ( pointno >= 0 )
{
Expand All @@ -322,7 +322,7 @@ NormVecDecorator::pointState NormVecDecorator::getState( int pointno ) const
}


bool NormVecDecorator::getTriangle( double x, double y, Point3D* p1, int* ptn1, Vector3D* v1, pointState* state1, Point3D* p2, int* ptn2, Vector3D* v2, pointState* state2, Point3D* p3, int* ptn3, Vector3D* v3, pointState* state3 )
bool NormVecDecorator::getTriangle( double x, double y, Point3D* p1, int* ptn1, Vector3D* v1, PointState* state1, Point3D* p2, int* ptn2, Vector3D* v2, PointState* state2, Point3D* p3, int* ptn3, Vector3D* v3, PointState* state3 )
{
if ( p1 && p2 && p3 && v1 && v2 && v3 && ptn1 && ptn2 && ptn3 && state1 && state2 && state3 )
{
Expand Down Expand Up @@ -377,7 +377,7 @@ bool NormVecDecorator::estimateFirstDerivative( int pointno )
int numberofbreaks = 0;//number of counted breaklines
double weights = 0;//sum of the weights
double currentweight = 0;//current weight
pointState status;
PointState status;

QList<int>* vlist = getSurroundingTriangles( pointno );//get the value list

Expand Down Expand Up @@ -468,15 +468,15 @@ bool NormVecDecorator::estimateFirstDerivative( int pointno )

if ( numberofbreaks == 0 )
{
status = NORMAL;
status = Normal;
}
else if ( numberofbreaks == 1 )
{
status = ENDPOINT;
status = EndPoint;
}
else
{
status = BREAKLINE;
status = BreakLine;
}

delete vlist;
Expand Down Expand Up @@ -558,7 +558,7 @@ void NormVecDecorator::eliminateHorizontalTriangles()
}
}

void NormVecDecorator::setState( int pointno, pointState s )
void NormVecDecorator::setState( int pointno, PointState s )
{
if ( pointno >= 0 )
{
Expand Down
20 changes: 10 additions & 10 deletions src/analysis/interpolation/NormVecDecorator.h
Expand Up @@ -30,8 +30,8 @@ class QProgressDialog;
class ANALYSIS_EXPORT NormVecDecorator: public TriDecorator
{
public:
//! Enumeration for the state of a point. NORMAL means, that the point is not on a breakline, BREAKLINE means that the point is on a breakline (but not an endpoint of it) and ENDPOINT means, that it is an endpoint of a breakline
enum pointState {NORMAL, BREAKLINE, ENDPOINT};
//! Enumeration for the state of a point. Normal means, that the point is not on a BreakLine, BreakLine means that the point is on a breakline (but not an end point of it) and EndPoint means, that it is an endpoint of a breakline.
enum PointState {Normal, BreakLine, EndPoint};
NormVecDecorator();
NormVecDecorator( Triangulation* tin );
virtual ~NormVecDecorator();
Expand All @@ -54,12 +54,12 @@ class ANALYSIS_EXPORT NormVecDecorator: public TriDecorator
//! Finds out, in which triangle a point with coordinates x and y is and assigns the triangle points to p1, p2, p3 and the estimated normals to v1, v2, v3. The vectors are normaly taken from 'mNormVec', exept if p1, p2 or p3 is a point on a breakline. In this case, the normal is calculated on-the-fly. Returns false, if something went wrong and true otherwise
bool getTriangle( double x, double y, Point3D* p1, Vector3D* v1, Point3D* p2, Vector3D* v2, Point3D* p3, Vector3D* v3 );

/** This function behaves similar to the one above. Additionally, the numbers of the points are returned (ptn1, ptn2, ptn3) as well as the pointStates of the triangle points (state1, state2, state3)
/** This function behaves similar to the one above. Additionally, the numbers of the points are returned (ptn1, ptn2, ptn3) as well as the PointStates of the triangle points (state1, state2, state3)
* @note not available in Python bindings
*/
bool getTriangle( double x, double y, Point3D* p1, int* ptn1, Vector3D* v1, pointState* state1, Point3D* p2, int* ptn2, Vector3D* v2, pointState* state2, Point3D* p3, int* ptn3, Vector3D* v3, pointState* state3 );
bool getTriangle( double x, double y, Point3D* p1, int* ptn1, Vector3D* v1, PointState* state1, Point3D* p2, int* ptn2, Vector3D* v2, PointState* state2, Point3D* p3, int* ptn3, Vector3D* v3, PointState* state3 );
//! Returns the state of the point with the number 'pointno'
pointState getState( int pointno ) const;
PointState getState( int pointno ) const;
//! Sets an interpolator
void setTriangleInterpolator( TriangleInterpolator* inter ) override;
//! Swaps the edge which is closest to the point with x and y coordinates (if this is possible) and forces recalculation of the concerned normals (if alreadyestimated is true)
Expand All @@ -78,17 +78,17 @@ class ANALYSIS_EXPORT NormVecDecorator: public TriDecorator
//! Vector that stores the normals for the points. If 'estimateFirstDerivatives()' was called and there is a null pointer, this means, that the triangle point is on a breakline
QVector<Vector3D*>* mNormVec;
//! Vector who stores, it a point is not on a breakline, if it is a normal point of the breakline or if it is an endpoint of a breakline
QVector<pointState>* mPointState;
//! Sets the state (BREAKLINE, NORMAL, ENDPOINT) of a point
void setState( int pointno, pointState s );
QVector<PointState>* mPointState;
//! Sets the state (BreakLine, Normal, EndPoint) of a point
void setState( int pointno, PointState s );
};

inline NormVecDecorator::NormVecDecorator(): TriDecorator(), mInterpolator( nullptr ), mNormVec( new QVector<Vector3D*>( mDefaultStorageForNormals ) ), mPointState( new QVector<pointState>( mDefaultStorageForNormals ) )
inline NormVecDecorator::NormVecDecorator(): TriDecorator(), mInterpolator( nullptr ), mNormVec( new QVector<Vector3D*>( mDefaultStorageForNormals ) ), mPointState( new QVector<PointState>( mDefaultStorageForNormals ) )
{
alreadyestimated = false;
}

inline NormVecDecorator::NormVecDecorator( Triangulation* tin ): TriDecorator( tin ), mInterpolator( nullptr ), mNormVec( new QVector<Vector3D*>( mDefaultStorageForNormals ) ), mPointState( new QVector<pointState>( mDefaultStorageForNormals ) )
inline NormVecDecorator::NormVecDecorator( Triangulation* tin ): TriDecorator( tin ), mInterpolator( nullptr ), mNormVec( new QVector<Vector3D*>( mDefaultStorageForNormals ) ), mPointState( new QVector<PointState>( mDefaultStorageForNormals ) )
{
alreadyestimated = false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/interpolation/qgstininterpolator.cpp
Expand Up @@ -29,7 +29,7 @@
#include "qgswkbptr.h"
#include <QProgressDialog>

QgsTINInterpolator::QgsTINInterpolator( const QList<LayerData>& inputData, TIN_INTERPOLATION interpolation, bool showProgressDialog )
QgsTINInterpolator::QgsTINInterpolator( const QList<LayerData>& inputData, TINInterpolation interpolation, bool showProgressDialog )
: QgsInterpolator( inputData )
, mTriangulation( nullptr )
, mTriangleInterpolator( nullptr )
Expand Down
6 changes: 3 additions & 3 deletions src/analysis/interpolation/qgstininterpolator.h
Expand Up @@ -32,12 +32,12 @@ class ANALYSIS_EXPORT QgsTINInterpolator: public QgsInterpolator
{
public:
//describes the type of interpolation
enum TIN_INTERPOLATION
enum TINInterpolation
{
Linear,
CloughTocher
};
QgsTINInterpolator( const QList<LayerData>& inputData, TIN_INTERPOLATION interpolation = Linear, bool showProgressDialog = false );
QgsTINInterpolator( const QList<LayerData>& inputData, TINInterpolation interpolation = Linear, bool showProgressDialog = false );
~QgsTINInterpolator();

/** Calculates interpolation value for map coordinates x, y
Expand All @@ -60,7 +60,7 @@ class ANALYSIS_EXPORT QgsTINInterpolator: public QgsInterpolator
//! File path to export the triangulation
QString mTriangulationFilePath;
//! Type of interpolation
TIN_INTERPOLATION mInterpolation;
TINInterpolation mInterpolation;

//! Create dual edge triangulation
void initialize();
Expand Down

0 comments on commit 4467487

Please sign in to comment.