38 #include <QMouseEvent> 46 :
te::qt::widgets::AbstractTool(display, parent)
62 draft->fill(Qt::transparent);
67 if(e->button() != Qt::LeftButton)
71 #if QT_VERSION >= 0x050000 79 std::unique_ptr<te::da::DataSourceTransactor> transactor(dataSource->getTransactor());
85 std::unique_ptr<te::da::DataSetType> datasetType = transactor->getDataSetType(
m_layer->
getDataSetName());
87 std::string propname = p->
getName();
96 std::size_t nproperties = dataset->getNumProperties();
97 QString information(
"<h2>Attributes</h2><ul>");
100 while(dataset->moveNext())
103 std::unique_ptr<te::gm::Geometry> g = dataset->getGeometry(pos);
104 if(g->intersects(&point))
110 for(std::size_t i = 0; i < nproperties; ++i)
112 int propertyType = dataset->getPropertyDataType(i);
114 information +=
"<li><b>" + QString::fromUtf8(dataset->getPropertyName(i).c_str()) +
":</b> " + QString::fromUtf8(dataset->getAsString(i, 3).c_str()) +
"</li>";
118 information +=
"</ul>";
125 QToolTip::showText(QCursor::pos(), information,
m_display, m_display->rect());
134 draft->fill(Qt::transparent);
139 canvas.setWindow(env.m_llx, env.m_lly, env.m_urx, env.m_ury);
142 canvas.setPolygonContourWidth(3);
145 for(std::size_t i = 0; i <
m_geoms.size(); ++i)
boost::shared_ptr< DataSource > DataSourcePtr
#define TE_OPAQUE
For an RGBA color this is the value of the alpha-channel for totally opaque.
A layer with reference to a dataset.
It models a property definition.
static DataSourceManager & getInstance()
It returns a reference to the singleton instance.
A point with x and y coordinate values.
An Envelope defines a 2D rectangular region.
virtual const te::gm::Envelope & getExtent() const
It returns the world extent showned by the MapDisplay.
const std::string & getDataSetName() const
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
A layer with reference to a dataset.
TEDATAACCESSEXPORT std::size_t GetFirstPropertyPos(const te::da::DataSet *dataset, int datatype)
This file contains include headers for the Vector Geometry model of TerraLib.
This file contains include headers for the Data Access module of TerraLib.
void FreeContents(boost::unordered_map< K, V * > &m)
This function can be applied to a map of pointers. It will delete each pointer in the map...
virtual const std::string & getDataSourceId() const
This file contains several utility functions for dealing with STL containers.
const std::string & getName() const
It returns the property name.