te::ag::Canvas Class Referenceabstract

A canvas built on top of Anti Grain Geometry. More...

#include <Canvas.h>

Inheritance diagram for te::ag::Canvas:
te::map::Canvas

Public Member Functions

char * getData (const std::string &file_name, int &w, int &h)
 
bool write_ppm (const std::string &file_name)
 It draws a text. More...
 
Initializer Methods

Methods related to instantiation and destruction.

 Canvas (int w, int h)
 It initializes a new Canvas. More...
 
 ~Canvas ()
 Destructor. More...
 
Accessor Methods

Methods used to access internal attributes.

void setWindow (const double &llx, const double &lly, const double &urx, const double &ury)
 It sets the world (or window) coordinates area (supposing a cartesian reference system). More...
 
void adjustWorldWindow (double &llx, double &lly, double &urx, double &ury, const HAlignType &ha=HCenter, const VAlignType &va=VCenter)
 It adjusts the world (or window) coordinates area (supposing a cartesian reference system). More...
 
void setBackgroundColor (const te::color::RGBAColor &color)
 It sets the canvas background color. More...
 
te::color::RGBAColor getBackgroundColor () const
 It returns the canvas background color. More...
 
void clear ()
 It clears the canvas content and fills with the background color. More...
 
void resize (int w, int h)
 It adjusts the canvas size (width and height). More...
 
int getWidth () const
 It returns the canvas width. More...
 
int getHeight () const
 It returns the canvas height. More...
 
Geographical Objects Drawing Methods (WKB or EWKB)

Methods used to draw geographical objects encoded as a WKB or EWKB.

Note that the visual (style and symbol) used to draw geometries is affected by the visual methods.

char * drawGeometry (char *geom)
 It draws the geometry in WKB format on canvas. More...
 
char * drawPoint (char *point)
 It draws the point in WKB format on canvas. More...
 
char * drawPointZ (char *point)
 It draws the point in WKB format on canvas. More...
 
char * drawPointM (char *point)
 It draws the point in WKB format on canvas. More...
 
char * drawPointZM (char *point)
 It draws the point in WKB format on canvas. More...
 
char * drawMultiPoint (char *mpoint)
 It draws the multipoint in WKB format on canvas. More...
 
char * drawLineString (char *line)
 It draws the line string in WKB format on canvas. More...
 
void drawLineString (double *v, const size_t &size)
 It draws the line string. More...
 
char * drawMultiLineString (char *mline)
 It draws the MultiLineString in WKB format on canvas. More...
 
char * drawPolygon (char *poly)
 It draws the polygon in WKB format on canvas. More...
 
void drawPolygon (agg::path_storage &path, const int &index)
 It draws the polygon. More...
 
char * drawMultiPolygon (char *mpoly)
 It draws the MultiPolygon in WKB format on canvas. More...
 
char * drawGeometryCollection (char *g)
 It draws the GeometryCollection in WKB format on canvas. More...
 
Geographical Objects Drawing Methods (TerraLib Geometry)

Methods used to draw geographical objects encoded as a TerraLib Geometry.

Note that the visual (style and symbol) used to draw geometries is affected by the visual methods.

void draw (te::gm::Geometry *geom)
 It draws the geometry on canvas. More...
 
void draw (te::gm::Point *point)
 It draws the point on canvas. More...
 
void draw (te::gm::PointZ *point)
 It draws the point with Z coordinate on canvas. More...
 
void draw (te::gm::PointM *point)
 It draws the point associated to a M value on canvas. More...
 
void draw (te::gm::PointZM *point)
 It draws the point with Z and M values on canvas. More...
 
void draw (te::gm::MultiPoint *mpoint)
 It draws the multipoint on canvas. More...
 
void draw (te::gm::LineString *line)
 It draws the line string on canvas. More...
 
void draw (te::gm::MultiLineString *mline)
 It draws the MultiLineString on canvas. More...
 
void draw (te::gm::Polygon *poly)
 It draws the polygon on canvas. More...
 
void draw (te::gm::MultiPolygon *mpoly)
 It draws the MultiPolygon on canvas. More...
 
void draw (te::gm::GeometryCollection *g)
 It draws the GeometryCollection on canvas. More...
 
Image Handling

Methods used to draw an image on Canvas.

char * getImage (te::map::Canvas::ImageType t, size_t &size) const
 It returns the internal contents as an image. More...
 
void freeImage (char *img) const
 This is the method that you should use to release a image generated by the canvas. More...
 
void drawImage (char *src, int size, te::map::Canvas::ImageType t)
 It draws the src pixmap over the canvas. More...
 
void drawImage (te::color::RGBAColor **src, int w, int h)
 It draws the src pixmap over the canvas. More...
 
void drawImage (int x, int y, char *src, int size, te::map::Canvas::ImageType t)
 It draws the src pixmap over the canvas at the specified position (x, y). More...
 
void drawImage (int x, int y, te::color::RGBAColor **src, int w, int h)
 It draws the src pixmap over the canvas at the specified position (x, y). More...
 
void drawImage (int x, int y, int w, int h, char *src, int size, te::map::Canvas::ImageType t)
 It draws the pixmap into the rectangle at position (x, y) with the given width and height. More...
 
void drawImage (int x, int y, int w, int h, te::color::RGBAColor **src, int srcw, int srch)
 It draws the pixmap into the rectangle at position (x, y) with the given width and height. More...
 
void drawImage (int x, int y, int w, int h, char *src, int size, te::map::Canvas::ImageType t, int sx, int sy, int sw, int sh)
 It draws the rectangular portion with the origin (sx, sy), width sw and height sh, of the given pixmap, at the point (x, y), with a width of w and a height of h. If sw or sh are equal to zero the width/height of the pixmap is used and adjusted by the offset sx/sy. More...
 
void drawImage (int x, int y, int w, int h, te::color::RGBAColor **src, int sx, int sy, int sw, int sh)
 It draws the rectangular portion with the origin (sx, sy), width sw and height sh, of the given pixmap, at the point (x, y), with a width of w and a height of h. If sw or sh are equal to zero the width/height of the pixmap is used and adjusted by the offset sx/sy. More...
 
void drawPixel (int x, int y)
 It sets a pixel using the point pen. More...
 
void drawPixel (int x, int y, const te::color::RGBAColor &color)
 It sets a pixel to a particular color. More...
 
Text Handling

Methods used to draw a text on Canvas.

void drawText (int x, int y, const std::string &tx, float angle=0.0, te::at::HorizontalAlignment hAlign=te::at::Start, te::at::VerticalAlignment vAlign=te::at::Baseline)
 It draws a text. More...
 
void drawText (double *vin, const int &size, const agg::trans_affine &matrix, const std::string &tx)
 It draws a text. More...
 
void drawText (const te::gm::Point &wp, const std::string &tx, float angle=0.0, te::at::HorizontalAlignment hAlign=te::at::Start, te::at::VerticalAlignment vAlign=te::at::Baseline)
 It draws a text. More...
 
void drawText (const double &x, const double &y, const std::string &tx, float angle=0.0, te::at::HorizontalAlignment hAlign=te::at::Start, te::at::VerticalAlignment vAlign=te::at::Baseline)
 It draws a text. More...
 
void draw (te::at::Text *tx)
 It draws a annotation text. More...
 
void drawTextBoundary (int x, int y, const std::string &tx, float angle=0.0, te::at::HorizontalAlignment hAlign=te::at::Start, te::at::VerticalAlignment vAlign=te::at::Baseline)
 It draws the text boundary. More...
 
void drawTextBoundary (const te::gm::Point &wp, const std::string &tx, float angle=0.0, te::at::HorizontalAlignment hAlign=te::at::Start, te::at::VerticalAlignment vAlign=te::at::Baseline)
 It draws the text boundary. More...
 
void drawTextBoundary (const double &x, const double &y, const std::string &tx, float angle=0.0, te::at::HorizontalAlignment hAlign=te::at::Start, te::at::VerticalAlignment vAlign=te::at::Baseline)
 It draws the text boundary. More...
 
te::gm::PolygongetTextBoundary (int x, int y, const std::string &tx, float angle=0.0, te::at::HorizontalAlignment hAlign=te::at::Start, te::at::VerticalAlignment vAlign=te::at::Baseline)
 It returns text boundary. More...
 
te::gm::PolygongetTextBoundary (const te::gm::Point &wp, const std::string &tx, float angle=0.0, te::at::HorizontalAlignment hAlign=te::at::Start, te::at::VerticalAlignment vAlign=te::at::Baseline)
 It returns the text boundary. More...
 
te::gm::PolygongetTextBoundary (const double &x, const double &y, const std::string &tx, float angle=0.0, te::at::HorizontalAlignment hAlign=te::at::Start, te::at::VerticalAlignment vAlign=te::at::Baseline)
 It returns the text boundary. More...
 
void setTextColor (const te::color::RGBAColor &color)
 It sets the text drawing color. More...
 
void setTextOpacity (const int &opacity)
 It sets the text opacity. More...
 
void setFontFamily (const std::string &family)
 It sets the text font family. More...
 
void setTextPointSize (double psize)
 It sets the text Point Size. More...
 
void setTextStyle (te::at::FontStyle style)
 It sets the text style. More...
 
void setTextWeight (te::at::FontWeight weight)
 It sets the text weight. More...
 
void setTextStretch (size_t stretch)
 It sets the text stretch. More...
 
void setTextUnderline (bool b)
 It sets the text underline flag. More...
 
void setTextOverline (bool b)
 It sets the text overline flag. More...
 
void setTextStrikeOut (bool b)
 It sets the text strike out flag. More...
 
void setTextDecorationColor (const te::color::RGBAColor &color)
 It sets the text strike out flag. More...
 
void setTextDecorationWidth (int width)
 It sets the text strike out flag. More...
 
void setTextBoundaryColor (const te::color::RGBAColor &color)
 It sets the text boundary drawing color. More...
 
void setTextBoundaryOpacity (const int &opacity)
 It sets the text boundary opacity. More...
 
void setTextBoundaryWidth (const int &width)
 It sets the text boundary width. More...
 
void setTextMultiLineJustification (const te::at::LineJustification &just)
 It sets the multi line text justification. More...
 
void setTextMultiLineSpacing (const int &spacing)
 It sets the multi line text spacing. More...
 
Visual and Style Configuration

Note that the visual (style and symbol) used to draw geometries is affected by the visual methods.

void setPointColor (const te::color::RGBAColor &color)
 It sets the point drawing color. More...
 
void setPointWidth (int w)
 It sets the point drawing color. More...
 
void setPointMarkerType (const ptMarkerType &type)
 It sets the point marker type. More...
 
void setPointStyle (te::color::RGBAColor **style, int ncols, int nrows)
 It sets the point style. More...
 
void setPointStyle (char *style, int size, te::map::Canvas::ImageType t)
 It sets the point style. More...
 
void setPointStyle (const std::string &fileName)
 It sets the point style. More...
 
void setLineColor (const te::color::RGBAColor &color)
 It sets the pen color used to draw line geometries. More...
 
void setLineStyle (te::color::RGBAColor **style, int ncols, int nrows)
 It sets the line style. More...
 
void setLineStyle (char *style, int size, te::map::Canvas::ImageType t)
 It sets the line style. More...
 
void setLineStyle (const std::string &fileName)
 It sets the line style. More...
 
void setLineWidth (const int &w)
 It sets the line width. More...
 
void setPolygonFillColor (const te::color::RGBAColor &color)
 It sets the color used to fill the draw of polygon geometries. More...
 
void setPolygonContourColor (const te::color::RGBAColor &color)
 It sets the pen color used to draw the boundary of polygon geometries. More...
 
void setPolygonFillStyle (te::color::RGBAColor **style, int ncols, int nrows)
 It sets the polygon fill style. More...
 
void setPolygonFillStyle (char *style, int size, te::map::Canvas::ImageType t)
 It sets the polygon fill style. More...
 
void setPolygonFillStyle (const std::string &fileName)
 It sets the polygon fill style. More...
 
void setPolygonPatternWidth (const int &w)
 It sets the polycon brush icon width. More...
 
void setPolygonPatternOpacity (const unsigned char &opac)
 It sets the polycon brush icon width. More...
 
void setPolygonContourStyle (te::color::RGBAColor **style, int ncols, int nrows)
 It sets the pen style used to draw the boundary of polygon geometries. More...
 
void setPolygonContourStyle (char *style, int size, te::map::Canvas::ImageType t)
 It sets the pen style used to draw the boundary of polygon geometries. More...
 
void setPolygonContourStyle (const std::string &fileName)
 It sets the polygon contour style. More...
 
void setPolygonContourWidth (const int &w)
 It sets the polycon contour width. More...
 
Image Generation Methods

These methods can be used to retrieve or save the canvas contents from/to an image.

void save (const char *fileName, te::map::Canvas::ImageType t, int quality=75, int fg=0) const
 It saves the canvas content to a file image in the specified format type. More...
 
te::color::RGBAColor ** getColorsFromBuffer (int x=0, int y=0, int w=0, int h=0) const
 It gets a RGBA colors from buffer. More...
 
unsigned char * getBuffer () const
 It gets a RGBA colors from buffer. More...
 
Accessor Methods

Methods used to access internal attributes.

virtual void calcAspectRatio (double &llx, double &lly, double &urx, double &ury, const AlignType hAlign=Center, const AlignType vAlign=Center)=0
 It calculates the best aspect ratio for world (or window) coordinates area (supposing a cartesian reference system). More...
 
virtual void calcAspectRatio (te::gm::Envelope *envelope, const AlignType hAlign=Center, const AlignType vAlign=Center)=0
 It calculates the best aspect ratio for world (or window) coordinates area (supposing a cartesian reference system). More...
 
Geographical Objects Drawing Methods (TerraLib Geometry)

Methods used to draw geographical objects encoded as a TerraLib Geometry.

Note that the visual (style and symbol) used to draw geometries is affected by the visual methods.

virtual void draw (const te::gm::Geometry *geom)=0
 It draws the geometry on canvas. More...
 
virtual void draw (const te::gm::Point *point)=0
 It draws the point on canvas. More...
 
virtual void draw (const te::gm::MultiPoint *mpoint)=0
 It draws the MultiPoint on canvas. More...
 
virtual void draw (const te::gm::LineString *line)=0
 It draws the LineString on canvas. More...
 
virtual void draw (const te::gm::MultiLineString *mline)=0
 It draws the MultiLineString on canvas. More...
 
virtual void draw (const te::gm::Polygon *poly)=0
 It draws the polygon on canvas. More...
 
virtual void draw (const te::gm::MultiPolygon *mpoly)=0
 It draws the MultiPolygon on canvas. More...
 
virtual void draw (const te::gm::GeometryCollection *g)=0
 It draws the GeometryCollection on canvas. More...
 
virtual void draw (const te::gm::MultiSurface *g)=0
 It draws the MultiSurface on canvas. More...
 
Text Handling

Methods used to draw a text on Canvas.

virtual void draw (const te::at::Text *txt)=0
 It draws an annotaion text. More...
 
virtual void drawText (const te::gm::Point *p, const std::string &txt, float angle=0.0, te::at::HorizontalAlignment hAlign=te::at::Start, te::at::VerticalAlignment vAlign=te::at::Baseline)=0
 It draws a text. More...
 
virtual te::gm::PolygongetTextBoundary (const te::gm::Point *p, const std::string &txt, float angle=0.0, te::at::HorizontalAlignment hAlign=te::at::Start, te::at::VerticalAlignment vAlign=te::at::Baseline)=0
 It returns the text boundary (its enclose rectangle). More...
 
Image Handling

Methods used to draw an image on Canvas.

virtual void save (const char *fileName, ImageType t, int quality=75, int fg=0) const =0
 It saves the canvas content to a file image in the specified format type. More...
 
virtual char * getImage (ImageType t, std::size_t &size, int quality=75, int fg=0) const =0
 It returns the internal content as an image in a specific format (PNG, JPEG, ...). More...
 
virtual te::color::RGBAColor ** getImage (const int x=0, const int y=0, const int w=0, const int h=0) const =0
 It gets a RGBA color array from internal canvas buffer. More...
 
virtual void drawImage (char *src, std::size_t size, ImageType t)=0
 It draws the src image over the canvas. More...
 
virtual void drawImage (int x, int y, char *src, std::size_t size, ImageType t)=0
 It draws the src image over the canvas at the specified position (x, y). More...
 
virtual void drawImage (int x, int y, int w, int h, char *src, std::size_t size, ImageType t)=0
 It draws the source image into the rectangle at position (x, y) with the given width and height. More...
 
virtual void drawImage (int x, int y, int w, int h, char *src, std::size_t size, ImageType t, int sx, int sy, int sw, int sh)=0
 It draws the rectangular portion with the origin (sx, sy), width sw and height sh, of the source image, at the point (x, y), with a width of w and a height of h. If sw or sh are equal to zero the width/height of the pixmap is used and adjusted by the offset sx/sy. More...
 
virtual void drawImage (int x, int y, te::rst::Raster *src, int opacity=TE_OPAQUE)=0
 It draws a raster over the canvas at the specified position (x, y). The raster must be with three 8-bit bands (1R, 2G, 3B),. More...
 
virtual void drawImage (int x, int y, int w, int h, te::rst::Raster *src, int sx, int sy, int sw, int sh, int opacity=TE_OPAQUE)=0
 It draws the rectangular portion with the origin (sx, sy), width sw and height sh, of the source raster, starting at the point (x, y), with a width of w and a height of h. If sw or sh are equal to zero the width/height of the pixmap is used and adjusted by the offset sx/sy. More...
 
Visual and Style Configuration

Note that the visual (style and symbol) used to draw geometries is affected by the visual methods.

virtual void setTextOpacity (int opacity)=0
 It sets the text opacity. More...
 
virtual void setTextStretch (std::size_t stretch)=0
 It sets the text stretch. More...
 
virtual void setTextContourColor (const te::color::RGBAColor &color)=0
 It sets the text contour (outline) drawing color. More...
 
virtual void setTextContourEnabled (bool b)=0
 It controls the display of the text outline. More...
 
virtual void setTextContourOpacity (int opacity)=0
 It sets the text contour opacity. More...
 
virtual void setTextContourWidth (int width)=0
 It sets the text contour width. More...
 
virtual void setTextJustification (te::at::LineJustification just)=0
 It sets the text justification for multi line text. More...
 
virtual void setTextMultiLineSpacing (int spacing)=0
 It sets the multi line text spacing. More...
 
virtual void setPointPattern (te::color::RGBAColor **pattern, int ncols, int nrows)=0
 It sets the point pattern. More...
 
virtual void setPointPattern (char *pattern, std::size_t size, ImageType t)=0
 It sets the point pattern using a buffered image. More...
 
virtual void setPointPatternRotation (const double &angle)=0
 It sets the point pattern rotation. Rotation is made ​​from the center of the pattern. More...
 
virtual void setPointPatternOpacity (int opacity)=0
 It sets the point pattern opacity. More...
 
virtual void setLinePattern (te::color::RGBAColor **pattern, int ncols, int nrows)=0
 It sets the line pattern. More...
 
virtual void setLinePattern (char *pattern, std::size_t size, ImageType t)=0
 It sets the line pattern using a buffered image. More...
 
virtual void setLinePatternRotation (const double &angle)=0
 It sets the line pattern rotation. Rotation is made ​​from the center of the pattern. More...
 
virtual void setLinePatternOpacity (int opacity)=0
 It sets the line pattern opacity. More...
 
virtual void setLineWidth (int w)=0
 It sets the line width. More...
 
virtual void setLineDashStyle (LineDashStyle style)=0
 It sets the line dash style. More...
 
virtual void setLineDashStyle (const std::vector< double > &style)=0
 It sets the line dash style to the given pattern. More...
 
virtual void setLineCapStyle (LineCapStyle style)=0
 It sets the line cap style. More...
 
virtual void setLineJoinStyle (LineJoinStyle style)=0
 It sets the line join style. More...
 
virtual void setPolygonFillPattern (te::color::RGBAColor **pattern, int ncols, int nrows)=0
 It sets the polygon fill pattern. More...
 
virtual void setPolygonFillPattern (char *pattern, std::size_t size, ImageType t)=0
 It sets the polygon fill pattern using a buffered image. More...
 
virtual void setPolygonPatternWidth (int w)=0
 It sets the polygon pattern width. More...
 
virtual void setPolygonPatternRotation (const double &angle)=0
 It sets the polygon pattern rotation. More...
 
virtual void setPolygonPatternOpacity (int opacity)=0
 It sets the polygon pattern opacity. More...
 
virtual void setPolygonContourPattern (te::color::RGBAColor **pattern, int ncols, int nrows)=0
 It sets the pen pattern used to draw the boundary of polygon geometries. More...
 
