Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature #8725: Fast rendering of geometries #980

Merged
merged 68 commits into from
Dec 17, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
db8eaf0
Feature #8725: Fast rendering of geom (v-OGR)
ahuarte47 Oct 18, 2013
3ddcdac
Feature #8725: FastRendering of geometries
ahuarte47 Oct 21, 2013
e4b0c8a
Feature #8725: Fast rendering of geometries
ahuarte47 Oct 22, 2013
daa72c2
Feature #8725: simplification configurable
ahuarte47 Oct 23, 2013
40b5b1e
Feature #8725: check QgsFeatureRequest::NoGeometry
ahuarte47 Oct 23, 2013
81afd87
Feature #8725: Fix dpi bug
ahuarte47 Oct 24, 2013
b745c3d
Feature #8725: Minor improvement
ahuarte47 Oct 24, 2013
6e24fe7
Feature #8725: Remove unnecesary setPen()
ahuarte47 Oct 24, 2013
2c00524
Feature #8725: Show configuration option
ahuarte47 Oct 26, 2013
775a8e8
Feature #8725: Increment 2x the factor in slider
ahuarte47 Oct 26, 2013
c9fccbd
Feature #8725: drawConvexPolygon() can be faster
ahuarte47 Oct 27, 2013
200ae38
Feature #8725: Replace '*foo=bar' by 'memcpy'
ahuarte47 Oct 27, 2013
709781a
Feature #8725: Disable simplify in editmode
ahuarte47 Oct 28, 2013
f30f229
Feature #8725: 'AA' disabling uses layer cfg
ahuarte47 Nov 4, 2013
5441a1e
Feature #8725: Disable simplification in composer
ahuarte47 Nov 4, 2013
019759a
Merge remote-tracking branch 'upstream/master' into Issue_8725-OGR
ahuarte47 Nov 4, 2013
40ed4bb
Feature #8725: fix merge changes
ahuarte47 Nov 4, 2013
e63e92e
Feature #8725: Simplification is assigned by flag
ahuarte47 Nov 5, 2013
2cfe27b
Merge remote-tracking branch 'upstream/master' into Issue_8725-OGR
ahuarte47 Nov 7, 2013
f2ca9a1
Merge remote-tracking branch 'upstream/master' into Issue_8725-OGR
ahuarte47 Nov 7, 2013
e1c8300
Merge remote-tracking branch 'upstream/master' into Issue_8725-OGR
ahuarte47 Nov 11, 2013
2f35a7b
#8725: Replace malloc by OGRMalloc
ahuarte47 Nov 13, 2013
d3cd331
#9062 (FIX): Set relevant fields to related layer
ahuarte47 Nov 13, 2013
92c6751
Merge remote-tracking branch 'origin/Issue_9062' into Issue_8725-OGR
ahuarte47 Nov 13, 2013
c26fecf
#9062 (FIX): Unmerge, already fixed in master
ahuarte47 Nov 14, 2013
dc078b8
Merge remote-tracking branch 'upstream/master' into Issue_8725-OGR
ahuarte47 Nov 14, 2013
e9ae374
Merge remote-tracking branch 'upstream/master' into Issue_8725-OGR
ahuarte47 Nov 15, 2013
aab2598
#8725: Show warning label for big simplify factor
ahuarte47 Nov 19, 2013
9e9a686
#8725: Improvements in strings
ahuarte47 Nov 20, 2013
d2d8e4f
#8725: drawRect faster drawConvexPolygon
ahuarte47 Nov 21, 2013
7b37614
#8725: use default drawing config
ahuarte47 Nov 21, 2013
affd78a
#8725: Improvements in strings
ahuarte47 Nov 22, 2013
5ceb9ae
#8725: Refactoring to simplifier classes
ahuarte47 Dec 12, 2013
4b794a5
#8725: AA-disabling only for simplify factor>1
ahuarte47 Dec 12, 2013
566e5bd
#8725: fix texts
ahuarte47 Dec 12, 2013
c4b2480
convert GDAL no data value to a value representable by data type, fix…
blazek Dec 14, 2013
6e775b9
fix warnings
jef-n Dec 15, 2013
98d7a02
german translation update and one translation string fix
jef-n Dec 15, 2013
27bea19
[composer] Fix overview extent not being drawn on composer outputs if…
nyalldawson Dec 15, 2013
bb1380e
Merge pull request #1026 from anitagraser/working
volaya Dec 15, 2013
b192f64
[composer] Make map rectangle preview text a bit more subtle
nyalldawson Dec 15, 2013
440ede9
Feature #8725: Fast rendering of geom (v-OGR)
ahuarte47 Oct 18, 2013
5499457
Feature #8725: FastRendering of geometries
ahuarte47 Oct 21, 2013
af5263a
Feature #8725: Fast rendering of geometries
ahuarte47 Oct 22, 2013
1481a7e
Feature #8725: simplification configurable
ahuarte47 Oct 23, 2013
134def2
Feature #8725: check QgsFeatureRequest::NoGeometry
ahuarte47 Oct 23, 2013
5a6dc99
Feature #8725: Fix dpi bug
ahuarte47 Oct 24, 2013
17b31c2
Feature #8725: Minor improvement
ahuarte47 Oct 24, 2013
f00e4fb
Feature #8725: Remove unnecesary setPen()
ahuarte47 Oct 24, 2013
b02636d
Feature #8725: Show configuration option
ahuarte47 Oct 26, 2013
b31a13e
Feature #8725: Increment 2x the factor in slider
ahuarte47 Oct 26, 2013
4f8e7e0
Feature #8725: drawConvexPolygon() can be faster
ahuarte47 Oct 27, 2013
aa2d3bc
Feature #8725: Replace '*foo=bar' by 'memcpy'
ahuarte47 Oct 27, 2013
fec6baf
Feature #8725: Disable simplify in editmode
ahuarte47 Oct 28, 2013
e98a938
Feature #8725: 'AA' disabling uses layer cfg
ahuarte47 Nov 4, 2013
0324de4
Feature #8725: Disable simplification in composer
ahuarte47 Nov 4, 2013
b2d9ebb
Feature #8725: fix merge changes
ahuarte47 Nov 4, 2013
c30202f
Feature #8725: Simplification is assigned by flag
ahuarte47 Nov 5, 2013
3442789
#8725: Replace malloc by OGRMalloc
ahuarte47 Nov 13, 2013
b42d87b
#8725: Show warning label for big simplify factor
ahuarte47 Nov 19, 2013
1201008
#8725: Improvements in strings
ahuarte47 Nov 20, 2013
f48238f
#8725: drawRect faster drawConvexPolygon
ahuarte47 Nov 21, 2013
ad2bd1e
#8725: use default drawing config
ahuarte47 Nov 21, 2013
ecc5e14
#8725: Improvements in strings
ahuarte47 Nov 22, 2013
6b11258
#8725: Refactoring to simplifier classes
ahuarte47 Dec 12, 2013
95cabe5
#8725: AA-disabling only for simplify factor>1
ahuarte47 Dec 12, 2013
bda114b
#8725: fix texts
ahuarte47 Dec 12, 2013
9195356
Merge branch 'Issue_8725-OGR' of https://github.com/ahuarte47/QGIS in…
ahuarte47 Dec 17, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 37 additions & 37 deletions doc/TRANSLATORS

