Merge remote-tracking branch 'origin/master' into thesis/2019/spaceweather-stream

This commit is contained in:
Sovanny Huy
2019-05-20 12:02:56 -04:00
214 changed files with 6002 additions and 1767 deletions

1
.gitignore vendored
View File

@@ -29,6 +29,7 @@ Thumbs.db
/documentation/
/logs/
/screenshots/
/recordings/
/sync/
# Customization is not supposed to be committed
customization.lua

View File

@@ -27,9 +27,9 @@ cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
project(OpenSpace)
set(OPENSPACE_VERSION_MAJOR 0)
set(OPENSPACE_VERSION_MINOR 13)
set(OPENSPACE_VERSION_MINOR 14)
set(OPENSPACE_VERSION_PATCH 0)
set(OPENSPACE_VERSION_STRING "Beta-3")
set(OPENSPACE_VERSION_STRING "Beta-4")
set(OPENSPACE_BASE_DIR "${PROJECT_SOURCE_DIR}")
@@ -103,7 +103,7 @@ execute_process(
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
RESULT_VARIABLE OPENSPACE_GIT_STATUS_RETURN
)
if (NOT OPENSPACE_GIT_STATUS_RETURN EQUAL 0)
if (NOT OPENSPACE_GIT_STATUS_RETURN EQUAL 0)
set(OPENSPACE_GIT_STATUS "uncommitted changes")
else()
set(OPENSPACE_GIT_STATUS "")
@@ -118,7 +118,7 @@ include(src/CMakeLists.txt)
##########################################################################################
# System libraries
if (APPLE)
begin_dependency("Core Libraries")
begin_dependency("Core Libraries")
target_include_directories(openspace-core PUBLIC "/Developer/Headers/FlatCarbon")
find_library(COREFOUNDATION_LIBRARY CoreFoundation)
find_library(CARBON_LIBRARY Carbon)
@@ -186,8 +186,27 @@ if (MSVC)
target_include_directories(openspace-core PUBLIC ${OPENSPACE_EXT_DIR}/vld)
end_dependency()
endif ()
endif ()
option(OPENSPACE_VTUNE_ENABLED "Include VTune support" OFF)
set(OPENSPACE_VTUNE_PATH "C:/Program Files (x86)/IntelSWTools/VTune Amplifier 2019" CACHE STRING "Path to VTune installation")
if (OPENSPACE_VTUNE_ENABLED)
begin_dependency("Intel VTune")
target_compile_definitions(openspace-core PUBLIC "OPENSPACE_HAS_VTUNE")
target_include_directories(openspace-core PUBLIC "${OPENSPACE_VTUNE_PATH}/include")
target_link_libraries(openspace-core "${OPENSPACE_VTUNE_PATH}/lib64/libittnotify.lib")
end_dependency()
endif ()
option(OPENSPACE_NVTOOLS_ENABLED "Include support for Nvidia Tools Extensions" OFF)
set(OPENSPACE_NVTOOLS_PATH "C:/Program Files/NVIDIA Corporation/NvToolsExt")
if (OPENSPACE_NVTOOLS_ENABLED)
begin_dependency("Nvidia Tools Extension")
target_compile_definitions(openspace-core PUBLIC "OPENSPACE_HAS_NVTOOLS")
target_include_directories(openspace-core PUBLIC "${OPENSPACE_NVTOOLS_PATH}/include")
end_dependency()
endif ()
endif ()
##########################################################################################
# Tests #
@@ -237,7 +256,7 @@ message(STATUS "")
# target as of July 2017, which is needed.
if (OPENSPACE_MODULE_WEBBROWSER AND CEF_ROOT)
# wanted by CEF
set(CMAKE_BUILD_TYPE Debug CACHE INTERNAL "CMAKE_BUILD_TYPE")
set(CMAKE_BUILD_TYPE Debug CACHE STRING "CMAKE_BUILD_TYPE")
set(PROJECT_ARCH "x86_64")

View File

@@ -1,11 +1,11 @@
# Core Team
Alexander Bock
Emil Axelsson
Kalle Bladin
Micah Acinapura
Jonathas Costa
Joakim Kilby
Gene Payne
Micah Acinapura
Kalle Bladin
Joakim Kilby
Erik Sundén
Eric Myers

View File

@@ -2,7 +2,7 @@
# #
# OpenSpace #
# #
# Copyright (c) 2014-2018 #
# Copyright (c) 2014-2019 #
# #
# 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 #
@@ -56,9 +56,6 @@ target_link_libraries(OpenSpace-MinVR libOpenSpace MinVR)
# Why not put these in the module's path? Because they do not have access to the
# target as of July 2017, which is needed.
if (OPENSPACE_MODULE_WEBBROWSER AND CEF_ROOT)
# wanted by CEF
set(CMAKE_BUILD_TYPE Debug CACHE INTERNAL "CMAKE_BUILD_TYPE")
if (WIN32)
set(RESOURCE_FILE ${OPENSPACE_APPS_DIR}/OpenSpace-MinVR/openspace.rc)
endif ()

View File

@@ -2,7 +2,7 @@
# #
# OpenSpace #
# #
# Copyright (c) 2014-2018 #
# Copyright (c) 2014-2019 #
# #
# 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 #
@@ -152,7 +152,6 @@ end_header("Dependency: SGCT")
# target as of July 2017, which is needed.
if (OPENSPACE_MODULE_WEBBROWSER AND CEF_ROOT)
# wanted by CEF
set(CMAKE_BUILD_TYPE Debug CACHE INTERNAL "CMAKE_BUILD_TYPE")
set(PROJECT_ARCH "x86_64")
if (WIN32)
@@ -176,3 +175,7 @@ if (MSVC)
target_link_libraries(OpenSpace Dbghelp.lib)
end_header()
endif ()
if (OPENSPACE_NVTOOLS_ENABLED)
target_link_libraries(OpenSpace "${OPENSPACE_NVTOOLS_PATH}/lib/x64/nvToolsExt64_1.lib")
endif ()

View File