virtual void setPolygonContourPattern (char *pattern, std::size_t size, ImageType t)=0
 It sets the pen pattern used to draw the boundary of polygon geometries using a buffered image. More...
 
virtual void setPolygonContourWidth (int w)=0
 It sets the polygon contour width. More...
 
virtual void setPolygonContourPatternRotation (const double &angle)=0
 It sets the polygon contour pattern rotation. More...
 
virtual void setPolygonContourPatternOpacity (int opacity)=0
 It sets the polygon contour pattern opacity. More...
 
virtual void setPolygonContourDashStyle (LineDashStyle style)=0
 It sets the polygon contour dash style. More...
 
virtual void setPolygonContourDashStyle (const std::vector< double > &style)=0
 It sets the polygon contour dash style to the given pattern. More...
 
virtual void setPolygonContourCapStyle (LineCapStyle style)=0
 It sets the polygon contour cap style. More...
 
virtual void setPolygonContourJoinStyle (LineJoinStyle style)=0
 It sets the polygon contour join style. More...
 
virtual void setEraseMode ()=0
 It sets the painter to erase mode. More...
 
virtual void setNormalMode ()=0
 It sets the painter to normal copy source to destination mode. More...
 

Private Types

typedef agg::conv_curve< font_manager_type::path_adaptor_type > conv_font_curve_type
 
typedef agg::conv_segmentator< conv_font_curve_typeconv_font_segm_type
 
typedef agg::conv_transform< conv_font_segm_type, agg::trans_single_path > conv_font_trans_type
 
typedef agg::font_engine_win32_tt_int16 font_engine_type
 
typedef agg::font_cache_manager< font_engine_typefont_manager_type
 

Private Member Functions

Copy Constructor and Assignment Operator

Copy constructor and assignment operator not allowed.

 Canvas (const Canvas &rhs)
 Copy constructor not allowed. More...
 
Canvasoperator= (const Canvas &rhs)
 Assignment operator not allowed. More...
 

Private Attributes

color_type m_bgColor
 Canvas background color. Defaults: white fully transparent. More...
 
unsigned char * m_buffer
 
agg::int8u * m_contourPatternBuffer
 
agg::rendering_buffer m_contourPatternRenderingBuffer
 
int m_dheight
 The device height. More...
 
int m_dwidth
 The device width. More...
 
font_engine_typem_fontEngine
 
font_manager_typem_fontManager
 
HDC m_hdc
 
color_type m_lineColor
 Line color. More...
 
agg::int8u * m_linePatternBuffer
 
agg::rendering_buffer m_linePatternRenderingBuffer
 
double m_lineWidth
 Line width. More...
 
agg::trans_affine m_matrix
 Matrix that transforms the world coordinate to device coordinate. More...
 
pixfmtm_pixfmt
 
color_type m_polyContourColor
 Polygon contoyr color. More...
 
double m_polyContourWidth
 Polygon contour width. More...
 
color_type m_polyFillColor
 Polygon fill color. More...
 
agg::int8u * m_polyPatternBuffer
 
unsigned char m_polyPatternOpacity
 The pattern opacity. More...
 
agg::rendering_buffer m_polyPatternRenderingBuffer
 
unsigned int m_polyPatternWidth
 The pattern width used to fill a polygon. More...
 
color_type m_ptColor
 Point color. More...
 
agg::marker_e m_ptMarkerType
 
agg::int8u * m_ptPatternBuffer
 
agg::rendering_buffer m_ptPatternRenderingBuffer
 
int m_ptWidth
 Point width. More...
 
agg::rasterizer_scanline_aa m_rasterizer
 
agg::renderer_base< pixfmtm_rendererBase
 
agg::rendering_buffer m_renderingBuffer
 
agg::scanline_p8 m_scanline
 
double m_textLetterSpacing
 Text letter spacing. More...
 
int m_textLineJustification
 Text multi line justification. More...
 
double m_textLineSpacing
 Text multi line spacing. More...
 
double m_textWordSpacing
 Text word spacing. More...
 
color_type m_txBoundaryColor
 Text boundary color. More...
 
double m_txBoundaryWidth
 Text boundary color. More...
 
color_type m_txColor
 Text color. More...
 
color_type m_txDecorationColor
 
int m_txDecorationType
 none=0, underline=1, overline=2 or strikeout=3. More...
 
double m_txDecorationWidth
 
double m_txXScale
 
double m_wllx
 Lower left x-coordinate of the World (in the spatial coordinate system of the datasets to be drawn). More...
 
double m_wlly
 Lower left y-coordinate of the World (in the spatial coordinate system of the datasets to be drawn). More...
 
double m_wurx
 Upper right x-coordinate of the World (in the spatial coordinate system of the datasets to be drawn). More...
 
double m_wury
 Upper right y-coordinate of the World (in the spatial coordinate system of the datasets to be drawn). More...
 

Detailed Description

A canvas built on top of Anti Grain Geometry.

What is a Canvas?
It is an abstraction of a drawing area. You can use it to:

  • draw geographical objects from a layer, with a given visual (or style);
  • draw texts;
  • draw the map legend;
  • create a chart.

Definition at line 82 of file Canvas.h.

Member Typedef Documentation

typedef agg::conv_curve<font_manager_type::path_adaptor_type> te::ag::Canvas::conv_font_curve_type
private

Definition at line 1281 of file Canvas.h.

typedef agg::conv_segmentator<conv_font_curve_type> te::ag::Canvas::conv_font_segm_type
private

Definition at line 1282 of file Canvas.h.

typedef agg::conv_transform<conv_font_segm_type, agg::trans_single_path> te::ag::Canvas::conv_font_trans_type
private

Definition at line 1283 of file Canvas.h.

typedef agg::font_engine_win32_tt_int16 te::ag::Canvas::font_engine_type
private

Definition at line 1279 of file Canvas.h.

typedef agg::font_cache_manager<font_engine_type> te::ag::Canvas::font_manager_type
private

Definition at line 1280 of file Canvas.h.

Constructor & Destructor Documentation

te::ag::Canvas::Canvas ( int  w,
int  h 
)

It initializes a new Canvas.

te::ag::Canvas::~Canvas ( )
virtual

Destructor.

Reimplemented from te::map::Canvas.

te::ag::Canvas::Canvas ( const Canvas rhs)
private

Copy constructor not allowed.

Parameters
rhsThe right-hand-side copy that would be used to copy from.

Member Function Documentation

void te::ag::Canvas::adjustWorldWindow ( double &  llx,
double &  lly,
double &  urx,
double &  ury,
const HAlignType &  ha = HCenter,
const VAlignType &  va = VCenter 
)

It adjusts the world (or window) coordinates area (supposing a cartesian reference system).

Parameters
llxLower left x-coordinate of the World.
llyLower left y-coordinate of the World.
urxUpper right x-coordinate of the World.
uryUpper right y-coordinate of the World.
hAlignHorizontal Alignment. It can be left, center or right.
vAlignVertical Alignment. It can be top, center or bottom.
Note
The input coordinates will be adjusted according to the alignment parameters provided.
virtual void te::map::Canvas::calcAspectRatio ( double &  llx,
double &  lly,
double &  urx,
double &  ury,
const AlignType  hAlign = Center,
const AlignType  vAlign = Center 
)
pure virtualinherited

It calculates the best aspect ratio for world (or window) coordinates area (supposing a cartesian reference system).

Parameters
llxLower left x-coordinate of the World.
llyLower left y-coordinate of the World.
urxUpper right x-coordinate of the World.
uryUpper right y-coordinate of the World.
hAlignHorizontal Alignment. It can be left, center or right.
vAlignVertical Alignment. It can be top, center or bottom.
Note
The input coordinates will be adjusted according to the alignment parameters provided.

Implemented in te::qt::widgets::Canvas.

virtual void te::map::Canvas::calcAspectRatio ( te::gm::Envelope envelope,
const AlignType  hAlign = Center,
const AlignType  vAlign = Center 
)
pure virtualinherited

It calculates the best aspect ratio for world (or window) coordinates area (supposing a cartesian reference system).

Parameters
envelopeA rectangle with world coordinates that will be adjusted.
hAlignHorizontal Alignment. It can be left, center or right.
vAlignVertical Alignment. It can be top, center or bottom.
Note
The input coordinates will be adjusted according to the alignment parameters provided.

Implemented in te::qt::widgets::Canvas.

void te::ag::Canvas::clear ( )
virtual

It clears the canvas content and fills with the background color.

Implements te::map::Canvas.

virtual void te::map::Canvas::draw ( const te::gm::Geometry geom)
pure virtualinherited

It draws the geometry on canvas.

Parameters
geomAny geometry (point, line, polygon, ...).

Implemented in te::qt::widgets::Canvas.

virtual void te::map::Canvas::draw ( const te::gm::Point point)
pure virtualinherited

It draws the point on canvas.

Parameters
pointThe point.

Implemented in te::qt::widgets::Canvas.

virtual void te::map::Canvas::draw ( const te::gm::MultiPoint mpoint)
pure virtualinherited

It draws the MultiPoint on canvas.

Parameters
mpointThe MultiPoint.

Implemented in te::qt::widgets::Canvas.

virtual void te::map::Canvas::draw ( const te::gm::LineString line)
pure virtualinherited

It draws the LineString on canvas.

Parameters
lineThe LineString.

Implemented in te::qt::widgets::Canvas.

virtual void te::map::Canvas::draw ( const te::gm::MultiLineString mline)
pure virtualinherited

It draws the MultiLineString on canvas.

Parameters
mlineThe MultiLineString.

Implemented in te::qt::widgets::Canvas.

virtual void te::map::Canvas::draw ( const te::gm::Polygon poly)
pure virtualinherited

It draws the polygon on canvas.

Parameters
polyThe polygon.

Implemented in te::qt::widgets::Canvas.

virtual void te::map::Canvas::draw ( const te::gm::MultiPolygon mpoly)
pure virtualinherited

It draws the MultiPolygon on canvas.

Parameters
mpolyThe MultiPolygon.

Implemented in te::qt::widgets::Canvas.

virtual void te::map::Canvas::draw ( const te::gm::GeometryCollection g)
pure virtualinherited

It draws the GeometryCollection on canvas.

Parameters
gThe GeometryCollection.

Implemented in te::qt::widgets::Canvas.

virtual void te::map::Canvas::draw ( const te::gm::MultiSurface g)
pure virtualinherited

It draws the MultiSurface on canvas.

Parameters
gThe MultiSurface.

Implemented in te::qt::widgets::Canvas.

