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 "../../../maptools/Utils.h"
37 #include "../../../se/CoverageStyle.h"
38 #include "../../../se/Utils.h"
39 #include "../canvas/Canvas.h"
47 #include <QMessageBox>
48 #include <QResizeEvent>
68 if(dataset->hasRaster())
70 std::auto_ptr<te::da::DataSourceTransactor> t = auxDs->getTransactor();
72 draw(dataset, auxDs, t->getDataSet(dataset->getName()).
get());
78 catch(
const std::exception& e)
80 QMessageBox::warning(
this,
81 tr(
"TerraLib Qt Components"),
86 QMessageBox::warning(
this,
87 tr(
"TerraLib Qt Components"),
88 tr(
"Unknown error when displaying dataset!"));
94 if((dataset.get() == 0) || (ds.get() == 0))
97 if(m_canvas.get() == 0)
98 m_canvas.reset(
new Canvas(width(), height()));
100 if(dataset->size() == 0)
103 if(dataset->hasRaster())
107 std::auto_ptr<te::rst::Raster> rst = datasetData->
getRaster(rpos);
113 int rstSrid = rst->getSRID();
117 else if(dataset->hasGeom())
127 m_canvas->calcAspectRatio(mbr.get());
129 m_canvas->setWindow(mbr->getLowerLeftX(), mbr->getLowerLeftY(), mbr->getUpperRightX(), mbr->getUpperRightY());
182 std::auto_ptr<te::gm::Geometry> g(datasetData->
getGeometry(gpos));
183 m_canvas->draw(g.get());
188 std::auto_ptr<te::da::DataSet> feature(ds->getDataSet(dataset->getName()));
192 while(feature->moveNext())
194 std::auto_ptr<te::gm::Geometry> g(feature->getGeometry(gpos));
195 m_canvas->draw(g.get());
209 if(m_canvas.get() == 0)
210 m_canvas.reset(
new Canvas(width(), height()));
220 if(m_canvas.get() == 0)
223 QPainter painter(
this);
225 painter.drawPixmap(0, 0, *(m_canvas->getPixmap()));
235 if(m_canvas.get() == 0)
238 m_canvas->resize(e->size().width(), e->size().height());
240 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
The Style defines the styling that is to be applied to a geographic dataset (vector geometries or cov...
boost::shared_ptr< DataSource > DataSourcePtr
The CoverageStyle defines the styling that is to be applied to a subset of Coverage data...
TESEEXPORT Style * CreateCoverageStyle(const std::vector< te::rst::BandProperty * > &properties)
Try creates an appropriate coverage style based on given band properties.
virtual std::auto_ptr< te::rst::Raster > getRaster(std::size_t i) const =0
Method for retrieving a raster attribute value.
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.
An Envelope defines a 2D rectangular region.
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)
TEMAPEXPORT void DrawRaster(te::da::DataSetType *type, te::da::DataSourcePtr ds, Canvas *canvas, const te::gm::Envelope &bbox, int bboxSRID, const te::gm::Envelope &visibleArea, int srid, te::se::CoverageStyle *style)
boost::shared_ptr< DataSourceInfo > DataSourceInfoPtr
const std::string & getName() const
It returns the property name.