8#include <QtCore/QScopedValueRollback>
10#include <QPainterPath>
12#include <QtLocation/private/qgeomap_p.h>
13#include <QtPositioning/private/qlocationutils_p.h>
14#include <QtPositioning/private/qdoublevector2d_p.h>
15#include <QtPositioning/private/qclipperutils_p.h>
16#include <QtPositioning/private/qgeopolygon_p.h>
17#include <QtPositioning/private/qwebmercator_p.h>
114 const QList<QList <QDoubleVector2D>> &basePaths,
131 paths.reserve(basePaths.size());
136 paths << QList<QDoubleVector2D>({bp[0]});
140 if (bp[
i].
x() > pp.last().x() + 0.5)
142 else if (bp[
i].
x() < pp.last().x() - 0.5)
153 if (pp.
last().x() - pp.
first().x() < -0.5) {
157 if (pp.
last().x() - pp.
first().x() > 0.5) {
159 const double leftBorder = cameraRect.
left();
160 const double rightBorder = cameraRect.
right();
164 if (pp.
last().x() < rightBorder) {
168 if (pp.
first().x() > leftBorder) {
172 const double newPoleLat = (pp.
first().y() + pp.
last().y() < 1.0) ? 0.0 : 1.0;
195 for (
double xoffset : {-1.0, 0.0, 1.0}) {
207 wrappedPaths =
paths;
217 for (
const auto &
path : wrappedPaths) {
218 if (visibleRegion.
size()) {
233 for (
const auto &
path: clippedPaths)
239 for (
const auto &
path: clippedPaths) {
251 if (
i ==
path.size() - 1) {
254 nextPoint =
p.wrappedMapProjectionToItemPosition(
path.at(
i+1)) -
origin;
256 bool addPoint = (
i > pointsAdded * 10 ||
259 const double tolerance = 0.1;
262 point.
x(), point.
y(),
263 nextPoint.
x(), nextPoint.
y(),
264 prevPoint.
x(), prevPoint.
y());
379 m_updatingGeometry(
false)
393 [=]() {
m_d->onGeoGeometryChanged();});
451 m_d->onGeoGeometryChanged();
469 m_d->onGeoGeometryUpdated();
490 m_d->onGeoGeometryChanged();
522 return m_d->updateMapItemPaintNode(oldNode,
data);
537 m_d->markSourceDirtyAndUpdate();
542 m_d->onLinePropertiesChanged();
550 if (
event.mapSize.isEmpty())
553 m_d->afterViewportChanged();
561 return m_d->contains(point);
575 m_d->onGeoGeometryChanged();
595 if (offsetLati == 0.0 && offsetLongi == 0.0)
599 m_d->onGeoGeometryChanged();
void addClipPolygon(const QList< QDoubleVector2D > &path)
void addSubjectPath(const QList< QDoubleVector2D > &path, bool closed)
QList< QList< QDoubleVector2D > > execute(Operation op, PolyFillType subjFillType=pftNonZero, PolyFillType clipFillType=pftNonZero)
The QColor class provides colors based on RGB, HSV or CMYK values.
int alpha() const noexcept
Returns the alpha color component of this color.
virtual void setPositionOnMap(const QGeoCoordinate &coordinate, const QPointF &offset)
QGeoMap::ItemType m_itemType
void setShapeTriangulationScale(QQuickShape *shape, qreal maxCoord) const
float zoomLevelOpacity() const
virtual void setMap(QDeclarativeGeoMap *quickMap, QGeoMap *map)
void referenceSurfaceChanged()
QLocation::ReferenceSurface referenceSurface
QDeclarativeGeoMap * quickMap() const
void setPath(const QPainterPath &path)
void widthChanged(qreal width)
void colorChanged(const QColor &color)
bool contains(const QPointF &point) const override
void updatePolish() override
QList< QList< QDoubleVector2D > > m_geopathProjected
~QDeclarativePolygonMapItemPrivateCPU() override
QDeclarativeGeoMapPainterPath * m_painterPath
QGeoMapPolygonGeometry m_geometry
QQuickShapePath * m_shapePath
QDeclarativePolygonMapItemPrivateCPU(QDeclarativePolygonMapItem &polygon)
QSGNode * updateMapItemPaintNode(QSGNode *oldNode, QQuickItem::UpdatePaintNodeData *data) override
QDeclarativePolygonMapItem & m_poly
virtual ~QDeclarativePolygonMapItemPrivate()
void updatePolish() override
Q_INVOKABLE void addCoordinate(const QGeoCoordinate &coordinate)
\qmlmethod void MapPolygon::addCoordinate(coordinate)
bool contains(const QPointF &point) const override
void setGeoShape(const QGeoShape &shape) override
QList< QGeoCoordinate > path
void colorChanged(const QColor &color)
std::unique_ptr< QDeclarativePolygonMapItemPrivate > m_d
void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override
void setMap(QDeclarativeGeoMap *quickMap, QGeoMap *map) override
QSGNode * updateMapItemPaintNode(QSGNode *, UpdatePaintNodeData *) override
QDeclarativeMapLineProperties * border
\qmlpropertygroup Location::MapPolygon::border \qmlproperty int MapPolygon::border....
void onLinePropertiesChanged()
~QDeclarativePolygonMapItem() override
void setColor(const QColor &color)
const QGeoShape & geoShape() const override
void afterViewportChanged(const QGeoMapViewportChangeEvent &event) override
void setPath(const QList< QGeoCoordinate > &value)
void markSourceDirtyAndUpdate()
Q_INVOKABLE void removeCoordinate(const QGeoCoordinate &coordinate)
\qmlmethod void MapPolygon::removeCoordinate(coordinate)
QDeclarativeMapLineProperties m_border
QDeclarativePolygonMapItem(QQuickItem *parent=nullptr)
Q_DECL_CONSTEXPR QPointF toPointF() const
Q_DECL_CONSTEXPR double x() const
Q_DECL_CONSTEXPR double y() const
double longitude
This property holds the longitude in decimal degrees.
double latitude
This property holds the latitude in decimal degrees.
bool isValid
This property holds the validity of this geo coordinate.
QGeoCoordinate srcOrigin_
QRectF sourceBoundingBox() const
const QGeoCoordinate & origin() const
bool isScreenDirty() const
QPainterPath srcPath() const
void updateSourcePoints(const QGeoMap &map, const QList< QList< QDoubleVector2D > > &path, MapBorderBehaviour wrapping=Duplicate)
QGeoMapPolygonGeometry()
\qmltype MapPolygon \instantiates QDeclarativePolygonMapItem \inqmlmodule QtLocation
const QGeoProjection & geoProjection() const
void setPerimeter(const QList< QGeoCoordinate > &path)
Sets the perimeter of the polygon based on a list of coordinates path.
Q_INVOKABLE void removeCoordinate(const QGeoCoordinate &coordinate)
Removes the last occurrence of coordinate from the polygon.
Q_INVOKABLE void translate(double degreesLatitude, double degreesLongitude)
Translates this geo polygon by degreesLatitude northwards and degreesLongitude eastwards.
Q_INVOKABLE void addCoordinate(const QGeoCoordinate &coordinate)
Appends coordinate to the polygon.
QList< QGeoCoordinate > perimeter
virtual QGeoCoordinate itemPositionToCoordinate(const QDoubleVector2D &pos, bool clipToViewport=true) const =0
bool isValid
This property holds the validity of the geo shape.
qsizetype size() const noexcept
void push_front(rvalue_ref t)
bool isEmpty() const noexcept
iterator insert(qsizetype i, parameter_type t)
void swapItemsAt(qsizetype i, qsizetype j)
qsizetype length() const noexcept
void reserve(qsizetype size)
void append(parameter_type t)
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
Q_WEAK_OVERLOAD void setObjectName(const QString &name)
Sets the object's name to name.
void translate(qreal dx, qreal dy)
Translates all elements in the path by ({dx}, {dy}).
void moveTo(const QPointF &p)
Moves the current point to the given point, implicitly starting a new subpath and closing the previou...
QPainterPath simplified() const
QRectF boundingRect() const
Returns the bounding rectangle of this painter path as a rectangle with floating point precision.
void closeSubpath()
Closes the current subpath by drawing a line to the beginning of the subpath, automatically starting ...
void lineTo(const QPointF &p)
Adds a straight line from the current position to the given endPoint.
\inmodule QtCore\reentrant
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
void setSize(const QSizeF &size)
void setFlag(Flag flag, bool enabled=true)
Enables the specified flag for this item if enabled is true; if enabled is false, the flag is disable...
virtual void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry)
Q_INVOKABLE QPointF mapToItem(const QQuickItem *item, const QPointF &point) const
Maps the given point in this item's coordinate system to the equivalent point within item's coordinat...
QQmlListProperty< QQuickPathElement > pathElements
\qmlproperty list<PathElement> QtQuick::Path::pathElements This property holds the objects composing ...
void setStrokeColor(const QColor &color)
void setStrokeWidth(qreal w)
void setFillColor(const QColor &color)
bool contains(const QPointF &point) const override
\qmlmethod bool QtQuick::Item::contains(point point)
void setContainsMode(ContainsMode containsMode)
FINALQQmlListProperty< QObject > data
\qmlproperty list<Object> QtQuick.Shapes::Shape::data
\inmodule QtCore\reentrant
constexpr QRectF translated(qreal dx, qreal dy) const noexcept
Returns a copy of the rectangle that is translated dx along the x axis and dy along the y axis,...
constexpr qreal left() const noexcept
Returns the x-coordinate of the rectangle's left edge.
bool intersects(const QRectF &r) const noexcept
Returns true if this rectangle intersects with the given rectangle (i.e.
constexpr QPointF topLeft() const noexcept
Returns the position of the rectangle's top-left corner.
constexpr QPointF center() const noexcept
Returns the center point of the rectangle.
constexpr QSizeF size() const noexcept
Returns the size of the rectangle.
constexpr qreal top() const noexcept
Returns the y-coordinate of the rectangle's top edge.
constexpr qreal right() const noexcept
Returns the x-coordinate of the rectangle's right edge.
\group qtquick-scenegraph-nodes \title Qt Quick Scene Graph Node classes
QMap< QString, QString > map
[6]
QRectF boundingRectangleFromList(const QList< QDoubleVector2D > &list)
double distanceSqrPointLine(double p0_x, double p0_y, double p1_x, double p1_y, double p2_x, double p2_y)
Combined button and popup list for selecting options.
static void addPoint(QPolygon &a, const QPoint &p)
constexpr const T & qMax(const T &a, const T &b)
GLint GLint GLint GLint GLint x
[0]
GLenum GLuint GLenum GLsizei length
GLsizei const GLuint * paths
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLsizei const GLchar *const * path
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent