mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 14:10:06 +00:00
Add geographic coordinates to mouse picking functions
This commit is contained in:
parent
6e04e1fab3
commit
a2f2181f1b
19 changed files with 72 additions and 42 deletions
|
|
@ -57,7 +57,8 @@ bool DrawItem::RunMousePicking(
|
|||
const QMapLibreGL::CustomLayerRenderParameters& /* params */,
|
||||
const QPointF& /* mouseLocalPos */,
|
||||
const QPointF& /* mouseGlobalPos */,
|
||||
const glm::vec2& /* mouseCoords */)
|
||||
const glm::vec2& /* mouseCoords */,
|
||||
const common::Coordinate& /* mouseGeoCoords */)
|
||||
{
|
||||
// By default, the draw item is not picked
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <scwx/qt/gl/gl.hpp>
|
||||
#include <scwx/common/geographic.hpp>
|
||||
|
||||
#include <memory>
|
||||
|
||||
|
|
@ -41,14 +42,16 @@ public:
|
|||
* @param [in] mouseLocalPos Mouse cursor widget position
|
||||
* @param [in] mouseGlobalPos Mouse cursor screen position
|
||||
* @param [in] mouseCoords Mouse cursor location in map screen coordinates
|
||||
* @param [in] mouseGeoCoords Mouse cursor location in geographic coordinates
|
||||
*
|
||||
* @return true if the draw item was picked, otherwise false
|
||||
*/
|
||||
virtual bool
|
||||
RunMousePicking(const QMapLibreGL::CustomLayerRenderParameters& params,
|
||||
const QPointF& mouseLocalPos,
|
||||
const QPointF& mouseGlobalPos,
|
||||
const glm::vec2& mouseCoords);
|
||||
const QPointF& mouseLocalPos,
|
||||
const QPointF& mouseGlobalPos,
|
||||
const glm::vec2& mouseCoords,
|
||||
const common::Coordinate& mouseGeoCoords);
|
||||
|
||||
protected:
|
||||
void
|
||||
|
|
|
|||
|
|
@ -794,7 +794,8 @@ bool GeoIcons::RunMousePicking(
|
|||
const QMapLibreGL::CustomLayerRenderParameters& params,
|
||||
const QPointF& /* mouseLocalPos */,
|
||||
const QPointF& mouseGlobalPos,
|
||||
const glm::vec2& mouseCoords)
|
||||
const glm::vec2& mouseCoords,
|
||||
const common::Coordinate& /* mouseGeoCoords */)
|
||||
{
|
||||
std::unique_lock lock {p->iconMutex_};
|
||||
|
||||
|
|
|
|||
|
|
@ -38,9 +38,10 @@ public:
|
|||
void Deinitialize() override;
|
||||
|
||||
bool RunMousePicking(const QMapLibreGL::CustomLayerRenderParameters& params,
|
||||
const QPointF& mouseLocalPos,
|
||||
const QPointF& mouseGlobalPos,
|
||||
const glm::vec2& mouseCoords) override;
|
||||
const QPointF& mouseLocalPos,
|
||||
const QPointF& mouseGlobalPos,
|
||||
const glm::vec2& mouseCoords,
|
||||
const common::Coordinate& mouseGeoCoords) override;
|
||||
|
||||
/**
|
||||
* Sets the visibility of the geo icons.
|
||||
|
|
|
|||
|
|
@ -688,7 +688,8 @@ bool PlacefileIcons::RunMousePicking(
|
|||
const QMapLibreGL::CustomLayerRenderParameters& params,
|
||||
const QPointF& /* mouseLocalPos */,
|
||||
const QPointF& mouseGlobalPos,
|
||||
const glm::vec2& mouseCoords)
|
||||
const glm::vec2& mouseCoords,
|
||||
const common::Coordinate& /* mouseGeoCoords */)
|
||||
{
|
||||
std::unique_lock lock {p->iconMutex_};
|
||||
|
||||
|
|
|
|||
|
|
@ -36,9 +36,10 @@ public:
|
|||
void Deinitialize() override;
|
||||
|
||||
bool RunMousePicking(const QMapLibreGL::CustomLayerRenderParameters& params,
|
||||
const QPointF& mouseLocalPos,
|
||||
const QPointF& mouseGlobalPos,
|
||||
const glm::vec2& mouseCoords) override;
|
||||
const QPointF& mouseLocalPos,
|
||||
const QPointF& mouseGlobalPos,
|
||||
const glm::vec2& mouseCoords,
|
||||
const common::Coordinate& mouseGeoCoords) override;
|
||||
|
||||
/**
|
||||
* Resets and prepares the draw item for adding a new set of icons.
|
||||
|
|
|
|||
|
|
@ -499,7 +499,8 @@ bool PlacefileLines::RunMousePicking(
|
|||
const QMapLibreGL::CustomLayerRenderParameters& params,
|
||||
const QPointF& /* mouseLocalPos */,
|
||||
const QPointF& mouseGlobalPos,
|
||||
const glm::vec2& mouseCoords)
|
||||
const glm::vec2& mouseCoords,
|
||||
const common::Coordinate& /* mouseGeoCoords */)
|
||||
{
|
||||
std::unique_lock lock {p->lineMutex_};
|
||||
|
||||
|
|
|
|||
|
|
@ -33,9 +33,10 @@ public:
|
|||
void Deinitialize() override;
|
||||
|
||||
bool RunMousePicking(const QMapLibreGL::CustomLayerRenderParameters& params,
|
||||
const QPointF& mouseLocalPos,
|
||||
const QPointF& mouseGlobalPos,
|
||||
const glm::vec2& mouseCoords) override;
|
||||
const QPointF& mouseLocalPos,
|
||||
const QPointF& mouseGlobalPos,
|
||||
const glm::vec2& mouseCoords,
|
||||
const common::Coordinate& mouseGeoCoords) override;
|
||||
|
||||
/**
|
||||
* Resets and prepares the draw item for adding a new set of lines.
|
||||
|
|
|
|||
|
|
@ -241,7 +241,8 @@ bool PlacefileText::RunMousePicking(
|
|||
const QMapLibreGL::CustomLayerRenderParameters& /* params */,
|
||||
const QPointF& /* mouseLocalPos */,
|
||||
const QPointF& mouseGlobalPos,
|
||||
const glm::vec2& /* mouseCoords */)
|
||||
const glm::vec2& /* mouseCoords */,
|
||||
const common::Coordinate& /* mouseGeoCoords */)
|
||||
{
|
||||
bool itemPicked = false;
|
||||
|
||||
|
|
|
|||
|
|
@ -38,9 +38,10 @@ public:
|
|||
void Deinitialize() override;
|
||||
|
||||
bool RunMousePicking(const QMapLibreGL::CustomLayerRenderParameters& params,
|
||||
const QPointF& mouseLocalPos,
|
||||
const QPointF& mouseGlobalPos,
|
||||
const glm::vec2& mouseCoords) override;
|
||||
const QPointF& mouseLocalPos,
|
||||
const QPointF& mouseGlobalPos,
|
||||
const glm::vec2& mouseCoords,
|
||||
const common::Coordinate& mouseGeoCoords) override;
|
||||
|
||||
/**
|
||||
* Resets and prepares the draw item for adding a new set of text.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue