13 #include "../charts/HistogramDataWidget.h" 14 #include "../charts/Utils.h" 15 #include "../utils/ScopedCursor.h" 16 #include "../Config.h" 17 #include "../Exception.h" 18 #include "../../../common/Exception.h" 20 #include "../../../core/logger/Logger.h" 21 #include "../../../dataaccess/dataset/DataSet.h" 22 #include "../../../dataaccess/dataset/DataSetCapabilities.h" 23 #include "../../../dataaccess/dataset/ObjectId.h" 24 #include "../../../dataaccess/dataset/ObjectIdSet.h" 25 #include "../../../dataaccess/dataset/DataSetTypeCapabilities.h" 26 #include "../../../dataaccess/datasource/DataSourceCapabilities.h" 27 #include "../../../dataaccess/datasource/DataSourceManager.h" 28 #include "../../../dataaccess/datasource/DataSourceTransactor.h" 29 #include "../../../dataaccess/query/DataSetName.h" 30 #include "../../../dataaccess/query/Field.h" 31 #include "../../../dataaccess/query/From.h" 32 #include "../../../dataaccess/query/In.h" 33 #include "../../../dataaccess/query/Literal.h" 34 #include "../../../dataaccess/query/Or.h" 35 #include "../../../dataaccess/query/OrderBy.h" 36 #include "../../../dataaccess/query/OrderByItem.h" 37 #include "../../../dataaccess/query/Select.h" 38 #include "../../../dataaccess/utils/Utils.h" 39 #include "../../../geometry/Geometry.h" 40 #include "../../../maptools/DataSetLayer.h" 41 #include "../../../maptools/DataSetAdapterLayer.h" 42 #include "../../../maptools/QueryLayer.h" 43 #include "../../../statistics/qt/StatisticsDialog.h" 44 #include "../../../st/maptools/ObservationDataSetLayer.h" 45 #include "../../../st/maptools/TimeSeriesDataSetLayer.h" 46 #include "../../../st/maptools/TrajectoryDataSetLayer.h" 51 #include <QContextMenuEvent> 53 #include <QDialogButtonBox> 54 #include <QHeaderView> 57 #include <QMessageBox> 80 for(
size_t i=0; i<nProps; i++)
82 cols.push_back(static_cast<int>(i));
93 for (
int i=0; i<static_cast<int>(sz); i++)
94 if(hView->isSectionHidden(i) && !
IsGeometryColumn(dset, static_cast<size_t>(i)))
104 std::vector<int>::iterator it;
106 QMenu* mnu =
new QMenu(hMnu);
107 mnu->setTitle(QObject::tr(
"Show hidden column"));
110 mnu->setEnabled(
false);
112 for(it=hSecs.begin(); it!=hSecs.end(); ++it)
114 QString cName = hView->model()->headerData(*it, Qt::Horizontal, Qt::DisplayRole).toString();
115 QAction* act =
new QAction(mnu);
118 act->setData(QVariant(*it));
120 QString tt = QObject::tr(
"Turns column \"%1\" visible.").arg(cName);
132 QAction* act =
new QAction(hMnu);
133 act->setText(QObject::tr(
"Show all columns"));
144 if(layer->
getType() ==
"DATASETLAYER")
151 else if(layer->
getType() ==
"DATASETADAPTERLAYER")
158 else if(layer->
getType() ==
"QUERYLAYER")
165 else if(layer->
getType() ==
"OBSERVATIONDATASETLAYER")
172 else if(layer->
getType() ==
"TIMESERIESDATASETLAYER")
179 else if(layer->
getType() ==
"TRAJECTORYDATASETLAYER")
194 if(ds.get() !=
nullptr)
205 std::unique_ptr<te::da::Select>
GetSelectExpression(
const std::string& datasetName,
const std::vector<std::string>& colsNames,
const bool& asc)
217 for(
size_t i=0; i<colsNames.size(); i++)
220 if (!order_by.empty())
221 return std::unique_ptr<te::da::Select>(
new te::da::Select(fields, from, order_by));
223 return std::unique_ptr<te::da::Select>(
new te::da::Select(fields, from));
228 std::vector<std::string> colsNames;
230 for(
size_t i = 0; i < cols.size(); ++i)
231 colsNames.push_back(
set->getPropertyName((
size_t)cols[i]));
242 if(query.get() ==
nullptr)
243 throw std::string(
"Fail to generate query.");
247 if(dsc.get() ==
nullptr)
248 throw std::string(
"Fail to get data source.");
256 return std::unique_ptr<te::da::DataSet>();
262 std::unique_ptr<te::da::Select> query;
264 if(layer->
getType() ==
"DATASETLAYER")
271 else if(layer->
getType() ==
"DATASETADAPTERLAYER")
278 else if(layer->
getType() ==
"QUERYLAYER")
287 for (
size_t i = 0; i<colsNames.size(); i++)
290 query->setOrderBy(order_by);
293 else if(layer->
getType() ==
"OBSERVATIONDATASETLAYER")
300 else if(layer->
getType() ==
"TIMESERIESDATASETLAYER")
307 else if(layer->
getType() ==
"TRAJECTORYDATASETLAYER")
317 if(query.get() ==
nullptr)
318 throw std::string(
"Fail to generate query.");
324 return std::unique_ptr<te::da::Select>();
330 std::vector<QString> res;
336 for(
size_t i=0; i<n; i++)
347 std::vector<int> geoCols;
357 size_t pos = (size_t)geoCols[0];
360 return std::unique_ptr<te::gm::Envelope>();
362 std::unique_ptr<te::gm::Geometry> g = dset->
getGeometry(pos);
364 return std::unique_ptr<te::gm::Envelope> (
new te::gm::Envelope(*g->getMBR()));
367 return std::unique_ptr<te::gm::Envelope>();
383 std::vector<size_t>::iterator it;
385 for(it = cols.begin(); it != cols.end(); ++it)
386 if((
size_t)col == *it)
396 std::vector<int> geoCols;
397 std::vector<int>::iterator it;
400 for(it = geoCols.begin(); it != geoCols.end(); ++it)
411 for(std::size_t i = 0; i < nProps; ++i)
444 m_view->horizontalHeader()->installEventFilter(
this);
445 m_view->verticalHeader()->installEventFilter(
this);
446 m_view->viewport()->installEventFilter(
this);
455 m_view->connect(
this, SIGNAL(
sortData(
const bool&,
const int&)), SLOT(sortByColumns(
const bool&,
const int&)));
476 return QObject::eventFilter(watched, event);
482 switch(event->type())
484 case QEvent::ContextMenu:
491 QContextMenuEvent* evt =
static_cast<QContextMenuEvent*
>(event);
492 QPoint pos = evt->globalPos();
494 m_columnPressed = hHdr->logicalIndex(hHdr->visualIndexAt(evt->pos().x()));
501 QAction* act =
new QAction(
m_hMenu);
502 act->setText(tr(
"Hide column"));
503 act->setToolTip(tr(
"Hides the selected column."));
510 act->setEnabled(
false);
512 m_hMenu->addAction(hMnu->menuAction());
517 QAction* act3 =
new QAction(
m_hMenu);
518 act3->setText(tr(
"Reset columns order"));
519 act3->setToolTip(tr(
"Put all columns in the original order."));
524 QAction* act5 =
new QAction(
m_hMenu);
525 act5->setText(tr(
"Sort data ASC"));
526 act5->setToolTip(tr(
"Sort data in ascendent order using selected columns."));
529 QAction* act9 =
new QAction(
m_hMenu);
530 act9->setText(tr(
"Sort data DESC"));
531 act9->setToolTip(tr(
"Sort data in descendent order using selected columns."));
536 QAction* act4 =
new QAction(
m_hMenu);
537 act4->setText(tr(
"Histogram"));
538 act4->setToolTip(tr(
"Creates a new histogram based on the data of the selected colunm."));
541 QAction* act10 =
new QAction(
m_hMenu);
542 act10->setText(tr(
"Normal Probability"));
543 act10->setToolTip(tr(
"Show a chart that displays the normal probability curve."));
546 QAction* act6 =
new QAction(
m_hMenu);
547 act6->setText(tr(
"Statistics"));
548 act6->setToolTip(tr(
"Show the statistics summary of the selected colunm."));
554 connect(act, SIGNAL(triggered()), SLOT(
hideColumn()));
555 connect(hMnu, SIGNAL(triggered(QAction*)), SLOT(
showColumn(QAction*)));
559 m_view->connect(act2, SIGNAL(triggered()), SLOT(showAllColumns()));
560 m_view->connect(act3, SIGNAL(triggered()), SLOT(resetColumnsOrder()));
564 connect(act5, SIGNAL(triggered()), SLOT(
sortDataAsc()));
565 connect(act9, SIGNAL(triggered()), SLOT(
sortDataDesc()));
570 QAction* act7 =
new QAction(
m_hMenu);
571 act7->setText(tr(
"Add column"));
572 act7->setToolTip(tr(
"Adds a column to the table."));
575 act7->setEnabled(
true);
579 act7->setEnabled(
false);
583 QAction* act8 =
new QAction(
m_hMenu);
584 act8->setText(tr(
"Remove column"));
585 act8->setToolTip(tr(
"Removes a column from the table."));
588 act8->setEnabled(
true);
592 act8->setEnabled(
false);
596 QAction* act10 =
new QAction(
m_hMenu);
597 act10->setText(tr(
"Rename column"));
598 act10->setToolTip(tr(
"Renames a column of the table."));
602 QAction* act11 =
new QAction(
m_hMenu);
603 act11->setText(tr(
"Change column type"));
604 act11->setToolTip(tr(
"Changes the type of a column of the table."));
607 act11->setEnabled(
true);
611 act11->setEnabled(
false);
615 QAction* act12 =
new QAction(
m_hMenu);
616 act12->setText(tr(
"Change column data"));
617 act12->setToolTip(tr(
"Changes the data of a column of the table."));
620 act12->setEnabled(
true);
624 act12->setEnabled(
false);
628 QAction* act13 =
new QAction(
m_hMenu);
629 act13->setText(tr(
"Save editions"));
630 act13->setToolTip(tr(
"Save pendent editions to layer."));
633 act13->setEnabled(
true);
637 act13->setEnabled(
false);
641 m_view->connect(act7, SIGNAL(triggered()), SLOT(addColumn()));
643 connect(act8, SIGNAL(triggered()), SLOT(
removeColumn()));
644 connect (act10, SIGNAL(triggered()), SLOT(
renameColumn()));
645 connect (act11, SIGNAL(triggered()), SLOT(
retypeColumn()));
647 connect (act13, SIGNAL(triggered()), SIGNAL(
saveEditions()));
656 QAction* act =
new QAction(
m_hMenu);
657 act->setText(tr(
"Hide column"));
658 act->setToolTip(tr(
"Hides the selected column."));
665 act->setEnabled(
false);
667 m_hMenu->addAction(hMnu->menuAction());
672 QAction* act3 =
new QAction(
m_hMenu);
673 act3->setText(tr(
"Reset columns order"));
674 act3->setToolTip(tr(
"Put all columns in the original order."));
679 QAction* act5 =
new QAction(
m_hMenu);
680 act5->setText(tr(
"Sort data ASC"));
681 act5->setToolTip(tr(
"Sort data in ascendent order using selected columns."));
684 QAction* act9 =
new QAction(
m_hMenu);
685 act9->setText(tr(
"Sort data DESC"));
686 act9->setToolTip(tr(
"Sort data in descendent order using selected columns."));
691 QAction* act4 =
new QAction(
m_hMenu);
692 act4->setText(tr(
"Histogram"));
693 act4->setToolTip(tr(
"Creates a new histogram based on the data of the selected colunm."));
696 QAction* act10 =
new QAction(
m_hMenu);
697 act10->setText(tr(
"Normal Probability"));
698 act10->setToolTip(tr(
"Show a chart that displays the normal probability curve."));
701 QAction* act6 =
new QAction(
m_hMenu);
702 act6->setText(tr(
"Statistics"));
703 act6->setToolTip(tr(
"Show the statistics summary of the selected colunm."));
709 connect(act, SIGNAL(triggered()), SLOT(
hideColumn()));
710 connect(hMnu, SIGNAL(triggered(QAction*)), SLOT(
showColumn(QAction*)));
714 m_view->connect(act2, SIGNAL(triggered()), SLOT(showAllColumns()));
715 m_view->connect(act3, SIGNAL(triggered()), SLOT(resetColumnsOrder()));
719 connect(act5, SIGNAL(triggered()), SLOT(
sortDataAsc()));
720 connect(act9, SIGNAL(triggered()), SLOT(
sortDataDesc()));
725 QAction* act7 =
new QAction(
m_hMenu);
726 act7->setText(tr(
"Add column"));
727 act7->setToolTip(tr(
"Adds a column to the table."));
729 act7->setEnabled(
m_caps->supportsAddColumn());
731 m_view->connect(act7, SIGNAL(triggered()), SLOT(addColumn()));
737 else if(watched == vport)
740 else if(watched == vHdr)
744 QContextMenuEvent* evt =
static_cast<QContextMenuEvent*
>(event);
745 QPoint pos = evt->globalPos();
748 QAction* act =
new QAction(
m_vMenu);
749 act->setText(tr(
"Enable auto scroll"));
750 act->setToolTip(tr(
"Goes to the selected row."));
752 act->setCheckable(
true);
760 act->setText(tr(
"Enable promotion"));
761 act->setToolTip(tr(
"Enables promotion of selected rows."));
763 act->setCheckable(
true);
773 act->setText(tr(
"Enable auto pan"));
774 act->setToolTip(tr(
"Pan to the selected row."));
776 act->setCheckable(
true);
794 return QObject::eventFilter(watched, event);
851 int column = act->data().toInt();
867 if(oidSet ==
nullptr || oidSet->
size() == 0)
873 std::unique_ptr<te::da::DataSet> dset = layer->
getData(oidSet);
876 statisticDialog.exec();
880 QMessageBox::information(
m_view, tr(
"Show statistics"), e.
what());
963 void sortData(
const bool&,
const int&);
974 std::unique_ptr<te::da::DataSetTypeCapabilities>
m_caps;
1001 #if QT_VERSION >= 0x050000 1002 horizontalHeader()->setSectionsMovable(
true);
1004 horizontalHeader()->setMovable(
true);
1007 setSelectionMode(QAbstractItemView::MultiSelection);
1008 setSelectionBehavior(QAbstractItemView::SelectColumns);
1020 connect(verticalHeader(), SIGNAL(selectedRow(
const int&,
const bool&)), SLOT(
highlightRow(
const int&,
const bool&)));
1021 connect(verticalHeader(), SIGNAL(selectedRows(
const int&,
const int&)), SLOT(
highlightRows(
const int&,
const int&)));
1030 QMessageBox msgBox(
this);
1031 msgBox.setText(
"There are unsaved changes on table.");
1032 msgBox.setInformativeText(
"Do you want to save your changes?");
1036 int ret = msgBox.exec();
1079 std::vector<te::dt::Property*> psps;
1081 if(sch->getPrimaryKey())
1082 psps = sch->getPrimaryKey()->getProperties();
1084 std::vector<te::dt::Property*>::iterator it;
1086 for(it = psps.begin(); it != psps.end(); ++it)
1094 if(dsc.get() ==
nullptr)
1095 throw std::string(
"Fail to get data source.");
1121 if(dsc.get() !=
nullptr)
1123 bool isOGR = (dsc->getType().compare(
"OGR") == 0);
1124 setSelectionMode(isOGR ? SingleSelection : MultiSelection);
1125 setSelectionBehavior(isOGR ? QAbstractItemView::SelectColumns : QAbstractItemView::SelectItems);
1160 std::unique_ptr<te::da::ObjectIdSet> objs_ptr(objs);
1180 scrollTo(
m_model->index((
int)row, 0));
1186 viewport()->repaint();
1204 dialog->setFixedSize(160, 75);
1211 QGridLayout* layout =
new QGridLayout(dialog);
1212 layout->addWidget(histogramWidget);
1214 QDialogButtonBox* bbox =
new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, dialog);
1215 connect(bbox, SIGNAL(accepted()), dialog, SLOT(accept()));
1216 connect(bbox, SIGNAL(rejected()), dialog, SLOT(reject()));
1218 layout->addWidget(bbox);
1219 layout->setSizeConstraint(QLayout::SetFixedSize);
1221 int res = dialog->exec();
1222 if (res == QDialog::Accepted)
1239 QString msgErr(tr(
"This operation is not available for this type of data"));
1240 QString msgTitle(tr(
"TNormal Probability"));
1241 QMessageBox::warning(
this, msgTitle, msgErr);
1247 horizontalHeader()->hideSection(column);
1252 horizontalHeader()->showSection(column);
1263 if(dlg.exec() == QDialog::Accepted)
1265 std::string oldName = dlg.
getOldName().toUtf8().data();
1266 std::string newName = dlg.
getNewName().toUtf8().data();
1269 if(dsrc.get() ==
nullptr)
1270 throw Exception(tr(
"Fail to get data source.").toUtf8().data());
1272 if(!dsrc->isPropertyNameValid(newName))
1274 QMessageBox::warning(
this, tr(
"TerraView"), tr(
"Invalid column name. Choose another."));
1278 if (dsrc->propertyExists(dsName, newName))
1280 QString msg = tr(
"The column could not be renamed: There already exists a property with this name.");
1282 QMessageBox::warning(
this, tr(
"TerraView"), msg);
1288 dsrc->renameProperty(dsName, oldName, newName);
1292 QMessageBox::information(
this, tr(
"Rename Column"), tr(
"The column could not be renamed: ") + e.
what());
1307 std::string dsetName = schema->
getName();
1308 std::string columnName;
1310 prp = schema->getProperty(column);
1313 throw Exception(tr(
"Fail to get property of the dataset.").toUtf8().data());
1321 if(dlg.exec() == QDialog::Accepted)
1325 if(dsrc.get() ==
nullptr)
1326 throw Exception(tr(
"Fail to get data source.").toUtf8().data());
1330 dsrc->changePropertyDefinition(dsetName, columnName, dlg.
getProperty().release());
1345 std::string dsetName = schema->
getName();
1347 std::string columnName = prop->
getName();
1350 std::map<std::string, int> pkColumnsType;
1353 throw Exception(tr(
"The layer must have a primary key.").toUtf8().data());
1355 std::vector<te::dt::Property*> pkProps = pk->
getProperties();
1357 for (
size_t i = 0; i < pkProps.size(); i++)
1359 pkColumnsType[pkProps[i]->getName()] = pkProps[i]->getType();
1368 if(dlg.exec() == QDialog::Accepted)
1372 if(dsrc.get() ==
nullptr)
1373 throw Exception(tr(
"Fail to get data source.").toUtf8().data());
1375 std::string sql =
"UPDATE " + dsetName +
" SET " + columnName +
" = " + dlg.
getExpression().toUtf8().data();
1393 std::string orFirstInExpStr =
" IN (";
1394 std::string orSecondInExpStr =
" IN (";
1401 for (std::size_t i = 0; i < orFirstInExp->
getNumArgs(); ++i)
1410 inStr =
"'" + inStr +
"'";
1413 orFirstInExpStr += inStr +
")";
1415 orFirstInExpStr += inStr +
",";
1418 for (std::size_t i = 0; i < orSecondInExp->
getNumArgs(); ++i)
1427 inStr =
"'" + inStr +
"'";
1430 orSecondInExpStr += inStr +
")";
1432 orSecondInExpStr += inStr +
",";
1441 std::string inExpStr =
" IN (";
1443 for (std::size_t i = 0; i < inExp->
getNumArgs(); ++i)
1452 inStr =
"'" + inStr +
"'";
1456 inExpStr += inStr +
")";
1460 inExpStr += inStr +
",";
1470 std::replace(sql.begin(), sql.end(),
'\n',
' ');
1480 QMessageBox::information(
this, tr(
"Updating data failure"), e.
what());
1484 QMessageBox::information(
this, tr(
"Updating data failure"), tr(
"Data source operation fail for unknown reason."));
1492 std::vector<int>::iterator it;
1494 for (it=hCols.begin(); it!=hCols.end(); ++it)
1495 horizontalHeader()->showSection(*it);
1502 int nCols = hdr->count();
1504 for(
int i=0; i<
nCols; i++)
1506 int visCol = hdr->visualIndex(i);
1509 hdr->moveSection(visCol, i);
1532 viewport()->repaint();
1545 viewport()->repaint();
1555 if(initRow < finalRow)
1575 viewport()->repaint();
1595 viewport()->repaint();
1609 std::vector<int> selCols;
1614 int nCols = model()->columnCount();
1616 for(
int i=0; i<
nCols; i++)
1618 int logRow = horizontalHeader()->logicalIndex(i);
1619 if(selectionModel()->isColumnSelected(logRow, QModelIndex()))
1622 selCols.push_back(logRow);
1629 selCols.push_back(col);
1635 if(dsc.get() ==
nullptr)
1636 throw std::string(
"Fail to get data source.");
1648 if(dset.get() ==
nullptr)
1649 throw te::common::Exception(tr(
"Sort operation not supported by the source of data.").toUtf8().data());
1653 viewport()->repaint();
1655 setUpdatesEnabled(
false);
1659 setUpdatesEnabled(
true);
1666 QMessageBox::information(
this, tr(
"Sorting columns failure"), tr(
"Could not sort data: ") + e.
what());
1674 horizontalHeader()->viewport()->repaint();
1688 std::string dsName = ds_t->getName();
1689 size_t n_prop = ds_t->getProperties().size();
1692 if(dlg.exec() == QDialog::Accepted)
1696 if(ds.get() ==
nullptr)
1701 if(
p->getName().empty())
1704 if(!ds->isPropertyNameValid(
p->getName()))
1707 if(ds->propertyExists(dsName,
p->getName()))
1710 ds->addProperty(dsName,
p.get());
1712 if(ds->getType().compare(
"OGR") == 0)
1722 QMessageBox::information(
this, tr(
"Creating column failure"), tr(
"The column could not be created: ") + e.
what());
1730 if(QMessageBox::question(
this, tr(
"Remove column"), tr(
"Are you sure you want to remove this column?"), QMessageBox::No, QMessageBox::Yes) == QMessageBox::Yes)
1734 if(ds.get() ==
nullptr)
1738 std::string dsName = ds_t->getName();
1740 std::string pName = ds_t->getProperty(column)->getName();
1742 ds->dropProperty(dsName, pName);
1753 QMessageBox::information(
this, tr(
"Removing column failure"), tr(
"The column could not be removed: ") + e.
what());
1783 QItemSelection toRemove;
1785 for(
int i=initRow; i<=finalRow; i++)
1787 QModelIndexList idx = selectionModel()->selectedColumns(i);
1790 toRemove.select(idx.first(), idx.last());
1793 selectionModel()->select(toRemove, QItemSelectionModel::Deselect);
1802 std::vector< std::set<int> > ed;
1810 if(ds.get() ==
nullptr)
1817 std::unique_ptr<te::da::ObjectIdSet> objs1(objs);
1819 ds->update(sch->getName(), md.get(), ed, objs1->getPropertyPos());
1825 QMessageBox::warning(
this, tr(
"Save edition failure"), e.
what());
1829 #include "DataSetTableView.moc"
virtual std::unique_ptr< te::gm::Geometry > getGeometry(std::size_t i) const =0
Method for retrieving a geometric attribute value.
Expression * getArg(std::size_t i) const
It returns the i-th function argument.
std::unique_ptr< te::da::Select > GetSelectExpression(const std::string &datasetName, const std::vector< std::string > &colsNames, const bool &asc)
A Qt dialog for reset data of a column in the table.
TEXSDEXPORT void Save(All *all, te::xml::AbstractWriter &writer)
bool IsGeometryColumn(te::da::DataSet *dset, const size_t &col)
Expression * getFirst() const
It returns the first function argument.
std::vector< QString > GetColumnsNames(te::da::DataSet *dset)
const std::string & getDataSourceId() const
A class that informs what kind of constraint and index is supported by a given data source...
te::da::DataSetTypeCapabilities * GetCapabilities(const te::map::AbstractLayer *layer)
The Field class can be used to model an expression that takes part of the output items of a SELECT...
TEDATAACCESSEXPORT void GetEmptyOIDSet(const DataSetType *type, ObjectIdSet *&set)
Returns an empty ObjectIdSet, with the definitions of fields that compose it.
A layer with reference to a dataset that contains trajectories.
std::vector< int > GetHiddenSections(QHeaderView *hView, te::da::DataSet *dset)
A Qt dialog for renaming columns into a table.
A model based on te::da::DataSet.
A layer with reference to a dataset that contains observations.
This is the base class for layers.
A class that models the name of a dataset used in a From clause.
boost::shared_ptr< DataSource > DataSourcePtr
virtual const std::string & getType() const =0
It returns the layer type.
Base exception class for plugin module.
A class that models the description of a dataset.
void setStatistics(te::da::DataSet *dataSet, const std::string prop)
virtual const char * what() const
It outputs the exception message.
virtual void setOutOfDate()
Its indicate that the layer schema is out of date.
boost::ptr_vector< OrderByItem > OrderBy
A class that can be used to model an ORDER BY clause.
std::unique_ptr< te::da::Select > GetDataSetQuery(const te::map::AbstractLayer *layer, const std::vector< std::string > &colsNames, const bool &asc)
A class that represents the known capabilities of a specific data source, i.e. this class informs all...
A layer resulting from a query.
static te::dt::Date ds(2010, 01, 01)
A class that informs what the dataset implementation of a given data source can perform.
#define TE_LOG_INFO(message)
Use this tag in order to log a message to the TerraLib default logger with the INFO level...
It models a property definition.
This is an abstract class that models a query expression.
const std::vector< te::dt::Property * > & getProperties() const
It returns the properties that take part of the primary key.
virtual bool move(std::size_t i)=0
It moves the dataset internal pointer to a given position.
void HideGeometryColumns(te::da::DataSet *dset, te::qt::widgets::DataSetTableView *view)
te::core::EncodingType getEncoding() const
It returns the encoding type.
te::da::DataSourcePtr GetDataSource(const te::map::AbstractLayer *layer)
unsigned int unsigned int nCols
A layer with reference to a DataSetTypeConverter.
virtual std::string toString() const =0
It returns the data value in a string notation.
A table view for a dataset.
static DataSourceManager & getInstance()
It returns a reference to the singleton instance.
virtual int getPropertyDataType(std::size_t i) const =0
It returns the underlying data type of the property at position pos.
An Envelope defines a 2D rectangular region.
This class models a literal value.
This class represents a set of unique ids created in the same context. i.e. from the same data set...
A Qt dialog for inserting columns into a table.
This class represents an unique id for a data set element.
std::size_t size() const
It returns the object id set size.
virtual std::unique_ptr< LayerSchema > getSchema() const =0
It returns the layer schema.
void GetGeometryColumnsPositions(te::da::DataSet *dset, std::vector< int > &cols)
static te::dt::DateTime d(2010, 8, 9, 15, 58, 39)
boost::ptr_vector< Field > Fields
Fields is just a boost::ptr_vector of Field pointers.
const std::string & getDataSourceId() const
bool IsPrimaryKey(const int &col, te::qt::widgets::DataSetTableView *view)
te::da::Select * getQuery() const
std::unique_ptr< te::gm::Envelope > GetExtent(te::da::DataSet *dset, te::qt::widgets::Promoter *p, const int &rowPosition)
std::unique_ptr< te::da::DataSet > GetDataSet(const te::map::AbstractLayer *layer, const te::da::DataSet *set, const std::vector< int > &cols, const bool &asc)
QAction * GetShowAllMenu(QHeaderView *hView, te::da::DataSet *dset, QMenu *hMnu)
This class is designed to declare objects to be thrown as exceptions by TerraLib. ...
A Select models a query to be used when retrieving data from a DataSource.
const std::string & getDataSourceId() const
boost::ptr_vector< FromItem > From
It models the FROM clause for a query.
rasterPointer reset(te::rst::RasterFactory::make("MEM", new te::rst::Grid(nCols, nLines), bandsProps, std::map< std::string, std::string >(), 0, 0))
int getType() const
It returns the property data type.
A dataset is the unit of information manipulated by the data access module of TerraLib.
virtual const te::da::ObjectIdSet * getSelected() const
It returns the selected group of this Layer.
const std::string & getDataSetName() const
virtual std::unique_ptr< te::da::DataSet > getData(te::common::TraverseType travType=te::common::FORWARDONLY, const te::common::AccessPolicy accessPolicy=te::common::RAccess) const =0
It gets the dataset identified by the layer name.
It describes a primary key (pk) constraint.
void HideTsVectorColumn(te::da::DataSet *dset, te::qt::widgets::DataSetTableView *view)
A layer with reference to a dataset that contains trajectories.
bool contains(ObjectId *oid) const
It returns if the object id set contains the given oid.
A delegate for highlight the selected object ids.
const std::vector< std::string > & getPropertyNames() const
It returns the property names used to generated the oids.
Expression * getExpressionByInClause(const std::string source="") const
virtual bool isNull(std::size_t i) const =0
It checks if the attribute value is NULL.
A class that represents the IN operator.
const std::vector< std::size_t > & getPropertyPos() const
It returns the property positions used to generated the oids.
A layer with reference to a dataset.
QMenu * GetHiddenColumnsMenu(QHeaderView *hView, te::da::DataSet *dset, QMenu *hMnu)
virtual const std::string & getName() const
It returns the constraint name.
virtual std::size_t getNumProperties() const =0
It returns the number of properties that composes an item of the dataset.
virtual std::string getPropertyName(std::size_t i) const =0
It returns the property name at position pos.
A class that can be used in an ORDER BY clause to sort the items of a resulting query.
Expression * getSecond() const
It returns the second function argument.
const DataSetCapabilities & getDataSetCapabilities() const
terralib_conf cmake set(SWIG_MAIN_FILE"${CMAKE_CURRENT_SOURCE_DIR}/../../../src/terralib/binding/swig/TerraLibLUA.i") file(GLOB TERRALIB_SWIG_SCRIPT_FILE $
std::set< ObjectId *, te::common::LessCmp< ObjectId * > >::const_iterator begin() const
Returns an iterator for the object ids in container.
te::dt::AbstractData * getValue() const
It returns the value associated to the literal.
virtual const std::string & getDataSourceId() const
std::size_t getNumArgs() const
It returns the number of arguments informed to the function.
const std::string & getName() const
It returns the property name.