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" 
   19 #include "../../../dataaccess/dataset/DataSet.h" 
   20 #include "../../../dataaccess/dataset/ObjectId.h" 
   21 #include "../../../dataaccess/dataset/ObjectIdSet.h" 
   22 #include "../../../dataaccess/dataset/DataSetTypeCapabilities.h" 
   23 #include "../../../dataaccess/datasource/DataSourceManager.h" 
   24 #include "../../../dataaccess/datasource/DataSourceTransactor.h" 
   25 #include "../../../dataaccess/query/DataSetName.h" 
   26 #include "../../../dataaccess/query/Field.h" 
   27 #include "../../../dataaccess/query/From.h" 
   28 #include "../../../dataaccess/query/In.h" 
   29 #include "../../../dataaccess/query/Literal.h" 
   30 #include "../../../dataaccess/query/Or.h" 
   31 #include "../../../dataaccess/query/OrderBy.h" 
   32 #include "../../../dataaccess/query/OrderByItem.h" 
   33 #include "../../../dataaccess/query/Select.h" 
   34 #include "../../../dataaccess/utils/Utils.h" 
   35 #include "../../../geometry/Geometry.h" 
   36 #include "../../../maptools/DataSetLayer.h" 
   37 #include "../../../maptools/DataSetAdapterLayer.h" 
   38 #include "../../../maptools/QueryLayer.h" 
   39 #include "../../../statistics/qt/StatisticsDialog.h" 
   40 #include "../../../st/maptools/ObservationDataSetLayer.h" 
   41 #include "../../../st/maptools/TimeSeriesDataSetLayer.h" 
   42 #include "../../../st/maptools/TrajectoryDataSetLayer.h" 
   46 #include <QContextMenuEvent> 
   48 #include <QDialogButtonBox> 
   49 #include <QHeaderView> 
   52 #include <QMessageBox> 
   72   for(
size_t i=0; i<nProps; i++)
 
   74       cols.push_back((
int)i);
 
   85     for (
int i=0; i<sz; i++)
 
   96   std::vector<int>::iterator it;
 
   98   QMenu* mnu = 
new QMenu(hMnu);
 
   99   mnu->setTitle(QObject::tr(
"Show hidden column"));
 
  102     mnu->setEnabled(
false);
 
  104     for(it=hSecs.begin(); it!=hSecs.end(); ++it)
 
  106       QString cName = hView->model()->headerData(*it, Qt::Horizontal, Qt::DisplayRole).toString();
 
  107       QAction* act = 
new QAction(mnu);
 
  110       act->setData(QVariant(*it));
 
  112       QString tt = QObject::tr(
"Turns column \"%1\" visible.").arg(cName);
 
  124   QAction* act = 
new QAction(hMnu);
 
  125   act->setText(QObject::tr(
"Show all columns"));
 
  136   if(layer->
getType() == 
"DATASETLAYER")
 
  143   else if(layer->
getType() == 
"DATASETADAPTERLAYER")
 
  150   else if(layer->
getType() == 
"QUERYLAYER")
 
  157   else if(layer->
getType() == 
"OBSERVATIONDATASETLAYER")
 
  164   else if(layer->
getType() == 
"TIMESERIESDATASETLAYER")
 
  171   else if(layer->
getType() == 
"TRAJECTORYDATASETLAYER")
 
  197 std::auto_ptr<te::da::Select> 
