Skip to content
Permalink
Browse files

Merge pull request #5259 from nyalldawson/modernize

Modernize initializers
  • Loading branch information
nyalldawson committed Sep 26, 2017
2 parents e536cdd + 65170d0 commit 6ce8b4c83efad3637eb21930cb0e5911f1eb7ea4
Showing 774 changed files with 1,704 additions and 3,449 deletions.
@@ -12,6 +12,7 @@




class QgsDxfExport
{

@@ -1201,7 +1201,9 @@ Returns an extruded version of this geometry.
%End
public:
Error();

explicit Error( const QString &m );

Error( const QString &m, const QgsPointXY &p );
QString what();
%Docstring
@@ -37,10 +37,10 @@ Constructor for ColumnConfig
%End


QgsAttributeTableConfig::Type type; //!< The type of this column.
QgsAttributeTableConfig::Type type;
QString name; //!< The name of the attribute if this column represents a field
bool hidden; //!< Flag that controls if the column is hidden
int width; //!< Width of column, or -1 for default width
bool hidden;
int width;
};

enum ActionWidgetStyle
@@ -318,6 +318,7 @@ class QgsDiagramSettings
};

QgsDiagramSettings();

bool enabled;
QFont font;
QList< QColor > categoryColors;
@@ -21,6 +21,7 @@ class QgsLabelPosition
public:
QgsLabelPosition( int id, double r, const QVector< QgsPointXY > &corners, const QgsRectangle &rect, double w, double h, const QString &layer, const QString &labeltext, const QFont &labelfont, bool upside_down, bool diagram = false, bool pinned = false, const QString &providerId = QString() );
QgsLabelPosition();

int featureId;
double rotation;
QVector< QgsPointXY > cornerPoints;
@@ -701,9 +702,9 @@ Z-Index of label, where labels with a higher z-index are rendered on top of labe
QgsPointXY ptZero;
QgsPointXY ptOne;
QgsGeometry extentGeom;
int mFeaturesToLabel; // total features that will probably be labeled, may be less (figured before PAL)
int mFeatsSendingToPal; // total features tested for sending into PAL (relative to maxNumLabels)
int mFeatsRegPal; // number of features registered in PAL, when using limitNumLabels
int mFeaturesToLabel;
int mFeatsSendingToPal;
int mFeatsRegPal;

};

@@ -37,7 +37,7 @@ class QgsSvgCacheEntry
%Docstring
Absolute path to SVG file
%End
double size; //size in pixels (cast to int for QImage)
double size;
double strokeWidth;
double widthScaleFactor;

@@ -22,7 +22,7 @@ class QgsAuthCertTrustPolicyComboBox : QComboBox
explicit QgsAuthCertTrustPolicyComboBox(
QWidget *parent /TransferThis/ = 0,
QgsAuthCertUtils::CertTrustPolicy policy = QgsAuthCertUtils::DefaultTrust,
QgsAuthCertUtils::CertTrustPolicy defaultpolicy = QgsAuthCertUtils::DefaultTrust );
QgsAuthCertUtils::CertTrustPolicy defaultpolicy = QgsAuthCertUtils::DefaultTrust );
%Docstring
Construct a combo box for defining certificate trust policy
\param parent Parent widget
@@ -93,7 +93,7 @@ Emitted when the widget curve changes

protected:

virtual void keyPressEvent( QKeyEvent *event ) ;
virtual void keyPressEvent( QKeyEvent *event );

};

@@ -97,7 +97,7 @@ returns the height of the document viewer
setDocumentViewerWidth set the height of the document viewer.
\param height the height. Use 0 for automatic best display.
%End
int documentViewerWidth() const ;
int documentViewerWidth() const;
%Docstring
returns the width of the document viewer
:rtype: int
@@ -114,6 +114,7 @@ class QgsNewNameDialog : QgsDialog