Large diffs are not rendered by default.

2,152 changes: 1,102 additions & 1,050 deletions i18n/qgis_de.ts

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions i18n/qgis_es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49496,6 +49496,10 @@ Should the existing classes be deleted before classification?</source>
<source>General</source>
<translation>General</translation>
</message>
<message>
<source>Rendering</source>
<translation>Representación</translation>
</message>
<message>
<source>Display name</source>
<translation type="obsolete">Mostrar el nombre</translation>
Expand Down Expand Up @@ -49944,6 +49948,22 @@ Should the existing classes be deleted before classification?</source>
<source>Type</source>
<translation>Tipo</translation>
</message>
<message>
<source>Fast drawing</source>
<translation>Pintado rápido</translation>
</message>
<message>
<source>&lt;b&gt;Note:&lt;/b&gt; This option enables geometry simplification drawing for fast rendering of the layer.</source>
<translation>&lt;b&gt;Nota:&lt;/b&gt; Esta opción activa el pintado simplificado de las geometrías para acelerar la representación de la capa.</translation>
</message>
<message>
<source>Simplification factor (Higher value draws more simplified geometries): </source>
<translation>Factor de simplificación (Cuanto mayor es el valor más se simplifica la geometría): </translation>
</message>
<message>
<source>Higher value draws more simplified geometries</source>
<translation>Cuanto mayor es el valor más se simplifica la geometría</translation>
</message>
</context>
<context>
<name>QgsVectorLayerSaveAsDialog</name>
Expand Down
2 changes: 1 addition & 1 deletion python/core/symbology-ng/qgssymbollayerv2.sip
Original file line number Diff line number Diff line change
Expand Up @@ -202,5 +202,5 @@ class QgsFillSymbolLayerV2 : QgsSymbolLayerV2
protected:
QgsFillSymbolLayerV2( bool locked = false );
/**Default method to render polygon*/
void _renderPolygon( QPainter* p, const QPolygonF& points, const QList<QPolygonF>* rings );
void _renderPolygon( QPainter* p, const QPolygonF& points, const QList<QPolygonF>* rings, QgsSymbolV2RenderContext& context );
};
20 changes: 20 additions & 0 deletions src/app/qgsoptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,11 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
chkAntiAliasing->setChecked( settings.value( "/qgis/enable_anti_aliasing", true ).toBool() );
chkUseRenderCaching->setChecked( settings.value( "/qgis/enable_render_caching", false ).toBool() );

// Default simplify drawing configuration
mSimplifyDrawingGroupBox->setChecked( settings.value( "/qgis/simplifyDrawingHints", (int)QgsVectorLayer::DefaultSimplification ).toInt() != QgsVectorLayer::NoSimplification );
mSimplifyDrawingSlider->setValue( (int)(5.0f * (settings.value( "/qgis/simplifyDrawingTol", QGis::DEFAULT_MAPTOPIXEL_THRESHOLD ).toFloat()-1)) );
mSimplifyDrawingPanel->setVisible( mSimplifyDrawingSlider->value()>0 );

// Slightly awkard here at the settings value is true to use QImage,
// but the checkbox is true to use QPixmap
chkUseQPixmap->setChecked( !( settings.value( "/qgis/use_qimage_to_render", true ).toBool() ) );
Expand Down Expand Up @@ -1091,6 +1096,16 @@ void QgsOptions::saveOptions()
bool legendLayersCapitalise = settings.value( "/qgis/capitaliseLayerName", false ).toBool();
settings.setValue( "/qgis/capitaliseLayerName", capitaliseCheckBox->isChecked() );

// Default simplify drawing configuration
int simplifyDrawingHints = QgsVectorLayer::NoSimplification;
if ( mSimplifyDrawingGroupBox->isChecked() )
{
simplifyDrawingHints |= QgsVectorLayer::DefaultSimplification;
if ( mSimplifyDrawingSlider->value() > 0 ) simplifyDrawingHints |= QgsVectorLayer::AntialiasingSimplification;
}
settings.setValue( "/qgis/simplifyDrawingHints", simplifyDrawingHints );
settings.setValue( "/qgis/simplifyDrawingTol", 1.0f + 0.2f*mSimplifyDrawingSlider->value() );

// project
settings.setValue( "/qgis/projOpenAtLaunch", mProjectOnLaunchCmbBx->currentIndex() );
settings.setValue( "/qgis/projOpenAtLaunchPath", mProjectOnLaunchLineEdit->text() );
Expand Down Expand Up @@ -2063,3 +2078,8 @@ void QgsOptions::saveDefaultDatumTransformations()
s.endGroup();
}

void QgsOptions::on_mSimplifyDrawingSlider_valueChanged( int value )
{
mSimplifyDrawingPanel->setVisible( value>0 );
}

2 changes: 2 additions & 0 deletions src/app/qgsoptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ class APP_EXPORT QgsOptions : public QgsOptionsDialogBase, private Ui::QgsOption
void on_mRemoveDefaultTransformButton_clicked();
void on_mAddDefaultTransformButton_clicked();

void on_mSimplifyDrawingSlider_valueChanged( int value );

private:
QStringList i18nList();
void initContrastEnhancement( QComboBox *cbox, QString name, QString defaultVal );
Expand Down
20 changes: 20 additions & 0 deletions src/app/qgsvectorlayerproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,11 @@ void QgsVectorLayerProperties::syncToLayer( void )
cbMinimumScale->setScale( 1.0 / layer->minimumScale() );
cbMaximumScale->setScale( 1.0 / layer->maximumScale() );

