mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 22:20:04 +00:00
added marker_types code for dealing with new marker icons
This commit is contained in:
parent
875fb8a8c9
commit
7ed89fdd5d
3 changed files with 61 additions and 1 deletions
|
|
@ -222,8 +222,8 @@ set(HDR_TYPES source/scwx/qt/types/alert_types.hpp
|
||||||
source/scwx/qt/types/layer_types.hpp
|
source/scwx/qt/types/layer_types.hpp
|
||||||
source/scwx/qt/types/location_types.hpp
|
source/scwx/qt/types/location_types.hpp
|
||||||
source/scwx/qt/types/map_types.hpp
|
source/scwx/qt/types/map_types.hpp
|
||||||
source/scwx/qt/types/media_types.hpp
|
|
||||||
source/scwx/qt/types/marker_types.hpp
|
source/scwx/qt/types/marker_types.hpp
|
||||||
|
source/scwx/qt/types/media_types.hpp
|
||||||
source/scwx/qt/types/qt_types.hpp
|
source/scwx/qt/types/qt_types.hpp
|
||||||
source/scwx/qt/types/radar_product_record.hpp
|
source/scwx/qt/types/radar_product_record.hpp
|
||||||
source/scwx/qt/types/text_event_key.hpp
|
source/scwx/qt/types/text_event_key.hpp
|
||||||
|
|
@ -239,6 +239,7 @@ set(SRC_TYPES source/scwx/qt/types/alert_types.cpp
|
||||||
source/scwx/qt/types/layer_types.cpp
|
source/scwx/qt/types/layer_types.cpp
|
||||||
source/scwx/qt/types/location_types.cpp
|
source/scwx/qt/types/location_types.cpp
|
||||||
source/scwx/qt/types/map_types.cpp
|
source/scwx/qt/types/map_types.cpp
|
||||||
|
source/scwx/qt/types/marker_types.cpp
|
||||||
source/scwx/qt/types/media_types.cpp
|
source/scwx/qt/types/media_types.cpp
|
||||||
source/scwx/qt/types/qt_types.cpp
|
source/scwx/qt/types/qt_types.cpp
|
||||||
source/scwx/qt/types/radar_product_record.cpp
|
source/scwx/qt/types/radar_product_record.cpp
|
||||||
|
|
|
||||||
34
scwx-qt/source/scwx/qt/types/marker_types.cpp
Normal file
34
scwx-qt/source/scwx/qt/types/marker_types.cpp
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
#include <scwx/qt/types/marker_types.hpp>
|
||||||
|
|
||||||
|
namespace scwx
|
||||||
|
{
|
||||||
|
namespace qt
|
||||||
|
{
|
||||||
|
namespace types
|
||||||
|
{
|
||||||
|
|
||||||
|
const std::vector<MarkerIconInfo>& getMarkerIcons()
|
||||||
|
{
|
||||||
|
static std::vector<MarkerIconInfo> markerIcons = {};
|
||||||
|
if (markerIcons.size() == 0)
|
||||||
|
{
|
||||||
|
markerIcons = {
|
||||||
|
MarkerIconInfo(types::ImageTexture::LocationMarker, -1, -1),
|
||||||
|
MarkerIconInfo(types::ImageTexture::LocationPin, 6, 16),
|
||||||
|
MarkerIconInfo(types::ImageTexture::LocationCrosshair, -1, -1),
|
||||||
|
MarkerIconInfo(types::ImageTexture::LocationStar, -1, -1),
|
||||||
|
MarkerIconInfo(types::ImageTexture::LocationBriefcase, -1, -1),
|
||||||
|
MarkerIconInfo(types::ImageTexture::LocationBuildingColumns, -1, -1),
|
||||||
|
MarkerIconInfo(types::ImageTexture::LocationBuilding, -1, -1),
|
||||||
|
MarkerIconInfo(types::ImageTexture::LocationCaravan, -1, -1),
|
||||||
|
MarkerIconInfo(types::ImageTexture::LocationHouse, -1, -1),
|
||||||
|
MarkerIconInfo(types::ImageTexture::LocationTent, -1, -1),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return markerIcons;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace types
|
||||||
|
} // namespace qt
|
||||||
|
} // namespace scwx
|
||||||
|
|
@ -1,8 +1,12 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <scwx/qt/types/texture_types.hpp>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
|
#include <QIcon>
|
||||||
|
|
||||||
namespace scwx
|
namespace scwx
|
||||||
{
|
{
|
||||||
namespace qt
|
namespace qt
|
||||||
|
|
@ -24,6 +28,27 @@ struct MarkerInfo
|
||||||
double longitude;
|
double longitude;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct MarkerIconInfo {
|
||||||
|
explicit MarkerIconInfo(types::ImageTexture texture,
|
||||||
|
std::int32_t hotX,
|
||||||
|
std::int32_t hotY) :
|
||||||
|
name{types::GetTextureName(texture)},
|
||||||
|
path{types::GetTexturePath(texture)},
|
||||||
|
hotX{hotX},
|
||||||
|
hotY{hotY},
|
||||||
|
qIcon{QIcon(QString::fromStdString(path))}
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string name;
|
||||||
|
std::string path;
|
||||||
|
std::int32_t hotX;
|
||||||
|
std::int32_t hotY;
|
||||||
|
QIcon qIcon;
|
||||||
|
};
|
||||||
|
|
||||||
|
const std::vector<MarkerIconInfo>& getMarkerIcons();
|
||||||
|
|
||||||
} // namespace types
|
} // namespace types
|
||||||
} // namespace qt
|
} // namespace qt
|
||||||
} // namespace scwx
|
} // namespace scwx
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue