39 #include <terralib/annotationtext/Text.h> 40 #include <terralib/annotationtext/Element.h> 41 #include <terralib/annotationtext/Attributes.h> 44 #include <QtGui/QApplication> 45 #include <QtGui/QPrinter> 46 #include <QtGui/QPrintDialog> 70 canvas.
setWindow(-180.0, -90.0, +180.0, +90.0);
126 std::map<std::string, std::string> connInfo;
127 connInfo[
"PG_HOST"] =
"atlas.dpi.inpe.br" ;
128 connInfo[
"PG_USER"] =
"postgres";
130 connInfo[
"PG_DB_NAME"] =
"terralib4";
131 connInfo[
"PG_CONNECT_TIMEOUT"] =
"4";
135 CPPUNIT_ASSERT_NO_THROW_MESSAGE(
"Could not instantiate the PostGIS data source!",
138 CPPUNIT_ASSERT_NO_THROW_MESSAGE(
"Could not open the PostGIS data source!",
142 te::da::DataSourceCatalogLoader* cl = transactor->getCatalogLoader();
144 CPPUNIT_ASSERT_NO_THROW_MESSAGE(
"Could not load the PostGIS data source catalog!",
145 cl->loadCatalog(
true));
155 for(
size_t i = 0; i < nLayers; ++i)
164 if(dt->hasGeom() ==
false)
170 int geomCol = dt->getPropertyPosition(gcol->
getName());
192 double wwi = extent->
m_llx;
194 double whi = extent->
m_lly;
198 double urx = wwi + ww;
200 double ury = whi + wh;
206 canvas.
setWindow(llx-ww/10., lly-wh/10., urx+ww/10, ury+wh/10.);
230 std::cout <<
"Testing " << dt->getName() << std::endl;
231 std::cout <<
"retrieving time: " << end - begin <<
" miliseconds" << std::endl;
254 std::cout <<
"drawing time: " << end - begin <<
" miliseconds" << std::endl << std::endl;
256 double ix = extent->
m_llx;
257 double iy = extent->
m_lly;
267 text.
add(textElement);
269 bb->
init(0, 0, ix+w/2., iy+h/2. - h/10);
272 std::string value =
"Multi line text\ncenter justification\nteste\ncom fonte\nVerdana\npointSize 12\nResolution = ";
275 text.
add(textElement2);
277 bb->
init(0, 0, ix + w/20., iy+h/2.-h/10);
279 value =
"Multi line text\nLeft justification\nteste\ncom fonte\nArial\npointSize 10\nResolution = ";
284 textElement3->setAttributes(attr2);
285 text.
add(textElement3);
287 bb->
init(0, 0, ix+w-w/20., iy+h/2.-h/10.);
289 value =
"Multi line text\nRight justification\nteste\ncom fonte\nScript MT Bold\npointSize 10\nResolution = ";
294 textElement4->setAttributes(attr3);
295 text.
add(textElement4);
299 std::string fileName = dt->getName() +
".png";
307 CPPUNIT_ASSERT_NO_THROW_MESSAGE(
"Could not close the PostGIS data source!",
virtual std::unique_ptr< te::gm::Geometry > getGeometry(std::size_t i) const =0
Method for retrieving a geometric attribute value.
static std::unique_ptr< DataSource > make(const std::string &driver, const te::core::URI &connInfo)
void init(const double &llx, const double &lly, const double &urx, const double &ury)
It initializes (sets) the envelope bounds.
void tcPerformance()
Test Case: it will draw several layers in order to make a benchmark.
virtual std::unique_ptr< DataSourceTransactor > getTransactor()=0
It returns the set of parameters used to set up the access channel to the underlying repository...
virtual void open()=0
It opens the data source and makes it ready for using.
boost::shared_ptr< DataSetType > DataSetTypePtr
void setTextColor(const std::string &color)
It sets the text color.
CPPUNIT_TEST_SUITE_REGISTRATION(TsCanvas)
It represents the system catalog of a DataSource.
double m_urx
Upper right corner x-coordinate.
A Text may contain 1 or more Text Elements.
std::size_t getNumberOfDataSets() const
It returns the number of datasets in the catalog.
static te::dt::Date ds(2010, 01, 01)
An abstract class for data providers like a DBMS, Web Services or a regular file. ...
const DataSetTypePtr & getDataSetType(std::size_t i) const
It returns the i-th dataset schema.
virtual bool moveNext()=0
It moves the internal pointer to the next item of the collection.
A LinearRing is a LineString that is both closed and simple.
double m_llx
Lower left corner x-coordinate.
virtual bool isEmpty() const =0
It returns true if the collection is empty.
LineString is a curve with linear interpolation between points.
A point with x and y coordinate values.
void setPoint(std::size_t i, const double &x, const double &y)
It sets the value of the specified point.
An Envelope defines a 2D rectangular region.
GeomType getGeometryType() const
It returns the geometry subtype allowed for the property.
static te::dt::TimeDuration dt(20, 30, 50, 11)
void setAttributes(Attributes *attribute)
it sets the text attributes.
A DataSourceTransactor can be viewed as a connection to the data source for reading/writing things in...
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
void tcTransformation()
Test Case: it will test if the transformation from/to device and world is ok.
double m_lly
Lower left corner y-coordinate.
This file contains include headers for the TerraLib PostGIS driver.
This file contains include headers for the Color Model of TerraLib.
int getType() const
It returns the property data type.
A dataset is the unit of information manipulated by the data access module of TerraLib.
Test suite for the Qt canvas widget.
Polygon is a subclass of CurvePolygon whose rings are defined by linear rings.
Test suite for the Qt Canvas implementation.
double m_ury
Upper right corner y-coordinate.
virtual void close()=0
It closes the data source and clears all the resources used by its internal communication channel...
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
Utility functions for dealing with strings.
This file contains include headers for the TerraLib Common Runtime module.
std::string Convert2String(boost::int16_t value)
It converts a short integer value to a string.
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 add(Element *element)
It adds the element.
void setRingN(std::size_t i, Curve *r)
It sets the informed position ring to the new one.
const std::string & getName() const
It returns the property name.