GetSelectExpression(
const std::string& datasetName, 
const std::vector<std::string>& colsNames, 
const bool& asc)
 
  201   fields.push_back(std::auto_ptr<te::da::Field>(
new te::da::Field(
"*")));
 
  209   for(
size_t i=0; i<colsNames.size(); i++)
 
  212   return std::auto_ptr<te::da::Select>(
new te::da::Select(fields, from, order_by));
 
  217   std::vector<std::string> colsNames;
 
  219   for(
size_t i = 0; i < cols.size(); ++i)
 
  232       throw std::string(
"Fail to generate query.");
 
  237       throw std::string(
"Fail to get data source.");
 
  243     return std::auto_ptr<te::da::DataSet>();
 
  249   std::auto_ptr<te::da::Select> query;
 
  251   if(layer->
getType() == 
"DATASETLAYER")
 
  258   else if(layer->
getType() == 
"DATASETADAPTERLAYER")
 
  265   else if(layer->
getType() == 
"QUERYLAYER")
 
  274       for (
size_t i = 0; i<colsNames.size(); i++)
 
  277       query->setOrderBy(order_by);
 
  280   else if(layer->
getType() == 
"OBSERVATIONDATASETLAYER")
 
  287   else if(layer->
getType() == 
"TIMESERIESDATASETLAYER")
 
  294   else if(layer->
getType() == 
"TRAJECTORYDATASETLAYER")
 
  305       throw std::string(
"Fail to generate query.");
 
  310       throw std::string(
"Fail to get data source.");
 
  316     return std::auto_ptr<te::da::DataSet>();
 
  322   std::vector<QString> res;
 
  328     for(
size_t i=0; i<n; i++)
 
  339   std::vector<int> geoCols;
 
  349     size_t pos = (size_t)geoCols[0];
 
  351     std::auto_ptr<te::gm::Geometry> g = dset->
getGeometry(pos);
 
  353     return std::auto_ptr<te::gm::Envelope> (
new te::gm::Envelope(*g->getMBR()));
 
  356   return std::auto_ptr<te::gm::Envelope>();
 
  372   std::vector<size_t>::iterator it;
 
  374   for(it = cols.begin(); it != cols.end(); ++it)
 
  375     if((
size_t)col == *it)
 
  385     std::vector<int> geoCols;
 
  386     std::vector<int>::iterator it;
 
  389     for(it = geoCols.begin(); it != geoCols.end(); ++it)
 
  400     for(std::size_t i = 0; i < nProps; ++i)
 
  431       m_view->horizontalHeader()->installEventFilter(
this);
 
  432       m_view->verticalHeader()->installEventFilter(
this);
 
  433       m_view->viewport()->installEventFilter(
this);
 
  441       m_view->connect(
this, SIGNAL(
sortData(
const bool&)), SLOT(sortByColumns(
const bool&)));
 
  462         return QObject::eventFilter(watched, event);
 
  464       QWidget* vport = 
m_view->viewport();
 
  465       QHeaderView* hHdr = 
m_view->horizontalHeader();
 
  466       QHeaderView* vHdr = 
m_view->verticalHeader();
 
  468       switch(event->type())
 
  470         case QEvent::ContextMenu:
 
  477             QContextMenuEvent* evt = 
static_cast<QContextMenuEvent*
>(event);
 
  478             QPoint pos = evt->globalPos();
 
  480             m_columnPressed = hHdr->logicalIndex(hHdr->visualIndexAt(evt->pos().x()));
 
  487               QAction* act = 
new QAction(
m_hMenu);
 
  488               act->setText(tr(
"Hide column"));
 
  489               act->setToolTip(tr(
"Hides the selected column."));
 
  496                 act->setEnabled(
false);
 
  498               m_hMenu->addAction(hMnu->menuAction());
 
  503               QAction* act3 = 
new QAction(
m_hMenu);
 
  504               act3->setText(tr(
"Reset columns order"));
 
  505               act3->setToolTip(tr(
"Put all columns in the original order."));
 
  510               QAction* act5 = 
new QAction(
m_hMenu);
 
  511               act5->setText(tr(
"Sort data ASC"));
 
  512               act5->setToolTip(tr(
"Sort data in ascendent order using selected columns."));
 
  515               QAction* act9 = 
new QAction(
m_hMenu);
 
  516               act9->setText(tr(
"Sort data DESC"));
 
  517               act9->setToolTip(tr(
"Sort data in descendent order using selected columns."));
 
  522               QAction* act4 = 
new QAction(
m_hMenu);
 
  523               act4->setText(tr(
"Histogram"));
 
  524               act4->setToolTip(tr(
"Creates a new histogram based on the data of the selected colunm."));
 
  527               QAction* act10 = 
new QAction(
m_hMenu);
 
  528               act10->setText(tr(
"Normal Probability"));
 
  529               act10->setToolTip(tr(
"Show a chart that displays the normal probability curve."));
 
  532               QAction* act6 = 