void te::ag::Canvas::draw ( te::gm::Geometry geom)

It draws the geometry on canvas.

Parameters
geomAny geometry (point, line, polygon, ...).
void te::ag::Canvas::draw ( te::gm::Point point)

It draws the point on canvas.

Parameters
pointThe point.
void te::ag::Canvas::draw ( te::gm::PointZ point)

It draws the point with Z coordinate on canvas.

Parameters
pointThe point-z.
void te::ag::Canvas::draw ( te::gm::PointM point)

It draws the point associated to a M value on canvas.

Parameters
pointThe point-m.
void te::ag::Canvas::draw ( te::gm::PointZM point)

It draws the point with Z and M values on canvas.

Parameters
pointThe point-zm.
void te::ag::Canvas::draw ( te::gm::MultiPoint mpoint)

It draws the multipoint on canvas.

Parameters
mpointThe MultiPoint.
void te::ag::Canvas::draw ( te::gm::LineString line)

It draws the line string on canvas.

Parameters
lineThe LineString.
void te::ag::Canvas::draw ( te::gm::MultiLineString mline)

It draws the MultiLineString on canvas.

Parameters
mlineThe MultiLineString.
void te::ag::Canvas::draw ( te::gm::Polygon poly)

It draws the polygon on canvas.

Parameters
polyThe polygon.
void te::ag::Canvas::draw ( te::gm::MultiPolygon mpoly)

It draws the MultiPolygon on canvas.

Parameters
mpolyThe MultiPolygon.
void te::ag::Canvas::draw ( te::gm::GeometryCollection g)

It draws the GeometryCollection on canvas.

Parameters
gThe GeometryCollection.
virtual void te::map::Canvas::draw ( const te::at::Text txt)
pure virtualinherited

It draws an annotaion text.

Parameters
txtThe annotation text to be drawn.

Implemented in te::qt::widgets::Canvas.

void te::ag::Canvas::draw ( te::at::Text tx)

It draws a annotation text.

Parameters
txAnotation text to be drawed.
char* te::ag::Canvas::drawGeometry ( char *  geom)

It draws the geometry in WKB format on canvas.

Parameters
geomThe geometry in WKB format.
Returns
A pointer to the byte after the geometry data stream.
Note
The WKB must be in the machine byte order.
char* te::ag::Canvas::drawGeometryCollection ( char *  g)

It draws the GeometryCollection in WKB format on canvas.

Parameters
gThe GeometryCollection in WKB format.
Returns
A pointer to the byte after the GeometryCollection data stream.
Note
The WKB must be in the machine byte order.
virtual void te::map::Canvas::drawImage ( char *  src,
std::size_t  size,
ImageType  t 
)
pure virtualinherited

It draws the src image over the canvas.

Parameters
srcA source image of any type (PNG, JPEG, GIF, ...).
sizeThe image size in bytes.
tThe image format type (see ImageType enum).

Implemented in te::qt::widgets::Canvas.

virtual void te::map::Canvas::drawImage ( int  x,
int  y,
char *  src,
std::size_t  size,
ImageType  t 
)
pure virtualinherited

It draws the src image over the canvas at the specified position (x, y).

Parameters
xThe canvas start position where the src image will be drawn.
yThe canvas start position where the src image will be drawn.
srcA source image of any type (PNG, JPEG, GIF, ...).
sizeThe image size in bytes.
tThe image format type (see ImageType enum).

Implemented in te::qt::widgets::Canvas.

virtual void te::map::Canvas::drawImage ( int  x,
int  y,
int  w,
int  h,
char *  src,
std::size_t  size,
ImageType  t 
)
pure virtualinherited

It draws the source image into the rectangle at position (x, y) with the given width and height.

Parameters
xThe canvas start position where the src image will be drawn.
yThe canvas start position where the src image will be drawn.
wThe rectangle width.
hThe rectangle height.
srcA source image of any type (PNG, JPEG, GIF, ...).
sizeThe image size in bytes.
tThe image format type (see ImageType enum).

Implemented in te::qt::widgets::Canvas.

virtual void te::map::Canvas::drawImage ( int  x,
int  y,
int  w,
int  h,
char *  src,
std::size_t  size,
ImageType  t,
int  sx,
int  sy,
int  sw,
int  sh 
)
pure virtualinherited

It draws the rectangular portion with the origin (sx, sy), width sw and height sh, of the source image, at the point (x, y), with a width of w and a height of h. If sw or sh are equal to zero the width/height of the pixmap is used and adjusted by the offset sx/sy.

Parameters
xThe canvas start position where the src image will be drawn.
yThe canvas start position where the src image will be drawn.
wThe rectangle width.
hThe rectangle height.
srcA source image of any type (PNG, JPEG, GIF, ...).
sizeThe image size in bytes.
tThe image format type (see ImageType enum).
sxThe source image position.
syThe source image position.
swThe source image rectangle width.
shThe source image rectangle height.

Implemented in te::qt::widgets::Canvas.

virtual void te::map::Canvas::drawImage ( int  x,
int  y,
te::rst::Raster src,
int  opacity = TE_OPAQUE 
)
pure virtualinherited

It draws a raster over the canvas at the specified position (x, y). The raster must be with three 8-bit bands (1R, 2G, 3B),.

Parameters
xThe canvas start position in x where the raster image will be drawn.
yThe canvas start position in y where the raster image will be drawn.
srcThe source raster.
opacityThe opacity value used to draw the image

Implemented in te::qt::widgets::Canvas.

virtual void te::map::Canvas::drawImage ( int  x,
int  y,
int  w,
int  h,
te::rst::Raster src,
int  sx,
int  sy,
int  sw,
int  sh,
int  opacity = TE_OPAQUE 
)
pure virtualinherited

It draws the rectangular portion with the origin (sx, sy), width sw and height sh, of the source raster, starting at the point (x, y), with a width of w and a height of h. If sw or sh are equal to zero the width/height of the pixmap is used and adjusted by the offset sx/sy.

Parameters
xThe canvas start position where the src image will be drawn.
yThe canvas start position where the src image will be drawn.
wThe rectangle width.
hThe rectangle height.
srcThe source raster.
sxThe source image start position.
syThe source image start position.
swThe source image rectangle width.
shThe source image rectangle height.
opacityThe opacity value used to draw the image

Implemented in te::qt::widgets::Canvas.

void te::ag::Canvas::drawImage ( char *  src,
int  size,
te::map::Canvas::ImageType  t 
)

It draws the src pixmap over the canvas.

Parameters
srcThe source pixmap.
void te::ag::Canvas::drawImage ( te::color::RGBAColor **  src,
int  w,
int  h 
)
virtual

It draws the src pixmap over the canvas.

Parameters
srcThe source pixmap.
wThe image width (number of columns).
hThe image height (number of columns).

Implements te::map::Canvas.

void te::ag::Canvas::drawImage ( int  x,
int  y,
char *  src,
int  size,
te::map::Canvas::ImageType  t 
)

It draws the src pixmap over the canvas at the specified position (x, y).

Parameters
xThe canvas start position where the src image will be drawn.
yThe canvas start position where the src image will be drawn.
srcThe source pixmap.
void te::ag::Canvas::drawImage ( int  x,
int  y,
te::color::RGBAColor **  src,
int  w,
int  h 
)
virtual

It draws the src pixmap over the canvas at the specified position (x, y).

Parameters
xThe canvas start position where the src image will be drawn.
yThe canvas start position where the src image will be drawn.
srcThe source pixmap.
wThe image width (number of columns).
hThe image height (number of columns).

Implements te::map::Canvas.

void te::ag::Canvas::drawImage ( int  x,
int  y,
int  w,
int  h,
char *  src,
int  size,
te::map::Canvas::ImageType  t 
)

It draws the pixmap into the rectangle at position (x, y) with the given width and height.

Parameters
xThe canvas start position where the src image will be drawn.
yThe canvas start position where the src image will be drawn.
wThe rectangle width.
hThe rectangle height.
srcThe source pixmap.
void te::ag::Canvas::drawImage ( int  x,
int  y,
int  w,
int  h,
te::color::RGBAColor **  src,
int  srcw,
int  srch 
)
virtual

It draws the pixmap into the rectangle at position (x, y) with the given width and height.

Parameters
xThe canvas start position where the src image will be drawn.
yThe canvas start position where the src image will be drawn.
wThe rectangle width.
hThe rectangle height.
srcThe source pixmap.
srcwThe source image width (number of columns).
srchThe source image height (number of columns).

Implements te::map::Canvas.

void te::ag::Canvas::drawImage ( int  x,
int  y,
int  w,
int  h,
char *  src,
int  size,
te::map::Canvas::ImageType  t,
int  sx,
int  sy,
int  sw,
int  sh 
)

It draws the rectangular portion with the origin (sx, sy), width sw and height sh, of the given pixmap, at the point (x, y), with a width of w and a height of h. If sw or sh are equal to zero the width/height of the pixmap is used and adjusted by the offset sx/sy.

Parameters
xThe canvas start position where the src image will be drawn.
yThe canvas start position where the src image will be drawn.
wThe rectangle width.
hThe rectangle height.
srcThe source pixmap.
sxThe source pixmap position.
syThe source pixmap position.
swThe source pixmap rectangle width.
shThe source pixmap rectangle height.
void te::ag::Canvas::drawImage ( int  x,
int  y,
int  w,
int  h,
te::color::RGBAColor **  src,
int  sx,
int  sy,
int  sw,
int  sh 
)
virtual

It draws the rectangular portion with the origin (sx, sy), width sw and height sh, of the given pixmap, at the point (x, y), with a width of w and a height of h. If sw or sh are equal to zero the width/height of the pixmap is used and adjusted by the offset sx/sy.

Parameters
xThe canvas start position where the src image will be drawn.
yThe canvas start position where the src image will be drawn.
wThe rectangle width.
hThe rectangle height.
srcThe source pixmap.
sxThe source pixmap start position.
syThe source pixmap start position.
swThe source pixmap rectangle width.
shThe source pixmap rectangle height.

Implements te::map::Canvas.

char* te::ag::Canvas::drawLineString ( char *  line)

It draws the line string in WKB format on canvas.

Parameters
lineThe LineString in WKB format.
Returns
A pointer to the byte after the LineString data stream.
Note
The WKB must be in the machine byte order.
void te::ag::Canvas::drawLineString ( double *  v,
const size_t &  size 
)

It draws the line string.

Parameters
vpoint array.
Note
This method becomes the owner of the point array and is responsible for its deletion.
char* te::ag::Canvas::drawMultiLineString ( char *  mline)

