te::qt::widgets::Canvas Class Reference

A canvas built on top of Qt. More...

#include <Canvas.h>

Inheritance diagram for te::qt::widgets::Canvas:
te::map::Canvas

Public Member Functions

QPainter * getPainter ()
 
Initializer Methods

Methods related to instantiation and destruction.

 Canvas (int w, int h, int devType=QInternal::Pixmap)
 It initializes a new Canvas and associates a pixmap as the default device. More...
 
 Canvas (QPaintDevice *device)
 It initializes a new Canvas associated with the given paint device. More...
 
 ~Canvas ()
 Destructor. More...
 
Methods Inherited From Abstract Canvas

These methods are re-implementations from abstract canvas.

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 calcAspectRatio (double &llx, double &lly, double &urx, double &ury, const te::map::AlignType hAlign=te::map::Center, const te::map::AlignType vAlign=te::map::Center)
 It calculates the best aspect ratio for world (or window) coordinates area (supposing a cartesian reference system). More...
 
void calcAspectRatio (te::gm::Envelope *envelope, const te::map::AlignType hAlign=te::map::Center, const te::map::AlignType vAlign=te::map::Center)
 It calculates the best aspect ratio for 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...
 
void draw (const te::gm::Geometry *geom)
 It draws the geometry on canvas. More...
 
void draw (const te::gm::Point *point)
 It draws the point on canvas. More...
 
void draw (const te::gm::MultiPoint *mpoint)
 It draws the MultiPoint on canvas. More...
 
void draw (const te::gm::LineString *line)
 It draws the LineString on canvas. More...
 
void draw (const te::gm::MultiLineString *mline)
 It draws the MultiLineString on canvas. More...
 
void draw (const te::gm::Polygon *poly)
 It draws the polygon on canvas. More...
 
void draw (const te::gm::MultiPolygon *mpoly)
 It draws the MultiPolygon on canvas. More...
 
void draw (const te::gm::GeometryCollection *g)
 It draws the GeometryCollection on canvas. More...
 
void draw (const te::gm::MultiSurface *g)
 It draws the MultiSurface on canvas. More...
 
void save (const char *fileName, te::map::ImageType t, int quality=75, int fg=0) const
 It saves the canvas content to a file image in the specified format type. More...
 
char * getImage (te::map::ImageType t, std::size_t &size, int quality=75, int fg=0) const
 It returns the internal content as an image in a specific format (PNG, JPEG, ...). More...
 
te::color::RGBAColor ** getImage (const int x=0, const int y=0, const int w=0, const int h=0) const
 It gets a RGBA color array from internal canvas buffer. More...
 
void freeImage (char *img) const
 This is the method that you should use to release an image generated by the canvas. More...
 
void drawImage (char *src, std::size_t size, te::map::ImageType t)
 It draws the src image over the canvas. More...
 
void drawImage (te::color::RGBAColor **src, int w, int h)
 It draws the src image over the canvas. More...
 
void drawImage (int x, int y, char *src, std::size_t size, te::map::ImageType t)
 It draws the src image 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 image over the canvas at the specified position (x, y). More...
 
void drawImage (int x, int y, int w, int h, char *src, std::size_t size, te::map::ImageType t)
 It draws the source image 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 source image 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, std::size_t size, te::map::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 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...
 
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 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...
 
void drawImage (int x, int y, te::rst::Raster *src, int opacity=TE_OPAQUE)
 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...
 
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)
 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...
 
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...
 
void drawText (int x, int y, const std::string &txt, 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 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)
 It draws a text. More...
 
void drawText (const double &x, const double &y, const std::string &txt, 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 (const te::at::Text *tx)
 It draws an annotaion text. More...
 
te::gm::PolygongetTextBoundary (int x, int y, const std::string &txt, float angle=0.0, te::at::HorizontalAlignment hAlign=te::at::Start, te::at::VerticalAlignment vAlign=te::at::Baseline)
 It returns the text boundary (its enclose rectangle). More...
 
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)
 It returns the text boundary (its enclose rectangle). More...
 
te::gm::PolygongetTextBoundary (const double &x, const double &y, const std::string &txt, float angle=0.0, te::at::HorizontalAlignment hAlign=te::at::Start, te::at::VerticalAlignment vAlign=te::at::Baseline)
 It returns the text boundary (its enclose rectangle). More...
 
void setTextColor (const te::color::RGBAColor &color)
 It sets the text drawing color. More...
 
