• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

marble

  • Marble
  • GeoPainter
Public Member Functions | List of all members
Marble::GeoPainter Class Reference

#include <GeoPainter.h>

Inheritance diagram for Marble::GeoPainter:
Inheritance graph
[legend]

Public Member Functions

 GeoPainter (QPaintDevice *paintDevice, const ViewportParams *viewportParams, MapQuality mapQuality=NormalQuality)
 
 ~GeoPainter ()
 
void drawAnnotation (const GeoDataCoordinates &position, const QString &text, QSizeF bubbleSize=QSizeF(130, 100), qreal bubbleOffsetX=-10, qreal bubbleOffsetY=-30, qreal xRnd=5, qreal yRnd=5)
 
void drawEllipse (const GeoDataCoordinates &centerPosition, qreal width, qreal height, bool isGeoProjected=false)
 
void drawImage (const GeoDataCoordinates &centerPosition, const QImage &image)
 
void drawPixmap (const GeoDataCoordinates &centerPosition, const QPixmap &pixmap)
 
void drawPoint (const GeoDataCoordinates &position)
 
void drawPoint (const GeoDataPoint &point)
 
void drawPolygon (const GeoDataLinearRing &linearRing, Qt::FillRule fillRule=Qt::OddEvenFill)
 
void drawPolygon (const GeoDataPolygon &polygon, Qt::FillRule fillRule=Qt::OddEvenFill)
 
void drawPolyline (const GeoDataLineString &lineString, const QString &labelText=QString(), LabelPositionFlags labelPositionFlags=LineCenter)
 
void drawRect (const GeoDataCoordinates &centerPosition, qreal width, qreal height, bool isGeoProjected=false)
 
void drawRoundRect (const GeoDataCoordinates &centerPosition, int width, int height, int xRnd=25, int yRnd=25)
 
void drawText (const GeoDataCoordinates &position, const QString &text)
 
MapQuality mapQuality () const
 
QRegion regionFromEllipse (const GeoDataCoordinates &centerPosition, qreal width, qreal height, bool isGeoProjected=false, qreal strokeWidth=3) const
 
QRegion regionFromPoint (const GeoDataCoordinates &position, qreal strokeWidth=3) const
 
QRegion regionFromPoint (const GeoDataPoint &point, qreal strokeWidth=3) const
 
QRegion regionFromPolygon (const GeoDataLinearRing &linearRing, Qt::FillRule fillRule, qreal strokeWidth=3) const
 
QRegion regionFromPolyline (const GeoDataLineString &lineString, qreal strokeWidth=3) const
 
QRegion regionFromRect (const GeoDataCoordinates &centerPosition, qreal width, qreal height, bool isGeoProjected=false, qreal strokeWidth=3) const
 
- Public Member Functions inherited from Marble::ClipPainter
 ClipPainter ()
 
 ClipPainter (QPaintDevice *, bool)
 
 ~ClipPainter ()
 
void drawPolygon (const QPolygonF &, Qt::FillRule fillRule=Qt::OddEvenFill)
 
void drawPolyline (const QPolygonF &)
 
void drawPolyline (const QPolygonF &, QVector< QPointF > &labelNodes, LabelPositionFlags labelPositionFlag=LineCenter)
 
bool isClipping () const
 
void setClipping (bool enable)
 
- Public Member Functions inherited from QPainter
 QPainter ()
 
 QPainter (QPaintDevice *device)
 
 ~QPainter ()
 
const QBrush & background () const
 
const QColor & backgroundColor () const
 
Qt::BGMode backgroundMode () const
 
bool begin (QPaintDevice *device)
 
bool begin (QPaintDevice *device, const QWidget *init)
 
void beginNativePainting ()
 
QRectF boundingRect (const QRectF &rectangle, int flags, const QString &text)
 
QRect boundingRect (const QRect &rectangle, int flags, const QString &text)
 
QRect boundingRect (int x, int y, int w, int h, int flags, const QString &text)
 
QRectF boundingRect (const QRectF &rectangle, const QString &text, const QTextOption &option)
 
QRect boundingRect (const QRect &rectangle, int flags, const QString &text, int length)
 