It draws the MultiLineString in WKB format on canvas.

Parameters
mlineThe MultiLineString in WKB format.
Returns
A pointer to the byte after the MultiLineString data stream.
Note
The WKB must be in the machine byte order.
char* te::ag::Canvas::drawMultiPoint ( char *  mpoint)

It draws the multipoint in WKB format on canvas.

Parameters
mpointThe MultiPoint in WKB format.
Returns
A pointer to the byte after the MultiPoint data stream.
Note
The WKB must be in the machine byte order.
char* te::ag::Canvas::drawMultiPolygon ( char *  mpoly)

It draws the MultiPolygon in WKB format on canvas.

Parameters
mpolyThe MultiPolygon in WKB format.
Returns
A pointer to the byte after the MultiPolygon data stream.
Note
The WKB must be in the machine byte order.
void te::ag::Canvas::drawPixel ( int  x,
int  y 
)
virtual

It sets a pixel using the point pen.

Parameters
xColumn.
yLine.

Implements te::map::Canvas.

void te::ag::Canvas::drawPixel ( int  x,
int  y,
const te::color::RGBAColor color 
)
virtual

It sets a pixel to a particular color.

The color must be an RGBA value. With the following range:

  • R: 0-255;
  • G: 0-255;
  • B: 0-255;
  • A: 0-255.

    Parameters
    xColumn.
    yLine.
    colorPixel color.
    Note
    This is not optimized for Canvas. Use a QImage instead.

Implements te::map::Canvas.

char* te::ag::Canvas::drawPoint ( char *  point)

It draws the point in WKB format on canvas.

Parameters
pointThe point in WKB format.
Returns
A pointer to the byte after the point data stream.
Note
The WKB must be in the machine byte order.
char* te::ag::Canvas::drawPointM ( char *  point)

It draws the point in WKB format on canvas.

Parameters
pointThe point in WKB format.
Returns
A pointer to the byte after the point data stream.
Note
The WKB must be in the machine byte order.
char* te::ag::Canvas::drawPointZ ( char *  point)

It draws the point in WKB format on canvas.

Parameters
pointThe point in WKB format.
Returns
A pointer to the byte after the point data stream.
Note
The WKB must be in the machine byte order.
char* te::ag::Canvas::drawPointZM ( char *  point)

It draws the point in WKB format on canvas.

Parameters
pointThe point in WKB format.
Returns
A pointer to the byte after the point data stream.
Note
The WKB must be in the machine byte order.
char* te::ag::Canvas::drawPolygon ( char *  poly)

It draws the polygon in WKB format on canvas.

Parameters
polyThe polygon in WKB format.
Returns
A pointer to the byte after the polygon data stream.
Note
The WKB must be in the machine byte order.
void te::ag::Canvas::drawPolygon ( agg::path_storage &  path,
const int &  index 
)

It draws the polygon.

Parameters
vPolygon vertex array.
      \param path The polygon path.

      \note This method becomes the owner of the path and is responsible for its deletion.
virtual void te::map::Canvas::drawText ( const te::gm::Point p,
const std::string &  txt,
float  angle = 0.0,
te::at::HorizontalAlignment  hAlign = te::at::Start,
te::at::VerticalAlignment  vAlign = te::at::Baseline 
)
pure virtualinherited

It draws a text.

Color and font family should be defined in advance.

Parameters
pThe text entry point in world coordinate.
txtThe text to be drawn.
angleThe text rotation.
hAlignThe horizontal text alignment.
vAlignThe vertical text alignment.

Implemented in te::qt::widgets::Canvas.

void te::ag::Canvas::drawText ( int  x,
int  y,
const std::string &  tx,
float  angle = 0.0,
te::at::HorizontalAlignment  hAlign = te::at::Start,
te::at::VerticalAlignment  vAlign = te::at::Baseline 
)
virtual

It draws a text.

Color and font family should be defined in advance.

Parameters
xThe text entry point x in device coordinate.
yThe text entry point y in device coordinate.
txThe text to be drawed.
angleThe text rotation.
hAlignThe horizontal text alignment.
vAlignThe vertical text alignment.

Implements te::map::Canvas.

void te::ag::Canvas::drawText ( double *  vin,
const int &  size,
const agg::trans_affine &  matrix,
const std::string &  tx 
)

It draws a text.

Color and font family should be defined in advance.

Parameters
vinThe line coordinate.
sizeThe line size.
matrixThe transformation matrix.
txThe text to be drawed.
void te::ag::Canvas::drawText ( const te::gm::Point wp,
const std::string &  tx,
float  angle = 0.0,
te::at::HorizontalAlignment  hAlign = te::at::Start,
te::at::VerticalAlignment  vAlign = te::at::Baseline 
)

It draws a text.

Color and font family should be defined in advance.

Parameters
wpThe text entry point in world coordinate.
txThe text to be drawed.
angleThe text rotation.
hAlignThe horizontal text alignment.
vAlignThe vertical text alignment.
void te::ag::Canvas::drawText ( const double &  x,
const double &  y,
const std::string &  tx,
float  angle = 0.0,
te::at::HorizontalAlignment  hAlign = te::at::Start,
te::at::VerticalAlignment  vAlign = te::at::Baseline 
)
virtual

It draws a text.

Color and font family should be defined in advance.

Parameters
xThe text entry point x in world coordinate.
yThe text entry point y in world coordinate.
txThe text to be drawed.
angleThe text rotation.
hAlignThe horizontal text alignment.
vAlignThe vertical text alignment.

Implements te::map::Canvas.

void te::ag::Canvas::drawTextBoundary ( int  x,
int  y,
const std::string &  tx,
float  angle = 0.0,
te::at::HorizontalAlignment  hAlign = te::at::Start,
te::at::VerticalAlignment  vAlign = te::at::Baseline 
)

It draws the text boundary.

Color and font family should be defined in advance.

Parameters
xThe text entry point x in device coordinate.
yThe text entry point y in device coordinate.
txThe text to be drawed.
angleThe text rotation.
hAlignThe horizontal text alignment.
vAlignThe vertical text alignment.
void te::ag::Canvas::drawTextBoundary ( const te::gm::Point wp,
const std::string &  tx,
float  angle = 0.0,
te::at::HorizontalAlignment  hAlign = te::at::Start,
te::at::VerticalAlignment  vAlign = te::at::Baseline 
)

It draws the text boundary.

Color and font family should be defined in advance.

Parameters
wpThe text entry point in world coordinate.
txThe text to be drawed.
angleThe text rotation.
hAlignThe horizontal text alignment.
vAlignThe vertical text alignment.
void te::ag::Canvas::drawTextBoundary ( const double &  x,
const double &  y,
const std::string &  tx,
float  angle = 0.0,
te::at::HorizontalAlignment  hAlign = te::at::Start,
te::at::VerticalAlignment  vAlign = te::at::Baseline 
)

It draws the text boundary.

Color and font family should be defined in advance.

Parameters
xThe text entry point x in world coordinate.
yThe text entry point y in world coordinate.
txThe text to be drawed.
angleThe text rotation.
hAlignThe horizontal text alignment.
vAlignThe vertical text alignment.
void te::ag::Canvas::freeImage ( char *  img) const
virtual

This is the method that you should use to release a image generated by the canvas.

Parameters
imgA pointer to an image previously created by the canvas.

Implements te::map::Canvas.

te::color::RGBAColor te::ag::Canvas::getBackgroundColor ( ) const
virtual

It returns the canvas background color.

Returns
The canvas background color.

Implements te::map::Canvas.

unsigned char* te::ag::Canvas::getBuffer ( ) const

It gets a RGBA colors from buffer.

Returns
The Pointer RGBA colors.
Note
The caller of this method will take the ownership of the returned pointer.
te::color::RGBAColor** te::ag::Canvas::getColorsFromBuffer ( int  x = 0,
int  y = 0,
int  w = 0,
int  h = 0 
) const

It gets a RGBA colors from buffer.

Returns
The Pointer RGBA colors.
Note
The caller of this method will take the ownership of the returned pointer.
char* te::ag::Canvas::getData ( const std::string &  file_name,
int &  w,
int &  h 
)
int te::ag::Canvas::getHeight ( ) const
inlinevirtual

It returns the canvas height.

Returns
The canvas height.

Implements te::map::Canvas.

Definition at line 175 of file Canvas.h.

virtual char* te::map::Canvas::getImage ( ImageType  t,
std::size_t &  size,
int  quality = 75,
int  fg = 0 
) const
pure virtualinherited

It returns the internal content as an image in a specific format (PNG, JPEG, ...).

Parameters
tThe image format type (see ImageType enum).
sizeThe image size in bytes.
qualityJPEG quality, generally a value between 0 and 95.
fgForeground color for WBMP images.
Returns
The internal content as an image. The caller will take the ownership of the returned pointer.
Note
Use canvas freeImage in order to release the returned image resources.

Implemented in te::qt::widgets::Canvas.

virtual te::color::RGBAColor** te::map::Canvas::getImage ( const int  x = 0,
const int  y = 0,
const int  w = 0,
const int  h = 0 
) const
pure virtualinherited

It gets a RGBA color array from internal canvas buffer.

Returns
The Pointer RGBA colors.
Note
The caller of this method will take the ownership of the returned array.

Implemented in te::qt::widgets::Canvas.

char* te::ag::Canvas::getImage ( te::map::Canvas::ImageType  t,
size_t &  size 
) const

It returns the internal contents as an image.

Parameters
tThe image format type (see ImageType enum).
sizeThe image size in bytes.
Returns
The internal contents as an image. The caller will take the ownership of the returned pointer.
Note
Use canvas freeImage in order to release the returned image resources.
virtual te::gm::Polygon* te::map::Canvas::getTextBoundary ( const te::gm::Point p,
const std::string &  txt,
float  angle = 0.0,
te::at::HorizontalAlignment  hAlign = te::at::Start,
te::at::VerticalAlignment  vAlign = te::at::Baseline 
)
pure virtualinherited

It returns the text boundary (its enclose rectangle).

Color and font family should be defined in advance.

Parameters
pThe text entry point in world coordinate.
txtThe text to be drawn.
angleThe text rotation.
hAlignThe horizontal text alignment.
vAlignThe vertical text alignment.
Returns
The text boundary in world coordinate.
Note
The caller of this method will take the ownership of the returned Polygon.

Implemented in te::qt::widgets::Canvas.