QString highlightText( const QString &text );
%Docstring
List of names with extensions
:rtype: str
%End
static QStringList fullNames( const QString &name, const QStringList &extensions );
@@ -27,9 +27,9 @@ class QgsSublayersDialog : QDialog
{
LayerDefinition();

int layerId; //!< Identifier of the layer (one unique layer id may have multiple types though)
int layerId;
QString layerName; //!< Name of the layer (not necessarily unique)
int count; //!< Number of features (might be unused)
int count;
QString type; //!< Extra type depending on the use (e.g. geometry type for vector sublayers)
};

@@ -748,7 +748,7 @@ sub detect_comment_block{
};

# remove struct member assignment
if ( $SIP_RUN != 1 && $ACCESS[$#ACCESS] == PUBLIC && $LINE =~ m/^(\s*\w+[\w<> *&:,]* \*?\w+) = \w+(\([^()]+\))?;/ ){
if ( $SIP_RUN != 1 && $ACCESS[$#ACCESS] == PUBLIC && $LINE =~ m/^(\s*\w+[\w<> *&:,]* \*?\w+) = [\-\w\:\.]+(\([^()]+\))?\s*;/ ){
dbg_info("remove struct member assignment");
$LINE = "$1;";
}
@@ -20,26 +20,12 @@
#include "NormVecDecorator.h"

CloughTocherInterpolator::CloughTocherInterpolator()
: mEdgeTolerance( 0.00001 )
, der1X( 0.0 )
, der1Y( 0.0 )
, der2X( 0.0 )
, der2Y( 0.0 )
, der3X( 0.0 )
, der3Y( 0.0 )
{

}

CloughTocherInterpolator::CloughTocherInterpolator( NormVecDecorator *tin )
: mTIN( tin )
, mEdgeTolerance( 0.00001 )
, der1X( 0.0 )
, der1Y( 0.0 )
, der2X( 0.0 )
, der2Y( 0.0 )
, der3X( 0.0 )
, der3Y( 0.0 )
{

}
@@ -35,7 +35,7 @@ class ANALYSIS_EXPORT CloughTocherInterpolator : public TriangleInterpolator
//! Association with a triangulation object
NormVecDecorator *mTIN = nullptr;
//! Tolerance of the barycentric coordinates at the borders of the triangles (to prevent errors because of very small negativ baricentric coordinates)
double mEdgeTolerance;
double mEdgeTolerance = 0.00001;
//! First point of the triangle in x-,y-,z-coordinates
QgsPoint point1 = QgsPoint( 0, 0, 0 );
//! Second point of the triangle in x-,y-,z-coordinates
@@ -75,17 +75,17 @@ class ANALYSIS_EXPORT CloughTocherInterpolator : public TriangleInterpolator
//! Control point 16
QgsPoint cp16 = QgsPoint( 0, 0, 0 );
//! Derivative in x-direction at point1
double der1X;
double der1X = 0.0;
//! Derivative in y-direction at point1
double der1Y;
double der1Y = 0.0;
//! Derivative in x-direction at point2
double der2X;
double der2X = 0.0;
//! Derivative in y-direction at point2
double der2Y;
double der2Y = 0.0;
//! Derivative in x-direction at point3
double der3X;
double der3X = 0.0;
//! Derivative in y-direction at point3
double der3Y;
double der3Y = 0.0;
//! Stores point1 of the last run
QgsPoint lpoint1 = QgsPoint( 0, 0, 0 );
//! Stores point2 of the last run
@@ -107,13 +107,13 @@ class ANALYSIS_EXPORT DualEdgeTriangulation: public Triangulation

protected:
//! X-coordinate of the upper right corner of the bounding box
double xMax;
double xMax = 0;
//! X-coordinate of the lower left corner of the bounding box
double xMin;
double xMin = 0;
//! Y-coordinate of the upper right corner of the bounding box
double yMax;
double yMax = 0;
//! Y-coordinate of the lower left corner of the bounding box
double yMin;
double yMin = 0;
//! Default value for the number of storable points at the beginning
static const unsigned int DEFAULT_STORAGE_FOR_POINTS = 100000;
//! Stores pointers to all points in the triangulations (including the points contained in the lines)
@@ -125,7 +125,7 @@ class ANALYSIS_EXPORT DualEdgeTriangulation: public Triangulation
//! Association to an interpolator object
TriangleInterpolator *mTriangleInterpolator = nullptr;
//! Member to store the behavior in case of crossing forced segments
Triangulation::ForcedCrossBehavior mForcedCrossBehavior;
Triangulation::ForcedCrossBehavior mForcedCrossBehavior = Triangulation::DeleteFirst;
//! Color to paint the normal edges
QColor mEdgeColor;
//! Color to paint the forced edges
@@ -153,15 +153,15 @@ class ANALYSIS_EXPORT DualEdgeTriangulation: public Triangulation
//! Swaps 'edge' and does no recursiv testing
void doOnlySwap( unsigned int edge );
//! Number of an edge which does not point to the virtual point. It continuously updated for a fast search
unsigned int mEdgeInside;
unsigned int mEdgeInside = 0;
//! Number of an edge on the outside of the convex hull. It is updated in method 'baseEdgeOfTriangle' to enable insertion of points outside the convex hull
unsigned int mEdgeOutside;
unsigned int mEdgeOutside = 0;
//! If an inserted point is exactly on an existing edge, 'baseEdgeOfTriangle' returns -20 and sets the variable 'mEdgeWithPoint'
unsigned int mEdgeWithPoint;
unsigned int mEdgeWithPoint = 0;
//! If an instability occurs in 'baseEdgeOfTriangle', mUnstableEdge is set to the value of the current edge
unsigned int mUnstableEdge;
unsigned int mUnstableEdge = 0;
//! If a point has been inserted twice, its number is stored in this member
int mTwiceInsPoint;
int mTwiceInsPoint = 0;
//! Returns true, if it is possible to swap an edge, otherwise false(concave quad or edge on (or outside) the convex hull)
bool swapPossible( unsigned int edge );
//! Divides a polygon in a triangle and two polygons and calls itself recursively for these two polygons. 'poly' is a pointer to a list with the numbers of the edges of the polygon, 'free' is a pointer to a list of free halfedges, and 'mainedge' is the number of the edge, towards which the new triangle is inserted. Mainedge has to be the same as poly->begin(), otherwise the recursion does not work
@@ -181,42 +181,20 @@ class ANALYSIS_EXPORT DualEdgeTriangulation: public Triangulation
#ifndef SIP_RUN

inline DualEdgeTriangulation::DualEdgeTriangulation()
: xMax( 0 )
, xMin( 0 )
, yMax( 0 )
, yMin( 0 )
, mTriangleInterpolator( nullptr )
, mForcedCrossBehavior( Triangulation::DeleteFirst )
, mEdgeColor( 0, 255, 0 )
: mEdgeColor( 0, 255, 0 )
, mForcedEdgeColor( 0, 0, 255 )
, mBreakEdgeColor( 100, 100, 0 )
, mDecorator( this )
, mEdgeInside( 0 )
, mEdgeOutside( 0 )
, mEdgeWithPoint( 0 )
, mUnstableEdge( 0 )
, mTwiceInsPoint( 0 )
{
mPointVector.reserve( DEFAULT_STORAGE_FOR_POINTS );
mHalfEdge.reserve( DEFAULT_STORAGE_FOR_HALF_EDGES );
}

inline DualEdgeTriangulation::DualEdgeTriangulation( int nop, Triangulation *decorator )
: xMax( 0 )
, xMin( 0 )
, yMax( 0 )
, yMin( 0 )
, mTriangleInterpolator( nullptr )
, mForcedCrossBehavior( Triangulation::DeleteFirst )
, mEdgeColor( 0, 255, 0 )
: mEdgeColor( 0, 255, 0 )
, mForcedEdgeColor( 0, 0, 255 )
, mBreakEdgeColor( 100, 100, 0 )
, mDecorator( decorator ? decorator : this )
, mEdgeInside( 0 )
, mEdgeOutside( 0 )
, mEdgeWithPoint( 0 )
, mUnstableEdge( 0 )
, mTwiceInsPoint( 0 )
{
mPointVector.reserve( nop );
mHalfEdge.reserve( nop );
@@ -29,15 +29,15 @@ class ANALYSIS_EXPORT HalfEdge
{
protected:
//! Number of the dual HalfEdge
int mDual;
int mDual = -10;
//! Number of the next HalfEdge
int mNext;
int mNext = -10;
//! Number of the point at which this HalfEdge points
int mPoint;
int mPoint = -10;
//! True, if the HalfEdge belongs to a break line, false otherwise
bool mBreak;
bool mBreak = false;
//! True, if the HalfEdge belongs to a constrained edge, false otherwise
bool mForced;
bool mForced = false;

public:
//! Default constructor. Values for mDual, mNext, mPoint are set to -10 which means that they are undefined
@@ -69,7 +69,7 @@ class ANALYSIS_EXPORT HalfEdge
#ifndef SIP_RUN


inline HalfEdge::HalfEdge(): mDual( -10 ), mNext( -10 ), mPoint( -10 ), mBreak( false ), mForced( false )
inline HalfEdge::HalfEdge()
{

}
@@ -56,7 +56,6 @@ class ANALYSIS_EXPORT LinTriangleInterpolator : public TriangleInterpolator
#ifndef SIP_RUN

inline LinTriangleInterpolator::LinTriangleInterpolator()
: mTIN( nullptr )
{

}
@@ -52,8 +52,6 @@ class ANALYSIS_EXPORT Node


inline Node::Node()
: mPoint( nullptr )
, mNext( nullptr )
{

}
@@ -86,12 +86,18 @@ class ANALYSIS_EXPORT NormVecDecorator: public TriDecorator

#ifndef SIP_RUN

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

inline NormVecDecorator::NormVecDecorator( Triangulation *tin ): TriDecorator( tin ), mInterpolator( nullptr ), mNormVec( new QVector<Vector3D*>( DEFAULT_STORAGE_FOR_NORMALS ) ), mPointState( new QVector<PointState>( DEFAULT_STORAGE_FOR_NORMALS ) )
inline NormVecDecorator::NormVecDecorator( Triangulation *tin )
: TriDecorator( tin )
, mNormVec( new QVector<Vector3D*>( DEFAULT_STORAGE_FOR_NORMALS ) )
, mPointState( new QVector<PointState>( DEFAULT_STORAGE_FOR_NORMALS ) )
{
alreadyestimated = false;
}
@@ -35,11 +35,11 @@ class ANALYSIS_EXPORT ParametricLine
{
protected:
//! Degree of the parametric Line
int mDegree;
int mDegree = 0;
//! Pointer to the parent object. If there isn't one, mParent is 0
ParametricLine *mParent = nullptr;
//! MControlPoly stores the points of the control polygon
QVector<QgsPoint *> *mControlPoly;
QVector<QgsPoint *> *mControlPoly = nullptr;
public:
//! Default constructor
ParametricLine();
@@ -70,16 +70,12 @@ class ANALYSIS_EXPORT ParametricLine
//-----------------------------------------constructors and destructor----------------------

inline ParametricLine::ParametricLine()
: mDegree( 0 )
, mParent( nullptr )
, mControlPoly( nullptr )
{

}

inline ParametricLine::ParametricLine( ParametricLine *par, QVector<QgsPoint *> *controlpoly )
: mDegree( 0 )
, mParent( par )
: mParent( par )
, mControlPoly( controlpoly )
{

@@ -68,12 +68,13 @@ class ANALYSIS_EXPORT TriDecorator : public Triangulation

#ifndef SIP_RUN

inline TriDecorator::TriDecorator(): mTIN( nullptr )
inline TriDecorator::TriDecorator()
{

}

inline TriDecorator::TriDecorator( Triangulation *t ): mTIN( t )
inline TriDecorator::TriDecorator( Triangulation *t )
: mTIN( t )
{

}

0 comments on commit 6ce8b4c

Please sign in to comment.
You can’t perform that action at this time.