21 #include <QtGui/QtGui>
22 #include <QtGui/QComboBox>
23 #include <QtGui/QMessageBox>
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"
45 QMessageBox::critical(
this, tr(
"Missing a Valid Data Source"), tr(
"Provide a valid data source!"));
49 layout()->setSizeConstraint(QLayout::SetFixedSize);
55 QStringList dataSetList;
57 size_t numDataSets = datasetNames.size();
58 for (
size_t i = 0; i < numDataSets; ++i)
59 dataSetList << (datasetNames[i]).c_str();
62 dataSetComboBox->addItems(dataSetList);
71 dataTypeComboBox->addItem(
"ARRAY");
77 dataTypeComboBox->addItem(
"BIT");
83 dataTypeComboBox->addItem(
"BOOLEAN");
89 dataTypeComboBox->addItem(
"BYTE_ARRAY");
95 dataTypeComboBox->addItem(
"CHAR");
101 dataTypeComboBox->addItem(
"COMPOSITE");
107 dataTypeComboBox->addItem(
"DATASET");
113 dataTypeComboBox->addItem(
"DATETIME");
119 dataTypeComboBox->addItem(
"DOUBLE");
125 dataTypeComboBox->addItem(
"FLOAT");
131 dataTypeComboBox->addItem(
"GEOMETRY");
137 dataTypeComboBox->addItem(
"INT16");
143 dataTypeComboBox->addItem(
"INT32");
149 dataTypeComboBox->addItem(
"INT64");
155 dataTypeComboBox->addItem(
"NUMERIC");
161 dataTypeComboBox->addItem(
"RASTER");
167 dataTypeComboBox->addItem(
"STRING");
173 dataTypeComboBox->addItem(
"UCHAR");
179 dataTypeComboBox->addItem(
"UINT16");
185 dataTypeComboBox->addItem(
"UINT32");
191 dataTypeComboBox->addItem(
"UINT64");
196 connect(dataSetComboBox, SIGNAL(currentIndexChanged(
const QString&)),
this, SLOT(
dataSetComboBoxChanged(
const QString&)));
198 connect(dataTypeComboBox, SIGNAL(currentIndexChanged(
const QString&)),
this, SLOT(
dataTypeComboBoxChanged(
const QString&)));
214 propertiesComboBox->clear();
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());
220 propertiesComboBoxActivated(pNames[0].c_str());
226 m_oldProperty = m_ds->getProperty(dataSetComboBox->currentText().toStdString(), propertyName.toStdString()).
get();
229 int oldPropertyType = m_oldProperty->getType();
231 int pos = dataTypeComboBox->findText(m_propertyTypeMap[oldPropertyType]);
232 dataTypeComboBox->setCurrentIndex(pos);
235 propertyNameLineEdit->clear();
236 propertyNameLineEdit->setText(m_oldProperty->getName().c_str());
239 autoNumberCheckBox->setEnabled(
false);
240 autoNumberCheckBox->setChecked(
false);
243 requiredCheckBox->setEnabled(
true);
244 requiredCheckBox->setChecked(
false);
247 defaultValueLineEdit->clear();
248 defaultValueLineEdit->setEnabled(
true);
251 dataTypeStackedWidget->setVisible(
true);
254 QString dataType = dataTypeComboBox->currentText();
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();
276 if(dataType ==
"INT32" || dataType ==
"INT64")
280 autoNumberCheckBox->setChecked(
true);
281 requiredCheckBox->setChecked(
true);
282 requiredCheckBox->setEnabled(
false);
283 defaultValueLineEdit->setText(defaultValue->c_str());
284 defaultValueLineEdit->setEnabled(
false);
289 requiredCheckBox->setChecked(
true);
292 defaultValueLineEdit->setText(defaultValue->c_str());
294 dataTypeStackedWidget->setVisible(
false);
300 dataTypeStackedWidget->setVisible(
false);
302 precisionLineEdit->setEnabled(
true);
303 scaleLineEdit->setEnabled(
true);
304 stringTypeComboBox->setEnabled(
false);
305 stringSizeLineEdit->setEnabled(
false);
307 if(dataType ==
"NUMERIC")
309 dataTypeStackedWidget->setVisible(
true);
310 dataTypeStackedWidget->setCurrentWidget(numericPage);
314 precisionLineEdit->setEnabled(
false);
315 scaleLineEdit->setEnabled(
false);
318 else if(dataType ==
"STRING")
320 dataTypeStackedWidget->setVisible(
true);
321 dataTypeStackedWidget->setCurrentWidget(stringPage);
325 stringTypeComboBox->setEnabled(
false);
326 stringSizeLineEdit->setEnabled(
false);
333 defaultValueLineEdit->clear();
335 defaultValueLineEdit->setEnabled(
true);
337 defaultValueLineEdit->setEnabled(
false);
342 arrayElementStackedWidget->setVisible(
false);
344 arrayElementPrecisionLineEdit->setEnabled(
true);
345 arrayElementScaleLineEdit->setEnabled(
true);
346 arrayElementStringTypeComboBox->setEnabled(
false);
347 arrayElementStringSizeLineEdit->setEnabled(
false);
354 oldArrayElementProperty = static_cast<te::dt::ArrayProperty*>(oldArrayElementProperty)->getElementType();
356 int oldArrayElementDataType = oldArrayElementProperty->
getType();
358 if(arrayElementDataType ==
"NUMERIC")
360 arrayElementStackedWidget->setVisible(
true);
361 arrayElementStackedWidget->setCurrentWidget(arrayElementNumericPage);
365 arrayElementPrecisionLineEdit->setEnabled(
false);
366 arrayElementScaleLineEdit->setEnabled(
false);
369 else if(arrayElementDataType ==
"STRING")
371 arrayElementStackedWidget->setVisible(
true);
372 arrayElementStackedWidget->setCurrentWidget(arrayElementStringPage);
376 arrayElementStringTypeComboBox->setEnabled(
false);
377 arrayElementStringSizeLineEdit->setEnabled(
false);
385 if(propertyNameLineEdit->text().isEmpty())
387 QMessageBox::information(
this, tr(
"Missing the Property Name"),
388 tr(
"Set the name of the property to be added!"));
392 m_propertyName = propertyNameLineEdit->text().toStdString();
395 if(defaultValueLineEdit->text().isEmpty())
398 m_defaultValue =
new std::string(defaultValueLineEdit->text().toStdString());
401 QString dataType = dataTypeComboBox->currentText();
403 m_updatedProperty = buildUpdatedProperty(dataType);
405 if(m_updatedProperty == 0)
422 dataTypeStackedWidget->setCurrentWidget(arrayPage);
427 requiredCheckBox->setChecked(
true);
430 if(defaultValue != 0)
432 size_t firstIndex = defaultValue->find(
"'");
433 size_t lastIndex = defaultValue->rfind(
"'");
435 size_t len = lastIndex - firstIndex - 1;
437 std::string defaultVal = defaultValue->substr(firstIndex + 1, len);
438 defaultValueLineEdit->setText(defaultVal.c_str());
441 arrayDimensionLineEdit->setEnabled(
false);
453 arrayDimensionLineEdit->setText(QString().number(dimension));
456 if(arrayElementDataTypeComboBox->count() == 0)
458 for(
int i = 0; i < dataTypeComboBox->count(); ++i)
460 QString typeItem = dataTypeComboBox->itemText(i);
461 if(typeItem !=
"ARRAY")
462 arrayElementDataTypeComboBox->addItem(typeItem);
466 QString arrayElementDataType = m_propertyTypeMap[arrayElementProperty->
getType()];
467 int index = arrayElementDataTypeComboBox->findText(arrayElementDataType);
468 arrayElementDataTypeComboBox->setCurrentIndex(index);
471 if(arrayElementDataTypeComboBox->currentText() ==
"NUMERIC")
476 arrayElementPrecisionLineEdit->clear();
477 arrayElementPrecisionLineEdit->setText(QString().setNum(numericProperty->
getPrecision()));
480 arrayElementScaleLineEdit->clear();
481 arrayElementScaleLineEdit->setText(QString().setNum(numericProperty->
getScale()));
483 else if(arrayElementDataTypeComboBox->currentText() ==
"STRING")
487 if(arrayElementStringTypeComboBox->count() == 0)
489 arrayElementStringTypeComboBox->addItem(
"FIXED_STRING");
490 arrayElementStringTypeComboBox->addItem(
"VAR_STRING");
491 arrayElementStringTypeComboBox->addItem(
"STRING");
495 arrayElementStringTypeComboBox->setCurrentIndex(stringType);
497 arrayElementStringSizeLineEdit->clear();
498 arrayElementStringSizeLineEdit->setText(QString().setNum(stringProperty->
size()));
504 dataTypeStackedWidget->setCurrentWidget(compositePage);
506 compositeNameLineEdit->clear();
513 dataTypeStackedWidget->setCurrentWidget(dateTimePage);
518 requiredCheckBox->setChecked(
true);
521 if(defaultValue != 0)
522 defaultValueLineEdit->setText(defaultValue->c_str());
525 if (dateTimeTypeComboBox->count() == 0)
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");
536 dateTimeTypeComboBox->setCurrentIndex(dtType);
541 dataTypeStackedWidget->setCurrentWidget(geometryPage);
546 requiredCheckBox->setChecked(
true);
549 if(defaultValue != 0)
550 defaultValueLineEdit->setText(defaultValue->c_str());
553 geometryTypeComboBox->setEnabled(
false);
554 geometrySRIDLineEdit->setEnabled(
false);
555 defaultGeometryCheckBox->setEnabled(
false);
557 geometryEnvelopeGroupBox->setEnabled(
false);
560 if (geometryTypeComboBox->count() == 0)
562 geometryTypeComboBox->addItem(
"GEOMETRY");
564 geometryTypeComboBox->addItem(
"GEOMETRYZ");
566 geometryTypeComboBox->addItem(
"GEOMETRYM");
568 geometryTypeComboBox->addItem(
"GEOMETRYZM");
570 geometryTypeComboBox->addItem(
"POINT");
572 geometryTypeComboBox->addItem(
"POINTZ");
574 geometryTypeComboBox->addItem(
"POINTM");
576 geometryTypeComboBox->addItem(
"POINTZM");
578 geometryTypeComboBox->addItem(
"LINESTRING");
580 geometryTypeComboBox->addItem(
"LINESTRINGZ");
582 geometryTypeComboBox->addItem(
"LINESTRINGM");
584 geometryTypeComboBox->addItem(
"LINESTRINGZM");
586 geometryTypeComboBox->addItem(
"POLYGON");
588 geometryTypeComboBox->addItem(
"POLYGONZ");
590 geometryTypeComboBox->addItem(
"POLYGONM");
592 geometryTypeComboBox->addItem(
"POLYGONZM");
594 geometryTypeComboBox->addItem(
"GEOMETRYCOLLECTION");
596 geometryTypeComboBox->addItem(
"GEOMETRYCOLLECTIONZ");
598 geometryTypeComboBox->addItem(
"GEOMETRYCOLLECTIONM");
600 geometryTypeComboBox->addItem(
"GEOMETRYCOLLECTIONZM");
602 geometryTypeComboBox->addItem(
"MULTIPOINT");
604 geometryTypeComboBox->addItem(
"MULTIPOINTZ");
606 geometryTypeComboBox->addItem(
"MULTIPOINTM");
608 geometryTypeComboBox->addItem(
"MULTIPOINTZM");
610 geometryTypeComboBox->addItem(
"MULTILINESTRING");
612 geometryTypeComboBox->addItem(
"MULTILINESTRINGZ");
614 geometryTypeComboBox->addItem(
"MULTILINESTRINGM");
616 geometryTypeComboBox->addItem(
"MULTILINESTRINGZM");
618 geometryTypeComboBox->addItem(
"MULTIPOLYGON");
620 geometryTypeComboBox->addItem(
"MULTIPOLYGONZ");
622 geometryTypeComboBox->addItem(
"MULTIPOLYGONM");
624 geometryTypeComboBox->addItem(
"MULTIPOLYGONZM");
627 geometryTypeComboBox->addItem(
"UNKNOWNGEOMETRY");
633 int pos = geometryTypeComboBox->findText(m_geomTypeTextMap[geomType]);
634 geometryTypeComboBox->setCurrentIndex(pos);
637 geometrySRIDLineEdit->setText(QString().setNum(gp->
getSRID()));
640 std::auto_ptr<te::da::DataSetType> dt = m_ds->getDataSetType(dataSetComboBox->currentText().toStdString());
643 if(gp == defaultGeomProperty)
644 defaultGeometryCheckBox->setChecked(
true);
646 defaultGeometryCheckBox->setChecked(
false);
649 std::auto_ptr<te::da::DataSet> dataSet = m_ds->getDataSet(dataSetComboBox->currentText().toStdString());
653 std::auto_ptr<te::gm::Envelope> e = dataSet->getExtent(gpos);
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));
665 dataTypeStackedWidget->setCurrentWidget(numericPage);
670 requiredCheckBox->setChecked(
true);
673 if(defaultValue != 0)
674 defaultValueLineEdit->setText(defaultValue->c_str());
676 precisionLineEdit->setEnabled(
false);
677 scaleLineEdit->setEnabled(
false);
680 precisionLineEdit->clear();
681 precisionLineEdit->setText(QString().setNum(np->
getPrecision()));
684 scaleLineEdit->clear();
685 scaleLineEdit->setText(QString().setNum(np->
getScale()));
690 dataTypeStackedWidget->setCurrentWidget(rasterPage);
695 requiredCheckBox->setChecked(
true);
698 if(defaultValue != 0)
699 defaultValueLineEdit->setText(defaultValue->c_str());
702 rasterSRIDLineEdit->setText(QString().setNum(rp->
getGrid()->
getSRID()));
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()));
733 dataTypeStackedWidget->setCurrentWidget(stringPage);
738 requiredCheckBox->setChecked(
true);
742 defaultValueLineEdit->setText(defaultValue->c_str());
744 stringTypeComboBox->setEnabled(
false);
745 stringSizeLineEdit->setEnabled(
false);
748 if (stringTypeComboBox->count() == 0)
750 stringTypeComboBox->addItem(
"FIXED_STRING");
751 stringTypeComboBox->addItem(
"VAR_STRING");
752 stringTypeComboBox->addItem(
"STRING");
756 stringSizeLineEdit->setText(QString().setNum(sp->
size()));
760 stringTypeComboBox->setCurrentIndex(stringType);
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();
814 unsigned int dimension = arrayDimensionLineEdit->text().toUInt();
819 QString arrayElementDataType = arrayElementDataTypeComboBox->currentText();
821 std::string tempPropertyName = m_propertyName;
822 m_propertyName = std::string();
824 std::string* tempDefaultValue = m_defaultValue;
831 m_propertyName = tempPropertyName;
832 m_defaultValue = tempDefaultValue;
838 arrayElementProperty = 0;
840 for(
unsigned int i = 0; i < dimension - 2; ++i)
847 requiredCheckBox->isChecked(), m_defaultValue);
853 if(m_defaultValue != 0)
855 for(
size_t i = 0; i < m_defaultValue->size(); ++i)
857 if(m_defaultValue->operator[](i) ==
'0' || m_defaultValue->operator[](i) ==
'1')
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!"));
867 requiredCheckBox->isChecked(), m_defaultValue);
872 if(m_defaultValue != 0)
874 QString qs = defaultValueLineEdit->text().toUpper();
876 if(qs !=
"TRUE" && qs !=
"FALSE")
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"));
885 requiredCheckBox->isChecked(), m_defaultValue);
891 requiredCheckBox->isChecked(), m_defaultValue);
896 if(m_defaultValue != 0)
899 int val = defaultValueLineEdit->text().toInt(&ok);
901 if(ok ==
false || val <-128 || val > 127)
903 QMessageBox::warning(
this, tr(
"Default Value Error"),
904 tr(
"The default value must be a char value >= -128 and <= 127!"));
910 requiredCheckBox->isChecked(), m_defaultValue);
915 std::string cname = std::string();
917 if(compositeNameLineEdit->text().isEmpty() ==
false)
918 cname = compositeNameLineEdit->text().toStdString();
931 dateTimeType,
te::dt::SECOND, requiredCheckBox->isChecked(), m_defaultValue);
936 if(m_defaultValue != 0)
940 defaultValueLineEdit->text().toDouble(&ok);
943 QMessageBox::warning(
this, tr(
"Default Value Error"),
944 tr(
"The default value must be a double number!"));
950 requiredCheckBox->isChecked(), m_defaultValue);
955 if(m_defaultValue != 0)
959 defaultValueLineEdit->text().toFloat(&ok);
962 QMessageBox::warning(
this, tr(
"Default Value Error"),
963 tr(
"The default value must be a float number!"));
969 requiredCheckBox->isChecked(), m_defaultValue);
975 std::string gTypeStr = geometryTypeComboBox->currentText().toStdString();
979 int srid = geometrySRIDLineEdit->text().toInt();
982 srid, gType,
false, 0);
987 if(m_defaultValue != 0)
991 defaultValueLineEdit->text().toShort(&ok);
994 QMessageBox::warning(
this, tr(
"Default Value Error"),
995 tr(
"The default value must be a short value!"));
1001 requiredCheckBox->isChecked(), m_defaultValue);
1006 if(m_defaultValue != 0 && autoNumberCheckBox->isChecked() ==
false)
1010 defaultValueLineEdit->text().toInt(&ok);
1013 QMessageBox::warning(
this, tr(
"Default Value Error"),
1014 tr(
"The default value must be an integer value!"));
1020 requiredCheckBox->isChecked(), m_defaultValue);
1029 if(m_defaultValue != 0 && autoNumberCheckBox->isChecked() ==
false)
1033 defaultValueLineEdit->text().toLongLong(&ok);
1036 QMessageBox::warning(
this, tr(
"Default Value Error"),
1037 tr(
"The default value must be a long long value!"));
1043 requiredCheckBox->isChecked(), m_defaultValue);
1051 if(dataTypeComboBox->currentText() ==
"NUMERIC")
1053 if(m_defaultValue != 0)
1055 defaultValueLineEdit->text().toDouble(&ok);
1058 QMessageBox::warning(
this, tr(
"Default Value Error"),
1059 tr(
"The default value must be a numeric value!"));
1066 unsigned int precision = 0;
1068 if(dataTypeComboBox->currentText() ==
"NUMERIC")
1070 if(precisionLineEdit->text().isEmpty() ==
false)
1071 precision = precisionLineEdit->text().toUInt(&ok);
1075 if(arrayElementPrecisionLineEdit->text().isEmpty() ==
false)
1076 precision = arrayElementPrecisionLineEdit->text().toUInt(&ok);
1081 QMessageBox::warning(
this, tr(
"Invalid Value"),
1082 tr(
"The precision must be an unsigned int value!"));
1087 unsigned int scale = 0;
1089 if(dataTypeComboBox->currentText() ==
"NUMERIC")
1091 if(scaleLineEdit->text().isEmpty() ==
false)
1092 scale = scaleLineEdit->text().toUInt(&ok);
1096 if(arrayElementScaleLineEdit->text().isEmpty() ==
false)
1097 scale = arrayElementScaleLineEdit->text().toUInt(&ok);
1102 QMessageBox::warning(
this, tr(
"Invalid Value"),
1103 tr(
"The scale must be an unsigned int value!"));
1108 precision, scale, requiredCheckBox->isChecked(), m_defaultValue);
1120 size_t stringSize = 0;
1123 if(dataTypeComboBox->currentText() ==
"STRING")
1127 if(stringSizeLineEdit->text().isEmpty() ==
false)
1128 stringSize = stringSizeLineEdit->text().toUInt(&ok);
1132 stringType =
static_cast<te::dt::StringType>(arrayElementStringTypeComboBox->currentIndex());
1134 if(arrayElementStringSizeLineEdit->text().isEmpty() ==
false)
1135 stringSize = arrayElementStringSizeLineEdit->text().toUInt(&ok);
1140 QMessageBox::warning(
this, tr(
"Invalid Value"),
1141 tr(
"The string size must be an unsigned int value!"));
1146 stringType, stringSize, requiredCheckBox->isChecked(), m_defaultValue);
1148 return stringProperty;
1153 if(m_defaultValue != 0)
1157 unsigned int val = defaultValueLineEdit->text().toUShort(&ok);
1158 if(ok ==
false || val > 255)
1160 QMessageBox::warning(
this, tr(
"Default Value Error"),
1161 tr(
"The default value must be an unsigned char value!"));
1167 requiredCheckBox->isChecked(), m_defaultValue);
1172 if(m_defaultValue != 0)
1176 defaultValueLineEdit->text().toUShort(&ok);
1179 QMessageBox::warning(
this, tr(
"Default Value Error"),
1180 tr(
"The default value must be an unsigned short value!"));
1186 requiredCheckBox->isChecked(), m_defaultValue);
1191 if(m_defaultValue != 0)
1195 defaultValueLineEdit->text().toUInt(&ok);
1198 QMessageBox::warning(
this, tr(
"Default Value Error"),
1199 tr(
"The default value must be an unsigned integer value!"));
1205 requiredCheckBox->isChecked(), m_defaultValue);
1210 if(m_defaultValue != 0)
1214 defaultValueLineEdit->text().toULongLong(&ok);
1217 QMessageBox::warning(
this, tr(
"Default Value Error"),
1218 tr(
"The default value must be an unsigned long long value!"));
1224 requiredCheckBox->isChecked(), m_defaultValue);
bool supportsByteArray() const
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 supportsDateTime() const
void helpPushButtonClicked()
bool isRequired() const
It returns true if the attribute is required, otherwise it returns false.
void setStringPropertyData()
te::da::DataTypeCapabilities dataTypeCapabilities
The type for variable-length multidimensional arrays.
te::dt::Property * buildUpdatedGeometryProperty()
te::dt::Property * buildUpdatedInt32Property()
An atomic property like an integer or double.
bool supportsComposite() const
virtual std::vector< std::string > getDataSetNames()
It gets the dataset names available in the data source.
te::dt::Property * buildUpdatedBitProperty()
void setArrayPropertyData()
bool supportsGeometry() const
bool supportsChar() const
TEDATAACCESSEXPORT te::gm::GeometryProperty * GetFirstGeomProperty(const DataSetType *dt)
virtual const DataSourceCapabilities & getCapabilities() const =0
It returns the known capabilities of the data source.
te::dt::Property * buildUpdatedInt64Property()
bool supportsInt64() const
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.
void setCompositePropertyData()
const double & getLowerLeftY() const
It returns a constant refernce to the y coordinate of the lower left corner.
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.
void setNumericPropertyData()
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.
const double & getLowerLeftX() const
It returns a constant reference to the x coordinate of the lower left corner.
void setGeometryPropertyData()
Property * getElementType() const
It returns the type of array elements.
void cancelPushButtonClicked()
void setDateTimePropertyData()
GeomType getGeometryType() const
It returns the geometry subtype allowed for the property.
te::dt::Property * buildUpdatedUint32Property()
bool supportsUChar() const
te::dt::Property * buildUpdatedRasterProperty()
std::map< int, QString > m_propertyTypeMap
te::gm::Envelope * getExtent()
Returns the geographic extension of the grid.
te::dt::Property * buildUpdatedCompositeProperty()
void setAutoNumber(bool a)
It tells if the property is an autonumber or not.
bool supportsDataset() const
te::dt::Property * buildUpdatedVoidProperty()
te::rst::Grid * getGrid()
Returns the definition of the raster grid support.
bool supportsBoolean() const
double getResolutionX() const
Returns the grid horizontal (x-axis) resolution.
TEDATAACCESSEXPORT std::size_t GetFirstPropertyPos(const te::da::DataSet *dataset, int datatype)
void closeEvent(QCloseEvent *e)
GeomType
Each enumerated type is compatible with a Well-known Binary (WKB) type code.
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.
te::dt::Property * buildUpdatedUint64Property()
te::dt::Property * buildUpdatedUcharProperty()
bool supportsInt16() const
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.
bool supportsNumeric() const
bool supportsDouble() const
An abstract class for data providers like a DBMS, Web Services or a regular file. ...
bool supportsInt32() const
bool supportsUInt64() const
It updates a property of a data set.
StringType
The subtype of string property.
te::dt::Property * buildUpdatedNumericProperty()
const std::string & getCompositeName() const
It returns the name of the composite type.
It models a property definition.
const double & getUpperRightX() const
It returns a constant refernce to the x coordinate of the upper right corner.
bool supportsUInt16() const
te::dt::Property * buildUpdatedDoubleProperty()
A base class for a compound property (non-atomic properties).
bool supportsUInt32() const
bool supportsRaster() const
unsigned int getNumberOfColumns() const
Returns the grid number of columns.
int getSRID() const
Returns the grid spatial reference system identifier.
The type for arbitrary precison numbers, like numeric(p, q).
int getType() const
It returns the property data type.
bool supportsString() const
const double & getUpperRightY() const
It returns a constant refernce to the x coordinate of the upper right corner.
void okPushButtonClicked()
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.
A class that represents the supported data types of a specific data source.
void setRasterPropertyData()
te::dt::Property * buildUpdatedProperty(const QString &dataType)
bool supportsFloat() const
te::da::DataSourceCapabilities capabilities
te::dt::Property * buildUpdatedArrayProperty()
bool isAutoNumber() const
It returns true if the attribute is an autonumber, otherwise it returns false.
bool supportsArray() const
te::dt::Property * buildUpdatedCharProperty()
te::dt::Property * buildUpdatedInt16Property()
te::da::DataSource * m_ds