27 #include "../../../common/STLUtils.h"
28 #include "../../../dataaccess/dataset/DataSet.h"
29 #include "../../../dataaccess/utils/Utils.h"
30 #include "../../../geometry.h"
31 #include "../../../maptools/DataSetLayer.h"
32 #include "../../../maptools/RasterTransform.h"
33 #include "../../../maptools/RasterTransformConfigurer.h"
34 #include "../../../qt/widgets/canvas/Canvas.h"
35 #include "../../../qt/widgets/canvas/MapDisplay.h"
36 #include "../../../raster/Raster.h"
37 #include "../../../raster/RasterSummary.h"
38 #include "../../../raster/RasterSummaryManager.h"
39 #include "../../../raster/Utils.h"
40 #include "../../../se/Utils.h"
41 #include "../../../se.h"
45 #include <QMouseEvent>
64 if(e->button() != Qt::LeftButton)
68 #if QT_VERSION >= 0x050000
69 QPointF qpoint = m_display->transform(e->localPos());
71 QPointF qpoint = m_display->transform(e->posF());
84 std::size_t nRules = cs->
getRules().size();
90 const std::vector<te::se::Symbolizer*>& symbolizers = rule->
getSymbolizers();
91 assert(!symbolizers.empty());
98 std::auto_ptr<te::da::DataSet> ds = m_layer->getData();
115 const std::complex<double>* cmin = rsMin->at(0).m_minVal;
116 const std::complex<double>* cmax = rsMax->at(0).m_maxVal;
127 te::gm::Coord2D coord = inputRst->getGrid()->geoToGrid(qpoint.x(), qpoint.y());
132 if((x >=0 && x < (
int)inputRst->getNumberOfColumns()) && (y >=0 && y < (
int)inputRst->getNumberOfRows()))
134 QString information(
"<h2>Read Pixel</h2><ul>");
136 information +=
"<h3>Location</h3>";
138 QString column, line, xCoord, yCoord;
141 xCoord.setNum(qpoint.x());
142 yCoord.setNum(qpoint.y());
144 information +=
"<li><b>" + QString(
"Line ") +
":</b> " + line +
"</li>";
145 information +=
"<li><b>" + QString(
"Column ") +
":</b> " + column +
"</li>";
146 information +=
"<li><b>" + QString(
"Coord X ") +
":</b> " + xCoord +
"</li>";
147 information +=
"<li><b>" + QString(
"Coord Y ") +
":</b> " + yCoord +
"</li>";
149 information +=
"<h3>Original Values</h3>";
151 for(
size_t t = 0; t < inputRst->getNumberOfBands(); ++t )
154 inputRst->getValue(x, y, val, t);
160 information +=
"<li><b>" + QString(
"Value for band ") + band +
":</b> " + value +
"</li>";
166 information +=
"<h3>Transformed Values</h3>";
168 QString red, green, blue, alpha;
169 red.setNum(color.
getRed());
174 QString rBand, gBand, bBand;
179 information +=
"<li><b>" + QString(
"Red Channel: </b>") + rBand +
"<b> - Value:</b> " + red +
"</li>";
180 information +=
"<li><b>" + QString(
"Green Channel: </b>") + gBand +
"<b> - Value:</b> " + green +
"</li>";
181 information +=
"<li><b>" + QString(
"Blue Channel: </b>") + bBand +
"<b> - Value:</b> " + blue +
"</li>";
182 information +=
"<li><b>" + QString(
"Alpha Channel value") +
":</b> " + alpha +
"</li>";
185 information +=
"<h3>Symbolizer</h3>";
191 type =
"RGB Composition";
195 type =
"Gray Composition";
199 type =
"Unknown Composition";
202 information +=
"<li><b>" + QString(
"Color Composition ") +
":</b> " + type +
"</li>";
207 information +=
"<li><b>" + QString(
"Opacity Value ") +
":</b> " + opacity +
"</li>";
213 information +=
"<li><b>" + QString(
"Gain Value ") +
":</b> " + gain +
"</li>";
219 information +=
"<li><b>" + QString(
"Offset Value ") +
":</b> " + offset +
"</li>";
222 if(rs->getChannelSelection()->getRedChannel() &&
223 rs->getChannelSelection()->getRedChannel()->getContrastEnhancement())
226 c.setNum(rs->getChannelSelection()->getRedChannel()->getContrastEnhancement()->getGammaValue());
228 information +=
"<li><b>" + QString(
"Red Contrast") +
":</b> " + c +
"</li>";
231 if(rs->getChannelSelection()->getGreenChannel() &&
232 rs->getChannelSelection()->getGreenChannel()->getContrastEnhancement())
235 c.setNum(rs->getChannelSelection()->getGreenChannel()->getContrastEnhancement()->getGammaValue());
237 information +=
"<li><b>" + QString(
"Green Contraste") +
":</b> " + c +
"</li>";
240 if(rs->getChannelSelection()->getBlueChannel() &&
241 rs->getChannelSelection()->getBlueChannel()->getContrastEnhancement())
244 c.setNum(rs->getChannelSelection()->getBlueChannel()->getContrastEnhancement()->getGammaValue());
246 information +=
"<li><b>" + QString(
"Blue Contraste") +
":</b> " + c +
"</li>";
249 if(rs->getChannelSelection()->getGrayChannel() &&
250 rs->getChannelSelection()->getGrayChannel()->getContrastEnhancement())
253 c.setNum(rs->getChannelSelection()->getGrayChannel()->getContrastEnhancement()->getGammaValue());
255 information +=
"<li><b>" + QString(
"Gray Contraste") +
":</b> " + c +
"</li>";
258 information +=
"</ul>";
261 QToolTip::showText(QCursor::pos(), information, m_display, m_display->rect());
int getRed() const
It returns the red component color value (a value from 0 to 255).
The CoverageStyle defines the styling that is to be applied to a subset of Coverage data...
int getBlue() const
It returns the blue component color value (a value from 0 to 255).
int getGreen() const
It returns the green component color value (a value from 0 to 255).
An utility struct for representing 2D coordinates.
Rule * getRule(std::size_t i) const
const std::vector< Rule * > & getRules() const
static RasterSummaryManager & getInstance()
It returns a reference to the singleton instance.
TERASTEREXPORT int Round(double val)
Round a double value to a integer value.
An abstract class for raster data strucutures.
virtual te::se::Style * getStyle() const
It returns the Style associated to the layer.
int getAlpha() const
It returns the alpha component color value (a value from 0 to 255).
boost::ptr_vector< BandSummary > RasterSummary
RasterSummary is just a typedef of a boost::ptr_vector.
The RasterSymbolizer describes how to render raster/matrix-coverage data (e.g., satellite photos...
const std::vector< Symbolizer * > & getSymbolizers() const
A Rule is used to attach property/scale conditions to and group the individual symbols used for rende...
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
A layer with reference to a dataset.
TEDATAACCESSEXPORT std::size_t GetFirstPropertyPos(const te::da::DataSet *dataset, int datatype)
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
TESEEXPORT std::string GetString(const te::se::ParameterValue *param)
It gets the parameter value as a string.