QRect boundingRect (int x, int y, int width, int height, int flags, const QString &text, int length)
 
const QBrush & brush () const
 
QPoint brushOrigin () const
 
QRectF clipBoundingRect () const
 
QPainterPath clipPath () const
 
QRegion clipRegion () const
 
QMatrix combinedMatrix () const
 
QTransform combinedTransform () const
 
CompositionMode compositionMode () const
 
QPaintDevice * device () const
 
const QMatrix & deviceMatrix () const
 
const QTransform & deviceTransform () const
 
void drawArc (const QRectF &rectangle, int startAngle, int spanAngle)
 
void drawArc (const QRect &rectangle, int startAngle, int spanAngle)
 
void drawArc (int x, int y, int width, int height, int startAngle, int spanAngle)
 
void drawChord (const QRectF &rectangle, int startAngle, int spanAngle)
 
void drawChord (int x, int y, int width, int height, int startAngle, int spanAngle)
 
void drawChord (const QRect &rectangle, int startAngle, int spanAngle)
 
void drawConvexPolygon (const QPolygonF &polygon, int index, int count)
 
void drawConvexPolygon (const QPolygon &polygon, int index, int count)
 
void drawConvexPolygon (const QPointF *points, int pointCount)
 
void drawConvexPolygon (const QPolygonF &polygon)
 
void drawConvexPolygon (const QPoint *points, int pointCount)
 
void drawConvexPolygon (const QPolygon &polygon)
 
void drawCubicBezier (const QPolygon &controlPoints, int index)
 
void drawEllipse (const QRectF &rectangle)
 
void drawEllipse (const QRect &rectangle)
 
void drawEllipse (int x, int y, int width, int height)
 
void drawEllipse (const QPointF &center, qreal rx, qreal ry)
 
void drawEllipse (const QPoint &center, int rx, int ry)
 
void drawGlyphRun (const QPointF &position, const QGlyphRun &glyphs)
 
void drawImage (const QRectF &target, const QImage &image, const QRectF &source, QFlags< Qt::ImageConversionFlag > flags)
 
void drawImage (const QRect &target, const QImage &image, const QRect &source, QFlags< Qt::ImageConversionFlag > flags)
 
void drawImage (const QPointF &point, const QImage &image, const QRectF &source, QFlags< Qt::ImageConversionFlag > flags)
 
void drawImage (const QPoint &point, const QImage &image, const QRect &source, QFlags< Qt::ImageConversionFlag > flags)
 
void drawImage (const QRectF &rectangle, const QImage &image)
 
void drawImage (const QRect &rectangle, const QImage &image)
 
void drawImage (const QPointF &point, const QImage &image)
 
void drawImage (const QPoint &point, const QImage &image)
 
void drawImage (int x, int y, const QImage &image, int sx, int sy, int sw, int sh, QFlags< Qt::ImageConversionFlag > flags)
 
void drawLine (const QLineF &line)
 
void drawLine (const QLine &line)
 
void drawLine (int x1, int y1, int x2, int y2)
 
void drawLine (const QPoint &p1, const QPoint &p2)
 
void drawLine (const QPointF &p1, const QPointF &p2)
 
void drawLines (const QLineF *lines, int lineCount)
 
void drawLines (const QVector< QLineF > &lines)
 
void drawLines (const QPointF *pointPairs, int lineCount)
 
void drawLines (const QVector< QPointF > &pointPairs)
 
void drawLines (const QLine *lines, int lineCount)
 
void drawLines (const QVector< QLine > &lines)
 
void drawLines (const QPoint *pointPairs, int lineCount)
 
void drawLines (const QVector< QPoint > &pointPairs)
 
void drawLineSegments (const QPolygon &polygon, int index, int count)
 
void drawPath (const QPainterPath &path)
 
void drawPicture (const QPointF &point, const QPicture &picture)
 
void drawPicture (int x, int y, const QPicture &picture)
 
void drawPicture (const QPoint &point, const QPicture &picture)
 
void drawPie (const QRect &rectangle, int startAngle, int spanAngle)
 