new QAction(
m_hMenu);
 
  533               act6->setText(tr(
"Statistics"));
 
  534               act6->setToolTip(tr(
"Show the statistics summary of the selected colunm."));
 
  540               connect(act, SIGNAL(triggered()), SLOT(
hideColumn()));
 
  541               connect(hMnu, SIGNAL(triggered(QAction*)), SLOT(
showColumn(QAction*)));
 
  545               m_view->connect(act2, SIGNAL(triggered()), SLOT(showAllColumns()));
 
  546               m_view->connect(act3, SIGNAL(triggered()), SLOT(resetColumnsOrder()));
 
  550               connect(act5, SIGNAL(triggered()), SLOT(
sortDataAsc()));
 
  551               connect(act9, SIGNAL(triggered()), SLOT(
sortDataDesc()));
 
  556                 QAction* act7 = 
new QAction(
m_hMenu);
 
  557                 act7->setText(tr(
"Add column"));
 
  558                 act7->setToolTip(tr(
"Adds a column to the table."));
 
  560                 act7->setEnabled(
m_caps->supportsAddColumn());
 
  562                 QAction* act8 = 
new QAction(
m_hMenu);
 
  563                 act8->setText(tr(
"Remove column"));
 
  564                 act8->setToolTip(tr(
"Removes a column from the table."));
 
  566                 act8->setEnabled(
m_caps->supportsRemoveColumn());
 
  568                 QAction* act10 = 
new QAction(
m_hMenu);
 
  569                 act10->setText(tr(
"Rename column"));
 
  570                 act10->setToolTip(tr(
"Renames a column of the table."));
 
  573                 QAction* act11 = 
new QAction(
m_hMenu);
 
  574                 act11->setText(tr(
"Change column type"));
 
  575                 act11->setToolTip(tr(
"Changes the type of a column of the table."));
 
  579                 QAction* act12 = 
new QAction(
m_hMenu);
 
  580                 act12->setText(tr(
"Change column data"));
 
  581                 act12->setToolTip(tr(
"Changes the data of a column of the table."));
 
  585                 QAction* act13 = 
new QAction(
m_hMenu);
 
  586                 act13->setText(tr(
"Save editions"));
 
  587                 act13->setToolTip(tr(
"Save pendent editions to layer."));
 
  591                 m_view->connect(act7, SIGNAL(triggered()), SLOT(addColumn()));
 
  593                 connect(act8, SIGNAL(triggered()), SLOT(
removeColumn()));
 
  594                 connect (act10, SIGNAL(triggered()), SLOT(
renameColumn()));
 
  595                 connect (act11, SIGNAL(triggered()), SLOT(
retypeColumn()));
 
  597                 connect (act13, SIGNAL(triggered()), SIGNAL(
saveEditions()));
 
  603           else if(watched == vport)
 
  606           else if(watched == vHdr)
 
  610             QContextMenuEvent* evt = 
static_cast<QContextMenuEvent*
>(event);
 
  611             QPoint pos = evt->globalPos();
 
  614             QAction* act = 
new QAction(
m_vMenu);
 
  615             act->setText(tr(
"Enable auto scroll"));
 
  616             act->setToolTip(tr(
"Goes to the selected row."));
 
  618             act->setCheckable(
true);
 
  626             act->setText(tr(
"Enable promotion"));
 
  627             act->setToolTip(tr(
"Enables promotion of selected rows."));
 
  629             act->setCheckable(
true);
 
  647       return QObject::eventFilter(watched, event);
 
  699       int column = act->data().toInt();
 
  709       statisticDialog.exec();
 
  793     std::auto_ptr<te::da::DataSetTypeCapabilities> 