te::gm::Polygon* te::ag::Canvas::getTextBoundary ( int  x,
int  y,
const std::string &  tx,
float  angle = 0.0,
te::at::HorizontalAlignment  hAlign = te::at::Start,
te::at::VerticalAlignment  vAlign = te::at::Baseline 
)
virtual

It returns text boundary.

Color and font family should be defined in advance.

Parameters
xThe text entry point x in device coordinate.
yThe text entry point y in device coordinate.
txThe text to be drawed.
angleThe text rotation.
hAlignThe horizontal text alignment.
vAlignThe vertical text alignment.
Returns
The text boundary in world coordinate.
Note
The caller of this method will take the ownership of the returned Polygon.

Implements te::map::Canvas.

te::gm::Polygon* te::ag::Canvas::getTextBoundary ( const te::gm::Point wp,
const std::string &  tx,
float  angle = 0.0,
te::at::HorizontalAlignment  hAlign = te::at::Start,
te::at::VerticalAlignment  vAlign = te::at::Baseline 
)

It returns the text boundary.

Color and font family should be defined in advance.

Parameters
wpThe text entry point in world coordinate.
txThe text to be drawed.
angleThe text rotation.
hAlignThe horizontal text alignment.
vAlignThe vertical text alignment.
Returns
The text boundary in world coordinate.
Note
The caller of this method will take the ownership of the returned Polygon.
te::gm::Polygon* te::ag::Canvas::getTextBoundary ( const double &  x,
const double &  y,
const std::string &  tx,
float  angle = 0.0,
te::at::HorizontalAlignment  hAlign = te::at::Start,
te::at::VerticalAlignment  vAlign = te::at::Baseline 
)
virtual

It returns the text boundary.

Color and font family should be defined in advance.

Parameters
xThe text entry point x in world coordinate.
yThe text entry point y in world coordinate.
txThe text to be drawed.
angleThe text rotation.
hAlignThe horizontal text alignment.
vAlignThe vertical text alignment.
Returns
The text boundary in world coordinate.
Note
The caller of this method will take the ownership of the returned Polygon.

Implements te::map::Canvas.

int te::ag::Canvas::getWidth ( ) const
inlinevirtual

It returns the canvas width.

Returns
The canvas width.

Implements te::map::Canvas.

Definition at line 168 of file Canvas.h.

Canvas& te::ag::Canvas::operator= ( const Canvas rhs)
private

Assignment operator not allowed.

Parameters
rhsThe right-hand-side copy that would be used to copy from.
Returns
A reference to this object.
void te::ag::Canvas::resize ( int  w,
int  h 
)
virtual

It adjusts the canvas size (width and height).

Parameters
wThe new canvas width.
hThe new canvas height.
Note
Remember to reset the world (or window) coordinates area before drawing.
This will invalidate the internal transformation function (you must call the setWindow method again before drawing something in the canvas).

Implements te::map::Canvas.

virtual void te::map::Canvas::save ( const char *  fileName,
ImageType  t,
int  quality = 75,
int  fg = 0 
) const
pure virtualinherited

It saves the canvas content to a file image in the specified format type.

Parameters
fileNameThe file name and path where the image will be saved.
tThe image format type (see ImageType enum).
qualityJPEG quality, generally a value between 0 and 95.
fgForeground color for WBMP images.

Implemented in te::qt::widgets::Canvas.

void te::ag::Canvas::save ( const char *  fileName,
te::map::Canvas::ImageType  t,
int  quality = 75,
int  fg = 0 
) const

It saves the canvas content to a file image in the specified format type.

Parameters
fileNameThe file name and path where the image will be saved.
tThe image format type (see ImageType enum).
qualityJPEG quality, generally a value between 0 and 95.
fgForeground color for WBMP images.
Warning
Qt Canvas extended method.
void te::ag::Canvas::setBackgroundColor ( const te::color::RGBAColor color)
virtual

It sets the canvas background color.

The default is totally transparent (255, 255, 255, 100%).

Parameters
colorThe background color.
Note
When this method is called, all the canvas contents is dropped out.

Implements te::map::Canvas.

virtual void te::map::Canvas::setEraseMode ( )
pure virtualinherited

It sets the painter to erase mode.

Implemented in te::qt::widgets::Canvas.

void te::ag::Canvas::setFontFamily ( const std::string &  family)
virtual

It sets the text font family.

Parameters
familyThe new font family for drawing a text.

Implements te::map::Canvas.

virtual void te::map::Canvas::setLineCapStyle ( LineCapStyle  style)
pure virtualinherited

It sets the line cap style.

Parameters
styleThe line cap style.

Implemented in te::qt::widgets::Canvas.

void te::ag::Canvas::setLineColor ( const te::color::RGBAColor color)
virtual

It sets the pen color used to draw line geometries.

Parameters
rRed component color value.
gGreen component color value.
bBlue component color value.
aAlpha component color.
Note
The alpha value will be an integer between 0 and 100, where 0 is totaly opaque and 100 totaly transparent.

Implements te::map::Canvas.

virtual void te::map::Canvas::setLineDashStyle ( LineDashStyle  style)
pure virtualinherited

It sets the line dash style.

Parameters
styleThe line dash style.

Implemented in te::qt::widgets::Canvas.

virtual void te::map::Canvas::setLineDashStyle ( const std::vector< double > &  style)
pure virtualinherited

It sets the line dash style to the given pattern.

Parameters
styleThe line custom dash style.
Note
The style should be specified as an even number of positive double where the entries 0, 2, 4, ... are dashes and 1, 3, 5, ... are spaces.

Implemented in te::qt::widgets::Canvas.

virtual void te::map::Canvas::setLineJoinStyle ( LineJoinStyle  style)
pure virtualinherited

It sets the line join style.

Parameters
styleThe line join style.

Implemented in te::qt::widgets::Canvas.

virtual void te::map::Canvas::setLinePattern ( te::color::RGBAColor **  pattern,
int  ncols,
int  nrows 
)
pure virtualinherited

It sets the line pattern.

The pattern is a matrix of int's, and each position corresponds to a RGBA color.

Parameters
patternThe pattern matrix: a square matrix of int's where each position corresponds to a RGBA color.
ncolsNumber of columns in the matrix.
nrowsNumber of rows in the matrix.

Implemented in te::qt::widgets::Canvas.

virtual void te::map::Canvas::setLinePattern ( char *  pattern,
std::size_t  size,
ImageType  t 
)
pure virtualinherited

It sets the line pattern using a buffered image.

Parameters
patternThe buffered image.
sizeThe buffer image size.
tThe image type used by the style.

Implemented in te::qt::widgets::Canvas.

virtual void te::map::Canvas::setLinePatternOpacity ( int  opacity)
pure virtualinherited

It sets the line pattern opacity.

Parameters
opacityThe pattern opacity.

Implemented in te::qt::widgets::Canvas.

virtual void te::map::Canvas::setLinePatternRotation ( const double &  angle)
pure virtualinherited

It sets the line pattern rotation. Rotation is made ​​from the center of the pattern.

Parameters
angleThe rotation angle in degress.

Implemented in te::qt::widgets::Canvas.

void te::ag::Canvas::setLineStyle ( te::color::RGBAColor **  style,
int  ncols,
int  nrows 
)

It sets the line style.

The style is a matrix of int's, and each position corresponds to a RGBA color.

Parameters
ncolsNumber of columns in the matrix.
nrowsNumber of rows in the matrix.
void te::ag::Canvas::setLineStyle ( char *  style,
int  size,
te::map::Canvas::ImageType  t 
)

It sets the line style.

The style is a matrix of int's, and each position corresponds to a RGBA color.

Parameters
ncolsNumber of columns in the matrix.
nrowsNumber of rows in the matrix.
void te::ag::Canvas::setLineStyle ( const std::string &  fileName)

It sets the line style.

The style is given by an image file. You should only use images that QT can read.

Parameters
fileNameThe file name.
virtual void te::map::Canvas::setLineWidth ( int  w)
pure virtualinherited

It sets the line width.

Parameters
wThe line width.

Implemented in te::qt::widgets::Canvas.

void te::ag::Canvas::setLineWidth ( const int &  w)

It sets the line width.

Parameters
wThe line width.
virtual void te::map::Canvas::setNormalMode ( )
pure virtualinherited

It sets the painter to normal copy source to destination mode.

Implemented in te::qt::widgets::Canvas.

void te::ag::Canvas::setPointColor ( const te::color::RGBAColor color)
virtual

It sets the point drawing color.

Parameters
colorThe new color for drawing a point.

Implements te::map::Canvas.

void te::ag::Canvas::setPointMarkerType ( const ptMarkerType &  type)

It sets the point marker type.

Parameters
typeThe point marker type.
virtual void te::map::Canvas::setPointPattern ( te::color::RGBAColor **  pattern,
int  ncols,
int  nrows 
)
pure virtualinherited

It sets the point pattern.

The pattern is a matrix of int's, and each position corresponds to a RGBA color.

Parameters
patternThe pattern matrix: a square matrix of int's where each position corresponds to a RGBA color.
ncolsNumber of columns in the matrix.
nrowsNumber of rows in the matrix.

Implemented in te::qt::widgets::Canvas.

virtual void te::map::Canvas::setPointPattern ( char *  pattern,
std::size_t  size,
ImageType  t 
)
pure virtualinherited

It sets the point pattern using a buffered image.

Parameters
patternThe buffered image.
sizeThe buffer image size.
tThe image type used by the style.

Implemented in te::qt::widgets::Canvas.

virtual void te::map::Canvas::setPointPatternOpacity ( int  opacity)
pure virtualinherited

It sets the point pattern opacity.

Parameters
opacityThe pattern opacity.

Implemented in te::qt::widgets::Canvas.

virtual void te::map::Canvas::setPointPatternRotation ( const double &  angle)
pure virtualinherited

It sets the point pattern rotation. Rotation is made ​​from the center of the pattern.

Parameters
angleThe rotation angle in degress.

Implemented in te::qt::widgets::Canvas.

void te::ag::Canvas::setPointStyle ( te::color::RGBAColor **  style,
int  ncols,
int  nrows 
)

It sets the point style.

The style is a matrix of int's, and each position corresponds to a RGBA color.

Parameters
styleThe style matrix: a square matrix of int's where each position corresponds to a RGBA color.
ncolsNumber of columns in the matrix.
nrowsNumber of rows in the matrix.
void te::ag::Canvas::setPointStyle ( char *  style,
int  size,
te::map::Canvas::ImageType  t 
)

It sets the point style.

The style is a matrix of int's, and each position corresponds to a RGBA color.