@@ -44,6 +44,7 @@
#include <sgct.h>
#include <chrono>
#include <ctime>
#include <stb_image.h>
#ifdef WIN32
#include <openspace/openspace.h>
@@ -63,6 +64,18 @@
#include "SpoutLibrary.h"
#endif // OPENSPACE_HAS_SPOUT
#ifdef OPENSPACE_HAS_VTUNE
#include <ittnotify.h>
// If this is set to 'true', it will disable all frame markers in this file and expect
// you to place them in the code you actually want to inspect
constexpr const bool EnableDetailedVtune = false;
#endif // OPENSPACE_HAS_VTUNE
#ifdef OPENSPACE_HAS_NVTOOLS
#include "nvToolsExt.h"
#endif // OPENSPACE_HAS_NVTOOLS
namespace {
constexpr const char* _loggerCat = "main";
@@ -76,6 +89,26 @@ sgct::SharedVector<char> _synchronizationBuffer;
sgct::SGCTWindow* FirstOpenVRWindow = nullptr;
#endif
#ifdef OPENSPACE_HAS_VTUNE
struct {
__itt_domain* init;
__itt_domain* preSync;
__itt_domain* postSyncPreDraw;
__itt_domain* render;
__itt_domain* draw2D;
__itt_domain* postDraw;
__itt_domain* keyboard;
__itt_domain* mouseButton;
__itt_domain* mousePos;
__itt_domain* mouseScroll;
__itt_domain* character;
__itt_domain* encode;
__itt_domain* decode;
} _vTune;
#endif // OPENSPACE_HAS_VTUNE
//
// SPOUT-support
//
@@ -219,17 +252,57 @@ std::pair<int, int> supportedOpenGLVersion() {
// Init function
//
void mainInitFunc() {
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_begin_v3(_vTune.init, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
LTRACE("main::mainInitFunc(begin)");
LDEBUG("Initializing OpenSpace Engine started");
openspace::global::openSpaceEngine.initialize();
LDEBUG("Initializing OpenSpace Engine finished");
{
std::string path = absPath("${DATA}/openspace-icon.png");
int x;
int y;
int n;
unsigned char* data = stbi_load(path.c_str(), &x, &y, &n, 0);
GLFWimage icons[1];
icons[0].pixels = data;
icons[0].width = x;
icons[0].height = y;
const size_t nWindows = SgctEngine->getNumberOfWindows();
for (size_t i = 0; i < nWindows; ++i) {
const sgct::SGCTWindow* windowPtr = SgctEngine->getWindowPtr(i);
glfwSetWindowIcon(windowPtr->getWindowHandle(), 1, icons);
}
stbi_image_free(icons[0].pixels);
}
LDEBUG("Initializing OpenGL in OpenSpace Engine started");
openspace::global::openSpaceEngine.initializeGL();
LDEBUG("Initializing OpenGL in OpenSpace Engine finished");
{
//using namespace ghoul::opengl;
//std::unique_ptr<ghoul::opengl::Texture> t = ghoul::io::TextureReader::ref().loadTexture(absPath("${DATA}/openspace-icon.png"));
//GLFWimage icons[1];
//icons[0].pixels =
}
// Find if we have at least one OpenVR window
// Save reference to first OpenVR window, which is the one we will copy to the HMD.
for (size_t i = 0; i < SgctEngine->getNumberOfWindows(); ++i) {
@@ -318,7 +391,6 @@ void mainInitFunc() {
);
}
for (size_t i = 0; i < nWindows; ++i) {
sgct::SGCTWindow* w = SgctEngine->getWindowPtr(i);
constexpr const char* screenshotNames = "OpenSpace";
@@ -335,12 +407,23 @@ void mainInitFunc() {
}
LTRACE("main::mainInitFunc(end)");
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_end_v3(_vTune.init, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
}
void mainPreSyncFunc() {
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_begin_v3(_vTune.preSync, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
LTRACE("main::mainPreSyncFunc(begin)");
openspace::global::openSpaceEngine.preSynchronization();
// Query joystick status
@@ -420,12 +503,26 @@ void mainPreSyncFunc() {
}
LTRACE("main::mainPreSyncFunc(end)");
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_end_v3(_vTune.preSync, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
}
void mainPostSyncPreDrawFunc() {
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_begin_v3(_vTune.postSyncPreDraw, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
#ifdef OPENSPACE_HAS_NVTOOLS
nvtxRangePush("postSyncPreDraw");
#endif // OPENSPACE_HAS_NVTOOLS
LTRACE("main::postSynchronizationPreDraw(begin)");
openspace::global::openSpaceEngine.postSynchronizationPreDraw();
#ifdef OPENVR_SUPPORT
@@ -436,11 +533,28 @@ void mainPostSyncPreDrawFunc() {
#endif // OPENVR_SUPPORT
LTRACE("main::postSynchronizationPreDraw(end)");
#ifdef OPENSPACE_HAS_NVTOOLS
nvtxRangePop();
#endif // OPENSPACE_HAS_NVTOOLS
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_end_v3(_vTune.postSyncPreDraw, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
}
void mainRenderFunc() {
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_begin_v3(_vTune.render, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
#ifdef OPENSPACE_HAS_NVTOOLS
nvtxRangePush("render");
#endif // OPENSPACE_HAS_NVTOOLS
LTRACE("main::mainRenderFunc(begin)");
glm::mat4 viewMatrix = SgctEngine->getCurrentViewMatrix() *
@@ -466,12 +580,26 @@ void mainRenderFunc() {
catch (const ghoul::RuntimeError& e) {
LERRORC(e.component, e.message);
}
LTRACE("main::mainRenderFunc(end)");
#ifdef OPENSPACE_HAS_NVTOOLS
nvtxRangePop();
#endif // OPENSPACE_HAS_NVTOOLS
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_end_v3(_vTune.render, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
}
void mainDraw2DFunc() {
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_begin_v3(_vTune.draw2D, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
LTRACE("main::mainDraw2DFunc(begin)");
try {
@@ -487,11 +615,21 @@ void mainDraw2DFunc() {
glDisable(GL_DEPTH_TEST);
LTRACE("main::mainDraw2DFunc(end)");
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_end_v3(_vTune.draw2D, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
}
void mainPostDrawFunc() {
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_begin_v3(_vTune.postDraw, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
LTRACE("main::mainPostDrawFunc(begin)");
#ifdef OPENVR_SUPPORT
@@ -532,73 +670,162 @@ void mainPostDrawFunc() {
#endif // OPENSPACE_HAS_SPOUT
LTRACE("main::mainPostDrawFunc(end)");
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_end_v3(_vTune.postDraw, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
}
void mainKeyboardCallback(int key, int, int action, int mods) {
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_begin_v3(_vTune.keyboard, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
LTRACE("main::mainKeyboardCallback(begin)");
openspace::global::openSpaceEngine.keyboardCallback(
openspace::Key(key),
openspace::KeyModifier(mods),
openspace::KeyAction(action)
);
LTRACE("main::mainKeyboardCallback(begin)");
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_end_v3(_vTune.keyboard, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
}
void mainMouseButtonCallback(int key, int action, int modifiers) {
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_begin_v3(_vTune.mouseButton, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
LTRACE("main::mainMouseButtonCallback(begin)");
openspace::global::openSpaceEngine.mouseButtonCallback(
openspace::MouseButton(key),
openspace::MouseAction(action),
openspace::KeyModifier(modifiers)
);
LTRACE("main::mainMouseButtonCallback(end)");
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_end_v3(_vTune.mouseButton, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
}
void mainMousePosCallback(double x, double y) {
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_begin_v3(_vTune.mousePos, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
openspace::global::openSpaceEngine.mousePositionCallback(x, y);
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_end_v3(_vTune.mousePos, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
}
void mainMouseScrollCallback(double posX, double posY) {
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_begin_v3(_vTune.mouseScroll, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
LTRACE("main::mainMouseScrollCallback(begin");
openspace::global::openSpaceEngine.mouseScrollWheelCallback(posX, posY);
LTRACE("main::mainMouseScrollCallback(end)");
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_end_v3(_vTune.mouseScroll, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
}
void mainCharCallback(unsigned int codepoint, int mods) {
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_begin_v3(_vTune.character, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
openspace::global::openSpaceEngine.charCallback(
codepoint,
openspace::KeyModifier(mods)
);
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_end_v3(_vTune.character, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
}
void mainEncodeFun() {
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_begin_v3(_vTune.encode, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
LTRACE("main::mainEncodeFun(begin)");
std::vector<char> data = openspace::global::openSpaceEngine.encode();
_synchronizationBuffer.setVal(std::move(data));
sgct::SharedData::instance()->writeVector(&_synchronizationBuffer);
LTRACE("main::mainEncodeFun(end)");
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_end_v3(_vTune.encode, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
}
void mainDecodeFun() {
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_begin_v3(_vTune.decode, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
LTRACE("main::mainDecodeFun(begin)");
sgct::SharedData::instance()->readVector(&_synchronizationBuffer);
std::vector<char> data = _synchronizationBuffer.getVal();
openspace::global::openSpaceEngine.decode(std::move(data));
LTRACE("main::mainDecodeFun(end)");
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_end_v3(_vTune.decode, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
}
@@ -816,6 +1043,15 @@ void setSgctDelegateFunctions() {
sgctDelegate.openGLProcedureAddress = [](const char* func) {
return glfwGetProcAddress(func);
};
sgctDelegate.getHorizFieldOfView = []() {
return static_cast<double>(
sgct::Engine::instance()->getWindowPtr(0)->getHorizFieldOfViewDegrees()
);
};
sgctDelegate.setHorizFieldOfView = [](float hFovDeg) {
sgct::SGCTWindow* w = sgct::Engine::instance()->getWindowPtr(0);
w->setHorizFieldOfView(hFovDeg);
};
}
int main(int argc, char** argv) {
@@ -823,6 +1059,25 @@ int main(int argc, char** argv) {
SetUnhandledExceptionFilter(generateMiniDump);
#endif // WIN32
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
_vTune.init = __itt_domain_create("init");
_vTune.preSync = __itt_domain_create("preSync");
_vTune.postSyncPreDraw = __itt_domain_create("postSyncPreDraw");
_vTune.render = __itt_domain_create("render");
_vTune.draw2D = __itt_domain_create("draw2D");
_vTune.postDraw = __itt_domain_create("postDraw");
_vTune.keyboard = __itt_domain_create("keyboard");
_vTune.mouseButton = __itt_domain_create("mouseButton");
_vTune.mousePos = __itt_domain_create("mousePos");
_vTune.mouseScroll = __itt_domain_create("mouseScroll");
_vTune.character = __itt_domain_create("character");
_vTune.encode = __itt_domain_create("encode");
_vTune.decode = __itt_domain_create("decode");
}
#endif // OPENSPACE_HAS_VTUNE
// Initialize the LogManager and add the console log as this will be used every time
// and we need a fall back if something goes wrong between here and when we add the
// logs from the configuration file. If the user requested as specific loglevel in the

View File

@@ -44,7 +44,7 @@ target_link_libraries(Sync openspace-core)
# target as of July 2017, which is needed.
if (OPENSPACE_MODULE_WEBBROWSER AND CEF_ROOT)
# wanted by CEF
set(CMAKE_BUILD_TYPE Debug CACHE INTERNAL "CMAKE_BUILD_TYPE")
set(CMAKE_BUILD_TYPE Debug CACHE STRING "CMAKE_BUILD_TYPE")
if (WIN32)
set(RESOURCE_FILE ${OPENSPACE_APPS_DIR}/OpenSpace/openspace.rc)

View File

@@ -44,7 +44,7 @@ target_link_libraries(TaskRunner openspace-core)
# target as of July 2017, which is needed.
if (OPENSPACE_MODULE_WEBBROWSER AND CEF_ROOT)
# wanted by CEF
set(CMAKE_BUILD_TYPE Debug CACHE INTERNAL "CMAKE_BUILD_TYPE")
set(CMAKE_BUILD_TYPE Debug CACHE STRING "CMAKE_BUILD_TYPE")
if (WIN32)
set(RESOURCE_FILE ${OPENSPACE_APPS_DIR}/OpenSpace/openspace.rc)

View File

@@ -45,7 +45,7 @@ target_link_libraries(Wormhole openspace-core)
# target as of July 2017, which is needed.
if (OPENSPACE_MODULE_WEBBROWSER AND CEF_ROOT)
# wanted by CEF
set(CMAKE_BUILD_TYPE Debug CACHE INTERNAL "CMAKE_BUILD_TYPE")
set(CMAKE_BUILD_TYPE Debug CACHE STRING "CMAKE_BUILD_TYPE")
set(PROJECT_ARCH "x86_64")
if (WIN32)

View File

@@ -28,16 +28,6 @@ asset.onInitialize(function ()
"Dawn", "Ceres", "Vesta"
})
openspace.addVirtualProperty(
"BoolProperty",
"Show Trails",
"*Trail.Renderable.Enabled",
"Disable or enable all trails of the scene at the same time",
true,
nil,
nil
)
openspace.navigation.setCameraState({
Anchor = DawnAsset.Dawn.Identifier,
Position = { 526781518487.171326, 257168309890.072144, -1381125204152.817383 },
@@ -46,7 +36,6 @@ asset.onInitialize(function ()
end)
asset.onDeinitialize(function ()
openspace.removeVirtualProperty("*Trail.Renderable.Enabled")
openspace.removeInterestingNodes({
"Dawn", "Ceres", "Vesta"
})

View File

@@ -10,6 +10,7 @@ asset.require('scene/solarsystem/planets/mars/moons/phobos')
asset.require('scene/solarsystem/planets/mars/moons/deimos')
asset.require('scene/solarsystem/dwarf_planets/pluto/system')
assetHelper.requestAll(asset, 'scene/digitaluniverse')
-- Load default key bindings applicable to most scenes
asset.require('util/default_keybindings')
asset.require('util/default_dashboard')
@@ -47,9 +48,9 @@ local Keybindings = {
},
{
Key = "h",
Name="Hide Trails",
Command = "openspace.setPropertyValue('Scene.*Trail.Renderable.Enabled', false)",
Documentation = "Disables visibility of the trails",
Name="Toggle Trails",
Command = "local list = openspace.getProperty('*Trail.Renderable.Enabled'); for _,v in pairs(list) do openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v)) end",
Documentation = "Toggles the visibility of all trails",
GuiPath = "/Rendering",
Local = false
},
@@ -74,16 +75,6 @@ asset.onInitialize(function ()
openspace.absPath("${DATA}/globebrowsing_servers.lua")
)
openspace.addVirtualProperty(
"BoolProperty",
"Show Trails",
"Scene.*Trail.Renderable.Enabled",
"Disable or enable all trails of the scene at the same time",
true,
nil,
nil
)
openspace.navigation.setCameraState({
Anchor = earthAsset.Earth.Identifier,
Position = { 0, 0, 0 },
@@ -95,6 +86,4 @@ end)
asset.onDeinitialize(function ()
sceneHelper.unbindKeys(Keybindings)
openspace.removeVirtualProperty("*Trail.Renderable.Enabled")
end)

View File

@@ -32,16 +32,6 @@ asset.onInitialize(function ()
28800, 57600, 115200, 230400, 460800, 921600, 1843200, 3686400, 7372800, 14745600
})
openspace.addVirtualProperty(
"BoolProperty",
"Show Trails",
"*Trail.Renderable.Enabled",
"Disable or enable all trails of the scene at the same time",
true,
nil,
nil
)
openspace.navigation.setCameraState({
Anchor = junoAsset.Juno.Identifier,
Position = { 1837386367.601345, -389860693812.834839, 714830404470.398926 },
@@ -50,5 +40,4 @@ asset.onInitialize(function ()
end)
asset.onDeinitialize(function ()
openspace.removeVirtualProperty("*Trail.Renderable.Enabled")
end)

View File

@@ -52,16 +52,6 @@ asset.onInitialize(function ()
28800, 57600, 115200, 230400, 460800, 921600, 1843200, 3686400, 7372800, 14745600
})
openspace.addVirtualProperty(
"BoolProperty",
"Show Trails",
"Scene.*Trail.Renderable.Enabled",
"Disable or enable all trails of the scene at the same time",
true,
nil,
nil
)
openspace.navigation.setCameraState({
Anchor = "Mercury",
Position = { 526781518487.171326, 257168309890.072144, -1381125204152.817383 },

View File

@@ -161,7 +161,16 @@ openspace.setPropertyValueSingle("Dashboard.NewHorizonsInstruments.Enabled", not
Name = "Toggle NH Trail",
GuiPath = "/New Horizons",
Local = false
}
},
{
Key = "h",
Name="Hide Trails",
Command = "local list = openspace.getProperty('*Trail.Renderable.Enabled'); for _,v in pairs(list) do openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v)) end",
Documentation = "Disables visibility of the trails",
GuiPath = "/Rendering",
Local = false
},
}
@@ -208,16 +217,6 @@ asset.onInitialize(function ()
openspace.setPropertyValueSingle('Scene.Charon.Renderable.Enabled', false)
openspace.setPropertyValueSingle("Scene.PlutoBarycenterTrail.Renderable.Enabled", false)
openspace.addVirtualProperty(
"BoolProperty",
"Show Trails",
"*Trail.Renderable.Enabled",
"Disable or enable all trails of the scene at the same time",
true,
nil,
nil
)
openspace.navigation.setCameraState({
Anchor = NewHorizonsAsset.NewHorizons.Identifier,
Position = { 4662120063743.592773, 1263245003503.724854, -955413856565.788086 },
@@ -230,6 +229,4 @@ asset.onDeinitialize(function ()
openspace.setPropertyValueSingle('Scene.Pluto.Renderable.Enabled', true)
openspace.setPropertyValueSingle('Scene.Charon.Renderable.Enabled', true)
openspace.setPropertyValueSingle('Scene.PlutoBarycenterTrail.Renderable.Enabled', true)
openspace.removeVirtualProperty("*Trail.Renderable.Enabled")
end)

View File

@@ -78,7 +78,16 @@ local Keybindings = {
Command = propertyHelper.invert('Scene.EarthMarker.Renderable.Enabled'),
Documentation = "Toggles the visibility of the text marking the location of the Earth.",
Local = false
}
},
{
Key = "h",
Name="Hide Trails",
Command = "local list = openspace.getProperty('*Trail.Renderable.Enabled'); for _,v in pairs(list) do openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v)) end",
Documentation = "Disables visibility of the trails",
GuiPath = "/Rendering",
Local = false
},
}
local OsirisRexAsset = asset.require('scene/solarsystem/missions/osirisrex/model')
@@ -122,16 +131,6 @@ asset.onInitialize(function ()
"OsirisRex", "BennuBarycenter", "Earth"
})
openspace.addVirtualProperty(
"BoolProperty",
"Show Trails",
"*Trail.Renderable.Enabled",
"Disable or enable all trails of the scene at the same time",
true,
nil,
nil
)
openspace.navigation.setCameraState({
Anchor = OsirisRexAsset.OsirisRex.Identifier,
Position = { 26974590199.661884, 76314608558.908020, -127086452897.101791 },
@@ -142,7 +141,6 @@ end)
asset.onDeinitialize(function ()
sceneHelper.unbindKeys(Keybindings)
openspace.removeVirtualProperty("*Trail.Renderable.Enabled")
openspace.removeInterestingNodes({
"OsirisRex", "BennuBarycenter", "Earth"
})

View File

@@ -83,7 +83,16 @@ local Keybindings = {
Command = propertyHelper.invert('Scene.67P.Renderable.ProjectionComponent.performProjection'),
Documentation = "Enables or disables the image projection on 67P.",
Local = false
}
},
{
Key = "h",
Name="Hide Trails",
Command = "local list = openspace.getProperty('*Trail.Renderable.Enabled'); for _,v in pairs(list) do openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v)) end",
Documentation = "Disables visibility of the trails",
GuiPath = "/Rendering",
Local = false
},
}
local Comet67PAsset = asset.require('scene/solarsystem/missions/rosetta/67p')
@@ -126,16 +135,6 @@ asset.onInitialize(function ()
28800, 57600, 115200, 230400, 460800, 921600, 1843200, 3686400, 7372800, 14745600
})
openspace.addVirtualProperty(
"BoolProperty",
"Show Trails",
"*Trail.Renderable.Enabled",
"Disable or enable all trails of the scene at the same time",
true,
nil,
nil
)
openspace.navigation.setCameraState({
Anchor = Comet67PAsset.Comet67P.Identifier,
Position = { 526781518487.171326, 257168309890.072144, -1381125204152.817383 },
@@ -147,6 +146,4 @@ end)
asset.onDeinitialize(function ()
sceneHelper.unbindKeys(Keybindings)
openspace.removeVirtualProperty("*Trail.Renderable.Enabled")
end)

View File

@@ -35,7 +35,8 @@ local object = {
Unit = "pc"
},
GUI = {
Path = "/Milky Way/Brown Dwarfs"
Name = "Brown Dwarfs",
Path = "/Milky Way"
}
}

View File

@@ -36,7 +36,7 @@ local object = {
},
GUI = {
Name = "Globular Clusters",
Path = "/Milky Way/Globular Clusters"
Path = "/Milky Way"
}
}

View File

@@ -7,7 +7,7 @@ local speck = asset.syncedResource({
Name = "Grids Speck Files",
Type = "HttpSynchronization",
Identifier = "digitaluniverse_grids_speck",
Version = 1
Version = 2
})
local radio = {
@@ -37,6 +37,31 @@ local radio = {
}
}
local oort = {
Identifier = "OortSphere",
Parent = transforms.SolarSystemBarycenter.Name,
Transform = {
Scale = {
Type = "StaticScale",
Scale = 7.47989845E15;
}
},
Renderable = {
Type = "RenderableSphericalGrid",
Enabled = false,
GridColor = { 0.8, 0.4, 0.4, 0.25},
LineWidth = 2.0,
GridMatrix = { -0.05487554, 0.4941095, -0.8676661 , 0.0,
-0.9938214 , -0.1109906, -0.0003515167, 0.0,
-0.09647644, 0.8622859, 0.4971472 , 0.0,
0.0 , 0.0 , 0.0 , 1.0 }
},
GUI = {
Name = "Oort Sphere",
Path = "/Other/Grids"
}
}
local ecliptic = {
Identifier = "EclipticSphere",
Parent = transforms.SolarSystemBarycenter.Name,
@@ -186,6 +211,244 @@ local galacticLabels = {
}
}
local plane1ld = {
Identifier = "1ldGrid",
Parent = transforms.SolarSystemBarycenter.Name,
Transform = {
Rotation = {
Type = "StaticRotation",
Rotation = {
-0.05487554, 0.4941095, -0.8676661,
-0.9938214 , -0.1109906, -0.0003515167,
-0.09647644, 0.8622859, 0.4971472
}
}
},
Renderable = {
Type = "RenderableDUMeshes",
Enabled = false,
Color = { 1.0, 1.0, 1.0 },
Transparency = 0.4,
ScaleFactor = 1.0,
File = speck .. "/1ld.speck",
MeshColor = {{ 0.1, 0.5, 0.6 }},
LabelFile = speck .. "/1ld.label",
TextColor = { 0.0, 0.2, 0.5, 1.0 },
TextSize = 10.3,
TextMinSize = 0.5,
TextMaxSize = 30.0,
Unit = "Km"
},
GUI = {
Name = "1ld Grid",
Path = "/Other/Grids"
}
}
local plane1lm = {
Identifier = "1lmGrid",
Parent = transforms.SolarSystemBarycenter.Name,
Transform = {
Rotation = {
Type = "StaticRotation",
Rotation = {
-0.05487554, 0.4941095, -0.8676661,
-0.9938214 , -0.1109906, -0.0003515167,
-0.09647644, 0.8622859, 0.4971472
}
}
},
Renderable = {
Type = "RenderableDUMeshes",
Enabled = false,
Color = { 1.0, 1.0, 1.0 },
Transparency = 0.4,
ScaleFactor = 1.0,
File = speck .. "/1lm.speck",
MeshColor = {{ 0.1, 0.5, 0.6 }},
LabelFile = speck .. "/1lm.label",
TextColor = { 0.0, 0.2, 0.5, 1.0 },
TextSize = 11.8,
TextMinSize = 0.5,
TextMaxSize = 30.0,
Unit = "pc"
},
GUI = {
Name = "1lm Grid",
Path = "/Other/Grids"
}
}
local plane1ly = {
Identifier = "1lyGrid",
Parent = transforms.SolarSystemBarycenter.Name,
Transform = {
Rotation = {
Type = "StaticRotation",
Rotation = {
-0.05487554, 0.4941095, -0.8676661,
-0.9938214 , -0.1109906, -0.0003515167,
-0.09647644, 0.8622859, 0.4971472
}
}
},
Renderable = {
Type = "RenderableDUMeshes",
Enabled = false,
Color = { 1.0, 1.0, 1.0 },
Transparency = 0.4,
ScaleFactor = 1.0,
File = speck .. "/1ly.speck",
MeshColor = {{ 0.1, 0.5, 0.6 }},
LabelFile = speck .. "/1ly.label",
TextColor = { 0.0, 0.2, 0.5, 1.0 },
TextSize = 13.0,
TextMinSize = 0.5,
TextMaxSize = 30.0,
Unit = "pc"
},
GUI = {
Name = "1ly Grid",
Path = "/Other/Grids"
}
}
local plane10ly = {
Identifier = "10lyGrid",
Parent = transforms.SolarSystemBarycenter.Name,
Transform = {
Rotation = {
Type = "StaticRotation",
Rotation = {
-0.05487554, 0.4941095, -0.8676661,
-0.9938214 , -0.1109906, -0.0003515167,
-0.09647644, 0.8622859, 0.4971472
}
}
},
Renderable = {
Type = "RenderableDUMeshes",
Enabled = false,
Color = { 1.0, 1.0, 1.0 },
Transparency = 0.4,
ScaleFactor = 1.0,
File = speck .. "/10ly.speck",
MeshColor = {{ 0.1, 0.5, 0.6 }},
LabelFile = speck .. "/10ly.label",
TextColor = { 0.0, 0.2, 0.5, 1.0 },
TextSize = 14.17,
TextMinSize = 0.5,
TextMaxSize = 30.0,
Unit = "pc"
},
GUI = {
Name = "10ly Grid",
Path = "/Other/Grids"
}
}
local plane100ly = {
Identifier = "100lyGrid",
Parent = transforms.SolarSystemBarycenter.Name,
Transform = {
Rotation = {
Type = "StaticRotation",
Rotation = {
-0.05487554, 0.4941095, -0.8676661,
-0.9938214 , -0.1109906, -0.0003515167,
-0.09647644, 0.8622859, 0.4971472
}
}
},
Renderable = {
Type = "RenderableDUMeshes",
Enabled = false,
Color = { 1.0, 1.0, 1.0 },
Transparency = 0.4,
ScaleFactor = 1.0,
File = speck .. "/100ly.speck",
MeshColor = {{ 0.1, 0.5, 0.6 }},
LabelFile = speck .. "/100ly.label",
TextColor = { 0.0, 0.2, 0.5, 1.0 },
TextSize = 15.0,
TextMinSize = 0.5,
TextMaxSize = 30.0,
Unit = "pc"
},
GUI = {
Name = "100ly Grid",
Path = "/Other/Grids"
}
}
local plane1kly = {
Identifier = "1klyGrid",
Parent = transforms.SolarSystemBarycenter.Name,
Transform = {
Rotation = {
Type = "StaticRotation",
Rotation = {
-0.05487554, 0.4941095, -0.8676661,
-0.9938214 , -0.1109906, -0.0003515167,
-0.09647644, 0.8622859, 0.4971472
}
}
},
Renderable = {
Type = "RenderableDUMeshes",
Enabled = false,
Color = { 1.0, 1.0, 1.0 },
Transparency = 0.4,
ScaleFactor = 1.0,
File = speck .. "/1kly.speck",
MeshColor = {{ 0.1, 0.5, 0.6 }},
LabelFile = speck .. "/1kly.label",
TextColor = { 0.0, 0.2, 0.5, 1.0 },
TextSize = 16.0,
TextMinSize = 0.5,
TextMaxSize = 30.0,
Unit = "pc"
},
GUI = {
Name = "1kly Grid",
Path = "/Other/Grids"
}
}
local plane10kly = {
Identifier = "10klyGrid",
Parent = transforms.SolarSystemBarycenter.Name,
Transform = {
Rotation = {
Type = "StaticRotation",
Rotation = {
-0.05487554, 0.4941095, -0.8676661,
-0.9938214 , -0.1109906, -0.0003515167,
-0.09647644, 0.8622859, 0.4971472
}
}
},
Renderable = {
Type = "RenderableDUMeshes",
Enabled = false,
Color = { 1.0, 1.0, 1.0 },
Transparency = 0.4,
ScaleFactor = 1.0,
File = speck .. "/10kly.speck",
MeshColor = {{ 0.1, 0.5, 0.6 }},
LabelFile = speck .. "/10kly.label",
TextColor = { 0.0, 0.2, 0.5, 1.0 },
TextSize = 17.25,
TextMinSize = 0.5,
TextMaxSize = 30.0,
Unit = "pc"
},
GUI = {
Name = "10kly Grid",
Path = "/Other/Grids"
}
}
local plane100kly = {
Identifier = "100klyGrid",
Renderable = {
@@ -302,6 +565,7 @@ local plane20Gly = {
}
assetHelper.registerSceneGraphNodesAndExport(asset, {
radio, ecliptic, eclipticLabels, equatorial, equatorialLabels, galactic,
galacticLabels, plane100kly, plane1Mly, plane10Mly, plane100Mly, plane20Gly
radio, oort, ecliptic, eclipticLabels, equatorial, equatorialLabels, galactic,
galacticLabels, plane1ld, plane1lm, plane1ly, plane10ly, plane100ly, plane1kly,
plane10kly, plane100kly, plane1Mly, plane10Mly, plane100Mly, plane20Gly
})

View File

@@ -36,7 +36,7 @@ local object = {
},
GUI = {
Name = "HII Regions",
Path = "/Milky Way/HII"
Path = "/Milky Way"
}
}

View File

@@ -43,8 +43,8 @@ local sphere = {
FadeOutThreshold = 0.025
},
GUI = {
Name = "Milky Way",
Path = "/Milky Way/Milky Way"
Name = "Milky Way Sphere",
Path = "/Milky Way"
}
}

View File

@@ -36,7 +36,7 @@ local object = {
},
GUI = {
Name = "OB Associations",
Path = "/Milky Way/OB Associations"
Path = "/Milky Way"
}
}

View File

@@ -36,7 +36,7 @@ local object = {
},
GUI = {
Name = "Planetary Nebulae",
Path = "/Milky Way/Planetary Nebulae"
Path = "/Milky Way"
}
}

View File

@@ -35,7 +35,7 @@ local object = {
Unit = "pc"
},
GUI = {
Path = "/Milky Way/Pulsars"
Path = "/Milky Way"
}
}

View File

@@ -33,7 +33,7 @@ local object = {
BillboardMinSize = 0.0,
},
GUI = {
Path = "/Universe/Quasars"
Path = "/Universe"
}
}

View File

@@ -29,7 +29,11 @@ local stars = {
Type = "RenderableStars",
File = speck .. "/stars.speck",
Texture = textures .. "/halo.png",
ColorMap = colorLUT .. "/colorbv.cmap"
--ShapeTexture = textures .. "/disc.png",
ColorMap = colorLUT .. "/colorbv.cmap",
MagnitudeExponent = 6.2,
SizeComposition = "Distance Modulus",
RenderMethod = "Texture Based" -- or PSF
},
GUI = {
Path = "/Milky Way/Stars"

View File

@@ -38,7 +38,7 @@ local object = {
},
GUI = {
Name = "Supernova Remnants",
Path = "/Milky Way/Supernova Remnants"
Path = "/Milky Way"
}
}

View File

@@ -13,7 +13,7 @@ local speck = asset.syncedResource({
Name = "Tully Speck Files",
Type = "HttpSynchronization",
Identifier = "digitaluniverse_tully_speck",
Version = 1
Version = 2
})
local tullyPoints = {

View File

@@ -31,8 +31,11 @@ local gaia_abundance_apogee = {
File = speck .. "/GaiaAbundApogee.speck",
ColorOption = "Other Data",
OtherData = "FeH",
ScaleFactor = 100,
MagnitudeExponent = 6.2,
SizeComposition = "Distance Modulus",
RenderMethod = "Texture Based",
Texture = textures .. "/halo.png",
-- ShapeTexture = textures .. "/disc.png",
ColorMap = colorLUT .. "/colorbv.cmap",
OtherDataColorMap = colorLUT .. "/viridis.cmap",
StaticFilter = -9999,

View File

@@ -30,9 +30,12 @@ local gaia_abundance_galah = {
Enabled = false,
File = speck .. "/GaiaAbundGalah.speck",
Texture = textures .. "/halo.png",
-- ShapeTexture = textures .. "/disc.png",
MagnitudeExponent = 6.2,
SizeComposition = "Distance Modulus",
RenderMethod = "Texture Based",
ColorOption = "Other Data",
OtherData = "FeH",
ScaleFactor = 100,
ColorMap = colorLUT .. "/colorbv.cmap",
OtherDataColorMap = colorLUT .. "/viridis.cmap",
StaticFilter = -9999,

View File

@@ -29,7 +29,10 @@ local object = {
Type = "RenderableStars",
File = speck .. "/denver_stars.speck",
Texture = textures .. "/halo.png",
ColorMap = colorLUT .. "/denver_colorbv.cmap"
ColorMap = colorLUT .. "/denver_colorbv.cmap",
MagnitudeExponent = 6.2,
SizeComposition = "Distance Modulus",
RenderMethod = "Texture Based" -- or PSF
},
GUI = {
Name = "Stars (Denver)",

View File

@@ -18,7 +18,7 @@ local CharonTrailBarycentric = {
Resolution = 1000
},
GUI = {
Name = "Charon Barycenteric Trail",
Name = "Charon Barycentric Trail",
Path = "/Solar System/Dwarf Planets/Pluto"
}
}

View File

@@ -18,7 +18,7 @@ local PlutoTrailBarycentric = {
Resolution = 1000
},
GUI = {
Name = "Pluto Barycenteric Trail",
Name = "Pluto Barycentric Trail",
Path = "/Solar System/Dwarf Planets/Pluto"
}
}

View File

@@ -1,6 +1,8 @@
local transforms = asset.require('./transforms')
local assetHelper = asset.require('util/asset_helper')
local texturesPath = asset.require('./earth_textures').TexturesPath
local labelsPath = asset.require('./earth_labels').LabelsPath
asset.request('./trail')
@@ -266,7 +268,24 @@ local Earth = {
Radius = 1.737E6
}
--Caster2 = { Name = "Independency Day Ship", Radius = 0.0, }
}
},
Labels = {
Enable = false,
FileName = labelsPath .. "/Earth.labels",
LabelAlignmentOption = "Horizontally", -- or Circularly
LabelsFontSize = 41.0,
LabelsSize = 0.52,
LabelsMinSize = 1.0,
LabelsMaxSize = 1500.0,
ProximityEnabled = false,
LabelsFadeInEnabled = true,
LabelsFadeOutEnabled = false,
FadeInStartingDistance = 50000.0,
FadeOutStartingDistance = 80000.0,
LabelsForceDomeRendering = true,
LabelsDistanceEPS = 1500000.0,
LabelsColor = {1.0, 0.0, 0.0, 1.0}
}
},
Tag = { "planet_solarSystem", "planet_terrestrial" },
GUI = {

View File

@@ -0,0 +1,7 @@
local LabelsPath = asset.syncedResource({
Name = "Earth Labels",
Type = "HttpSynchronization",
Identifier = "earth_labels",
Version = 1
})
asset.export("LabelsPath", LabelsPath)

View File

@@ -1,5 +1,7 @@
local assetHelper = asset.require('util/asset_helper')
local transforms = asset.require('./transforms')
local labelsPath = asset.require('./mercury_labels').LabelsPath
asset.require("spice/base")
asset.request('./trail')
@@ -212,6 +214,21 @@ local Mercury = {
SegmentsPerPatch = 64,
Layers = {
ColorLayers = color_layers
},
Labels = {
Enable = false,
FileName = labelsPath .. "/Mercury.labels",
LabelAlignmentOption = "Horizontally", -- or Circularly
LabelsFontSize = 40.0,
LabelsSize = 10.0,
LabelsMinSize = 1.0,
LabelsMaxSize = 1500.0,
ProximityEnabled = false,
FadeInStartingDistance = 40000000.0,
FadeOutStartingDistance = 80000.0,
LabelsForceDomeRendering = true,
LabelsDistanceEPS = 1500000.0,
LabelsColor = {1.0, 1.0, 0.0, 1.0}
}
},
Tag = { "planet_solarSystem", "planet_terrestrial" },

View File

@@ -0,0 +1,7 @@
local LabelsPath = asset.syncedResource({
Name = "Mercury Labels",
Type = "HttpSynchronization",
Identifier = "mercury_labels",
Version = 1
})
asset.export("LabelsPath", LabelsPath)

View File

@@ -14,7 +14,8 @@ local SunGlare = {
Origin = "Center",
Billboard = true,
Texture = textures .. "/halo.png",
BlendMode = "Additive"
BlendMode = "Additive",
RenderableType = "Transparent"
},
Transform = {
Translation = {

View File

@@ -1,7 +1,7 @@
local guiCustomization = asset.require('customization/gui')
-- Select which commit hashes to use for the frontend and backend
local frontendHash = "6a34f2b0c6cfde64b890f12aa5bfaa42ac61a40f"
local frontendHash = "f6c17563e5fc3b3e16d18b50e8932f258b34a3bc"
local backendHash = "408142f26d3fa3d041399fcf58645874589d5b64"
local dataProvider = "data.openspaceproject.com/files/webgui"

View File

@@ -60,16 +60,6 @@ asset.onInitialize(function ()
"Earth", "Voyager 1", "Voyager 2", "Jupiter", "Saturn", "Uranus", "Neptune"
})
openspace.addVirtualProperty(
"BoolProperty",
"Show Trails",
"*Trail.Renderable.Enabled",
"Disable or enable all trails of the scene at the same time",
true,
nil,
nil
)
openspace.navigation.setCameraState({
Anchor = VoyagerAsset.Voyager_1.Identifier,
Position = { 526781518487.171326, 257168309890.072144, -1381125204152.817383 },
@@ -78,7 +68,6 @@ asset.onInitialize(function ()
end)
asset.onDeinitialize(function ()
openspace.removeVirtualProperty("*Trail.Renderable.Enabled")
openspace.removeInterestingNodes({
"Earth", "Voyager 1", "Voyager 2", "Jupiter", "Saturn", "Uranus", "Neptune"
})

BIN
data/openspace-icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

View File

@@ -113,6 +113,10 @@ struct WindowDelegate {
int (*currentWindowId)() = []() { return 0; };
double (*getHorizFieldOfView)() = []() { return 0.0; };
void (*setHorizFieldOfView)(float hFovDeg) = [](float) { };
using GLProcAddress = void(*)(void);
GLProcAddress (*openGLProcedureAddress)(const char*) =

View File

@@ -56,6 +56,8 @@ public:
glm::dvec2 localRollVelocity() const;
glm::dvec2 globalRollVelocity() const;
void resetVelocities();
protected:
struct InteractionState {
InteractionState(double scaleFactor);

View File

@@ -54,6 +54,7 @@ public:
void updateStatesFromInput(const InputState& inputState, double deltaTime);
void updateCameraStateFromStates(double deltaTime);
void resetVelocities();
Camera* camera() const;
void setCamera(Camera* camera);
@@ -66,6 +67,7 @@ public:
void startRetargetAim();
float retargetInterpolationTime() const;
void setRetargetInterpolationTime(float durationInSeconds);
void resetNodeMovements();
JoystickCameraStates& joystickStates();
@@ -148,7 +150,6 @@ private:
glm::dquat _previousAnchorNodeRotation;
glm::dvec3 _previousAimNodePosition;
glm::dquat _previousAimNodeRotation;
double _currentCameraToSurfaceDistance = 0.0;
bool _directlySetStereoDistance = false;

View File

@@ -43,10 +43,19 @@ class KeyframeNavigator;
class SessionRecording : public properties::PropertyOwner {
public:
enum class RecordedDataMode {
Ascii,
Ascii = 0,
Binary
};
enum class SessionState {
Idle = 0,
Recording,
Playback
};
using CallbackHandle = int;
using StateChangeCallback = std::function<void()>;
SessionRecording();
~SessionRecording();
/**
@@ -115,6 +124,12 @@ public:
*/
bool isPlayingBack() const;
/**
* Used to obtain the state of idle/recording/playback.
* \returns int value of state as defined by struct SessionState.
*/
SessionState state() const;
/**
* Used to trigger a save of the camera states (position, rotation, focus node,
* whether it is following the rotation of a node, and timestamp). The data will
@@ -141,12 +156,26 @@ public:
*/
static openspace::scripting::LuaLibrary luaLibrary();
/**
* Used to request a callback for notification of playback state change.
* \param cb function handle for callback.
* \returns CallbackHandle value of callback number.
*/
CallbackHandle addStateChangeCallback(StateChangeCallback cb);
/**
* Removes the callback for notification of playback state change.
* \param callback function handle for the callback.
*/
void removeStateChangeCallback(CallbackHandle handle);
/**
* Provides list of available playback files.
* \returns vector of filenames in recordings dir.
*/
std::vector<std::string> playbackList() const;
private:
enum class SessionState {
Idle = 0,
Recording,
Playback
};
enum class RecordedType {
Camera = 0,
Time,
@@ -175,20 +204,14 @@ private:
void playbackScript();
bool playbackAddEntriesToTimeline();
void signalPlaybackFinishedForComponent(RecordedType type);
void writeToFileBuffer(const double src);
void writeToFileBuffer(double src);
void writeToFileBuffer(std::vector<char>& cvec);
void writeToFileBuffer(const unsigned char c);
void writeToFileBuffer(unsigned char c);
void writeToFileBuffer(bool b);
void saveStringToFile(const std::string& s);
void saveKeyframeToFileBinary(unsigned char* bufferSource, size_t size);
void findFirstCameraKeyframeInTimeline();
std::string readHeaderElement(size_t readLen_chars);
void readFromPlayback(unsigned char& result);
void readFromPlayback(double& result);
void readFromPlayback(float& result);
void readFromPlayback(size_t& result);
void readFromPlayback(bool& result);
void readFromPlayback(std::string& result);
void saveKeyframeToFile(std::string entry);
void addKeyframe(double timestamp,
@@ -206,6 +229,7 @@ private:
bool isDataModeBinary();
unsigned int findIndexOfLastCameraKeyframeInTimeline();
bool doesTimelineEntryContainCamera(unsigned int index) const;
std::vector<std::pair<CallbackHandle, StateChangeCallback>> _stateChangeCallbacks;
RecordedType getNextKeyframeType();
RecordedType getPrevKeyframeType();
@@ -222,6 +246,7 @@ private:
RecordedDataMode _recordingDataMode = RecordedDataMode::Binary;
SessionState _state = SessionState::Idle;
SessionState _lastState = SessionState::Idle;
std::string _playbackFilename;
std::ifstream _playbackFile;
std::string _playbackLineParsing;
@@ -260,6 +285,8 @@ private:
unsigned int _idxTimeline_cameraFirstInTimeline = 0;
double _cameraFirstInTimeline_timestamp = 0;
int _nextCallbackHandle = 0;
};
} // namespace openspace

View File

@@ -91,7 +91,8 @@ public:
void update() override;
void performRaycasterTasks(const std::vector<RaycasterTask>& tasks);
void performDeferredTasks(const std::vector<DeferredcasterTask>& tasks);
void performDeferredTasks(const std::vector<DeferredcasterTask>& tasks,
float blackoutFactor);
void render(Scene* scene, Camera* camera, float blackoutFactor) override;
/**

View File

@@ -29,6 +29,7 @@
#include <openspace/properties/scalar/boolproperty.h>
#include <openspace/properties/scalar/floatproperty.h>
#include <openspace/properties/stringproperty.h>
namespace ghoul { class Dictionary; }
namespace ghoul::opengl {
@@ -91,6 +92,7 @@ public:
protected:
properties::BoolProperty _enabled;
properties::FloatProperty _opacity;
properties::StringProperty _renderableType;
void registerUpdateRenderBinFromOpacity();

View File

@@ -195,6 +195,7 @@ private:
properties::FloatProperty _hdrExposure;
properties::FloatProperty _hdrBackground;
properties::FloatProperty _gamma;
properties::FloatProperty _horizFieldOfView;
properties::Vec3Property _globalRotation;
properties::Vec3Property _screenSpaceRotation;

View File

@@ -92,6 +92,8 @@ uniform dmat4 dSgctProjectionToModelTransformMatrix;
uniform dvec4 dCamPosObj;
uniform dvec3 sunDirectionObj;
uniform float blackoutFactor;
/*******************************************************************************
***** ALL CALCULATIONS FOR ECLIPSE ARE IN METERS AND IN WORLD SPACE SYSTEM ****
*******************************************************************************/
@@ -693,7 +695,7 @@ void main() {
}
renderTarget = atmosphereFinalColor / float(nSamples);
renderTarget.a *= blackoutFactor;
// if (complex)
// renderTarget = vec4(1.0, 0.0, 0.0, 1.0);
}
@@ -704,7 +706,7 @@ void main() {
bColor += texelFetch(mainColorTexture, fragCoords, f);
}
bColor /= float(nAaSamples);
renderTarget = vec4(HDR(bColor.xyz * backgroundConstant, atmExposure), bColor.a);
renderTarget = vec4(HDR(bColor.xyz * backgroundConstant, atmExposure), bColor.a * blackoutFactor);
}
else {
discard;

View File

@@ -57,6 +57,13 @@ namespace {
"This value specifies an image that is loaded from disk and is used as a texture "
"that is applied to this plane. This image has to be square."
};
constexpr openspace::properties::Property::PropertyInfo RenderableTypeInfo = {
"RenderableType",
"RenderableType",
"This value specifies if the plane should be rendered in the Background,"
"Opaque, Transparent, or Overlay rendering step."
};
} // namespace
namespace openspace {
@@ -71,7 +78,13 @@ namespace openspace {
TextureInfo.identifier,
new StringVerifier,
Optional::No,
TextureInfo.description,
TextureInfo.description
},
{
RenderableTypeInfo.identifier,
new StringVerifier,
Optional::Yes,
RenderableTypeInfo.description
}
}
};
@@ -96,6 +109,25 @@ namespace openspace {
[this](const ghoul::filesystem::File&) { _textureIsDirty = true; }
);
if (dictionary.hasKey(RenderableTypeInfo.identifier)) {
std::string renderType = dictionary.value<std::string>(
RenderableTypeInfo.identifier
);
if (renderType == "Background") {
setRenderBin(Renderable::RenderBin::Background);
} else if (renderType == "Opaque") {
setRenderBin(Renderable::RenderBin::Opaque);
}
else if (renderType == "Transparent") {
setRenderBin(Renderable::RenderBin::Transparent);
}
else if (renderType == "Overlay") {
setRenderBin(Renderable::RenderBin::Overlay);
}
}
else {
setRenderBin(Renderable::RenderBin::Opaque);
}
}
bool RenderablePlaneImageLocal::isReady() const {
@@ -114,7 +146,7 @@ namespace openspace {
BaseModule::TextureManager.release(_texture);
RenderablePlane::deinitializeGL();
}
void RenderablePlaneImageLocal::bindTexture() {
//_texture->bind();
@@ -156,7 +188,7 @@ namespace openspace {
_texture->bind();
}
void RenderablePlaneImageLocal::update(const UpdateData& data) {
RenderablePlane::update(data);

View File

@@ -243,8 +243,6 @@ void RenderableTrail::initializeGL() {
);
ghoul::opengl::updateUniformLocations(*_programObject, _uniformCache, UniformNames);
setRenderBin(Renderable::RenderBin::Overlay);
}
void RenderableTrail::deinitializeGL() {

View File

@@ -97,6 +97,13 @@ namespace {
"smoother the trail, but also more memory will be used."
};
constexpr openspace::properties::Property::PropertyInfo RenderableTypeInfo = {
"RenderableType",
"RenderableType",
"This value specifies if the plane should be rendered in the Background,"
"Opaque, Transparent, or Overlay rendering step."
};
} // namespace
namespace openspace {
@@ -118,6 +125,12 @@ documentation::Documentation RenderableTrailOrbit::Documentation() {
new IntVerifier,
Optional::No,
ResolutionInfo.description
},
{
RenderableTypeInfo.identifier,
new StringVerifier,
Optional::Yes,
RenderableTypeInfo.description
}
}
};
@@ -160,6 +173,27 @@ RenderableTrailOrbit::RenderableTrailOrbit(const ghoul::Dictionary& dictionary)
// We store the vertices with (excluding the wrapping) decending temporal order
_primaryRenderInformation.sorting = RenderInformation::VertexSorting::NewestFirst;
if (dictionary.hasKey(RenderableTypeInfo.identifier)) {
std::string renderType = dictionary.value<std::string>(
RenderableTypeInfo.identifier
);
if (renderType == "Background") {
setRenderBin(Renderable::RenderBin::Background);
}
else if (renderType == "Opaque") {
setRenderBin(Renderable::RenderBin::Opaque);
}
else if (renderType == "Transparent") {
setRenderBin(Renderable::RenderBin::Transparent);
}
else if (renderType == "Overlay") {
setRenderBin(Renderable::RenderBin::Overlay);
}
}
else {
setRenderBin(Renderable::RenderBin::Opaque);
}
}
void RenderableTrailOrbit::initializeGL() {

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2018 *
* Copyright (c) 2014-2019 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2018 *
* Copyright (c) 2014-2019 *
* *
* 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 *

View File

@@ -78,6 +78,9 @@ namespace {
constexpr int8_t CurrentCacheVersion = 1;
constexpr double PARSEC = 0.308567756E17;
constexpr const int RenderOptionViewDirection = 0;
constexpr const int RenderOptionPositionNormal = 1;
constexpr openspace::properties::Property::PropertyInfo SpriteTextureInfo = {
"Texture",
"Point Sprite Texture",
@@ -390,11 +393,11 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di
, _spriteTexturePath(SpriteTextureInfo)
, _textColor(
TextColorInfo,
glm::vec4(1.0f, 1.0, 1.0f, 1.f),
glm::vec4(1.f, 1.f, 1.f, 1.f),
glm::vec4(0.f),
glm::vec4(1.f)
)
, _textSize(TextSizeInfo, 8.0, 0.5, 24.0)
, _textSize(TextSizeInfo, 8.f, 0.5f, 24.f)
, _textMinSize(LabelMinSizeInfo, 8.f, 0.5f, 24.f)
, _textMaxSize(LabelMaxSizeInfo, 20.f, 0.5f, 100.f)
, _drawElements(DrawElementsInfo, true)
@@ -403,15 +406,15 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di
, _colorOption(ColorOptionInfo, properties::OptionProperty::DisplayType::Dropdown)
, _fadeInDistance(
FadeInDistancesInfo,
glm::vec2(0.0f),
glm::vec2(0.0),
glm::vec2(100.0)
glm::vec2(0.f),
glm::vec2(0.f),
glm::vec2(100.f)
)
, _disableFadeInDistance(DisableFadeInInfo, true)
, _billboardMaxSize(BillboardMaxSizeInfo, 400.0, 0.0, 1000.0)
, _billboardMinSize(BillboardMinSizeInfo, 0.0, 0.0, 100.0)
, _correctionSizeEndDistance(CorrectionSizeEndDistanceInfo, 17.0, 12.0, 25.0)
, _correctionSizeFactor(CorrectionSizeFactorInfo, 8, 0.0, 20.0)
, _billboardMaxSize(BillboardMaxSizeInfo, 400.f, 0.f, 1000.f)
, _billboardMinSize(BillboardMinSizeInfo, 0.f, 0.f, 100.f)
, _correctionSizeEndDistance(CorrectionSizeEndDistanceInfo, 17.f, 12.f, 25.f)
, _correctionSizeFactor(CorrectionSizeFactorInfo, 8.f, 0.f, 20.f)
, _renderOption(RenderOptionInfo, properties::OptionProperty::DisplayType::Dropdown)
{
documentation::testSpecificationAndThrow(
@@ -427,18 +430,17 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di
addProperty(_drawElements);
}
_renderOption.addOption(0, "Camera View Direction");
_renderOption.addOption(1, "Camera Position Normal");
_renderOption.addOption(RenderOptionViewDirection, "Camera View Direction");
_renderOption.addOption(RenderOptionPositionNormal, "Camera Position Normal");
_renderOption.set(1);
_renderOption = RenderOptionPositionNormal;
if (dictionary.hasKeyAndValue<std::string>(RenderOptionInfo.identifier)) {
const std::string option =
dictionary.value<std::string>(RenderOptionInfo.identifier);
const std::string o = dictionary.value<std::string>(RenderOptionInfo.identifier);
if (option == "Camera View Direction") {
_renderOption.set(0);
} else if (option == "Camera Position Normal") {
_renderOption.set(1);
if (o == "Camera View Direction") {
_renderOption = RenderOptionViewDirection;
} else if (o == "Camera Position Normal") {
_renderOption = RenderOptionPositionNormal;
}
}
@@ -499,11 +501,11 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di
colorOptionDataDic.value<std::string>(std::to_string(i + 1))
);
_colorOption.addOption(i, colorMapInUseName);
_optionConversionMap.insert({i, colorMapInUseName});
_optionConversionMap.insert({ i, colorMapInUseName });
_colorOptionString = colorMapInUseName;
}
}
_colorOption.onChange([&] {
_colorOption.onChange([&]() {
_dataIsDirty = true;
_colorOptionString = _optionConversionMap[_colorOption.value()];
});
@@ -548,9 +550,7 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di
}
addProperty(_drawLabels);
_labelFile = absPath(dictionary.value<std::string>(
LabelFileInfo.identifier
));
_labelFile = absPath(dictionary.value<std::string>(LabelFileInfo.identifier));
_hasLabel = true;
if (dictionary.hasKey(TextColorInfo.identifier)) {
@@ -581,15 +581,13 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di
if (dictionary.hasKey(TransformationMatrixInfo.identifier)) {
_transformationMatrix = dictionary.value<glm::dmat4>(
TransformationMatrixInfo.identifier
);
);
}
if (dictionary.hasKey(FadeInDistancesInfo.identifier)) {
glm::vec2 fadeInValue = dictionary.value<glm::vec2>(
FadeInDistancesInfo.identifier
);
_fadeInDistance.set(fadeInValue);
_disableFadeInDistance.set(false);
glm::vec2 v = dictionary.value<glm::vec2>(FadeInDistancesInfo.identifier);
_fadeInDistance = v;
_disableFadeInDistance = false;
addProperty(_fadeInDistance);
addProperty(_disableFadeInDistance);
}
@@ -597,28 +595,28 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di
if (dictionary.hasKey(BillboardMaxSizeInfo.identifier)) {
_billboardMaxSize = static_cast<float>(
dictionary.value<double>(BillboardMaxSizeInfo.identifier)
);
);
}
addProperty(_billboardMaxSize);
if (dictionary.hasKey(BillboardMinSizeInfo.identifier)) {
_billboardMinSize = static_cast<float>(
dictionary.value<double>(BillboardMinSizeInfo.identifier)
);
);
}
addProperty(_billboardMinSize);
if (dictionary.hasKey(CorrectionSizeEndDistanceInfo.identifier)) {
_correctionSizeEndDistance = static_cast<float>(
dictionary.value<double>(CorrectionSizeEndDistanceInfo.identifier)
);
);
}
addProperty(_correctionSizeEndDistance);
if (dictionary.hasKey(CorrectionSizeFactorInfo.identifier)) {
_correctionSizeFactor = static_cast<float>(
dictionary.value<double>(CorrectionSizeFactorInfo.identifier)
);
);
}
addProperty(_correctionSizeFactor);
@@ -650,7 +648,7 @@ void RenderableBillboardsCloud::initialize() {
void RenderableBillboardsCloud::initializeGL() {
_program = DigitalUniverseModule::ProgramObjectManager.request(
ProgramObjectName,
[]() -> std::unique_ptr<ghoul::opengl::ProgramObject> {
[]() {
return global::renderEngine.buildRenderProgram(
ProgramObjectName,
absPath("${MODULE_DIGITALUNIVERSE}/shaders/billboard_vs.glsl"),
@@ -662,7 +660,7 @@ void RenderableBillboardsCloud::initializeGL() {
_renderToPolygonProgram = DigitalUniverseModule::ProgramObjectManager.request(
RenderToPolygonProgram,
[]() -> std::unique_ptr<ghoul::opengl::ProgramObject> {
[]() {
return ghoul::opengl::ProgramObject::Build(
RenderToPolygonProgram,
absPath("${MODULE_DIGITALUNIVERSE}/shaders/billboardpolygon_vs.glsl"),
@@ -765,8 +763,10 @@ void RenderableBillboardsCloud::renderBillboards(const RenderData& data,
);
_program->setUniform(_uniformCache.renderOption, _renderOption.value());
_program->setUniform(_uniformCache.modelMatrix, modelMatrix);
_program->setUniform(_uniformCache.cameraViewProjectionMatrix,
glm::dmat4(data.camera.projectionMatrix()) * data.camera.combinedViewMatrix());
_program->setUniform(
_uniformCache.cameraViewProjectionMatrix,
glm::dmat4(data.camera.projectionMatrix()) * data.camera.combinedViewMatrix()
);
_program->setUniform(_uniformCache.minBillboardSize, _billboardMinSize); // in pixels
_program->setUniform(_uniformCache.maxBillboardSize, _billboardMaxSize); // in pixels
_program->setUniform(_uniformCache.color, _pointColor);
@@ -792,15 +792,17 @@ void RenderableBillboardsCloud::renderBillboards(const RenderData& data,
textureUnit.activate();
if (_hasPolygon) {
glBindTexture(GL_TEXTURE_2D, _pTexture);
} else {
}
else {
_spriteTexture->bind();
}
_program->setUniform(_uniformCache.spriteTexture, textureUnit);
_program->setUniform(_uniformCache.hasColormap, _hasColorMapFile);
glBindVertexArray(_vao);
const GLsizei nAstronomicalObjects = static_cast<GLsizei>(_fullData.size() /
_nValuesPerAstronomicalObject);
const GLsizei nAstronomicalObjects = static_cast<GLsizei>(
_fullData.size() / _nValuesPerAstronomicalObject
);
glDrawArrays(GL_POINTS, 0, nAstronomicalObjects);
glBindVertexArray(0);
@@ -827,10 +829,10 @@ void RenderableBillboardsCloud::renderLabels(const RenderData& data,
float scale = 0.f;
switch (_unit) {
case Meter:
scale = 1.0;
scale = 1.f;
break;
case Kilometer:
scale = 1e3;
scale = 1e3f;
break;
case Parsec:
scale = static_cast<float>(PARSEC);
@@ -852,6 +854,20 @@ void RenderableBillboardsCloud::renderLabels(const RenderData& data,
glm::vec4 textColor = _textColor;
textColor.a *= fadeInVariable;
textColor.a *= _opacity;
ghoul::fontrendering::FontRenderer::ProjectedLabelsInformation labelInfo;
labelInfo.orthoRight = orthoRight;
labelInfo.orthoUp = orthoUp;
labelInfo.minSize = static_cast<int>(_textMinSize);
labelInfo.maxSize = static_cast<int>(_textMaxSize);
labelInfo.cameraPos = data.camera.positionVec3();
labelInfo.cameraLookUp = data.camera.lookUpVectorWorldSpace();
labelInfo.renderType = _renderOption;
labelInfo.mvpMatrix = modelViewProjectionMatrix;
labelInfo.scale = pow(10.f, _textSize);
labelInfo.enableDepth = true;
labelInfo.enableFalseDepth = false;
for (const std::pair<glm::vec3, std::string>& pair : _labelData) {
//glm::vec3 scaledPos(_transformationMatrix * glm::dvec4(pair.first, 1.0));
glm::vec3 scaledPos(pair.first);
@@ -861,28 +877,19 @@ void RenderableBillboardsCloud::renderLabels(const RenderData& data,
scaledPos,
pair.second,
textColor,
pow(10.f, _textSize.value()),
static_cast<int>(_textMinSize),
static_cast<int>(_textMaxSize),
modelViewProjectionMatrix,
orthoRight,
orthoUp,
data.camera.positionVec3(),
data.camera.lookUpVectorWorldSpace(),
_renderOption.value()
labelInfo
);
}
}
void RenderableBillboardsCloud::render(const RenderData& data, RendererTasks&) {
float scale = 0.f;
switch (_unit) {
case Meter:
scale = 1.0;
scale = 1.f;
break;
case Kilometer:
scale = 1e3;
scale = 1e3f;
break;
case Parsec:
scale = static_cast<float>(PARSEC);
@@ -938,9 +945,7 @@ void RenderableBillboardsCloud::render(const RenderData& data, RendererTasks&) {
);
orthoRight = glm::normalize(glm::cross(otherVector, cameraViewDirectionWorld));
}
glm::dvec3 orthoUp = glm::normalize(
glm::cross(cameraViewDirectionWorld, orthoRight)
);
glm::dvec3 orthoUp = glm::normalize(glm::cross(cameraViewDirectionWorld, orthoRight));
if (_hasSpeckFile) {
renderBillboards(
@@ -1045,10 +1050,7 @@ void RenderableBillboardsCloud::update(const UpdateData&) {
[path = _spriteTexturePath]() -> std::unique_ptr<ghoul::opengl::Texture> {
LINFO(fmt::format("Loaded texture from '{}'", absPath(path)));
std::unique_ptr<ghoul::opengl::Texture> t =
ghoul::io::TextureReader::ref().loadTexture(
absPath(path)
);
ghoul::io::TextureReader::ref().loadTexture(absPath(path));
t->uploadTexture();
t->setFilter(ghoul::opengl::Texture::FilterMode::AnisotropicMipMap);
return t;
@@ -1078,79 +1080,81 @@ bool RenderableBillboardsCloud::loadData() {
}
bool RenderableBillboardsCloud::loadSpeckData() {
if (!_hasSpeckFile) {
return true;
}
bool success = true;
if (_hasSpeckFile) {
const std::string& cachedFile = FileSys.cacheManager()->cachedFilename(
ghoul::filesystem::File(_speckFile),
"RenderableDUMeshes|" + identifier(),
ghoul::filesystem::CacheManager::Persistent::Yes
);
const std::string& cachedFile = FileSys.cacheManager()->cachedFilename(
ghoul::filesystem::File(_speckFile),
"RenderableDUMeshes|" + identifier(),
ghoul::filesystem::CacheManager::Persistent::Yes
);
const bool hasCachedFile = FileSys.fileExists(cachedFile);
if (hasCachedFile) {
LINFO(fmt::format(
"Cached file '{}' used for Speck file '{}'",
cachedFile, _speckFile
));
const bool hasCachedFile = FileSys.fileExists(cachedFile);
if (hasCachedFile) {
LINFO(fmt::format(
"Cached file '{}' used for Speck file '{}'",
cachedFile, _speckFile
));
success = loadCachedFile(cachedFile);
if (success) {
return true;
}
else {
FileSys.cacheManager()->removeCacheFile(_speckFile);
// Intentional fall-through to the 'else' to generate the cache
// file for the next run
}
success = loadCachedFile(cachedFile);
if (success) {
return true;
}
else {
LINFO(fmt::format("Cache for Speck file '{}' not found", _speckFile));
FileSys.cacheManager()->removeCacheFile(_speckFile);
// Intentional fall-through to the 'else' to generate the cache
// file for the next run
}
LINFO(fmt::format("Loading Speck file '{}'", _speckFile));
success = readSpeckFile();
if (!success) {
return false;
}
success &= saveCachedFile(cachedFile);
}
else {
LINFO(fmt::format("Cache for Speck file '{}' not found", _speckFile));
}
LINFO(fmt::format("Loading Speck file '{}'", _speckFile));
success = readSpeckFile();
if (!success) {
return false;
}
success &= saveCachedFile(cachedFile);
return success;
}
bool RenderableBillboardsCloud::loadLabelData() {
if (_labelFile.empty()) {
return true;
}
bool success = true;
if (!_labelFile.empty()) {
// I disabled the cache as it didn't work on Mac --- abock
const std::string& cachedFile = FileSys.cacheManager()->cachedFilename(
ghoul::filesystem::File(_labelFile),
ghoul::filesystem::CacheManager::Persistent::Yes
);
if (!_hasSpeckFile && !_hasColorMapFile) {
success = true;
}
const bool hasCachedFile = FileSys.fileExists(cachedFile);
if (hasCachedFile) {
LINFO(fmt::format(
"Cached file '{}' used for Label file '{}'",
cachedFile, _labelFile
));
// I disabled the cache as it didn't work on Mac --- abock
const std::string& cachedFile = FileSys.cacheManager()->cachedFilename(
ghoul::filesystem::File(_labelFile),
ghoul::filesystem::CacheManager::Persistent::Yes
);
if (!_hasSpeckFile && !_hasColorMapFile) {
success = true;
}
const bool hasCachedFile = FileSys.fileExists(cachedFile);
if (hasCachedFile) {
LINFO(fmt::format(
"Cached file '{}' used for Label file '{}'",
cachedFile, _labelFile
));
success &= loadCachedFile(cachedFile);
if (!success) {
FileSys.cacheManager()->removeCacheFile(_labelFile);
// Intentional fall-through to the 'else' to generate the cache
// file for the next run
}
success &= loadCachedFile(cachedFile);
if (!success) {
FileSys.cacheManager()->removeCacheFile(_labelFile);
// Intentional fall-through to the 'else' to generate the cache
// file for the next run
}
else {
LINFO(fmt::format("Cache for Label file '{}' not found", _labelFile));
LINFO(fmt::format("Loading Label file '{}'", _labelFile));
}
else {
LINFO(fmt::format("Cache for Label file '{}' not found", _labelFile));
LINFO(fmt::format("Loading Label file '{}'", _labelFile));
success &= readLabelFile();
if (!success) {
return false;
}
success &= readLabelFile();
if (!success) {
return false;
}
}
@@ -1389,102 +1393,94 @@ bool RenderableBillboardsCloud::readLabelFile() {
bool RenderableBillboardsCloud::loadCachedFile(const std::string& file) {
std::ifstream fileStream(file, std::ifstream::binary);
if (fileStream.good()) {
int8_t version = 0;
fileStream.read(reinterpret_cast<char*>(&version), sizeof(int8_t));
if (version != CurrentCacheVersion) {
LINFO("The format of the cached file has changed: deleting old cache");
fileStream.close();
FileSys.deleteFile(file);
return false;
}
int32_t nValues = 0;
fileStream.read(reinterpret_cast<char*>(&nValues), sizeof(int32_t));
fileStream.read(
reinterpret_cast<char*>(&_nValuesPerAstronomicalObject),
sizeof(int32_t)
);
_fullData.resize(nValues);
fileStream.read(reinterpret_cast<char*>(&_fullData[0]),
nValues * sizeof(_fullData[0]));
if (_hasColorMapFile) {
int32_t nItems = 0;
fileStream.read(reinterpret_cast<char*>(&nItems), sizeof(int32_t));
for (int i = 0; i < nItems; ++i) {
int32_t keySize = 0;
fileStream.read(reinterpret_cast<char*>(&keySize), sizeof(int32_t));
std::vector<char> buffer(keySize);
fileStream.read(buffer.data(), keySize);
std::string key(buffer.begin(), buffer.end());
int32_t value = 0;
fileStream.read(reinterpret_cast<char*>(&value), sizeof(int32_t));
_variableDataPositionMap.insert({ key, value });
}
}
bool success = fileStream.good();
return success;
}
else {
if (!fileStream.good()) {
LERROR(fmt::format("Error opening file '{}' for loading cache file", file));
return false;
}
int8_t version = 0;
fileStream.read(reinterpret_cast<char*>(&version), sizeof(int8_t));
if (version != CurrentCacheVersion) {
LINFO("The format of the cached file has changed: deleting old cache");
fileStream.close();
FileSys.deleteFile(file);
return false;
}
int32_t nValues = 0;
fileStream.read(reinterpret_cast<char*>(&nValues), sizeof(int32_t));
fileStream.read(
reinterpret_cast<char*>(&_nValuesPerAstronomicalObject),
sizeof(int32_t)
);
_fullData.resize(nValues);
fileStream.read(
reinterpret_cast<char*>(&_fullData[0]),
nValues * sizeof(_fullData[0])
);
if (_hasColorMapFile) {
int32_t nItems = 0;
fileStream.read(reinterpret_cast<char*>(&nItems), sizeof(int32_t));
for (int i = 0; i < nItems; ++i) {
int32_t keySize = 0;
fileStream.read(reinterpret_cast<char*>(&keySize), sizeof(int32_t));
std::vector<char> buffer(keySize);
fileStream.read(buffer.data(), keySize);
std::string key(buffer.begin(), buffer.end());
int32_t value = 0;
fileStream.read(reinterpret_cast<char*>(&value), sizeof(int32_t));
_variableDataPositionMap.insert({ key, value });
}
}
bool success = fileStream.good();
return success;
}
bool RenderableBillboardsCloud::saveCachedFile(const std::string& file) const {
std::ofstream fileStream(file, std::ofstream::binary);
if (fileStream.good()) {
fileStream.write(reinterpret_cast<const char*>(&CurrentCacheVersion),
sizeof(int8_t));
int32_t nValues = static_cast<int32_t>(_fullData.size());
if (nValues == 0) {
LERROR("Error writing cache: No values were loaded");
return false;
}
fileStream.write(reinterpret_cast<const char*>(&nValues), sizeof(int32_t));
int32_t nValuesPerAstronomicalObject = static_cast<int32_t>(
_nValuesPerAstronomicalObject
);
fileStream.write(
reinterpret_cast<const char*>(&nValuesPerAstronomicalObject),
sizeof(int32_t)
);
size_t nBytes = nValues * sizeof(_fullData[0]);
fileStream.write(reinterpret_cast<const char*>(&_fullData[0]), nBytes);
if (_hasColorMapFile) {
int32_t nItems = static_cast<int32_t>(_variableDataPositionMap.size());
fileStream.write(reinterpret_cast<const char*>(&nItems), sizeof(int32_t));
for (const std::pair<const std::string, int>& pair :
_variableDataPositionMap)
{
int32_t keySize = static_cast<int32_t>(pair.first.size());
fileStream.write(
reinterpret_cast<const char*>(&keySize),
sizeof(int32_t)
);
fileStream.write(pair.first.data(), keySize);
int32_t value = static_cast<int32_t>(pair.second);
fileStream.write(reinterpret_cast<const char*>(&value), sizeof(int32_t));
}
}
return fileStream.good();
}
else {
if (!fileStream.good()) {
LERROR(fmt::format("Error opening file '{}' for save cache file", file));
return false;
}
fileStream.write(reinterpret_cast<const char*>(&CurrentCacheVersion), sizeof(int8_t));
int32_t nValues = static_cast<int32_t>(_fullData.size());
if (nValues == 0) {
LERROR("Error writing cache: No values were loaded");
return false;
}
fileStream.write(reinterpret_cast<const char*>(&nValues), sizeof(int32_t));
int32_t nValuesPerAstronomicalObject = static_cast<int32_t>(
_nValuesPerAstronomicalObject
);
fileStream.write(
reinterpret_cast<const char*>(&nValuesPerAstronomicalObject),
sizeof(int32_t)
);
size_t nBytes = nValues * sizeof(_fullData[0]);
fileStream.write(reinterpret_cast<const char*>(&_fullData[0]), nBytes);
if (_hasColorMapFile) {
int32_t nItems = static_cast<int32_t>(_variableDataPositionMap.size());
fileStream.write(reinterpret_cast<const char*>(&nItems), sizeof(int32_t));
for (const std::pair<const std::string, int>& pair : _variableDataPositionMap) {
int32_t keySize = static_cast<int32_t>(pair.first.size());
fileStream.write(reinterpret_cast<const char*>(&keySize), sizeof(int32_t));
fileStream.write(pair.first.data(), keySize);
int32_t value = static_cast<int32_t>(pair.second);
fileStream.write(reinterpret_cast<const char*>(&value), sizeof(int32_t));
}
}
return fileStream.good();
}
void RenderableBillboardsCloud::createDataSlice() {
@@ -1503,7 +1499,7 @@ void RenderableBillboardsCloud::createDataSlice() {
colorMapInUse = _variableDataPositionMap[_colorOptionString];
glm::vec2 currentColorRange = _colorRangeData[_colorOption.value()];
float colorMapBinSize = (currentColorRange.y - currentColorRange.x) /
static_cast<float>(_colorMapData.size());
static_cast<float>(_colorMapData.size());
float bin = colorMapBinSize;
for (size_t i = 0; i < _colorMapData.size(); ++i) {
colorBins.push_back(bin);
@@ -1522,7 +1518,7 @@ void RenderableBillboardsCloud::createDataSlice() {
glm::vec4 position(glm::vec3(transformedPos), static_cast<float>(_unit));
if (_hasColorMapFile) {
for (auto j = 0; j < 4; ++j) {
for (int j = 0; j < 4; ++j) {
_slicedData.push_back(position[j]);
biggestCoord = biggestCoord < position[j] ? position[j] : biggestCoord;
}
@@ -1539,17 +1535,14 @@ void RenderableBillboardsCloud::createDataSlice() {
}
}
int colorIndex =
c == static_cast<int>(colorBins.size() - 1) ?
0 :
c + 1;
int colorIndex = c == static_cast<int>(colorBins.size() - 1) ? 0 : c + 1;
for (auto j = 0; j < 4; ++j) {
for (int j = 0; j < 4; ++j) {
_slicedData.push_back(_colorMapData[colorIndex][j]);
}
}
else {
for (auto j = 0; j < 4; ++j) {
for (int j = 0; j < 4; ++j) {
_slicedData.push_back(position[j]);
}
}
@@ -1568,8 +1561,7 @@ void RenderableBillboardsCloud::createPolygonTexture() {
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
// Stopped using a buffer object for GL_PIXEL_UNPACK_BUFFER
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 256,
256, 0, GL_RGBA, GL_BYTE, nullptr);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 256, 256, 0, GL_RGBA, GL_BYTE, nullptr);
renderToTexture(_pTexture, 256, 256);
}
@@ -1615,7 +1607,7 @@ void RenderableBillboardsCloud::loadPolygonGeometryForRendering() {
const GLfloat vertex_data[] = {
// x y z w
0.0f, 0.0f, 0.0f, 1.0f,
0.f, 0.f, 0.f, 1.f,
};
glBufferData(GL_ARRAY_BUFFER, sizeof(vertex_data), vertex_data, GL_STATIC_DRAW);
@@ -1633,14 +1625,15 @@ void RenderableBillboardsCloud::loadPolygonGeometryForRendering() {
void RenderableBillboardsCloud::renderPolygonGeometry(GLuint vao) {
std::unique_ptr<ghoul::opengl::ProgramObject> program =
ghoul::opengl::ProgramObject::Build("RenderableBillboardsCloud_Polygon",
ghoul::opengl::ProgramObject::Build(
"RenderableBillboardsCloud_Polygon",
absPath("${MODULE_DIGITALUNIVERSE}/shaders/billboardpolygon_vs.glsl"),
absPath("${MODULE_DIGITALUNIVERSE}/shaders/billboardpolygon_fs.glsl"),
absPath("${MODULE_DIGITALUNIVERSE}/shaders/billboardpolygon_gs.glsl")
);
program->activate();
static const float black[] = { 0.0f, 0.0f, 0.0f, 0.0f };
static const float black[] = { 0.f, 0.f, 0.f, 0.f };
glClearBufferfv(GL_COLOR, 0, black);
program->setUniform("sides", _polygonSides);

View File

@@ -64,6 +64,9 @@ namespace {
constexpr const char* GigaparsecUnit = "Gpc";
constexpr const char* GigalightyearUnit = "Gly";
constexpr const int RenderOptionViewDirection = 0;
constexpr const int RenderOptionPositionNormal = 1;
constexpr const int8_t CurrentCacheVersion = 1;
constexpr const double PARSEC = 0.308567756E17;
@@ -252,11 +255,11 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary)
glm::vec4(0.f),
glm::vec4(1.f)
)
, _textSize(TextSizeInfo, 8.0, 0.5, 24.0)
, _textSize(TextSizeInfo, 8.f, 0.5f, 24.f)
, _drawElements(DrawElementsInfo, true)
, _drawLabels(DrawLabelInfo, false)
, _textMinSize(LabelMinSizeInfo, 8.0, 0.5, 24.0)
, _textMaxSize(LabelMaxSizeInfo, 500.0, 0.0, 1000.0)
, _textMinSize(LabelMinSizeInfo, 8.f, 0.5f, 24.f)
, _textMaxSize(LabelMaxSizeInfo, 500.f, 0.f, 1000.f)
, _renderOption(RenderOptionInfo, properties::OptionProperty::DisplayType::Dropdown)
{
documentation::testSpecificationAndThrow(
@@ -272,13 +275,13 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary)
addProperty(_drawElements);
}
_renderOption.addOption(0, "Camera View Direction");
_renderOption.addOption(1, "Camera Position Normal");
_renderOption.addOption(RenderOptionViewDirection, "Camera View Direction");
_renderOption.addOption(RenderOptionPositionNormal, "Camera Position Normal");
if (global::windowDelegate.isFisheyeRendering()) {
_renderOption.set(1);
_renderOption = RenderOptionPositionNormal;
}
else {
_renderOption.set(0);
_renderOption = RenderOptionViewDirection;
}
addProperty(_renderOption);
@@ -336,9 +339,7 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary)
addProperty(_drawLabels);
if (dictionary.hasKey(LabelFileInfo.identifier)) {
_labelFile = absPath(dictionary.value<std::string>(
LabelFileInfo.identifier
));
_labelFile = absPath(dictionary.value<std::string>(LabelFileInfo.identifier));
_hasLabel = true;
if (dictionary.hasKey(TextColorInfo.identifier)) {
@@ -356,16 +357,12 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary)
addProperty(_textSize);
if (dictionary.hasKey(LabelMinSizeInfo.identifier)) {
_textMinSize = floor(
dictionary.value<float>(LabelMinSizeInfo.identifier)
);
_textMinSize = floor(dictionary.value<float>(LabelMinSizeInfo.identifier));
}
addProperty(_textMinSize);
if (dictionary.hasKey(LabelMaxSizeInfo.identifier)) {
_textMaxSize = floor(
dictionary.value<float>(LabelMaxSizeInfo.identifier)
);
_textMaxSize = floor(dictionary.value<float>(LabelMaxSizeInfo.identifier));
}
addProperty(_textMaxSize);
}
@@ -381,11 +378,10 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary)
MeshColorInfo.identifier
);
for (int i = 0; i < static_cast<int>(colorDict.size()); ++i) {
_meshColorMap.insert({ i + 1,
colorDict.value<glm::vec3>(std::to_string(i + 1)) }
_meshColorMap.insert(
{ i + 1, colorDict.value<glm::vec3>(std::to_string(i + 1)) }
);
}
}
setRenderBin(Renderable::RenderBin::Opaque);
@@ -393,13 +389,13 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary)
bool RenderableDUMeshes::isReady() const {
return (_program != nullptr) &&
(!_renderingMeshesMap.empty() || (!_labelData.empty()));
(!_renderingMeshesMap.empty() || (!_labelData.empty()));
}
void RenderableDUMeshes::initializeGL() {
_program = DigitalUniverseModule::ProgramObjectManager.request(
ProgramObjectName,
[]() -> std::unique_ptr<ghoul::opengl::ProgramObject> {
[]() {
return global::renderEngine.buildRenderProgram(
"RenderableDUMeshes",
absPath("${MODULE_DIGITALUNIVERSE}/shaders/dumesh_vs.glsl"),
@@ -530,10 +526,10 @@ void RenderableDUMeshes::renderLabels(const RenderData& data,
float scale = 0.f;
switch (_unit) {
case Meter:
scale = 1.0;
scale = 1.f;
break;
case Kilometer:
scale = 1e3;
scale = 1e3f;
break;
case Parsec:
scale = static_cast<float>(PARSEC);
@@ -552,6 +548,19 @@ void RenderableDUMeshes::renderLabels(const RenderData& data,
break;
}
ghoul::fontrendering::FontRenderer::ProjectedLabelsInformation labelInfo;
labelInfo.orthoRight = orthoRight;
labelInfo.orthoUp = orthoUp;
labelInfo.minSize = static_cast<int>(_textMinSize);
labelInfo.maxSize = static_cast<int>(_textMaxSize);
labelInfo.cameraPos = data.camera.positionVec3();
labelInfo.cameraLookUp = data.camera.lookUpVectorWorldSpace();
labelInfo.renderType = _renderOption;
labelInfo.mvpMatrix = modelViewProjectionMatrix;
labelInfo.scale = pow(10.f, _textSize);
labelInfo.enableDepth = true;
labelInfo.enableFalseDepth = false;
for (const std::pair<glm::vec3, std::string>& pair : _labelData) {
//glm::vec3 scaledPos(_transformationMatrix * glm::dvec4(pair.first, 1.0));
glm::vec3 scaledPos(pair.first);
@@ -561,15 +570,7 @@ void RenderableDUMeshes::renderLabels(const RenderData& data,
scaledPos,
pair.second,
_textColor,
pow(10.f, _textSize.value()),
static_cast<int>(_textMinSize),
static_cast<int>(_textMaxSize),
modelViewProjectionMatrix,
orthoRight,
orthoUp,
data.camera.positionVec3(),
data.camera.lookUpVectorWorldSpace(),
_renderOption.value()
labelInfo
);
}
}
@@ -599,18 +600,17 @@ void RenderableDUMeshes::render(const RenderData& data, RendererTasks&) {
right = glm::cross(viewDirection, otherVector);
orthoRight = glm::normalize(
glm::vec3(worldToModelTransform * glm::vec4(right, 0.0))
);
);
}
const glm::vec3 orthoUp = glm::normalize(
glm::vec3(worldToModelTransform * glm::vec4(up, 0.0))
);
if (_hasSpeckFile) {
renderMeshes(data, modelViewMatrix, projectionMatrix);
}
if (_drawLabels && _hasLabel) {
const glm::vec3 orthoUp = glm::normalize(
glm::vec3(worldToModelTransform * glm::dvec4(up, 0.0))
);
renderLabels(data, modelViewProjectionMatrix, orthoRight, orthoUp);
}
}
@@ -648,16 +648,12 @@ bool RenderableDUMeshes::loadData() {
// else
// {
// LINFO("Cache for Speck file '" << _speckFile << "' not found");
LINFO(fmt::format("Loading Speck file '{}'", _speckFile));
LINFO(fmt::format("Loading Speck file '{}'", _speckFile));
success = readSpeckFile();
if (!success) {
return false;
}
// LINFO("Saving cache");
//success &= saveCachedFile(cachedFile);
// }
success = readSpeckFile();
if (!success) {
return false;
}
}
std::string labelFile = _labelFile;
@@ -683,12 +679,12 @@ bool RenderableDUMeshes::loadData() {
// }
// else {
// LINFO("Cache for Label file '" << labelFile << "' not found");
LINFO(fmt::format("Loading Label file '{}'", labelFile));
LINFO(fmt::format("Loading Label file '{}'", labelFile));
success &= readLabelFile();
if (!success) {
return false;
}
success &= readLabelFile();
if (!success) {
return false;
}
// }
}
@@ -720,7 +716,7 @@ bool RenderableDUMeshes::readSpeckFile() {
// Guard against wrong line endings (copying files from Windows to Mac) causes
// lines to have a final \r
if (!line.empty() && line.back() == '\r') {
line = line.substr(0, line.length() -1);
line = line.substr(0, line.length() - 1);
}
if (line.empty() || line[0] == '#') {
@@ -837,7 +833,7 @@ bool RenderableDUMeshes::readLabelFile() {
// Guard against wrong line endings (copying files from Windows to Mac) causes
// lines to have a final \r
if (!line.empty() && line.back() == '\r') {
line = line.substr(0, line.length() -1);
line = line.substr(0, line.length() - 1);
}
@@ -863,7 +859,6 @@ bool RenderableDUMeshes::readLabelFile() {
}
}
do {
std::vector<float> values(_nValuesPerAstronomicalObject);
@@ -872,7 +867,7 @@ bool RenderableDUMeshes::readLabelFile() {
// Guard against wrong line endings (copying files from Windows to Mac) causes
// lines to have a final \r
if (!line.empty() && line.back() == '\r') {
line = line.substr(0, line.length() -1);
line = line.substr(0, line.length() - 1);
}
if (line.empty()) {
@@ -910,115 +905,174 @@ bool RenderableDUMeshes::readLabelFile() {
bool RenderableDUMeshes::loadCachedFile(const std::string& file) {
std::ifstream fileStream(file, std::ifstream::binary);
if (fileStream.good()) {
int8_t version = 0;
fileStream.read(reinterpret_cast<char*>(&version), sizeof(int8_t));
if (version != CurrentCacheVersion) {
LINFO("The format of the cached file has changed: deleting old cache");
fileStream.close();
FileSys.deleteFile(file);
return false;
}
int32_t nValues = 0;
fileStream.read(reinterpret_cast<char*>(&nValues), sizeof(int32_t));
fileStream.read(
reinterpret_cast<char*>(&_nValuesPerAstronomicalObject),
sizeof(int32_t)
);
_fullData.resize(nValues);
fileStream.read(reinterpret_cast<char*>(&_fullData[0]),
nValues * sizeof(_fullData[0]));
bool success = fileStream.good();
return success;
}
else {
if (!fileStream.good()) {
LERROR(fmt::format("Error opening file '{}' for loading cache file", file));
return false;
}
int8_t version = 0;
fileStream.read(reinterpret_cast<char*>(&version), sizeof(int8_t));
if (version != CurrentCacheVersion) {
LINFO("The format of the cached file has changed: deleting old cache");
fileStream.close();
FileSys.deleteFile(file);
return false;
}
int32_t nValues = 0;
fileStream.read(reinterpret_cast<char*>(&nValues), sizeof(int32_t));
fileStream.read(
reinterpret_cast<char*>(&_nValuesPerAstronomicalObject),
sizeof(int32_t)
);
_fullData.resize(nValues);
fileStream.read(
reinterpret_cast<char*>(&_fullData[0]),
nValues * sizeof(_fullData[0])
);
bool success = fileStream.good();
return success;
}
bool RenderableDUMeshes::saveCachedFile(const std::string& file) const {
std::ofstream fileStream(file, std::ofstream::binary);
if (fileStream.good()) {
fileStream.write(reinterpret_cast<const char*>(&CurrentCacheVersion),
sizeof(int8_t));
const int32_t nValues = static_cast<int32_t>(_fullData.size());
if (nValues == 0) {
LERROR("Error writing cache: No values were loaded");
return false;
}
fileStream.write(reinterpret_cast<const char*>(&nValues), sizeof(int32_t));
const int32_t nValuesPerAstronomicalObject = static_cast<int32_t>(
_nValuesPerAstronomicalObject
);
fileStream.write(
reinterpret_cast<const char*>(&nValuesPerAstronomicalObject),
sizeof(int32_t)
);
const size_t nBytes = nValues * sizeof(_fullData[0]);
fileStream.write(reinterpret_cast<const char*>(&_fullData[0]), nBytes);
const bool success = fileStream.good();
return success;
}
else {
if (!fileStream.good()) {
LERROR(fmt::format("Error opening file '{}' for save cache file", file));
return false;
}
fileStream.write(
reinterpret_cast<const char*>(&CurrentCacheVersion),
sizeof(int8_t)
);
const int32_t nValues = static_cast<int32_t>(_fullData.size());
if (nValues == 0) {
LERROR("Error writing cache: No values were loaded");
return false;
}
fileStream.write(reinterpret_cast<const char*>(&nValues), sizeof(int32_t));
const int32_t nValuesPerAstronomicalObject = static_cast<int32_t>(
_nValuesPerAstronomicalObject
);
fileStream.write(
reinterpret_cast<const char*>(&nValuesPerAstronomicalObject),
sizeof(int32_t)
);
const size_t nBytes = nValues * sizeof(_fullData[0]);
fileStream.write(reinterpret_cast<const char*>(&_fullData[0]), nBytes);
const bool success = fileStream.good();
return success;
}
void RenderableDUMeshes::createMeshes() {
if (_dataIsDirty && _hasSpeckFile) {
LDEBUG("Creating planes");
if (!(_dataIsDirty && _hasSpeckFile)) {
return;
}
LDEBUG("Creating planes");
for (std::pair<const int, RenderingMesh>& p : _renderingMeshesMap) {
float scale = 0.f;
switch (_unit) {
case Meter:
scale = 1.f;
break;
case Kilometer:
scale = 1e3f;
break;
case Parsec:
scale = static_cast<float>(PARSEC);
break;
case Kiloparsec:
scale = static_cast<float>(1e3 * PARSEC);
break;
case Megaparsec:
scale = static_cast<float>(1e6 * PARSEC);
break;
case Gigaparsec:
scale = static_cast<float>(1e9 * PARSEC);
break;
case GigalightYears:
scale = static_cast<float>(306391534.73091 * PARSEC);
break;
for (std::pair<const int, RenderingMesh>& p : _renderingMeshesMap) {
float scale = 0.f;
switch (_unit) {
case Meter:
scale = 1.f;
break;
case Kilometer:
scale = 1e3f;
break;
case Parsec:
scale = static_cast<float>(PARSEC);
break;
case Kiloparsec:
scale = static_cast<float>(1e3 * PARSEC);
break;
case Megaparsec:
scale = static_cast<float>(1e6 * PARSEC);
break;
case Gigaparsec:
scale = static_cast<float>(1e9 * PARSEC);
break;
case GigalightYears:
scale = static_cast<float>(306391534.73091 * PARSEC);
break;
}
for (GLfloat& v : p.second.vertices) {
v *= scale;
}
for (int i = 0; i < p.second.numU; ++i) {
GLuint vao;
glGenVertexArrays(1, &vao);
p.second.vaoArray.push_back(vao);
GLuint vbo;
glGenBuffers(1, &vbo);
p.second.vboArray.push_back(vbo);
glBindVertexArray(vao);
glBindBuffer(GL_ARRAY_BUFFER, vbo);
//glBufferData(GL_ARRAY_BUFFER, it->second.numV * sizeof(GLfloat),
glBufferData(
GL_ARRAY_BUFFER,
p.second.vertices.size() * sizeof(GLfloat),
&p.second.vertices[0],
GL_STATIC_DRAW
);
// in_position
glEnableVertexAttribArray(0);
// U and V may not be given by the user
if (p.second.vertices.size() / (p.second.numU * p.second.numV) > 3) {
glVertexAttribPointer(
0,
3,
GL_FLOAT,
GL_FALSE,
sizeof(GLfloat) * 5,
reinterpret_cast<GLvoid*>(sizeof(GLfloat) * i * p.second.numV)
);
// texture coords
glEnableVertexAttribArray(1);
glVertexAttribPointer(
1,
2,
GL_FLOAT,
GL_FALSE,
sizeof(GLfloat) * 7,
reinterpret_cast<GLvoid*>(sizeof(GLfloat) * 3 * i * p.second.numV)
);
}
for (GLfloat& v : p.second.vertices) {
v *= scale;
else { // no U and V:
glVertexAttribPointer(
0,
3,
GL_FLOAT,
GL_FALSE,
0,
reinterpret_cast<GLvoid*>(sizeof(GLfloat) * 3 * i * p.second.numV)
);
}
}
for (int i = 0; i < p.second.numU; ++i) {
GLuint vao;
glGenVertexArrays(1, &vao);
p.second.vaoArray.push_back(vao);
// Grid: we need columns
if (p.second.numU > 1) {
for (int i = 0; i < p.second.numV; ++i) {
GLuint cvao;
glGenVertexArrays(1, &cvao);
p.second.vaoArray.push_back(cvao);
GLuint vbo;
glGenBuffers(1, &vbo);
p.second.vboArray.push_back(vbo);
GLuint cvbo;
glGenBuffers(1, &cvbo);
p.second.vboArray.push_back(cvbo);
glBindVertexArray(vao);
glBindBuffer(GL_ARRAY_BUFFER, vbo);
//glBufferData(GL_ARRAY_BUFFER, it->second.numV * sizeof(GLfloat),
glBindVertexArray(cvao);
glBindBuffer(GL_ARRAY_BUFFER, cvbo);
glBufferData(
GL_ARRAY_BUFFER,
p.second.vertices.size() * sizeof(GLfloat),
@@ -1034,8 +1088,8 @@ void RenderableDUMeshes::createMeshes() {
3,
GL_FLOAT,
GL_FALSE,
sizeof(GLfloat) * 5,
reinterpret_cast<GLvoid*>(sizeof(GLfloat) * i * p.second.numV)
p.second.numV * sizeof(GLfloat) * 5,
reinterpret_cast<GLvoid*>(sizeof(GLfloat) * i)
);
// texture coords
@@ -1045,10 +1099,8 @@ void RenderableDUMeshes::createMeshes() {
2,
GL_FLOAT,
GL_FALSE,
sizeof(GLfloat) * 7,
reinterpret_cast<GLvoid*>(
sizeof(GLfloat) * 3 * i * p.second.numV
)
p.second.numV * sizeof(GLfloat) * 7,
reinterpret_cast<GLvoid*>(sizeof(GLfloat) * 3 * i)
);
}
else { // no U and V:
@@ -1057,81 +1109,17 @@ void RenderableDUMeshes::createMeshes() {
3,
GL_FLOAT,
GL_FALSE,
0,
reinterpret_cast<GLvoid*>(
sizeof(GLfloat) * 3 * i * p.second.numV
)
p.second.numV * sizeof(GLfloat) * 3,
reinterpret_cast<GLvoid*>(sizeof(GLfloat) * 3 * i)
);
}
}
// Grid: we need columns
if (p.second.numU > 1) {
for (int i = 0; i < p.second.numV; ++i) {
GLuint cvao;
glGenVertexArrays(1, &cvao);
p.second.vaoArray.push_back(cvao);
GLuint cvbo;
glGenBuffers(1, &cvbo);
p.second.vboArray.push_back(cvbo);
glBindVertexArray(cvao);
glBindBuffer(GL_ARRAY_BUFFER, cvbo);
glBufferData(
GL_ARRAY_BUFFER,
p.second.vertices.size() * sizeof(GLfloat),
&p.second.vertices[0],
GL_STATIC_DRAW
);
// in_position
glEnableVertexAttribArray(0);
// U and V may not be given by the user
if (p.second.vertices.size() /
(p.second.numU * p.second.numV) > 3)
{
glVertexAttribPointer(
0,
3,
GL_FLOAT,
GL_FALSE,
p.second.numV * sizeof(GLfloat) * 5,
reinterpret_cast<GLvoid*>(sizeof(GLfloat) * i)
);
// texture coords
glEnableVertexAttribArray(1);
glVertexAttribPointer(
1,
2,
GL_FLOAT,
GL_FALSE,
p.second.numV * sizeof(GLfloat) * 7,
reinterpret_cast<GLvoid*>(sizeof(GLfloat) * 3 * i)
);
}
else { // no U and V:
glVertexAttribPointer(
0,
3,
GL_FLOAT,
GL_FALSE,
p.second.numV * sizeof(GLfloat) * 3,
reinterpret_cast<GLvoid*>(sizeof(GLfloat) * 3 * i)
);
}
}
}
}
glBindVertexArray(0);
_dataIsDirty = false;
}
if (_hasLabel && _labelDataIsDirty) {
_labelDataIsDirty = false;
}
glBindVertexArray(0);
_dataIsDirty = false;
}
} // namespace openspace

View File

@@ -117,7 +117,6 @@ private:
bool _dataIsDirty = true;
bool _textColorIsDirty = true;
bool _hasLabel = false;
bool _labelDataIsDirty = true;
properties::FloatProperty _alphaValue;
//properties::FloatProperty _scaleFactor;
@@ -152,8 +151,6 @@ private:
std::unordered_map<int, glm::vec3> _meshColorMap;
std::unordered_map<int, RenderingMesh> _renderingMeshesMap;
};
} // namespace openspace
#endif // __OPENSPACE_MODULE_DIGITALUNIVERSE___RENDERABLEDUMESHES___H__

View File

@@ -651,7 +651,21 @@ void RenderablePlanesCloud::renderLabels(const RenderData& data,
}
glm::vec4 textColor = _textColor;
textColor.a *= fadeInVariable;
textColor.a *= fadeInVariable * _opacity;
ghoul::fontrendering::FontRenderer::ProjectedLabelsInformation labelInfo;
labelInfo.orthoRight = orthoRight;
labelInfo.orthoUp = orthoUp;
labelInfo.minSize = static_cast<int>(_textMinSize);
labelInfo.maxSize = static_cast<int>(_textMaxSize);
labelInfo.cameraPos = data.camera.positionVec3();
labelInfo.cameraLookUp = data.camera.lookUpVectorWorldSpace();
labelInfo.renderType = _renderOption;
labelInfo.mvpMatrix = modelViewProjectionMatrix;
labelInfo.scale = pow(10.f, _textSize);
labelInfo.enableDepth = true;
labelInfo.enableFalseDepth = false;
for (const std::pair<glm::vec3, std::string>& pair : _labelData) {
//glm::vec3 scaledPos(_transformationMatrix * glm::dvec4(pair.first, 1.0));
glm::vec3 scaledPos(pair.first);
@@ -661,15 +675,7 @@ void RenderablePlanesCloud::renderLabels(const RenderData& data,
scaledPos,
pair.second,
textColor,
pow(10.f, _textSize.value()),
_textMinSize,
_textMaxSize,
modelViewProjectionMatrix,
orthoRight,
orthoUp,
data.camera.positionVec3(),
data.camera.lookUpVectorWorldSpace(),
_renderOption.value()
labelInfo
);
}
}

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2018 *
* Copyright (c) 2014-2019 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2018 *
* Copyright (c) 2014-2019 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2018 *
* Copyright (c) 2014-2019 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2018 *
* Copyright (c) 2014-2019 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2018 *
* Copyright (c) 2014-2019 *
* *
* 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 *

View File

@@ -26,13 +26,13 @@ include(${OPENSPACE_CMAKE_EXT_DIR}/module_definition.cmake)
set(HEADER_FILES
${CMAKE_CURRENT_SOURCE_DIR}/globebrowsingmodule.h
${CMAKE_CURRENT_SOURCE_DIR}/src/asynctiledataprovider.h
${CMAKE_CURRENT_SOURCE_DIR}/src/basictypes.h
${CMAKE_CURRENT_SOURCE_DIR}/src/dashboarditemglobelocation.h
${CMAKE_CURRENT_SOURCE_DIR}/src/ellipsoid.h
${CMAKE_CURRENT_SOURCE_DIR}/src/gdalwrapper.h
${CMAKE_CURRENT_SOURCE_DIR}/src/geodeticpatch.h
${CMAKE_CURRENT_SOURCE_DIR}/src/globelabelscomponent.h
${CMAKE_CURRENT_SOURCE_DIR}/src/globetranslation.h
${CMAKE_CURRENT_SOURCE_DIR}/src/gpulayergroup.h
${CMAKE_CURRENT_SOURCE_DIR}/src/layer.h
@@ -62,12 +62,12 @@ set(HEADER_FILES
set(SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/globebrowsingmodule.cpp
${CMAKE_CURRENT_SOURCE_DIR}/globebrowsingmodule_lua.inl
${CMAKE_CURRENT_SOURCE_DIR}/src/asynctiledataprovider.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/dashboarditemglobelocation.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/ellipsoid.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/gdalwrapper.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/geodeticpatch.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/globelabelscomponent.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/globetranslation.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/gpulayergroup.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/layer.cpp
@@ -123,7 +123,7 @@ if (WIN32)
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/ext/gdal/lib/gdal_i.lib
)
register_external_libraries("${CMAKE_CURRENT_SOURCE_DIR}/ext/gdal/lib/gdal203.dll")
register_external_libraries("${CMAKE_CURRENT_SOURCE_DIR}/ext/gdal/lib/gdal241.dll")
else (WIN32)
find_package(GDAL REQUIRED)

View File

@@ -1,5 +1,5 @@
/**********************************************************************
* $Id: cpl_alibaba_oss.h e648607661fdd5cbc6bb778c17c20c3e7979a734 2018-04-04 19:27:08 +0200 Even Rouault $
* $Id: cpl_alibaba_oss.h c39d156816d937c3139360b11786c769aeabd21e 2018-05-05 19:48:08 +0200 Even Rouault $
*
* Name: cpl_alibaba_oss.h
* Project: CPL - Common Portability Library
@@ -45,14 +45,16 @@
class VSIOSSHandleHelper final: public IVSIS3LikeHandleHelper
{
CPLString m_osURL;
CPLString m_osSecretAccessKey;
CPLString m_osAccessKeyId;
CPLString m_osEndpoint;
CPLString m_osBucket;
CPLString m_osObjectKey;
bool m_bUseHTTPS;
bool m_bUseVirtualHosting;
CPL_DISALLOW_COPY_ASSIGN(VSIOSSHandleHelper)
CPLString m_osURL{};
CPLString m_osSecretAccessKey{};
CPLString m_osAccessKeyId{};
CPLString m_osEndpoint{};
CPLString m_osBucket{};
CPLString m_osObjectKey{};
bool m_bUseHTTPS = false;
bool m_bUseVirtualHosting = false;
void RebuildURL() override;
@@ -104,9 +106,9 @@ class VSIOSSHandleHelper final: public IVSIS3LikeHandleHelper
class VSIOSSUpdateParams
{
public:
CPLString m_osEndpoint;
CPLString m_osEndpoint{};
VSIOSSUpdateParams() {}
VSIOSSUpdateParams() = default;
explicit VSIOSSUpdateParams(const VSIOSSHandleHelper* poHelper) :
m_osEndpoint(poHelper->GetEndpoint()) {}

View File

@@ -0,0 +1,85 @@
/**********************************************************************
* $Id: cpl_auto_close.h 928c6bcbd3901094d5680a73a623acc194f55afc 2018-10-07 18:11:27 +0800 小旋风 $
*
* Name: cpl_auto_close.h
* Project: CPL - Common Portability Library
* Purpose: CPL Auto Close handling
* Author: Liu Yimin, ymwh@foxmail.com
*
**********************************************************************
* Copyright (c) 2018, Liu Yimin
*
* 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 without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
****************************************************************************/
#ifndef CPL_AUTO_CLOSE_H_INCLUDED
#define CPL_AUTO_CLOSE_H_INCLUDED
#if defined(__cplusplus)
#include <type_traits>
/************************************************************************/
/* CPLAutoClose */
/************************************************************************/
/**
* The class use the destructor to automatically close the resource.
* Example:
* GDALDatasetH hDset = GDALOpen(path,GA_ReadOnly);
* CPLAutoClose<GDALDatasetH,void(*)(void*)> autoclosehDset(hDset,GDALClose);
* Or:
* GDALDatasetH hDset = GDALOpen(path,GA_ReadOnly);
* CPL_AUTO_CLOSE_WARP(hDset,GDALClose);
*/
template<typename _Ty,typename _Dx>
class CPLAutoClose {
static_assert( !std::is_const<_Ty>::value && std::is_pointer<_Ty>::value,
"_Ty must is pointer type,_Dx must is function type");
private:
_Ty& m_ResourcePtr;
_Dx m_CloseFunc;
private:
CPLAutoClose(const CPLAutoClose&) = delete;
void operator=(const CPLAutoClose&) = delete;
public:
/**
* @brief Constructor.
* @param ptr Pointer to the resource object.
* @param dt Resource release(close) function.
*/
explicit CPLAutoClose(_Ty& ptr,_Dx dt) :
m_ResourcePtr(ptr),
m_CloseFunc(dt)
{}
/**
* @brief Destructor.
*/
~CPLAutoClose()
{
if(m_ResourcePtr && m_CloseFunc)
m_CloseFunc(m_ResourcePtr);
}
};
#define CPL_AUTO_CLOSE_WARP(hObject,closeFunc) \
CPLAutoClose<decltype(hObject),decltype(closeFunc)*> tAutoClose##hObject(hObject,closeFunc)
#endif /* __cplusplus */
#endif /* CPL_AUTO_CLOSE_H_INCLUDED */

View File

@@ -1,5 +1,5 @@
/**********************************************************************
* $Id: cpl_aws.h 1d0f559204e90d0e54d4aebe6ea8b65f0851be69 2018-06-20 16:38:42 +0200 Even Rouault $
* $Id: cpl_aws.h 5318f6d39d2006a10cb6c1410334c56d76a74aa6 2018-06-20 16:38:42 +0200 Even Rouault $
*
* Name: cpl_aws.h
* Project: CPL - Common Portability Library
@@ -83,15 +83,17 @@ CPLString CPLGetAWS_SIGN4_Authorization(const CPLString& osSecretAccessKey,
class IVSIS3LikeHandleHelper
{
CPL_DISALLOW_COPY_ASSIGN(IVSIS3LikeHandleHelper)
protected:
std::map<CPLString, CPLString> m_oMapQueryParameters;
std::map<CPLString, CPLString> m_oMapQueryParameters{};
virtual void RebuildURL() = 0;
CPLString GetQueryString(bool bAddEmptyValueAfterEqual) const;
public:
IVSIS3LikeHandleHelper() {}
virtual ~IVSIS3LikeHandleHelper() {}
IVSIS3LikeHandleHelper() = default;
virtual ~IVSIS3LikeHandleHelper() = default;
void ResetQueryParameters();
void AddQueryParameter(const CPLString& osKey, const CPLString& osValue);
@@ -123,17 +125,19 @@ public:
class VSIS3HandleHelper final: public IVSIS3LikeHandleHelper
{
CPLString m_osURL;
CPLString m_osSecretAccessKey;
CPLString m_osAccessKeyId;
CPLString m_osSessionToken;
CPLString m_osEndpoint;
CPLString m_osRegion;
CPLString m_osRequestPayer;
CPLString m_osBucket;
CPLString m_osObjectKey;
bool m_bUseHTTPS;
bool m_bUseVirtualHosting;
CPL_DISALLOW_COPY_ASSIGN(VSIS3HandleHelper)
CPLString m_osURL{};
CPLString m_osSecretAccessKey{};
CPLString m_osAccessKeyId{};
CPLString m_osSessionToken{};
CPLString m_osEndpoint{};
CPLString m_osRegion{};
CPLString m_osRequestPayer{};
CPLString m_osBucket{};
CPLString m_osObjectKey{};
bool m_bUseHTTPS = false;
bool m_bUseVirtualHosting = false;
void RebuildURL() override;
@@ -208,13 +212,12 @@ class VSIS3HandleHelper final: public IVSIS3LikeHandleHelper
class VSIS3UpdateParams
{
public:
CPLString m_osRegion;
CPLString m_osEndpoint;
CPLString m_osRequestPayer;
bool m_bUseVirtualHosting;
CPLString m_osRegion{};
CPLString m_osEndpoint{};
CPLString m_osRequestPayer{};
bool m_bUseVirtualHosting = false;
VSIS3UpdateParams() :
m_bUseVirtualHosting(false) {}
VSIS3UpdateParams() = default;
explicit VSIS3UpdateParams(const VSIS3HandleHelper* poHelper) :
m_osRegion(poHelper->GetRegion()),

View File

@@ -41,6 +41,7 @@ class VSIAzureBlobHandleHelper final: public IVSIS3LikeHandleHelper
{
CPLString m_osURL;
CPLString m_osEndpoint;
CPLString m_osBlobEndpoint;
CPLString m_osBucket;
CPLString m_osObjectKey;
CPLString m_osStorageAccount;
@@ -50,10 +51,12 @@ class VSIAzureBlobHandleHelper final: public IVSIS3LikeHandleHelper
static bool GetConfiguration(CSLConstList papszOptions,
bool& bUseHTTPS,
CPLString& osEndpoint,
CPLString& osBlobEndpoint,
CPLString& osStorageAccount,
CPLString& osStorageKey);
static CPLString BuildURL(const CPLString& osEndpoint,
const CPLString& osBlobEndpoint,
const CPLString& osStorageAccount,
const CPLString& osBucket,
const CPLString& osObjectKey,
@@ -63,6 +66,7 @@ class VSIAzureBlobHandleHelper final: public IVSIS3LikeHandleHelper
public:
VSIAzureBlobHandleHelper(const CPLString& osEndpoint,
const CPLString& osBlobEndpoint,
const CPLString& osBucket,
const CPLString& osObjectKey,
const CPLString& osStorageAccount,

View File

@@ -1,6 +1,5 @@
#ifndef CPL_CONFIG_H
#define CPL_CONFIG_H
/* We define this here in general so that a VC++ build will publicly
declare STDCALL interfaces even if an application is built against it
using MinGW */
@@ -111,9 +110,6 @@
#pragma warning(disable: 4786)
/* #define CPL_DISABLE_DLL */
/* Define to 1, if your compiler supports long long data type */
#define HAVE_LONG_LONG 1
#endif /* CPL_CONFIG_H */

View File

@@ -1,5 +1,5 @@
/******************************************************************************
* $Id: cpl_conv.h dfac92801bd83819cbae2501803e02e06b361a43 2018-04-23 18:07:32 +0200 Martin Landa $
* $Id: cpl_conv.h c39d156816d937c3139360b11786c769aeabd21e 2018-05-05 19:48:08 +0200 Even Rouault $
*
* Project: CPL - Common Portability Library
* Purpose: Convenience functions declarations.
@@ -296,14 +296,11 @@ extern "C++"
{
class CPL_DLL CPLLocaleC
{
CPL_DISALLOW_COPY_ASSIGN(CPLLocaleC)
public:
CPLLocaleC();
~CPLLocaleC();
/* Make it non-copyable */
CPLLocaleC(const CPLLocaleC&) = delete;
CPLLocaleC& operator=(const CPLLocaleC&) = delete;
private:
char *pszOldLocale;
};
@@ -315,14 +312,12 @@ private:
class CPLThreadLocaleCPrivate;
class CPL_DLL CPLThreadLocaleC
{
CPL_DISALLOW_COPY_ASSIGN(CPLThreadLocaleC)
public:
CPLThreadLocaleC();
~CPLThreadLocaleC();
/* Make it non-copyable */
CPLThreadLocaleC(const CPLThreadLocaleC&) = delete;
CPLThreadLocaleC& operator=(const CPLThreadLocaleC&) = delete;
private:
CPLThreadLocaleCPrivate* m_private;
};
@@ -344,15 +339,12 @@ extern "C++"
{
class CPL_DLL CPLConfigOptionSetter
{
CPL_DISALLOW_COPY_ASSIGN(CPLConfigOptionSetter)
public:
CPLConfigOptionSetter(const char* pszKey, const char* pszValue,
bool bSetOnlyIfUndefined);
~CPLConfigOptionSetter();
/* Make it non-copyable */
CPLConfigOptionSetter(const CPLConfigOptionSetter&) = delete;
CPLConfigOptionSetter& operator=(const CPLConfigOptionSetter&) = delete;
private:
char* m_pszKey;
char *m_pszOldValue;

View File

@@ -1,5 +1,5 @@
/**********************************************************************
* $Id: cpl_error.h f5361e0be8e2ae819dde996e6c6aa5985b8fefec 2018-04-02 15:11:21 +0200 Even Rouault $
* $Id: cpl_error.h 340ad0d703534a256ec3de94176c95b0cf20cbd4 2018-10-13 00:33:14 +0200 Even Rouault $
*
* Name: cpl_error.h
* Project: CPL - Common Portability Library
@@ -130,7 +130,9 @@ typedef int CPLErrorNum;
/** AWSInvalidCredentials */
#define CPLE_AWSInvalidCredentials 15
/** AWSSignatureDoesNotMatch */
#define CPLE_AWSSignatureDoesNotMatch 16
#define CPLE_AWSSignatureDoesNotMatch 16
/** VSIE_AWSError */
#define CPLE_AWSError 17
/* 100 - 299 reserved for GDAL */
@@ -177,9 +179,18 @@ void CPL_DLL CPL_STDCALL _CPLAssert( const char *, const char *, int ) CPL_NO_RE
#ifdef DEBUG
/** Assert on an expression. Only enabled in DEBUG mode */
# define CPLAssert(expr) ((expr) ? (void)(0) : _CPLAssert(#expr,__FILE__,__LINE__))
/** Assert on an expression in DEBUG mode. Evaluate it also in non-DEBUG mode (useful to 'consume' a error return variable) */
# define CPLAssertAlwaysEval(expr) CPLAssert(expr)
#else
/** Assert on an expression. Only enabled in DEBUG mode */
# define CPLAssert(expr)
#ifdef __cplusplus
/** Assert on an expression in DEBUG mode. Evaluate it also in non-DEBUG mode (useful to 'consume' a error return variable) */
# define CPLAssertAlwaysEval(expr) CPL_IGNORE_RET_VAL(expr)
#else
/** Assert on an expression in DEBUG mode. Evaluate it also in non-DEBUG mode (useful to 'consume' a error return variable) */
# define CPLAssertAlwaysEval(expr) (void)(expr)
#endif
#endif
CPL_C_END

View File

@@ -43,6 +43,8 @@
class VSIGSHandleHelper final: public IVSIS3LikeHandleHelper
{
CPL_DISALLOW_COPY_ASSIGN(VSIGSHandleHelper)
CPLString m_osURL;
CPLString m_osEndpoint;
CPLString m_osBucketObjectKey;

View File

@@ -1,5 +1,5 @@
/******************************************************************************
* $Id: cpl_http.h 07238f4cbcdc1a56c9db7e8dc3a5727346194074 2018-04-02 14:34:13 +0200 Even Rouault $
* $Id: cpl_http.h 15748d502551e341d73d0e388eb9f2e5209aa902 2018-10-06 19:05:17 +0200 Denis Rykov $
*
* Project: Common Portability Library
* Purpose: Function wrapper for libcurl HTTP access.
@@ -136,9 +136,9 @@ CPL_C_END
#if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
/*! @cond Doxygen_Suppress */
// Not sure if this belong here, used in cpl_http.cpp, cpl_vsil_curl.cpp and frmts/wms/gdalhttp.cpp
void* CPLHTTPSetOptions(void *pcurl, const char * const* papszOptions);
void* CPLHTTPSetOptions(void *pcurl, const char *pszURL, const char * const* papszOptions);
char** CPLHTTPGetOptionsFromEnv();
double CPLHTTPGetNewRetryDelay(int response_code, double dfOldDelay);
double CPLHTTPGetNewRetryDelay(int response_code, double dfOldDelay, const char* pszErrBuf);
void* CPLHTTPIgnoreSigPipe();
void CPLHTTPRestoreSigPipeHandler(void* old_handler);
bool CPLMultiPerformWait(void* hCurlMultiHandle, int& repeats);
@@ -193,22 +193,22 @@ class GOA2Manager
private:
mutable CPLString m_osCurrentBearer;
mutable time_t m_nExpirationTime;
AuthMethod m_eMethod;
mutable CPLString m_osCurrentBearer{};
mutable time_t m_nExpirationTime = 0;
AuthMethod m_eMethod = NONE;
// for ACCESS_TOKEN_FROM_REFRESH
CPLString m_osClientId;
CPLString m_osClientSecret;
CPLString m_osRefreshToken;
CPLString m_osClientId{};
CPLString m_osClientSecret{};
CPLString m_osRefreshToken{};
// for SERVICE_ACCOUNT
CPLString m_osPrivateKey;
CPLString m_osClientEmail;
CPLString m_osScope;
CPLStringList m_aosAdditionalClaims;
CPLString m_osPrivateKey{};
CPLString m_osClientEmail{};
CPLString m_osScope{};
CPLStringList m_aosAdditionalClaims{};
CPLStringList m_aosOptions;
CPLStringList m_aosOptions{};
};

View File

@@ -149,8 +149,8 @@ protected:
/*! @endcond */
private:
JSONObjectH m_poJsonObject;
std::string m_osKey;
JSONObjectH m_poJsonObject = nullptr;
std::string m_osKey{};
};
/**

View File

@@ -39,6 +39,8 @@
class CPL_DLL CPLJSonStreamingParser
{
CPL_DISALLOW_COPY_ASSIGN(CPLJSonStreamingParser)
enum State
{
INIT,
@@ -51,19 +53,25 @@ class CPL_DLL CPLJSonStreamingParser
STATE_NULL
};
bool m_bExceptionOccurred;
bool m_bElementFound;
int m_nLastChar;
int m_nLineCounter;
int m_nCharCounter;
std::vector<State> m_aState;
std::string m_osToken;
std::vector<bool> m_abFirstElement;
bool m_bInStringEscape;
bool m_bInUnicode;
std::string m_osUnicodeHex;
size_t m_nMaxDepth;
size_t m_nMaxStringSize;
bool m_bExceptionOccurred = false;
bool m_bElementFound = false;
int m_nLastChar = 0;
int m_nLineCounter = 1;
int m_nCharCounter = 1;
std::vector<State> m_aState{};
std::string m_osToken{};
enum class ArrayState
{
INIT,
AFTER_COMMA,
AFTER_VALUE
};
std::vector<ArrayState> m_abArrayState{};
bool m_bInStringEscape = false;
bool m_bInUnicode = false;
std::string m_osUnicodeHex{};
size_t m_nMaxDepth = 1024;
size_t m_nMaxStringSize = 10000000;
enum MemberState
{
@@ -72,13 +80,13 @@ class CPL_DLL CPLJSonStreamingParser
KEY_FINISHED,
IN_VALUE
};
std::vector<MemberState> m_aeObjectState;
std::vector<MemberState> m_aeObjectState{};
enum State currentState() { return m_aState.back(); }
void SkipSpace(const char*& pStr, size_t& nLength);
void AdvanceChar(const char*& pStr, size_t& nLength);
bool EmitException(const char* pszMessage);
bool EmitUnexpectedChar(char ch);
bool EmitUnexpectedChar(char ch, const char* pszExpecting = nullptr);
bool StartNewToken(const char*& pStr, size_t& nLength);
bool CheckAndEmitTrueFalseOrNull(char ch);
bool CheckStackEmpty();

View File

@@ -172,6 +172,16 @@ class Cache {
return cache_.find(k) != cache_.end();
}
bool getOldestEntry(Key& kOut, Value& vOut) {
Guard g(lock_);
if( keys_.empty() ) {
return false;
}
kOut = keys_.back().key;
vOut = keys_.back().value;
return true;
}
size_t getMaxSize() const { return maxSize_; }
size_t getElasticity() const { return elasticity_; }
size_t getMaxAllowedSize() const { return maxSize_ + elasticity_; }

View File

@@ -1,4 +1,4 @@
/* $Id: cpl_minizip_ioapi.h 2f03d19efafeda04a990e03e7fb3cf56dd11b213 2016-11-24 06:35:54Z Kurt Schwehr $ */
/* $Id: cpl_minizip_ioapi.h 105d437a91a1a110bdeaba3bab046cd235701173 2018-07-02 12:01:26 +0200 Even Rouault $ */
/* Modified version by Even Rouault. :
- change fill_fopen_filefunc to cpl_fill_fopen_filefunc
@@ -80,6 +80,13 @@ void cpl_fill_fopen_filefunc (zlib_filefunc_def* pzlib_filefunc_def);
#define ZCLOSE(filefunc,filestream) ((*((filefunc).zclose_file))((filefunc).opaque,filestream))
#define ZERROR(filefunc,filestream) ((*((filefunc).zerror_file))((filefunc).opaque,filestream))
#define ZREAD64 ZREAD
#define ZWRITE64 ZWRITE
#define ZTELL64 ZTELL
#define ZSEEK64 ZSEEK
#define ZCLOSE64 ZCLOSE
#define ZERROR64 ZERROR
#ifdef __cplusplus
}
#endif

View File

@@ -1,5 +1,5 @@
/******************************************************************************
* $Id: cpl_minizip_zip.h 44e0c0ecc2e12f7885d8572d0f18dd94e7fbda1c 2016-10-25 02:28:29Z Kurt Schwehr $
* $Id: cpl_minizip_zip.h 105d437a91a1a110bdeaba3bab046cd235701173 2018-07-02 12:01:26 +0200 Even Rouault $
*
* Project: CPL - Common Portability Library
* Author: Frank Warmerdam, warmerdam@pobox.com
@@ -64,6 +64,7 @@
#include "cpl_vsi.h"
#define uLong64 vsi_l_offset
typedef vsi_l_offset ZPOS64_T;
#ifdef __cplusplus
extern "C" {
@@ -234,7 +235,7 @@ extern int ZEXPORT cpl_zipCloseFileInZip (zipFile file);
*/
extern int ZEXPORT cpl_zipCloseFileInZipRaw (zipFile file,
uLong uncompressed_size,
ZPOS64_T uncompressed_size,
uLong crc32);
/*
Close the current file in the zipfile, for file opened with

View File

@@ -1,5 +1,5 @@
/**********************************************************************
* $Id: cpl_multiproc.h b5fb552a68377945dc4bff235f0e1af3728c75c6 2018-03-11 23:57:13Z Even Rouault $
* $Id: cpl_multiproc.h 49f2075cf4be6b103a5ab0b5a64f1ed3e2e7f46b 2018-11-27 21:21:53Z Robert Coup $
*
* Project: CPL - Common Portability Library
* Purpose: CPL Multi-Threading, and process handling portability functions.
@@ -139,22 +139,24 @@ CPL_C_END
class CPL_DLL CPLMutexHolder
{
private:
CPLMutex *hMutex;
CPLMutex *hMutex = nullptr;
// Only used for debugging.
const char *pszFile;
int nLine;
const char *pszFile = nullptr;
int nLine = 0;
CPL_DISALLOW_COPY_ASSIGN(CPLMutexHolder)
public:
/** Instantiates the mutex if not already done. */
CPLMutexHolder( CPLMutex **phMutex, double dfWaitInSeconds = 1000.0,
explicit CPLMutexHolder( CPLMutex **phMutex, double dfWaitInSeconds = 1000.0,
const char *pszFile = __FILE__,
int nLine = __LINE__,
int nOptions = CPL_MUTEX_RECURSIVE);
/** This variant assumes the mutex has already been created. If not, it will
* be a no-op */
CPLMutexHolder( CPLMutex* hMutex, double dfWaitInSeconds = 1000.0,
explicit CPLMutexHolder( CPLMutex* hMutex, double dfWaitInSeconds = 1000.0,
const char *pszFile = __FILE__,
int nLine = __LINE__ );
@@ -172,9 +174,11 @@ class CPL_DLL CPLMutexHolder
class CPL_DLL CPLLockHolder
{
private:
CPLLock *hLock;
const char *pszFile;
int nLine;
CPLLock *hLock = nullptr;
const char *pszFile = nullptr;
int nLine = 0;
CPL_DISALLOW_COPY_ASSIGN(CPLLockHolder)
public:
@@ -185,7 +189,7 @@ class CPL_DLL CPLLockHolder
/** This variant assumes the lock has already been created. If not, it will
* be a no-op */
CPLLockHolder( CPLLock* hSpin,
explicit CPLLockHolder( CPLLock* hSpin,
const char *pszFile = __FILE__,
int nLine = __LINE__ );
@@ -203,7 +207,7 @@ class CPL_DLL CPLLockHolder
#define CTLS_CSVTABLEPTR 3 /* cpl_csv.cpp */
#define CTLS_CSVDEFAULTFILENAME 4 /* cpl_csv.cpp */
#define CTLS_ERRORCONTEXT 5 /* cpl_error.cpp */
#define CTLS_GDALDATASET_REC_PROTECT_MAP 6 /* gdaldataset.cpp */
/* 6: unused */
#define CTLS_PATHBUF 7 /* cpl_path.cpp */
#define CTLS_ABSTRACTARCHIVE_SPLIT 8 /* cpl_vsil_abstract_archive.cpp */
#define CTLS_UNUSED4 9
@@ -214,6 +218,7 @@ class CPL_DLL CPLLockHolder
#define CTLS_CONFIGOPTIONS 14 /* cpl_conv.cpp */
#define CTLS_FINDFILE 15 /* cpl_findfile.cpp */
#define CTLS_VSIERRORCONTEXT 16 /* cpl_vsi_error.cpp */
#define CTLS_ERRORHANDLERACTIVEDATA 17 /* cpl_error.cpp */
#define CTLS_MAX 32

View File

@@ -1,5 +1,5 @@
/******************************************************************************
* $Id: cpl_odbc.h 7e07230bbff24eb333608de4dbd460b7312839d0 2017-12-11 19:08:47Z Even Rouault $
* $Id: cpl_odbc.h 97890c6814b40588defbe147a3189f056d50cf97 2018-05-14 20:12:48 +0200 KovBal $
*
* Project: OGR ODBC Driver
* Purpose: Declarations for ODBC Access Cover API.
@@ -159,11 +159,14 @@ class CPLODBCStatement;
*/
class CPL_DLL CPLODBCSession {
char m_szLastError[SQL_MAX_MESSAGE_LENGTH + 1];
HENV m_hEnv;
HDBC m_hDBC;
int m_bInTransaction;
int m_bAutoCommit;
CPL_DISALLOW_COPY_ASSIGN(CPLODBCSession)
CPLString m_osLastError{};
HENV m_hEnv = nullptr;
HDBC m_hDBC = nullptr;
int m_bInTransaction = false;
int m_bAutoCommit = true;
public:
CPLODBCSession();
@@ -205,26 +208,28 @@ class CPL_DLL CPLODBCSession {
class CPL_DLL CPLODBCStatement {
CPLODBCSession *m_poSession;
HSTMT m_hStmt;
CPL_DISALLOW_COPY_ASSIGN(CPLODBCStatement)
SQLSMALLINT m_nColCount;
char **m_papszColNames;
SQLSMALLINT *m_panColType;
char **m_papszColTypeNames;
CPL_SQLULEN *m_panColSize;
SQLSMALLINT *m_panColPrecision;
SQLSMALLINT *m_panColNullable;
char **m_papszColColumnDef;
CPLODBCSession *m_poSession = nullptr;
HSTMT m_hStmt = nullptr;
char **m_papszColValues;
CPL_SQLLEN *m_panColValueLengths;
SQLSMALLINT m_nColCount = 0;
char **m_papszColNames = nullptr;
SQLSMALLINT *m_panColType = nullptr;
char **m_papszColTypeNames = nullptr;
CPL_SQLULEN *m_panColSize = nullptr;
SQLSMALLINT *m_panColPrecision = nullptr;
SQLSMALLINT *m_panColNullable = nullptr;
char **m_papszColColumnDef = nullptr;
char **m_papszColValues = nullptr;
CPL_SQLLEN *m_panColValueLengths = nullptr;
int Failed( int );
char *m_pszStatement;
size_t m_nStatementMax;
size_t m_nStatementLen;
char *m_pszStatement = nullptr;
size_t m_nStatementMax = 0;
size_t m_nStatementLen = 0;
public:
explicit CPLODBCStatement( CPLODBCSession * );

View File

@@ -1,5 +1,5 @@
/******************************************************************************
* $Id: cpl_port.h 9b81cd476af4dd1a40b1a79f9e3e355114e2cd33 2018-05-08 11:21:07 +0200 Even Rouault $
* $Id: cpl_port.h c55171b249f96a1cfa0e54f83dfa872c722e493c 2018-05-12 13:46:40 -0700 Lucian Plesea $
*
* Project: CPL - Common Portability Library
* Author: Frank Warmerdam, warmerdam@pobox.com
@@ -186,10 +186,12 @@
# if !(__cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1900))
# error Must have C++11 or newer.
# endif
# if __cplusplus >= 201402L
# if __cplusplus >= 201402L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201402L)
# define HAVE_CXX14 1
# endif
/* TODO(schwehr): What is the correct test for C++ 17? */
# if __cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
# define HAVE_CXX17 1
# endif
#endif /* __cplusplus */
/*---------------------------------------------------------------------

View File

@@ -1,5 +1,5 @@
/**********************************************************************
* $Id: cpl_string.h 2a269ed2b136bd254b213f39846587c1eb237662 2018-04-18 23:42:24 +0200 Even Rouault $
* $Id: cpl_string.h e12a0fc61edef91a039e13c7baff2ce58288a552 2018-08-10 00:53:29 +0200 Juergen E. Fischer $
*
* Name: cpl_string.h
* Project: CPL - Common Portability Library
@@ -177,6 +177,8 @@ char CPL_DLL ** CSLParseCommandLine(const char* pszCommandLine);
#define CPLES_XML_BUT_QUOTES 5
/** Scheme for CPLEscapeString()/CPLUnescapeString() for CSV (forced quoting) */
#define CPLES_CSV_FORCE_QUOTING 6
/** Scheme for CPLEscapeString()/CPLUnescapeString() for SQL identifiers */
#define CPLES_SQLI 7
char CPL_DLL *CPLEscapeString( const char *pszString, int nLength,
int nScheme ) CPL_WARN_UNUSED_RESULT;
@@ -304,51 +306,40 @@ extern "C++"
#include <string>
#endif
// VC++ implicitly applies __declspec(dllexport) to template base
// classes of classes marked with __declspec(dllexport).
// Hence, VC++ would export symbols for the specialization of std::basic_string<char>,
// since it is a base class of CPLString, which is marked with CPL_DLL.
// VC++ implicitly applies __declspec(dllexport) to template base classes
// of classes marked with __declspec(dllexport).
// Hence, if marked with CPL_DLL, VC++ would export symbols for the specialization
// of std::basic_string<char>, since it is a base class of CPLString.
// As a result, if an application linked both gdal.dll and a static library that
// (implicitly) instantiates std::string (almost all do!), then the linker would
// emit an error concerning duplicate symbols for std::string.
// The least intrusive solution is to turn CPLString into a template class
// (that is not marked with CPL_DLL), make CPLString a typedef for a specialization
// of that template class, and mark only the few non-inline member functions of
// CPLStringT with CPL_DLL.
// The least intrusive solution is to not mark the whole class with
// __declspec(dllexport) for VC++, but only its non-inline methods.
#ifdef _MSC_VER
# define CPLSTRING_DLL CPL_DLL
template< class Dummy = void > class CPLStringT;
typedef CPLStringT<> CPLString;
template< class Dummy >
class CPLStringT : public std::string
# define CPLSTRING_CLASS_DLL
# define CPLSTRING_METHOD_DLL CPL_DLL
#else
/*! @cond Doxygen_Suppress */
# define CPLSTRING_DLL
# define CPLStringT CPLString
# define CPLSTRING_CLASS_DLL CPL_DLL
# define CPLSTRING_METHOD_DLL
/*! @endcond */
#endif
//! Convenient string class based on std::string.
class CPL_DLL CPLString : public std::string
#endif
class CPLSTRING_CLASS_DLL CPLString : public std::string
{
public:
/** Constructor */
CPLStringT(void) {}
CPLString(void) {}
/** Constructor */
// cppcheck-suppress noExplicitConstructor
CPLStringT( const std::string &oStr ) : std::string( oStr ) {}
CPLString( const std::string &oStr ) : std::string( oStr ) {}
/** Constructor */
// cppcheck-suppress noExplicitConstructor
CPLStringT( const char *pszStr ) : std::string( pszStr ) {}
CPLString( const char *pszStr ) : std::string( pszStr ) {}
/** Constructor */
CPLStringT( const char *pszStr, size_t n ) : std::string( pszStr, n ) {}
CPLString( const char *pszStr, size_t n ) : std::string( pszStr, n ) {}
/** Return string as zero terminated character array */
operator const char* (void) const { return c_str(); }
@@ -398,39 +389,39 @@ public:
/* There seems to be a bug in the way the compiler count indices...
* Should be CPL_PRINT_FUNC_FORMAT (1, 2) */
CPLSTRING_DLL CPLString &Printf(
CPLSTRING_METHOD_DLL CPLString &Printf(
CPL_FORMAT_STRING(const char *pszFormat), ... )
CPL_PRINT_FUNC_FORMAT (2, 3);
CPLSTRING_DLL CPLString &vPrintf(
CPLSTRING_METHOD_DLL CPLString &vPrintf(
CPL_FORMAT_STRING(const char *pszFormat), va_list args )
CPL_PRINT_FUNC_FORMAT(2, 0);
CPLSTRING_DLL CPLString &FormatC( double dfValue, const char *pszFormat = nullptr );
CPLSTRING_DLL CPLString &Trim();
CPLSTRING_DLL CPLString &Recode( const char *pszSrcEncoding, const char *pszDstEncoding );
CPLSTRING_DLL CPLString &replaceAll(
CPLSTRING_METHOD_DLL CPLString &FormatC( double dfValue, const char *pszFormat = nullptr );
CPLSTRING_METHOD_DLL CPLString &Trim();
CPLSTRING_METHOD_DLL CPLString &Recode( const char *pszSrcEncoding, const char *pszDstEncoding );
CPLSTRING_METHOD_DLL CPLString &replaceAll(
const std::string &osBefore, const std::string& osAfter );
CPLSTRING_DLL CPLString &replaceAll( const std::string &osBefore, char chAfter );
CPLSTRING_DLL CPLString &replaceAll( char chBefore, const std::string &osAfter );
CPLSTRING_DLL CPLString &replaceAll( char chBefore, char chAfter );
CPLSTRING_METHOD_DLL CPLString &replaceAll( const std::string &osBefore, char chAfter );
CPLSTRING_METHOD_DLL CPLString &replaceAll( char chBefore, const std::string &osAfter );
CPLSTRING_METHOD_DLL CPLString &replaceAll( char chBefore, char chAfter );
/* case insensitive find alternates */
CPLSTRING_DLL size_t ifind( const std::string & str, size_t pos = 0 ) const;
CPLSTRING_DLL size_t ifind( const char * s, size_t pos = 0 ) const;
CPLSTRING_DLL CPLString &toupper( void );
CPLSTRING_DLL CPLString &tolower( void );
CPLSTRING_METHOD_DLL size_t ifind( const std::string & str, size_t pos = 0 ) const;
CPLSTRING_METHOD_DLL size_t ifind( const char * s, size_t pos = 0 ) const;
CPLSTRING_METHOD_DLL CPLString &toupper( void );
CPLSTRING_METHOD_DLL CPLString &tolower( void );
CPLSTRING_DLL bool endsWith( const std::string& osStr ) const;
CPLSTRING_METHOD_DLL bool endsWith( const std::string& osStr ) const;
};
#ifndef _MSC_VER
# undef CPLStringT
#endif
#undef CPLSTRING_CLASS_DLL
#undef CPLSTRING_METHOD_DLL
CPLString CPL_DLL CPLOPrintf(CPL_FORMAT_STRING(const char *pszFormat), ... )
CPL_PRINT_FUNC_FORMAT (1, 2);
CPLString CPL_DLL CPLOvPrintf(
CPL_FORMAT_STRING(const char *pszFormat), va_list args)
CPL_PRINT_FUNC_FORMAT (1, 0);
CPLString CPL_DLL CPLQuotedSQLIdentifier(const char *pszIdent);
/* -------------------------------------------------------------------- */
/* URL processing functions, here since they depend on CPLString. */
@@ -446,22 +437,20 @@ CPLString CPL_DLL CPLURLAddKVP(const char* pszURL, const char* pszKey,
//! String list class designed around our use of C "char**" string lists.
class CPL_DLL CPLStringList
{
char **papszList;
mutable int nCount;
mutable int nAllocation;
bool bOwnList;
bool bIsSorted;
char **papszList = nullptr;
mutable int nCount = 0;
mutable int nAllocation = 0;
bool bOwnList = false;
bool bIsSorted = false;
void Initialize();
void MakeOurOwnCopy();
void EnsureAllocation( int nMaxLength );
int FindSortedInsertionPoint( const char *pszLine );
public:
CPLStringList();
CPLStringList( char **papszList, int bTakeOwnership=TRUE );
// cppcheck-suppress noExplicitConstructor
CPLStringList( CSLConstList papszList );
explicit CPLStringList( char **papszList, int bTakeOwnership=TRUE );
explicit CPLStringList( CSLConstList papszList );
CPLStringList( const CPLStringList& oOther );
~CPLStringList();

View File

@@ -0,0 +1,52 @@
/******************************************************************************
*
* Name: cpl_userfault.h
* Project: CPL - Common Portability Library
* Purpose: Use userfaultfd and VSIL to service page faults
* Author: James McClain, <james.mcclain@gmail.com>
*
******************************************************************************
* Copyright (c) 2018, Dr. James McClain <james.mcclain@gmail.com>
*
* 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 without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
****************************************************************************/
#ifndef CPL_USERFAULTFD
#define CPL_USERFAULTFD
#include <stdint.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <linux/userfaultfd.h>
#define GDAL_UFFD_LIMIT "GDAL_UFFD_LIMIT"
typedef struct cpl_uffd_context cpl_uffd_context;
bool CPLIsUserFaultMappingSupported();
cpl_uffd_context * CPLCreateUserFaultMapping(const char * pszFilename, void ** ppVma, uint64_t * pnVmaSize);
void CPLDeleteUserFaultMapping(cpl_uffd_context * ctx);
#endif

View File

@@ -1,5 +1,5 @@
/******************************************************************************
* $Id: cpl_vsi.h 07238f4cbcdc1a56c9db7e8dc3a5727346194074 2018-04-02 14:34:13 +0200 Even Rouault $
* $Id: cpl_vsi.h fe66521fc5854bf38bc2eb42326d9a17d2f0f275 2018-12-22 13:46:01 +0100 Juergen E. Fischer $
*
* Project: CPL - Common Portability Library
* Author: Frank Warmerdam, warmerdam@pobox.com
@@ -33,6 +33,7 @@
#define CPL_VSI_H_INCLUDED
#include "cpl_port.h"
#include "cpl_progress.h"
/**
* \file cpl_vsi.h
@@ -301,12 +302,59 @@ GIntBig CPL_DLL CPLGetUsablePhysicalRAM(void);
char CPL_DLL **VSIReadDir( const char * );
char CPL_DLL **VSIReadDirRecursive( const char *pszPath );
char CPL_DLL **VSIReadDirEx( const char *pszPath, int nMaxFiles );
/** Opaque type for a directory iterator */
typedef struct VSIDIR VSIDIR;
VSIDIR CPL_DLL *VSIOpenDir( const char *pszPath,
int nRecurseDepth,
const char* const *papszOptions);
/** Directory entry. */
typedef struct VSIDIREntry
{
/** Filename */
char* pszName;
/** File mode. See VSI_ISREG() / VSI_ISDIR() */
int nMode;
/** File size */
vsi_l_offset nSize;
/** Last modification time (seconds since 1970/01/01) */
GIntBig nMTime;
/** Whether nMode is known: 0 = unknown, 1 = known. */
char bModeKnown;
/** Whether nSize is known: 0 = unknown, 1 = known. */
char bSizeKnown;
/** Whether nMTime is known: 0 = unknown, 1 = known. */
char bMTimeKnown;
/** NULL-terminated list of extra properties. */
char** papszExtra;
#if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
/*! @cond Doxygen_Suppress */
VSIDIREntry();
~VSIDIREntry();
VSIDIREntry(const VSIDIREntry&) = delete;
VSIDIREntry& operator=(VSIDIREntry&) = delete;
/*! @endcond */
#endif
} VSIDIREntry;
const VSIDIREntry CPL_DLL *VSIGetNextDirEntry(VSIDIR* dir);
void CPL_DLL VSICloseDir(VSIDIR* dir);
int CPL_DLL VSIMkdir( const char * pszPathname, long mode );
int CPL_DLL VSIMkdirRecursive( const char * pszPathname, long mode );
int CPL_DLL VSIRmdir( const char * pszDirname );
int CPL_DLL VSIRmdirRecursive( const char * pszDirname );
int CPL_DLL VSIUnlink( const char * pszFilename );
int CPL_DLL VSIRename( const char * oldpath, const char * newpath );
int CPL_DLL VSISync( const char* pszSource, const char* pszTarget,
const char* const * papszOptions,
GDALProgressFunc pProgressFunc,
void *pProgressData,
char*** ppapszOutputs );
char CPL_DLL *VSIStrerror( int );
GIntBig CPL_DLL VSIGetDiskFreeSpace(const char *pszDirname);
@@ -320,6 +368,7 @@ void CPL_DLL VSIInstallLargeFileHandler(void);
void CPL_DLL VSIInstallSubFileHandler(void);
void VSIInstallCurlFileHandler(void);
void CPL_DLL VSICurlClearCache(void);
void CPL_DLL VSICurlPartialClearCache(const char* pszFilenamePrefix);
void VSIInstallCurlStreamingFileHandler(void);
void VSIInstallS3FileHandler(void);
void VSIInstallS3StreamingFileHandler(void);
@@ -334,6 +383,8 @@ void VSIInstallSwiftStreamingFileHandler(void);
void VSIInstallGZipFileHandler(void); /* No reason to export that */
void VSIInstallZipFileHandler(void); /* No reason to export that */
void VSIInstallStdinHandler(void); /* No reason to export that */
void VSIInstallHdfsHandler(void); /* No reason to export that */
void VSIInstallWebHdfsHandler(void); /* No reason to export that */
void VSIInstallStdoutHandler(void); /* No reason to export that */
void CPL_DLL VSIInstallSparseFileHandler(void);
void VSIInstallTarFileHandler(void); /* No reason to export that */

View File

@@ -1,5 +1,5 @@
/******************************************************************************
* $Id: cpl_vsi_virtual.h 07238f4cbcdc1a56c9db7e8dc3a5727346194074 2018-04-02 14:34:13 +0200 Even Rouault $
* $Id: cpl_vsi_virtual.h 7b937306fdeb31f6adefa6675d83ccd60f99e619 2018-11-25 23:10:44 +0100 Even Rouault $
*
* Project: VSI Virtual File System
* Purpose: Declarations for classes related to the virtual filesystem.
@@ -113,6 +113,14 @@ public:
virtual const char* GetActualURL(const char* /*pszFilename*/) { return nullptr; }
virtual const char* GetOptions() { return nullptr; }
virtual char* GetSignedURL(const char* /*pszFilename*/, CSLConstList /* papszOptions */) { return nullptr; }
virtual bool Sync( const char* pszSource, const char* pszTarget,
const char* const * papszOptions,
GDALProgressFunc pProgressFunc,
void *pProgressData,
char*** ppapszOutputs );
virtual VSIDIR* OpenDir( const char *pszPath, int nRecurseDepth,
const char* const *papszOptions);
};
#endif /* #ifndef DOXYGEN_SKIP */
@@ -124,13 +132,15 @@ public:
class CPL_DLL VSIFileManager
{
private:
VSIFilesystemHandler *poDefaultHandler;
std::map<std::string, VSIFilesystemHandler *> oHandlers;
VSIFilesystemHandler *poDefaultHandler = nullptr;
std::map<std::string, VSIFilesystemHandler *> oHandlers{};
VSIFileManager();
static VSIFileManager *Get();
CPL_DISALLOW_COPY_ASSIGN(VSIFileManager)
public:
~VSIFileManager();
@@ -170,12 +180,11 @@ typedef struct
class VSIArchiveContent
{
public:
time_t mTime;
vsi_l_offset nFileSize;
int nEntries;
VSIArchiveEntry* entries;
time_t mTime = 0;
vsi_l_offset nFileSize = 0;
int nEntries = 0;
VSIArchiveEntry* entries = nullptr;
VSIArchiveContent() : mTime(0), nFileSize(0), nEntries(0), entries(nullptr) {}
~VSIArchiveContent();
};
@@ -195,12 +204,14 @@ class VSIArchiveReader
class VSIArchiveFilesystemHandler : public VSIFilesystemHandler
{
CPL_DISALLOW_COPY_ASSIGN(VSIArchiveFilesystemHandler)
protected:
CPLMutex* hMutex;
CPLMutex* hMutex = nullptr;
/* We use a cache that contains the list of files contained in a VSIArchive file as */
/* unarchive.c is quite inefficient in listing them. This speeds up access to VSIArchive files */
/* containing ~1000 files like a CADRG product */
std::map<CPLString,VSIArchiveContent*> oFileList;
std::map<CPLString,VSIArchiveContent*> oFileList{};
virtual const char* GetPrefix() = 0;
virtual std::vector<CPLString> GetExtensions() = 0;
@@ -224,6 +235,22 @@ public:
virtual int FindFileInArchive(const char* archiveFilename, const char* fileInArchiveName, const VSIArchiveEntry** archiveEntry);
};
/************************************************************************/
/* VSIDIR */
/************************************************************************/
struct CPL_DLL VSIDIR
{
VSIDIR() = default;
virtual ~VSIDIR();
virtual const VSIDIREntry* NextDirEntry() = 0;
private:
VSIDIR(const VSIDIR&) = delete;
VSIDIR& operator=(const VSIDIR&) = delete;
};
#endif /* #ifndef DOXYGEN_SKIP */
VSIVirtualHandle CPL_DLL *VSICreateBufferedReaderHandle(VSIVirtualHandle* poBaseHandle);
@@ -231,6 +258,10 @@ VSIVirtualHandle* VSICreateBufferedReaderHandle(VSIVirtualHandle* poBaseHandle,
const GByte* pabyBeginningContent,
vsi_l_offset nCheatFileSize);
VSIVirtualHandle CPL_DLL *VSICreateCachedFile( VSIVirtualHandle* poBaseHandle, size_t nChunkSize = 32768, size_t nCacheSize = 0 );
VSIVirtualHandle CPL_DLL *VSICreateGZipWritable( VSIVirtualHandle* poBaseHandle, int bRegularZLibIn, int bAutoCloseBaseHandle );
const int CPL_DEFLATE_TYPE_GZIP = 0;
const int CPL_DEFLATE_TYPE_ZLIB = 1;
const int CPL_DEFLATE_TYPE_RAW_DEFLATE = 2;
VSIVirtualHandle CPL_DLL *VSICreateGZipWritable( VSIVirtualHandle* poBaseHandle, int nDeflateType, int bAutoCloseBaseHandle );
#endif /* ndef CPL_VSI_VIRTUAL_H_INCLUDED */

View File

@@ -0,0 +1,554 @@
/******************************************************************************
*
* Project: CPL - Common Portability Library
* Purpose: Declarations for /vsicurl/ and related file systems
* Author: Even Rouault, even.rouault at spatialys.com
*
******************************************************************************
* Copyright (c) 2010-2018, Even Rouault <even.rouault at spatialys.com>
*
* 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 without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
****************************************************************************/
#ifndef CPL_VSIL_CURL_CLASS_H_INCLUDED
#define CPL_VSIL_CURL_CLASS_H_INCLUDED
#ifdef HAVE_CURL
#include "cpl_aws.h"
#include "cpl_port.h"
#include "cpl_string.h"
#include "cpl_vsil_curl_priv.h"
#include "cpl_mem_cache.h"
#include <curl/curl.h>
#include <set>
#include <map>
#include <memory>
//! @cond Doxygen_Suppress
// 7.18.1
#if LIBCURL_VERSION_NUM >= 0x071201
#define HAVE_CURLINFO_REDIRECT_URL
#endif
void VSICurlStreamingClearCache( void ); // from cpl_vsil_curl_streaming.cpp
struct curl_slist* VSICurlSetOptions(CURL* hCurlHandle, const char* pszURL,
const char * const* papszOptions);
struct curl_slist* VSICurlMergeHeaders( struct curl_slist* poDest,
struct curl_slist* poSrcToDestroy );
namespace cpl {
typedef enum
{
EXIST_UNKNOWN = -1,
EXIST_NO,
EXIST_YES,
} ExistStatus;
class FileProp
{
public:
ExistStatus eExists = EXIST_UNKNOWN;
vsi_l_offset fileSize = 0;
time_t mTime = 0;
time_t nExpireTimestampLocal = 0;
CPLString osRedirectURL{};
bool bHasComputedFileSize = false;
bool bIsDirectory = false;
bool bS3LikeRedirect = false;
CPLString ETag{};
};
typedef struct
{
bool bGotFileList = false;
CPLStringList oFileList{}; /* only file name without path */
} CachedDirList;
typedef struct
{
char* pBuffer;
size_t nSize;
bool bIsHTTP;
bool bIsInHeader;
bool bMultiRange;
vsi_l_offset nStartOffset;
vsi_l_offset nEndOffset;
int nHTTPCode;
vsi_l_offset nContentLength;
bool bFoundContentRange;
bool bError;
bool bDownloadHeaderOnly;
bool bDetectRangeDownloadingError;
GIntBig nTimestampDate; // Corresponds to Date: header field
VSILFILE *fp;
VSICurlReadCbkFunc pfnReadCbk;
void *pReadCbkUserData;
bool bInterrupted;
} WriteFuncStruct;
/************************************************************************/
/* VSICurlFilesystemHandler */
/************************************************************************/
class VSICurlHandle;
class VSICurlFilesystemHandler : public VSIFilesystemHandler
{
CPL_DISALLOW_COPY_ASSIGN(VSICurlFilesystemHandler)
struct FilenameOffsetPair
{
std::string filename_;
vsi_l_offset offset_;
FilenameOffsetPair(const std::string& filename,
vsi_l_offset offset) :
filename_(filename), offset_(offset) {}
bool operator==(const FilenameOffsetPair& other) const
{
return filename_ == other.filename_ &&
offset_ == other.offset_;
}
};
struct FilenameOffsetPairHasher
{
std::size_t operator()(const FilenameOffsetPair& k) const
{
return std::hash<std::string>()(k.filename_) ^
std::hash<vsi_l_offset>()(k.offset_);
}
};
using RegionCacheType =
lru11::Cache<FilenameOffsetPair, std::shared_ptr<std::string>,
lru11::NullLock,
std::unordered_map<
FilenameOffsetPair,
typename std::list<lru11::KeyValuePair<FilenameOffsetPair,
std::shared_ptr<std::string>>>::iterator,
FilenameOffsetPairHasher>>;
RegionCacheType oRegionCache;
lru11::Cache<std::string, FileProp> oCacheFileProp;
int nCachedFilesInDirList = 0;
lru11::Cache<std::string, CachedDirList> oCacheDirList;
char** ParseHTMLFileList(const char* pszFilename,
int nMaxFiles,
char* pszData,
bool* pbGotFileList);
protected:
CPLMutex *hMutex = nullptr;
virtual VSICurlHandle* CreateFileHandle(const char* pszFilename);
virtual char** GetFileList(const char *pszFilename,
int nMaxFiles,
bool* pbGotFileList);
void RegisterEmptyDir( const CPLString& osDirname );
bool AnalyseS3FileList( const CPLString& osBaseURL,
const char* pszXML,
CPLStringList& osFileList,
int nMaxFiles,
bool bIgnoreGlacierStorageClass,
bool& bIsTruncated );
void AnalyseSwiftFileList( const CPLString& osBaseURL,
const CPLString& osPrefix,
const char* pszJson,
CPLStringList& osFileList,
int nMaxFilesThisQuery,
int nMaxFiles,
bool& bIsTruncated,
CPLString& osNextMarker );
static const char* GetOptionsStatic();
static bool IsAllowedFilename( const char* pszFilename );
public:
VSICurlFilesystemHandler();
~VSICurlFilesystemHandler() override;
VSIVirtualHandle *Open( const char *pszFilename,
const char *pszAccess,
bool bSetError ) override;
int Stat( const char *pszFilename, VSIStatBufL *pStatBuf,
int nFlags ) override;
int Unlink( const char *pszFilename ) override;
int Rename( const char *oldpath, const char *newpath ) override;
int Mkdir( const char *pszDirname, long nMode ) override;
int Rmdir( const char *pszDirname ) override;
char **ReadDir( const char *pszDirname ) override
{ return ReadDirEx(pszDirname, 0); }
char **ReadDirEx( const char *pszDirname, int nMaxFiles ) override;
int HasOptimizedReadMultiRange( const char* /* pszPath */ )
override { return true; }
const char* GetActualURL(const char* pszFilename) override;
const char* GetOptions() override;
char **ReadDirInternal( const char *pszDirname, int nMaxFiles,
bool* pbGotFileList );
void InvalidateDirContent( const char *pszDirname );
virtual CPLString GetFSPrefix() { return "/vsicurl/"; }
virtual bool AllowCachedDataFor(const char* pszFilename);
std::shared_ptr<std::string> GetRegion( const char* pszURL,
vsi_l_offset nFileOffsetStart );
void AddRegion( const char* pszURL,
vsi_l_offset nFileOffsetStart,
size_t nSize,
const char *pData );
bool GetCachedFileProp( const char* pszURL,
FileProp& oFileProp );
void SetCachedFileProp( const char* pszURL,
const FileProp& oFileProp );
void InvalidateCachedData( const char* pszURL );
CURLM *GetCurlMultiHandleFor( const CPLString& osURL );
virtual void ClearCache();
virtual void PartialClearCache(const char* pszFilename);
bool GetCachedDirList( const char* pszURL,
CachedDirList& oCachedDirList );
void SetCachedDirList( const char* pszURL,
const CachedDirList& oCachedDirList );
bool ExistsInCacheDirList( const CPLString& osDirname, bool *pbIsDir );
virtual CPLString GetURLFromFilename( const CPLString& osFilename );
};
/************************************************************************/
/* VSICurlHandle */
/************************************************************************/
class VSICurlHandle : public VSIVirtualHandle
{
CPL_DISALLOW_COPY_ASSIGN(VSICurlHandle)
protected:
VSICurlFilesystemHandler* poFS = nullptr;
bool m_bCached = true;
FileProp oFileProp{};
CPLString m_osFilename{}; // e.g "/vsicurl/http://example.com/foo"
char* m_pszURL = nullptr; // e.g "http://example.com/foo"
char **m_papszHTTPOptions = nullptr;
vsi_l_offset lastDownloadedOffset = VSI_L_OFFSET_MAX;
int nBlocksToDownload = 1;
bool bStopOnInterruptUntilUninstall = false;
bool bInterrupted = false;
VSICurlReadCbkFunc pfnReadCbk = nullptr;
void *pReadCbkUserData = nullptr;
int m_nMaxRetry = 0;
double m_dfRetryDelay = 0.0;
void DownloadRegionPostProcess( const vsi_l_offset startOffset,
const int nBlocks,
const char* pBuffer,
size_t nSize );
private:
vsi_l_offset curOffset = 0;
bool bEOF = false;
virtual bool DownloadRegion(vsi_l_offset startOffset, int nBlocks);
bool m_bUseHead = false;
int ReadMultiRangeSingleGet( int nRanges, void ** ppData,
const vsi_l_offset* panOffsets,
const size_t* panSizes );
CPLString GetRedirectURLIfValid(bool& bHasExpired);
protected:
virtual struct curl_slist* GetCurlHeaders( const CPLString& /*osVerb*/,
const struct curl_slist* /* psExistingHeaders */)
{ return nullptr; }
virtual bool AllowAutomaticRedirection() { return true; }
virtual bool CanRestartOnError( const char*, const char*, bool ) { return false; }
virtual bool UseLimitRangeGetInsteadOfHead() { return false; }
virtual bool IsDirectoryFromExists( const char* /*pszVerb*/, int /*response_code*/ ) { return false; }
virtual void ProcessGetFileSizeResult(const char* /* pszContent */ ) {}
void SetURL(const char* pszURL);
public:
VSICurlHandle( VSICurlFilesystemHandler* poFS,
const char* pszFilename,
const char* pszURLIn = nullptr );
~VSICurlHandle() override;
int Seek( vsi_l_offset nOffset, int nWhence ) override;
vsi_l_offset Tell() override;
size_t Read( void *pBuffer, size_t nSize, size_t nMemb ) override;
int ReadMultiRange( int nRanges, void ** ppData,
const vsi_l_offset* panOffsets,
const size_t* panSizes ) override;
size_t Write( const void *pBuffer, size_t nSize, size_t nMemb ) override;
int Eof() override;
int Flush() override;
int Close() override;
bool IsKnownFileSize() const { return oFileProp.bHasComputedFileSize; }
vsi_l_offset GetFileSize() { return GetFileSize(false); }
virtual vsi_l_offset GetFileSize( bool bSetError );
bool Exists( bool bSetError );
bool IsDirectory() const { return oFileProp.bIsDirectory; }
time_t GetMTime() const { return oFileProp.mTime; }
int InstallReadCbk( VSICurlReadCbkFunc pfnReadCbk,
void* pfnUserData,
int bStopOnInterruptUntilUninstall );
int UninstallReadCbk();
const char *GetURL() const { return m_pszURL; }
};
/************************************************************************/
/* IVSIS3LikeFSHandler */
/************************************************************************/
class IVSIS3LikeFSHandler: public VSICurlFilesystemHandler
{
CPL_DISALLOW_COPY_ASSIGN(IVSIS3LikeFSHandler)
protected:
char** GetFileList( const char *pszFilename,
int nMaxFiles,
bool* pbGotFileList ) override;
virtual IVSIS3LikeHandleHelper* CreateHandleHelper(
const char* pszURI, bool bAllowNoObject) = 0;
IVSIS3LikeFSHandler() = default;
public:
int Unlink( const char *pszFilename ) override;
int Mkdir( const char *pszDirname, long nMode ) override;
int Rmdir( const char *pszDirname ) override;
int Stat( const char *pszFilename, VSIStatBufL *pStatBuf,
int nFlags ) override;
virtual int DeleteObject( const char *pszFilename );
virtual const char* GetDebugKey() const = 0;
virtual void UpdateMapFromHandle(IVSIS3LikeHandleHelper*) {}
virtual void UpdateHandleFromMap( IVSIS3LikeHandleHelper * ) {}
bool Sync( const char* pszSource, const char* pszTarget,
const char* const * papszOptions,
GDALProgressFunc pProgressFunc,
void *pProgressData,
char*** ppapszOutputs ) override;
VSIDIR* OpenDir( const char *pszPath, int nRecurseDepth,
const char* const *papszOptions) override;
};
/************************************************************************/
/* IVSIS3LikeHandle */
/************************************************************************/
class IVSIS3LikeHandle: public VSICurlHandle
{
CPL_DISALLOW_COPY_ASSIGN(IVSIS3LikeHandle)
protected:
bool UseLimitRangeGetInsteadOfHead() override { return true; }
bool IsDirectoryFromExists( const char* pszVerb,
int response_code ) override
{
// A bit dirty, but on S3, a GET on a existing directory returns a 416
return response_code == 416 && EQUAL(pszVerb, "GET") &&
CPLString(m_pszURL).back() == '/';
}
void ProcessGetFileSizeResult( const char* pszContent ) override
{
oFileProp.bIsDirectory = strstr(pszContent, "ListBucketResult") != nullptr;
}
public:
IVSIS3LikeHandle( VSICurlFilesystemHandler* poFSIn,
const char* pszFilename,
const char* pszURLIn = nullptr ) :
VSICurlHandle(poFSIn, pszFilename, pszURLIn) {}
~IVSIS3LikeHandle() override {}
};
/************************************************************************/
/* VSIS3WriteHandle */
/************************************************************************/
class VSIS3WriteHandle final : public VSIVirtualHandle
{
CPL_DISALLOW_COPY_ASSIGN(VSIS3WriteHandle)
IVSIS3LikeFSHandler *m_poFS = nullptr;
CPLString m_osFilename{};
IVSIS3LikeHandleHelper *m_poS3HandleHelper = nullptr;
bool m_bUseChunked = false;
vsi_l_offset m_nCurOffset = 0;
int m_nBufferOff = 0;
int m_nBufferSize = 0;
int m_nBufferOffReadCallback = 0;
bool m_bClosed = false;
GByte *m_pabyBuffer = nullptr;
CPLString m_osUploadID{};
int m_nPartNumber = 0;
std::vector<CPLString> m_aosEtags{};
CPLString m_osXML{};
int m_nOffsetInXML = 0;
bool m_bError = false;
CURLM *m_hCurlMulti = nullptr;
CURL *m_hCurl = nullptr;
const void *m_pBuffer = nullptr;
CPLString m_osCurlErrBuf{};
size_t m_nChunkedBufferOff = 0;
size_t m_nChunkedBufferSize = 0;
static size_t ReadCallBackBuffer( char *buffer, size_t size,
size_t nitems, void *instream );
bool InitiateMultipartUpload();
bool UploadPart();
static size_t ReadCallBackXML( char *buffer, size_t size,
size_t nitems, void *instream );
bool CompleteMultipart();
bool AbortMultipart();
bool DoSinglePartPUT();
static size_t ReadCallBackBufferChunked( char *buffer, size_t size,
size_t nitems, void *instream );
size_t WriteChunked( const void *pBuffer,
size_t nSize, size_t nMemb );
int FinishChunkedTransfer();
void InvalidateParentDirectory();
public:
VSIS3WriteHandle( IVSIS3LikeFSHandler* poFS,
const char* pszFilename,
IVSIS3LikeHandleHelper* poS3HandleHelper,
bool bUseChunked );
~VSIS3WriteHandle() override;
int Seek( vsi_l_offset nOffset, int nWhence ) override;
vsi_l_offset Tell() override;
size_t Read( void *pBuffer, size_t nSize, size_t nMemb ) override;
size_t Write( const void *pBuffer, size_t nSize, size_t nMemb ) override;
int Eof() override;
int Close() override;
bool IsOK() { return m_bUseChunked || m_pabyBuffer != nullptr; }
};
/************************************************************************/
/* VSIAppendWriteHandle */
/************************************************************************/
class VSIAppendWriteHandle : public VSIVirtualHandle
{
CPL_DISALLOW_COPY_ASSIGN(VSIAppendWriteHandle)
protected:
VSICurlFilesystemHandler* m_poFS = nullptr;
CPLString m_osFSPrefix{};
CPLString m_osFilename{};
vsi_l_offset m_nCurOffset = 0;
int m_nBufferOff = 0;
int m_nBufferSize = 0;
int m_nBufferOffReadCallback = 0;
bool m_bClosed = false;
GByte *m_pabyBuffer = nullptr;
bool m_bError = false;
static size_t ReadCallBackBuffer( char *buffer, size_t size,
size_t nitems, void *instream );
virtual bool Send(bool bIsLastBlock) = 0;
public:
VSIAppendWriteHandle( VSICurlFilesystemHandler* poFS,
const char* pszFSPrefix,
const char* pszFilename,
int nChunkSize );
virtual ~VSIAppendWriteHandle();
int Seek( vsi_l_offset nOffset, int nWhence ) override;
vsi_l_offset Tell() override;
size_t Read( void *pBuffer, size_t nSize, size_t nMemb ) override;
size_t Write( const void *pBuffer, size_t nSize, size_t nMemb ) override;
int Eof() override;
int Close() override;
bool IsOK() { return m_pabyBuffer != nullptr; }
};
int VSICURLGetDownloadChunkSize();
void VSICURLInitWriteFuncStruct( WriteFuncStruct *psStruct,
VSILFILE *fp,
VSICurlReadCbkFunc pfnReadCbk,
void *pReadCbkUserData );
size_t VSICurlHandleWriteFunc( void *buffer, size_t count,
size_t nmemb, void *req );
void MultiPerform(CURLM* hCurlMultiHandle,
CURL* hEasyHandle = nullptr);
void VSICURLResetHeaderAndWriterFunctions(CURL* hCurlHandle);
} // namespace cpl
//! @endcond
#endif // HAVE_CURL
#endif // CPL_VSIL_CURL_CLASS_H_INCLUDED

View File

@@ -1,5 +1,5 @@
/**********************************************************************
* $Id: cpl_worker_thread_pool.h 9ff327806cd64df6d73a6c91f92d12ca0c5e07df 2018-04-07 20:25:06 +0200 Even Rouault $
* $Id: cpl_worker_thread_pool.h 9b93d5aaef0e512d52da849390cb72856db540b6 2018-07-01 22:10:36 +0200 Even Rouault $
*
* Project: CPL - Common Portability Library
* Purpose: CPL worker thread pool
@@ -74,15 +74,17 @@ typedef enum
/** Pool of worker threads */
class CPL_DLL CPLWorkerThreadPool
{
std::vector<CPLWorkerThread> aWT;
CPLCond* hCond;
CPLMutex* hMutex;
volatile CPLWorkerThreadState eState;
CPLList* psJobQueue;
volatile int nPendingJobs;
CPL_DISALLOW_COPY_ASSIGN(CPLWorkerThreadPool)
CPLList* psWaitingWorkerThreadsList;
int nWaitingWorkerThreads;
std::vector<CPLWorkerThread> aWT{};
CPLCond* hCond = nullptr;
CPLMutex* hMutex = nullptr;
volatile CPLWorkerThreadState eState = CPLWTS_OK;
CPLList* psJobQueue = nullptr;
volatile int nPendingJobs = 0;
CPLList* psWaitingWorkerThreadsList = nullptr;
int nWaitingWorkerThreads = 0;
static void WorkerThreadFunction(void* user_data);
@@ -96,9 +98,14 @@ class CPL_DLL CPLWorkerThreadPool
bool Setup(int nThreads,
CPLThreadFunc pfnInitFunc,
void** pasInitData);
bool Setup(int nThreads,
CPLThreadFunc pfnInitFunc,
void** pasInitData,
bool bWaitallStarted);
bool SubmitJob(CPLThreadFunc pfnFunc, void* pData);
bool SubmitJobs(CPLThreadFunc pfnFunc, const std::vector<void*>& apData);
void WaitCompletion(int nMaxRemainingJobs = 0);
void WaitEvent();
/** Return the number of threads setup */
int GetThreadCount() const { return static_cast<int>(aWT.size()); }

View File

@@ -1,5 +1,5 @@
/******************************************************************************
* $Id: cplkeywordparser.h 21e39584409342c2c70c6635a2b0329113de8975 2018-01-06 16:34:40Z Even Rouault $
* $Id: cplkeywordparser.h c39d156816d937c3139360b11786c769aeabd21e 2018-05-05 19:48:08 +0200 Even Rouault $
*
* Project: Common Portability Library
* Purpose: Implementation of CPLKeywordParser - a class for parsing
@@ -45,16 +45,18 @@
class CPLKeywordParser
{
char **papszKeywordList;
char **papszKeywordList = nullptr;
CPLString osHeaderText;
const char *pszHeaderNext;
CPLString osHeaderText{};
const char *pszHeaderNext = nullptr;
void SkipWhite();
bool ReadWord( CPLString &osWord );
bool ReadPair( CPLString &osName, CPLString &osValue );
bool ReadGroup( const char *pszPathPrefix, int nRecLevel );
CPL_DISALLOW_COPY_ASSIGN(CPLKeywordParser)
public:
CPLKeywordParser();
~CPLKeywordParser();

View File

@@ -1,5 +1,5 @@
/******************************************************************************
* $Id: gdal.h 2a145ae8e090b07cdddea4397fd43a26d2a78591 2018-05-07 20:12:57 +0200 Even Rouault $
* $Id: gdal.h 2519a7eb0e1649dbf8625ae8ffc7bb7c3ef9514b 2018-07-10 12:05:23 +0100 Robert Coup $
*
* Project: GDAL Core
* Purpose: GDAL Core C/Public declarations.
@@ -225,7 +225,7 @@ const char CPL_DLL *GDALGetPaletteInterpretationName( GDALPaletteInterp );
/* "well known" metadata items. */
/** Metadata item for dataset that indicates the spatial interpreation of a
/** Metadata item for dataset that indicates the spatial interpretation of a
* pixel */
#define GDALMD_AREA_OR_POINT "AREA_OR_POINT"
/** Value for GDALMD_AREA_OR_POINT that indicates that a pixel represents an
@@ -1102,8 +1102,17 @@ typedef enum {
/*! Maximum GFU value (equals to GFU_AlphaMax+1 currently) */ GFU_MaxCount
} GDALRATFieldUsage;
/** RAT table type (thematic or athematic)
* @since GDAL 2.4
*/
typedef enum {
/*! Thematic table type */ GRTT_THEMATIC,
/*! Athematic table type */ GRTT_ATHEMATIC
} GDALRATTableType;
GDALRasterAttributeTableH CPL_DLL CPL_STDCALL
GDALCreateRasterAttributeTable(void) CPL_WARN_UNUSED_RESULT;
void CPL_DLL CPL_STDCALL GDALDestroyRasterAttributeTable(
GDALRasterAttributeTableH );
@@ -1153,19 +1162,23 @@ CPLErr CPL_DLL CPL_STDCALL GDALRATSetLinearBinning( GDALRasterAttributeTableH,
double, double );
int CPL_DLL CPL_STDCALL GDALRATGetLinearBinning( GDALRasterAttributeTableH,
double *, double * );
CPLErr CPL_DLL CPL_STDCALL GDALRATSetTableType( GDALRasterAttributeTableH hRAT,
const GDALRATTableType eInTableType );
GDALRATTableType CPL_DLL CPL_STDCALL GDALRATGetTableType( GDALRasterAttributeTableH hRAT);
CPLErr CPL_DLL CPL_STDCALL GDALRATInitializeFromColorTable(
GDALRasterAttributeTableH, GDALColorTableH );
GDALColorTableH CPL_DLL CPL_STDCALL GDALRATTranslateToColorTable(
GDALRasterAttributeTableH, int nEntryCount );
void CPL_DLL CPL_STDCALL GDALRATDumpReadable( GDALRasterAttributeTableH,
FILE * );
GDALRasterAttributeTableH CPL_DLL CPL_STDCALL
GDALRATClone( GDALRasterAttributeTableH );
GDALRasterAttributeTableH CPL_DLL CPL_STDCALL
GDALRATClone( const GDALRasterAttributeTableH );
void CPL_DLL* CPL_STDCALL
GDALRATSerializeJSON( GDALRasterAttributeTableH ) CPL_WARN_UNUSED_RESULT;
int CPL_DLL CPL_STDCALL GDALRATGetRowOfValue( GDALRasterAttributeTableH, double );
void CPL_DLL CPL_STDCALL GDALRATRemoveStatistics( GDALRasterAttributeTableH );
/* ==================================================================== */
/* GDAL Cache Management */

View File

@@ -1,5 +1,5 @@
/******************************************************************************
* $Id: gdal_alg.h ecc4064ad058e92440d85c2a83501cc45579c06c 2017-07-24 19:24:22Z Even Rouault $
* $Id: gdal_alg.h b9ddc19f9ccd776cac9388f260aebc24439f10aa 2018-10-09 11:45:33 +0200 Julien Cabieces $
*
* Project: GDAL Image Processing Algorithms
* Purpose: Prototypes, and definitions for various GDAL based algorithms.
@@ -306,6 +306,8 @@ typedef struct
double adfGeoTransform[6];
int nElevField;
int nElevFieldMin;
int nElevFieldMax;
int nIDField;
int nNextID;
} OGRContourWriterInfo;
@@ -316,11 +318,16 @@ OGRContourWriter( double, int, double *, double *, void *pInfo );
CPLErr CPL_DLL
GDALContourGenerate( GDALRasterBandH hBand,
double dfContourInterval, double dfContourBase,
int nFixedLevelCount, double *padfFixedLevels,
int bUseNoData, double dfNoDataValue,
void *hLayer, int iIDField, int iElevField,
GDALProgressFunc pfnProgress, void *pProgressArg );
double dfContourInterval, double dfContourBase,
int nFixedLevelCount, double *padfFixedLevels,
int bUseNoData, double dfNoDataValue,
void *hLayer, int iIDField, int iElevField,
GDALProgressFunc pfnProgress, void *pProgressArg );
CPLErr CPL_DLL
GDALContourGenerateEx( GDALRasterBandH hBand, void *hLayer,
CSLConstList options,
GDALProgressFunc pfnProgress, void *pProgressArg );
/************************************************************************/
/* Rasterizer API - geometries burned into GDAL raster. */

View File

@@ -1,5 +1,5 @@
/******************************************************************************
* $Id: gdal_alg_priv.h e13dcd4dc171dfeed63f912ba06b9374ce4f3bb2 2018-03-18 21:37:41Z Even Rouault $
* $Id: gdal_alg_priv.h fe2d81c8819bf9794bce0210098e637565728350 2018-05-06 00:49:51 +0200 Even Rouault $
*
* Project: GDAL Image Processing Algorithms
* Purpose: Prototypes and definitions for various GDAL based algorithms:
@@ -112,15 +112,17 @@ private:
void MergePolygon( int nSrcId, int nDstId );
int NewPolygon( DataType nValue );
CPL_DISALLOW_COPY_ASSIGN(GDALRasterPolygonEnumeratorT)
public: // these are intended to be readonly.
GInt32 *panPolyIdMap;
DataType *panPolyValue;
GInt32 *panPolyIdMap = nullptr;
DataType *panPolyValue = nullptr;
int nNextPolygonId;
int nPolyAlloc;
int nNextPolygonId = 0;
int nPolyAlloc = 0;
int nConnectedness;
int nConnectedness = 0;
public:
explicit GDALRasterPolygonEnumeratorT( int nConnectedness=4 );

View File

@@ -1,5 +1,5 @@
/******************************************************************************
* $Id: gdal_frmts.h cc3abf4797c390d97322b20caac26099104f0b58 2017-12-21 13:19:20Z Even Rouault $
* $Id: gdal_frmts.h 91d70b77cc330670d972f2317dbdf3a5b424f845 2018-10-15 00:43:04 +0200 Even Rouault $
*
* Project: GDAL
* Purpose: Prototypes for all format specific driver initialization.
@@ -157,6 +157,7 @@ void CPL_DLL GDALRegister_KMLSUPEROVERLAY(void);
void CPL_DLL GDALRegister_GTX(void);
void CPL_DLL GDALRegister_LOSLAS(void);
void CPL_DLL GDALRegister_Istar(void);
void CPL_DLL GDALRegister_NTv1(void);
void CPL_DLL GDALRegister_NTv2(void);
void CPL_DLL GDALRegister_CTable2(void);
void CPL_DLL GDALRegister_JP2OpenJPEG(void);
@@ -192,6 +193,11 @@ void CPL_DLL GDALRegister_JP2Lura(void);
void CPL_DLL GDALRegister_PRF(void);
void CPL_DLL GDALRegister_NULL(void);
void CPL_DLL GDALRegister_RDA(void);
void CPL_DLL GDALRegister_EEDAI(void);
void CPL_DLL GDALRegister_EEDA(void);
void CPL_DLL GDALRegister_SIGDEM(void);
void CPL_DLL GDALRegister_BYN(void);
void CPL_DLL GDALRegister_IGNFHeightASCIIGrid(void);
CPL_C_END
#endif /* ndef GDAL_FRMTS_H_INCLUDED */

View File

@@ -1,5 +1,5 @@
/******************************************************************************
* $Id: gdal_mdreader.h 7cbc4992fe78542e3ade2da352b283218f4a5ffb 2017-12-19 16:39:24Z Even Rouault $
* $Id: gdal_mdreader.h e37e476c4cf8f4b0df8995e0d95d5d672fca1a9b 2018-05-05 16:54:18 +0200 Even Rouault $
*
* Project: GDAL Core
* Purpose: Read metadata (mainly the remote sensing imagery) from files of
@@ -97,6 +97,9 @@ typedef enum {
* The base class for all metadata readers
*/
class GDALMDReaderBase{
CPL_DISALLOW_COPY_ASSIGN(GDALMDReaderBase)
public:
GDALMDReaderBase(const char *pszPath, char **papszSiblingFiles);
virtual ~GDALMDReaderBase();
@@ -161,11 +164,11 @@ protected:
const char *pszValue);
protected:
//! @cond Doxygen_Suppress
char **m_papszIMDMD;
char **m_papszRPCMD;
char **m_papszIMAGERYMD;
char **m_papszDEFAULTMD;
bool m_bIsMetadataLoad;
char **m_papszIMDMD = nullptr;
char **m_papszRPCMD = nullptr;
char **m_papszIMAGERYMD = nullptr;
char **m_papszDEFAULTMD = nullptr;
bool m_bIsMetadataLoad = false;
//! @endcond
};
@@ -175,6 +178,9 @@ protected:
* for provided path.
*/
class CPL_DLL GDALMDReaderManager{
CPL_DISALLOW_COPY_ASSIGN(GDALMDReaderManager)
public:
GDALMDReaderManager();
virtual ~GDALMDReaderManager();
@@ -194,7 +200,7 @@ public:
GUInt32 nType = MDR_ANY);
protected:
//! @cond Doxygen_Suppress
GDALMDReaderBase *m_pReader;
GDALMDReaderBase *m_pReader = nullptr;
//! @endcond
};

View File

@@ -1,5 +1,5 @@
/******************************************************************************
* $Id: gdal_pam.h 773b7550bb86d46bc587f547f5db549566665834 2017-12-18 04:05:13Z Kurt Schwehr $
* $Id: gdal_pam.h e37e476c4cf8f4b0df8995e0d95d5d672fca1a9b 2018-05-05 16:54:18 +0200 Even Rouault $
*
* Project: GDAL Core
* Purpose: Declaration for Peristable Auxiliary Metadata classes.
@@ -87,22 +87,22 @@ class GDALPamRasterBand;
class GDALDatasetPamInfo
{
public:
char *pszPamFilename;
char *pszPamFilename = nullptr;
char *pszProjection;
char *pszProjection = nullptr;
int bHaveGeoTransform;
double adfGeoTransform[6];
int bHaveGeoTransform = false;
double adfGeoTransform[6]{0,0,0,0,0,0};
int nGCPCount;
GDAL_GCP *pasGCPList;
char *pszGCPProjection;
int nGCPCount = 0;
GDAL_GCP *pasGCPList = nullptr;
char *pszGCPProjection = nullptr;
CPLString osPhysicalFilename;
CPLString osSubdatasetName;
CPLString osAuxFilename;
CPLString osPhysicalFilename{};
CPLString osSubdatasetName{};
CPLString osAuxFilename{};
int bHasMetadata;
int bHasMetadata = false;
};
//! @endcond
@@ -122,8 +122,8 @@ class CPL_DLL GDALPamDataset : public GDALDataset
GDALPamDataset(void);
//! @cond Doxygen_Suppress
int nPamFlags;
GDALDatasetPamInfo *psPam;
int nPamFlags = 0;
GDALDatasetPamInfo *psPam = nullptr;
virtual CPLXMLNode *SerializeToXML( const char *);
virtual CPLErr XMLInit( CPLXMLNode *, const char * );
@@ -249,7 +249,7 @@ class CPL_DLL GDALPamRasterBand : public GDALRasterBand
void PamInitialize();
void PamClear();
GDALRasterBandPamInfo *psPam;
GDALRasterBandPamInfo *psPam = nullptr;
//! @endcond
public:

View File

@@ -1,5 +1,5 @@
/******************************************************************************
* $Id: gdal_priv.h 12e52bca5d2ef4d60eac422db198aefa9577be63 2018-07-14 19:04:33 +0200 Even Rouault $
* $Id: gdal_priv.h e5e7b313540f0ff913fadfe6a273fb7c356a22cb 2018-11-02 22:54:20 +0100 Even Rouault $
*
* Name: gdal_priv.h
* Project: GDAL Core
@@ -134,8 +134,8 @@ class CPL_DLL GDALMajorObject
protected:
//! @cond Doxygen_Suppress
int nFlags; // GMO_* flags.
CPLString sDescription;
GDALMultiDomainMetadata oMDMD;
CPLString sDescription{};
GDALMultiDomainMetadata oMDMD{};
//! @endcond
@@ -187,7 +187,7 @@ class CPL_DLL GDALDefaultOverviews
GDALDataset *poDS;
GDALDataset *poODS;
CPLString osOvrFilename;
CPLString osOvrFilename{};
bool bOvrIsAux;
@@ -323,10 +323,6 @@ class swq_select_parse_options;
typedef struct GDALSQLParseInfo GDALSQLParseInfo;
//! @endcond
#ifdef DETECT_OLD_IRASTERIO
typedef void signature_changed;
#endif
//! @cond Doxygen_Suppress
#ifdef GDAL_COMPILATION
#define OPTIONAL_OUTSIDE_GDAL(val)
@@ -352,26 +348,24 @@ class CPL_DLL GDALDataset : public GDALMajorObject
void AddToDatasetOpenList();
void Init( bool bForceCachedIO );
protected:
//! @cond Doxygen_Suppress
GDALDriver *poDriver;
GDALAccess eAccess;
GDALDriver *poDriver = nullptr;
GDALAccess eAccess = GA_ReadOnly;
// Stored raster information.
int nRasterXSize;
int nRasterYSize;
int nBands;
GDALRasterBand **papoBands;
int nRasterXSize = 512;
int nRasterYSize = 512;
int nBands = 0;
GDALRasterBand **papoBands = nullptr;
int nOpenFlags;
int nOpenFlags = 0;
int nRefCount;
bool bForceCachedIO;
bool bShared;
bool bIsInternal;
bool bSuppressOnClose;
int nRefCount = 1;
bool bForceCachedIO = false;
bool bShared = false;
bool bIsInternal = true;
bool bSuppressOnClose = false;
GDALDataset(void);
explicit GDALDataset(int bForceCachedIO);
@@ -379,17 +373,11 @@ class CPL_DLL GDALDataset : public GDALMajorObject
void RasterInitialize( int, int );
void SetBand( int, GDALRasterBand * );
GDALDefaultOverviews oOvManager;
GDALDefaultOverviews oOvManager{};
virtual CPLErr IBuildOverviews( const char *, int, int *,
int, int *, GDALProgressFunc, void * );
#ifdef DETECT_OLD_IRASTERIO
virtual signature_changed IRasterIO( GDALRWFlag, int, int, int, int,
void *, int, int, GDALDataType,
int, int *, int, int, int ) {};
#endif
virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
void *, int, int, GDALDataType,
int, int *, GSpacing, GSpacing, GSpacing,
@@ -441,7 +429,7 @@ class CPL_DLL GDALDataset : public GDALMajorObject
//! @cond Doxygen_Suppress
int ValidateLayerCreationOptions( const char* const* papszLCO );
char **papszOpenOptions;
char **papszOpenOptions = nullptr;
friend class GDALRasterBand;
@@ -484,7 +472,7 @@ class CPL_DLL GDALDataset : public GDALMajorObject
public:
Iterator(GDALDataset* poDS, bool bStart);
Iterator(const Iterator& oOther); // declared but not defined. Needed for gcc 5.4 at least
Iterator(Iterator&& oOther); // declared but not defined. Needed for gcc 5.4 at least
Iterator(Iterator&& oOther) noexcept; // declared but not defined. Needed for gcc 5.4 at least
~Iterator();
GDALRasterBand* operator*();
Iterator& operator++();
@@ -627,10 +615,10 @@ class CPL_DLL GDALDataset : public GDALMajorObject
struct FeatureLayerPair
{
/** Unique pointer to a OGRFeature. */
OGRFeatureUniquePtr feature;
OGRFeatureUniquePtr feature{};
/** Layer to which the feature belongs to. */
OGRLayer* layer;
OGRLayer* layer = nullptr;
};
private:
@@ -641,7 +629,7 @@ private:
OGRGeometry *poSpatialFilter,
const char *pszDialect,
swq_select_parse_options* poSelectParseOptions);
CPLStringList oDerivedMetadataList;
CPLStringList oDerivedMetadataList{};
public:
@@ -679,11 +667,11 @@ private:
Iterator(); /**< Default constructor */
Iterator(GDALDataset* poDS, bool bStart); /**< Constructor */
Iterator(const Iterator& oOther); /**< Copy constructor */
Iterator(Iterator&& oOther); /**< Move constructor */
Iterator(Iterator&& oOther) noexcept; /**< Move constructor */
~Iterator(); /**< Destructor */
Iterator& operator=(const Iterator& oOther); /**< Assignment operator */
Iterator& operator=(Iterator&& oOther); /**< Move assignment operator */
Iterator& operator=(Iterator&& oOther) noexcept; /**< Move assignment operator */
OGRLayer* operator*() const; /**< Dereference operator */
Iterator& operator++(); /**< Pre-increment operator */
@@ -729,7 +717,7 @@ private:
public:
Iterator(GDALDataset* poDS, bool bStart);
Iterator(const Iterator& oOther); // declared but not defined. Needed for gcc 5.4 at least
Iterator(Iterator&& oOther); // declared but not defined. Needed for gcc 5.4 at least
Iterator(Iterator&& oOther) noexcept; // declared but not defined. Needed for gcc 5.4 at least
~Iterator();
const FeatureLayerPair& operator*() const;
Iterator& operator++();
@@ -801,7 +789,7 @@ private:
OGRErr ProcessSQLAlterTableAlterColumn( const char * );
OGRErr ProcessSQLAlterTableRenameColumn( const char * );
OGRStyleTable *m_poStyleTable;
OGRStyleTable *m_poStyleTable = nullptr;
//! @endcond
private:
@@ -950,7 +938,7 @@ class CPL_DLL GDALColorTable
{
GDALPaletteInterp eInterp;
std::vector<GDALColorEntry> aoEntries;
std::vector<GDALColorEntry> aoEntries{};
public:
explicit GDALColorTable( GDALPaletteInterp = GPI_RGB );
@@ -995,13 +983,15 @@ public:
class CPL_DLL GDALAbstractBandBlockCache
{
// List of blocks that can be freed or recycled, and its lock
CPLLock *hSpinLock;
GDALRasterBlock *psListBlocksToFree;
CPLLock *hSpinLock = nullptr;
GDALRasterBlock *psListBlocksToFree = nullptr;
// Band keep alive counter, and its lock & condition
CPLCond *hCond;
CPLMutex *hCondMutex;
volatile int nKeepAliveCounter;
CPLCond *hCond = nullptr;
CPLMutex *hCondMutex = nullptr;
volatile int nKeepAliveCounter = 0;
CPL_DISALLOW_COPY_ASSIGN(GDALAbstractBandBlockCache)
protected:
GDALRasterBand *poBand;
@@ -1046,37 +1036,36 @@ class CPL_DLL GDALRasterBand : public GDALMajorObject
friend class GDALHashSetBandBlockCache;
friend class GDALRasterBlock;
CPLErr eFlushBlockErr;
GDALAbstractBandBlockCache* poBandBlockCache;
CPLErr eFlushBlockErr = CE_None;
GDALAbstractBandBlockCache* poBandBlockCache = nullptr;
void SetFlushBlockErr( CPLErr eErr );
CPLErr UnreferenceBlock( GDALRasterBlock* poBlock );
void Init(int bForceCachedIO);
void SetValidPercent( GUIntBig nSampleCount, GUIntBig nValidCount );
protected:
//! @cond Doxygen_Suppress
GDALDataset *poDS;
int nBand; /* 1 based */
GDALDataset *poDS = nullptr;
int nBand = 0; /* 1 based */
int nRasterXSize;
int nRasterYSize;
int nRasterXSize = 0;
int nRasterYSize = 0;
GDALDataType eDataType;
GDALAccess eAccess;
GDALDataType eDataType = GDT_Byte;
GDALAccess eAccess = GA_ReadOnly;
/* stuff related to blocking, and raster cache */
int nBlockXSize;
int nBlockYSize;
int nBlocksPerRow;
int nBlocksPerColumn;
int nBlockXSize = -1;
int nBlockYSize = -1;
int nBlocksPerRow = 0;
int nBlocksPerColumn = 0;
int nBlockReads;
int bForceCachedIO;
int nBlockReads = 0;
int bForceCachedIO = 0;
GDALRasterBand *poMask;
bool bOwnMask;
int nMaskFlags;
GDALRasterBand *poMask = nullptr;
bool bOwnMask = false;
int nMaskFlags = 0;
void InvalidateMaskBand();
@@ -1097,12 +1086,6 @@ class CPL_DLL GDALRasterBand : public GDALMajorObject
virtual CPLErr IReadBlock( int nBlockXOff, int nBlockYOff, void * pData ) = 0;
virtual CPLErr IWriteBlock( int nBlockXOff, int nBlockYOff, void * pData );
#ifdef DETECT_OLD_IRASTERIO
virtual signature_changed IRasterIO( GDALRWFlag, int, int, int, int,
void *, int, int, GDALDataType,
int, int ) {};
#endif
virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
void *, int, int, GDALDataType,
GSpacing, GSpacing, GDALRasterIOExtraArg* psExtraArg ) CPL_WARN_UNUSED_RESULT;
@@ -1283,12 +1266,20 @@ class CPL_DLL GDALAllValidMaskBand : public GDALRasterBand
protected:
CPLErr IReadBlock( int, int, void * ) override;
CPL_DISALLOW_COPY_ASSIGN(GDALAllValidMaskBand)
public:
explicit GDALAllValidMaskBand( GDALRasterBand * );
~GDALAllValidMaskBand() override;
GDALRasterBand *GetMaskBand() override;
int GetMaskFlags() override;
CPLErr ComputeStatistics( int bApproxOK,
double *pdfMin, double *pdfMax,
double *pdfMean, double *pdfStdDev,
GDALProgressFunc, void *pProgressData ) override;
};
/* ******************************************************************** */
@@ -1300,6 +1291,8 @@ class CPL_DLL GDALNoDataMaskBand : public GDALRasterBand
double dfNoDataValue;
GDALRasterBand *poParent;
CPL_DISALLOW_COPY_ASSIGN(GDALNoDataMaskBand)
protected:
CPLErr IReadBlock( int, int, void * ) override;
CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
@@ -1322,6 +1315,8 @@ class CPL_DLL GDALNoDataValuesMaskBand : public GDALRasterBand
{
double *padfNodataValues;
CPL_DISALLOW_COPY_ASSIGN(GDALNoDataValuesMaskBand)
protected:
CPLErr IReadBlock( int, int, void * ) override;
@@ -1339,6 +1334,8 @@ class GDALRescaledAlphaBand : public GDALRasterBand
GDALRasterBand *poParent;
void *pTemp;
CPL_DISALLOW_COPY_ASSIGN(GDALRescaledAlphaBand)
protected:
CPLErr IReadBlock( int, int, void * ) override;
CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
@@ -1472,6 +1469,12 @@ class CPL_DLL GDALDriver : public GDALMajorObject
static CPLErr DefaultCopyMasks( GDALDataset *poSrcDS,
GDALDataset *poDstDS,
int bStrict );
static CPLErr DefaultCopyMasks( GDALDataset *poSrcDS,
GDALDataset *poDstDS,
int bStrict,
CSLConstList papszOptions,
GDALProgressFunc pfnProgress,
void * pProgressData );
//! @endcond
static CPLErr QuietDelete( const char * pszName );
@@ -1511,9 +1514,9 @@ private:
class CPL_DLL GDALDriverManager : public GDALMajorObject
{
int nDrivers;
GDALDriver **papoDrivers;
std::map<CPLString, GDALDriver*> oMapNameToDrivers;
int nDrivers = 0;
GDALDriver **papoDrivers = nullptr;
std::map<CPLString, GDALDriver*> oMapNameToDrivers{};
GDALDriver *GetDriver_unlocked( int iDriver )
{ return (iDriver >= 0 && iDriver < nDrivers) ?
@@ -1522,6 +1525,8 @@ class CPL_DLL GDALDriverManager : public GDALMajorObject
GDALDriver *GetDriverByName_unlocked( const char * pszName )
{ return oMapNameToDrivers[CPLString(pszName).toupper()]; }
CPL_DISALLOW_COPY_ASSIGN(GDALDriverManager)
public:
GDALDriverManager();
~GDALDriverManager();
@@ -1553,6 +1558,9 @@ CPL_C_END
*/
class CPL_DLL GDALAsyncReader
{
CPL_DISALLOW_COPY_ASSIGN(GDALAsyncReader)
protected:
//! @cond Doxygen_Suppress
GDALDataset* poDS;
@@ -1811,6 +1819,8 @@ template<class T> inline bool ARE_REAL_EQUAL(T fVal1, T fVal2, int ulp = 2)
std::abs(fVal1 - fVal2) < std::numeric_limits<float>::epsilon() * std::abs(fVal1+fVal2) * ulp;
}
double GDALAdjustNoDataCloseToFloatMax(double dfVal);
#define DIV_ROUND_UP(a, b) ( ((a) % (b)) == 0 ? ((a) / (b)) : (((a) / (b)) + 1) )
// Number of data samples that will be used to compute approximate statistics

View File

@@ -1,5 +1,5 @@
/******************************************************************************
* $Id: gdal_proxy.h d10f99bfacb1d7c3331a539c4667d1c95199313d 2017-12-18 12:00:18Z Kurt Schwehr $
* $Id: gdal_proxy.h b10430acb1303d18052fc20ebc36de01e01398fd 2018-10-25 14:49:58 -0500 Sander Jansen $
*
* Project: GDAL Core
* Purpose: GDAL Core C++/Private declarations
@@ -208,20 +208,20 @@ class GDALProxyPoolRasterBand;
class CPL_DLL GDALProxyPoolDataset : public GDALProxyDataset
{
private:
GIntBig responsiblePID;
GIntBig responsiblePID = -1;
char *pszProjectionRef;
double adfGeoTransform[6];
int bHasSrcProjection;
int bHasSrcGeoTransform;
char *pszGCPProjection;
int nGCPCount;
GDAL_GCP *pasGCPList;
CPLHashSet *metadataSet;
CPLHashSet *metadataItemSet;
char *pszProjectionRef = nullptr;
double adfGeoTransform[6]{0,1,0,0,0,1};
int bHasSrcProjection = false;
int bHasSrcGeoTransform = false;
char *pszGCPProjection = nullptr;
int nGCPCount = 0;
GDAL_GCP *pasGCPList = nullptr;
CPLHashSet *metadataSet = nullptr;
CPLHashSet *metadataItemSet = nullptr;
GDALProxyPoolCacheEntry* cacheEntry;
char *m_pszOwner;
GDALProxyPoolCacheEntry* cacheEntry = nullptr;
char *m_pszOwner = nullptr;
GDALDataset *RefUnderlyingDataset(bool bForceOpen);
@@ -245,6 +245,11 @@ class CPL_DLL GDALProxyPoolDataset : public GDALProxyDataset
void AddSrcBandDescription( GDALDataType eDataType, int nBlockXSize,
int nBlockYSize );
// Used by VRT SimpleSource to add a single GDALProxyPoolRasterBand while
// keeping all other bands initialized to a nullptr. This is under the assumption,
// VRT SimpleSource will not have to access any other bands than the one added.
void AddSrcBand(int nBand, GDALDataType eDataType, int nBlockXSize,
int nBlockYSize );
void FlushCache() override;
const char *GetProjectionRef() override;
@@ -279,17 +284,15 @@ class GDALProxyPoolMaskBand;
class CPL_DLL GDALProxyPoolRasterBand : public GDALProxyRasterBand
{
private:
CPLHashSet *metadataSet;
CPLHashSet *metadataItemSet;
char *pszUnitType;
char **papszCategoryNames;
GDALColorTable *poColorTable;
CPLHashSet *metadataSet = nullptr;
CPLHashSet *metadataItemSet = nullptr;
char *pszUnitType = nullptr;
char **papszCategoryNames = nullptr;
GDALColorTable *poColorTable = nullptr;
int nSizeProxyOverviewRasterBand;
GDALProxyPoolOverviewRasterBand **papoProxyOverviewRasterBand;
GDALProxyPoolMaskBand *poProxyMaskBand;
void Init();
int nSizeProxyOverviewRasterBand = 0;
GDALProxyPoolOverviewRasterBand **papoProxyOverviewRasterBand = nullptr;
GDALProxyPoolMaskBand *poProxyMaskBand = nullptr;
GDALRasterBand* RefUnderlyingRasterBand( bool bForceOpen );
@@ -338,11 +341,13 @@ class CPL_DLL GDALProxyPoolRasterBand : public GDALProxyRasterBand
class GDALProxyPoolOverviewRasterBand : public GDALProxyPoolRasterBand
{
private:
GDALProxyPoolRasterBand *poMainBand;
int nOverviewBand;
GDALProxyPoolRasterBand *poMainBand = nullptr;
int nOverviewBand = 0;
GDALRasterBand *poUnderlyingMainRasterBand;
int nRefCountUnderlyingMainRasterBand;
GDALRasterBand *poUnderlyingMainRasterBand = nullptr;
int nRefCountUnderlyingMainRasterBand = 0;
CPL_DISALLOW_COPY_ASSIGN(GDALProxyPoolOverviewRasterBand)
protected:
GDALRasterBand* RefUnderlyingRasterBand() override;
@@ -364,10 +369,12 @@ class GDALProxyPoolOverviewRasterBand : public GDALProxyPoolRasterBand
class GDALProxyPoolMaskBand : public GDALProxyPoolRasterBand
{
private:
GDALProxyPoolRasterBand *poMainBand;
GDALProxyPoolRasterBand *poMainBand = nullptr;
GDALRasterBand *poUnderlyingMainRasterBand;
int nRefCountUnderlyingMainRasterBand;
GDALRasterBand *poUnderlyingMainRasterBand = nullptr;
int nRefCountUnderlyingMainRasterBand = 0;
CPL_DISALLOW_COPY_ASSIGN(GDALProxyPoolMaskBand)
protected:
GDALRasterBand* RefUnderlyingRasterBand() override;

View File

@@ -1,5 +1,5 @@
/******************************************************************************
* $Id: gdal_rat.h 3c5e4ec07e57067c187d87dad3b6be5490b76a4e 2018-04-02 23:38:56 +0200 Even Rouault $
* $Id: gdal_rat.h 2519a7eb0e1649dbf8625ae8ffc7bb7c3ef9514b 2018-07-10 12:05:23 +0100 Robert Coup $
*
* Project: GDAL Core
* Purpose: GDALRasterAttributeTable class declarations.
@@ -60,7 +60,7 @@ public:
*
* @return new copy of the RAT as an in-memory implementation.
*/
virtual GDALDefaultRasterAttributeTable *Clone() const = 0;
virtual GDALRasterAttributeTable *Clone() const = 0;
/**
* \brief Fetch table column count.
@@ -238,6 +238,25 @@ public:
*/
virtual int ChangesAreWrittenToFile() = 0;
/**
* \brief Set the RAT table type.
*
* Set whether the RAT is thematic or athematic (continuous).
*
* @since GDAL 2.4
*/
virtual CPLErr SetTableType(const GDALRATTableType eInTableType) = 0;
/**
* \brief Get the RAT table type.
*
* Indicates whether the RAT is thematic or athematic (continuous).
*
* @since GDAL 2.4
* @return table type
*/
virtual GDALRATTableType GetTableType() const = 0;
virtual CPLErr ValuesIO( GDALRWFlag eRWFlag, int iField,
int iStartRow, int iLength,
double *pdfData);
@@ -285,6 +304,13 @@ public:
*/
static inline GDALRasterAttributeTable* FromHandle(GDALRasterAttributeTableH hRAT)
{ return static_cast<GDALRasterAttributeTable*>(hRAT); }
/**
* \brief Remove statistics from the RAT.
*
* @since GDAL 2.4
*/
virtual void RemoveStatistics() = 0;
};
/************************************************************************/
@@ -296,15 +322,15 @@ public:
class GDALRasterAttributeField
{
public:
CPLString sName;
CPLString sName{};
GDALRATFieldType eType;
GDALRATFieldType eType = GFT_Integer;
GDALRATFieldUsage eUsage;
GDALRATFieldUsage eUsage = GFU_Generic;
std::vector<GInt32> anValues;
std::vector<double> adfValues;
std::vector<CPLString> aosValues;
std::vector<GInt32> anValues{};
std::vector<double> adfValues{};
std::vector<CPLString> aosValues{};
};
//! @endcond
@@ -314,28 +340,28 @@ class GDALRasterAttributeField
//! Raster Attribute Table container.
// cppcheck-suppress copyCtorAndEqOperator
class CPL_DLL GDALDefaultRasterAttributeTable : public GDALRasterAttributeTable
{
private:
std::vector<GDALRasterAttributeField> aoFields;
std::vector<GDALRasterAttributeField> aoFields{};
int bLinearBinning; // TODO(schwehr): Can this be a bool?
double dfRow0Min;
double dfBinSize;
int bLinearBinning = false; // TODO(schwehr): Can this be a bool?
double dfRow0Min = -0.5;
double dfBinSize = 1.0;
GDALRATTableType eTableType;
void AnalyseColumns();
int bColumnsAnalysed; // TODO(schwehr): Can this be a bool?
int nMinCol;
int nMaxCol;
int bColumnsAnalysed = false; // TODO(schwehr): Can this be a bool?
int nMinCol = -1;
int nMaxCol = -1;
int nRowCount;
int nRowCount = 0;
CPLString osWorkingResult;
CPLString osWorkingResult{};
public:
GDALDefaultRasterAttributeTable();
GDALDefaultRasterAttributeTable( const GDALDefaultRasterAttributeTable& );
~GDALDefaultRasterAttributeTable() override;
GDALDefaultRasterAttributeTable *Clone() const override;
@@ -372,6 +398,11 @@ class CPL_DLL GDALDefaultRasterAttributeTable : public GDALRasterAttributeTable
double dfBinSize ) override;
int GetLinearBinning( double *pdfRow0Min,
double *pdfBinSize ) const override;
CPLErr SetTableType(const GDALRATTableType eInTableType) override;
GDALRATTableType GetTableType() const override;
void RemoveStatistics() override;
};
#endif /* ndef GDAL_RAT_H_INCLUDED */

View File

@@ -1,5 +1,5 @@
/******************************************************************************
* $Id: gdal_simplesurf.h 1b31a5ae8474bacb2fb8cce9c7121b390e192c4c 2016-12-04 04:32:31Z Kurt Schwehr $
* $Id: gdal_simplesurf.h fe2d81c8819bf9794bce0210098e637565728350 2018-05-06 00:49:51 +0200 Even Rouault $
* Project: GDAL
* Purpose: Correlator
* Author: Andrew Migal, migal.drew@gmail.com
@@ -187,6 +187,8 @@ private:
*/
class GDALIntegralImage
{
CPL_DISALLOW_COPY_ASSIGN(GDALIntegralImage)
public:
GDALIntegralImage();
virtual ~GDALIntegralImage();
@@ -260,9 +262,9 @@ public:
int GetWidth();
private:
double **pMatrix;
int nWidth;
int nHeight;
double **pMatrix = nullptr;
int nWidth = 0;
int nHeight = 0;
};
/**
@@ -275,6 +277,8 @@ private:
*/
class GDALOctaveLayer
{
CPL_DISALLOW_COPY_ASSIGN(GDALOctaveLayer)
public:
GDALOctaveLayer();
@@ -424,12 +428,8 @@ private:
class MatchedPointPairInfo
{
public:
MatchedPointPairInfo(int nInd_1, int nInd_2, double dfDist)
{
ind_1 = nInd_1;
ind_2 = nInd_2;
euclideanDist = dfDist;
}
MatchedPointPairInfo(int nInd_1, int nInd_2, double dfDist):
ind_1(nInd_1), ind_2(nInd_2), euclideanDist(dfDist) {}
int ind_1;
int ind_2;

View File

@@ -6,8 +6,8 @@
#ifndef GDAL_VERSION_MAJOR
# define GDAL_VERSION_MAJOR 2
# define GDAL_VERSION_MINOR 3
# define GDAL_VERSION_REV 2
# define GDAL_VERSION_MINOR 4
# define GDAL_VERSION_REV 1
# define GDAL_VERSION_BUILD 0
#endif
@@ -24,9 +24,9 @@
#if !defined(DO_NOT_DEFINE_GDAL_RELEASE_DATE_AND_GDAL_RELEASE_NAME)
#ifndef GDAL_RELEASE_DATE
# define GDAL_RELEASE_DATE 20180921
# define GDAL_RELEASE_DATE 20190315
#endif
#ifndef GDAL_RELEASE_NAME
# define GDAL_RELEASE_NAME "2.3.2"
# define GDAL_RELEASE_NAME "2.4.1"
#endif
#endif

View File

@@ -1,5 +1,5 @@
/******************************************************************************
* $Id: gdalgeorefpamdataset.h 773b7550bb86d46bc587f547f5db549566665834 2017-12-18 04:05:13Z Kurt Schwehr $
* $Id: gdalgeorefpamdataset.h e37e476c4cf8f4b0df8995e0d95d5d672fca1a9b 2018-05-05 16:54:18 +0200 Even Rouault $
*
* Project: GDAL
* Purpose: GDALPamDataset with internal storage for georeferencing, with
@@ -59,6 +59,8 @@ class CPL_DLL GDALGeorefPamDataset : public GDALPamDataset
bool m_bPAMLoaded;
char** m_papszMainMD;
CPL_DISALLOW_COPY_ASSIGN(GDALGeorefPamDataset)
public:
GDALGeorefPamDataset();
~GDALGeorefPamDataset() override;

Some files were not shown because too many files have changed in this diff Show More