m_caps;
 
  805   m_autoScrollEnabled(false),
 
  807   m_promotionEnabled(false),
 
  818 #if QT_VERSION >= 0x050000 
  819   horizontalHeader()->setSectionsMovable(
true);
 
  821   horizontalHeader()->setMovable(
true);
 
  824   setSelectionMode(QAbstractItemView::MultiSelection);
 
  825   setSelectionBehavior(QAbstractItemView::SelectColumns);
 
  837   connect(verticalHeader(), SIGNAL(selectedRow(
const int&, 
const bool&)), SLOT(
highlightRow(
const int&, 
const bool&)));
 
  838   connect(verticalHeader(), SIGNAL(selectedRows(
const int&, 
const int&)), SLOT(
highlightRows(
const int&, 
const int&)));
 
  843   if (m_model->hasEditions())
 
  845     QMessageBox msgBox(
this);
 
  846     msgBox.setText(
"There are unsaved changes on table.");
 
  847     msgBox.setInformativeText(
"Do you want to save your changes?");
 
  851     int ret = msgBox.exec();
 
  890   std::auto_ptr<te::map::LayerSchema> sch = m_layer->getSchema();
 
  892   if (m_orderby.empty())
 
  894     std::vector<te::dt::Property*> psps;
 
  896     if(sch->getPrimaryKey())
 
  897       psps = sch->getPrimaryKey()->getProperties();
 
  899       psps = sch->getProperties();
 
  901     std::vector<te::dt::Property*>::iterator it;
 
  903     for(it = psps.begin(); it != psps.end(); ++it)
 
  904       m_orderby.push_back((*it)->getName());
 
  909   setDataSet(
GetDataSet(m_layer, m_orderby, m_orderAsc).release(), dsc->getEncoding(), clearEditor);
 
  911   setLayerSchema(sch.get());
 
  915   m_popupFilter->setDataSetTypeCapabilities(caps);
 
  918     m_model->setEditable(caps->supportsDataEdition());
 
  922     bool isOGR = (dsc->getType().compare(
"OGR") == 0);
 
  923     setSelectionMode(isOGR ? SingleSelection : MultiSelection);
 
  924     setSelectionBehavior(isOGR ? QAbstractItemView::SelectColumns : QAbstractItemView::SelectItems);
 
  925     m_popupFilter->setIsOGR(isOGR);
 
  928   highlightOIds(m_layer->getSelected());
 
  937   m_model->setDataSet(dset, enc, clearEditor);
 
  944   m_popupFilter->setDataSet(dset);
 
  945   m_delegate->setDataSet(dset);
 
  955   std::auto_ptr<te::da::ObjectIdSet> objs_ptr(objs);
 
  957   m_delegate->setObjectIdSet(objs_ptr.get());
 
  959   m_model->setPkeysColumns(objs_ptr->getPropertyPos());
 
  969   m_delegate->setObjectIdSet(oids);
 
  971   if(m_autoScrollEnabled && oids != 0 && oids->
size() > 0)
 
  973     size_t row = m_model->getPromoter()->map2Row(*oids->
begin());
 
  975     scrollTo(m_model->index((
int)row, 0));
 
  978   if(m_promotionEnabled)
 
  981   viewport()->repaint();
 
  986   m_delegate->setColor(color);
 
  993   return m_model->hasEditions();
 
  998   QDialog* dialog = 
new QDialog(
this);
 
  999   dialog->setFixedSize(160, 75);
 
 1011   QGridLayout* layout = 
new QGridLayout(dialog);
 
 1012   layout->addWidget(histogramWidget);
 
 1014   QDialogButtonBox* bbox = 
new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, dialog);
 
 1015   connect(bbox, SIGNAL(accepted()), dialog, SLOT(accept()));
 
 1016   connect(bbox, SIGNAL(rejected()), dialog, SLOT(reject()));
 
 1018   layout->addWidget(bbox);
 
 1019   layout->setSizeConstraint(QLayout::SetFixedSize);
 
 1021   int res = dialog->exec();
 
 1022   if (res == QDialog::Accepted)
 
 1030   int propType = m_layer->getData()->getPropertyDataType(column);
 
 1037     QString msgErr(tr(
"This operation is not available for this type of data"));
 
 1038     QString msgTitle(tr(
"TNormal Probability"));
 
 1039     QMessageBox::warning(
this, msgTitle, msgErr);
 
 1045   horizontalHeader()->hideSection(column);
 
 1050   horizontalHeader()->showSection(column);
 
 1057   dlg.
setOldColumnName(QString::fromStdString(m_dset->getPropertyName(column)));
 
 1059   if(dlg.exec() == QDialog::Accepted)
 
 1061     std::string oldName = dlg.
getOldName().toStdString();
 
 1062     std::string newName = dlg.
