All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UpdateProperty.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2001-2011 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 // Qt
21 #include <QtGui/QtGui>
22 #include <QtGui/QComboBox>
23 #include <QtGui/QMessageBox>
24 
25 // TerraLib
26 #include "../../../dataaccess.h"
27 #include "../../../datatype.h"
28 #include "../../../datatype/ByteArray.h"
29 #include "../../../datatype/Enums.h"
30 #include "../../../geometry/Envelope.h"
31 #include "../../../geometry/Geometry.h"
32 #include "../../../geometry/GeometryProperty.h"
33 #include "../../../raster/Grid.h"
34 #include "../../../raster/RasterProperty.h"
35 
36 #include "UpdateProperty.h"
37 
39  : QDialog(parent),
40  m_ds(ds),
41  m_oldProperty(0),
42  m_updatedProperty(0)
43 {
44  if (m_ds == 0)
45  QMessageBox::critical(this, tr("Missing a Valid Data Source"), tr("Provide a valid data source!"));
46 
47  setupUi(this);
48 
49  layout()->setSizeConstraint(QLayout::SetFixedSize);
50 
51  // Get the dataset names of the data source
52  std::vector<std::string> datasetNames = m_ds->getDataSetNames();
53 
54  // Fill alphabetically the dataSetCombobox with the dataset names of the data source
55  QStringList dataSetList;
56 
57  size_t numDataSets = datasetNames.size();
58  for (size_t i = 0; i < numDataSets; ++i)
59  dataSetList << (datasetNames[i]).c_str();
60 
61  dataSetList.sort();
62  dataSetComboBox->addItems(dataSetList);
63 
64  // Fill the dataTypeComboBox with the data types available
65  // according the data source capabilities
68 
69  if(dataTypeCapabilities.supportsArray())
70  {
71  dataTypeComboBox->addItem("ARRAY");
73  }
74 
75  if(dataTypeCapabilities.supportsBit())
76  {
77  dataTypeComboBox->addItem("BIT");
79  }
80 
81  if(dataTypeCapabilities.supportsBoolean())
82  {
83  dataTypeComboBox->addItem("BOOLEAN");
85  }
86 
87  if(dataTypeCapabilities.supportsByteArray())
88  {
89  dataTypeComboBox->addItem("BYTE_ARRAY");
91  }
92 
93  if(dataTypeCapabilities.supportsChar())
94  {
95  dataTypeComboBox->addItem("CHAR");
97  }
98 
99  if(dataTypeCapabilities.supportsComposite())
100  {
101  dataTypeComboBox->addItem("COMPOSITE");
103  }
104 
105  if(dataTypeCapabilities.supportsDataset())
106  {
107  dataTypeComboBox->addItem("DATASET");
109  }
110 
111  if(dataTypeCapabilities.supportsDateTime())
112  {
113  dataTypeComboBox->addItem("DATETIME");
115  }
116 
117  if(dataTypeCapabilities.supportsDouble())
118  {
119  dataTypeComboBox->addItem("DOUBLE");
121  }
122 
123  if(dataTypeCapabilities.supportsFloat())
124  {
125  dataTypeComboBox->addItem("FLOAT");
127  }
128 
129  if(dataTypeCapabilities.supportsGeometry())
130  {
131  dataTypeComboBox->addItem("GEOMETRY");
133  }
134 
135  if(dataTypeCapabilities.supportsInt16())
136  {
137  dataTypeComboBox->addItem("INT16");
139  }
140 
141  if(dataTypeCapabilities.supportsInt32())
142  {
143  dataTypeComboBox->addItem("INT32");
145  }
146 
147  if(dataTypeCapabilities.supportsInt64())
148  {
149  dataTypeComboBox->addItem("INT64");
151  }
152 
153  if(dataTypeCapabilities.supportsNumeric())
154  {
155  dataTypeComboBox->addItem("NUMERIC");
157  }
158 
159  if(dataTypeCapabilities.supportsRaster())
160  {
161  dataTypeComboBox->addItem("RASTER");
163  }
164 
165  if(dataTypeCapabilities.supportsString())
166  {
167  dataTypeComboBox->addItem("STRING");
169  }
170 
171  if(dataTypeCapabilities.supportsUChar())
172  {
173  dataTypeComboBox->addItem("UCHAR");
175  }
176 
177  if(dataTypeCapabilities.supportsUInt16())
178  {
179  dataTypeComboBox->addItem("UINT16");
181  }
182 
183  if(dataTypeCapabilities.supportsUInt32())
184  {
185  dataTypeComboBox->addItem("UINT32");
187  }
188 
189  if(dataTypeCapabilities.supportsUInt64())
190  {
191  dataTypeComboBox->addItem("UINT64");
193  }
194 
195  // Connect the signals/slots
196  connect(dataSetComboBox, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(dataSetComboBoxChanged(const QString&)));
197  connect(propertiesComboBox, SIGNAL(activated(const QString&)), this, SLOT(propertiesComboBoxActivated(const QString&)));
198  connect(dataTypeComboBox, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(dataTypeComboBoxChanged(const QString&)));
199  connect(requiredCheckBox, SIGNAL(clicked(bool)), this, SLOT(requiredCheckBoxClicked(bool)));
200  connect(arrayElementDataTypeComboBox, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(arrayElementDataTypeComboBoxChanged(const QString&)));
201  connect(okPushButton, SIGNAL(clicked()), this, SLOT(okPushButtonClicked()));
202  connect(cancelPushButton, SIGNAL(clicked()), this, SLOT(cancelPushButtonClicked()));
203  connect(helpPushButton, SIGNAL(clicked()), this, SLOT(helpPushButtonClicked()));
204 
205  dataSetComboBoxChanged(dataSetComboBox->currentText());
206 }
207 
209 {
210 }
211 
213 {
214  propertiesComboBox->clear();
215 
216  std::vector<std::string> pNames = m_ds->getPropertyNames(datasetName.toStdString());
217  for (size_t i = 0; i < pNames.size(); ++i)
218  propertiesComboBox->addItem(pNames[i].c_str());
219 
220  propertiesComboBoxActivated(pNames[0].c_str());
221 }
222 
224 {
225  // Get the old property
226  m_oldProperty = m_ds->getProperty(dataSetComboBox->currentText().toStdString(), propertyName.toStdString()).get();
227 
228  // Set in the dataTypeComboBox the initial old property data type
229  int oldPropertyType = m_oldProperty->getType();
230 
231  int pos = dataTypeComboBox->findText(m_propertyTypeMap[oldPropertyType]);
232  dataTypeComboBox->setCurrentIndex(pos);
233 
234  // Set in the propertyNameLineEdit the name of the old property name
235  propertyNameLineEdit->clear();
236  propertyNameLineEdit->setText(m_oldProperty->getName().c_str());
237 
238  // Initialize the autoNumberCheckBox status
239  autoNumberCheckBox->setEnabled(false);
240  autoNumberCheckBox->setChecked(false);
241 
242  // Initialize the requiredCheckBox status
243  requiredCheckBox->setEnabled(true);
244  requiredCheckBox->setChecked(false);
245 
246  // Initialize the defaultValueLineEdit status
247  defaultValueLineEdit->clear();
248  defaultValueLineEdit->setEnabled(true);
249 
250  // Set the dataTypeStackedWidget as visible
251  dataTypeStackedWidget->setVisible(true);
252 
253  // Get the type of the property selected
254  QString dataType = dataTypeComboBox->currentText();
255 
256  // Set the particular data of the old property
257  if(dataType == "ARRAY")
258  setArrayPropertyData();
259  else if(dataType == "COMPOSITE")
260  setCompositePropertyData();
261  else if(dataType == "DATETIME")
262  setDateTimePropertyData();
263  else if(dataType == "GEOMETRY")
264  setGeometryPropertyData();
265  else if(dataType == "NUMERIC")
266  setNumericPropertyData();
267  else if(dataType == "RASTER")
268  setRasterPropertyData();
269  else if(dataType == "STRING")
270  setStringPropertyData();
271  else
272  {
273  te::dt::SimpleProperty* sp = static_cast<te::dt::SimpleProperty*>(m_oldProperty);
274  std::string* defaultValue = sp->getDefaultValue();
275 
276  if(dataType == "INT32" || dataType == "INT64")
277  {
278  if(sp->isAutoNumber())
279  {
280  autoNumberCheckBox->setChecked(true);
281  requiredCheckBox->setChecked(true);
282  requiredCheckBox->setEnabled(false);
283  defaultValueLineEdit->setText(defaultValue->c_str());
284  defaultValueLineEdit->setEnabled(false);
285  }
286  }
287 
288  if(sp->isRequired())
289  requiredCheckBox->setChecked(true);
290 
291  if(defaultValue)
292  defaultValueLineEdit->setText(defaultValue->c_str());
293 
294  dataTypeStackedWidget->setVisible(false);
295  }
296 }
297 
299 {
300  dataTypeStackedWidget->setVisible(false);
301 
302  precisionLineEdit->setEnabled(true);
303  scaleLineEdit->setEnabled(true);
304  stringTypeComboBox->setEnabled(false);
305  stringSizeLineEdit->setEnabled(false);
306 
307  if(dataType == "NUMERIC")
308  {
309  dataTypeStackedWidget->setVisible(true);
310  dataTypeStackedWidget->setCurrentWidget(numericPage);
311 
312  if(m_oldProperty->getType() == te::dt::NUMERIC_TYPE)
313  {
314  precisionLineEdit->setEnabled(false);
315  scaleLineEdit->setEnabled(false);
316  }
317  }
318  else if(dataType == "STRING")
319  {
320  dataTypeStackedWidget->setVisible(true);
321  dataTypeStackedWidget->setCurrentWidget(stringPage);
322 
323  if(m_oldProperty->getType() == te::dt::STRING_TYPE)
324  {
325  stringTypeComboBox->setEnabled(false);
326  stringSizeLineEdit->setEnabled(false);
327  }
328  }
329 }
330 
332 {
333  defaultValueLineEdit->clear();
334  if(checked == true)
335  defaultValueLineEdit->setEnabled(true);
336  else
337  defaultValueLineEdit->setEnabled(false);
338 }
339 
341 {
342  arrayElementStackedWidget->setVisible(false);
343 
344  arrayElementPrecisionLineEdit->setEnabled(true);
345  arrayElementScaleLineEdit->setEnabled(true);
346  arrayElementStringTypeComboBox->setEnabled(false);
347  arrayElementStringSizeLineEdit->setEnabled(false);
348 
349  // Get the type of the old array element
350  te::dt::ArrayProperty* oldArrayProperty = static_cast<te::dt::ArrayProperty*>(m_oldProperty);
351 
352  te::dt::Property* oldArrayElementProperty = oldArrayProperty->getElementType();
353  while(oldArrayElementProperty->getType() == te::dt::ARRAY_TYPE)
354  oldArrayElementProperty = static_cast<te::dt::ArrayProperty*>(oldArrayElementProperty)->getElementType();
355 
356  int oldArrayElementDataType = oldArrayElementProperty->getType();
357 
358  if(arrayElementDataType == "NUMERIC")
359  {
360  arrayElementStackedWidget->setVisible(true);
361  arrayElementStackedWidget->setCurrentWidget(arrayElementNumericPage);
362 
363  if(oldArrayElementDataType == te::dt::NUMERIC_TYPE)
364  {
365  arrayElementPrecisionLineEdit->setEnabled(false);
366  arrayElementScaleLineEdit->setEnabled(false);
367  }
368  }
369  else if(arrayElementDataType == "STRING")
370  {
371  arrayElementStackedWidget->setVisible(true);
372  arrayElementStackedWidget->setCurrentWidget(arrayElementStringPage);
373 
374  if(oldArrayElementDataType == te::dt::STRING_TYPE)
375  {
376  arrayElementStringTypeComboBox->setEnabled(false);
377  arrayElementStringSizeLineEdit->setEnabled(false);
378  }
379  }
380 }
381 
383 {
384  // Get the property name
385  if(propertyNameLineEdit->text().isEmpty())
386  {
387  QMessageBox::information(this, tr("Missing the Property Name"),
388  tr("Set the name of the property to be added!"));
389  return;
390  }
391 
392  m_propertyName = propertyNameLineEdit->text().toStdString();
393 
394  // Get the default value
395  if(defaultValueLineEdit->text().isEmpty())
396  m_defaultValue = 0;
397  else
398  m_defaultValue = new std::string(defaultValueLineEdit->text().toStdString());
399 
400  // Build the property to be updated
401  QString dataType = dataTypeComboBox->currentText();
402 
403  m_updatedProperty = buildUpdatedProperty(dataType);
404 
405  if(m_updatedProperty == 0)
406  return;
407 
408  accept();
409 }
410 
412 {
413  reject();
414 }
415 
417 {
418 }
419 
421 {
422  dataTypeStackedWidget->setCurrentWidget(arrayPage);
423 
424  te::dt::ArrayProperty* oldArrayProperty = static_cast<te::dt::ArrayProperty*>(m_oldProperty);
425 
426  if(oldArrayProperty->isRequired() == true)
427  requiredCheckBox->setChecked(true);
428 
429  std::string* defaultValue = oldArrayProperty->getDefaultValue();
430  if(defaultValue != 0)
431  {
432  size_t firstIndex = defaultValue->find("'");
433  size_t lastIndex = defaultValue->rfind("'");
434 
435  size_t len = lastIndex - firstIndex - 1;
436 
437  std::string defaultVal = defaultValue->substr(firstIndex + 1, len);
438  defaultValueLineEdit->setText(defaultVal.c_str());
439  }
440 
441  arrayDimensionLineEdit->setEnabled(false);
442 
443  // Set the array dimension
444  int dimension = 1;
445 
446  te::dt::Property* arrayElementProperty = oldArrayProperty->getElementType();
447  while(arrayElementProperty->getType() == te::dt::ARRAY_TYPE)
448  {
449  ++dimension;
450  arrayElementProperty = static_cast<te::dt::ArrayProperty*>(arrayElementProperty)->getElementType();
451  }
452 
453  arrayDimensionLineEdit->setText(QString().number(dimension));
454 
455  // Set the array element data type
456  if(arrayElementDataTypeComboBox->count() == 0)
457  {
458  for(int i = 0; i < dataTypeComboBox->count(); ++i)
459  {
460  QString typeItem = dataTypeComboBox->itemText(i);
461  if(typeItem != "ARRAY")
462  arrayElementDataTypeComboBox->addItem(typeItem);
463  }
464  }
465 
466  QString arrayElementDataType = m_propertyTypeMap[arrayElementProperty->getType()];
467  int index = arrayElementDataTypeComboBox->findText(arrayElementDataType);
468  arrayElementDataTypeComboBox->setCurrentIndex(index);
469 
470  // Set the array element parameters for the numeric and string types.
471  if(arrayElementDataTypeComboBox->currentText() == "NUMERIC")
472  {
473  te::dt::NumericProperty* numericProperty = static_cast<te::dt::NumericProperty*>(arrayElementProperty);
474 
475  // Set the precision
476  arrayElementPrecisionLineEdit->clear();
477  arrayElementPrecisionLineEdit->setText(QString().setNum(numericProperty->getPrecision()));
478 
479  // Set the scale
480  arrayElementScaleLineEdit->clear();
481  arrayElementScaleLineEdit->setText(QString().setNum(numericProperty->getScale()));
482  }
483  else if(arrayElementDataTypeComboBox->currentText() == "STRING")
484  {
485  te::dt::StringProperty* stringProperty = static_cast<te::dt::StringProperty*>(arrayElementProperty);
486 
487  if(arrayElementStringTypeComboBox->count() == 0)
488  {
489  arrayElementStringTypeComboBox->addItem("FIXED_STRING");
490  arrayElementStringTypeComboBox->addItem("VAR_STRING");
491  arrayElementStringTypeComboBox->addItem("STRING");
492  }
493 
494  te::dt::StringType stringType = stringProperty->getSubType();
495  arrayElementStringTypeComboBox->setCurrentIndex(stringType);
496 
497  arrayElementStringSizeLineEdit->clear();
498  arrayElementStringSizeLineEdit->setText(QString().setNum(stringProperty->size()));
499  }
500 }
501 
503 {
504  dataTypeStackedWidget->setCurrentWidget(compositePage);
505 
506  compositeNameLineEdit->clear();
507  te::dt::CompositeProperty* cp = static_cast<te::dt::CompositeProperty*>(m_oldProperty);
508  compositeNameLineEdit->setText(cp->getCompositeName().c_str());
509 }
510 
512 {
513  dataTypeStackedWidget->setCurrentWidget(dateTimePage);
514 
515  te::dt::DateTimeProperty* dtp = static_cast<te::dt::DateTimeProperty*>(m_oldProperty);
516 
517  if(dtp->isRequired() == true)
518  requiredCheckBox->setChecked(true);
519 
520  std::string* defaultValue = dtp->getDefaultValue();
521  if(defaultValue != 0)
522  defaultValueLineEdit->setText(defaultValue->c_str());
523 
524  // Fill the dateTimeTypeComboBox with the datetime types
525  if (dateTimeTypeComboBox->count() == 0)
526  {
527  dateTimeTypeComboBox->addItem("TIME_STAMP");
528  dateTimeTypeComboBox->addItem("TIME_STAMP_TZ");
529  dateTimeTypeComboBox->addItem("DATE");
530  dateTimeTypeComboBox->addItem("DATETIME");
531  dateTimeTypeComboBox->addItem("TIME");
532  dateTimeTypeComboBox->addItem("TIME_TZ");
533  }
534 
535  te::dt::DateTimeType dtType = dtp->getSubType();
536  dateTimeTypeComboBox->setCurrentIndex(dtType);
537 }
538 
540 {
541  dataTypeStackedWidget->setCurrentWidget(geometryPage);
542 
543  te::gm::GeometryProperty* gp = static_cast<te::gm::GeometryProperty*>(m_oldProperty);
544 
545  if(gp->isRequired() == true)
546  requiredCheckBox->setChecked(true);
547 
548  std::string* defaultValue = gp->getDefaultValue();
549  if(defaultValue != 0)
550  defaultValueLineEdit->setText(defaultValue->c_str());
551 
552  // Enable/Disable the widgets related to the geometry property
553  geometryTypeComboBox->setEnabled(false);
554  geometrySRIDLineEdit->setEnabled(false);
555  defaultGeometryCheckBox->setEnabled(false);
556 
557  geometryEnvelopeGroupBox->setEnabled(false);
558 
559  // Fill the geometryTypeComboBox with the geometry types
560  if (geometryTypeComboBox->count() == 0)
561  {
562  geometryTypeComboBox->addItem("GEOMETRY");
563  m_geomTypeTextMap[te::gm::GeometryType] = "GEOMETRY";
564  geometryTypeComboBox->addItem("GEOMETRYZ");
565  m_geomTypeTextMap[te::gm::GeometryZType] = "GEOMETRYZ";
566  geometryTypeComboBox->addItem("GEOMETRYM");
567  m_geomTypeTextMap[te::gm::GeometryMType] = "GEOMETRYM";
568  geometryTypeComboBox->addItem("GEOMETRYZM");
569  m_geomTypeTextMap[te::gm::GeometryZMType] = "GEOMETRYZM";
570  geometryTypeComboBox->addItem("POINT");
571  m_geomTypeTextMap[te::gm::PointType] = "POINT";
572  geometryTypeComboBox->addItem("POINTZ");
573  m_geomTypeTextMap[te::gm::PointZType] = "POINTZ";
574  geometryTypeComboBox->addItem("POINTM");
575  m_geomTypeTextMap[te::gm::PointMType] = "POINTM";
576  geometryTypeComboBox->addItem("POINTZM");
577  m_geomTypeTextMap[te::gm::PointZMType] = "POINTZM";
578  geometryTypeComboBox->addItem("LINESTRING");
579  m_geomTypeTextMap[te::gm::LineStringType] = "LINESTRING";
580  geometryTypeComboBox->addItem("LINESTRINGZ");
581  m_geomTypeTextMap[te::gm::LineStringZType] = "LINESTRINGZ";
582  geometryTypeComboBox->addItem("LINESTRINGM");
583  m_geomTypeTextMap[te::gm::LineStringMType] = "LINESTRINGM";
584  geometryTypeComboBox->addItem("LINESTRINGZM");
585  m_geomTypeTextMap[te::gm::LineStringZMType] = "LINESTRINGZM";
586  geometryTypeComboBox->addItem("POLYGON");
587  m_geomTypeTextMap[te::gm::PolygonType] = "POLYGON";
588  geometryTypeComboBox->addItem("POLYGONZ");
589  m_geomTypeTextMap[te::gm::PolygonZType] = "POLYGONZ";
590  geometryTypeComboBox->addItem("POLYGONM");
591  m_geomTypeTextMap[te::gm::PolygonMType] = "POLYGONM";
592  geometryTypeComboBox->addItem("POLYGONZM");
593  m_geomTypeTextMap[te::gm::PolygonZMType] = "POLYGONZM";
594  geometryTypeComboBox->addItem("GEOMETRYCOLLECTION");
595  m_geomTypeTextMap[te::gm::GeometryCollectionType] = "GEOMETRYCOLLECTION";
596  geometryTypeComboBox->addItem("GEOMETRYCOLLECTIONZ");
597  m_geomTypeTextMap[te::gm::GeometryCollectionZType] = "GEOMETRYCOLLECTIONZ";
598  geometryTypeComboBox->addItem("GEOMETRYCOLLECTIONM");
599  m_geomTypeTextMap[te::gm::GeometryCollectionMType] = "GEOMETRYCOLLECTIONM";
600  geometryTypeComboBox->addItem("GEOMETRYCOLLECTIONZM");
601  m_geomTypeTextMap[te::gm::GeometryCollectionZMType] = "GEOMETRYCOLLECTIONZM";
602  geometryTypeComboBox->addItem("MULTIPOINT");
603  m_geomTypeTextMap[te::gm::MultiPointType] = "MULTIPOINT";
604  geometryTypeComboBox->addItem("MULTIPOINTZ");
605  m_geomTypeTextMap[te::gm::MultiPointZType] = "MULTIPOINTZ";
606  geometryTypeComboBox->addItem("MULTIPOINTM");
607  m_geomTypeTextMap[te::gm::MultiPointMType] = "MULTIPOINTM";
608  geometryTypeComboBox->addItem("MULTIPOINTZM");
609  m_geomTypeTextMap[te::gm::MultiPointZMType] = "MULTIPOINTZM";
610  geometryTypeComboBox->addItem("MULTILINESTRING");
611  m_geomTypeTextMap[te::gm::MultiLineStringType] = "MULTILINESTRING";
612  geometryTypeComboBox->addItem("MULTILINESTRINGZ");
613  m_geomTypeTextMap[te::gm::MultiLineStringZType] = "MULTILINESTRINGZ";
614  geometryTypeComboBox->addItem("MULTILINESTRINGM");
615  m_geomTypeTextMap[te::gm::MultiLineStringMType] = "MULTILINESTRINGM";
616  geometryTypeComboBox->addItem("MULTILINESTRINGZM");
617  m_geomTypeTextMap[te::gm::MultiLineStringZMType] = "MULTILINESTRINGZM";
618  geometryTypeComboBox->addItem("MULTIPOLYGON");
619  m_geomTypeTextMap[te::gm::MultiPolygonType] = "MULTIPOLYGON";
620  geometryTypeComboBox->addItem("MULTIPOLYGONZ");
621  m_geomTypeTextMap[te::gm::MultiPolygonZType] = "MULTIPOLYGONZ";
622  geometryTypeComboBox->addItem("MULTIPOLYGONM");
623  m_geomTypeTextMap[te::gm::MultiPolygonMType] = "MULTIPOLYGONM";
624  geometryTypeComboBox->addItem("MULTIPOLYGONZM");
625  m_geomTypeTextMap[te::gm::MultiPolygonZMType] = "MULTIPOLYGONZM";
626 
627  geometryTypeComboBox->addItem("UNKNOWNGEOMETRY");
628  m_geomTypeTextMap[te::gm::UnknownGeometryType] = "UNKNOWNGEOMETRY";
629  }
630 
631  // Set the geometry type
632  te::gm::GeomType geomType = gp->getGeometryType();
633  int pos = geometryTypeComboBox->findText(m_geomTypeTextMap[geomType]);
634  geometryTypeComboBox->setCurrentIndex(pos);
635 
636  // Set the srid
637  geometrySRIDLineEdit->setText(QString().setNum(gp->getSRID()));
638 
639  // Set the defaultGeometryCheckBox, if this geometry property is the default
640  std::auto_ptr<te::da::DataSetType> dt = m_ds->getDataSetType(dataSetComboBox->currentText().toStdString());
641  te::gm::GeometryProperty* defaultGeomProperty = te::da::GetFirstGeomProperty(dt.get());
642 
643  if(gp == defaultGeomProperty)
644  defaultGeometryCheckBox->setChecked(true);
645  else
646  defaultGeometryCheckBox->setChecked(false);
647 
648  // Set the envelope
649  std::auto_ptr<te::da::DataSet> dataSet = m_ds->getDataSet(dataSetComboBox->currentText().toStdString());
650 
651  std::size_t gpos = te::da::GetFirstPropertyPos(dataSet.get(), te::dt::GEOMETRY_TYPE);
652 
653  std::auto_ptr<te::gm::Envelope> e = dataSet->getExtent(gpos);
654  if(e.get())
655  {
656  geometryLLXLineEdit->setText(QString().setNum(e->getLowerLeftX(), 'g', 15));
657  geometryLLYLineEdit->setText(QString().setNum(e->getLowerLeftY(), 'g', 15));
658  geometryURXLineEdit->setText(QString().setNum(e->getUpperRightX(), 'g', 15));
659  geometryURYLineEdit->setText(QString().setNum(e->getUpperRightY(), 'g', 15));
660  }
661 }
662 
664 {
665  dataTypeStackedWidget->setCurrentWidget(numericPage);
666 
667  te::dt::NumericProperty* np = static_cast<te::dt::NumericProperty*>(m_oldProperty);
668 
669  if(np->isRequired())
670  requiredCheckBox->setChecked(true);
671 
672  std::string* defaultValue = np->getDefaultValue();
673  if(defaultValue != 0)
674  defaultValueLineEdit->setText(defaultValue->c_str());
675 
676  precisionLineEdit->setEnabled(false);
677  scaleLineEdit->setEnabled(false);
678 
679  // Set the precision
680  precisionLineEdit->clear();
681  precisionLineEdit->setText(QString().setNum(np->getPrecision()));
682 
683  // Set the scale
684  scaleLineEdit->clear();
685  scaleLineEdit->setText(QString().setNum(np->getScale()));
686 }
687 
689 {
690  dataTypeStackedWidget->setCurrentWidget(rasterPage);
691 
692  te::rst::RasterProperty* rp = static_cast<te::rst::RasterProperty*>(m_oldProperty);
693 
694  if(rp->isRequired())
695  requiredCheckBox->setChecked(true);
696 
697  std::string* defaultValue = rp->getDefaultValue();
698  if(defaultValue != 0)
699  defaultValueLineEdit->setText(defaultValue->c_str());
700 
701  //Set the SRID
702  rasterSRIDLineEdit->setText(QString().setNum(rp->getGrid()->getSRID()));
703 
704  // Set the number of bands
705  nBandsLineEdit->setText(QString().setNum(rp->getBandProperties().size()));
706 
707  // Set the number of columns
708  nColsLineEdit->setText(QString().setNum(rp->getGrid()->getNumberOfColumns()));
709 
710  // Set the number of lines
711  nLinesLineEdit->setText(QString().setNum(rp->getGrid()->getNumberOfRows()));
712 
713  // Set the X resolution
714  resxLineEdit->setText(QString().setNum(rp->getGrid()->getResolutionX()));
715 
716  // Set the Y resolution
717  resyLineEdit->setText(QString().setNum(rp->getGrid()->getResolutionY()));
718 
719  // Set the envelope
720  const te::gm::Envelope* e = rp->getGrid()->getExtent();
721 
722  if(e != 0)
723  {
724  rasterLLXLineEdit->setText(QString().setNum(e->getLowerLeftX()));
725  rasterLLYLineEdit->setText(QString().setNum(e->getLowerLeftY()));
726  rasterURXLineEdit->setText(QString().setNum(e->getUpperRightX()));
727  rasterURYLineEdit->setText(QString().setNum(e->getUpperRightY()));
728  }
729 }
730 
732 {
733  dataTypeStackedWidget->setCurrentWidget(stringPage);
734 
735  te::dt::StringProperty* sp = static_cast<te::dt::StringProperty*>(m_oldProperty);
736 
737  if(sp->isRequired())
738  requiredCheckBox->setChecked(true);
739 
740  std::string* defaultValue = sp->getDefaultValue();
741  if(defaultValue)
742  defaultValueLineEdit->setText(defaultValue->c_str());
743 
744  stringTypeComboBox->setEnabled(false);
745  stringSizeLineEdit->setEnabled(false);
746 
747  // Fill the stringTypeComboBox with the string types
748  if (stringTypeComboBox->count() == 0)
749  {
750  stringTypeComboBox->addItem("FIXED_STRING");
751  stringTypeComboBox->addItem("VAR_STRING");
752  stringTypeComboBox->addItem("STRING");
753  }
754 
755  // Set the StringProperty size
756  stringSizeLineEdit->setText(QString().setNum(sp->size()));
757 
758  // Set the StringProperty subtype
759  te::dt::StringType stringType = sp->getSubType();
760  stringTypeComboBox->setCurrentIndex(stringType);
761 }
762 
764 {
765  if(dataType == "ARRAY")
766  return buildUpdatedArrayProperty();
767  else if(dataType == "BIT")
768  return buildUpdatedBitProperty();
769  else if(dataType == "BOOLEAN")
770  return buildUpdatedBooleanProperty();
771  else if(dataType == "CHAR")
772  return buildUpdatedCharProperty();
773  else if(dataType == "COMPOSITE")
774  return buildUpdatedCompositeProperty();
775  else if(dataType == "DATETIME")
776  return buildUpdatedDateTimeProperty();
777  else if(dataType == "DOUBLE")
778  return buildUpdatedDoubleProperty();
779  else if(dataType == "FLOAT")
780  return buildUpdatedFloatProperty();
781  else if(dataType == "GEOMETRY")
782  return buildUpdatedGeometryProperty();
783  else if(dataType == "INT16")
784  return buildUpdatedInt16Property();
785  else if(dataType == "INT32")
786  return buildUpdatedInt32Property();
787  else if(dataType == "INT64")
788  return buildUpdatedInt64Property();
789  else if(dataType == "NUMERIC")
790  return buildUpdatedNumericProperty();
791  else if(dataType == "RASTER")
792  return buildUpdatedRasterProperty();
793  else if(dataType == "STRING")
794  return buildUpdatedStringProperty();
795  else if(dataType == "UCHAR")
796  return buildUpdatedUcharProperty();
797  else if(dataType == "UINT16")
798  return buildUpdatedUint16Property();
799  else if(dataType == "UINT32")
800  return buildUpdatedUint32Property();
801  else if(dataType == "UINT64")
802  return buildUpdatedUint64Property();
803  else if(dataType == "UNKNOWN")
804  return buildUpdatedUnknownProperty();
805  else if(dataType == "VOID")
806  return buildUpdatedVoidProperty();
807 
808  return 0;
809 }
810 
812 {
813  // Get the dimension
814  unsigned int dimension = arrayDimensionLineEdit->text().toUInt();
815 
816  // Build the array element property
817  te::dt::SimpleProperty* arrayElementProperty;
818 
819  QString arrayElementDataType = arrayElementDataTypeComboBox->currentText();
820 
821  std::string tempPropertyName = m_propertyName;
822  m_propertyName = std::string();
823 
824  std::string* tempDefaultValue = m_defaultValue;
825  m_defaultValue = 0;
826 
827  arrayElementProperty = static_cast<te::dt::SimpleProperty*>(buildUpdatedProperty(arrayElementDataType));
828  arrayElementProperty->setAutoNumber(false);
829  arrayElementProperty->setRequired(false);
830 
831  m_propertyName = tempPropertyName;
832  m_defaultValue = tempDefaultValue;
833 
834  if(dimension != 1)
835  {
836  te::dt::SimpleProperty* simpleP = arrayElementProperty;
837 
838  arrayElementProperty = 0;
839 
840  for(unsigned int i = 0; i < dimension - 2; ++i)
841  arrayElementProperty = new te::dt::ArrayProperty(std::string(), arrayElementProperty);
842 
843  arrayElementProperty = new te::dt::ArrayProperty(std::string(), simpleP);
844  }
845 
846  return new te::dt::ArrayProperty(m_propertyName, arrayElementProperty,
847  requiredCheckBox->isChecked(), m_defaultValue);
848 }
849 
850 
852 {
853  if(m_defaultValue != 0)
854  {
855  for(size_t i = 0; i < m_defaultValue->size(); ++i)
856  {
857  if(m_defaultValue->operator[](i) == '0' || m_defaultValue->operator[](i) == '1')
858  {
859  QMessageBox::warning(this, tr("Default Value Error"),
860  tr("The default value contents for the BIT property can only contains 0's or 1's!"));
861  return 0;
862  }
863  }
864  }
865 
866  return new te::dt::SimpleProperty(m_propertyName, te::dt::BIT_TYPE,
867  requiredCheckBox->isChecked(), m_defaultValue);
868 }
869 
871 {
872  if(m_defaultValue != 0)
873  {
874  QString qs = defaultValueLineEdit->text().toUpper();
875 
876  if(qs != "TRUE" && qs != "FALSE")
877  {
878  QMessageBox::warning(this, tr("Default Value Error"),
879  tr("The default value for the BOOLEAN property can only be: true, TRUE, false, or FALSE"));
880  return 0;
881  }
882  }
883 
884  return new te::dt::SimpleProperty(m_propertyName, te::dt::BOOLEAN_TYPE,
885  requiredCheckBox->isChecked(), m_defaultValue);
886 }
887 
889 {
890  return new te::dt::SimpleProperty(m_propertyName, te::dt::BYTE_ARRAY_TYPE,
891  requiredCheckBox->isChecked(), m_defaultValue);
892 }
893 
895 {
896  if(m_defaultValue != 0)
897  {
898  bool ok;
899  int val = defaultValueLineEdit->text().toInt(&ok);
900 
901  if(ok == false || val <-128 || val > 127)
902  {
903  QMessageBox::warning(this, tr("Default Value Error"),
904  tr("The default value must be a char value >= -128 and <= 127!"));
905  return 0;
906  }
907  }
908 
909  return new te::dt::SimpleProperty(m_propertyName, te::dt::CHAR_TYPE,
910  requiredCheckBox->isChecked(), m_defaultValue);
911 }
912 
914 {
915  std::string cname = std::string();
916 
917  if(compositeNameLineEdit->text().isEmpty() == false)
918  cname = compositeNameLineEdit->text().toStdString();
919 
920  return new te::dt::CompositeProperty(cname, m_propertyName);
921 }
922 
924 {
925  // Get the DateTime type
926  te::dt::DateTimeType dateTimeType =
927  static_cast<te::dt::DateTimeType>(dateTimeTypeComboBox->currentIndex());
928 
929  // Build the DateTime property
930  return new te::dt::DateTimeProperty(m_propertyName,
931  dateTimeType, te::dt::SECOND, requiredCheckBox->isChecked(), m_defaultValue);
932 }
933 
935 {
936  if(m_defaultValue != 0)
937  {
938  bool ok;
939 
940  defaultValueLineEdit->text().toDouble(&ok);
941  if(ok == false)
942  {
943  QMessageBox::warning(this, tr("Default Value Error"),
944  tr("The default value must be a double number!"));
945  return 0;
946  }
947  }
948 
949  return new te::dt::SimpleProperty(m_propertyName, te::dt::DOUBLE_TYPE,
950  requiredCheckBox->isChecked(), m_defaultValue);
951 }
952 
954 {
955  if(m_defaultValue != 0)
956  {
957  bool ok;
958 
959  defaultValueLineEdit->text().toFloat(&ok);
960  if(ok == false)
961  {
962  QMessageBox::warning(this, tr("Default Value Error"),
963  tr("The default value must be a float number!"));
964  return 0;
965  }
966  }
967 
968  return new te::dt::SimpleProperty(m_propertyName, te::dt::FLOAT_TYPE,
969  requiredCheckBox->isChecked(), m_defaultValue);
970 }
971 
973 {
974  // Get the geometry subtype
975  std::string gTypeStr = geometryTypeComboBox->currentText().toStdString();
977 
978  // Get the srid
979  int srid = geometrySRIDLineEdit->text().toInt();
980 
981  return new te::gm::GeometryProperty(m_propertyName,
982  srid, gType, false, 0);
983 }
984 
986 {
987  if(m_defaultValue != 0)
988  {
989  bool ok;
990 
991  defaultValueLineEdit->text().toShort(&ok);
992  if(ok == false)
993  {
994  QMessageBox::warning(this, tr("Default Value Error"),
995  tr("The default value must be a short value!"));
996  return 0;
997  }
998  }
999 
1000  return new te::dt::SimpleProperty(m_propertyName, te::dt::INT16_TYPE,
1001  requiredCheckBox->isChecked(), m_defaultValue);
1002 }
1003 
1005 {
1006  if(m_defaultValue != 0 && autoNumberCheckBox->isChecked() == false)
1007  {
1008  bool ok;
1009 
1010  defaultValueLineEdit->text().toInt(&ok);
1011  if(ok == false)
1012  {
1013  QMessageBox::warning(this, tr("Default Value Error"),
1014  tr("The default value must be an integer value!"));
1015  return 0;
1016  }
1017  }
1018 
1020  requiredCheckBox->isChecked(), m_defaultValue);
1021 
1022  p->setAutoNumber(autoNumberCheckBox->isChecked());
1023 
1024  return p;
1025 }
1026 
1028 {
1029  if(m_defaultValue != 0 && autoNumberCheckBox->isChecked() == false)
1030  {
1031  bool ok;
1032 
1033  defaultValueLineEdit->text().toLongLong(&ok);
1034  if(ok == false)
1035  {
1036  QMessageBox::warning(this, tr("Default Value Error"),
1037  tr("The default value must be a long long value!"));
1038  return 0;
1039  }
1040  }
1041 
1042  return new te::dt::SimpleProperty(m_propertyName, te::dt::INT64_TYPE,
1043  requiredCheckBox->isChecked(), m_defaultValue);
1044 }
1045 
1047 {
1048  bool ok = false;
1049 
1050  // Check the default value
1051  if(dataTypeComboBox->currentText() == "NUMERIC")
1052  {
1053  if(m_defaultValue != 0)
1054  {
1055  defaultValueLineEdit->text().toDouble(&ok);
1056  if(ok == false)
1057  {
1058  QMessageBox::warning(this, tr("Default Value Error"),
1059  tr("The default value must be a numeric value!"));
1060  return 0;
1061  }
1062  }
1063  }
1064 
1065  // Get the precision value
1066  unsigned int precision = 0;
1067 
1068  if(dataTypeComboBox->currentText() == "NUMERIC")
1069  {
1070  if(precisionLineEdit->text().isEmpty() == false)
1071  precision = precisionLineEdit->text().toUInt(&ok);
1072  }
1073  else
1074  {
1075  if(arrayElementPrecisionLineEdit->text().isEmpty() == false)
1076  precision = arrayElementPrecisionLineEdit->text().toUInt(&ok);
1077  }
1078 
1079  if(ok == false)
1080  {
1081  QMessageBox::warning(this, tr("Invalid Value"),
1082  tr("The precision must be an unsigned int value!"));
1083  return 0;
1084  }
1085 
1086  // Get the scale value
1087  unsigned int scale = 0;
1088 
1089  if(dataTypeComboBox->currentText() == "NUMERIC")
1090  {
1091  if(scaleLineEdit->text().isEmpty() == false)
1092  scale = scaleLineEdit->text().toUInt(&ok);
1093  }
1094  else
1095  {
1096  if(arrayElementScaleLineEdit->text().isEmpty() == false)
1097  scale = arrayElementScaleLineEdit->text().toUInt(&ok);
1098  }
1099 
1100  if(ok == false)
1101  {
1102  QMessageBox::warning(this, tr("Invalid Value"),
1103  tr("The scale must be an unsigned int value!"));
1104  return 0;
1105  }
1106 
1107  return new te::dt::NumericProperty(m_propertyName,
1108  precision, scale, requiredCheckBox->isChecked(), m_defaultValue);
1109 }
1110 
1112 {
1113  return 0;
1114 }
1115 
1117 {
1118  // Get the string type and the string size
1119  te::dt::StringType stringType;
1120  size_t stringSize = 0;
1121  bool ok = false;
1122 
1123  if(dataTypeComboBox->currentText() == "STRING")
1124  {
1125  stringType = static_cast<te::dt::StringType>(stringTypeComboBox->currentIndex());
1126 
1127  if(stringSizeLineEdit->text().isEmpty() == false)
1128  stringSize = stringSizeLineEdit->text().toUInt(&ok);
1129  }
1130  else
1131  {
1132  stringType = static_cast<te::dt::StringType>(arrayElementStringTypeComboBox->currentIndex());
1133 
1134  if(arrayElementStringSizeLineEdit->text().isEmpty() == false)
1135  stringSize = arrayElementStringSizeLineEdit->text().toUInt(&ok);
1136  }
1137 
1138  if(ok == false)
1139  {
1140  QMessageBox::warning(this, tr("Invalid Value"),
1141  tr("The string size must be an unsigned int value!"));
1142  return 0;
1143  }
1144 
1145  te::dt::Property* stringProperty = new te::dt::StringProperty(m_propertyName,
1146  stringType, stringSize, requiredCheckBox->isChecked(), m_defaultValue);
1147 
1148  return stringProperty;
1149 }
1150 
1152 {
1153  if(m_defaultValue != 0)
1154  {
1155  bool ok;
1156 
1157  unsigned int val = defaultValueLineEdit->text().toUShort(&ok);
1158  if(ok == false || val > 255)
1159  {
1160  QMessageBox::warning(this, tr("Default Value Error"),
1161  tr("The default value must be an unsigned char value!"));
1162  return 0;
1163  }
1164  }
1165 
1166  return new te::dt::SimpleProperty(m_propertyName, te::dt::UCHAR_TYPE,
1167  requiredCheckBox->isChecked(), m_defaultValue);
1168 }
1169 
1171 {
1172  if(m_defaultValue != 0)
1173  {
1174  bool ok;
1175 
1176  defaultValueLineEdit->text().toUShort(&ok);
1177  if(ok == false)
1178  {
1179  QMessageBox::warning(this, tr("Default Value Error"),
1180  tr("The default value must be an unsigned short value!"));
1181  return 0;
1182  }
1183  }
1184 
1185  return new te::dt::SimpleProperty(m_propertyName, te::dt::UINT32_TYPE,
1186  requiredCheckBox->isChecked(), m_defaultValue);
1187 }
1188 
1190 {
1191  if(m_defaultValue != 0)
1192  {
1193  bool ok;
1194 
1195  defaultValueLineEdit->text().toUInt(&ok);
1196  if(ok == false)
1197  {
1198  QMessageBox::warning(this, tr("Default Value Error"),
1199  tr("The default value must be an unsigned integer value!"));
1200  return 0;
1201  }
1202  }
1203 
1204  return new te::dt::SimpleProperty(m_propertyName, te::dt::UINT32_TYPE,
1205  requiredCheckBox->isChecked(), m_defaultValue);
1206 }
1207 
1209 {
1210  if(m_defaultValue != 0)
1211  {
1212  bool ok;
1213 
1214  defaultValueLineEdit->text().toULongLong(&ok);
1215  if(ok == false)
1216  {
1217  QMessageBox::warning(this, tr("Default Value Error"),
1218  tr("The default value must be an unsigned long long value!"));
1219  return 0;
1220  }
1221  }
1222 
1223  return new te::dt::SimpleProperty(m_propertyName, te::dt::UINT64_TYPE,
1224  requiredCheckBox->isChecked(), m_defaultValue);
1225 }
1226 
1228 {
1229  return new te::dt::SimpleProperty(m_propertyName, te::dt::UNKNOWN_TYPE,
1230  false, 0);
1231 }
1232 
1234 {
1235  return new te::dt::SimpleProperty(m_propertyName, te::dt::VOID_TYPE,
1236  false, 0);
1237 }
1238 
1240 {
1241 }
void dataTypeComboBoxChanged(const QString &dataType)
std::vector< te::rst::BandProperty * > & getBandProperties()
Returns a reference to the list of bands definitions.
void arrayElementDataTypeComboBoxChanged(const QString &arrayElementDataType)
te::dt::Property * buildUpdatedBooleanProperty()
UpdateProperty(te::da::DataSource *ds, QWidget *parent=0)
void setRequired(bool r)
It tells if the property is required or not.
bool isRequired() const
It returns true if the attribute is required, otherwise it returns false.
te::da::DataTypeCapabilities dataTypeCapabilities
The type for variable-length multidimensional arrays.
Definition: ArrayProperty.h:45
te::dt::Property * buildUpdatedGeometryProperty()
te::dt::Property * buildUpdatedInt32Property()
An atomic property like an integer or double.
virtual std::vector< std::string > getDataSetNames()
It gets the dataset names available in the data source.
Definition: DataSource.cpp:143
te::dt::Property * buildUpdatedBitProperty()
TEDATAACCESSEXPORT te::gm::GeometryProperty * GetFirstGeomProperty(const DataSetType *dt)
Definition: Utils.cpp:504
virtual const DataSourceCapabilities & getCapabilities() const =0
It returns the known capabilities of the data source.
te::dt::Property * buildUpdatedInt64Property()
void requiredCheckBoxClicked(bool checked)
The type for date and time types: date, date period, date duration, time duration, time instant, time period, time instant with time zone or time period with time zone.
StringType getSubType() const
It returns the string property sub type.
int getSRID() const
It returns the spatial reference system identifier associated to this property.
The type for string types: FIXED_STRING, VAR_STRING or STRING.
const double & getLowerLeftY() const
It returns a constant refernce to the y coordinate of the lower left corner.
Definition: Envelope.h:400
DateTimeType getSubType() const
It returns the date time property sub type.
te::dt::Property * buildUpdatedFloatProperty()
void dataSetComboBoxChanged(const QString &dataSet)
double getResolutionY() const
Returns the grid vertical (y-axis) resolution.
Definition: Grid.cpp:261
A class that represents the known capabilities of a specific data source, i.e. this class informs all...
void propertiesComboBoxActivated(const QString &p)
te::dt::Property * buildUpdatedDateTimeProperty()
te::dt::Property * buildUpdatedStringProperty()
unsigned int getNumberOfRows() const
Returns the grid number of rows.
Definition: Grid.cpp:215
const double & getLowerLeftX() const
It returns a constant reference to the x coordinate of the lower left corner.
Definition: Envelope.h:390
Property * getElementType() const
It returns the type of array elements.
Definition: ArrayProperty.h:98
GeomType getGeometryType() const
It returns the geometry subtype allowed for the property.
te::dt::Property * buildUpdatedUint32Property()
te::dt::Property * buildUpdatedRasterProperty()
std::map< int, QString > m_propertyTypeMap
te::gm::Envelope * getExtent()
Returns the geographic extension of the grid.
Definition: Grid.cpp:276
te::dt::Property * buildUpdatedCompositeProperty()
void setAutoNumber(bool a)
It tells if the property is an autonumber or not.
te::dt::Property * buildUpdatedVoidProperty()
te::rst::Grid * getGrid()
Returns the definition of the raster grid support.
double getResolutionX() const
Returns the grid horizontal (x-axis) resolution.
Definition: Grid.cpp:256
TEDATAACCESSEXPORT std::size_t GetFirstPropertyPos(const te::da::DataSet *dataset, int datatype)
Definition: Utils.cpp:428
GeomType
Each enumerated type is compatible with a Well-known Binary (WKB) type code.
Definition: Enums.h:41
te::dt::Property * buildUpdatedUint16Property()
std::string * getDefaultValue() const
It returns the default value associated to the property, or NULL if none is associated.
GeomType getGeomTypeId() const
It returns the geometry subclass type identifier.
Definition: Geometry.h:178
te::dt::Property * buildUpdatedUint64Property()
te::dt::Property * buildUpdatedUcharProperty()
te::dt::Property * buildUpdatedByteArrayProperty()
std::size_t size() const
It returns the maximum number of characters for a varying string, or the number of characters for a f...
unsigned int getPrecision() const
It returns the total count of significant digits in the whole number, that is, the number of digits t...
const DataTypeCapabilities & getDataTypeCapabilities() const
DateTimeType
The subtype of date and time type.
Definition: Enums.h:38
An abstract class for data providers like a DBMS, Web Services or a regular file. ...
Definition: DataSource.h:116
It updates a property of a data set.
StringType
The subtype of string property.
Definition: Enums.h:107
te::dt::Property * buildUpdatedNumericProperty()
const std::string & getCompositeName() const
It returns the name of the composite type.
Raster property.
It models a property definition.
Definition: Property.h:59
const double & getUpperRightX() const
It returns a constant refernce to the x coordinate of the upper right corner.
Definition: Envelope.h:410
te::dt::Property * buildUpdatedDoubleProperty()
A base class for a compound property (non-atomic properties).
unsigned int getNumberOfColumns() const
Returns the grid number of columns.
Definition: Grid.cpp:205
int getSRID() const
Returns the grid spatial reference system identifier.
Definition: Grid.cpp:266
The type for arbitrary precison numbers, like numeric(p, q).
int getType() const
It returns the property data type.
Definition: Property.h:143
const double & getUpperRightY() const
It returns a constant refernce to the x coordinate of the upper right corner.
Definition: Envelope.h:420
te::dt::Property * buildUpdatedUnknownProperty()
unsigned int getScale() const
It returns the count of decimal digits in the fractional part, to the right of the decimal point...
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51
A class that represents the supported data types of a specific data source.
Geometric property.
te::dt::Property * buildUpdatedProperty(const QString &dataType)
te::da::DataSourceCapabilities capabilities
te::dt::Property * buildUpdatedArrayProperty()
bool isAutoNumber() const
It returns true if the attribute is an autonumber, otherwise it returns false.
te::dt::Property * buildUpdatedCharProperty()
te::dt::Property * buildUpdatedInt16Property()