void drawPie (const QRectF &rectangle, int startAngle, int spanAngle)
 
void drawPie (int x, int y, int width, int height, int startAngle, int spanAngle)
 
void drawPixmap (const QRectF &target, const QPixmap &pixmap, const QRectF &source)
 
void drawPixmap (const QRect &target, const QPixmap &pixmap, const QRect &source)
 
void drawPixmap (int x, int y, int w, int h, const QPixmap &pixmap, int sx, int sy, int sw, int sh)
 
void drawPixmap (int x, int y, const QPixmap &pixmap, int sx, int sy, int sw, int sh)
 
void drawPixmap (const QPointF &point, const QPixmap &pixmap, const QRectF &source)
 
void drawPixmap (const QPoint &point, const QPixmap &pixmap, const QRect &source)
 
void drawPixmap (const QPointF &point, const QPixmap &pixmap)
 
void drawPixmap (const QPoint &point, const QPixmap &pixmap)
 
void drawPixmap (const QRect &rectangle, const QPixmap &pixmap)
 
void drawPixmap (int x, int y, int width, int height, const QPixmap &pixmap)
 
void drawPixmap (int x, int y, const QPixmap &pixmap)
 
void drawPixmapFragments (const PixmapFragment *fragments, int fragmentCount, const QPixmap &pixmap, QFlags< QPainter::PixmapFragmentHint > hints)
 
void drawPixmapFragments (const QRectF *targetRects, const QRectF *sourceRects, int fragmentCount, const QPixmap &pixmap, QFlags< QPainter::PixmapFragmentHint > hints)
 
void drawPoint (const QPointF &position)
 
void drawPoint (const QPoint &position)
 
void drawPoint (int x, int y)
 
void drawPoints (const QPolygon &polygon, int index, int count)
 
void drawPoints (const QPointF *points, int pointCount)
 
void drawPoints (const QPolygonF &points)
 
void drawPoints (const QPoint *points, int pointCount)
 
void drawPoints (const QPolygon &points)
 
void drawPolygon (const QPolygonF &polygon, bool winding, int index, int count)
 
void drawPolygon (const QPolygon &polygon, bool winding, int index, int count)
 
void drawPolygon (const QPointF *points, int pointCount, Qt::FillRule fillRule)
 
void drawPolygon (const QPoint *points, int pointCount, Qt::FillRule fillRule)
 
void drawPolygon (const QPolygonF &points, Qt::FillRule fillRule)
 
void drawPolygon (const QPolygon &points, Qt::FillRule fillRule)
 
void drawPolyline (const QPointF *points, int pointCount)
 
void drawPolyline (const QPolygonF &points)
 
void drawPolyline (const QPoint *points, int pointCount)
 
void drawPolyline (const QPolygon &points)
 
void drawPolyline (const QPolygon &polygon, int index, int count)
 
void drawRect (const QRectF &rectangle)
 
void drawRect (int x, int y, int width, int height)
 
void drawRect (const QRect &rectangle)
 
void drawRects (const QRectF *rectangles, int rectCount)
 
void drawRects (const QVector< QRectF > &rectangles)
 
void drawRects (const QRect *rectangles, int rectCount)
 
void drawRects (const QVector< QRect > &rectangles)
 
void drawRoundedRect (const QRectF &rect, qreal xRadius, qreal yRadius, Qt::SizeMode mode)
 
void drawRoundedRect (int x, int y, int w, int h, qreal xRadius, qreal yRadius, Qt::SizeMode mode)
 
void drawRoundedRect (const QRect &rect, qreal xRadius, qreal yRadius, Qt::SizeMode mode)
 
void drawRoundRect (const QRectF &r, int xRnd, int yRnd)
 
void drawRoundRect (const QRect &r, int xRnd, int yRnd)
 
void drawRoundRect (int x, int y, int w, int h, int xRnd, int yRnd)
 
void drawStaticText (int left, int top, const QStaticText &staticText)
 
void drawStaticText (const QPointF &topLeftPosition, const QStaticText &staticText)
 
void drawStaticText (const QPoint &topLeftPosition, const QStaticText &staticText)
 
void drawText (const QPointF &position, const QString &text)
 
void drawText (const QPoint &position, const QString &text)
 
void drawText (int x, int y, const QString &text)
 
void drawText (const QRect &rectangle, int flags, const QString &text, QRect *boundingRect)
 
void drawText (int x, int y, int width, int height, int flags, const QString &text, QRect *boundingRect)
 
void drawText (const QRectF &rectangle, const QString &text, const QTextOption &option)
 
void drawText (const QRectF &rectangle, int flags, const QString &text, QRectF *boundingRect)
 
void drawText (const QPoint &point, const QString &text, int pos, int length)
 
void drawText (int x, int y, const QString &text, int length)
 
void drawText (const QPoint &point, const QString &text, int length)
 
void drawText (int x, int y, const QString &text, int pos, int length)
 
void drawText (const QRect &rectangle, int flags, const QString &text, int length, QRect *br)
 
void drawText (int x, int y, int width, int height, int flags, const QString &text, int length, QRect *br)
 
void drawTiledPixmap (const QRectF &rectangle, const QPixmap &pixmap, const QPointF &position)
 
void drawTiledPixmap (const QRect &rectangle, const QPixmap &pixmap, const QPoint &position)
 
void drawTiledPixmap (int x, int y, int width, int height, const QPixmap &pixmap, int sx, int sy)
 
bool end ()
 
void endNativePainting ()
 
void eraseRect (const QRectF &rectangle)
 
void eraseRect (int x, int y, int width, int height)
 
void eraseRect (const QRect &rectangle)
 
void fillPath (const QPainterPath &path, const QBrush &brush)
 
void fillRect (int x, int y, int width, int height, const QColor &color)
 
void fillRect (const QRect &rectangle, Qt::BrushStyle style)
 
void fillRect (int x, int y, int width, int height, Qt::GlobalColor color)
 
void fillRect (const QRect &rectangle, Qt::GlobalColor color)
 
void fillRect (const QRect &rectangle, const QBrush &brush)
 
void fillRect (const QRectF &rectangle, const QBrush &brush)
 
void fillRect (int x, int y, int width, int height, const QBrush &brush)
 
void fillRect (const QRectF &rectangle, const QColor &color)
 
void fillRect (const QRect &rectangle, const QColor &color)
 
void fillRect (int x, int y, int width, int height, Qt::BrushStyle style)
 
void fillRect (const QRectF &rectangle, Qt::BrushStyle style)
 
void fillRect (const QRectF &rectangle, Qt::GlobalColor color)
 
const QFont & font () const
 
QFontInfo fontInfo () const
 
QFontMetrics fontMetrics () const
 
bool hasClipping () const
 
bool hasViewXForm () const
 
bool hasWorldXForm () const
 
void initFrom (const QWidget *widget)
 
bool isActive () const
 
Qt::LayoutDirection layoutDirection () const
 
const QMatrix & matrix () const
 
bool matrixEnabled () const
 
qreal opacity () const
 
QPaintEngine * paintEngine () const
 
const QPen & pen () const
 
RenderHints renderHints () const
 
void resetMatrix ()
 
void resetTransform ()
 
void resetXForm ()
 
void restore ()
 
void rotate (qreal angle)
 
void save ()
 
void scale (qreal sx, qreal sy)
 
void setBackground (const QBrush &brush)
 
void setBackgroundColor (const QColor &color)
 
void setBackgroundMode (Qt::BGMode mode)
 
void setBrush (Qt::BrushStyle style)
 
void setBrush (const QBrush &brush)
 
void setBrushOrigin (const QPointF &position)
 
void setBrushOrigin (const QPoint &position)
 
void setBrushOrigin (int x, int y)
 
void setClipPath (const QPainterPath &path, Qt::ClipOperation operation)
 
void setClipping (bool enable)
 
void setClipRect (const QRectF &rectangle, Qt::ClipOperation operation)
 
void setClipRect (const QRect &rectangle, Qt::ClipOperation operation)
 
void setClipRect (int x, int y, int width, int height, Qt::ClipOperation operation)
 
