Showing with 243 additions and 210 deletions.
  1. +1 −1 python/core/qgsclipper.sip
  2. +3 −3 python/core/symbology-ng/qgsrendererv2.sip
  3. +1 −1 src/analysis/interpolation/qgsinterpolator.cpp
  4. +1 −1 src/analysis/interpolation/qgstininterpolator.cpp
  5. +6 −6 src/analysis/vector/qgsgeometryanalyzer.cpp
  6. +2 −2 src/analysis/vector/qgsgeometryanalyzer.h
  7. +1 −1 src/analysis/vector/qgszonalstatistics.cpp
  8. +1 −1 src/app/qgsmaptooloffsetcurve.cpp
  9. +1 −1 src/core/pal/layer.cpp
  10. +2 −2 src/core/pal/palgeometry.h
  11. +1 −1 src/core/pal/util.cpp
  12. +1 −1 src/core/pal/util.h
  13. +1 −1 src/core/qgsclipper.cpp
  14. +1 −1 src/core/qgsclipper.h
  15. +8 −8 src/core/qgsdistancearea.cpp
  16. +2 −2 src/core/qgsdistancearea.h
  17. +33 −33 src/core/qgsgeometry.cpp
  18. +34 −34 src/core/qgsgeometry.h
  19. +1 −1 src/core/qgsgeometryvalidator.cpp
  20. +4 −4 src/core/qgslabel.cpp
  21. +1 −1 src/core/qgslabel.h
  22. +6 −6 src/core/qgsogcutils.cpp
  23. +1 −1 src/core/qgspalgeometry.cpp
  24. +2 −2 src/core/qgspalgeometry.h
  25. +4 −4 src/core/qgspallabeling.cpp
  26. +2 −2 src/core/qgsvectorfilewriter.cpp
  27. +1 −1 src/core/qgsvectorlayereditbuffer.h
  28. +72 −56 src/core/qgsvectorlayerfeatureiterator.cpp
  29. +25 −8 src/core/qgsvectorlayerfeatureiterator.h
  30. +9 −9 src/core/symbology-ng/qgsrendererv2.cpp
  31. +3 −3 src/core/symbology-ng/qgsrendererv2.h
  32. +4 −4 src/plugins/spatialquery/qgsspatialquery.cpp
  33. +2 −2 src/plugins/spatialquery/qgsspatialquery.h
  34. +1 −1 src/providers/gpx/qgsgpxprovider.cpp
  35. +3 −3 src/providers/ogr/qgsogrprovider.cpp
  36. +1 −1 src/providers/postgres/qgspostgresprovider.cpp
  37. +1 −1 src/providers/wfs/qgswfsprovider.cpp
2 changes: 1 addition & 1 deletion python/core/qgsclipper.sip
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@ class QgsClipper
@param wkb pointer to the start of the line wkb
@param clipExtent clipping bounds
@param line out: clipped line coordinates*/
static unsigned char* clippedLineWKB( unsigned char* wkb, const QgsRectangle& clipExtent, QPolygonF& line );
static const unsigned char* clippedLineWKB( const unsigned char* wkb, const QgsRectangle& clipExtent, QPolygonF& line );
};
6 changes: 3 additions & 3 deletions python/core/symbology-ng/qgsrendererv2.sip
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ class QgsFeatureRendererV2
//! render editing vertex marker for a polygon
void renderVertexMarkerPolygon( QPolygonF& pts, QList<QPolygonF>* rings, QgsRenderContext& context );

static unsigned char* _getPoint( QPointF& pt, QgsRenderContext& context, unsigned char* wkb );
static unsigned char* _getLineString( QPolygonF& pts, QgsRenderContext& context, unsigned char* wkb );
static unsigned char* _getPolygon( QPolygonF& pts, QList<QPolygonF>& holes, QgsRenderContext& context, unsigned char* wkb );
static const unsigned char* _getPoint( QPointF& pt, QgsRenderContext& context, const unsigned char* wkb );
static const unsigned char* _getLineString( QPolygonF& pts, QgsRenderContext& context, const unsigned char* wkb );
static const unsigned char* _getPolygon( QPolygonF& pts, QList<QPolygonF>& holes, QgsRenderContext& context, const unsigned char* wkb );

void setScaleMethodToSymbol( QgsSymbolV2* symbol, int scaleMethod );
};
2 changes: 1 addition & 1 deletion src/analysis/interpolation/qgsinterpolator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ int QgsInterpolator::addVerticesToCache( QgsGeometry* geom, bool zCoord, double
}

bool hasZValue = false;
unsigned char* currentWkbPtr = geom->asWkb();
const unsigned char* currentWkbPtr = geom->asWkb();
vertexData theVertex; //the current vertex

QGis::WkbType wkbType = geom->wkbType();
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/interpolation/qgstininterpolator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ int QgsTINInterpolator::insertData( QgsFeature* f, bool zCoord, int attr, InputT
//parse WKB. It is ugly, but we cannot use the methods with QgsPoint because they don't contain z-values for 25D types
bool hasZValue = false;
double x, y, z;
unsigned char* currentWkbPtr = g->asWkb();
const unsigned char* currentWkbPtr = g->asWkb();
//maybe a structure or break line
Line3D* line = 0;

Expand Down
12 changes: 6 additions & 6 deletions src/analysis/vector/qgsgeometryanalyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1186,9 +1186,9 @@ QgsGeometry* QgsGeometryAnalyzer::locateBetweenMeasures( double fromMeasure, dou
QgsMultiPolyline resultGeom;

//need to go with WKB and z coordinate until QgsGeometry supports M values
unsigned char* lineWkb = lineGeom->asWkb();
const unsigned char* lineWkb = lineGeom->asWkb();

unsigned char* ptr = lineWkb + 1;
const unsigned char* ptr = lineWkb + 1;
QGis::WkbType wkbType;
memcpy( &wkbType, ptr, sizeof( wkbType ) );
ptr += sizeof( wkbType );
Expand Down Expand Up @@ -1230,9 +1230,9 @@ QgsGeometry* QgsGeometryAnalyzer::locateAlongMeasure( double measure, QgsGeometr
QgsMultiPoint resultGeom;

//need to go with WKB and z coordinate until QgsGeometry supports M values
unsigned char* lineWkb = lineGeom->asWkb();
const unsigned char* lineWkb = lineGeom->asWkb();

unsigned char* ptr = lineWkb + 1;
const unsigned char* ptr = lineWkb + 1;
QGis::WkbType wkbType;
memcpy( &wkbType, ptr, sizeof( wkbType ) );
ptr += sizeof( wkbType );
Expand Down Expand Up @@ -1264,7 +1264,7 @@ QgsGeometry* QgsGeometryAnalyzer::locateAlongMeasure( double measure, QgsGeometr
return QgsGeometry::fromMultiPoint( resultGeom );
}

unsigned char* QgsGeometryAnalyzer::locateBetweenWkbString( unsigned char* ptr, QgsMultiPolyline& result, double fromMeasure, double toMeasure )
const unsigned char* QgsGeometryAnalyzer::locateBetweenWkbString( const unsigned char* ptr, QgsMultiPolyline& result, double fromMeasure, double toMeasure )
{
int* nPoints = ( int* ) ptr;
ptr += sizeof( int );
Expand Down Expand Up @@ -1316,7 +1316,7 @@ unsigned char* QgsGeometryAnalyzer::locateBetweenWkbString( unsigned char* ptr,
return ptr;
}

unsigned char* QgsGeometryAnalyzer::locateAlongWkbString( unsigned char* ptr, QgsMultiPoint& result, double measure )
const unsigned char* QgsGeometryAnalyzer::locateAlongWkbString( const unsigned char* ptr, QgsMultiPoint& result, double measure )
{
int* nPoints = ( int* ) ptr;
ptr += sizeof( int );
Expand Down
4 changes: 2 additions & 2 deletions src/analysis/vector/qgsgeometryanalyzer.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ class ANALYSIS_EXPORT QgsGeometryAnalyzer
@param offset the offset value in layer unit. Negative values mean offset towards left, positive values offset to the right side*/
void createOffsetGeometry( QgsGeometry* geom, QgsGeometry* lineGeom, double offset );
QgsPoint createPointOffset( double x, double y, double dist, QgsGeometry* lineGeom ) const;
unsigned char* locateBetweenWkbString( unsigned char* ptr, QgsMultiPolyline& result, double fromMeasure, double toMeasure );
unsigned char* locateAlongWkbString( unsigned char* ptr, QgsMultiPoint& result, double measure );
const unsigned char* locateBetweenWkbString( const unsigned char* ptr, QgsMultiPolyline& result, double fromMeasure, double toMeasure );
const unsigned char* locateAlongWkbString( const unsigned char* ptr, QgsMultiPoint& result, double measure );
static bool clipSegmentByRange( double x1, double y1, double m1, double x2, double y2, double m2, double range1, double range2, QgsPoint& pt1, QgsPoint& pt2, bool& secondPointClipped );
static void locateAlongSegment( double x1, double y1, double m1, double x2, double y2, double m2, double measure, bool& pt1Ok, QgsPoint& pt1, bool& pt2Ok, QgsPoint& pt2 );
};
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/vector/qgszonalstatistics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ void QgsZonalStatistics::statisticsFromMiddlePointTest( void* band, QgsGeometry*
count = 0;
sum = 0;

GEOSGeometry* polyGeos = poly->asGeos();
const GEOSGeometry* polyGeos = poly->asGeos();
if ( !polyGeos )
{
return;
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsmaptooloffsetcurve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ void QgsMapToolOffsetCurve::setOffsetForRubberBand( double offset, bool leftSide
}

QgsGeometry geomCopy( *mOriginalGeometry );
GEOSGeometry* geosGeom = geomCopy.asGeos();
const GEOSGeometry* geosGeom = geomCopy.asGeos();
if ( geosGeom )
{
QSettings s;
Expand Down
2 changes: 1 addition & 1 deletion src/core/pal/layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ namespace pal
}

// Split MULTI GEOM and Collection in simple geometries
GEOSGeometry *the_geom = userGeom->getGeosGeometry();
const GEOSGeometry *the_geom = userGeom->getGeosGeometry();

Feature* f = new Feature( this, geom_id, userGeom, label_x, label_y );
if ( fixedPos )
Expand Down
4 changes: 2 additions & 2 deletions src/core/pal/palgeometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ namespace pal
*
* @return GEOSGeometry * a pointer the geos geom
*/
virtual GEOSGeometry* getGeosGeometry() = 0;
virtual const GEOSGeometry* getGeosGeometry() = 0;


/**
* \brief Called by Pal when it doesn't need the coordinates anymore
* @param the_geom is the geoms geom from PalGeometry::getfeomGeometry()
*/
virtual void releaseGeosGeometry( GEOSGeometry *the_geom ) = 0;
virtual void releaseGeosGeometry( const GEOSGeometry *the_geom ) = 0;


virtual ~PalGeometry() {}
Expand Down
2 changes: 1 addition & 1 deletion src/core/pal/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ namespace pal
}

//LinkedList<const geos::geom::Geometry*> * unmulti (geos::geom::Geometry *the_geom){
LinkedList<const GEOSGeometry*> * unmulti( GEOSGeometry *the_geom )
LinkedList<const GEOSGeometry*> * unmulti( const GEOSGeometry *the_geom )
{

//LinkedList<const geos::geom::Geometry*> *queue = new LinkedList<const geos::geom::Geometry*>(ptrGeomEq);
Expand Down
2 changes: 1 addition & 1 deletion src/core/pal/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ namespace pal
class Layer;
class FeaturePart;

LinkedList<const GEOSGeometry*> * unmulti( GEOSGeometry *the_geom );
LinkedList<const GEOSGeometry*> * unmulti( const GEOSGeometry* the_geom );

/**
* \brief For usage in problem solving algorithm
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsclipper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const double QgsClipper::MIN_Y = -16000;

const double QgsClipper::SMALL_NUM = 1e-12;

unsigned char* QgsClipper::clippedLineWKB( unsigned char* wkb, const QgsRectangle& clipExtent, QPolygonF& line )
const unsigned char* QgsClipper::clippedLineWKB( const unsigned char* wkb, const QgsRectangle& clipExtent, QPolygonF& line )
{
wkb++; // jump over endian info
unsigned int wkbType = *(( int* ) wkb );
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsclipper.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class CORE_EXPORT QgsClipper
@param wkb pointer to the start of the line wkb
@param clipExtent clipping bounds
@param line out: clipped line coordinates*/
static unsigned char* clippedLineWKB( unsigned char* wkb, const QgsRectangle& clipExtent, QPolygonF& line );
static const unsigned char* clippedLineWKB( const unsigned char* wkb, const QgsRectangle& clipExtent, QPolygonF& line );

private:

Expand Down
16 changes: 8 additions & 8 deletions src/core/qgsdistancearea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,11 @@ double QgsDistanceArea::measure( QgsGeometry* geometry )
if ( !geometry )
return 0.0;

unsigned char* wkb = geometry->asWkb();
const unsigned char* wkb = geometry->asWkb();
if ( !wkb )
return 0.0;

unsigned char* ptr;
const unsigned char* ptr;
unsigned int wkbType;
double res, resTotal = 0;
int count, i;
Expand Down Expand Up @@ -324,11 +324,11 @@ double QgsDistanceArea::measurePerimeter( QgsGeometry* geometry )
if ( !geometry )
return 0.0;

unsigned char* wkb = geometry->asWkb();
const unsigned char* wkb = geometry->asWkb();
if ( !wkb )
return 0.0;

unsigned char* ptr;
const unsigned char* ptr;
unsigned int wkbType;
double res, resTotal = 0;
int count, i;
Expand Down Expand Up @@ -373,9 +373,9 @@ double QgsDistanceArea::measurePerimeter( QgsGeometry* geometry )
}


unsigned char* QgsDistanceArea::measureLine( unsigned char* feature, double* area, bool hasZptr )
const unsigned char* QgsDistanceArea::measureLine( const unsigned char* feature, double* area, bool hasZptr )
{
unsigned char *ptr = feature + 5;
const unsigned char *ptr = feature + 5;
unsigned int nPoints = *(( int* )ptr );
ptr = feature + 9;

Expand Down Expand Up @@ -481,7 +481,7 @@ double QgsDistanceArea::measureLine( const QgsPoint& p1, const QgsPoint& p2 )
}


unsigned char* QgsDistanceArea::measurePolygon( unsigned char* feature, double* area, double* perimeter, bool hasZptr )
const unsigned char* QgsDistanceArea::measurePolygon( const unsigned char* feature, double* area, double* perimeter, bool hasZptr )
{
// get number of rings in the polygon
unsigned int numRings = *(( int* )( feature + 1 + sizeof( int ) ) );
Expand All @@ -490,7 +490,7 @@ unsigned char* QgsDistanceArea::measurePolygon( unsigned char* feature, double*
return 0;

// Set pointer to the first ring
unsigned char* ptr = feature + 1 + 2 * sizeof( int );
const unsigned char* ptr = feature + 1 + 2 * sizeof( int );

QList<QgsPoint> points;
QgsPoint pnt;
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsdistancearea.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ class CORE_EXPORT QgsDistanceArea

protected:
//! measures line distance, line points are extracted from WKB
unsigned char* measureLine( unsigned char* feature, double* area, bool hasZptr = false );
const unsigned char* measureLine( const unsigned char* feature, double* area, bool hasZptr = false );
//! measures polygon area and perimeter, vertices are extracted from WKB
unsigned char* measurePolygon( unsigned char* feature, double* area, double* perimeter, bool hasZptr = false );
const unsigned char* measurePolygon( const unsigned char* feature, double* area, double* perimeter, bool hasZptr = false );

/**
calculates distance from two points on ellipsoid
Expand Down
Loading