Marble
GeoPainter.cpp
31 GeoPainterPrivate::GeoPainterPrivate( GeoPainter* q, const ViewportParams *viewport, MapQuality mapQuality )
60 qreal x0 = ( x + bubbleOffsetX ) - dx * ( 1.0 - arrowPosition ) * ( width - 2.0 * xRnd ) - xRnd *dx;
62 qreal x2 = ( x + bubbleOffsetX ) - dx * ( 1.0 - arrowPosition ) * ( width - 2.0 * xRnd ) + xRnd * dx;
122 GeoDataLinearRing GeoPainterPrivate::createLinearRingFromGeoRect( const GeoDataCoordinates & centerCoordinates,
136 qreal north = GeoDataCoordinates::normalizeLat( lat + height * 0.5, GeoDataCoordinates::Degree );
137 qreal south = GeoDataCoordinates::normalizeLat( lat - height * 0.5, GeoDataCoordinates::Degree );
181 void GeoPainterPrivate::drawTextRotated( const QPointF &startPoint, qreal angle, const QString &text )
193 // -------------------------------------------------------------------------------------------------
195 GeoPainter::GeoPainter( QPaintDevice* pd, const ViewportParams *viewport, MapQuality mapQuality )
232 bool visible = d->m_viewport->screenCoordinates( position, d->m_x, y, pointRepeatNum, QSizeF(), globeHidesPoint );
239 d->createAnnotationLayout( d->m_x[it], y, bubbleSize, bubbleOffsetX, bubbleOffsetY, xRnd, yRnd, path, rect );
253 bool visible = d->m_viewport->screenCoordinates( position, d->m_x, y, pointRepeatNum, QSizeF(), globeHidesPoint );
301 bool visible = d->m_viewport->screenCoordinates( position, d->m_x, y, pointRepeatNum, textSize, globeHidesPoint );
329 bool visible = d->m_viewport->screenCoordinates( centerPosition, d->m_x, y, pointRepeatNum, QSizeF( width, height ), globeHidesPoint );
398 bool visible = d->m_viewport->screenCoordinates( centerPosition, d->m_x, y, pointRepeatNum, QSizeF( width, height ), globeHidesPoint );
407 const int startY = antialiased ? (qFloor(y - halfStrokeWidth)) : (qFloor(y+0.5 - halfStrokeWidth));
408 const int endY = antialiased ? (qCeil(y + height + halfStrokeWidth)) : (qFloor(y+0.5 + height + halfStrokeWidth));
412 const int startX = antialiased ? (qFloor(x - halfStrokeWidth)) : (qFloor(x+0.5 - halfStrokeWidth));
413 const int endX = antialiased ? (qCeil(x + width + halfStrokeWidth)) : (qFloor(x+0.5 + width + halfStrokeWidth));
478 bool visible = d->m_viewport->screenCoordinates( centerPosition, d->m_x, y, pointRepeatNum, image.size(), globeHidesPoint );
501 bool visible = d->m_viewport->screenCoordinates( centerPosition, d->m_x, y, pointRepeatNum, pixmap.size(), globeHidesPoint );
831 if ( ! d->m_viewport->viewLatLonAltBox().intersects( polygon.outerBoundary().latLonAltBox() ) ||
976 const int startY = antialiased ? (qFloor(topY - halfStrokeWidth)) : (qFloor(topY+0.5 - halfStrokeWidth));
977 const int endY = antialiased ? (qCeil(topY + height + halfStrokeWidth)) : (qFloor(centerY+0.5 + height + halfStrokeWidth));
981 const int startX = antialiased ? (qFloor(leftX - halfStrokeWidth)) : (qFloor(leftX+0.5 - halfStrokeWidth));
982 const int endX = antialiased ? (qCeil(leftX + width + halfStrokeWidth)) : (qFloor(leftX+0.5 + width + halfStrokeWidth));
1004 bool visible = d->m_viewport->screenCoordinates( centerPosition, d->m_x, y, pointRepeatNum, QSizeF( width, height ), globeHidesPoint );
Antialiasing
AlignHCenter
QTextStream & right(QTextStream &stream)
qreal height() const const
bool isEmpty() const const
qreal widthF() const const
void arcTo(const QRectF &rectangle, qreal startAngle, qreal sweepLength)
A class that defines a 3D bounding box for geographic data.
Definition: GeoDataLatLonAltBox.h:42
void setWidth(qreal width)
void addPolygon(const QPolygonF &polygon)
QString number(int n, int base)
int height() const const
void drawPixmap(const QRectF &target, const QPixmap &pixmap, const QRectF &source)
int size() const const
void geoCoordinates(qreal &lon, qreal &lat, GeoDataCoordinates::Unit unit) const
use this function to get the longitude and latitude with one call - use the unit parameter to switch ...
Definition: GeoDataCoordinates.cpp:161
void drawEllipse(const QRectF &rectangle)
QTransform & rotate(qreal angle, Qt::Axis axis)
QSize size() const const
void setTopLeft(const QPointF &position)
void drawRect(const QRectF &rectangle)
void setPointSize(int pointSize)
QPointF pointAtPercent(qreal t) const const
QTextStream & left(QTextStream &stream)
TextWordWrap
bool testFlag(Enum flag) const const
int horizontalAdvance(const QString &text, int len) const const
QRegion regionFromPolyline(const GeoDataLineString &lineString, qreal strokeWidth=3) const
Creates a region for a given line string (a "polyline").
Definition: GeoPainter.cpp:726
void fill(const QColor &color)
int width() const const
int ascent() const const
void drawRoundedRect(const GeoDataCoordinates ¢erPosition, qreal width, qreal height, qreal xRnd=25.0, qreal yRnd=25.0)
Draws a rectangle with rounded corners at the given position. The rectangle is placed with its center...
Definition: GeoPainter.cpp:995
int x() const const
int y() const const
qreal longitude(GeoDataCoordinates::Unit unit) const
retrieves the longitude of the GeoDataCoordinates object use the unit parameter to switch between Rad...
Definition: GeoDataCoordinates.cpp:198
const QPen & pen() const const
bool contains(const QRect &rectangle, bool proper) const const
T & first()
void strokePath(const QPainterPath &path, const QPen &pen)
void drawText(const QPointF &position, const QString &text)
bool testRenderHint(QPainter::RenderHint hint) const const
void drawImage(const QRectF &target, const QImage &image, const QRectF &source, Qt::ImageConversionFlags flags)
QPolygonF toFillPolygon(const QMatrix &matrix) const const
QRegion regionFromPixmapRect(const GeoDataCoordinates ¢erCoordinates, int width, int height, int margin=0) const
Creates a region for a rectangle for a pixmap at a given position.
Definition: GeoPainter.cpp:515
bool begin(QPaintDevice *device)
void drawLabelsForPolygons(const QVector< QPolygonF * > &polygons, const QString &labelText, LabelPositionFlags labelPositionFlags, const QColor &labelColor)
Draws Labels for a given set of screen polygons.
Definition: GeoPainter.cpp:592
QVector< GeoDataLinearRing > & innerBoundaries()
Returns a set of inner boundaries which are represented as LinearRings.
Definition: GeoDataPolygon.cpp:157
bool end()
OddEvenFill
void clear()
Ellipse
void setX(qreal x)
void setY(qreal y)
A LineString that allows to store a contiguous set of line segments.
Definition: GeoDataLineString.h:67
GeoPainter(QPaintDevice *paintDevice, const ViewportParams *viewportParams, MapQuality mapQuality=NormalQuality)
Creates a new geo painter.
Definition: GeoPainter.cpp:195
qreal angleAtPercent(qreal t) const const
QRegion regionFromEllipse(const GeoDataCoordinates ¢erPosition, qreal width, qreal height, bool isGeoProjected=false, qreal strokeWidth=3) const
Creates a region for an ellipse at a given position.
Definition: GeoPainter.cpp:388
A public class that controls what is visible in the viewport of a Marble map.
Definition: ViewportParams.h:41
void drawRoundedRect(const QRectF &rect, qreal xRadius, qreal yRadius, Qt::SizeMode mode)
const GeoDataLatLonAltBox & latLonAltBox() const override
Returns the smallest latLonAltBox that contains the LineString.
Definition: GeoDataLineString.cpp:794
qreal altitude() const
return the altitude of the Point in meters
Definition: GeoDataCoordinates.cpp:718
QTransform & translate(qreal dx, qreal dy)
QRegion regionFromPoint(const GeoDataCoordinates &position, qreal strokeWidth=3) const
Creates a region for a given geographic position.
Definition: GeoPainter.cpp:264
void setAlphaF(qreal alpha)
qreal latitude(GeoDataCoordinates::Unit unit) const
retrieves the latitude of the GeoDataCoordinates object use the unit parameter to switch between Radi...
Definition: GeoDataCoordinates.cpp:215
bool isEmpty() const const
void drawPath(const QPainterPath &path)
QPainterPath createStroke(const QPainterPath &path) const const
void setBottomRight(const QPointF &position)
int length() const const
MapQuality
This enum is used to choose the map quality shown in the view.
Definition: MarbleGlobal.h:74
A class that defines a 2D bounding box for geographic data.
Definition: GeoDataLatLonBox.h:46
QFontMetrics fontMetrics() const const
Binds a QML item to a specific geodetic location in screen coordinates.
Definition: AbstractDataPlugin.cpp:22
QSize size() const const
int height() const const
A painter that allows to draw geometric primitives on the map.
Definition: GeoPainter.h:88
void reserve(int size)
void setBrush(const QBrush &brush)
void drawText(const GeoDataCoordinates &position, const QString &text, qreal xOffset=0.0, qreal yOffset=0.0, qreal width=0.0, qreal height=0.0, const QTextOption &option=QTextOption())
Draws the given text at a given geographic position. The text is drawn starting at the given position...
Definition: GeoPainter.cpp:284
QPixmap * find(const QString &key)
QRectF boundingRect(const QRectF &rectangle, int flags, const QString &text)
void polygonsFromLineString(const GeoDataLineString &lineString, QVector< QPolygonF * > &polygons) const
Helper method for safe and quick linestring conversion.
Definition: GeoPainter.cpp:544
qreal length() const const
int height() const const
void drawPoint(const QPointF &position)
qreal x() const const
qreal y() const const
GeoDataLinearRing & outerBoundary()
Returns the outer boundary that is represented as a LinearRing.
Definition: GeoDataPolygon.cpp:135
void drawPixmap(const GeoDataCoordinates ¢erPosition, const QPixmap &pixmap)
Draws a pixmap at the given position. The pixmap is placed with its center located at the given cente...
Definition: GeoPainter.cpp:492
QString left(int n) const const
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)
Draws a text annotation that points to a geodesic position.
Definition: GeoPainter.cpp:217
QRect viewport() const const
const QFont & font() const const
QPoint toPoint() const const
const QChar at(int position) const const
void drawPoint(const GeoDataCoordinates &position)
Draws a single point at a given geographic position. The point is drawn using the painter's pen color...
Definition: GeoPainter.cpp:247
void moveTo(const QPointF &point)
void drawEllipse(const GeoDataCoordinates ¢erPosition, 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 ce...
Definition: GeoPainter.cpp:320
static qreal normalizeLat(qreal lat, GeoDataCoordinates::Unit=GeoDataCoordinates::Radian)
normalize latitude to always be in -M_PI / 2.
Definition: GeoDataCoordinates.cpp:268
QTextStream & center(QTextStream &stream)
int size() const const
virtual bool intersects(const GeoDataLatLonAltBox &) const
Check if this GeoDataLatLonAltBox intersects with the given one.
Definition: GeoDataLatLonAltBox.cpp:188
void setPointSizeF(qreal pointSize)
void drawPolygon(const GeoDataLinearRing &linearRing, Qt::FillRule fillRule=Qt::OddEvenFill)
Draws a given linear ring (a "polygon without holes").
Definition: GeoPainter.cpp:759
QColor lighter(int factor) const const
QPainterPath united(const QPainterPath &p) const const
void drawImage(const GeoDataCoordinates ¢erPosition, const QImage &image)
Draws an image at the given position. The image is placed with its center located at the given center...
Definition: GeoPainter.cpp:466
void setRenderHint(QPainter::RenderHint hint, bool on)
NoPen
void setFont(const QFont &font)
void setHeight(qreal height)
QPolygon toPolygon() const const
QRegion regionFromRect(const GeoDataCoordinates ¢erPosition, qreal width, qreal height, bool isGeoProjected=false, qreal strokeWidth=3) const
Creates a region for a rectangle at a given position.
Definition: GeoPainter.cpp:955
QRegion regionFromPolygon(const GeoDataLinearRing &linearRing, Qt::FillRule fillRule, qreal strokeWidth=3) const
Creates a region for a given linear ring (a "polygon without holes").
Definition: GeoPainter.cpp:784
static qreal normalizeLon(qreal lon, GeoDataCoordinates::Unit=GeoDataCoordinates::Radian)
normalize the longitude to always be -M_PI <= lon <= +M_PI (Radian).
Definition: GeoDataCoordinates.cpp:245
bool insert(const QString &key, const QPixmap &pixmap)
int height() const const
virtual bool isClippedToSphere() const
Defines whether a projection is supposed to be clipped to a certain radius.
Definition: AbstractProjection.cpp:143
A LinearRing that allows to store a closed, contiguous set of line segments.
Definition: GeoDataLinearRing.h:62
transparent
bool empty() const const
int width() const const
void drawRect(const GeoDataCoordinates ¢erPosition, 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...
Definition: GeoPainter.cpp:927
qreal width() const const
qreal height() const const
void drawPolyline(const GeoDataLineString &lineString, const QString &labelText, LabelPositionFlags labelPositionFlags=LineCenter, const QColor &labelcolor=Qt::black)
Draws a given line string (a "polyline") with a label.
Definition: GeoPainter.cpp:562
void lineTo(const QPointF &endPoint)
int width() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sat Jan 28 2023 04:00:20 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sat Jan 28 2023 04:00:20 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.