23 changes: 20 additions & 3 deletions src/plugins/georeferencer/qgsgeoreftransform.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#include <vector>
#include <stdexcept>

#include "qgsrasterchangecoords.h"

class QgsGeorefTransformInterface
{
public:
Expand Down Expand Up @@ -79,6 +81,20 @@ class QgsGeorefTransform : public QgsGeorefTransformInterface
*/
void selectTransformParametrisation( TransformParametrisation parametrisation );

/**
* Setting the mRasterChangeCoords for change type coordinate(map for pixel).
*/
void setRasterChangeCoords( const QString &fileRaster );

//! \returns Whether has Coordinate Reference Systems in image
bool hasCrs() const { return mRasterChangeCoords.hasCrs(); }

//! \returns Coordinates of image
QgsPoint toColumnLine(const QgsPoint &pntMap) { return mRasterChangeCoords.toColumnLine( pntMap ); }

//! \returns Bounding box of image(transform to coordinate of Map or Image )
QgsRectangle getBoundingBox(const QgsRectangle &rect, bool toPixel) { return mRasterChangeCoords.getBoundingBox( rect, toPixel); }

//! \brief The transform parametrisation currently in use.
TransformParametrisation transformParametrisation() const;

Expand Down Expand Up @@ -113,22 +129,22 @@ class QgsGeorefTransform : public QgsGeorefTransformInterface
*
* \note Negative y-axis points down in raster CS.
*/
bool transformRasterToWorld( const QgsPoint &raster, QgsPoint &world ) const;
bool transformRasterToWorld( const QgsPoint &raster, QgsPoint &world );

/**
* \brief Transform from referenced coordinates to raster coordinates.
*
* \note Negative y-axis points down in raster CS.
*/
bool transformWorldToRaster( const QgsPoint &world, QgsPoint &raster ) const;
bool transformWorldToRaster( const QgsPoint &world, QgsPoint &raster );

/**
* \brief Transforms from raster to world if rasterToWorld is true,
* \brief or from world to raster when rasterToWorld is false.
*
* \note Negative y-axis points down in raster CS.
*/
bool transform( const QgsPoint &src, QgsPoint &dst, bool rasterToWorld ) const;
bool transform( const QgsPoint &src, QgsPoint &dst, bool rasterToWorld );

//! \brief Returns origin and scale if this is a linear transform, fails otherwise.
bool getLinearOriginScale( QgsPoint &origin, double &scaleX, double &scaleY ) const;
Expand All @@ -149,6 +165,7 @@ class QgsGeorefTransform : public QgsGeorefTransformInterface
QgsGeorefTransformInterface *mGeorefTransformImplementation;
TransformParametrisation mTransformParametrisation;
bool mParametersInitialized;
QgsRasterChangeCoords mRasterChangeCoords;
};

#endif