void setClipRegion (const QRegion &region, Qt::ClipOperation operation)
 
void setCompositionMode (CompositionMode mode)
 
void setFont (const QFont &font)
 
void setLayoutDirection (Qt::LayoutDirection direction)
 
void setMatrix (const QMatrix &matrix, bool combine)
 
void setMatrixEnabled (bool enable)
 
void setOpacity (qreal opacity)
 
void setPen (const QColor &color)
 
void setPen (const QPen &pen)
 
void setPen (Qt::PenStyle style)
 
void setRenderHint (RenderHint hint, bool on)
 
void setRenderHints (QFlags< QPainter::RenderHint > hints, bool on)
 
void setTransform (const QTransform &transform, bool combine)
 
void setViewport (int x, int y, int width, int height)
 
void setViewport (const QRect &rectangle)
 
void setViewTransformEnabled (bool enable)
 
void setViewXForm (bool enabled)
 
void setWindow (int x, int y, int width, int height)
 
void setWindow (const QRect &rectangle)
 
void setWorldMatrix (const QMatrix &matrix, bool combine)
 
void setWorldMatrixEnabled (bool enable)
 
void setWorldTransform (const QTransform &matrix, bool combine)
 
void setWorldXForm (bool enabled)
 
void shear (qreal sh, qreal sv)
 
void strokePath (const QPainterPath &path, const QPen &pen)
 
bool testRenderHint (RenderHint hint) const
 
const QTransform & transform () const
 
void translate (const QPointF &offset)
 
void translate (const QPoint &offset)
 
void translate (qreal dx, qreal dy)
 
qreal translationX () const
 
qreal translationY () const
 
QRect viewport () const
 
bool viewTransformEnabled () const
 
QRect window () const
 
const QMatrix & worldMatrix () const
 
bool worldMatrixEnabled () const
 
const QTransform & worldTransform () const
 
QPoint xForm (const QPoint &point) const
 
QPolygon xForm (const QPolygon &polygon) const
 
QPolygon xForm (const QPolygon &polygon, int index, int count) const
 
QRect xForm (const QRect &rectangle) const
 
QPoint xFormDev (const QPoint &point) const
 
QPolygon xFormDev (const QPolygon &polygon) const
 
QPolygon xFormDev (const QPolygon &polygon, int index, int count) const
 
QRect xFormDev (const QRect &rectangle) const
 

Additional Inherited Members

- Static Public Member Functions inherited from QPainter
void redirect (QPaintDevice *pdev, QPaintDevice *replacement)
 
QPaintDevice * redirect (QPaintDevice *pdev)
 
QPaintDevice * redirected (const QPaintDevice *device, QPoint *offset)
 
void restoreRedirected (const QPaintDevice *device)
 
void setRedirected (const QPaintDevice *device, QPaintDevice *replacement, const QPoint &offset)
 
- Public Attributes inherited from QPainter
typedef PixmapFragmentHints
 
typedef RenderHints
 

Detailed Description

A painter that allows to draw geometric primitives on the map.

This class allows application developers to draw simple geometric shapes and objects onto the map.

The API is modeled after the QPainter API.

The GeoPainter provides a wide range of methods that are using geographic ("geodesic") coordinates to position the item. For example a point or the nodes of a polygon can fully be described in geographic coordinates.

In all these cases the position of the object is specified in geographic coordinates.

There are however some cases where there are two viable cases:

  • the shape of the object could still use screen coordinates (like a label or an icon).
  • Alternatively the shape of the object can get projected according to the current projection (e.g. a texture projected onto the spherical surface)

If screen coordinates are used then e.g. width and height are assumed to be expressed in pixels, otherwise degrees are used.

Painter transformations (e.g. translate) always happen in screen coordinates.

Like in QPainter drawing objects onto a widget should always considered to be a volatile operation. This means that e.g. placemarks don't get added to the globe permanently. So the drawing needs to be done on every repaint to prevent that drawings will disappear during the next paint event.

So if you want to add placemarks to your map widget permanently (i.e. you don't want to take care of repainting) then you need to use other solutions such as the KML import of the Marble framework or Marble's GeoGraphicsItems.

Note
By default the GeoPainter automatically filters geographical content in order to provide fast painting:
  • Geographically positioned objects which are outside the viewport are not drawn at all. Parts of objects which are specified through geographic coordinates (like polygons, ellipses etc.) get cut off if they are not placed within the viewport.
  • Objects which have a shape that is specified through geographic coordinates get filtered according to the viewport resolution: If the object is much smaller than a pixel then it won't get drawn at all.

Definition at line 98 of file GeoPainter.h.

Constructor & Destructor Documentation

GeoPainter::GeoPainter ( QPaintDevice *  paintDevice,
const ViewportParams *  viewportParams,
MapQuality  mapQuality = NormalQuality 
)

Creates a new geo painter.

To create a geo painter it's necessary to provide paintDevice as a canvas and the viewportParams to specify the map projection inside the viewport.

Definition at line 176 of file GeoPainter.cpp.

GeoPainter::~GeoPainter ( )

Destroys the geo painter.

Definition at line 185 of file GeoPainter.cpp.

Member Function Documentation

void GeoPainter::drawAnnotation ( const GeoDataCoordinates &  position,
const QString &  text,
QSizeF  bubbleSize = QSizeF( 130, 100 ),
qreal  bubbleOffsetX = -10,
qreal  bubbleOffsetY = -30,
qreal  xRnd = 5,
qreal  yRnd = 5 
)

Draws a text annotation that points to a geodesic position.

The annotation consists of a bubble with the specified text inside. By choosing an appropriate pen for the painter it's possible to change the color and line style of the bubble outline and the text. The brush chosen for the painter is used to paint the background of the bubble

The optional parameters which describe the layout of the bubble are similar to those used by QPainter::drawRoundRect(). Unlike in QPainter the rounded corners are not specified in percentage but in pixels to provide for optimal aesthetics. By choosing a positive or negative bubbleOffset it's possible to place the annotation on top, bottom, left or right of the annotated position.

Parameters
positionThe geodesic position
textThe text contained by the bubble
bubbleSizeThe size of the bubble that holds the annotation text. A height of 0 can be used to have the height calculated automatically to fit the needed text height.
bubbleOffsetXThe x-axis offset between the annotated position and the "root" of the speech bubble's "arrow".
bubbleOffsetYThe y-axis offset between the annotated position and the "root" of the speech bubble's "arrow".
xRndSpecifies the geometry of the rounded corners in pixels along the x-axis.
yRndSpecifies the geometry of the rounded corners in pixels along the y-axis.
See also
GeoDataCoordinates

Definition at line 197 of file GeoPainter.cpp.

void GeoPainter::drawEllipse ( const GeoDataCoordinates &  centerPosition,
qreal  width,
qreal  height,
bool  isGeoProjected = false 
)

Draws an ellipse at the given position. The ellipse is placed with its center located at the given centerPosition.

For the outline it uses the painter's pen and for the background the painter's brush.

If isGeoProjected is true then the outline of the ellipse is drawn in geographic coordinates. In this case the width and the height are interpreted to be degrees. If isGeoProjected is false then the outline of the ellipse is drawn in screen coordinates. In this case the width and the height are interpreted to be pixels.

See also
GeoDataCoordinates

Definition at line 289 of file GeoPainter.cpp.

void GeoPainter::drawImage ( const GeoDataCoordinates &  centerPosition,
const QImage &  image 
)

Draws an image at the given position. The image is placed with its center located at the given centerPosition.

The image rendering is performed in screen coordinates and is not subject to the current projection.

See also
GeoDataCoordinates

Definition at line 428 of file GeoPainter.cpp.

void GeoPainter::drawPixmap ( const GeoDataCoordinates &  centerPosition,
const QPixmap &  pixmap 
)

Draws a pixmap at the given position. The pixmap is placed with its center located at the given centerPosition.

The image rendering is performed in screen coordinates and is not subject to the current projection.

See also
GeoDataCoordinates

Definition at line 452 of file GeoPainter.cpp.

void GeoPainter::drawPoint ( const GeoDataCoordinates &  position)

Draws a single point at a given geographic position. The point is drawn using the painter's pen color.

See also
GeoDataCoordinates

Definition at line 227 of file GeoPainter.cpp.

void GeoPainter::drawPoint ( const GeoDataPoint &  point)

Draws a single point at a given geographic position. The point is drawn using the painter's pen color.

See also
GeoDataPoint

Definition at line 251 of file GeoPainter.cpp.

void GeoPainter::drawPolygon ( const GeoDataLinearRing &  linearRing,
Qt::FillRule  fillRule = Qt::OddEvenFill 
)

Draws a given linear ring (a "polygon without holes").

The outline of the linearRing is drawn using the current pen. The background is painted using the current brush of the painter. Like in QPainter::drawPolygon() the fillRule specifies the fill algorithm that is used to fill the polygon.

See also
GeoDataLinearRing

Definition at line 560 of file GeoPainter.cpp.

void GeoPainter::drawPolygon ( const GeoDataPolygon &  polygon,
Qt::FillRule  fillRule = Qt::OddEvenFill 
)

Draws a given polygon (which may contain holes).

The outline of the polygon is drawn using the current pen. The background is painted using the current brush of the painter. Like in QPainter::drawPolygon() the fillRule specifies the fill algorithm that is used to fill the polygon.

See also
GeoDataPolygon

Definition at line 628 of file GeoPainter.cpp.

void GeoPainter::drawPolyline ( const GeoDataLineString &  lineString,
const QString &  labelText = QString(),
LabelPositionFlags  labelPositionFlags = LineCenter 
)

Draws a given line string (a "polyline").

The lineString is drawn using the current pen. It's possible to provide a labelText for the lineString. The text is rendered using the painter's font property. The position of the labelText can be specified using the labelPositionFlags.

See also
GeoDataLineString

Definition at line 474 of file GeoPainter.cpp.

void GeoPainter::drawRect ( const GeoDataCoordinates &  centerPosition,
qreal  width,
qreal  height,
bool  isGeoProjected = false 
)

Draws a rectangle at the given position. The rectangle is placed with its center located at the given centerPosition.

For the outline it uses the painter's pen and for the background the painter's brush.

If isGeoProjected is true then the outline of the rectangle is drawn in geographic coordinates. In this case the width and the height are interpreted to be degrees. If isGeoProjected is false then the outline of the rectangle is drawn in screen coordinates. In this case the width and the height are interpreted to be pixels.

See also
GeoDataCoordinates

Definition at line 700 of file GeoPainter.cpp.

void GeoPainter::drawRoundRect ( const GeoDataCoordinates &  centerPosition,
int  width,
int  height,
int  xRnd = 25,
int  yRnd = 25 
)

Draws a rectangle with rounded corners at the given position. The rectangle is placed with its center located at the given centerPosition.

For the outline it uses the painter's pen and for the background the painter's brush. Unlike in QPainter::drawRoundedRect() the rounded corners are not specified in percentage but in pixels to provide for optimal aesthetics.

Parameters
widthWidth of the rectangle in pixels
heightHeight of the rectangle in pixels
xRndSpecifies the geometry of the rounded corners in pixels along the x-axis.
yRndSpecifies the geometry of the rounded corners in pixels along the y-axis.
See also
GeoDataCoordinates

Definition at line 759 of file GeoPainter.cpp.

void GeoPainter::drawText ( const GeoDataCoordinates &  position,
const QString &  text 
)

Draws the given text at a given geographic position. The text is drawn starting at the given position using the painter's font property. The text rendering is performed in screen coordinates and is not subject to the current projection.

Definition at line 264 of file GeoPainter.cpp.

MapQuality GeoPainter::mapQuality ( ) const

Returns the map quality.

Returns
The map quality that got assigned to the painter.

Definition at line 191 of file GeoPainter.cpp.

QRegion GeoPainter::regionFromEllipse ( const GeoDataCoordinates &  centerPosition,
qreal  width,
qreal  height,
bool  isGeoProjected = false,
qreal  strokeWidth = 3 
) const

Creates a region for an ellipse at a given position.

A QRegion object is created that represents the area covered by GeoPainter::drawEllipse(). As such it can be used e.g. for input event handling for objects that have been painted using GeoPainter::drawEllipse().

The strokeWidth allows to extrude the QRegion by half the amount of "stroke width" pixels. For input event handling it's always advisable to use a width that is slightly bigger than the width of the painter's pen.

See also
GeoDataCoordinates

Definition at line 356 of file GeoPainter.cpp.

QRegion GeoPainter::regionFromPoint ( const GeoDataCoordinates &  position,
qreal  strokeWidth = 3 
) const

Creates a region for a given geographic position.

A QRegion object is created that represents the area covered by GeoPainter::drawPoint( GeoDataCoordinates ). It can be used e.g. for input event handling of objects that have been painted using GeoPainter::drawPoint( GeoDataCoordinates ).

The width allows to set the "stroke width" for the region. For input event handling it's always advisable to use a width that is slightly bigger than the width of the painter's pen.

See also
GeoDataCoordinates

Definition at line 244 of file GeoPainter.cpp.

QRegion GeoPainter::regionFromPoint ( const GeoDataPoint &  point,
qreal  strokeWidth = 3 
) const

Create a region for a given geographic position.

A QRegion object is created that represents the area covered by GeoPainter::drawPoint( GeoDataPoint ). It can be used e.g. for input event handling of objects that have been painted using GeoPainter::drawPoint( GeoDataPoint ).

The width allows to set the "stroke width" for the region. For input event handling it's always advisable to use a width that is slightly bigger than the width of the painter's pen.

Definition at line 257 of file GeoPainter.cpp.

QRegion GeoPainter::regionFromPolygon ( const GeoDataLinearRing &  linearRing,
Qt::FillRule  fillRule,
qreal  strokeWidth = 3 
) const

Creates a region for a given linear ring (a "polygon without holes").

A QRegion object is created that represents the area covered by GeoPainter::drawPolygon( GeoDataLinearRing ). As such it can be used e.g. for input event handling for objects that have been painted using GeoPainter::drawPolygon( GeoDataLinearRing ).

Like in drawPolygon() the fillRule specifies the fill algorithm that is used to fill the polygon.

The strokeWidth allows to extrude the QRegion by half the amount of "stroke width" pixels. For input event handling it's always advisable to use a width that is slightly bigger than the width of the painter's pen.

For the polygon case a "cosmetic" strokeWidth of zero should provide the best performance.

See also
GeoDataLinearRing

Definition at line 585 of file GeoPainter.cpp.

QRegion GeoPainter::regionFromPolyline ( const GeoDataLineString &  lineString,
qreal  strokeWidth = 3 
) const

Creates a region for a given line string (a "polyline").

A QRegion object is created that represents the area covered by GeoPainter::drawPolyline( GeoDataLineString ). As such it can be used e.g. for input event handling for objects that have been painted using GeoPainter::drawPolyline( GeoDataLineString ).

The strokeWidth allows to extrude the QRegion by half the amount of "stroke width" pixels. For input event handling it's always advisable to use a width that is slightly bigger than the width of the painter's pen.

See also
GeoDataLineString

Definition at line 526 of file GeoPainter.cpp.

QRegion GeoPainter::regionFromRect ( const GeoDataCoordinates &  centerPosition,
qreal  width,
qreal  height,
bool  isGeoProjected = false,
qreal  strokeWidth = 3 
) const

Creates a region for a rectangle at a given position.

A QRegion object is created that represents the area covered by GeoPainter::drawRect(). This can be used e.g. for input event handling for objects that have been painted using GeoPainter::drawRect().

The isGeoProjected parameter is used the same way as for GeoPainter::drawRect().

The strokeWidth allows to extrude the QRegion by half the amount of "stroke width" pixels. For input event handling it's always advisable to use a width that is slightly bigger than the width of the painter's pen. This is especially true for small objects.

See also
GeoDataCoordinates

Definition at line 726 of file GeoPainter.cpp.


The documentation for this class was generated from the following files:
  • GeoPainter.h
  • GeoPainter.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:45 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

marble

Skip menu "marble"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal