QGIS API Documentation  2.2.0-Valmiera
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes | List of all members
QgsCoordinateTransformCache Class Reference

Cache coordinate transform by authid of source/dest transformation to avoid the overhead of initialisation for each redraw. More...

#include <qgscrscache.h>

Collaboration diagram for QgsCoordinateTransformCache:
Collaboration graph
[legend]

Public Member Functions

 ~QgsCoordinateTransformCache ()
const QgsCoordinateTransformtransform (const QString &srcAuthId, const QString &destAuthId, int srcDatumTransform=-1, int destDatumTransform=-1)
 Returns coordinate transformation.
void invalidateCrs (const QString &crsAuthId)
 Removes transformations where a changed crs is involved from the cache.

Static Public Member Functions

static
QgsCoordinateTransformCache
instance ()

Private Attributes

QMultiHash< QPair< QString,
QString >
, QgsCoordinateTransform * > 
mTransforms

Static Private Attributes

static
QgsCoordinateTransformCache
mInstance

Detailed Description

Cache coordinate transform by authid of source/dest transformation to avoid the overhead of initialisation for each redraw.

Definition at line 28 of file qgscrscache.h.

Constructor & Destructor Documentation

QgsCoordinateTransformCache::~QgsCoordinateTransformCache ( )

Definition at line 28 of file qgscrscache.cpp.

References mTransforms.

Member Function Documentation

QgsCoordinateTransformCache * QgsCoordinateTransformCache::instance ( )
static
void QgsCoordinateTransformCache::invalidateCrs ( const QString &  crsAuthId)

Removes transformations where a changed crs is involved from the cache.

Definition at line 62 of file qgscrscache.cpp.

References mTransforms.

const QgsCoordinateTransform * QgsCoordinateTransformCache::transform ( const QString &  srcAuthId,
const QString &  destAuthId,
int  srcDatumTransform = -1,
int  destDatumTransform = -1 
)

Returns coordinate transformation.

Cache keeps ownership

Parameters
srcAuthIdauth id string of source crs
destAuthIdauth id string of dest crs
srcDatumTransformid of source's datum transform
destDatumTransformid of destinations's datum transform

Definition at line 37 of file qgscrscache.cpp.

References QgsCoordinateTransform::initialise(), instance(), mTransforms, QgsCoordinateTransform::setDestinationDatumTransform(), and QgsCoordinateTransform::setSourceDatumTransform().

Referenced by QgsRasterProjector::block(), QgsRasterProjector::calc(), and QgsMapRenderer::transformation().

Member Data Documentation

QgsCoordinateTransformCache* QgsCoordinateTransformCache::mInstance
staticprivate

Definition at line 44 of file qgscrscache.h.

Referenced by instance().

QMultiHash< QPair< QString, QString >, QgsCoordinateTransform* > QgsCoordinateTransformCache::mTransforms
private

Definition at line 45 of file qgscrscache.h.

Referenced by invalidateCrs(), transform(), and ~QgsCoordinateTransformCache().


The documentation for this class was generated from the following files: