Skip to content
Permalink
Browse files

Highlight: get transformation object from maprenderer and added some …

…consts
  • Loading branch information
mhugent committed Nov 7, 2013
1 parent 6cc5db3 commit aec1d5e711eb28cd9d5bb2bf2de2ea93efbdb4bc
Showing with 13 additions and 10 deletions.
  1. +1 −1 src/core/qgsmaprenderer.cpp
  2. +3 −3 src/core/qgsmaprenderer.h
  3. +5 −2 src/gui/qgshighlight.cpp
  4. +3 −3 src/gui/qgsmapcanvas.cpp
  5. +1 −1 src/gui/qgsmapcanvas.h
@@ -1238,7 +1238,7 @@ void QgsMapRenderer::setLabelingEngine( QgsLabelingEngineInterface* iface )
mLabelingEngine = iface;
}

const QgsCoordinateTransform* QgsMapRenderer::tr( QgsMapLayer *layer )
const QgsCoordinateTransform* QgsMapRenderer::tr( const QgsMapLayer *layer ) const
{
if ( !layer || !mDestCRS )
{
@@ -297,6 +297,8 @@ class CORE_EXPORT QgsMapRenderer : public QObject

void addLayerCoordinateTransform( const QString& layerId, const QString& srcAuthId, const QString& destAuthId, int srcDatumTransform = -1, int destDatumTransform = -1 );

const QgsCoordinateTransform* tr( const QgsMapLayer *layer ) const;

signals:

void drawingProgress( int current, int total );
@@ -313,7 +315,7 @@ class CORE_EXPORT QgsMapRenderer : public QObject
void drawError( QgsMapLayer* );

//! Notifies higher level components to show the datum transform dialog and add a QgsLayerCoordinateTransformInfo for that layer
void datumTransformInfoRequested( QgsMapLayer* ml, const QString& srcAuthId, const QString& destAuthId );
void datumTransformInfoRequested( const QgsMapLayer* ml, const QString& srcAuthId, const QString& destAuthId ) const;

public slots:

@@ -389,8 +391,6 @@ class CORE_EXPORT QgsMapRenderer : public QObject

QHash< QString, QgsLayerCoordinateTransform > mLayerCoordinateTransformInfo;

private:
const QgsCoordinateTransform* tr( QgsMapLayer *layer );
};

#endif
@@ -46,8 +46,11 @@ void QgsHighlight::init()
{
if ( mMapCanvas->mapRenderer()->hasCrsTransformEnabled() )
{
QgsCoordinateTransform transform( mLayer->crs(), mMapCanvas->mapRenderer()->destinationCrs() );
mGeometry->transform( transform );
const QgsCoordinateTransform* ct = mMapCanvas->mapRenderer()->tr( mLayer );
if ( ct )
{
mGeometry->transform( *ct );
}
}
updateRect();
update();
@@ -112,8 +112,8 @@ QgsMapCanvas::QgsMapCanvas( QWidget * parent, const char *name )
setFocusPolicy( Qt::StrongFocus );

mMapRenderer = new QgsMapRenderer;
connect( mMapRenderer, SIGNAL( datumTransformInfoRequested( QgsMapLayer*, const QString&, const QString& ) ),
this, SLOT( getDatumTransformInfo( QgsMapLayer*, const QString& , const QString& ) ) );
connect( mMapRenderer, SIGNAL( datumTransformInfoRequested( const QgsMapLayer*, const QString&, const QString& ) ),
this, SLOT( getDatumTransformInfo( const QgsMapLayer*, const QString& , const QString& ) ) );

// create map canvas item which will show the map
mMap = new QgsMapCanvasMap( this );
@@ -1548,7 +1548,7 @@ void QgsMapCanvas::writeProject( QDomDocument & doc )
}

/**Ask user which datum transform to use*/
void QgsMapCanvas::getDatumTransformInfo( QgsMapLayer* ml, const QString& srcAuthId, const QString& destAuthId )
void QgsMapCanvas::getDatumTransformInfo( const QgsMapLayer* ml, const QString& srcAuthId, const QString& destAuthId )
{
if ( !ml )
{
@@ -304,7 +304,7 @@ class GUI_EXPORT QgsMapCanvas : public QGraphicsView
void writeProject( QDomDocument & );

//! ask user about datum transformation
void getDatumTransformInfo( QgsMapLayer* ml, const QString& srcAuthId, const QString& destAuthId );
void getDatumTransformInfo( const QgsMapLayer* ml, const QString& srcAuthId, const QString& destAuthId );

private slots:
//! called when current maptool is destroyed

0 comments on commit aec1d5e

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