getNewName().toStdString();
 
 1066       throw Exception(tr(
"Fail to get data source.").toStdString());
 
 1068     if(!dsrc->isPropertyNameValid(newName))
 
 1070       QMessageBox::warning(
this, tr(
"TerraView"), tr(
"Invalid column name. Choose another."));
 
 1076       dsrc->renameProperty(m_layer->getSchema()->getName(), oldName, newName);
 
 1080       QMessageBox::information(
this, tr(
"Rename Column"), tr(
"The column could not be renamed: ") + e.
what());
 
 1083     m_layer->setOutOfDate();
 
 1093   std::auto_ptr<te::da::DataSetType> schema = m_layer->getSchema();
 
 1095   std::string dsetName = schema->
getName();
 
 1096   std::string columnName;
 
 1098   prp = schema->getProperty(column);
 
 1101     throw Exception(tr(
"Fail to get property of the dataset.").toStdString());
 
 1109   if(dlg.exec() == QDialog::Accepted)
 
 1114       throw Exception(tr(
"Fail to get data source.").toStdString());
 
 1118     dsrc->changePropertyDefinition(dsetName, columnName, dlg.
getProperty().release());
 
 1120     m_layer->setOutOfDate();
 
 1128   if(m_dset == 0 || m_layer == 0)
 
 1131   std::auto_ptr<te::da::DataSetType> schema = m_layer->getSchema();
 
 1133   std::string dsetName = schema->
getName();
 
 1135   std::string columnName = prop->
getName();
 
 1138   std::map<std::string, int> pkColumnsType;
 
 1140   std::vector<te::dt::Property*> pkProps = pk->
getProperties();
 
 1142   for (
size_t i = 0; i < pkProps.size(); i++)
 
 1144     pkColumnsType[pkProps[i]->getName()] = pkProps[i]->getType();
 
 1153   if(dlg.exec() == QDialog::Accepted)
 
 1158       throw Exception(tr(
"Fail to get data source.").toStdString());
 
 1160     std::string sql = 
"UPDATE " + dsetName + 
" SET " + columnName + 
" = " + dlg.
getExpression().toStdString();
 
 1180         std::string orFirstInExpStr = 
" IN (";
 
 1181         std::string orSecondInExpStr = 
" IN (";
 
 1188           for (std::size_t i = 0; i < orFirstInExp->
getNumArgs(); ++i)
 
 1197               inStr = 
"'" + inStr + 
"'";
 
 1200               orFirstInExpStr += inStr + 
")";
 
 1202               orFirstInExpStr += inStr + 
",";
 
 1205           for (std::size_t i = 0; i < orSecondInExp->
getNumArgs(); ++i)
 
 1214               inStr = 
"'" + inStr + 
"'";
 
 1217               orSecondInExpStr += inStr + 
")";
 
 1219               orSecondInExpStr += inStr + 
",";
 
 1228           std::string inExpStr = 
" IN (";
 
 1230           for (std::size_t i = 0; i < inExp->
getNumArgs(); ++i)
 
 1239               inStr = 
"'" + inStr + 
"'";
 
 1243               inExpStr += inStr + 
")";
 
 1247               inExpStr += inStr + 
