Skip to content

Commit

Permalink
Documentation and warning fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
manisandro committed Sep 21, 2015
1 parent 5037328 commit 7573afc
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 17 deletions.
7 changes: 5 additions & 2 deletions python/core/qgsmapsettings.sip
Expand Up @@ -139,8 +139,11 @@ class QgsMapSettings

const QgsMapToPixel& mapToPixel() const;

//! computes an *estimated* conversion factor between layer and map units: layerUnits * layerToMapUnits = mapUnits
//! @param referenceExtent A reference extent based on which to perform the computation. If not specified, the layer extent is used
/** Computes an *estimated* conversion factor between layer and map units: layerUnits * layerToMapUnits = mapUnits
* @param theLayer The layer
* @param referenceExtent A reference extent based on which to perform the computation. If not specified, the layer extent is used
* @note added in QGIS 2.12
*/
double layerToMapUnits( QgsMapLayer* theLayer, const QgsRectangle& referenceExtent = QgsRectangle() ) const;

/**
Expand Down
9 changes: 7 additions & 2 deletions src/core/geometry/qgsgeometryutils.h
Expand Up @@ -63,9 +63,10 @@ class CORE_EXPORT QgsGeometryUtils
* @param q1 Second segment start point
* @param q2 Second segment end point
* @param inter Output parameter, the intersection point
* @param tolerance The tolerance to use
* @return Whether the segments intersect
*/
static bool segmentIntersection( const QgsPointV2 &p1, const QgsPointV2 &p2, const QgsPointV2 &q1, const QgsPointV2 &q2, QgsPointV2& inter , double tolerance );
static bool segmentIntersection( const QgsPointV2 &p1, const QgsPointV2 &p2, const QgsPointV2 &q1, const QgsPointV2 &q2, QgsPointV2& inter, double tolerance );

/**
* @brief Project the point on a segment
Expand All @@ -91,8 +92,12 @@ class CORE_EXPORT QgsGeometryUtils

/**
* @brief Find self intersections in a polyline
* @param line The line
* @param geom The geometry to check
* @param part The part of the geometry to check
* @param ring The ring of the geometry part to check
* @param tolerance The tolerance to use
* @return The list of self intersections
* @note added in QGIS 2.12
*/
static QList<SelfIntersection> getSelfIntersections( const QgsAbstractGeometryV2* geom, int part, int ring, double tolerance );

Expand Down
2 changes: 0 additions & 2 deletions src/core/geometry/qgsgeos.cpp
Expand Up @@ -49,8 +49,6 @@ email : marco.hugentobler at sourcepole dot com
return r; \
}

QString GEOSException::lastMsg;

static void throwGEOSException( const char *fmt, ... )
{
va_list ap;
Expand Down
11 changes: 6 additions & 5 deletions src/core/geometry/qgsgeos.h
Expand Up @@ -71,6 +71,7 @@ class CORE_EXPORT QgsGeos: public QgsGeometryEngine
@param[out] newGeometries list of new geometries that have been created with the split
@param topological true if topological editing is enabled
@param[out] topologyTestPoints points that need to be tested for topological completeness in the dataset
@param[out] errorMsg error messages emitted, if any
@return 0 in case of success, 1 if geometry has not been split, error else*/
int splitGeometry( const QgsLineStringV2& splitLine,
QList<QgsAbstractGeometryV2*>& newGeometries,
Expand Down Expand Up @@ -152,14 +153,14 @@ class GEOSException
public:
GEOSException( QString theMsg )
{
if ( theMsg == "Unknown exception thrown" && lastMsg.isNull() )
if ( theMsg == "Unknown exception thrown" && lastMsg().isNull() )
{
msg = theMsg;
}
else
{
msg = theMsg;
lastMsg = msg;
lastMsg() = msg;
}
}

Expand All @@ -171,8 +172,8 @@ class GEOSException

~GEOSException()
{
if ( lastMsg == msg )
lastMsg = QString::null;
if ( lastMsg() == msg )
lastMsg() = QString::null;
}

QString what()
Expand All @@ -182,7 +183,7 @@ class GEOSException

private:
QString msg;
static QString lastMsg;
static QString& lastMsg() { static QString _lastMsg; return _lastMsg; }
};

/// @endcond
Expand Down
3 changes: 1 addition & 2 deletions src/core/geosextra/geos_c_extra.cpp
Expand Up @@ -44,8 +44,7 @@ extern "C"
{
try
{
std::auto_ptr<GEOSGeometry> ptr = reducer->reduce( *geometry );
return ptr.release();
return reducer->reduce( *geometry ).release();
}
catch ( const geos::util::GEOSException& )
{
Expand Down
7 changes: 5 additions & 2 deletions src/core/qgsmapsettings.h
Expand Up @@ -186,8 +186,11 @@ class CORE_EXPORT QgsMapSettings

const QgsMapToPixel& mapToPixel() const { return mMapToPixel; }

//! computes an *estimated* conversion factor between layer and map units: layerUnits * layerToMapUnits = mapUnits
//! @param referenceExtent A reference extent based on which to perform the computation. If not specified, the layer extent is used
/** Computes an *estimated* conversion factor between layer and map units: layerUnits * layerToMapUnits = mapUnits
* @param theLayer The layer
* @param referenceExtent A reference extent based on which to perform the computation. If not specified, the layer extent is used
* @note added in QGIS 2.12
*/
double layerToMapUnits( QgsMapLayer* theLayer, const QgsRectangle& referenceExtent = QgsRectangle() ) const;

/**
Expand Down
4 changes: 2 additions & 2 deletions src/providers/CMakeLists.txt
Expand Up @@ -22,6 +22,6 @@ IF (POSTGRES_FOUND)
ADD_SUBDIRECTORY(postgres)
ENDIF (POSTGRES_FOUND)

IF (GRASS_FOUND)
IF (WITH_GRASS)
ADD_SUBDIRECTORY(grass)
ENDIF (GRASS_FOUND)
ENDIF (WITH_GRASS)

0 comments on commit 7573afc

Please sign in to comment.