Skip to content

Commit

Permalink
Faster build times with fwd include
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed May 10, 2019
1 parent 425f672 commit 0081ad0
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 11 deletions.
6 changes: 6 additions & 0 deletions src/core/geometry/qgsabstractgeometry.cpp
Expand Up @@ -20,6 +20,7 @@ email : marco.hugentobler at sourcepole dot com
#include "qgsmaptopixel.h"
#include "qgspoint.h"
#include "qgsgeometrycollection.h"
#include "nlohmann/json.hpp"

#include <limits>
#include <QTransform>
Expand Down Expand Up @@ -158,6 +159,11 @@ QString QgsAbstractGeometry::asJson( int precision )
return QString::fromStdString( asJsonObject( precision ).dump() );
}

json QgsAbstractGeometry::asJsonObject( int precision ) const
{
Q_UNUSED( precision ); return nullptr;
}

QgsPoint QgsAbstractGeometry::centroid() const
{
// http://en.wikipedia.org/wiki/Centroid#Centroid_of_polygon
Expand Down
4 changes: 2 additions & 2 deletions src/core/geometry/qgsabstractgeometry.h
Expand Up @@ -26,7 +26,7 @@ email : marco.hugentobler at sourcepole dot com
#include "qgswkbptr.h"

#ifndef SIP_RUN
#include "nlohmann/json.hpp"
#include "nlohmann/json_fwd.hpp"
using json = nlohmann::json;
#endif

Expand Down Expand Up @@ -297,7 +297,7 @@ class CORE_EXPORT QgsAbstractGeometry
* \note not available in Python bindings
* \since QGIS 3.10
*/
virtual json asJsonObject( int precision = 17 ) const SIP_SKIP { Q_UNUSED( precision ); return nullptr; }
virtual json asJsonObject( int precision = 17 ) SIP_SKIP const;


//render pipeline
Expand Down
1 change: 0 additions & 1 deletion src/core/geometry/qgsgeometryutils.cpp
Expand Up @@ -27,7 +27,6 @@ email : marco.hugentobler at sourcepole dot com
#include <QVector>
#include <QRegularExpression>


#include "nlohmann/json.hpp"

QVector<QgsLineString *> QgsGeometryUtils::extractLineStrings( const QgsAbstractGeometry *geom )
Expand Down
13 changes: 7 additions & 6 deletions src/core/geometry/qgspoint.cpp
Expand Up @@ -277,12 +277,6 @@ QDomElement QgsPoint::asGml3( QDomDocument &doc, int precision, const QString &n
return elemPoint;
}

/***************************************************************************
* This class is considered CRITICAL and any change MUST be accompanied with
* full unit tests.
* See details in QEP #17
****************************************************************************/


json QgsPoint::asJsonObject( int precision ) const
{
Expand Down Expand Up @@ -319,6 +313,13 @@ void QgsPoint::clear()
clearCache();
}


/***************************************************************************
* This class is considered CRITICAL and any change MUST be accompanied with
* full unit tests.
* See details in QEP #17
****************************************************************************/

void QgsPoint::transform( const QgsCoordinateTransform &ct, QgsCoordinateTransform::TransformDirection d, bool transformZ )
{
clearCache();
Expand Down
1 change: 1 addition & 0 deletions src/core/qgsjsonutils.cpp
Expand Up @@ -26,6 +26,7 @@
#include "qgsfieldformatterregistry.h"
#include "qgsfieldformatter.h"
#include "qgsapplication.h"
#include "nlohmann/json.hpp"

#include <QJsonDocument>
#include <QJsonArray>
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsjsonutils.h
Expand Up @@ -24,7 +24,7 @@


#ifndef SIP_RUN
#include "nlohmann/json.hpp"
#include "nlohmann/json_fwd.hpp"
using json = nlohmann::json;
#endif

Expand Down
2 changes: 2 additions & 0 deletions src/server/services/wms/qgswmsrenderer.cpp
Expand Up @@ -91,6 +91,8 @@
#include "qgsunittypes.h"
#include <QUrl>

#include"nlohmann/json.hpp"

namespace QgsWms
{
QgsRenderer::QgsRenderer( const QgsWmsRenderContext &context )
Expand Down
2 changes: 1 addition & 1 deletion tests/src/core/testqgsjsonutils.cpp
Expand Up @@ -17,7 +17,7 @@
#include <qgsjsonutils.h>
#include "qgsvectorlayer.h"
#include "qgsfeature.h"

#include"nlohmann/json.hpp"

class TestQgsJsonUtils : public QObject
{
Expand Down

0 comments on commit 0081ad0

Please sign in to comment.