All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ColorMapWidget.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2011-2012 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file terralib/qt/widgets/se/ColorMapWidget.cpp
22 
23  \brief A dialog used to build a Color Map element.
24 */
25 
26 // TerraLib
27 
28 #include "../../../color/ColorBar.h"
29 #include "../../../common/STLUtils.h"
30 #include "../../../dataaccess/dataset/DataSet.h"
31 #include "../../../dataaccess/dataset/DataSetType.h"
32 #include "../../../dataaccess/utils/Utils.h"
33 #include "../../../datatype.h"
34 #include "../../../maptools/DataSetLayer.h"
35 #include "../../../maptools/GroupingAlgorithms.h"
36 #include "../../../maptools/RasterLayer.h"
37 #include "../../../fe/Literal.h"
38 #include "../../../raster.h"
39 #include "../../../raster/RasterSummary.h"
40 #include "../../../raster/RasterSummaryManager.h"
41 #include "../../../se/ColorMap.h"
42 #include "../../../se/Categorize.h"
43 #include "../../../se/Enums.h"
44 #include "../../../se/Interpolate.h"
45 #include "../../../se/InterpolationPoint.h"
46 #include "../../../se/ParameterValue.h"
47 #include "../../../se/RasterSymbolizer.h"
48 #include "../../../se/Utils.h"
49 #include "../../widgets/colorbar/ColorBar.h"
50 #include "../../widgets/colorbar/ColorCatalogWidget.h"
51 #include "ColorMapWidget.h"
52 #include "ui_ColorMapWidgetForm.h"
53 
54 // Qt
55 #include <QColorDialog>
56 #include <QMessageBox>
57 #include <QPainter>
58 #include <QValidator>
59 
60 // STL
61 #include <cassert>
62 
64 
65 te::qt::widgets::ColorMapWidget::ColorMapWidget(QWidget* parent, Qt::WindowFlags f)
66  : QWidget(parent, f),
67  m_ui(new Ui::ColorMapWidgetForm),
68  m_cm(0),
69  m_cb(0),
70  m_raster(0)
71 {
72  m_ui->setupUi(this);
73 
74  QGridLayout* l = new QGridLayout(m_ui->m_colorBarWidget);
75  l->setContentsMargins(0,0,0,0);
76  m_colorBar = new te::qt::widgets::ColorCatalogWidget(m_ui->m_colorBarWidget);
77  l->addWidget(m_colorBar);
78 
79  m_ui->m_minValueLineEdit->setValidator(new QDoubleValidator(this));
80  m_ui->m_maxValueLineEdit->setValidator(new QDoubleValidator(this));
81 
82  initialize();
83 
84  // Signals & slots
85  connect(m_colorBar, SIGNAL(colorBarChanged()), this, SLOT(onApplyPushButtonClicked()));
86  connect(m_ui->m_bandComboBox, SIGNAL(activated(QString)), this, SLOT(onBandSelected(QString)));
87  connect(m_ui->m_applyPushButton, SIGNAL(clicked()), this, SLOT(onApplyPushButtonClicked()));
88  connect(m_ui->m_tableWidget, SIGNAL(itemDoubleClicked(QTableWidgetItem*)), this, SLOT(onTableWidgetItemDoubleClicked(QTableWidgetItem*)));
89  connect(m_ui->m_importPushButton, SIGNAL(clicked()), this, SLOT(onImportPushButtonClicked()));
90 }
91 
93 {
94  delete m_cb;
95 
96  delete m_cm;
97 }
98 
100 {
101  assert(r);
102 
103  m_raster = r;
104 
105  int nBands = m_raster->getNumberOfBands();
106 
107  m_ui->m_bandComboBox->clear();
108 
109  for(int i = 0; i < nBands; ++i)
110  {
111  QString strBand;
112  strBand.setNum(i);
113 
114  m_ui->m_bandComboBox->addItem(strBand);
115  }
116 
117  if(nBands > 0)
118  onBandSelected(m_ui->m_bandComboBox->itemText(0));
119 }
120 
122 {
123  assert(cm);
124 
125  m_cm = cm->clone();
126 
127  updateUi(true);
128 }
129 
131 {
132  return m_cm->clone();
133 }
134 
136 {
137  if(m_ui->m_bandComboBox->count() != 0)
138  {
139  return m_ui->m_bandComboBox->currentText().toStdString();
140  }
141 
142  return "";
143 }
144 
146 {
147  m_colorBar->getColorBar()->setHeight(20);
148  m_colorBar->getColorBar()->setScaleVisible(false);
149 
150  m_ui->m_transformComboBox->clear();
151 
152  m_ui->m_transformComboBox->addItem(tr("Categorize"), te::se::CATEGORIZE_TRANSFORMATION);
153  m_ui->m_transformComboBox->addItem(tr("Interpolate"), te::se::INTERPOLATE_TRANSFORMATION);
154  //m_ui->m_transformComboBox->addItem(tr("Recode"), te::se::RECODE_TRANSFORMATION);
155 }
156 
158 {
159  m_ui->m_tableWidget->setRowCount(0);
160 
161  if(!m_cm)
162  {
163  return;
164  }
165 
166  te::color::ColorBar* cb = 0;
167 
168  if(m_cm->getCategorize())
169  {
170  for(int i = 0; i < m_ui->m_transformComboBox->count(); ++i)
171  {
172  if(m_ui->m_transformComboBox->itemData(i).toInt() == te::se::CATEGORIZE_TRANSFORMATION)
173  m_ui->m_transformComboBox->setCurrentIndex(i);
174  }
175 
176  std::vector<te::se::ParameterValue*> t = m_cm->getCategorize()->getThresholds();
177  std::vector<te::se::ParameterValue*> tV = m_cm->getCategorize()->getThresholdValues();
178 
179  m_ui->m_slicesSpinBox->setValue(tV.size() - 2);
180 
181  m_ui->m_tableWidget->setRowCount(tV.size() - 2);
182 
183  te::color::RGBAColor initColor(te::se::GetString(tV[1]).c_str());
184  te::color::RGBAColor endColor(te::se::GetString(tV[tV.size() - 2]).c_str());
185 
186  if(loadColorBar)
187  cb = new te::color::ColorBar(initColor, endColor, 256);
188 
189  int count = 0;
190 
191  for(size_t i = 1; i < tV.size() - 1; ++i)
192  {
193  QColor color;
194  std::string lowerLimit = "";
195  std::string upperLimit = "";
196 
197  if(i == 0)
198  {
199  lowerLimit = "...";
200  upperLimit = te::se::GetString(t[i]);
201  color.setNamedColor(te::se::GetString(tV[i]).c_str());
202  }
203  else if(i == tV.size() - 1)
204  {
205  lowerLimit = te::se::GetString(t[i - 1]);
206  upperLimit = "...";
207  color.setNamedColor(te::se::GetString(tV[i]).c_str());
208  }
209  else
210  {
211  lowerLimit = te::se::GetString(t[i - 1]);
212  upperLimit = te::se::GetString(t[i]);
213  color.setNamedColor(te::se::GetString(tV[i]).c_str());
214  }
215 
216  if(loadColorBar)
217  {
218  if(count != 0 && count != tV.size() - 2)
219  {
220  double pos = (1. / (tV.size() - 2)) * count;
221 
222  te::color::RGBAColor color(te::se::GetString(tV[i]).c_str());
223 
224  cb->addColor(color, pos);
225  }
226  }
227 
228  ++count;
229 
230  //color
231  QTableWidgetItem* item = new QTableWidgetItem();
232  item->setBackgroundColor(color);
233  item->setFlags(Qt::ItemIsEnabled);
234  item->setData(Qt::UserRole, QVariant((int)i));
235  m_ui->m_tableWidget->setItem(i - 1, 1, item);
236 
237  //value
238  std::string range = lowerLimit + " - " + upperLimit;
239  QTableWidgetItem* itemRange = new QTableWidgetItem();
240  itemRange->setText(range.c_str());
241  itemRange->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEnabled);
242  m_ui->m_tableWidget->setItem(i - 1, 0, itemRange);
243 
244  //label
245  std::string rangeStr = lowerLimit + " to " + upperLimit;
246  QTableWidgetItem* itemRangeStr = new QTableWidgetItem();
247  itemRangeStr->setText(rangeStr.c_str());
248  itemRangeStr->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEnabled);
249  m_ui->m_tableWidget->setItem(i - 1, 2, itemRangeStr);
250  }
251  }
252  else if(m_cm->getInterpolate())
253  {
254  for(int i = 0; i < m_ui->m_transformComboBox->count(); ++i)
255  {
256  if(m_ui->m_transformComboBox->itemData(i).toInt() == te::se::INTERPOLATE_TRANSFORMATION)
257  m_ui->m_transformComboBox->setCurrentIndex(i);
258  }
259 
260  std::vector<te::se::InterpolationPoint*> ip = m_cm->getInterpolate()->getInterpolationPoints();
261 
262  m_ui->m_slicesSpinBox->setValue(ip.size() - 1);
263 
264  m_ui->m_tableWidget->setRowCount(ip.size() - 1);
265 
266  te::color::RGBAColor initColor(te::se::GetString(ip[0]->getValue()).c_str());
267  te::color::RGBAColor endColor(te::se::GetString(ip[ip.size() - 1]->getValue()).c_str());
268 
269  if(loadColorBar)
270  cb = new te::color::ColorBar(initColor, endColor, 256);
271 
272  int count = 0;
273 
274  for(size_t i = 0; i < ip.size() - 1; ++i)
275  {
276  QColor color;
277  QString valStrBegin;
278  QString valStrEnd;
279 
280  te::se::InterpolationPoint* ipItem = ip[i];
281 
282  color.setNamedColor(te::se::GetString(ipItem->getValue()).c_str());
283 
284  valStrBegin.setNum(ipItem->getData());
285  valStrEnd.setNum(ip[i+1]->getData());
286 
287  QString valStr;
288  valStr.append(valStrBegin);
289  valStr.append(" - ");
290  valStr.append(valStrEnd);
291 
292  if(loadColorBar)
293  {
294  if(count != 0 && count != ip.size() - 1)
295  {
296  double pos = (1. / (ip.size() - 1)) * count;
297 
298  te::color::RGBAColor color(te::se::GetString(ipItem->getValue()).c_str());
299 
300  cb->addColor(color, pos);
301  }
302  }
303 
304  ++count;
305 
306  //color
307  QTableWidgetItem* item = new QTableWidgetItem();
308  item->setBackgroundColor(color);
309  item->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEnabled);
310  item->setData(Qt::UserRole, QVariant((int)i));
311  m_ui->m_tableWidget->setItem(i, 1, item);
312 
313  //value
314  QTableWidgetItem* itemRange = new QTableWidgetItem();
315  itemRange->setText(valStr);
316  itemRange->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEnabled);
317  m_ui->m_tableWidget->setItem(i, 0, itemRange);
318 
319  //label
320  QTableWidgetItem* itemRangeStr = new QTableWidgetItem();
321  itemRangeStr->setText(valStr);
322  itemRangeStr->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEnabled);
323  m_ui->m_tableWidget->setItem(i, 2, itemRangeStr);
324  }
325  }
326 
327  if(cb)
328  {
329  disconnect(m_colorBar, SIGNAL(colorBarChanged()), this, SLOT(onApplyPushButtonClicked()));
330 
332  cbW->setColorBar(cb);
333 
334  connect(m_colorBar, SIGNAL(colorBarChanged()), this, SLOT(onApplyPushButtonClicked()));
335  }
336 
337  m_ui->m_tableWidget->resizeColumnToContents(0);
338  m_ui->m_tableWidget->resizeColumnToContents(1);
339 }
340 
342 {
343  delete m_cb;
344 
345  m_cb = m_colorBar->getColorBar()->getColorBar();
346 
347  int sliceValue = m_ui->m_slicesSpinBox->value();
348 
349  std::vector<te::color::RGBAColor> colorVec = m_cb->getSlices(sliceValue);
350 
351  std::vector<te::map::GroupingItem*> legVec;
352 
353  std::vector<double> vec;
354  vec.push_back(m_ui->m_minValueLineEdit->text().toDouble());
355  vec.push_back(m_ui->m_maxValueLineEdit->text().toDouble());
356 
357  te::map::GroupingByEqualSteps(vec.begin(), vec.end(), sliceValue, legVec, 1);
358 
360 
361  c->setFallbackValue("#000000");
362  c->setLookupValue(new te::se::ParameterValue("Rasterdata"));
363 
364  QColor cWhite(Qt::white);
365  std::string colorWhiteStr = cWhite.name().toLatin1().data();
366 
367  //added dummy color for values < than min values...
368  c->addValue(new te::se::ParameterValue(colorWhiteStr));
369 
370  for(size_t i = 0; i < colorVec.size(); ++i)
371  {
372  QColor color(colorVec[i].getRed(), colorVec[i].getGreen(), colorVec[i].getBlue(), colorVec[i].getAlpha());
373 
374  std::string rangeStr = legVec[i]->getLowerLimit();
375  std::string colorStr = color.name().toStdString();
376 
377  c->addThreshold(new te::se::ParameterValue(rangeStr));
378  c->addValue(new te::se::ParameterValue(colorStr));
379 
380  if(i == colorVec.size() - 1)
381  {
382  rangeStr = legVec[i]->getUpperLimit();
383  c->addThreshold(new te::se::ParameterValue(rangeStr));
384  }
385  }
386 
387  //added dummy color for values > than max values...
388  c->addValue(new te::se::ParameterValue(colorWhiteStr));
389 
390  c->setThresholdsBelongTo(te::se::Categorize::SUCCEEDING);
391 
392  if(m_cm)
393  {
394  m_cm->setCategorize(c);
395  m_cm->setInterpolate(0);
396  }
397 }
398 
400 {
401  delete m_cb;
402 
403  m_cb = m_colorBar->getColorBar()->getColorBar();
404 
405  int sliceValue = m_ui->m_slicesSpinBox->value();
406 
407  std::vector<te::color::RGBAColor> colorVec = m_cb->getSlices(sliceValue + 1);
408 
409  std::vector<te::map::GroupingItem*> legVec;
410 
411  std::vector<double> vec;
412  vec.push_back(m_ui->m_minValueLineEdit->text().toDouble());
413  vec.push_back(m_ui->m_maxValueLineEdit->text().toDouble());
414 
415  te::map::GroupingByEqualSteps(vec.begin(), vec.end(), sliceValue, legVec, 1);
416 
417 
418  te::se::Interpolate* interpolate = new te::se::Interpolate();
419 
420  interpolate->setFallbackValue("#000000");
421  interpolate->setLookupValue(new te::se::ParameterValue("Rasterdata"));
422  interpolate->setMethodType(te::se::Interpolate::COLOR);
423 
424 
425  for(size_t i = 0; i < colorVec.size(); ++i)
426  {
427  QColor color(colorVec[i].getRed(), colorVec[i].getGreen(), colorVec[i].getBlue(), colorVec[i].getAlpha());
428 
429  if(i == colorVec.size() - 1)
430  {
431  QString rangeStr = legVec[i - 1]->getUpperLimit().c_str();
432  std::string colorStr = color.name().toLatin1().data();
433 
435 
436  ip->setData(rangeStr.toDouble());
437  ip->setValue(new te::se::ParameterValue(colorStr));
438 
439  interpolate->add(ip);
440  }
441  else
442  {
443  QString rangeStr = legVec[i]->getLowerLimit().c_str();
444  std::string colorStr = color.name().toLatin1().data();
445 
447 
448  ip->setData(rangeStr.toDouble());
449  ip->setValue(new te::se::ParameterValue(colorStr));
450 
451  interpolate->add(ip);
452  }
453  }
454 
455  if(m_cm)
456  {
457  m_cm->setInterpolate(interpolate);
458  m_cm->setCategorize(0);
459  }
460 }
461 
463 {
464 
465 }
466 
467 
469 {
470  int index = m_ui->m_transformComboBox->currentIndex();
471 
472  int type = m_ui->m_transformComboBox->itemData(index).toInt();
473 
475  {
476  buildCategorizationMap();
477  }
478  else if(type == te::se::INTERPOLATE_TRANSFORMATION)
479  {
480  buildInterpolationMap();
481  }
482  else if(type == te::se::RECODE_TRANSFORMATION)
483  {
484  buildRecodingMap();
485  }
486 
487  emit applyPushButtonClicked();
488 
489  updateUi();
490 }
491 
493 {
494  if(value.isEmpty())
495  {
496  return;
497  }
498 
501  const std::complex<double>* cmin = rsMin->at(0).m_minVal;
502  const std::complex<double>* cmax = rsMax->at(0).m_maxVal;
503  double min = cmin->real();
504  double max = cmax->real();
505 
506  QString strMin;
507  strMin.setNum(min);
508  m_ui->m_minValueLineEdit->setText(strMin);
509 
510  QString strMax;
511  strMax.setNum(max);
512  m_ui->m_maxValueLineEdit->setText(strMax);
513 }
514 
516 {
517  int curCol = m_ui->m_tableWidget->currentColumn();
518  int curRow = m_ui->m_tableWidget->currentRow();
519 
520  if(curCol == 1)
521  {
522  int index = item->data(Qt::UserRole).toInt();
523 
524  QColor bgColor = item->backgroundColor();
525 
526  QColor newBgColor = QColorDialog::getColor(bgColor, m_ui->m_tableWidget);
527 
528  if(newBgColor.isValid())
529  bgColor = newBgColor;
530 
531  te::se::ParameterValue* value = new te::se::ParameterValue(bgColor.name().toLatin1().data());
532 
533  int type = m_ui->m_transformComboBox->itemData(m_ui->m_transformComboBox->currentIndex()).toInt();
534 
536  {
537  te::se::Categorize* old = m_cm->getCategorize();
538 
539  te::se::ParameterValue* param = old->getThresholdValues()[curRow+1];
541  litExp->setValue(bgColor.name().toStdString());
542  }
543  else if(type == te::se::INTERPOLATE_TRANSFORMATION)
544  {
545  std::vector<te::se::InterpolationPoint*> ip = m_cm->getInterpolate()->getInterpolationPoints();
546 
547  te::se::InterpolationPoint* ipItem = ip[index];
548 
549  ipItem->setValue(value);
550  }
551 
552  item->setBackgroundColor(bgColor);
553 
554  emit applyPushButtonClicked();
555  }
556 }
557 
559 {
560  te::se::RasterSymbolizer* symb = 0;
561 
562  if(layer->getType() == "DATASETLAYER")
563  {
564  te::map::DataSetLayer* l = dynamic_cast<te::map::DataSetLayer*>(layer.get());
565 
566  if(l)
567  {
569  }
570  }
571  else if(layer->getType() == "RASTERLAYER")
572  {
573  te::map::RasterLayer* l = dynamic_cast<te::map::RasterLayer*>(layer.get());
574 
575  if(l)
576  {
578  }
579  }
580 
581  if(symb)
582  {
583  if(symb->getColorMap())
584  {
585  return symb->getColorMap();
586  }
587  }
588 
589  return 0;
590 }
591 
593 {
594  te::rst::Raster* raster = 0;
595 
596  if(layer->getType() == "DATASETLAYER")
597  {
598  te::map::DataSetLayer* l = dynamic_cast<te::map::DataSetLayer*>(layer.get());
599 
600  if(l)
601  {
602  std::auto_ptr<te::da::DataSet> ds = layer->getData();
603 
604  if(ds.get())
605  {
606  std::size_t rpos = te::da::GetFirstPropertyPos(ds.get(), te::dt::RASTER_TYPE);
607  return ds->getRaster(rpos).release();
608  }
609  }
610  }
611  else if(layer->getType() == "RASTERLAYER")
612  {
613  te::map::RasterLayer* l = dynamic_cast<te::map::RasterLayer*>(layer.get());
614 
615  if(l)
616  {
617  return l->getRaster();
618  }
619  }
620 
621  return 0;
622 }
623 
624 void te::qt::widgets::ColorMapWidget::setLayers(te::map::AbstractLayerPtr selectedLayer, std::vector<te::map::AbstractLayerPtr> allLayers)
625 {
626  for(std::size_t i = 0; i < allLayers.size(); ++i)
627  {
628  std::auto_ptr<te::da::DataSetType> dt(allLayers[i]->getSchema());
629 
630  if(dt->hasRaster() && getLayerColorMap(allLayers[i]) && allLayers[i]->getId() != selectedLayer->getId())
631  {
632  m_ui->m_layersComboBox->addItem(allLayers[i]->getTitle().c_str(), QVariant::fromValue(allLayers[i]));
633  }
634  }
635 }
636 
638 {
639  if(m_ui->m_layersComboBox->currentText() == "")
640  {
641  QMessageBox::warning(this, tr("Grouping"), tr("There are no other layers with Grouping!"));
642  return;
643  }
644 
645  QVariant varLayer = m_ui->m_layersComboBox->itemData(m_ui->m_layersComboBox->currentIndex(), Qt::UserRole);
646  te::map::AbstractLayerPtr layer = varLayer.value<te::map::AbstractLayerPtr>();
647 
648  te::se::ColorMap* cm = getLayerColorMap(layer);
649 
650  setRaster(getLayerRaster(layer));
651  setColorMap(cm);
652 
653  if(cm->getCategorize())
654  {
655  buildCategorizationMap();
656  }
657  else if(cm->getInterpolate())
658  {
659  buildInterpolationMap();
660  }
661 
662  emit applyPushButtonClicked();
663 
664  updateUi(true);
665 }
ParameterValue * getValue() const
ColorMap * clone() const
Definition: ColorMap.cpp:80
The transformation of continuous values to distinct values (Categorize function). ...
Definition: Categorize.h:90
Q_DECLARE_METATYPE(te::map::AbstractLayerPtr)
void setData(const double &d)
te::fe::Expression * m_expression
Parameter from an expression.
TESEEXPORT RasterSymbolizer * GetRasterSymbolizer(Style *s)
Try to get raster symbolizer from a style.
Definition: Utils.cpp:371
te::rst::Raster * getRaster() const
void addColor(const RGBAColor &color, const double &pos)
It adds a color in the color bar.
Definition: ColorBar.cpp:264
void onTableWidgetItemDoubleClicked(QTableWidgetItem *item)
void GroupingByEqualSteps(iterator begin, iterator end, int nSteps, std::vector< te::map::GroupingItem * > &legend, int precision=0, bool countElements=true)
It groups the values defined by a range of iterators using the equal steps algorithm.
The transformation of continuous values to a number of values (Interpolate function).
Definition: Interpolate.h:88
The "ParameterValueType" uses WFS-Filter expressions to give values for SE graphic parameters...
A widget used to build.
void setColorBar(te::color::ColorBar *cb)
It sets the color bar.
Definition: ColorBar.cpp:108
void setValue(ParameterValue *v)
void setValue(const std::string &v)
It sets the literal value.
Definition: Literal.cpp:43
const Parameter * getParameter(size_t i) const
std::auto_ptr< te::da::DataSet > getData(te::common::TraverseType travType=te::common::FORWARDONLY, const te::common::AccessPolicy accessPolicy=te::common::RAccess) const
It gets the dataset identified by the layer name.
A layer with reference to a raster.
Definition: RasterLayer.h:52
ColorMapWidget(QWidget *parent=0, Qt::WindowFlags f=0)
Constructs a ShadedReliefWidget dialog which is a child of parent, with widget flags set to f...
void updateUi(bool loadColorBar=false)
Updates the widget form based on internal fill element.
static RasterSummaryManager & getInstance()
It returns a reference to the singleton instance.
void setColorMap(te::se::ColorMap *cm)
An abstract class for raster data strucutures.
Definition: Raster.h:71
void onBandSelected(QString value)
virtual te::se::Style * getStyle() const
It returns the Style associated to the layer.
virtual std::size_t getNumberOfBands() const =0
Returns the number of bands (dimension of cells attribute values) in the raster.
boost::ptr_vector< BandSummary > RasterSummary
RasterSummary is just a typedef of a boost::ptr_vector.
Definition: RasterSummary.h:44
te::se::ColorMap * getLayerColorMap(te::map::AbstractLayerPtr layer)
It QWidget implementation of color bar.
Definition: ColorBar.h:67
void setRaster(te::rst::Raster *r)
The RasterSymbolizer describes how to render raster/matrix-coverage data (e.g., satellite photos...
void initialize()
Internal method to initialize the widget (e.g.: color, combos, icons, etc.)
This class can be used to represent literal values.
Definition: Literal.h:56
They are used to define a graph of points.
te::qt::widgets::ColorCatalogWidget * m_colorBar
Widget used to pick a color.
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
Definition: RGBAColor.h:57
te::color::ColorBar * getColorBar()
It returns the colorbar.
Definition: ColorBar.cpp:117
te::rst::Raster * getLayerRaster(te::map::AbstractLayerPtr layer)
void setLayers(te::map::AbstractLayerPtr selectedLayer, std::vector< te::map::AbstractLayerPtr > allLayers)
te::se::ColorMap * getColorMap()
It models the concept of color bar.
Definition: ColorBar.h:49
std::auto_ptr< Ui::ColorMapWidgetForm > m_ui
Dialog form.
te::se::ColorMap * getColorMap() const
A layer with reference to a dataset.
Definition: DataSetLayer.h:47
TEDATAACCESSEXPORT std::size_t GetFirstPropertyPos(const te::da::DataSet *dataset, int datatype)
Definition: Utils.cpp:432
Calculate the min value.
Definition: Enums.h:40
Calculate the max value.
Definition: Enums.h:41
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
TESEEXPORT std::string GetString(const te::se::ParameterValue *param)
It gets the parameter value as a string.
Definition: Utils.cpp:453
A ColorMap defines either the colors of a pallette-type raster source or the mapping of numeric pixel...
Definition: ColorMap.h:60
const std::vector< ParameterValue * > & getThresholdValues() const
Definition: Categorize.cpp:114