Skip to content

Commit

Permalink
Fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
kebekus committed Feb 19, 2025
1 parent 84a774e commit aefce91
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
14 changes: 14 additions & 0 deletions src/geomaps/VAC.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#pragma once

#include <QGeoCoordinate>
#include <QGeoRectangle>
#include <QQmlEngine>

using namespace Qt::Literals::StringLiterals;
Expand Down Expand Up @@ -87,6 +88,12 @@ class VAC
*/
Q_PROPERTY(QGeoCoordinate bottomRight MEMBER bottomRight)

/*! \brief Bounding box
*
* The bounding box will be invalid if the coordinates are invalid.
*/
Q_PROPERTY(QGeoRectangle boundingBox READ boundingBox)

/*! \brief Center coordinate
*
* This property holds the geographic coordinate of the raster image center,
Expand Down Expand Up @@ -139,6 +146,13 @@ class VAC
// Getter Methods
//

/*! \brief Getter function for property of the same name
*
* @returns Property boundingBox
*/
[[nodiscard]] QGeoRectangle boundingBox() const {return QGeoRectangle({topLeft, topRight, bottomLeft, bottomRight});}


/*! \brief Getter function for property of the same name
*
* @returns Property center
Expand Down
4 changes: 1 addition & 3 deletions src/geomaps/VACLibrary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,7 @@ QVector<GeoMaps::VAC> GeoMaps::VACLibrary::vacs4Point(const QGeoCoordinate& posi
{
continue;
}
#warning WRONG. Rectangle need not be coordinate-aligned
const QGeoRectangle rc(vac.topLeft, vac.bottomRight);
if (rc.contains(position))
if (vac.boundingBox().contains(position))
{
result.append(vac);
}
Expand Down
5 changes: 2 additions & 3 deletions src/geomaps/VACLibrary.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,15 +157,14 @@ class VACLibrary : public QObject
*/
[[nodiscard]] Q_INVOKABLE QVector<GeoMaps::VAC> vacsByDistance(const QGeoCoordinate& position, const QString& filter);

/*! \brief List of all VACs installed
/*! \brief List of all VACs that contain a given point.
*
* This method returns the list of all installed VACs that contain the given point.
*
* @param position Geographic position
*
* @returns List of all VACs installed
* @returns List of all VACs containing the given point.
*/
#warning docu
[[nodiscard]] Q_INVOKABLE QVector<GeoMaps::VAC> vacs4Point(const QGeoCoordinate& position);

signals:
Expand Down

0 comments on commit aefce91

Please sign in to comment.