Parameters
styleThe style matrix: a square matrix of int's where each position corresponds to a RGBA color.
tThe image type used by the style.
void te::ag::Canvas::setPointStyle ( const std::string &  fileName)

It sets the point style.

The style is given by an image file. You should only use images that QT can read.

Parameters
fileNameThe file name.
void te::ag::Canvas::setPointWidth ( int  w)
virtual

It sets the point drawing color.

Parameters
wThe new width for drawing a point.

Implements te::map::Canvas.

virtual void te::map::Canvas::setPolygonContourCapStyle ( LineCapStyle  style)
pure virtualinherited

It sets the polygon contour cap style.

Parameters
styleThe polygon contour cap style.

Implemented in te::qt::widgets::Canvas.

void te::ag::Canvas::setPolygonContourColor ( const te::color::RGBAColor color)
virtual

It sets the pen color used to draw the boundary of polygon geometries.

Parameters
rRed component color value.
gGreen component color value.
bBlue component color value.
aAlpha component color.
Note
The alpha value will be an integer between 0 and 100, where 0 is totaly opaque and 100 totaly transparent.

Implements te::map::Canvas.

virtual void te::map::Canvas::setPolygonContourDashStyle ( LineDashStyle  style)
pure virtualinherited

It sets the polygon contour dash style.

Parameters
styleThe polygon contour dash style.

Implemented in te::qt::widgets::Canvas.

virtual void te::map::Canvas::setPolygonContourDashStyle ( const std::vector< double > &  style)
pure virtualinherited

It sets the polygon contour dash style to the given pattern.

Parameters
styleThe polygon contour custom dash style.
Note
The style should be specified as an even number of positive double where the entries 0, 2, 4, ... are dashes and 1, 3, 5, ... are spaces.

Implemented in te::qt::widgets::Canvas.

virtual void te::map::Canvas::setPolygonContourJoinStyle ( LineJoinStyle  style)
pure virtualinherited

It sets the polygon contour join style.

Parameters
styleThe polygon contour join style.

Implemented in te::qt::widgets::Canvas.

virtual void te::map::Canvas::setPolygonContourPattern ( te::color::RGBAColor **  pattern,
int  ncols,
int  nrows 
)
pure virtualinherited

It sets the pen pattern used to draw the boundary of polygon geometries.

The pattern is a matrix of int's, and each position corresponds to a RGBA color.

Parameters
patternThe pattern matrix: a square matrix of int's where each position corresponds to a RGBA color.
ncolsNumber of columns in the matrix.
nrowsNumber of rows in the matrix.

Implemented in te::qt::widgets::Canvas.

virtual void te::map::Canvas::setPolygonContourPattern ( char *  pattern,
std::size_t  size,
ImageType  t 
)
pure virtualinherited

It sets the pen pattern used to draw the boundary of polygon geometries using a buffered image.

Parameters
patternThe buffered image.
sizeThe buffer image size.
tThe image type used by the style.

Implemented in te::qt::widgets::Canvas.

virtual void te::map::Canvas::setPolygonContourPatternOpacity ( int  opacity)
pure virtualinherited

It sets the polygon contour pattern opacity.

Parameters
opacityThe pattern opacity.

Implemented in te::qt::widgets::Canvas.

virtual void te::map::Canvas::setPolygonContourPatternRotation ( const double &  angle)
pure virtualinherited

It sets the polygon contour pattern rotation.

Parameters
angleThe rotation angle in degress.

Implemented in te::qt::widgets::Canvas.

void te::ag::Canvas::setPolygonContourStyle ( te::color::RGBAColor **  style,
int  ncols,
int  nrows 
)

It sets the pen style used to draw the boundary of polygon geometries.

The style is a matrix of int's, and each position corresponds to a RGBA color.

Parameters
styleThe style matrix.
ncolsNumber of columns in the matrix.
nrowsNumber of rows in the matrix.
void te::ag::Canvas::setPolygonContourStyle ( char *  style,
int  size,
te::map::Canvas::ImageType  t 
)

It sets the pen style used to draw the boundary of polygon geometries.

The style is a matrix of int's, and each position corresponds to a RGBA color.

Parameters
ncolsNumber of columns in the matrix.
nrowsNumber of rows in the matrix.
void te::ag::Canvas::setPolygonContourStyle ( const std::string &  fileName)

It sets the polygon contour style.

The style is given by an image file. You should only use images that QT can read.

Parameters
fileNameThe file name.
virtual void te::map::Canvas::setPolygonContourWidth ( int  w)
pure virtualinherited

It sets the polygon contour width.

Parameters
wThe contour width.

Implemented in te::qt::widgets::Canvas.

void te::ag::Canvas::setPolygonContourWidth ( const int &  w)

It sets the polycon contour width.

Parameters
wThe contour width.
void te::ag::Canvas::setPolygonFillColor ( const te::color::RGBAColor color)
virtual

It sets the color used to fill the draw of polygon geometries.

Parameters
rRed component color value.
gGreen component color value.
bBlue component color value.
aAlpha component color.
Note
The alpha value will be an integer between 0 and 100, where 0 is totaly opaque and 100 totaly transparent.

Implements te::map::Canvas.

virtual void te::map::Canvas::setPolygonFillPattern ( te::color::RGBAColor **  pattern,
int  ncols,
int  nrows 
)
pure virtualinherited

It sets the polygon fill pattern.

The pattern is a matrix of int's, and each position corresponds to a RGBA color.

Parameters
patternThe style matrix: a square matrix of int's where each position corresponds to a RGBA color.
ncolsNumber of columns in the matrix.
nrowsNumber of rows in the matrix.

Implemented in te::qt::widgets::Canvas.

virtual void te::map::Canvas::setPolygonFillPattern ( char *  pattern,
std::size_t  size,
ImageType  t 
)
pure virtualinherited

It sets the polygon fill pattern using a buffered image.

Parameters
patternThe buffered image.
sizeThe buffer image size.
tThe image type used by the style.

Implemented in te::qt::widgets::Canvas.

void te::ag::Canvas::setPolygonFillStyle ( te::color::RGBAColor **  style,
int  ncols,
int  nrows 
)

It sets the polygon fill style.

The style is a matrix of int's, and each position corresponds to a RGBA color.

Parameters
ncolsNumber of columns in the matrix.
nrowsNumber of rows in the matrix.
void te::ag::Canvas::setPolygonFillStyle ( char *  style,
int  size,
te::map::Canvas::ImageType  t 
)

It sets the polygon fill style.

The style is a matrix of int's, and each position corresponds to a RGBA color.

Parameters
ncolsNumber of columns in the matrix.
nrowsNumber of rows in the matrix.
void te::ag::Canvas::setPolygonFillStyle ( const std::string &  fileName)

It sets the polygon fill style.

The style is given by an image file. You should only use images that QT can read.

Parameters
fileNameThe file name.
virtual void te::map::Canvas::setPolygonPatternOpacity ( int  opacity)
pure virtualinherited

It sets the polygon pattern opacity.

Parameters
opacityThe pattern opacity.

Implemented in te::qt::widgets::Canvas.

void te::ag::Canvas::setPolygonPatternOpacity ( const unsigned char &  opac)

It sets the polycon brush icon width.

Parameters
wThe icon width.
virtual void te::map::Canvas::setPolygonPatternRotation ( const double &  angle)
pure virtualinherited

It sets the polygon pattern rotation.

Parameters
angleThe rotation angle in degress.

Implemented in te::qt::widgets::Canvas.

virtual void te::map::Canvas::setPolygonPatternWidth ( int  w)
pure virtualinherited

It sets the polygon pattern width.

Parameters
wThe pattern width.

Implemented in te::qt::widgets::Canvas.

void te::ag::Canvas::setPolygonPatternWidth ( const int &  w)

It sets the polycon brush icon width.

Parameters
wThe icon width.
void te::ag::Canvas::setTextBoundaryColor ( const te::color::RGBAColor color)

It sets the text boundary drawing color.

Parameters
colorThe new color for drawing a text boundary.
void te::ag::Canvas::setTextBoundaryOpacity ( const int &  opacity)

It sets the text boundary opacity.

Parameters
opacityThe new opacity for drawing a text boundary.
void te::ag::Canvas::setTextBoundaryWidth ( const int &  width)

It sets the text boundary width.

Parameters
widthThe new width for drawing a text boundary.
void te::ag::Canvas::setTextColor ( const te::color::RGBAColor color)
virtual

It sets the text drawing color.

Parameters
colorThe new color for drawing a text.

Implements te::map::Canvas.

virtual void te::map::Canvas::setTextContourColor ( const te::color::RGBAColor color)
pure virtualinherited

It sets the text contour (outline) drawing color.

Parameters
colorThe new color for drawing the contour of texts.

Implemented in te::qt::widgets::Canvas.

virtual void te::map::Canvas::setTextContourEnabled ( bool  b)
pure virtualinherited

It controls the display of the text outline.

Parameters
bTrue to display and false to not display.

Implemented in te::qt::widgets::Canvas.

virtual void te::map::Canvas::setTextContourOpacity ( int  opacity)
pure virtualinherited

It sets the text contour opacity.

Parameters
opacityThe new opacity for drawing the text contour.

Implemented in te::qt::widgets::Canvas.

virtual void te::map::Canvas::setTextContourWidth ( int  width)
pure virtualinherited

It sets the text contour width.

Parameters
widthThe new width for drawing the text contour.

Implemented in te::qt::widgets::Canvas.

void te::ag::Canvas::setTextDecorationColor ( const te::color::RGBAColor color)
virtual

It sets the text strike out flag.

Parameters
colorThe new color for drawing text decoration.

Implements te::map::Canvas.

void te::ag::Canvas::setTextDecorationWidth ( int  width)
virtual

It sets the text strike out flag.

Parameters
widthThe new width for drawing text decoration.

Implements te::map::Canvas.

virtual void te::map::Canvas::setTextJustification ( te::at::LineJustification  just)
pure virtualinherited

It sets the text justification for multi line text.

Parameters
justThe new justification for drawing a multi line text.

Implemented in te::qt::widgets::Canvas.

void te::ag::Canvas::setTextMultiLineJustification ( const te::at::LineJustification just)

It sets the multi line text justification.

Parameters
justThe new justification for drawing a multi line text.
virtual void te::map::Canvas::setTextMultiLineSpacing ( int  spacing)
pure virtualinherited

It sets the multi line text spacing.

Parameters
spacingThe new spacing for drawing a multi line text.

Implemented in te::qt::widgets::Canvas.