void setTextOpacity (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 (std::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 color for drawing text decoration. More...
 
void setTextDecorationWidth (int width)
 It sets the width for drawing text decoration. More...
 
void setTextContourColor (const te::color::RGBAColor &color)
 It sets the text contour (outline) drawing color. More...
 
void setTextContourEnabled (bool b)
 It controls the display of the text outline. More...
 
void setTextContourOpacity (int opacity)
 It sets the text contour opacity. More...
 
void setTextContourWidth (int width)
 It sets the text contour width. More...
 
void setTextJustification (te::at::LineJustification just)
 It sets the text justification for multi line text. More...
 
void setTextMultiLineSpacing (int spacing)
 It sets the multi line text spacing. More...
 
void setPointColor (const te::color::RGBAColor &color)
 It sets the point drawing color. More...
 
void setPointWidth (int w)
 It sets the point width. If point has a patterns, this pattern is scaled to width. More...
 
void setPointPattern (te::color::RGBAColor **pattern, int ncols, int nrows)
 It sets the point pattern. More...
 
void setPointPattern (char *pattern, std::size_t size, te::map::ImageType t)
 It sets the point pattern using a buffered image. More...
 
void setPointPatternRotation (const double &angle)
 It sets the point pattern rotation. Rotation is made ​​from the center of the pattern. More...
 
void setPointPatternOpacity (int opacity)
 It sets the point pattern opacity. More...
 
void setLineColor (const te::color::RGBAColor &color)
 It sets the pen color used to draw line geometries. More...
 
void setLinePattern (te::color::RGBAColor **pattern, int ncols, int nrows)
 It sets the line pattern. More...
 
void setLinePattern (char *pattern, std::size_t size, te::map::ImageType t)
 It sets the line pattern using a buffered image. More...
 
void setLinePatternRotation (const double &angle)
 It sets the line pattern rotation. Rotation is made ​​from the center of the pattern. More...
 
void setLinePatternOpacity (int opacity)
 It sets the line pattern opacity. More...
 
void setLineDashStyle (te::map::LineDashStyle style)
 It sets the line dash style. More...
 
void setLineDashStyle (const std::vector< double > &style)
 It sets the line dash style to the given pattern. More...
 
void setLineCapStyle (te::map::LineCapStyle style)
 It sets the line cap style. More...
 
void setLineJoinStyle (te::map::LineJoinStyle style)
 It sets the line join style. More...
 
void setLineWidth (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 setPolygonFillColor (const QBrush &color)
 
void setPolygonContourColor (const te::color::RGBAColor &color)
 It sets the pen color used to draw the boundary of polygon geometries. More...
 
void setPolygonFillPattern (te::color::RGBAColor **pattern, int ncols, int nrows)
 It sets the polygon fill pattern. More...
 
void setPolygonFillPattern (char *pattern, std::size_t size, te::map::ImageType t)
 It sets the polygon fill pattern using a buffered image. More...
 
void setPolygonPatternWidth (int w)
 It sets the polygon pattern width. More...
 
void setPolygonPatternRotation (const double &angle)
 It sets the polygon pattern rotation. More...
 
void setPolygonPatternOpacity (int opacity)
 It sets the polygon pattern opacity. More...
 
void setPolygonContourPattern (te::color::RGBAColor **pattern, int ncols, int nrows)
 It sets the pen pattern used to draw the boundary of polygon geometries. More...
 
void setPolygonContourPattern (char *pattern, std::size_t size, te::map::ImageType t)
 It sets the pen pattern used to draw the boundary of polygon geometries using a buffered image. More...
 
void setPolygonContourWidth (int w)
 It sets the polygon contour width. More...
 
void setPolygonContourPatternRotation (const double &angle)
 It sets the polygon contour pattern rotation. More...
 
void setPolygonContourPatternOpacity (int opacity)
 It sets the polygon contour pattern opacity. More...
 
void setPolygonContourDashStyle (te::map::LineDashStyle style)
 It sets the polygon contour dash style. More...
 
void setPolygonContourDashStyle (const std::vector< double > &style)
 It sets the polygon contour dash style to the given pattern. More...
 
void setPolygonContourCapStyle (te::map::LineCapStyle style)
 It sets the polygon contour cap style. More...
 
void setPolygonContourJoinStyle (te::map::LineJoinStyle style)
 It sets the polygon contour join style. More...
 
void setEraseMode ()
 It sets the painter to erase mode. More...
 
void setNormalMode ()
 It sets the painter to normal copy source to destination mode. More...
 
Qt Canvas Specific Methos

Methods that belongs only to Qt Canvas.

void drawText (const QPoint &p, const std::string &txt, float angle=0.0, te::at::HorizontalAlignment hAlign=te::at::Start, te::at::VerticalAlignment vAlign=te::at::Baseline)
 It draws a text. More...
 
te::gm::PolygongetTextBoundary (const QPoint &p, const std::string &txt, float angle=0.0, te::at::HorizontalAlignment hAlign=te::at::Start, te::at::VerticalAlignment vAlign=te::at::Baseline)
 It returns text boundary. Color and font family should be defined in advance. More...
 
QPixmap * getPixmap () const
 It returns the internal pixmap used to draw geographical objects. More...
 
QImage * getImage () const
 It returns the internal image used to draw geographical objects. More...
 
QPaintDevice * getDevice () const
 It returns the internal device used to draw geographical objects. More...
 
void setDevice (QPaintDevice *device, bool takeOwnerShip)
 It sets new device as QPrinter. More...
 
int getResolution ()
 It returns the device resolution. More...
 
QMatrix getMatrix ()
 It returns the matrix. More...
 
void setMatrix (const QMatrix &matrix)
 
void setRenderHint (QPainter::RenderHint hint, bool on=true)
 Sets the given render hint on the canvas painter if on is true; otherwise clears the render hint. More...
 

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...
 
Auxiliary Methods

Auxiliary methods.

void setLineDashStyle (QPen &pen, const std::vector< double > &style)
 It adjusts the given pen to use the given pattern. More...
 
void updateAlpha (QImage &img, const int &opacity)
 It updates the alpha channel of the given image using the given opacity value. More...
 
void createPointPatterns ()
 It creates two patterns. A pattern used to draw selected objects and the other used to erase this pattern. More...
 
void drawContour (const te::gm::LineString *line)
 It draw the polygon contour. More...
 

Private Attributes

QColor m_bgColor
 Canvas background color. Defaults: white fully transparent. More...
 
bool m_erase
 used for erase operation. More...
 
QFont m_font
 The text font. More...
 
bool m_isDeviceOwner
 Tells if canvas is the owner of the paint device. More...
 
QColor m_lnColor
 The color used to draw lines. More...
 
QPen m_lnPen
 The pen used to draw lines. More...
 
QMatrix m_matrix
 Matrix that transforms the world coordinate to device coordinate. More...
 
QPainter m_painter
 The painter used to draw geometric objects. More...
 
std::map< std::string, QPixmap * > m_patterns
 The pixmap styles used to draw patterns. More...
 
QBrush m_polyBrush
 The brush used to fill polygon. More...
 
QColor m_polyColor
 The color used to fill polygon (solid, marker or pattern). More...
 
QColor m_polyContourColor
 The color used to draw polygon contour. More...
 
QPen m_polyContourPen
 The pen used to draw contour polygon. More...
 
QBrush m_polyDefaultBrush
 The brush used to fill polygon. More...
 
QImage * m_polyImage
 The pattern image used to fill polygon. More...
 
int m_polyPatternWidth
 The width used to draw marker or pattern. More...
 
QImage * m_polyRotatedImage
 The pattern rotated image used to fill polygon. More...
 
QPointF m_pt
 Point buffer to avoid creating another point instance. More...
 
QImage * m_ptClearPatternImg
 The marker or pattern used to clear (erase point). More...
 
QColor m_ptColor
 The color used to draw point (pixel) or marker. More...
 
QColor m_ptColorFrom
 Indicates the color that originated the pattern that shows the status of selection. Used for optmization. More...
 
int m_ptHOffset
 Horizontal offset in pixels (in device coordinate) applied to point pattern or marker. More...
 
QImage * m_ptImg
 The marker or pattern used to point. More...
 
QImage * m_ptImgRotated
 The marker or pattern already with rotation used to draw points. More...
 
QPen m_ptPen
 The pen used to draw points. More...
 
double m_ptRotation
 The point pattern rotation. More...
 
QImage * m_ptSelectionPatternImg
 The marker or pattern used to show selection status. The color is mixed with point pattern. More...
 
int m_ptVOffset
 Vertical offset in pixels (in device coordinate) applied to point pattern or marker. More...
 
int m_ptWidth
 The width for point markers and point pattern. More...
 
QBrush m_txtBrush
 The brush used to draw texts. More...
 
bool m_txtContourEnabled
 The flag indicates whether the outline of the text should be drawn. More...
 
QPen m_txtContourPen
 The pen used to draw the text contour. More...
 
int m_txtLetterSpacing
 Text letter spacing. More...
 
int m_txtLineSpacing
 Text multi line spacing. More...
 
int m_txtWordSpacing
 Text word spacing. More...
 

Detailed Description

A canvas built on top of Qt.

See also
te::map::Canvas

Definition at line 54 of file Canvas.h.

Constructor & Destructor Documentation

te::qt::widgets::Canvas::Canvas ( int  w,
int  h,
int  devType = QInternal::Pixmap 
)

It initializes a new Canvas and associates a pixmap as the default device.

Parameters
wThe internal pixmap width in pixels.
hThe internal pixmap height in pixels.
devTypeThe internal device. It can be Pixmap or Image.
te::qt::widgets::Canvas::Canvas ( QPaintDevice *  device)

It initializes a new Canvas associated with the given paint device.

Parameters
deviceThe paint device that will be associated to this canvas.
Note
The canvas will NOT take the ownership of the given device.
te::qt::widgets::Canvas::~Canvas ( )
virtual

Destructor.

Reimplemented from te::map::Canvas.

te::qt::widgets::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::qt::widgets::Canvas::calcAspectRatio ( double &  llx,
double &  lly,
double &  urx,
double &  ury,
const te::map::AlignType  hAlign = te::map::Center,
const te::map::AlignType  vAlign = te::map::Center 
)
virtual

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.

Implements te::map::Canvas.

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

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.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::clear ( )
virtual

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

Implements te::map::Canvas.

void te::qt::widgets::Canvas::createPointPatterns ( )
private

It creates two patterns. A pattern used to draw selected objects and the other used to erase this pattern.

void te::qt::widgets::Canvas::draw ( const te::gm::Geometry geom)
virtual

It draws the geometry on canvas.

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

Implements te::map::Canvas.

void te::qt::widgets::Canvas::draw ( const te::gm::Point point)
virtual

It draws the point on canvas.

Parameters
pointThe point.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::draw ( const te::gm::MultiPoint mpoint)
virtual

It draws the MultiPoint on canvas.

Parameters
mpointThe MultiPoint.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::draw ( const te::gm::LineString line)
virtual

It draws the LineString on canvas.

Parameters
lineThe LineString.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::draw ( const te::gm::MultiLineString mline)
virtual

It draws the MultiLineString on canvas.

Parameters
mlineThe MultiLineString.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::draw ( const te::gm::Polygon poly)
virtual

It draws the polygon on canvas.

Parameters
polyThe polygon.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::draw ( const te::gm::MultiPolygon mpoly)
virtual

It draws the MultiPolygon on canvas.

Parameters
mpolyThe MultiPolygon.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::draw ( const te::gm::GeometryCollection g)
virtual

It draws the GeometryCollection on canvas.

Parameters
gThe GeometryCollection.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::draw ( const te::gm::MultiSurface g)
virtual

It draws the MultiSurface on canvas.

Parameters
gThe MultiSurface.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::draw ( const te::at::Text txt)
virtual

It draws an annotaion text.

Parameters
txtThe annotation text to be drawn.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::drawContour ( const te::gm::LineString line)
private

It draw the polygon contour.

void te::qt::widgets::Canvas::drawImage ( char *  src,
std::size_t  size,
te::map::ImageType  t 
)
virtual

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).

Implements te::map::Canvas.

void te::qt::widgets::Canvas::drawImage ( te::color::RGBAColor **  src,
int  w,
int  h 
)
virtual

It draws the src image over the canvas.

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

Implements te::map::Canvas.

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

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).

Implements te::map::Canvas.

void te::qt::widgets::Canvas::drawImage ( int  x,
int  y,
te::color::RGBAColor **  src,
int  w,
int  h 
)
virtual

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.
srcThe source image.
wThe image width (number of columns).
hThe image height (number of rows).

Implements te::map::Canvas.

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

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).