",";
 
 1257       std::replace(sql.begin(), sql.end(), 
'\n', 
' ');
 
 1261       m_layer->setOutOfDate();
 
 1267       QMessageBox::information(
this, tr(
"Updating data failure"), e.
what());
 
 1271       QMessageBox::information(
this, tr(
"Updating data failure"), tr(
"Data source operation fail for unknown reason."));
 
 1278   std::vector<int> hCols = m_popupFilter->getHiddenColumns();
 
 1279   std::vector<int>::iterator it;
 
 1281   for (it=hCols.begin(); it!=hCols.end(); ++it)
 
 1282     horizontalHeader()->showSection(*it);
 
 1287   QHeaderView* hdr = horizontalHeader();
 
 1289   int nCols = hdr->count();
 
 1291   for(
int i=0; i<nCols; i++)
 
 1293     int visCol = hdr->visualIndex(i);
 
 1296       hdr->moveSection(visCol, i);
 
 1308     if(m_delegate->getSelected()->contains(oid))
 
 1310       emit deselectOIds(oids);
 
 1314       m_delegate->setObjectIdSet(m_layer->getSelected());
 
 1316       if(m_promotionEnabled)
 
 1319       viewport()->repaint();
 
 1327   emit selectOIds(oids, add, 
GetExtent(m_dset, m_model->getPromoter(), row).
get());
 
 1329   if(m_promotionEnabled)
 
 1332   viewport()->repaint();
 
 1342   if(initRow < finalRow)
 
 1357   emit selectOIds(oids, 
true, 
GetExtent(m_dset, m_model->getPromoter(), 
final).
get());
 
 1359   if(m_promotionEnabled)
 
 1362   viewport()->repaint();
 
 1372   m_model->setEnabled(
false);
 
 1373   m_popupFilter->setEnabled(
false);
 
 1376   m_model->promote(oids);
 
 1378   m_popupFilter->setEnabled(
true);
 
 1379   m_model->setEnabled(
true);
 
 1382   viewport()->repaint();
 
 1397     std::vector<int> selCols;
 
 1401     int nCols = model()->columnCount();
 
 1403     for(
int i=0; i<nCols; i++)
 
 1405       int logRow = horizontalHeader()->logicalIndex(i);
 
 1406       if(selectionModel()->isColumnSelected(logRow, QModelIndex()))
 
 1408         m_orderby.push_back(m_dset->getPropertyName((
size_t)logRow));
 
 1409         selCols.push_back(logRow);
 
 1416     std::auto_ptr<te::da::DataSet> dset = 
GetDataSet(m_layer, m_orderby, asc);
 
 1419       throw te::common::Exception(tr(
"Sort operation not supported by the source of data.").toStdString());
 
 1421     setDataSet(dset.release(), m_encoding);
 
 1423     viewport()->repaint();
 
 1425     setUpdatesEnabled(
false);
 
 1427     m_model->getPromoter()->preProcessKeys(m_dset, m_delegate->getSelected()->getPropertyPos());
 
 1429     setUpdatesEnabled(
true);
 
 1431     if(m_promotionEnabled)
 
 1436     QMessageBox::information(
this, tr(
"Sorting columns failure"), tr(
"Could not sort data: ") + e.
what());
 
 1442   m_model->showOIdsVisible(visible);
 
 1444   horizontalHeader()->viewport()->repaint();
 
 1456     std::auto_ptr<te::da::DataSetType> ds_t = m_layer->getSchema();
 
 1458     std::string dsName = ds_t->getName();
 
 1459     size_t n_prop = ds_t->getProperties().size();
 
 1462     if(dlg.exec() == QDialog::Accepted)
 
 1471       if(p->getName().empty())
 
 1474       if(!ds->isPropertyNameValid(p->getName()))
 
 1477       if(ds->propertyExists(dsName, p->getName()))
 
 1480       ds->addProperty(dsName, p.get());
 
 1482       if(ds->getType().compare(
"OGR") == 0)
 
 1483         m_model->insertColumns(((
int)n_prop-1), 0);
 
 1485       m_layer->setOutOfDate();
 
 1487       setLayer(m_layer, 
false);
 
 1492     QMessageBox::information(
this, tr(
"Creating column failure"), tr(
"The column could not be created: ") + e.
what());
 
 1500     if(QMessageBox::question(
this, tr(
"Remove column"), tr(
"Are you sure you want to remove this column?"), QMessageBox::No, QMessageBox::Yes) == QMessageBox::Yes)
 
 1507       std::auto_ptr<te::da::DataSetType> ds_t = m_layer->getSchema();
 
 1508       std::string dsName = ds_t->getName();
 
 1510       std::string pName = ds_t->getProperty(column)->getName();
 
 1512       ds->dropProperty(dsName, pName);
 
 1514       m_model->removeColumns(column, 0);
 
 1516       m_layer->setOutOfDate();
 
 1518       setLayer(m_layer, 
false);
 
 1523     QMessageBox::information(
this, tr(
"Removing column failure"), tr(
"The column could not be removed: ") + e.
what());
 
 1529   m_autoScrollEnabled = enable;
 
 1531   m_model->getPromoter()->preProcessKeys(m_dset, m_delegate->getSelected()->getPropertyPos());
 
 1536   m_promotionEnabled = enable;
 
 1538   m_model->getPromoter()->preProcessKeys(m_dset, m_delegate->getSelected()->getPropertyPos());
 
 1540   if(m_promotionEnabled)
 
 1543   m_popupFilter->setPromotionEnabled(m_promotionEnabled);
 
 1548   QItemSelection toRemove;
 
 1550   for(
int i=initRow; i<=finalRow; i++)
 
 1552     QModelIndexList idx = selectionModel()->selectedColumns(i);
 
 1555       toRemove.select(idx.first(), idx.last());
 
 1558   selectionModel()->select(toRemove, QItemSelectionModel::Deselect);
 
 1567     std::vector< std::set<int> > ed;
 
 1569     std::auto_ptr<te::map::LayerSchema> sch = m_layer->getSchema();
 
 1571     std::auto_ptr<te::da::DataSet> md = m_model->getEditions(sch.get(), ed);
 
 1582     std::auto_ptr<te::da::ObjectIdSet> objs1(objs);
 
 1584     ds->update(sch->getName(), md.get(), ed, objs1->getPropertyPos());
 
 1590     QMessageBox::warning(
this, tr(
"Save edition failure"), e.
what());
 
 1594 #include "DataSetTableView.moc" 