void te::ag::Canvas::setTextMultiLineSpacing ( const int &  spacing)

It sets the multi line text spacing.

Parameters
spacingThe new spacing for drawing a multi line text.
virtual void te::map::Canvas::setTextOpacity ( int  opacity)
pure virtualinherited

It sets the text opacity.

Parameters
opacityThe new opacity for drawing a text.

Implemented in te::qt::widgets::Canvas.

void te::ag::Canvas::setTextOpacity ( const int &  opacity)

It sets the text opacity.

Parameters
opacityThe new opacity for drawing a text.
void te::ag::Canvas::setTextOverline ( bool  b)
virtual

It sets the text overline flag.

Parameters
bTrue: for overline. False other wise.

Implements te::map::Canvas.

void te::ag::Canvas::setTextPointSize ( double  psize)
virtual

It sets the text Point Size.

Parameters
psizeThe new point size for drawing a text.

Implements te::map::Canvas.

virtual void te::map::Canvas::setTextStretch ( std::size_t  stretch)
pure virtualinherited

It sets the text stretch.

Parameters
stretchThe new stretch for drawing a text.

Implemented in te::qt::widgets::Canvas.

void te::ag::Canvas::setTextStretch ( size_t  stretch)

It sets the text stretch.

Parameters
stretchThe new stretch for drawing a text.
Note
QT defines the following values: QFont::UltraCondensed 50 50 QFont::ExtraCondensed 62 62 QFont::Condensed 75 75 QFont::SemiCondensed 87 87 QFont::Unstretched 100 100 QFont::SemiExpanded 112 112 QFont::Expanded 125 125 QFont::ExtraExpanded 150 150 QFont::UltraExpanded 200 200
void te::ag::Canvas::setTextStrikeOut ( bool  b)
virtual

It sets the text strike out flag.

Parameters
bTrue: for strike out. False other wise.

Implements te::map::Canvas.

void te::ag::Canvas::setTextStyle ( te::at::FontStyle  style)
virtual

It sets the text style.

Parameters
styleThe new style for drawing a text.

Implements te::map::Canvas.

void te::ag::Canvas::setTextUnderline ( bool  b)
virtual

It sets the text underline flag.

Parameters
bTrue: for underline. False other wise.

Implements te::map::Canvas.

void te::ag::Canvas::setTextWeight ( te::at::FontWeight  weight)
virtual

It sets the text weight.

Parameters
weightThe new weight for drawing a text.

Implements te::map::Canvas.

void te::ag::Canvas::setWindow ( const double &  llx,
const double &  lly,
const double &  urx,
const double &  ury 
)
virtual

It sets the world (or window) coordinates area (supposing a cartesian reference system).

Parameters
llxLower left x-coordinate of the World (in the spatial coordinate system of the datasets to be drawn).
llyLower left y-coordinate of the World (in the spatial coordinate system of the datasets to be drawn).
urxUpper right x-coordinate of the World (in the spatial coordinate system of the datasets to be drawn).
uryUpper right y-coordinate of the World (in the spatial coordinate system of the datasets to be drawn).

Implements te::map::Canvas.

bool te::ag::Canvas::write_ppm ( const std::string &  file_name)

It draws a text.

Color and font family should be defined in advance.

Parameters
pThe text entry point i device coordinate.
txThe text to be drawed.
angleThe text rotation.
hAlignThe horizontal text alignment.
vAlignThe vertical text alignment.
Note
Qt Canvas extended method.

It draws the text boundary.

Color and font family should be defined in advance.

Parameters
pThe text entry point in device coordinate.
txThe text to be drawed.
angleThe text rotation.
hAlignThe horizontal text alignment.
vAlignThe vertical text alignment.
Warning
Qt Canvas extended method.

It returns text boundary. Color and font family should be defined in advance.

Parameters
pThe text entry point in device coordinate.
txThe text to be drawed.
angleThe text rotation.
hAlignThe horizontal text alignment.
vAlignThe vertical text alignment.
Returns
The text boundary in world coordinate.
Note
The caller of this method will take the ownership of the returned Polygon.
Warning
Qt Canvas extended method.

It returns the internal pixmap used to draw geographical objects.

Returns
The internal pixmap used to draw geographical objects. Don't delete it!
Warning
Qt Canvas extended method.
Note
You can not delete this pointer.

It sets new device as QPrinter.

Parameters
deviceThe new paint device.
Note
The canvas becomes owner of the device. You can not delete this pointer

It returns the device resolution.

Returns
The device resolution.

It returns the matrix.

Returns
The marix.

Member Data Documentation

color_type te::ag::Canvas::m_bgColor
private

Canvas background color. Defaults: white fully transparent.

Definition at line 1256 of file Canvas.h.

unsigned char* te::ag::Canvas::m_buffer
private

Definition at line 1248 of file Canvas.h.

agg::int8u* te::ag::Canvas::m_contourPatternBuffer
private

Definition at line 1265 of file Canvas.h.

agg::rendering_buffer te::ag::Canvas::m_contourPatternRenderingBuffer
private

Definition at line 1266 of file Canvas.h.

int te::ag::Canvas::m_dheight
private

The device height.

Definition at line 1243 of file Canvas.h.

int te::ag::Canvas::m_dwidth
private

The device width.

Definition at line 1242 of file Canvas.h.

font_engine_type* te::ag::Canvas::m_fontEngine
private

Definition at line 1284 of file Canvas.h.

font_manager_type* te::ag::Canvas::m_fontManager
private

Definition at line 1285 of file Canvas.h.

HDC te::ag::Canvas::m_hdc
private

Definition at line 1241 of file Canvas.h.

color_type te::ag::Canvas::m_lineColor
private

Line color.

Definition at line 1268 of file Canvas.h.

agg::int8u* te::ag::Canvas::m_linePatternBuffer
private

Definition at line 1270 of file Canvas.h.

agg::rendering_buffer te::ag::Canvas::m_linePatternRenderingBuffer
private

Definition at line 1271 of file Canvas.h.

double te::ag::Canvas::m_lineWidth
private

Line width.

Definition at line 1269 of file Canvas.h.

agg::trans_affine te::ag::Canvas::m_matrix
private

Matrix that transforms the world coordinate to device coordinate.

Definition at line 1254 of file Canvas.h.

pixfmt* te::ag::Canvas::m_pixfmt
private

Definition at line 1250 of file Canvas.h.

color_type te::ag::Canvas::m_polyContourColor
private

Polygon contoyr color.

Definition at line 1259 of file Canvas.h.

double te::ag::Canvas::m_polyContourWidth
private

Polygon contour width.

Definition at line 1260 of file Canvas.h.

color_type te::ag::Canvas::m_polyFillColor
private

Polygon fill color.

Definition at line 1258 of file Canvas.h.

agg::int8u* te::ag::Canvas::m_polyPatternBuffer
private

Definition at line 1262 of file Canvas.h.

unsigned char te::ag::Canvas::m_polyPatternOpacity
private

The pattern opacity.

Definition at line 1264 of file Canvas.h.

agg::rendering_buffer te::ag::Canvas::m_polyPatternRenderingBuffer
private

Definition at line 1263 of file Canvas.h.

unsigned int te::ag::Canvas::m_polyPatternWidth
private

The pattern width used to fill a polygon.

Definition at line 1261 of file Canvas.h.

color_type te::ag::Canvas::m_ptColor
private

Point color.

Definition at line 1273 of file Canvas.h.

agg::marker_e te::ag::Canvas::m_ptMarkerType
private

Definition at line 1275 of file Canvas.h.

agg::int8u* te::ag::Canvas::m_ptPatternBuffer
private

Definition at line 1276 of file Canvas.h.

agg::rendering_buffer te::ag::Canvas::m_ptPatternRenderingBuffer
private

Definition at line 1277 of file Canvas.h.

int te::ag::Canvas::m_ptWidth
private

Point width.

Definition at line 1274 of file Canvas.h.

agg::rasterizer_scanline_aa te::ag::Canvas::m_rasterizer
private

Definition at line 1252 of file Canvas.h.

agg::renderer_base<pixfmt> te::ag::Canvas::m_rendererBase
private

Definition at line 1251 of file Canvas.h.

agg::rendering_buffer te::ag::Canvas::m_renderingBuffer
private

Definition at line 1249 of file Canvas.h.

agg::scanline_p8 te::ag::Canvas::m_scanline
private

Definition at line 1253 of file Canvas.h.

double te::ag::Canvas::m_textLetterSpacing
private

Text letter spacing.

Definition at line 1293 of file Canvas.h.

int te::ag::Canvas::m_textLineJustification
private

Text multi line justification.

Definition at line 1296 of file Canvas.h.

double te::ag::Canvas::m_textLineSpacing
private

Text multi line spacing.

Definition at line 1295 of file Canvas.h.

double te::ag::Canvas::m_textWordSpacing
private

Text word spacing.

Definition at line 1294 of file Canvas.h.

color_type te::ag::Canvas::m_txBoundaryColor
private

Text boundary color.

Definition at line 1287 of file Canvas.h.

double te::ag::Canvas::m_txBoundaryWidth
private

Text boundary color.

Definition at line 1288 of file Canvas.h.

color_type te::ag::Canvas::m_txColor
private

Text color.

Definition at line 1286 of file Canvas.h.

color_type te::ag::Canvas::m_txDecorationColor
private

Definition at line 1291 of file Canvas.h.

int te::ag::Canvas::m_txDecorationType
private

none=0, underline=1, overline=2 or strikeout=3.

Definition at line 1290 of file Canvas.h.

double te::ag::Canvas::m_txDecorationWidth
private

Definition at line 1292 of file Canvas.h.

double te::ag::Canvas::m_txXScale
private

Definition at line 1289 of file Canvas.h.

double te::ag::Canvas::m_wllx
private

Lower left x-coordinate of the World (in the spatial coordinate system of the datasets to be drawn).

Definition at line 1244 of file Canvas.h.

double te::ag::Canvas::m_wlly
private

Lower left y-coordinate of the World (in the spatial coordinate system of the datasets to be drawn).

Definition at line 1245 of file Canvas.h.

double te::ag::Canvas::m_wurx
private

Upper right x-coordinate of the World (in the spatial coordinate system of the datasets to be drawn).

Definition at line 1246 of file Canvas.h.

double te::ag::Canvas::m_wury
private

Upper right y-coordinate of the World (in the spatial coordinate system of the datasets to be drawn).

Definition at line 1247 of file Canvas.h.


The documentation for this class was generated from the following file: