TimeViewerDockWidget.cpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
3 
4  This file is part of the TerraLib - a Framework for building GIS enabled
5  applications.
6 
7  TerraLib is free software: you can redistribute it and/or modify
8  it under the terms of the GNU Lesser General Public License as published by
9  the Free Software Foundation, either version 3 of the License,
10  or (at your option) any later version.
11 
12  TerraLib is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU Lesser General Public License for more details.
16 
17  You should have received a copy of the GNU Lesser General Public License
18  along with TerraLib. See COPYING. If not, write to
19  TerraLib Team at <terralib-team@terralib.org>.
20 */
21 
22 /*!
23  \file terralib/qt/plugins/timeviewee/plugin.cpp
24 
25  \brief Add a plugin interface for dynamic loading of TimeViewer plugin.
26 
27  \author Matheus Cavassan Zaglia
28  \author Carolina Galvão dos Santos
29  \author Fabiana Zioti
30  */
31 
32 // Terralib
33 #include "TimeViewerDockWidget.h"
34 #include "../../..//dataaccess/query/EqualTo.h"
35 #include "../../../Exception.h"
36 #include "../../../color/ColorBar.h"
37 #include "../../../color/ColorScheme.h"
38 #include "../../../color/ColorSchemeCatalog.h"
39 #include "../../../color/ColorSchemeCatalogManager.h"
40 #include "../../../color/ColorSchemeGroup.h"
41 #include "../../../color/RGBAColor.h"
42 #include "../../../common/Globals.h"
43 #include "../../../common/STLUtils.h"
44 #include "../../../dataaccess/datasource/DataSourceManager.h"
45 #include "../../../dataaccess/query/And.h"
46 #include "../../../dataaccess/query/DataSetName.h"
47 #include "../../../dataaccess/query/Field.h"
48 #include "../../../dataaccess/query/From.h"
49 #include "../../../dataaccess/query/FromItem.h"
50 #include "../../../dataaccess/query/GreaterThanOrEqualTo.h"
51 #include "../../../dataaccess/query/LessThanOrEqualTo.h"
52 #include "../../../dataaccess/query/LiteralString.h"
53 #include "../../../dataaccess/query/OrderBy.h"
54 #include "../../../dataaccess/query/OrderByItem.h"
55 #include "../../../dataaccess/query/PropertyName.h"
56 #include "../../../dataaccess/query/SQLVisitor.h"
57 #include "../../../dataaccess/query/Select.h"
58 #include "../../../dataaccess/query/Where.h"
59 #include "../../../dataaccess/utils/Utils.h"
60 #include "../../../fe.h"
61 #include "../../../geometry/GeometryProperty.h"
62 #include "../../../maptools/AbstractLayer.h"
63 #include "../../../maptools/Grouping.h"
64 #include "../../../maptools/GroupingAlgorithms.h"
65 #include "../../../maptools/MapDisplay.h"
66 #include "../../../maptools/Utils.h"
67 #include "../../../se/ColorMap.h"
68 #include "../../../se/PolygonSymbolizer.h"
69 #include "../../../se/Rule.h"
70 #include "../../../se/Style.h"
71 #include "../../../se/Utils.h"
72 #include "../../af/ApplicationController.h"
73 #include "../../af/BaseApplication.h"
74 #include "../../af/connectors/MapDisplay.h"
75 #include "../../af/events/LayerEvents.h"
76 #include "../../af/events/MapEvents.h"
77 #include "../../widgets/Utils.h"
78 #include "../../widgets/canvas/Canvas.h"
79 #include "../../widgets/canvas/MapDisplay.h"
80 #include "../../widgets/layer/explorer/LayerItemView.h"
81 #include "../../widgets/se/GroupingDialog.h"
83 #include "ui_TimeViewerWidget.h"
84 
85 // Boost
86 #include <boost/algorithm/string.hpp>
87 #include <boost/algorithm/string/join.hpp>
88 #include <boost/uuid/random_generator.hpp>
89 #include <boost/uuid/uuid_io.hpp>
90 
91 // QT
92 #include <QtConcurrent/qtconcurrentrun.h>
93 #include <QDateTime>
94 #include <QIcon>
95 #include <QList>
96 #include <QMenu>
97 #include <QMessageBox>
98 #include <QSize>
99 #include <QVBoxLayout>
100 
101 // STL
102 #include <algorithm>
103 #include <iostream>
104 
106  : QDockWidget(parent),
107  m_ui(new Ui::TimeViewerWidget),
108  m_accumulate(false),
109  m_sliderThr(false),
110  m_drawingLoop(nullptr),
111  m_dsPtr(nullptr),
112  m_layer(nullptr)
113 
114 {
116 
117  m_mainWidget = new QWidget(this);
118  m_mainWidget->setMinimumSize(0, 0);
119 
120  m_ui->setupUi(m_mainWidget);
121  m_app = qobject_cast<te::qt::af::BaseApplication*>(
123 
126 
127  setWindowTitle("Time Viewer");
128  setWindowIcon(QIcon::fromTheme("time-viewer"));
129 
130  // add button icons
131  m_ui->m_stopToolButton->setIcon(QIcon::fromTheme("media-playback-stop"));
132  m_ui->m_backToolButton->setIcon(QIcon::fromTheme("media-skip-backward"));
133  m_ui->m_passToolButton->setIcon(QIcon::fromTheme("media-skip-forward"));
134  m_ui->m_pauseToolButton->setIcon(QIcon::fromTheme("media-playback-pause"));
135  m_ui->m_playToolButton->setIcon(QIcon::fromTheme("media-playback-start"));
136 
137  // slider buttons
138  connect(m_ui->m_stopToolButton, SIGNAL(clicked()), this,SLOT(onStopButtonClicked()));
139  connect(m_ui->m_backToolButton, SIGNAL(clicked()), this,SLOT(onBackButtonClicked()));
140  connect(m_ui->m_passToolButton, SIGNAL(clicked()), this,SLOT(onPassButtonClicked()));
141  connect(m_ui->m_playToolButton, SIGNAL(clicked()), this,SLOT(onPlayButtonClicked()));
142  connect(m_ui->m_pauseToolButton, SIGNAL(clicked()), this,SLOT(onPauseButtonClicked()));
143 
144  setupLayerCombo();
145  setupSlider();
146 
147  // accumulate
148  m_ui->m_accumPushButton->setEnabled(false);
149  connect(m_ui->m_accumulate, SIGNAL(toggled(bool)), this,SLOT(onAccumulateSelect()));
150 
151  // legend
152  connect(m_ui->m_applyButton, SIGNAL(clicked()), this, SLOT(onApplyButtonClicked()));
153  connect(m_ui->m_legendPushButton, SIGNAL(clicked()), this,SLOT(onLegendButtoClicked()));
154  connect(m_ui->m_accumPushButton, SIGNAL(clicked()), this,SLOT(onAccumulateButtonClicked()));
155 
156  // dialog
157  connect(m_editLegendDialog.get(), SIGNAL(okPushButtonClicked()), this,SLOT(onEditLegendApplyClicked()));
158  connect(m_editAccumulateDialog.get(), SIGNAL(okAccPushButtonClicked()), this, SLOT(onAccumulateOkClicked()));
159 
160  this->setWidget(m_mainWidget);
161 
162  m_app->addDockWidget(Qt::BottomDockWidgetArea, this);
163 }
164 
166 {
167  m_ui->m_timeSlider->setMinimum(0);
168  m_ui->m_timeSlider->setSingleStep(1);
169  m_ui->m_timeSlider->setTracking(false);
170 
171  connect(m_ui->m_timeSlider, SIGNAL(valueChanged(int)), this,SLOT(onSliderChanged()));
172 }
173 
175 {
176  auto layerList = m_app->getLayerExplorer()->getAllLayers();
177  auto it = std::find_if(layerList.begin(), layerList.end(),
178  [this](te::map::AbstractLayerPtr layer) {
179  return m_layer->getTitle() == layer->getTitle();
180  });
181 
182  if(it != layerList.end())
183  {
184  layerList.remove(*it);
185  m_app->getLayerExplorer()->setLayers(layerList);
186  auto mapDisplay = m_app->getMapDisplay();
187  mapDisplay->setLayerList(m_app->getLayerExplorer()->getAllLayers());
188  }
189 
190  te::qt::af::AppCtrlSingleton::getInstance().removeListener(this);
191  delete m_ui;
192 }
193 
195 {
197 
198  emit triggered(&e);
199 
200  m_ui->m_layerCBox->addItem("");
201  for(auto layer : e.m_layers)
202  {
203  m_ui->m_layerCBox->addItem(layer->getDataSetName().c_str(),layer->getDataSourceId().c_str());
204  }
205 
206  connect(m_ui->m_layerCBox, SIGNAL(activated(int)), this,SLOT(onLayerCBoxSelected(int)));
207 }
208 
210 {
211  m_datasetName = m_ui->m_layerCBox->itemText(index).toUtf8().data();
212  m_dsId = m_ui->m_layerCBox->itemData(index).toString().toUtf8().data();
213 
214  if(m_datasetName.empty())
215  return;
216 
217  m_ui->m_startDateCBox->clear();
218  m_ui->m_endDateCBox->clear();
219  m_ui->m_startDateCBox->addItem("");
220  m_ui->m_endDateCBox->addItem("");
221 
222  m_ui->m_accumulate->setChecked(false);
223  m_ui->m_accumPushButton->setEnabled(false);
224 
226 
227  if(m_dsPtr->getType() != "POSTGIS")
228  {
229  QMessageBox::warning(0, "TimeViewer", "Unsupported datasource");
230  return;
231  }
232  auto properties = m_dsPtr->getPropertyNames(m_datasetName);
233  for(auto propertie : properties)
234  {
235  m_ui->m_startDateCBox->addItem(propertie.c_str());
236  m_ui->m_endDateCBox->addItem(propertie.c_str());
237  }
238 }
239 
240 std::string generateId()
241 {
242  static boost::uuids::basic_random_generator<boost::mt19937> gen;
243  boost::uuids::uuid u = gen();
244  return boost::uuids::to_string(u);
245 }
246 
248 {
249  auto dsTypePtr = m_dsPtr->getDataSetType(m_datasetName);
251 
252  if(m_layer == nullptr)
253  m_layer.reset(new te::map::QueryLayer(generateId(), "TimeViewer Layer"));
254 
255  m_layer->setDataSourceId(m_dsId);
256  m_layer->setDataSetName(m_datasetName);
257  m_layer->setRendererType("QUERY_LAYER_RENDERER");
258  m_layer->setSRID(gp->getSRID());
259  m_layer->setGeomPropertytName(gp->getName());
260  m_layer->setVisibility(te::map::VISIBLE);
261 
262  // if m_accumulate is true older geoms must have a different color
263  if(m_layer->getStyle() == nullptr)
264  {
266  m_layer->setStyle(style);
267  }
268 }
269 
271 {
272  m_sliderThr = false;
273  m_ui->m_timeSlider->setEnabled(true);
274 }
275 
277 {
278  m_sliderThr = false;
279  m_ui->m_timeSlider->setValue(m_ui->m_timeSlider->maximum());
280  m_ui->m_timeSlider->setEnabled(true);
281 
282  return;
283 }
284 
286 {
287  int value = m_ui->m_timeSlider->value();
288  if(!(value == m_ui->m_timeSlider->maximum()))
289  {
290  m_ui->m_timeSlider->setValue(++value);
291  }
292 }
293 
295 {
296  int value = m_ui->m_timeSlider->value();
297  if(!(value == 0))
298  {
299  m_ui->m_timeSlider->setValue(--value);
300  }
301 }
302 
304 {
306 }
308 {
309  int min_value;
310  int max_value = m_ui->m_timeSlider->maximum();
311 
312  m_sliderThr = true;
313 
314  if(m_ui->m_timeSlider->value() == max_value)
315  {
316  m_ui->m_timeSlider->setValue(0);
317  }
318 
319  m_ui->m_timeSlider->setEnabled(false);
320 
321  for(min_value = m_ui->m_timeSlider->value(); min_value <= max_value;
322  min_value++)
323  {
324  while(m_drawing == true)
325  {
326  QThread::currentThread()->msleep(250);
327  }
328  if(m_sliderThr == true && m_drawing == false)
329  {
330  QThread::currentThread()->msleep(2000);
331  m_ui->m_timeSlider->setValue(min_value);
332  }
333  }
334 
335  m_ui->m_timeSlider->setEnabled(true);
336 
337  m_sliderThr = false;
338 }
339 
341 {
342  // create layer with all attr
343  std::string query = "SELECT * FROM " + m_datasetName;
344  auto result = m_dsPtr->query(query);
345 
346  setupLayer();
347 
348  std::string alias = "timeviewer";
349 
350  te::da::FromItem* fromItem = new te::da::DataSetName(m_datasetName, alias);
351  te::da::From* from = new te::da::From;
352  from->push_back(fromItem);
353 
354  te::da::Fields* fields = new te::da::Fields;
355 
356  auto properties = m_dsPtr->getPropertyNames(m_datasetName);
357  for(auto propertie : properties)
358  {
359  fields->push_back(new te::da::Field(alias + "." + propertie));
360  }
361 
362  auto dsTypePtr = m_dsPtr->getDataSetType(m_datasetName);
363 
365 
366  fields->push_back(new te::da::Field(alias + "." + gp->getName()));
367 
368  te::da::Select* select = new te::da::Select();
369  select->setFrom(from);
370  select->setFields(fields);
371 
372  std::string sql;
373  te::da::SQLVisitor visitor(*m_dsPtr->getDialect(), sql);
374  visitor.visit(select);
375 
376  m_layer->setQuery(select);
377  m_layer->computeExtent();
378 }
379 
381 {
382  m_editAccumulateDialog->show();
384 }
385 
387 {
388  if(m_datasetName.empty())
389  {
390  QMessageBox::warning(
391  0, "TimeViewer",
392  "There is no layer selected. \nPlease select one before edit legend");
393  return;
394  }
395 
396  // create layer with all attr
397  setupLayerInt();
398 
399  m_editLegendDialog->show();
400  m_editLegendDialog->setLayers(m_layer);
401 }
402 
404 {
405  if(m_datasetName.empty())
406  {
407  QMessageBox::warning(
408  0, "TimeViewer",
409  "There is no layer selected. \nPlease select one before applying");
410  return;
411  }
412 
413  m_start = m_ui->m_startDateCBox->currentText().toUtf8().data();
414  m_end = m_ui->m_endDateCBox->currentText().toUtf8().data();
415 
416  if(m_start.empty())
417  {
418  QMessageBox::warning(0, "TimeViewer",
419  "There is no start date attribute selected. \nPlease "
420  "select one before applying");
421  return;
422  }
423 
424  std::string query = "SELECT " + m_start +
425  " as date"
426  " FROM " +
427  m_datasetName + " GROUP BY " + m_start;
428 
429  if(!m_end.empty())
430  {
431  query +=
432  " UNION"
433  " SELECT " +
434  m_end +
435  " as date"
436  " FROM " +
437  m_datasetName + " GROUP BY " + m_end;
438  }
439 
440  query += " ORDER BY date";
441 
442  auto result = m_dsPtr->query(query);
443 
444  result->moveBeforeFirst();
445 
446  while(result->moveNext())
447  {
448  m_dates.push_back(result->getAsString("date"));
449  }
450 
451  m_ui->m_timeSlider->setMaximum(m_dates.size() - 1);
452 
453  setupLayerInt();
454 
455  auto layerList = m_app->getLayerExplorer()->getAllLayers();
456  auto it = std::find_if(layerList.begin(), layerList.end(),
457  [this](te::map::AbstractLayerPtr layer) {
458  return m_layer->getTitle() == layer->getTitle();
459  });
460 
461  if(it == layerList.end())
462  {
463  layerList.push_front(m_layer);
464  m_app->getLayerExplorer()->setLayers(layerList);
465  auto mapDisplay = m_app->getMapDisplay();
466  mapDisplay->setLayerList(m_app->getLayerExplorer()->getAllLayers());
467  }
468 
469  m_ui->m_timeSlider->blockSignals(true);
470  m_ui->m_timeSlider->setValue(0);
471  m_ui->m_timeSlider->blockSignals(false);
472 
473  onSliderChanged();
474 }
475 
477 {
478  int index = m_ui->m_timeSlider->value();
479 
480  std::string date = m_dates[index];
481 
482  te::da::LiteralString* literal = new te::da::LiteralString(date);
483 
484  std::string alias = "timeviewer";
485 
486  te::da::FromItem* fromItem = new te::da::DataSetName(m_datasetName, alias);
487  te::da::From* from = new te::da::From;
488  from->push_back(fromItem);
489 
490  te::da::Fields* fields = new te::da::Fields;
491 
492  auto properties = m_dsPtr->getPropertyNames(m_datasetName);
493  for(auto propertie : properties)
494  {
495  fields->push_back(new te::da::Field(alias + "." + propertie));
496  }
497 
498  auto dsTypePtr = m_dsPtr->getDataSetType(m_datasetName);
499 
501 
502  fields->push_back(new te::da::Field(alias + "." + gp->getName()));
503 
504  te::da::Where* where = nullptr;
507  te::da::Expression* expression = nullptr;
508  te::da::Expression* expression2 = nullptr;
509  te::da::And* aand = nullptr;
510 
511  // form Query
512  if(m_ui->m_accumulate->isChecked())
513  {
514  if(m_end.empty())
515  expression = new te::da::LessThanOrEqualTo(start, literal);
516 
517  else
518  expression = new te::da::LessThanOrEqualTo(end, literal);
519 
520  where = new te::da::Where(expression);
521  }
522 
523  else
524  {
525  if(m_end.empty())
526  {
527  expression = new te::da::EqualTo(start, literal);
528 
529  where = new te::da::Where(expression);
530  }
531  else
532  {
533  expression = new te::da::GreaterThanOrEqualTo(start, literal);
534  te::da::LiteralString* literal2 = new te::da::LiteralString(date);
535  expression2 = new te::da::LessThanOrEqualTo(end, literal2);
536  aand = new te::da::And(expression, expression2);
537 
538  where = new te::da::Where(aand);
539  }
540  }
541 
542  te::da::Select* select = new te::da::Select();
543  select->setWhere(where);
544  select->setFrom(from);
545  select->setFields(fields);
546 
547  std::string sql;
548  te::da::SQLVisitor visitor(*m_dsPtr->getDialect(), sql);
549  visitor.visit(select);
550 
551  m_layer->setQuery(select);
552  m_layer->computeExtent();
553 
554  // Use Legend
555  if(m_ui->m_accumulate->isChecked())
556  {
557  te::se::Style* sty = m_layer->getStyle()->clone();
558 
559  sty->removeRules();
560 
561  std::string dateAttr = m_ui->m_startDateCBox->currentText().toUtf8().data();
562 
563  te::fe::PropertyName* propName = new te::fe::PropertyName(dateAttr);
564  te::fe::Literal* propValue = new te::fe::Literal(date);
565 
567 
568  te::fe::Filter* filter = new te::fe::Filter;
569  filter->setOp(less);
570 
571  te::se::Rule* general = new te::se::Rule;
572  general->setFilter(filter);
573 
574  std::vector<te::se::Symbolizer*> symbVec;
576  s = te::se::CreateSymbolizer(gp->getGeometryType(),m_accumColor.toUtf8().data());
577 
578  symbVec.push_back(s);
579  general->setSymbolizers(symbVec);
580 
581  sty->push_back(general);
582 
583  if(m_rules.empty())
584  {
585  te::se::Rule* ruleActual = new te::se::Rule;
586  ruleActual->setFilter(te::fe::CreateFilterByUniqueValue(dateAttr, date));
587 
588  std::vector<te::se::Symbolizer*> symbVecAct;
589  te::se::Symbolizer* symbAct;
590  symbAct = te::se::CreateSymbolizer(gp->getGeometryType(), "#3c9c3d");
591 
592  symbVecAct.push_back(symbAct);
593  ruleActual->setSymbolizers(symbVecAct);
594 
595  sty->push_back(ruleActual);
596  }
597 
598  else
599  {
600  for(std::size_t t = 0; t < m_rules.size(); ++t)
601  {
602  te::se::Rule* r = new te::se::Rule;
603  r = m_rules[t]->clone();
604 
605  const te::fe::Filter* currentFilter = m_rules[t]->getFilter();
606  te::fe::AbstractOp* currentOp = currentFilter->getOp()->clone();
607 
608  te::fe::PropertyName* currentPropName = new te::fe::PropertyName(dateAttr);
609  te::fe::Literal* currentPropValue = new te::fe::Literal(date);
612 
613  te::fe::Filter* filterB = new te::fe::Filter;
614  filterB->setOp(andOp);
615  r->setFilter(filterB);
616 
617  sty->push_back(r);
618  }
619  }
620 
621  m_layer->setStyle(sty);
622  }
623 
624  else if(!m_rules.empty() && m_ui->m_timeSlider->value() == 0)
625  {
626  te::se::Style* style_t = m_layer->getStyle();
627  te::se::Style* style = style_t->clone();
628 
629  style->removeRules();
630 
631  for(std::size_t t = 0; t < m_rules.size(); ++t)
632  {
633  te::se::Rule* rule = m_rules[t]->clone();
634  style->push_back(rule);
635  }
636 
637  m_layer->setStyle(style);
638  }
639 
640  drawLayer();
641 }
642 
644 {
645  auto mapDisplay = m_app->getMapDisplay();
646  if(mapDisplay->getSRID() == 0)
647  {
648  mapDisplay->setSRID(m_layer->getSRID());
649  std::pair<int, std::string> srid(mapDisplay->getSRID(), "EPSG");
651  emit triggered(&evt);
652  }
653 
654  auto extent = m_layer->getExtent();
655 
656  m_drawing = true;
657  mapDisplay->setExtent(extent, true);
658 }
659 
661 {
662  m_rules = m_editLegendDialog->getRules();
663 }
664 
666 {
667  m_accumColor = m_editAccumulateDialog->getAccumColor();
668 }
670 {
671  m_ui->m_accumPushButton->setEnabled(true);
672 }
673 
676 {
677  switch(e->m_id)
678  {
680  {
681  m_drawing = false;
682  break;
683  }
684  default:
685  break;
686  }
687 }
static const char * sm_propertyIsLessThan
Geometric property.
An abstract class that models a source of data in a query.
Definition: FromItem.h:50
The Field class can be used to model an expression that takes part of the output items of a SELECT...
It models the inequality operator less than or equal to (<=).
The Style defines the styling that is to be applied to a geographic dataset (vector geometries or cov...
Definition: Style.h:65
A class that models the name of a dataset used in a From clause.
Definition: DataSetName.h:43
TESEEXPORT Symbolizer * CreateSymbolizer(const te::gm::GeomType &geomType)
Try creates an appropriate symbolizer based on given geometry type.
virtual Style * clone() const =0
It creates a new copy of this object.
void Filter()
A class that models the name of any property of an object.
A Symbolizer describes how a feature is to appear on a map.
Definition: Symbolizer.h:80
A base class for application events.
This event signals that the srid of the map display changed.
Definition: MapEvents.h:54
It models the inequality operator greater than or equal to (>=).
AbstractOp * getOp() const
It returns main filter operation.
void push_back(const std::string &semanticTypeIdentifier)
Definition: Style.cpp:75
std::unique_ptr< te::qt::plugins::tv::TimeViewerEditLegendDialog > m_editLegendDialog
A layer resulting from a query.
Definition: QueryLayer.h:50
void setFilter(te::fe::Filter *f)
Definition: Rule.cpp:91
static const char * sm_propertyIsEqualTo
Boolean logic operator: AND.
This is an abstract class that models a query expression.
TESEEXPORT Style * CreateFeatureTypeStyle(const te::gm::GeomType &geomType)
Try creates an appropriate feature type style based on given geometry type.
virtual void setLayerList(const std::list< te::map::AbstractLayerPtr > &layers)
It sets the layer list to be showed in the Map Display.
void setWhere(Where *w)
It sets the filter codition.
Definition: Select.cpp:799
TEFEEXPORT te::fe::Filter * CreateFilterByUniqueValue(const std::string &attrName, const std::string &value)
void setOp(AbstractOp *o)
It sets the filter main operation (expression).
int getSRID() const
It returns the spatial reference system identifier associated to this property.
static ApplicationController & getInstance()
It returns a reference to the singleton instance.
virtual void visit(const Expression &visited)
This class is used to encode the name of any property of an object.
GeomType getGeometryType() const
It returns the geometry subtype allowed for the property.
boost::ptr_vector< Field > Fields
Fields is just a boost::ptr_vector of Field pointers.
Definition: Fields.h:37
void removeRules()
Definition: Style.cpp:120
te::qt::widgets::LayerItemView * getLayerExplorer()
A class that can be used to model a filter expression that can be applied to a query.
Definition: Where.h:47
void onApplicationTriggered(te::qt::af::evt::Event *e)
A filter is any valid predicate expression.
Definition: fe/Filter.h:55
A dialog used to edit legend.
void setSymbolizers(const std::vector< Symbolizer * > &symbs)
Definition: Rule.cpp:152
A Select models a query to be used when retrieving data from a DataSource.
Definition: Select.h:65
void setLayers(const std::list< te::map::AbstractLayerPtr > &layers)
Sets the list of layers. Old layers in the tree are then removed.
boost::ptr_vector< FromItem > From
It models the FROM clause for a query.
Definition: From.h:37
An abstract interface for operators.
Definition: AbstractOp.h:47
A class for binary comparison operators.
static const char * sm_and
std::list< te::map::AbstractLayerPtr > m_layers
Definition: LayerEvents.h:345
This class can be used to represent literal values.
Definition: fe/Literal.h:56
A Rule is used to attach property/scale conditions to and group the individual symbols used for rende...
Definition: Rule.h:76
te::qt::widgets::MapDisplay * getMapDisplay()
It models the comparison operator.
Definition: EqualTo.h:46
std::list< te::map::AbstractLayerPtr > getAllLayers() const
Returs all layers in the tree including folders.
A visitor for building an SQL statement from a given Query hierarchy.
A logical operator can be used to combine two or more conditional expressions.
Definition: BinaryLogicOp.h:58
TEDATAACCESSEXPORT te::gm::GeometryProperty * GetFirstGeomProperty(const DataSetType *dt)
std::string generateId()
std::unique_ptr< te::qt::plugins::tv::TimeViewerEditAccumulateDialog > m_editAccumulateDialog
virtual void setSRID(const int &srid, bool doRefresh=true)
It sets a new Spatial Reference System to be used by the Map Display.
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
void setFields(Fields *f)
It sets the list of output expressions used to form the result set.
Definition: Select.cpp:779
void triggered(te::qt::af::evt::Event *e)
virtual AbstractOp * clone() const =0
It creates a new copy of this object.
void setFrom(From *f)
It sets the list of source information.
Definition: Select.cpp:789
This class models a string Literal value.
Definition: LiteralString.h:46
const std::string & getName() const
It returns the property name.
Definition: Property.h:127