27 #include "../../../dataaccess/dataset/DataSet.h"
28 #include "../../../dataaccess/dataset/DataSetType.h"
29 #include "../../../dataaccess/datasource/DataSource.h"
30 #include "../../../dataaccess/datasource/DataSourceManager.h"
31 #include "../../../dataaccess/datasource/DataSourceTransactor.h"
32 #include "../../../dataaccess/utils/Utils.h"
33 #include "../../../geometry/Envelope.h"
34 #include "../../../geometry/Geometry.h"
35 #include "../../../geometry/GeometryProperty.h"
36 #include "../canvas/Canvas.h"
44 #include <QMessageBox>
45 #include <QResizeEvent>
67 catch(
const std::exception& e)
69 QMessageBox::warning(
this,
70 tr(
"TerraLib Qt Components"),
75 QMessageBox::warning(
this,
76 tr(
"TerraLib Qt Components"),
77 tr(
"Unknown error when displaying dataset!"));
83 if((dataset.get() == 0) || (ds.get() == 0))
86 if(m_canvas.get() == 0)
87 m_canvas.reset(
new Canvas(width(), height()));
89 if(dataset->size() == 0)
92 if(!dataset->hasGeom())
106 m_canvas->calcAspectRatio(mbr.get());
108 m_canvas->setWindow(mbr->getLowerLeftX(), mbr->getLowerLeftY(), mbr->getUpperRightX(), mbr->getUpperRightY());
161 std::auto_ptr<te::gm::Geometry> g(datasetData->
getGeometry(gpos));
162 m_canvas->draw(g.get());
167 std::auto_ptr<te::da::DataSet> feature(ds->getDataSet(dataset->getName()));
171 while(feature->moveNext())
173 std::auto_ptr<te::gm::Geometry> g(feature->getGeometry(gpos));
174 m_canvas->draw(g.get());
183 if(m_canvas.get() == 0)
184 m_canvas.reset(
new Canvas(width(), height()));
194 if(m_canvas.get() == 0)
197 QPainter painter(
this);
199 painter.drawPixmap(0, 0, *(m_canvas->getPixmap()));
209 if(m_canvas.get() == 0)
212 m_canvas->resize(e->size().width(), e->size().height());
214 QFrame::resizeEvent(e);
TEDATAACCESSEXPORT te::gm::Envelope * GetExtent(const std::string &datasetName, const std::string &propertyName, const std::string &datasourceId)
TEDATAACCESSEXPORT void LoadProperties(te::da::DataSetType *dataset, const std::string &datasourceId)
boost::shared_ptr< DataSetType > DataSetTypePtr
boost::shared_ptr< DataSource > DataSourcePtr
virtual bool moveNext()=0
It moves the internal pointer to the next item of the collection.
static DataSourceManager & getInstance()
It returns a reference to the singleton instance.
GeomType getGeometryType() const
It returns the geometry subtype allowed for the property.
virtual std::auto_ptr< te::gm::Geometry > getGeometry(std::size_t i) const =0
Method for retrieving a geometric attribute value.
A dataset is the unit of information manipulated by the data access module of TerraLib.
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
TEDATAACCESSEXPORT std::size_t GetFirstPropertyPos(const te::da::DataSet *dataset, int datatype)
TEDATAACCESSEXPORT te::gm::GeometryProperty * GetFirstGeomProperty(const DataSetType *dt)
boost::shared_ptr< DataSourceInfo > DataSourceInfoPtr
const std::string & getName() const
It returns the property name.