mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-25 13:38:35 -05:00
Merge remote-tracking branch 'origin/master' into feature/video-on-globe
# Conflicts: # modules/globebrowsing/src/layergroupid.h # modules/globebrowsing/src/tileprovider/tileprovider.cpp
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
# #
|
||||
# OpenSpace #
|
||||
# #
|
||||
# Copyright (c) 2014-2022 #
|
||||
# Copyright (c) 2014-2023 #
|
||||
# #
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy of this #
|
||||
# software and associated documentation files (the "Software"), to deal in the Software #
|
||||
@@ -22,7 +22,7 @@
|
||||
# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #
|
||||
##########################################################################################
|
||||
|
||||
include(${OPENSPACE_CMAKE_EXT_DIR}/module_definition.cmake)
|
||||
include(${PROJECT_SOURCE_DIR}/support/cmake/module_definition.cmake)
|
||||
|
||||
set(HEADER_FILES
|
||||
globebrowsingmodule.h
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
@@ -129,7 +129,6 @@ namespace {
|
||||
"The maximum size of the MemoryAwareTileCache, on the CPU and GPU"
|
||||
};
|
||||
|
||||
|
||||
openspace::GlobeBrowsingModule::Capabilities
|
||||
parseSubDatasets(char** subDatasets, int nSubdatasets)
|
||||
{
|
||||
@@ -148,7 +147,7 @@ namespace {
|
||||
std::fill(IdentifierBuffer.begin(), IdentifierBuffer.end(), '\0');
|
||||
int ret = sscanf(
|
||||
subDatasets[i],
|
||||
"SUBDATASET_%i_%256[^=]",
|
||||
"SUBDATASET_%i_%255[^=]",
|
||||
&iDataset,
|
||||
IdentifierBuffer.data()
|
||||
);
|
||||
@@ -396,7 +395,7 @@ glm::vec3 GlobeBrowsingModule::cartesianCoordinatesFromGeo(
|
||||
using namespace globebrowsing;
|
||||
|
||||
const Geodetic3 pos = {
|
||||
{ glm::radians(latitude), glm::radians(longitude) },
|
||||
{ .lat = glm::radians(latitude), .lon = glm::radians(longitude) },
|
||||
altitude
|
||||
};
|
||||
|
||||
@@ -455,8 +454,8 @@ void GlobeBrowsingModule::goToChunk(const globebrowsing::RenderableGlobe& globe,
|
||||
positionOnPatch.lat *= uv.y;
|
||||
positionOnPatch.lon *= uv.x;
|
||||
const Geodetic2 pointPosition = {
|
||||
corner.lat + positionOnPatch.lat,
|
||||
corner.lon + positionOnPatch.lon
|
||||
.lat = corner.lat + positionOnPatch.lat,
|
||||
.lon = corner.lon + positionOnPatch.lon
|
||||
};
|
||||
|
||||
// Compute altitude
|
||||
@@ -692,29 +691,28 @@ uint64_t GlobeBrowsingModule::wmsCacheSize() const {
|
||||
}
|
||||
|
||||
scripting::LuaLibrary GlobeBrowsingModule::luaLibrary() const {
|
||||
scripting::LuaLibrary res;
|
||||
res.name = "globebrowsing";
|
||||
res.functions = {
|
||||
codegen::lua::AddLayer,
|
||||
codegen::lua::DeleteLayer,
|
||||
codegen::lua::GetLayers,
|
||||
codegen::lua::MoveLayer,
|
||||
codegen::lua::GoToChunk,
|
||||
codegen::lua::GoToGeo,
|
||||
// @TODO (2021-06-23, emmbr) Combine with the above function when the camera
|
||||
// paths work really well close to surfaces
|
||||
codegen::lua::FlyToGeo,
|
||||
codegen::lua::GetLocalPositionFromGeo,
|
||||
codegen::lua::GetGeoPositionForCamera,
|
||||
codegen::lua::LoadWMSCapabilities,
|
||||
codegen::lua::RemoveWMSServer,
|
||||
codegen::lua::CapabilitiesWMS
|
||||
return {
|
||||
.name = "globebrowsing",
|
||||
.functions = {
|
||||
codegen::lua::AddLayer,
|
||||
codegen::lua::DeleteLayer,
|
||||
codegen::lua::GetLayers,
|
||||
codegen::lua::MoveLayer,
|
||||
codegen::lua::GoToChunk,
|
||||
codegen::lua::GoToGeo,
|
||||
// @TODO (2021-06-23, emmbr) Combine with the above function when the camera
|
||||
// paths work really well close to surfaces
|
||||
codegen::lua::FlyToGeo,
|
||||
codegen::lua::GetLocalPositionFromGeo,
|
||||
codegen::lua::GetGeoPositionForCamera,
|
||||
codegen::lua::LoadWMSCapabilities,
|
||||
codegen::lua::RemoveWMSServer,
|
||||
codegen::lua::CapabilitiesWMS
|
||||
},
|
||||
.scripts = {
|
||||
absPath("${MODULE_GLOBEBROWSING}/scripts/layer_support.lua")
|
||||
}
|
||||
};
|
||||
res.scripts = {
|
||||
absPath("${MODULE_GLOBEBROWSING}/scripts/layer_support.lua")
|
||||
};
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
@@ -151,24 +151,26 @@ namespace {
|
||||
* Rearranges the order of a single layer on a globe. The first parameter is the
|
||||
* identifier of the globe, the second parameter specifies the name of the layer group,
|
||||
* the third parameter is the original position of the layer that should be moved and the
|
||||
* last parameter is the new position in the list. The first position in the list has
|
||||
* index 0, and the last position is given by the number of layers minus one. The new
|
||||
* position may be -1 to place the layer at the top or any number bigger than the number
|
||||
* of layers to place it at the bottom.
|
||||
* last parameter is the new position in the list. The third and fourth parameters can
|
||||
* also acccept names, in which case these refer to identifiers of the layer to be moved.
|
||||
* If the last parameter is a name, the source layer is moved below that destination
|
||||
* layer. The first position in the list has index 0, and the last position is given by
|
||||
* the number of layers minus one.
|
||||
*/
|
||||
[[codegen::luawrap]] void moveLayer(std::string globeIdentifier, std::string layer,
|
||||
int oldPosition, int newPosition)
|
||||
[[codegen::luawrap]] void moveLayer(std::string globeIdentifier, std::string layerGroup,
|
||||
std::variant<int, std::string> source,
|
||||
std::variant<int, std::string> destination)
|
||||
{
|
||||
using namespace openspace;
|
||||
using namespace globebrowsing;
|
||||
|
||||
if (oldPosition == newPosition) {
|
||||
if (source == destination) {
|
||||
return;
|
||||
}
|
||||
|
||||
SceneGraphNode* n = sceneGraphNode(globeIdentifier);
|
||||
if (!n) {
|
||||
throw ghoul::lua::LuaError("Unknown globe name: " + globeIdentifier);
|
||||
throw ghoul::lua::LuaError(fmt::format("Unknown globe: {}", globeIdentifier));
|
||||
}
|
||||
|
||||
RenderableGlobe* globe = dynamic_cast<RenderableGlobe*>(n->renderable());
|
||||
@@ -176,13 +178,62 @@ namespace {
|
||||
throw ghoul::lua::LuaError("Identifier must be a RenderableGlobe");
|
||||
}
|
||||
|
||||
layers::Group::ID group = ghoul::from_string<layers::Group::ID>(layer);
|
||||
layers::Group::ID group = ghoul::from_string<layers::Group::ID>(layerGroup);
|
||||
if (group == layers::Group::ID::Unknown) {
|
||||
throw ghoul::lua::LuaError("Unknown layer groupd: " + layer);
|
||||
throw ghoul::lua::LuaError(fmt::format("Unknown layer group: {}", layerGroup));
|
||||
}
|
||||
|
||||
LayerGroup& lg = globe->layerManager().layerGroup(group);
|
||||
if (std::holds_alternative<int>(source) && std::holds_alternative<int>(destination)) {
|
||||
// Short circut here, no need to get the layers
|
||||
lg.moveLayer(std::get<int>(source), std::get<int>(destination));
|
||||
return;
|
||||
}
|
||||
|
||||
LayerGroup& lg = globe->layerManager().layerGroup(group);
|
||||
lg.moveLayer(oldPosition, newPosition);
|
||||
std::vector<Layer*> layers = lg.layers();
|
||||
|
||||
int sourceIdx = 0;
|
||||
if (std::holds_alternative<int>(source)) {
|
||||
sourceIdx = std::get<int>(source);
|
||||
}
|
||||
else {
|
||||
auto it = std::find_if(
|
||||
layers.cbegin(), layers.cend(),
|
||||
[s = std::get<std::string>(source)](Layer* l) {
|
||||
return l->identifier() == s;
|
||||
}
|
||||
);
|
||||
if (it == layers.cend()) {
|
||||
throw ghoul::lua::LuaError(fmt::format(
|
||||
"Could not find source layer '{}'", std::get<std::string>(source)
|
||||
));
|
||||
}
|
||||
|
||||
sourceIdx = static_cast<int>(std::distance(layers.cbegin(), it));
|
||||
}
|
||||
|
||||
int destinationIdx = 0;
|
||||
if (std::holds_alternative<int>(destination)) {
|
||||
destinationIdx = std::get<int>(destination);
|
||||
}
|
||||
else {
|
||||
auto it = std::find_if(
|
||||
layers.cbegin(), layers.cend(),
|
||||
[d = std::get<std::string>(destination)](Layer* l) {
|
||||
return l->identifier() == d;
|
||||
}
|
||||
);
|
||||
if (it == layers.cend()) {
|
||||
throw ghoul::lua::LuaError(fmt::format(
|
||||
"Could not find destination layer '{}'", std::get<std::string>(source)
|
||||
));
|
||||
}
|
||||
|
||||
// +1 since we want to move the layer _below_ the specified layer
|
||||
destinationIdx = static_cast<int>(std::distance(layers.cbegin(), it));
|
||||
}
|
||||
|
||||
lg.moveLayer(sourceIdx, destinationIdx);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,7 +10,7 @@ openspace.globebrowsing.documentation = {
|
||||
{
|
||||
Name = "createGibsGdalXml",
|
||||
Arguments = { layerName = "String", date = "String", resolution = "String", format = "String" },
|
||||
Documentation =
|
||||
Documentation =
|
||||
"Creates an XML configuration for a GIBS dataset." ..
|
||||
"Arguments are: layerName, date, resolution, format." ..
|
||||
"For all specifications, see " ..
|
||||
@@ -94,7 +94,7 @@ openspace.globebrowsing.addGibsLayer = function(layer, resolution, format, start
|
||||
end
|
||||
|
||||
local layer = {
|
||||
Identifier = layerName,
|
||||
Identifier = layerName,
|
||||
Type = "TemporalTileLayer",
|
||||
Mode = "Prototyped",
|
||||
Prototyped = {
|
||||
@@ -207,7 +207,7 @@ openspace.globebrowsing.parseInfoFile = function (file)
|
||||
file_func()
|
||||
else
|
||||
openspace.printError('Error loading file "' .. file .. '": '.. error)
|
||||
return nil, nil, nil, nil
|
||||
return nil
|
||||
end
|
||||
|
||||
-- Hoist the global variables into local space
|
||||
@@ -220,11 +220,11 @@ openspace.globebrowsing.parseInfoFile = function (file)
|
||||
|
||||
-- Now we can start
|
||||
local name = Name or Identifier
|
||||
local identifier = Identifier or Name
|
||||
local identifier = Identifier
|
||||
|
||||
if name == nil and identifier == nil then
|
||||
openspace.printError('Error loading file "' .. file .. '": No "Name" or "Identifier" found')
|
||||
return nil, nil, nil, nil
|
||||
if identifier == "" then
|
||||
openspace.printError('Error loading file "' .. file .. '": No "Identifier" found')
|
||||
return nil
|
||||
end
|
||||
|
||||
local color = nil
|
||||
@@ -287,11 +287,12 @@ openspace.globebrowsing.addBlendingLayersFromDirectory = function (dir, node_nam
|
||||
for _, file in pairs(files) do
|
||||
if file and file:find('.info') and ends_with(file, '.info') then
|
||||
local t = openspace.globebrowsing.parseInfoFile(file)
|
||||
if t.Color then
|
||||
|
||||
if t and t.Color then
|
||||
openspace.printInfo("Adding color layer '" .. t.Color["Identifier"] .. "'")
|
||||
openspace.globebrowsing.addLayer(node_name, "ColorLayers", t.Color)
|
||||
end
|
||||
if t.Height then
|
||||
if t and t.Height then
|
||||
openspace.printInfo("Adding height layer '" .. t.Height["Identifier"] .. "'")
|
||||
openspace.globebrowsing.addLayer(node_name, "HeightLayers", t.Height)
|
||||
end
|
||||
@@ -306,7 +307,7 @@ openspace.globebrowsing.addFocusNodesFromDirectory = function (dir, node_name)
|
||||
if file and file:find('.info') then
|
||||
local t = openspace.globebrowsing.parseInfoFile(file)
|
||||
|
||||
if node_name and t.Location then
|
||||
if node_name and t and t.Location then
|
||||
openspace.printInfo("Creating focus node for '" .. node_name .. "'")
|
||||
|
||||
local lat = t.Location.Center[1]
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
@@ -42,19 +42,6 @@
|
||||
#include <ghoul/misc/profiling.h>
|
||||
|
||||
namespace {
|
||||
constexpr openspace::properties::Property::PropertyInfo FontNameInfo = {
|
||||
"FontName",
|
||||
"Font Name",
|
||||
"This value is the name of the font that is used. It can either refer to an "
|
||||
"internal name registered previously, or it can refer to a path that is used"
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo FontSizeInfo = {
|
||||
"FontSize",
|
||||
"Font Size",
|
||||
"This value determines the size of the font that is used to render the date"
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo DisplayFormatInfo = {
|
||||
"DisplayFormat",
|
||||
"Display Format",
|
||||
@@ -68,12 +55,6 @@ namespace {
|
||||
};
|
||||
|
||||
struct [[codegen::Dictionary(DashboardItemGlobeLocation)]] Parameters {
|
||||
// [[codegen::verbatim(FontNameInfo.description)]]
|
||||
std::optional<std::string> fontName;
|
||||
|
||||
// [[codegen::verbatim(FontSizeInfo.description)]]
|
||||
std::optional<float> fontSize;
|
||||
|
||||
enum class DisplayFormat {
|
||||
DecimalDegrees,
|
||||
DegreeMinuteSeconds
|
||||
@@ -91,32 +72,20 @@ namespace {
|
||||
namespace openspace {
|
||||
|
||||
documentation::Documentation DashboardItemGlobeLocation::Documentation() {
|
||||
return codegen::doc<Parameters>("globebrowsing_dashboarditem_globelocation");
|
||||
return codegen::doc<Parameters>(
|
||||
"globebrowsing_dashboarditem_globelocation",
|
||||
DashboardTextItem::Documentation()
|
||||
);
|
||||
}
|
||||
|
||||
DashboardItemGlobeLocation::DashboardItemGlobeLocation(
|
||||
const ghoul::Dictionary& dictionary)
|
||||
: DashboardItem(dictionary)
|
||||
, _fontName(FontNameInfo, "Mono")
|
||||
, _fontSize(FontSizeInfo, 10.f, 10.f, 144.f, 1.f)
|
||||
: DashboardTextItem(dictionary)
|
||||
, _displayFormat(DisplayFormatInfo)
|
||||
, _significantDigits(SignificantDigitsInfo, 4, 1, 12)
|
||||
, _font(global::fontManager->font("Mono", 10))
|
||||
{
|
||||
const Parameters p = codegen::bake<Parameters>(dictionary);
|
||||
|
||||
_fontName = p.fontName.value_or(_fontName);
|
||||
_fontName.onChange([this]() {
|
||||
_font = global::fontManager->font(_fontName, _fontSize);
|
||||
});
|
||||
addProperty(_fontName);
|
||||
|
||||
_fontSize = p.fontSize.value_or(_fontSize);
|
||||
_fontSize.onChange([this]() {
|
||||
_font = global::fontManager->font(_fontName, _fontSize);
|
||||
});
|
||||
addProperty(_fontSize);
|
||||
|
||||
auto updateFormatString = [this]() {
|
||||
switch (_displayFormat.value()) {
|
||||
case static_cast<int>(DisplayFormat::DecimalDegrees):
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
@@ -25,20 +25,18 @@
|
||||
#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___DASHBOARDITEMGLOBELOCATION___H__
|
||||
#define __OPENSPACE_MODULE_GLOBEBROWSING___DASHBOARDITEMGLOBELOCATION___H__
|
||||
|
||||
#include <openspace/rendering/dashboarditem.h>
|
||||
#include <openspace/rendering/dashboardtextitem.h>
|
||||
|
||||
#include <openspace/properties/optionproperty.h>
|
||||
#include <openspace/properties/stringproperty.h>
|
||||
#include <openspace/properties/scalar/floatproperty.h>
|
||||
#include <openspace/properties/scalar/intproperty.h>
|
||||
|
||||
namespace ghoul::fontrendering { class Font; }
|
||||
|
||||
namespace openspace {
|
||||
|
||||
namespace documentation { struct Documentation; }
|
||||
|
||||
class DashboardItemGlobeLocation : public DashboardItem {
|
||||
class DashboardItemGlobeLocation : public DashboardTextItem {
|
||||
public:
|
||||
DashboardItemGlobeLocation(const ghoul::Dictionary& dictionary);
|
||||
~DashboardItemGlobeLocation() override = default;
|
||||
@@ -55,13 +53,9 @@ private:
|
||||
DegreeMinuteSeconds
|
||||
};
|
||||
|
||||
properties::StringProperty _fontName;
|
||||
properties::FloatProperty _fontSize;
|
||||
|
||||
properties::OptionProperty _displayFormat;
|
||||
properties::IntProperty _significantDigits;
|
||||
|
||||
std::shared_ptr<ghoul::fontrendering::Font> _font;
|
||||
std::string _formatString;
|
||||
std::vector<char> _buffer;
|
||||
};
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
@@ -133,8 +133,8 @@ double Ellipsoid::greatCircleDistance(const Geodetic2& p1, const Geodetic2& p2)
|
||||
);
|
||||
|
||||
const Geodetic2 pMid = {
|
||||
(p1.lat + p2.lat) / 2.0,
|
||||
(p1.lon + p2.lon) / 2.0
|
||||
.lat = (p1.lat + p2.lat) / 2.0,
|
||||
.lon = (p1.lon + p2.lon) / 2.0
|
||||
};
|
||||
const glm::dvec3 centralNormal = cartesianSurfacePosition(pMid);
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
@@ -132,8 +132,8 @@ double GeodeticPatch::maxLon() const {
|
||||
|
||||
bool GeodeticPatch::contains(const Geodetic2& p) const {
|
||||
const Geodetic2 diff = {
|
||||
_center.lat - p.lat,
|
||||
_center.lon - p.lon
|
||||
.lat = _center.lat - p.lat,
|
||||
.lon = _center.lon - p.lon
|
||||
};
|
||||
return glm::abs(diff.lat) <= _halfSize.lat && glm::abs(diff.lon) <= _halfSize.lon;
|
||||
}
|
||||
@@ -166,8 +166,8 @@ Geodetic2 GeodeticPatch::clamp(const Geodetic2& p) const {
|
||||
Geodetic2 GeodeticPatch::closestCorner(const Geodetic2& p) const {
|
||||
// LatLon vector from patch center to the point
|
||||
const Geodetic2 centerToPoint = {
|
||||
p.lat - _center.lat,
|
||||
p.lon - _center.lon
|
||||
.lat = p.lat - _center.lat,
|
||||
.lon = p.lon - _center.lon
|
||||
};
|
||||
|
||||
// Normalize the difference angles to be centered around 0.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
@@ -232,11 +232,11 @@ glm::dmat3 GlobeRotation::matrix(const UpdateData&) const {
|
||||
zAxis = glm::normalize(zAxis);
|
||||
|
||||
const glm::dvec3 xAxis = glm::normalize(glm::cross(yAxis, zAxis));
|
||||
const glm::dmat3 mat = {
|
||||
const glm::dmat3 mat = glm::dmat3(
|
||||
xAxis.x, xAxis.y, xAxis.z,
|
||||
yAxis.x, yAxis.y, yAxis.z,
|
||||
zAxis.x, zAxis.y, zAxis.z
|
||||
};
|
||||
);
|
||||
|
||||
const glm::dquat q = glm::angleAxis(glm::radians(_angle.value()), yAxis);
|
||||
_matrix = glm::toMat3(q) * mat;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
@@ -61,10 +61,9 @@ namespace {
|
||||
constexpr openspace::properties::Property::PropertyInfo AltitudeInfo = {
|
||||
"Altitude",
|
||||
"Altitude",
|
||||
"The altitude in meters. "
|
||||
"If the 'UseHeightmap' property is 'true', this is an offset from the actual "
|
||||
"surface of the globe. If not, this is an offset from the reference ellipsoid."
|
||||
"The default value is 0.0"
|
||||
"The altitude in meters. If the 'UseHeightmap' property is 'true', this is an "
|
||||
"offset from the actual surface of the globe. If not, this is an offset from the "
|
||||
"reference ellipsoid. The default value is 0.0"
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo UseHeightmapInfo = {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
@@ -47,11 +47,31 @@ struct Group {
|
||||
};
|
||||
|
||||
constexpr std::array<Group, 5> Groups = {
|
||||
Group{ Group::ID::HeightLayers, "HeightLayers", "Height Layers" },
|
||||
Group{ Group::ID::ColorLayers, "ColorLayers", "Color Layers" },
|
||||
Group{ Group::ID::Overlays, "Overlays", "Overlays" },
|
||||
Group{ Group::ID::NightLayers, "NightLayers", "Night Layers" },
|
||||
Group{ Group::ID::WaterMasks, "WaterMasks", "Water Masks" }
|
||||
Group {
|
||||
.id = Group::ID::HeightLayers,
|
||||
.identifier = "HeightLayers",
|
||||
.name = "Height Layers"
|
||||
},
|
||||
Group {
|
||||
.id = Group::ID::ColorLayers,
|
||||
.identifier = "ColorLayers",
|
||||
.name = "Color Layers"
|
||||
},
|
||||
Group {
|
||||
.id = Group::ID::Overlays,
|
||||
.identifier = "Overlays",
|
||||
.name = "Overlays"
|
||||
},
|
||||
Group {
|
||||
.id = Group::ID::NightLayers,
|
||||
.identifier = "NightLayers",
|
||||
.name = "Night Layers"
|
||||
},
|
||||
Group {
|
||||
.id = Group::ID::WaterMasks,
|
||||
.identifier = "WaterMasks",
|
||||
.name = "Water Masks"
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -77,21 +97,52 @@ struct Layer {
|
||||
};
|
||||
|
||||
constexpr std::array<Layer, 11> Layers = {
|
||||
Layer{ Layer::ID::DefaultTileLayer, "DefaultTileLayer" },
|
||||
Layer{ Layer::ID::SingleImageTileLayer, "SingleImageTileLayer" },
|
||||
Layer{ Layer::ID::ImageSequenceTileLayer, "ImageSequenceTileLayer" },
|
||||
Layer{ Layer::ID::SizeReferenceTileLayer, "SizeReferenceTileLayer" },
|
||||
Layer{ Layer::ID::TemporalTileLayer, "TemporalTileLayer" },
|
||||
Layer{ Layer::ID::TileIndexTileLayer, "TileIndexTileLayer" },
|
||||
Layer{ Layer::ID::ByIndexTileLayer, "ByIndexTileLayer" },
|
||||
Layer{ Layer::ID::ByLevelTileLayer, "ByLevelTileLayer" },
|
||||
Layer{ Layer::ID::SolidColor, "SolidColor" },
|
||||
Layer{ Layer::ID::SpoutImageTileLayer, "SpoutImageTileLayer" },
|
||||
Layer{ Layer::ID::VideoTileLayer, "VideoTileLayer" }
|
||||
Layer {
|
||||
.id = Layer::ID::DefaultTileLayer,
|
||||
.identifier = "DefaultTileLayer"
|
||||
},
|
||||
Layer {
|
||||
.id = Layer::ID::SingleImageTileLayer,
|
||||
.identifier = "SingleImageTileLayer"
|
||||
},
|
||||
Layer {
|
||||
.id = Layer::ID::ImageSequenceTileLayer,
|
||||
.identifier = "ImageSequenceTileLayer"
|
||||
},
|
||||
Layer {
|
||||
.id = Layer::ID::SizeReferenceTileLayer,
|
||||
.identifier = "SizeReferenceTileLayer"
|
||||
},
|
||||
Layer {
|
||||
.id = Layer::ID::TemporalTileLayer,
|
||||
.identifier = "TemporalTileLayer"
|
||||
},
|
||||
Layer {
|
||||
.id = Layer::ID::TileIndexTileLayer,
|
||||
.identifier = "TileIndexTileLayer"
|
||||
},
|
||||
Layer {
|
||||
.id = Layer::ID::ByIndexTileLayer,
|
||||
.identifier = "ByIndexTileLayer"
|
||||
},
|
||||
Layer {
|
||||
.id = Layer::ID::ByLevelTileLayer,
|
||||
.identifier = "ByLevelTileLayer"
|
||||
},
|
||||
Layer {
|
||||
.id = Layer::ID::SolidColor,
|
||||
.identifier = "SolidColor"
|
||||
},
|
||||
Layer {
|
||||
.id = Layer::ID::SpoutImageTileLayer,
|
||||
.identifier = "SpoutImageTileLayer"
|
||||
},
|
||||
Layer {
|
||||
.id = Layer::ID::VideoTileLayer,
|
||||
.identifier = "VideoTileLayer"
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct Adjustment {
|
||||
enum class ID {
|
||||
None = 0,
|
||||
@@ -104,9 +155,18 @@ struct Adjustment {
|
||||
};
|
||||
|
||||
constexpr std::array<Adjustment, 3> Adjustments = {
|
||||
Adjustment{ Adjustment::ID::None, "None" },
|
||||
Adjustment{ Adjustment::ID::ChromaKey, "ChromaKey" },
|
||||
Adjustment{ Adjustment::ID::TransferFunction, "TransferFunction" }
|
||||
Adjustment {
|
||||
.id = Adjustment::ID::None,
|
||||
.identifier = "None"
|
||||
},
|
||||
Adjustment {
|
||||
.id = Adjustment::ID::ChromaKey,
|
||||
.identifier = "ChromaKey"
|
||||
},
|
||||
Adjustment {
|
||||
.id = Adjustment::ID::TransferFunction,
|
||||
.identifier = "TransferFunction"
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -125,11 +185,11 @@ struct Blend {
|
||||
};
|
||||
|
||||
constexpr std::array<Blend, 5> Blends = {
|
||||
Blend{ Blend::ID::Normal, "Normal" },
|
||||
Blend{ Blend::ID::Multiply, "Multiply" },
|
||||
Blend{ Blend::ID::Add, "Add" },
|
||||
Blend{ Blend::ID::Subtract, "Subtract" },
|
||||
Blend{ Blend::ID::Color, "Color" }
|
||||
Blend { .id = Blend::ID::Normal, .identifier = "Normal" },
|
||||
Blend { .id = Blend::ID::Multiply, .identifier = "Multiply" },
|
||||
Blend { .id = Blend::ID::Add, .identifier = "Add" },
|
||||
Blend { .id = Blend::ID::Subtract, .identifier = "Subtract" },
|
||||
Blend { .id = Blend::ID::Color, .identifier = "Color" }
|
||||
};
|
||||
|
||||
} // namespace openspace::globebrowsing::layers
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
@@ -145,7 +145,7 @@ std::array<LayerGroup*, LayerManager::NumLayerGroups> LayerManager::layerGroups(
|
||||
ZoneScoped
|
||||
|
||||
std::array<LayerGroup*, NumLayerGroups> res = {};
|
||||
for (int i = 0; i < NumLayerGroups; ++i) {
|
||||
for (size_t i = 0; i < NumLayerGroups; ++i) {
|
||||
res[i] = _layerGroups[i].get();
|
||||
}
|
||||
return res;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
@@ -50,7 +50,7 @@ struct RawTile {
|
||||
std::unique_ptr<std::byte[]> imageData;
|
||||
TileMetaData tileMetaData;
|
||||
std::optional<TileTextureInitData> textureInitData;
|
||||
TileIndex tileIndex = { 0, 0, 0 };
|
||||
TileIndex tileIndex = TileIndex(0, 0, 0);
|
||||
ReadError error = ReadError::None;
|
||||
GLuint pbo = 0;
|
||||
};
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
@@ -69,51 +69,51 @@ struct MemoryLocation {
|
||||
|
||||
// The memory locations are grouped to be mostly cache-aligned
|
||||
constexpr std::array<MemoryLocation, 42> NoDataAvailableData = {
|
||||
MemoryLocation{ 296380, std::byte(205) },
|
||||
MemoryLocation{ 296381, std::byte(205) },
|
||||
MemoryLocation{ 296382, std::byte(205) },
|
||||
MemoryLocation{ 296383, std::byte(255) },
|
||||
MemoryLocation{ 296384, std::byte(224) },
|
||||
MemoryLocation{ 296385, std::byte(224) },
|
||||
MemoryLocation{ 296386, std::byte(224) },
|
||||
MemoryLocation{ 296387, std::byte(255) },
|
||||
MemoryLocation{ 296388, std::byte(244) },
|
||||
MemoryLocation{ 296389, std::byte(244) },
|
||||
MemoryLocation{ 296390, std::byte(244) },
|
||||
MemoryLocation{ 296391, std::byte(255) },
|
||||
MemoryLocation { .offset = 296380, .value = std::byte(205) },
|
||||
MemoryLocation { .offset = 296381, .value = std::byte(205) },
|
||||
MemoryLocation { .offset = 296382, .value = std::byte(205) },
|
||||
MemoryLocation { .offset = 296383, .value = std::byte(255) },
|
||||
MemoryLocation { .offset = 296384, .value = std::byte(224) },
|
||||
MemoryLocation { .offset = 296385, .value = std::byte(224) },
|
||||
MemoryLocation { .offset = 296386, .value = std::byte(224) },
|
||||
MemoryLocation { .offset = 296387, .value = std::byte(255) },
|
||||
MemoryLocation { .offset = 296388, .value = std::byte(244) },
|
||||
MemoryLocation { .offset = 296389, .value = std::byte(244) },
|
||||
MemoryLocation { .offset = 296390, .value = std::byte(244) },
|
||||
MemoryLocation { .offset = 296391, .value = std::byte(255) },
|
||||
|
||||
MemoryLocation{ 269840, std::byte(209) },
|
||||
MemoryLocation{ 269841, std::byte(209) },
|
||||
MemoryLocation{ 269842, std::byte(209) },
|
||||
MemoryLocation{ 269844, std::byte(203) },
|
||||
MemoryLocation{ 269845, std::byte(203) },
|
||||
MemoryLocation{ 269846, std::byte(203) },
|
||||
MemoryLocation{ 269852, std::byte(221) },
|
||||
MemoryLocation{ 269853, std::byte(221) },
|
||||
MemoryLocation{ 269854, std::byte(221) },
|
||||
MemoryLocation{ 269856, std::byte(225) },
|
||||
MemoryLocation{ 269857, std::byte(225) },
|
||||
MemoryLocation{ 269858, std::byte(225) },
|
||||
MemoryLocation{ 269860, std::byte(218) },
|
||||
MemoryLocation{ 269861, std::byte(218) },
|
||||
MemoryLocation { .offset = 269840, .value = std::byte(209) },
|
||||
MemoryLocation { .offset = 269841, .value = std::byte(209) },
|
||||
MemoryLocation { .offset = 269842, .value = std::byte(209) },
|
||||
MemoryLocation { .offset = 269844, .value = std::byte(203) },
|
||||
MemoryLocation { .offset = 269845, .value = std::byte(203) },
|
||||
MemoryLocation { .offset = 269846, .value = std::byte(203) },
|
||||
MemoryLocation { .offset = 269852, .value = std::byte(221) },
|
||||
MemoryLocation { .offset = 269853, .value = std::byte(221) },
|
||||
MemoryLocation { .offset = 269854, .value = std::byte(221) },
|
||||
MemoryLocation { .offset = 269856, .value = std::byte(225) },
|
||||
MemoryLocation { .offset = 269857, .value = std::byte(225) },
|
||||
MemoryLocation { .offset = 269858, .value = std::byte(225) },
|
||||
MemoryLocation { .offset = 269860, .value = std::byte(218) },
|
||||
MemoryLocation { .offset = 269861, .value = std::byte(218) },
|
||||
|
||||
MemoryLocation{ 240349, std::byte(203) },
|
||||
MemoryLocation{ 240350, std::byte(203) },
|
||||
MemoryLocation{ 240352, std::byte(205) },
|
||||
MemoryLocation{ 240353, std::byte(204) },
|
||||
MemoryLocation{ 240354, std::byte(205) },
|
||||
MemoryLocation { .offset = 240349, .value = std::byte(203) },
|
||||
MemoryLocation { .offset = 240350, .value = std::byte(203) },
|
||||
MemoryLocation { .offset = 240352, .value = std::byte(205) },
|
||||
MemoryLocation { .offset = 240353, .value = std::byte(204) },
|
||||
MemoryLocation { .offset = 240354, .value = std::byte(205) },
|
||||
|
||||
MemoryLocation{ 0, std::byte(204) },
|
||||
MemoryLocation{ 7, std::byte(255) },
|
||||
MemoryLocation{ 520, std::byte(204) },
|
||||
MemoryLocation{ 880, std::byte(204) },
|
||||
MemoryLocation{ 883, std::byte(255) },
|
||||
MemoryLocation{ 91686, std::byte(204) },
|
||||
MemoryLocation{ 372486, std::byte(204) },
|
||||
MemoryLocation{ 670483, std::byte(255) },
|
||||
MemoryLocation{ 231684, std::byte(202) },
|
||||
MemoryLocation{ 232092, std::byte(202) },
|
||||
MemoryLocation{ 235921, std::byte(203) },
|
||||
MemoryLocation { .offset = 0, .value = std::byte(204) },
|
||||
MemoryLocation { .offset = 7, .value = std::byte(255) },
|
||||
MemoryLocation { .offset = 520, .value = std::byte(204) },
|
||||
MemoryLocation { .offset = 880, .value = std::byte(204) },
|
||||
MemoryLocation { .offset = 883, .value = std::byte(255) },
|
||||
MemoryLocation { .offset = 91686, .value = std::byte(204) },
|
||||
MemoryLocation { .offset = 372486, .value = std::byte(204) },
|
||||
MemoryLocation { .offset = 670483, .value = std::byte(255) },
|
||||
MemoryLocation { .offset = 231684, .value = std::byte(202) },
|
||||
MemoryLocation { .offset = 232092, .value = std::byte(202) },
|
||||
MemoryLocation { .offset = 235921, .value = std::byte(203) },
|
||||
};
|
||||
|
||||
enum class Side {
|
||||
@@ -304,10 +304,10 @@ bool isInside(const PixelRegion& lhs, const PixelRegion& rhs) {
|
||||
}
|
||||
|
||||
IODescription cutIODescription(IODescription& io, Side side, int pos) {
|
||||
glm::dvec2 ratio = {
|
||||
glm::dvec2 ratio = glm::dvec2(
|
||||
io.write.region.numPixels.x / static_cast<double>(io.read.region.numPixels.x),
|
||||
io.write.region.numPixels.y / static_cast<double>(io.read.region.numPixels.y)
|
||||
};
|
||||
);
|
||||
|
||||
IODescription whatCameOff = io;
|
||||
whatCameOff.read.region = globalCut(io.read.region, side, pos);
|
||||
@@ -785,13 +785,14 @@ IODescription RawTileDataReader::ioDescription(const TileIndex& tileIndex) const
|
||||
io.write.region.numPixels = _initData.dimensions;
|
||||
|
||||
io.read.overview = 0;
|
||||
io.read.fullRegion.start = { 0, 0 };
|
||||
io.read.fullRegion.numPixels = { _rasterXSize, _rasterYSize };
|
||||
io.read.fullRegion.start = glm::ivec2(0, 0);
|
||||
io.read.fullRegion.numPixels = glm::ivec2(_rasterXSize, _rasterYSize);
|
||||
// For correct sampling in dataset, we need to pad the texture tile
|
||||
|
||||
PixelRegion scaledPadding;
|
||||
scaledPadding.start = _initData.tilePixelStartOffset;
|
||||
scaledPadding.numPixels = _initData.tilePixelSizeDifference;
|
||||
PixelRegion scaledPadding = {
|
||||
.start = _initData.tilePixelStartOffset,
|
||||
.numPixels = _initData.tilePixelSizeDifference
|
||||
};
|
||||
|
||||
const double scale = static_cast<double>(io.read.region.numPixels.x) /
|
||||
static_cast<double>(io.write.region.numPixels.x);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
@@ -98,7 +98,7 @@ private:
|
||||
|
||||
const TileTextureInitData _initData;
|
||||
const PerformPreprocessing _preprocess;
|
||||
TileDepthTransform _depthTransform = { 0.f, 0.f };
|
||||
TileDepthTransform _depthTransform = { .scale = 0.f, .offset = 0.f };
|
||||
|
||||
mutable std::mutex _datasetLock;
|
||||
};
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
@@ -190,15 +190,15 @@ namespace {
|
||||
constexpr openspace::properties::Property::PropertyInfo ZFightingPercentageInfo = {
|
||||
"ZFightingPercentage",
|
||||
"Z-Fighting Percentage",
|
||||
"The percentage of the correct distance to the surface being shadowed. "
|
||||
"Possible values: [0.0, 1.0]"
|
||||
"The percentage of the correct distance to the surface being shadowed. Possible "
|
||||
"values: [0.0, 1.0]"
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo NumberShadowSamplesInfo = {
|
||||
"NumberShadowSamples",
|
||||
"Number of Shadow Samples",
|
||||
"The number of samples used during shadow mapping calculation "
|
||||
"(Percentage Closer Filtering)"
|
||||
"The number of samples used during shadow mapping calculation (Percentage Closer "
|
||||
"Filtering)"
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo TargetLodScaleFactorInfo = {
|
||||
@@ -1713,7 +1713,7 @@ void RenderableGlobe::recompileShaders() {
|
||||
}
|
||||
|
||||
ghoul::Dictionary layerGroupNames;
|
||||
for (int i = 0; i < layers::Groups.size(); ++i) {
|
||||
for (size_t i = 0; i < layers::Groups.size(); ++i) {
|
||||
layerGroupNames.setValue(
|
||||
std::to_string(i),
|
||||
std::string(layers::Groups[i].identifier)
|
||||
@@ -1875,13 +1875,13 @@ float RenderableGlobe::getHeight(const glm::dvec3& position) const {
|
||||
const Geodetic2 southWest = patch.corner(Quad::SOUTH_WEST);
|
||||
|
||||
const Geodetic2 geoDiffPatch = {
|
||||
northEast.lat - southWest.lat,
|
||||
northEast.lon - southWest.lon
|
||||
.lat = northEast.lat - southWest.lat,
|
||||
.lon = northEast.lon - southWest.lon
|
||||
};
|
||||
|
||||
const Geodetic2 geoDiffPoint = {
|
||||
geodeticPosition.lat - southWest.lat,
|
||||
geodeticPosition.lon - southWest.lon
|
||||
.lat = geodeticPosition.lat - southWest.lat,
|
||||
.lon = geodeticPosition.lon - southWest.lon
|
||||
};
|
||||
const glm::vec2 patchUV = glm::vec2(
|
||||
geoDiffPoint.lon / geoDiffPatch.lon,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
@@ -135,7 +135,10 @@ Tile DefaultTileProvider::tile(const TileIndex& tileIndex) {
|
||||
if (tileIndex.level > maxLevel()) {
|
||||
return Tile{ nullptr, std::nullopt, Tile::Status::OutOfRange };
|
||||
}
|
||||
const cache::ProviderTileKey key = { tileIndex, uniqueIdentifier };
|
||||
const cache::ProviderTileKey key = {
|
||||
.tileIndex = tileIndex,
|
||||
.providerID = uniqueIdentifier
|
||||
};
|
||||
cache::MemoryAwareTileCache* tileCache =
|
||||
global::moduleEngine->module<GlobeBrowsingModule>()->tileCache();
|
||||
Tile tile = tileCache->get(key);
|
||||
@@ -154,7 +157,10 @@ Tile::Status DefaultTileProvider::tileStatus(const TileIndex& index) {
|
||||
return Tile::Status::OutOfRange;
|
||||
}
|
||||
|
||||
const cache::ProviderTileKey key = { index, uniqueIdentifier };
|
||||
const cache::ProviderTileKey key = {
|
||||
.tileIndex = index,
|
||||
.providerID = uniqueIdentifier
|
||||
};
|
||||
cache::MemoryAwareTileCache* tileCache =
|
||||
global::moduleEngine->module<GlobeBrowsingModule>()->tileCache();
|
||||
return tileCache->get(key).status;
|
||||
@@ -171,7 +177,10 @@ void DefaultTileProvider::update() {
|
||||
|
||||
std::optional<RawTile> tile = _asyncTextureDataProvider->popFinishedRawTile();
|
||||
if (tile) {
|
||||
const cache::ProviderTileKey key = { tile->tileIndex, uniqueIdentifier };
|
||||
const cache::ProviderTileKey key = {
|
||||
.tileIndex = tile->tileIndex,
|
||||
.providerID = uniqueIdentifier
|
||||
};
|
||||
cache::MemoryAwareTileCache* tileCache =
|
||||
global::moduleEngine->module<GlobeBrowsingModule>()->tileCache();
|
||||
ghoul_assert(!tileCache->exist(key), "Tile must not be existing in cache");
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
@@ -94,12 +94,12 @@ Tile SizeReferenceTileProvider::tile(const TileIndex& tileIndex) {
|
||||
}
|
||||
|
||||
std::string text = fmt::format(" {:.0f} {:s}", tileLongitudalLength, unit);
|
||||
glm::vec2 textPosition = {
|
||||
glm::vec2 textPosition = glm::vec2(
|
||||
0.f,
|
||||
aboveEquator ?
|
||||
fontSize / 2.f :
|
||||
initData.dimensions.y - 3.f * fontSize / 2.f
|
||||
};
|
||||
);
|
||||
|
||||
return TextTileProvider::renderTile(tileIndex, text, textPosition, glm::vec4(1.f));
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -207,7 +207,11 @@ ChunkTile TileProvider::chunkTile(TileIndex tileIndex, int parents, int maxParen
|
||||
ti.level--;
|
||||
};
|
||||
|
||||
TileUvTransform uvTransform = { glm::vec2(0.f, 0.f), glm::vec2(1.f, 1.f) };
|
||||
TileUvTransform uvTransform = {
|
||||
.uvOffset = glm::vec2(0.f, 0.f),
|
||||
.uvScale = glm::vec2(1.f, 1.f)
|
||||
};
|
||||
|
||||
return traverseTree(tileIndex, parents, maxParents, ascendToParent, uvTransform);
|
||||
}
|
||||
|
||||
@@ -225,8 +229,8 @@ ChunkTilePile TileProvider::chunkTilePile(TileIndex tileIndex, int pileSize) {
|
||||
if (i == 0) {
|
||||
// First iteration
|
||||
chunkTilePile[i]->tile = DefaultTile;
|
||||
chunkTilePile[i]->uvTransform.uvOffset = { 0.f, 0.f };
|
||||
chunkTilePile[i]->uvTransform.uvScale = { 1.f, 1.f };
|
||||
chunkTilePile[i]->uvTransform.uvOffset = glm::vec2(0.f, 0.f);
|
||||
chunkTilePile[i]->uvTransform.uvScale = glm::vec2(1.f, 1.f);
|
||||
}
|
||||
else {
|
||||
// We are iterating through the array one-by-one, so we are guaranteed
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user