27 #include "../../../dataaccess/dataset/DataSet.h"
28 #include "../../../dataaccess/dataset/DataSetAdapter.h"
29 #include "../../../dataaccess/dataset/DataSetType.h"
30 #include "../../../dataaccess/dataset/DataSetTypeConverter.h"
31 #include "../../../dataaccess/datasource/DataSource.h"
32 #include "../../../dataaccess/utils/Utils.h"
33 #include "../../../geometry/GeometryProperty.h"
34 #include "../../../maptools/DataSetAdapterLayer.h"
35 #include "../../../se/FeatureTypeStyle.h"
36 #include "../../../se/Utils.h"
39 #include "ui_DataPropertiesDialogForm.h"
40 #include "ui_DataPropertiesWidgetForm.h"
43 #include <boost/uuid/random_generator.hpp>
44 #include <boost/uuid/uuid_io.hpp>
48 const std::string& propertyName)
52 while(dataset->moveNext())
63 m_ui(new Ui::DataPropertiesDialogForm)
71 QGridLayout* layout =
new QGridLayout(
m_ui->m_dataWidgetFrame);
73 layout->setContentsMargins(0,0,0,0);
74 this->layout()->setSizeConstraint(QLayout::SetFixedSize);
79 m_ui->m_helpPushButton->setPageReference(
"widgets/external_table/external_table.html");
84 delete m_dataPropertiesWidget;
89 static boost::uuids::basic_random_generator<boost::mt19937> gen;
90 boost::uuids::uuid u = gen();
91 std::string
id = boost::uuids::to_string(u);
93 std::string title = m_dataPropertiesWidget->getDataSetType()->getTitle().empty() ? m_dataPropertiesWidget->getDataSetType()->getName() : m_dataPropertiesWidget->getDataSetType()->getTitle();
96 m_DataSetAdapterLayer->setDataSetName(m_dataPropertiesWidget->getDataSetType()->getName());
97 m_DataSetAdapterLayer->setDataSourceId(m_dataPropertiesWidget->getDataSource()->getId());
99 m_DataSetAdapterLayer->setRendererType(
"ABSTRACT_LAYER_RENDERER");
100 m_DataSetAdapterLayer->setConverter(m_dataPropertiesWidget->getConverter());
102 if(m_DataSetAdapterLayer->getConverter()->getResult()->hasGeom())
105 std::auto_ptr<te::gm::Envelope> mbr(
te::da::GetExtent(m_DataSetAdapterLayer->getDataSetName(), gp->
getName(), m_DataSetAdapterLayer->getDataSourceId()));
111 m_DataSetAdapterLayer->setExtent(*(mbr.release()));
113 m_DataSetAdapterLayer->setSRID(gp->
getSRID());
122 return m_DataSetAdapterLayer;
TEDATAACCESSEXPORT te::gm::GeometryProperty * GetFirstGeomProperty(const DataSetType *dt)
A class used to configure the properties of a new textual file based layer.
A dialog used to configure the properties of a new textual file based layer.
int getSRID() const
It returns the spatial reference system identifier associated to this property.
te::gm::Envelope & computeDataSetEnvelope(std::auto_ptr< te::da::DataSet > dataset, const std::string &propertyName)
const std::string & getName() const
It returns the property name.
TEDATAACCESSEXPORT te::gm::Envelope * GetExtent(const std::string &datasetName, const std::string &propertyName, const std::string &datasourceId)
A class to represent a chart display.
TESEEXPORT Style * CreateFeatureTypeStyle(const te::gm::GeomType &geomType)
Try creates an appropriate feature type style based on given geometry type.
GeomType getGeometryType() const
It returns the geometry subtype allowed for the property.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
te::map::DataSetAdapterLayerPtr getDataSetAdapterLayer()
Returns a new DataSetAdapterLayer.
std::auto_ptr< Ui::DataPropertiesDialogForm > m_ui
The dialog form.
boost::intrusive_ptr< DataSetAdapterLayer > DataSetAdapterLayerPtr
DataPropertiesDialog(QWidget *parent=0, Qt::WindowFlags f=0)
Constructor.
~DataPropertiesDialog()
Destructor.
DatapPropertiesWidget * m_dataPropertiesWidget
The widget used to import and configure a textual file.
void onOkPushButtonClicked()
A layer with reference to a DataSetTypeConverter.
const Envelope * getMBR() const
It returns the minimum bounding rectangle for the geometry in an internal representation.
An Envelope defines a 2D rectangular region.
void Union(const Envelope &rhs)
It updates the envelop with coordinates of another envelope.