Implements te::map::Canvas.

void te::qt::widgets::Canvas::drawImage ( int  x,
int  y,
int  w,
int  h,
te::color::RGBAColor **  src,
int  srcw,
int  srch 
)
virtual

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.
srcThe source image.
srcwThe source image width (number of columns).
srchThe source image height (number of rows).

Implements te::map::Canvas.

void te::qt::widgets::Canvas::drawImage ( int  x,
int  y,
int  w,
int  h,
char *  src,
std::size_t  size,
te::map::ImageType  t,
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 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.

Implements te::map::Canvas.

void te::qt::widgets::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 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.
srcThe source image.
sxThe source image start position.
syThe source image start position.
swThe source image rectangle width.
shThe source image rectangle height.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::drawImage ( int  x,
int  y,
te::rst::Raster src,
int  opacity = TE_OPAQUE 
)
virtual

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

Implements te::map::Canvas.

void te::qt::widgets::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 
)
virtual

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

Implements te::map::Canvas.

void te::qt::widgets::Canvas::drawPixel ( int  x,
int  y 
)
virtual

It sets a pixel using the point pen.

Parameters
xColumn.
yRow.

Implements te::map::Canvas.

void te::qt::widgets::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.
    yRow.
    colorPixel color.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::drawText ( int  x,
int  y,
const std::string &  txt,
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.
txtThe text to be drawn.
angleThe text rotation.
hAlignThe horizontal text alignment.
vAlignThe vertical text alignment.

Implements te::map::Canvas.

void te::qt::widgets::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 
)
virtual

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.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::drawText ( const double &  x,
const double &  y,
const std::string &  txt,
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.
txtThe text to be drawn.
angleThe text rotation.
hAlignThe horizontal text alignment.
vAlignThe vertical text alignment.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::drawText ( const QPoint &  p,
const std::string &  txt,
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
pThe text entry point i device coordinate.
txtThe text to be drawed.
angleThe text rotation.
hAlignThe horizontal text alignment.
vAlignThe vertical text alignment.
Note
Qt Canvas extended method.
void te::qt::widgets::Canvas::freeImage ( char *  img) const
virtual

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

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

Implements te::map::Canvas.

te::color::RGBAColor te::qt::widgets::Canvas::getBackgroundColor ( ) const
virtual

It returns the canvas background color.

Returns
The canvas background color.

Implements te::map::Canvas.

QPaintDevice* te::qt::widgets::Canvas::getDevice ( ) const

It returns the internal device used to draw geographical objects.

Returns
The internal device used to draw geographical objects. Don't delete it!
Warning
Qt Canvas extended method.
Note
You can not delete this pointer.
int te::qt::widgets::Canvas::getHeight ( ) const
virtual

It returns the canvas height.

Returns
The canvas height.

Implements te::map::Canvas.

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

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.

Implements te::map::Canvas.

te::color::RGBAColor** te::qt::widgets::Canvas::getImage ( const int  x = 0,
const int  y = 0,
const int  w = 0,
const int  h = 0 
) const
virtual

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.

Implements te::map::Canvas.

QImage* te::qt::widgets::Canvas::getImage ( ) const

It returns the internal image used to draw geographical objects.

Returns
The internal image used to draw geographical objects. Don't delete it! Null is returned if device is not a image.
Warning
Qt Canvas extended method.
Note
You can not delete this pointer.
QMatrix te::qt::widgets::Canvas::getMatrix ( )

It returns the matrix.

Returns
The marix.
QPainter* te::qt::widgets::Canvas::getPainter ( )
QPixmap* te::qt::widgets::Canvas::getPixmap ( ) const

It returns the internal pixmap used to draw geographical objects.

Returns
The internal pixmap used to draw geographical objects. Don't delete it! Null is returned if device is not a pixmap.
Warning
Qt Canvas extended method.
Note
You can not delete this pointer.
int te::qt::widgets::Canvas::getResolution ( )

It returns the device resolution.

Returns
The device resolution.
te::gm::Polygon* te::qt::widgets::Canvas::getTextBoundary ( int  x,
int  y,
const std::string &  txt,
float  angle = 0.0,
te::at::HorizontalAlignment  hAlign = te::at::Start,
te::at::VerticalAlignment  vAlign = te::at::Baseline 
)
virtual

It returns the text boundary (its enclose rectangle).

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.
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.

Implements te::map::Canvas.

te::gm::Polygon* te::qt::widgets::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 
)
virtual

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.

Implements te::map::Canvas.

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

It returns the text boundary (its enclose rectangle).

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.
txtThe text to be drawn.
angleThe text rotation.
hAlignThe horizontal text alignment.
vAlignThe vertical text alignment.
Returns
The text boundary in world coordinates.
Note
The caller of this method will take the ownership of the returned Polygon.

Implements te::map::Canvas.

te::gm::Polygon* te::qt::widgets::Canvas::getTextBoundary ( const QPoint &  p,
const std::string &  txt,
float  angle = 0.0,
te::at::HorizontalAlignment  hAlign = te::at::Start,
te::at::VerticalAlignment  vAlign = te::at::Baseline 
)

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.
int te::qt::widgets::Canvas::getWidth ( ) const
virtual

It returns the canvas width.

Returns
The canvas width.

Implements te::map::Canvas.

Canvas& te::qt::widgets::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::qt::widgets::Canvas::resize ( int  w,
int  h 
)
virtual

It adjusts the canvas size (width and height).

Parameters
wThe new canvas width.
hThe new canvas height.

Implements te::map::Canvas.

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

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.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::setBackgroundColor ( const te::color::RGBAColor color)
virtual

It sets the canvas background color.

The default is totally transparent (255, 255, 255, 0).

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

Implements te::map::Canvas.

void te::qt::widgets::Canvas::setDevice ( QPaintDevice *  device,
bool  takeOwnerShip 
)

It sets new device as QPrinter.

Parameters
deviceThe new paint device.
takeOwnerShipIf true the canvas will take the ownership of the given device otherwise it is the caller responsability to release the device.
void te::qt::widgets::Canvas::setEraseMode ( )
virtual

It sets the painter to erase mode.

Implements te::map::Canvas.

void te::qt::widgets::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.

void te::qt::widgets::Canvas::setLineCapStyle ( te::map::LineCapStyle  style)
virtual

It sets the line cap style.

Parameters
styleThe line cap style.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::setLineColor ( const te::color::RGBAColor color)
virtual

It sets the pen color used to draw line geometries.

This method will drop any pattern or line style previously set.

Parameters
colorThe color to be used by the pen.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::setLineDashStyle ( te::map::LineDashStyle  style)
virtual

It sets the line dash style.

Parameters
styleThe line dash style.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::setLineDashStyle ( const std::vector< double > &  style)
virtual

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.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::setLineDashStyle ( QPen &  pen,
const std::vector< double > &  style 
)
private

It adjusts the given pen to use the given pattern.

Parameters
penThe pen that will be adjusted.
styleThe line custom dash style.
void te::qt::widgets::Canvas::setLineJoinStyle ( te::map::LineJoinStyle  style)
virtual

It sets the line join style.

Parameters
styleThe line join style.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::setLinePattern ( te::color::RGBAColor **  pattern,
int  ncols,
int  nrows 
)
virtual

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.

Implements te::map::Canvas.

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

It sets the line pattern using a buffered image.

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

Implements te::map::Canvas.

void te::qt::widgets::Canvas::setLinePatternOpacity ( int  opacity)
virtual

It sets the line pattern opacity.

Parameters
opacityThe pattern opacity.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::setLinePatternRotation ( const double &  angle)
virtual

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

Parameters
angleThe rotation angle in degress.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::setLineWidth ( int  w)
virtual

It sets the line width.

Parameters
wThe line width.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::setMatrix ( const QMatrix &  matrix)
void te::qt::widgets::Canvas::setNormalMode ( )
virtual

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

Implements te::map::Canvas.

void te::qt::widgets::Canvas::setPointColor ( const te::color::RGBAColor color)
virtual

It sets the point drawing color.

This method will instruct the canvas to draw points like pixels. Any pattern previously set will be released.

Parameters
colorThe new color for drawing a point.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::setPointPattern ( te::color::RGBAColor **  pattern,
int  ncols,
int  nrows 
)
virtual

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.

Implements te::map::Canvas.

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

It sets the point pattern using a buffered image.

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

Implements te::map::Canvas.

void te::qt::widgets::Canvas::setPointPatternOpacity ( int  opacity)
virtual

It sets the point pattern opacity.

Parameters
opacityThe pattern opacity.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::setPointPatternRotation ( const double &  angle)
virtual

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

Parameters
angleThe rotation angle in degress.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::setPointWidth ( int  w)
virtual

It sets the point width. If point has a patterns, this pattern is scaled to width.

Parameters
wThe width used to draw point.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::setPolygonContourCapStyle ( te::map::LineCapStyle  style)
virtual

It sets the polygon contour cap style.

Parameters
styleThe polygon contour cap style.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::setPolygonContourColor ( const te::color::RGBAColor color)
virtual

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

Parameters
colorThe color to be used to outline a polygon.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::setPolygonContourDashStyle ( te::map::LineDashStyle  style)
virtual

It sets the polygon contour dash style.

Parameters
styleThe polygon contour dash style.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::setPolygonContourDashStyle ( const std::vector< double > &  style)
virtual

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.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::setPolygonContourJoinStyle ( te::map::LineJoinStyle  style)
virtual

It sets the polygon contour join style.

Parameters
styleThe polygon contour join style.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::setPolygonContourPattern ( te::color::RGBAColor **  pattern,
int  ncols,
int  nrows 
)
virtual

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.

Implements te::map::Canvas.

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

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.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::setPolygonContourPatternOpacity ( int  opacity)
virtual

It sets the polygon contour pattern opacity.

Parameters
opacityThe pattern opacity.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::setPolygonContourPatternRotation ( const double &  angle)
virtual

It sets the polygon contour pattern rotation.

Parameters
angleThe rotation angle in degress.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::setPolygonContourWidth ( int  w)
virtual

It sets the polygon contour width.

Parameters
wThe contour width.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::setPolygonFillColor ( const te::color::RGBAColor color)
virtual

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

Parameters
colorThe color to be used when filling a polygon.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::setPolygonFillColor ( const QBrush &  color)
void te::qt::widgets::Canvas::setPolygonFillPattern ( te::color::RGBAColor **  pattern,
int  ncols,
int  nrows 
)
virtual

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.

Implements te::map::Canvas.

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

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.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::setPolygonPatternOpacity ( int  opacity)
virtual

It sets the polygon pattern opacity.

Parameters
opacityThe pattern opacity.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::setPolygonPatternRotation ( const double &  angle)
virtual

It sets the polygon pattern rotation.

Parameters
angleThe rotation angle in degress.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::setPolygonPatternWidth ( int  w)
virtual

It sets the polygon pattern width.

Parameters
wThe pattern width.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::setRenderHint ( QPainter::RenderHint  hint,
bool  on = true 
)

Sets the given render hint on the canvas painter if on is true; otherwise clears the render hint.

void te::qt::widgets::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.

void te::qt::widgets::Canvas::setTextContourColor ( const te::color::RGBAColor color)
virtual

It sets the text contour (outline) drawing color.

Parameters
colorThe new color for drawing the contour of texts.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::setTextContourEnabled ( bool  b)
virtual

It controls the display of the text outline.

Parameters
bTrue to display and false to not display.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::setTextContourOpacity ( int  opacity)
virtual

It sets the text contour opacity.

Parameters
opacityThe new opacity for drawing the text contour.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::setTextContourWidth ( int  width)
virtual

It sets the text contour width.

Parameters
widthThe new width for drawing the text contour.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::setTextDecorationColor ( const te::color::RGBAColor color)
virtual

It sets the text color for drawing text decoration.

Parameters
colorThe new color for drawing text decoration.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::setTextDecorationWidth ( int  width)
virtual

It sets the width for drawing text decoration.

Parameters
widthThe new width for drawing text decoration.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::setTextJustification ( te::at::LineJustification  just)
virtual

It sets the text justification for multi line text.

Parameters
justThe new justification for drawing a multi line text.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::setTextMultiLineSpacing ( int  spacing)
virtual

It sets the multi line text spacing.

Parameters
spacingThe new spacing for drawing a multi line text.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::setTextOpacity ( int  opacity)
virtual

It sets the text opacity.

Parameters
opacityThe new opacity for drawing a text.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::setTextOverline ( bool  b)
virtual

It sets the text overline flag.

Parameters
bTrue: for overline. False otherwise.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::setTextPointSize ( double  size)
virtual

It sets the text point Size.

Parameters
sizeThe new point size for drawing a text.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::setTextStretch ( std::size_t  stretch)
virtual

It sets the text stretch.

Parameters
stretchThe new stretch for drawing a text.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::setTextStrikeOut ( bool  b)
virtual

It sets the text strike out flag.

Parameters
bTrue: for strike out. False otherwise.

Implements te::map::Canvas.

void te::qt::widgets::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::qt::widgets::Canvas::setTextUnderline ( bool  b)
virtual

It sets the text underline flag.

Parameters
bTrue: for underline. False otherwise.

Implements te::map::Canvas.

void te::qt::widgets::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::qt::widgets::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.
llyLower left y-coordinate of the World.
urxUpper right x-coordinate of the World.
uryUpper right y-coordinate of the World.
Note
The coordinates must be in the Spatial Reference System of the features to be drawn in canvas.

Implements te::map::Canvas.

void te::qt::widgets::Canvas::updateAlpha ( QImage &  img,
const int &  opacity 
)
private

It updates the alpha channel of the given image using the given opacity value.

Parameters
imgThe image that will be updated.
opacityThe opacity value that will be used.

Member Data Documentation

QColor te::qt::widgets::Canvas::m_bgColor
private

Canvas background color. Defaults: white fully transparent.

Definition at line 484 of file Canvas.h.

bool te::qt::widgets::Canvas::m_erase
private

used for erase operation.

Definition at line 486 of file Canvas.h.

QFont te::qt::widgets::Canvas::m_font
private

The text font.

Definition at line 516 of file Canvas.h.

bool te::qt::widgets::Canvas::m_isDeviceOwner
private

Tells if canvas is the owner of the paint device.

Definition at line 482 of file Canvas.h.

QColor te::qt::widgets::Canvas::m_lnColor
private

The color used to draw lines.

Definition at line 500 of file Canvas.h.

QPen te::qt::widgets::Canvas::m_lnPen
private

The pen used to draw lines.

Definition at line 501 of file Canvas.h.

QMatrix te::qt::widgets::Canvas::m_matrix
private

Matrix that transforms the world coordinate to device coordinate.

Definition at line 478 of file Canvas.h.

QPainter te::qt::widgets::Canvas::m_painter
private

The painter used to draw geometric objects.

Definition at line 480 of file Canvas.h.

std::map<std::string, QPixmap*> te::qt::widgets::Canvas::m_patterns
private

The pixmap styles used to draw patterns.

Definition at line 522 of file Canvas.h.

QBrush te::qt::widgets::Canvas::m_polyBrush
private

The brush used to fill polygon.

Definition at line 507 of file Canvas.h.

QColor te::qt::widgets::Canvas::m_polyColor
private

The color used to fill polygon (solid, marker or pattern).

Definition at line 506 of file Canvas.h.

QColor te::qt::widgets::Canvas::m_polyContourColor
private

The color used to draw polygon contour.

Definition at line 503 of file Canvas.h.

QPen te::qt::widgets::Canvas::m_polyContourPen
private

The pen used to draw contour polygon.

Definition at line 504 of file Canvas.h.

QBrush te::qt::widgets::Canvas::m_polyDefaultBrush
private

The brush used to fill polygon.

Definition at line 508 of file Canvas.h.

QImage* te::qt::widgets::Canvas::m_polyImage
private

The pattern image used to fill polygon.

Definition at line 509 of file Canvas.h.

int te::qt::widgets::Canvas::m_polyPatternWidth
private

The width used to draw marker or pattern.

Definition at line 511 of file Canvas.h.

QImage* te::qt::widgets::Canvas::m_polyRotatedImage
private

The pattern rotated image used to fill polygon.

Definition at line 510 of file Canvas.h.

QPointF te::qt::widgets::Canvas::m_pt
private

Point buffer to avoid creating another point instance.

Definition at line 488 of file Canvas.h.

QImage* te::qt::widgets::Canvas::m_ptClearPatternImg
private

The marker or pattern used to clear (erase point).

Definition at line 495 of file Canvas.h.

QColor te::qt::widgets::Canvas::m_ptColor
private

The color used to draw point (pixel) or marker.

Definition at line 490 of file Canvas.h.

QColor te::qt::widgets::Canvas::m_ptColorFrom
private

Indicates the color that originated the pattern that shows the status of selection. Used for optmization.

Definition at line 491 of file Canvas.h.

int te::qt::widgets::Canvas::m_ptHOffset
private

Horizontal offset in pixels (in device coordinate) applied to point pattern or marker.

Definition at line 498 of file Canvas.h.

QImage* te::qt::widgets::Canvas::m_ptImg
private

The marker or pattern used to point.

Definition at line 492 of file Canvas.h.

QImage* te::qt::widgets::Canvas::m_ptImgRotated
private

The marker or pattern already with rotation used to draw points.

Definition at line 493 of file Canvas.h.

QPen te::qt::widgets::Canvas::m_ptPen
private

The pen used to draw points.

Definition at line 487 of file Canvas.h.

double te::qt::widgets::Canvas::m_ptRotation
private

The point pattern rotation.

Definition at line 496 of file Canvas.h.

QImage* te::qt::widgets::Canvas::m_ptSelectionPatternImg
private

The marker or pattern used to show selection status. The color is mixed with point pattern.

Definition at line 494 of file Canvas.h.

int te::qt::widgets::Canvas::m_ptVOffset
private

Vertical offset in pixels (in device coordinate) applied to point pattern or marker.

Definition at line 497 of file Canvas.h.

int te::qt::widgets::Canvas::m_ptWidth
private

The width for point markers and point pattern.

Definition at line 489 of file Canvas.h.

QBrush te::qt::widgets::Canvas::m_txtBrush
private

The brush used to draw texts.

Definition at line 515 of file Canvas.h.

bool te::qt::widgets::Canvas::m_txtContourEnabled
private

The flag indicates whether the outline of the text should be drawn.

Definition at line 514 of file Canvas.h.

QPen te::qt::widgets::Canvas::m_txtContourPen
private

The pen used to draw the text contour.

Definition at line 513 of file Canvas.h.

int te::qt::widgets::Canvas::m_txtLetterSpacing
private

Text letter spacing.

Definition at line 517 of file Canvas.h.

int te::qt::widgets::Canvas::m_txtLineSpacing
private

Text multi line spacing.

Definition at line 520 of file Canvas.h.

int te::qt::widgets::Canvas::m_txtWordSpacing
private

Text word spacing.

Definition at line 518 of file Canvas.h.


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