QGIS API Documentation  2.5.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | List of all members
QgsMapToPixel Class Reference

Perform transforms between map coordinates and device coordinates. More...

#include <qgsmaptopixel.h>

Public Member Functions

 QgsMapToPixel (double mapUnitsPerPixel=0, double ymax=0, double ymin=0, double xmin=0)
 
 ~QgsMapToPixel ()
 destructor More...
 
QgsPoint transform (const QgsPoint &p) const
 
void transform (QgsPoint *p) const
 
QgsPoint transform (double x, double y) const
 
void transformInPlace (double &x, double &y) const
 
void transformInPlace (QVector< double > &x, QVector< double > &y) const
 
QgsPoint toMapCoordinates (int x, int y) const
 
QgsPoint toMapCoordinatesF (double x, double y) const
 
QgsPoint toMapCoordinates (QPoint p) const
 
QgsPoint toMapPoint (double x, double y) const
 
void setMapUnitsPerPixel (double mapUnitsPerPixel)
 
double mapUnitsPerPixel () const
 Return current map units per pixel. More...
 
void setYMaximum (double ymax)
 Set maximum y value. More...
 
void setYMinimum (double ymin)
 Set minimum y value. More...
 
void setXMinimum (double xmin)
 set minimum x value More...
 
void setParameters (double mapUnitsPerPixel, double xmin, double ymin, double ymax)
 
QString showParameters ()
 String representation of the parameters used in the transform. More...
 

Detailed Description

Perform transforms between map coordinates and device coordinates.

This class can convert device coordinates to map coordinates and vice versa.

Constructor & Destructor Documentation

QgsMapToPixel::QgsMapToPixel ( double  mapUnitsPerPixel = 0,
double  ymax = 0,
double  ymin = 0,
double  xmin = 0 
)
QgsMapToPixel::~QgsMapToPixel ( )

destructor

Member Function Documentation

double QgsMapToPixel::mapUnitsPerPixel ( ) const

Return current map units per pixel.

void QgsMapToPixel::setMapUnitsPerPixel ( double  mapUnitsPerPixel)

Set map units per pixel

Parameters
mapUnitsPerPixelMap units per pixel
void QgsMapToPixel::setParameters ( double  mapUnitsPerPixel,
double  xmin,
double  ymin,
double  ymax 
)

Set parameters for use in tranfsorming coordinates

Parameters
mapUnitsPerPixelMap units per pixel
xminMinimum x value
yminMinimum y value
ymaxMaximum y value
void QgsMapToPixel::setXMinimum ( double  xmin)

set minimum x value

void QgsMapToPixel::setYMaximum ( double  ymax)

Set maximum y value.

void QgsMapToPixel::setYMinimum ( double  ymin)

Set minimum y value.

QString QgsMapToPixel::showParameters ( )

String representation of the parameters used in the transform.

QgsPoint QgsMapToPixel::toMapCoordinates ( int  x,
int  y 
) const
QgsPoint QgsMapToPixel::toMapCoordinates ( QPoint  p) const

Tranform device coordinates to map (world) coordinates

Parameters
pPoint to be converted to map cooordinates
Returns
QgsPoint in map coorndiates
QgsPoint QgsMapToPixel::toMapCoordinatesF ( double  x,
double  y 
) const

Transform device coordinates to map (world) coordinates

Note
: this method was added in version 1.6
QgsPoint QgsMapToPixel::toMapPoint ( double  x,
double  y 
) const
QgsPoint QgsMapToPixel::transform ( const QgsPoint p) const

Transform the point from map (world) coordinates to device coordinates

Parameters
pPoint to transform
Returns
QgsPoint in device coordinates
void QgsMapToPixel::transform ( QgsPoint p) const
QgsPoint QgsMapToPixel::transform ( double  x,
double  y 
) const

Transform the point specified by x,y from map (world) coordinates to device coordinates

Parameters
xx cordinate o point to transform
yy coordinate of point to transform
Returns
QgsPoint in device coordinates
void QgsMapToPixel::transformInPlace ( double &  x,
double &  y 
) const

Tranform device coordinates to map (world) coordinates

Parameters
xx coordinate of point to be converted to map cooordinates
yy coordinate of point to be converted to map cooordinates
Returns
QgsPoint in map coordinates
void QgsMapToPixel::transformInPlace ( QVector< double > &  x,
QVector< double > &  y 
) const

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