// get simplify drawing configuration
mSimplifyDrawingGroupBox->setChecked( layer->simplifyDrawingHints() != QgsVectorLayer::NoSimplification );
mSimplifyDrawingSlider->setValue( (int)(5.0f * (layer->simplifyDrawingTol()-1)) );
mSimplifyDrawingPanel->setVisible( mSimplifyDrawingSlider->value()>0 );

// load appropriate symbology page (V1 or V2)
updateSymbologyPage();

Expand Down Expand Up @@ -529,6 +534,16 @@ void QgsVectorLayerProperties::apply()
layer->setMetadataUrlType( mLayerMetadataUrlTypeComboBox->currentText() );
layer->setMetadataUrlFormat( mLayerMetadataUrlFormatComboBox->currentText() );

//layer simplify drawing configuration
int simplifyDrawingHints = QgsVectorLayer::NoSimplification;
if ( mSimplifyDrawingGroupBox->isChecked() )
{
simplifyDrawingHints |= QgsVectorLayer::DefaultSimplification;
if ( mSimplifyDrawingSlider->value() > 0 ) simplifyDrawingHints |= QgsVectorLayer::AntialiasingSimplification;
}
layer->setSimplifyDrawingHints( simplifyDrawingHints );
layer->setSimplifyDrawingTol( 1.0f + 0.2f*mSimplifyDrawingSlider->value() );

// update symbology
emit refreshLegend( layer->id(), QgsLegendItem::DontChange );

Expand Down Expand Up @@ -1067,3 +1082,8 @@ void QgsVectorLayerProperties::on_mMaximumScaleSetCurrentPushButton_clicked()
{
cbMaximumScale->setScale( 1.0 / QgisApp::instance()->mapCanvas()->mapRenderer()->scale() );
}

void QgsVectorLayerProperties::on_mSimplifyDrawingSlider_valueChanged( int value )
{
mSimplifyDrawingPanel->setVisible( value>0 );
}
2 changes: 2 additions & 0 deletions src/app/qgsvectorlayerproperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ class APP_EXPORT QgsVectorLayerProperties : public QgsOptionsDialogBase, private
void on_mMinimumScaleSetCurrentPushButton_clicked();
void on_mMaximumScaleSetCurrentPushButton_clicked();

void on_mSimplifyDrawingSlider_valueChanged( int value );

signals:

/** emitted when changes to layer were saved to update legend */
Expand Down
2 changes: 2 additions & 0 deletions src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ SET(QGIS_CORE_SRCS
qgsgeometry.cpp
qgsgeometrycache.cpp
qgsgeometryvalidator.cpp
qgsgeometrysimplifier.cpp
qgsgml.cpp
qgsgmlschema.cpp
qgshttptransaction.cpp
Expand All @@ -85,6 +86,7 @@ SET(QGIS_CORE_SRCS
qgsmaplayerregistry.cpp
qgsmaprenderer.cpp
qgsmaptopixel.cpp
qgsmaptopixelgeometrysimplifier.cpp
qgsmessageoutput.cpp
qgsmimedatautils.cpp
qgsmessagelog.cpp
Expand Down
40 changes: 20 additions & 20 deletions src/core/composer/qgscomposermap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,14 @@ void QgsComposerMap::draw( QPainter *painter, const QgsRectangle& extent, const
{
theRendererContext->setDrawEditingInformation( false );
theRendererContext->setRenderingStopped( false );
}
theRendererContext->setRenderingPrintComposition( true );

// force vector output (no caching of marker images etc.)
theRendererContext->setForceVectorOutput( true );
// force vector output (no caching of marker images etc.)
theRendererContext->setForceVectorOutput( true );

// make the renderer respect the composition's useAdvancedEffects flag
theRendererContext->setUseAdvancedEffects( mComposition->useAdvancedEffects() );
// make the renderer respect the composition's useAdvancedEffects flag
theRendererContext->setUseAdvancedEffects( mComposition->useAdvancedEffects() );
}

//force composer map scale for scale dependent visibility
double bk_scale = theMapRenderer.scale();
Expand Down Expand Up @@ -315,7 +316,7 @@ void QgsComposerMap::paint( QPainter* painter, const QStyleOptionGraphicsItem* i
drawBackground( painter );
QFont messageFont( "", 12 );
painter->setFont( messageFont );
painter->setPen( QColor( 0, 0, 0 ) );
painter->setPen( QColor( 0, 0, 0, 125 ) );
painter->drawText( thisPaintRect, tr( "Map will be printed here" ) );
}
else if ( mComposition->plotStyle() == QgsComposition::Preview )
Expand Down Expand Up @@ -423,17 +424,16 @@ void QgsComposerMap::paint( QPainter* painter, const QStyleOptionGraphicsItem* i
{
drawGrid( painter );
}
if ( mOverviewFrameMapId != -1 )
{
drawOverviewMapExtent( painter );
}
drawFrame( painter );
if ( isSelected() )
{
drawSelectionBoxes( painter );
}

if ( mOverviewFrameMapId != -1 )
{
drawOverviewMapExtent( painter );
}

painter->restore();
}

Expand Down Expand Up @@ -2186,6 +2186,13 @@ void QgsComposerMap::drawOverviewMapExtent( QPainter* p )
return;
}

if ( mComposition->plotStyle() == QgsComposition::Preview && mPreviewMode == Rectangle )
{
//if map item is set to rectangle preview mode and we are not exporting the composition
//then don't draw an overview rectangle
return;
}

const QgsComposerMap* overviewFrameMap = mComposition->getComposerMapById( mOverviewFrameMapId );
if ( !overviewFrameMap )
{
Expand All @@ -2199,15 +2206,8 @@ void QgsComposerMap::drawOverviewMapExtent( QPainter* p )

QgsRenderContext context;
context.setPainter( p );
if ( mPreviewMode == Rectangle )
{
return;
}
else
{
context.setScaleFactor( 1.0 );
context.setRasterScaleFactor( mComposition->printResolution() / 25.4 );
}
context.setScaleFactor( 1.0 );
context.setRasterScaleFactor( mComposition->printResolution() / 25.4 );

p->save();
p->setCompositionMode( mOverviewBlendMode );
Expand Down
3 changes: 3 additions & 0 deletions src/core/qgis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ const CORE_EXPORT QString GEO_NONE = "NONE";

const double QGis::DEFAULT_IDENTIFY_RADIUS = 0.5;

//! Default threshold between map coordinates and device coordinates for map2pixel simplification
const float QGis::DEFAULT_MAPTOPIXEL_THRESHOLD = 1.0f;

// description strings for units
// Order must match enum indices
const char* QGis::qgisUnitTypes[] =
Expand Down
3 changes: 3 additions & 0 deletions src/core/qgis.h
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,9 @@ class CORE_EXPORT QGis

static const double DEFAULT_IDENTIFY_RADIUS;

//! Default threshold between map coordinates and device coordinates for map2pixel simplification
static const float DEFAULT_MAPTOPIXEL_THRESHOLD;

private:
// String representation of unit types (set in qgis.cpp)
static const char *qgisUnitTypes[];
Expand Down
24 changes: 8 additions & 16 deletions src/core/qgsclipper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ const unsigned char* QgsClipper::clippedLineWKB( const unsigned char* wkb, const

bool hasZValue = ( wkbType == QGis::WKBLineString25D );

int sizeOfDoubleX = sizeof(double);
int sizeOfDoubleY = hasZValue ? 2*sizeof(double) : sizeof(double);

double p0x, p0y, p1x = 0.0, p1y = 0.0; //original coordinates
double p1x_c, p1y_c; //clipped end coordinates
double lastClipX = 0.0, lastClipY = 0.0; //last successfully clipped coords
Expand All @@ -56,29 +59,18 @@ const unsigned char* QgsClipper::clippedLineWKB( const unsigned char* wkb, const
{
if ( i == 0 )
{
memcpy( &p1x, wkb, sizeof( double ) );
wkb += sizeof( double );
memcpy( &p1y, wkb, sizeof( double ) );
wkb += sizeof( double );
if ( hasZValue ) // ignore Z value
{
wkb += sizeof( double );
}
memcpy( &p1x, wkb, sizeof( double ) ); wkb += sizeOfDoubleX;
memcpy( &p1y, wkb, sizeof( double ) ); wkb += sizeOfDoubleY;

continue;
}
else
{
p0x = p1x;
p0y = p1y;

memcpy( &p1x, wkb, sizeof( double ) );
wkb += sizeof( double );
memcpy( &p1y, wkb, sizeof( double ) );
wkb += sizeof( double );
if ( hasZValue ) // ignore Z value
{
wkb += sizeof( double );
}
memcpy( &p1x, wkb, sizeof( double ) ); wkb += sizeOfDoubleX;
memcpy( &p1y, wkb, sizeof( double ) ); wkb += sizeOfDoubleY;

p1x_c = p1x; p1y_c = p1y;
if ( clipLineSegment( clipExtent.xMinimum(), clipExtent.xMaximum(), clipExtent.yMinimum(), clipExtent.yMaximum(),
Expand Down
5 changes: 4 additions & 1 deletion src/core/qgscrscache.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ class CORE_EXPORT QgsCoordinateTransformCache
~QgsCoordinateTransformCache();
/**Returns coordinate transformation. Cache keeps ownership
@param srcAuthId auth id string of source crs
@param destAuthId auth id string of dest crs*/
@param destAuthId auth id string of dest crs
@param srcDatumTransform id of source's datum transform
@param destDatumTransform id of destinations's datum transform
*/
const QgsCoordinateTransform* transform( const QString& srcAuthId, const QString& destAuthId, int srcDatumTransform = -1, int destDatumTransform = -1 );
/**Removes transformations where a changed crs is involved from the cache*/
void invalidateCrs( const QString& crsAuthId );
Expand Down
33 changes: 33 additions & 0 deletions src/core/qgsfeaturerequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ QgsFeatureRequest::QgsFeatureRequest()
: mFilter( FilterNone )
, mFilterExpression( 0 )
, mFlags( 0 )
, mMapCoordTransform( NULL )
, mMapToPixel( NULL )
, mMapToPixelTol( QGis::DEFAULT_MAPTOPIXEL_THRESHOLD )
{
}

Expand All @@ -31,6 +34,9 @@ QgsFeatureRequest::QgsFeatureRequest( QgsFeatureId fid )
, mFilterFid( fid )
, mFilterExpression( 0 )
, mFlags( 0 )
, mMapCoordTransform( NULL )
, mMapToPixel( NULL )
, mMapToPixelTol( QGis::DEFAULT_MAPTOPIXEL_THRESHOLD )
{
}

Expand All @@ -39,13 +45,19 @@ QgsFeatureRequest::QgsFeatureRequest( const QgsRectangle& rect )
, mFilterRect( rect )
, mFilterExpression( 0 )
, mFlags( 0 )
, mMapCoordTransform( NULL )
, mMapToPixel( NULL )
, mMapToPixelTol( QGis::DEFAULT_MAPTOPIXEL_THRESHOLD )
{
}

QgsFeatureRequest::QgsFeatureRequest( const QgsExpression& expr )
: mFilter( FilterExpression )
, mFilterExpression( new QgsExpression( expr.expression() ) )
, mFlags( 0 )
, mMapCoordTransform( NULL )
, mMapToPixel( NULL )
, mMapToPixelTol( QGis::DEFAULT_MAPTOPIXEL_THRESHOLD )
{
}

Expand All @@ -70,6 +82,9 @@ QgsFeatureRequest& QgsFeatureRequest::operator=( const QgsFeatureRequest & rh )
mFilterExpression = 0;
}
mAttrs = rh.mAttrs;
mMapCoordTransform = rh.mMapCoordTransform;
mMapToPixel = rh.mMapToPixel;
mMapToPixelTol = rh.mMapToPixelTol;
return *this;
}

Expand Down Expand Up @@ -174,3 +189,21 @@ bool QgsFeatureRequest::acceptFeature( const QgsFeature& feature )

return true;
}

QgsFeatureRequest& QgsFeatureRequest::setCoordinateTransform( const QgsCoordinateTransform* ct )
{
mMapCoordTransform = ct;
return *this;
}

QgsFeatureRequest& QgsFeatureRequest::setMapToPixel( const QgsMapToPixel* mtp )
{
mMapToPixel = mtp;
return *this;
}

QgsFeatureRequest& QgsFeatureRequest::setMapToPixelTol( float map2pixelTol )
{
mMapToPixelTol = map2pixelTol;
return *this;
}
Loading