Quantum GIS API Documentation
1.7.5-Wroclaw
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
src
core
qgsrasterprojector.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsrasterprojector.h - Raster projector
3
--------------------------------------
4
Date : Jan 16, 2011
5
Copyright : (C) 2005 by Radim Blazek
6
email : radim dot blazek at gmail dot com
7
***************************************************************************/
8
9
/***************************************************************************
10
* *
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
15
* *
16
***************************************************************************/
17
/* $Id: qgsrasterprojector.h 15005 2011-01-08 16:35:21Z rblazek $ */
18
19
/* This code takes ideas from WarpBuilder in Geotools.
20
* Thank you to Ing. Andrea Aime, Ing. Simone Giannecchini and GeoSolutions S.A.S.
21
* See : http://geo-solutions.blogspot.com/2011/01/developers-corner-improving.html
22
*/
23
24
#ifndef QGSRASTERPROJECTOR_H
25
#define QGSRASTERPROJECTOR_H
26
27
#include <QVector>
28
#include <QList>
29
30
31
#include "
qgsrectangle.h
"
32
#include "
qgscoordinatereferencesystem.h
"
33
#include "
qgscoordinatetransform.h
"
34
35
#include <cmath>
36
37
//class QgsRectangle;
38
class
QgsPoint
;
39
40
//class CORE_EXPORT QgsRasterProjector
41
class
QgsRasterProjector
42
{
43
// Q_OBJECT
44
public
:
49
QgsRasterProjector
(
50
QgsCoordinateReferenceSystem
theSrcCRS,
51
QgsCoordinateReferenceSystem
theDestCRS,
52
QgsRectangle
theDestExtent,
53
int
theDestRows,
int
theDestCols,
54
double
theMaxSrcXRes,
double
theMaxSrcYRes,
55
QgsRectangle
theExtent
56
);
57
59
~QgsRasterProjector
();
60
61
63
void
destPointOnCPMatrix
(
int
theRow,
int
theCol,
double
*theX,
double
*theY );
64
66
int
matrixRow
(
int
theDestRow );
67
int
matrixCol
(
int
theDestCol );
68
70
QgsPoint
srcPoint
(
int
theRow,
int
theCol );
71
73
inline
void
preciseSrcRowCol
(
int
theDestRow,
int
theDestCol,
int
*theSrcRow,
int
*theSrcCol );
74
76
inline
void
approximateSrcRowCol
(
int
theDestRow,
int
theDestCol,
int
*theSrcRow,
int
*theSrcCol );
77
79
void
srcRowCol
(
int
theDestRow,
int
theDestCol,
int
*theSrcRow,
int
*theSrcCol );
80
82
void
insertRows
();
83
85
void
insertCols
();
86
87
/* calculate single control point in current matrix */
88
void
calcCP
(
int
theRow,
int
theCol );
89
91
bool
calcRow
(
int
theRow );
92
94
bool
calcCol
(
int
theCol );
95
97
void
calcSrcExtent
();
98
100
void
calcSrcRowsCols
();
101
104
bool
checkCols
();
105
108
bool
checkRows
();
109
111
//void calcHelper ( int theMatrixRow, QList<QgsPoint> *thePoints );
112
void
calcHelper
(
int
theMatrixRow,
QgsPoint
*thePoints );
113
115
void
nextHelper
();
116
118
QgsRectangle
srcExtent
() {
return
mSrcExtent
; }
119
121
int
srcRows
() {
return
mSrcRows
; }
122
int
srcCols
() {
return
mSrcCols
; }
123
void
setSrcRows
(
int
theRows ) {
mSrcRows
= theRows;
mSrcXRes
=
mSrcExtent
.
height
() /
mSrcRows
; }
124
void
setSrcCols
(
int
theCols ) {
mSrcCols
= theCols;
mSrcYRes
=
mSrcExtent
.
width
() /
mSrcCols
; }
125
127
QString
cpToString
();
128
129
private
:
131
QgsCoordinateReferenceSystem
mSrcCRS
;
132
134
QgsCoordinateReferenceSystem
mDestCRS
;
135
137
QgsCoordinateTransform
mCoordinateTransform
;
138
140
QgsRectangle
mDestExtent
;
141
143
QgsRectangle
mSrcExtent
;
144
146
QgsRectangle
mExtent
;
147
149
int
mDestRows
;
150
152
int
mDestCols
;
153
155
double
mDestXRes
;
156
158
double
mDestYRes
;
159
161
int
mSrcRows
;
162
164
int
mSrcCols
;
165
167
double
mSrcXRes
;
168
170
double
mSrcYRes
;
171
173
double
mDestRowsPerMatrixRow
;
174
176
double
mDestColsPerMatrixCol
;
177
179
QList< QList<QgsPoint> >
mCPMatrix
;
180
182
/* Warning: using QList is slow on access */
183
QgsPoint
*
pHelperTop
;
184
186
/* Warning: using QList is slow on access */
187
QgsPoint
*
pHelperBottom
;
188
190
int
mHelperTopRow
;
191
193
int
mCPCols
;
195
int
mCPRows
;
196
198
double
mSqrTolerance
;
199
201
double
mMaxSrcXRes
;
202
double
mMaxSrcYRes
;
203
205
bool
mApproximate
;
206
};
207
208
#endif
209
Generated on Wed Jun 13 2012 13:54:11 for Quantum GIS API Documentation by
1.8.1