Expression * getArg(std::size_t i) const 
It returns the i-th function argument. 
 
virtual const std::string & getType() const =0
It returns the layer type. 
 
A Qt dialog for reset data of a column in the table. 
 
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 & getDataSetName() const 
 
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. 
 
CharEncoding
Supported charsets (character encoding). 
 
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
 
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. 
 
boost::ptr_vector< OrderByItem > OrderBy
A class that can be used to model an ORDER BY clause. 
 
virtual std::string toString() const =0
It returns the data value in a string notation. 
 
A layer resulting from a query. 
 
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::da::DataSourcePtr GetDataSource(const te::map::AbstractLayer *layer)
 
std::auto_ptr< te::da::DataSet > GetDataSet(const te::map::AbstractLayer *layer, const te::da::DataSet *set, const std::vector< int > &cols, const bool &asc)
 
A layer with reference to a DataSetTypeConverter. 
 
A table view for a dataset. 
 
static DataSourceManager & getInstance()
It returns a reference to the singleton instance. 
 
An Envelope defines a 2D rectangular region. 
 
const std::string & getDataSourceId() const 
 
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...
 
virtual std::string getPropertyName(std::size_t i) const =0
It returns the property name at position pos. 
 
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. 
 
void GetGeometryColumnsPositions(te::da::DataSet *dset, std::vector< int > &cols)
 
const std::string & getDataSourceId() const 
 
TEDATAACCESSEXPORT void Save(const std::string &fileName)
 
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)
 
const std::string & getDataSourceId() const 
 
te::da::Select * getQuery() const 
 
QAction * GetShowAllMenu(QHeaderView *hView, te::da::DataSet *dset, QMenu *hMnu)
 
virtual std::size_t getNumProperties() const =0
It returns the number of properties that composes an item of the dataset. 
 
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. 
 
virtual std::auto_ptr< te::gm::Geometry > getGeometry(std::size_t i) const =0
Method for retrieving a geometric attribute value. 
 
const std::string & getDataSourceId() const 
 
boost::ptr_vector< FromItem > From
It models the FROM clause for a query. 
 
int getType() const 
It returns the property data type. 
 
A dataset is the unit of information manipulated by the data access module of TerraLib. 
 
It describes a primary key (pk) constraint. 
 
void HideTsVectorColumn(te::da::DataSet *dset, te::qt::widgets::DataSetTableView *view)
 
std::auto_ptr< te::gm::Envelope > GetExtent(te::da::DataSet *dset, te::qt::widgets::Promoter *p, const int &rowPosition)
 
A layer with reference to a dataset that contains trajectories. 
 
std::auto_ptr< te::da::Select > GetSelectExpression(const std::string &datasetName, const std::vector< std::string > &colsNames, const bool &asc)
 
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 
 
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. 
 
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. 
 
virtual int getPropertyDataType(std::size_t i) const =0
It returns the underlying data type of the property at position pos. 
 
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. 
 
std::size_t getNumArgs() const 
It returns the number of arguments informed to the function. 
 
virtual std::auto_ptr< LayerSchema > getSchema() const =0
It returns the layer schema. 
 
const std::string & getName() const 
It returns the property name.