11 #include "../../widgets/tools/CoordTracking.h" 12 #include "../../widgets/Utils.h" 13 #include "../../../qt/widgets/canvas/MapDisplay.h" 14 #include "../../../dataaccess/utils/Utils.h" 15 #include "../../../maptools/AbstractLayer.h" 16 #include "../../../maptools/MapDisplay.h" 17 #include "../../../maptools/RasterTransform.h" 18 #include "../../../maptools/Utils.h" 19 #include "../../../raster.h" 25 #include <QMessageBox> 26 #include <QMouseEvent> 31 :
te::qt::widgets::AbstractTool(display, parent)
40 QStatusBar* sb =
m_app->statusBar();
45 QMessageBox::information(
nullptr, tr(
"Show Values"),
TE_TR(
"Select a layer!"));
54 if (!dsType->hasRaster())
56 QMessageBox::information(
nullptr, tr(
"Show Values"),
TE_TR(
"Select a raster layer!"));
64 QMessageBox::information(
nullptr, tr(
"Show Values"),
TE_TR(
"SRID layer is different SRID display!"));
71 #if QT_VERSION >= 0x050000 85 te::gm::Coord2D coord = raster->getGrid()->geoToGrid(qpoint.x(), qpoint.y());
90 if (x >= 0 && y >= 0 && x < (
int)raster->getNumberOfColumns() && y < (
int)raster->getNumberOfRows())
93 raster->getValue(x, y, val, 0);
96 if (val != raster->getBand(0)->getProperty()->m_noDataValue)
97 information = QString(tr(
"Coord: %1, %2 Value: %3")).arg(qpoint.x(), 0,
'f').arg(qpoint.y(), 0,
'f').arg(val);
99 information = QString(tr(
"Coord: %1, %2 NODATA")).arg(qpoint.x(), 0,
'f').arg(qpoint.y(), 0,
'f');
101 sb->showMessage(information);
This is the base class for layers.
An utility struct for representing 2D coordinates.
Configuration flags for the MNT Qt Widget plugin.
#define TE_TR(message)
It marks a string in order to get translated.
This file defines the Show MNT Values Proccess.
virtual int getSRID() const
It return the Spatial Reference System used by the Map Display.
virtual std::unique_ptr< LayerSchema > getSchema() const =0
It returns the layer schema.
TERASTEREXPORT int Round(double val)
Round a double value to a integer value.
te::qt::widgets::LayerItemView * getLayerExplorer()
TEMAPEXPORT te::rst::Raster * GetRaster(AbstractLayer *layer)
It gets the raster referenced by the given data set layer.
virtual int getSRID() const
It returns the Spatial Reference System ID associated to the Layer.