mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-22 04:49:12 -06:00
Merge remote-tracking branch 'origin/master' into feature/video-on-globe
# Conflicts: # modules/globebrowsing/src/layergroupid.h # modules/globebrowsing/src/tileprovider/tileprovider.cpp
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
# #
|
||||
# OpenSpace #
|
||||
# #
|
||||
# Copyright (c) 2014-2022 #
|
||||
# Copyright (c) 2014-2023 #
|
||||
# #
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy of this #
|
||||
# software and associated documentation files (the "Software"), to deal in the Software #
|
||||
@@ -22,8 +22,8 @@
|
||||
# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #
|
||||
##########################################################################################
|
||||
|
||||
include(${OPENSPACE_CMAKE_EXT_DIR}/global_variables.cmake)
|
||||
include(${GHOUL_BASE_DIR}/support/cmake/message_macros.cmake)
|
||||
include(${PROJECT_SOURCE_DIR}/support/cmake/global_variables.cmake)
|
||||
include(${PROJECT_SOURCE_DIR}/ext/ghoul/support/cmake/message_macros.cmake)
|
||||
|
||||
|
||||
# This function takes a list of module paths and returns the list of include paths that
|
||||
@@ -164,7 +164,7 @@ endfunction ()
|
||||
|
||||
|
||||
set(OPENSPACE_EXTERNAL_MODULES_PATHS "" CACHE STRING "List of external modules")
|
||||
set(internal_module_path "${OPENSPACE_BASE_DIR}/modules")
|
||||
set(internal_module_path "${PROJECT_SOURCE_DIR}/modules")
|
||||
set(all_enabled_modules "")
|
||||
|
||||
|
||||
@@ -378,12 +378,12 @@ if (NOT "${MODULE_PATHS}" STREQUAL "")
|
||||
endif ()
|
||||
|
||||
configure_file(
|
||||
${OPENSPACE_CMAKE_EXT_DIR}/module_registration.template
|
||||
${PROJECT_SOURCE_DIR}/support/cmake/module_registration.template
|
||||
${CMAKE_BINARY_DIR}/_generated/include/openspace/moduleregistration.h
|
||||
)
|
||||
|
||||
configure_file(
|
||||
${OPENSPACE_CMAKE_EXT_DIR}/module_path.template
|
||||
${PROJECT_SOURCE_DIR}/support/cmake/module_path.template
|
||||
${CMAKE_BINARY_DIR}/_generated/include/openspace/modulepath.h
|
||||
)
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# #
|
||||
# OpenSpace #
|
||||
# #
|
||||
# Copyright (c) 2014-2022 #
|
||||
# Copyright (c) 2014-2023 #
|
||||
# #
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy of this #
|
||||
# software and associated documentation files (the "Software"), to deal in the Software #
|
||||
@@ -22,7 +22,7 @@
|
||||
# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #
|
||||
##########################################################################################
|
||||
|
||||
include(${OPENSPACE_CMAKE_EXT_DIR}/module_definition.cmake)
|
||||
include(${PROJECT_SOURCE_DIR}/support/cmake/module_definition.cmake)
|
||||
|
||||
set(HEADER_FILES
|
||||
rendering/atmospheredeferredcaster.h
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# #
|
||||
# OpenSpace #
|
||||
# #
|
||||
# Copyright (c) 2014-2022 #
|
||||
# Copyright (c) 2014-2023 #
|
||||
# #
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy of this #
|
||||
# software and associated documentation files (the "Software"), to deal in the Software #
|
||||
@@ -22,7 +22,7 @@
|
||||
# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #
|
||||
##########################################################################################
|
||||
|
||||
include(${OPENSPACE_CMAKE_EXT_DIR}/module_definition.cmake)
|
||||
include(${PROJECT_SOURCE_DIR}/support/cmake/module_definition.cmake)
|
||||
|
||||
set(HEADER_FILES
|
||||
dashboard/dashboarditemangle.h
|
||||
@@ -30,6 +30,7 @@ set(HEADER_FILES
|
||||
dashboard/dashboarditemdistance.h
|
||||
dashboard/dashboarditemelapsedtime.h
|
||||
dashboard/dashboarditemframerate.h
|
||||
dashboard/dashboarditeminputstate.h
|
||||
dashboard/dashboarditemmission.h
|
||||
dashboard/dashboarditemparallelconnection.h
|
||||
dashboard/dashboarditempropertyvalue.h
|
||||
@@ -85,6 +86,7 @@ set(SOURCE_FILES
|
||||
dashboard/dashboarditemdistance.cpp
|
||||
dashboard/dashboarditemelapsedtime.cpp
|
||||
dashboard/dashboarditemframerate.cpp
|
||||
dashboard/dashboarditeminputstate.cpp
|
||||
dashboard/dashboarditemmission.cpp
|
||||
dashboard/dashboarditemparallelconnection.cpp
|
||||
dashboard/dashboarditempropertyvalue.cpp
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <modules/base/dashboard/dashboarditemdistance.h>
|
||||
#include <modules/base/dashboard/dashboarditemelapsedtime.h>
|
||||
#include <modules/base/dashboard/dashboarditemframerate.h>
|
||||
#include <modules/base/dashboard/dashboarditeminputstate.h>
|
||||
#include <modules/base/dashboard/dashboarditemmission.h>
|
||||
#include <modules/base/dashboard/dashboarditemparallelconnection.h>
|
||||
#include <modules/base/dashboard/dashboarditempropertyvalue.h>
|
||||
@@ -109,6 +110,7 @@ void BaseModule::internalInitialize(const ghoul::Dictionary&) {
|
||||
fDashboard->registerClass<DashboardItemDistance>("DashboardItemDistance");
|
||||
fDashboard->registerClass<DashboardItemElapsedTime>("DashboardItemElapsedTime");
|
||||
fDashboard->registerClass<DashboardItemFramerate>("DashboardItemFramerate");
|
||||
fDashboard->registerClass<DashboardItemInputState>("DashboardItemInputState");
|
||||
fDashboard->registerClass<DashboardItemMission>("DashboardItemMission");
|
||||
fDashboard->registerClass<DashboardItemParallelConnection>(
|
||||
"DashboardItemParallelConnection"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
@@ -354,7 +354,7 @@ void DashboardItemDistance::render(glm::vec2& penPosition) {
|
||||
else {
|
||||
const DistanceUnit unit = static_cast<DistanceUnit>(_requestedUnit.value());
|
||||
const double convertedD = convertMeters(d, unit);
|
||||
dist = { convertedD, nameForDistanceUnit(unit, convertedD != 1.0) };
|
||||
dist = std::pair(convertedD, nameForDistanceUnit(unit, convertedD != 1.0));
|
||||
}
|
||||
|
||||
std::fill(_buffer.begin(), _buffer.end(), char(0));
|
||||
@@ -385,7 +385,7 @@ glm::vec2 DashboardItemDistance::size() const {
|
||||
else {
|
||||
DistanceUnit unit = static_cast<DistanceUnit>(_requestedUnit.value());
|
||||
double convertedD = convertMeters(d, unit);
|
||||
dist = { convertedD, nameForDistanceUnit(unit, convertedD != 1.0) };
|
||||
dist = std::pair(convertedD, nameForDistanceUnit(unit, convertedD != 1.0));
|
||||
}
|
||||
|
||||
return _font->boundingBox(
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
223
modules/base/dashboard/dashboarditeminputstate.cpp
Normal file
223
modules/base/dashboard/dashboarditeminputstate.cpp
Normal file
@@ -0,0 +1,223 @@
|
||||
/*****************************************************************************************
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
* 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. *
|
||||
****************************************************************************************/
|
||||
|
||||
#include <modules/base/dashboard/dashboarditeminputstate.h>
|
||||
|
||||
#include <openspace/documentation/documentation.h>
|
||||
#include <openspace/documentation/verifier.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/navigation/navigationhandler.h>
|
||||
#include <ghoul/font/font.h>
|
||||
#include <ghoul/font/fontmanager.h>
|
||||
#include <ghoul/font/fontrenderer.h>
|
||||
#include <ghoul/misc/misc.h>
|
||||
|
||||
namespace {
|
||||
constexpr openspace::properties::Property::PropertyInfo ShowWhenEnabledInfo = {
|
||||
"ShowWhenEnabled",
|
||||
"Show when enabled",
|
||||
"Show text when the input is enabled"
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo ShowWhenDisabledInfo = {
|
||||
"ShowWhenDisabled",
|
||||
"Show when disabled",
|
||||
"Show text when the input is disabled"
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo ShowKeyboardInfo = {
|
||||
"ShowKeyboard",
|
||||
"Show Keyboard information",
|
||||
"Display the state of the keyboard input"
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo ShowMouseInfo = {
|
||||
"ShowMouse",
|
||||
"Show Mouse information",
|
||||
"Display the state of the mouse input"
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo ShowJoystickInfo = {
|
||||
"ShowJoystick",
|
||||
"Show Joystick information",
|
||||
"Display the state of the joystick input"
|
||||
};
|
||||
|
||||
struct [[codegen::Dictionary(DashboardItemPropertyValue)]] Parameters {
|
||||
// [[codegen::verbatim(ShowWhenEnabledInfo.description)]]
|
||||
std::optional<bool> showWhenEnabled;
|
||||
|
||||
// [[codegen::verbatim(ShowWhenDisabledInfo.description)]]
|
||||
std::optional<bool> showWhenDisabled;
|
||||
|
||||
// [[codegen::verbatim(ShowKeyboardInfo.description)]]
|
||||
std::optional<bool> showKeyboard;
|
||||
|
||||
// [[codegen::verbatim(ShowMouseInfo.description)]]
|
||||
std::optional<bool> showMouse;
|
||||
|
||||
// [[codegen::verbatim(ShowJoystickInfo.description)]]
|
||||
std::optional<bool> showJoystick;
|
||||
};
|
||||
#include "dashboarditeminputstate_codegen.cpp"
|
||||
} // namespace
|
||||
|
||||
namespace openspace {
|
||||
|
||||
documentation::Documentation DashboardItemInputState::Documentation() {
|
||||
return codegen::doc<Parameters>(
|
||||
"base_dashboarditem_inputstate",
|
||||
DashboardTextItem::Documentation()
|
||||
);
|
||||
}
|
||||
|
||||
DashboardItemInputState::DashboardItemInputState(const ghoul::Dictionary& dictionary)
|
||||
: DashboardTextItem(dictionary)
|
||||
, _showWhenEnabled(ShowWhenEnabledInfo, true)
|
||||
, _showWhenDisabled(ShowWhenDisabledInfo, true)
|
||||
, _showKeyboard(ShowKeyboardInfo, true)
|
||||
, _showMouse(ShowMouseInfo, true)
|
||||
, _showJoystick(ShowJoystickInfo, true)
|
||||
{
|
||||
const Parameters p = codegen::bake<Parameters>(dictionary);
|
||||
|
||||
_showWhenEnabled = p.showWhenEnabled.value_or(_showWhenEnabled);
|
||||
addProperty(_showWhenEnabled);
|
||||
|
||||
_showWhenDisabled = p.showWhenDisabled.value_or(_showWhenDisabled);
|
||||
addProperty(_showWhenDisabled);
|
||||
|
||||
_showKeyboard = p.showKeyboard.value_or(_showKeyboard);
|
||||
addProperty(_showKeyboard);
|
||||
|
||||
_showMouse = p.showMouse.value_or(_showMouse);
|
||||
addProperty(_showMouse);
|
||||
|
||||
_showJoystick = p.showJoystick.value_or(_showJoystick);
|
||||
addProperty(_showJoystick);
|
||||
}
|
||||
|
||||
void DashboardItemInputState::render(glm::vec2& penPosition) {
|
||||
ZoneScoped
|
||||
|
||||
std::vector<std::string> text;
|
||||
if (_showKeyboard) {
|
||||
if (global::navigationHandler->disabledKeybindings()) {
|
||||
if (_showWhenDisabled) {
|
||||
text.push_back("Keyboard shortcuts disabled");
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (_showWhenEnabled) {
|
||||
text.push_back("Keyboard shortcuts enabled");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (_showMouse) {
|
||||
if (global::navigationHandler->disabledMouse()) {
|
||||
if (_showWhenDisabled) {
|
||||
text.push_back("Mouse input disabled");
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (_showWhenEnabled) {
|
||||
text.push_back("Mouse input enabled");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (_showJoystick) {
|
||||
if (global::navigationHandler->disabledJoystick()) {
|
||||
if (_showWhenDisabled) {
|
||||
text.push_back("Joystick input disabled");
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (_showWhenEnabled) {
|
||||
text.push_back("Joystick input enabled");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!text.empty()) {
|
||||
std::string t = ghoul::join(std::move(text), "\n");
|
||||
RenderFont(*_font, penPosition, t);
|
||||
penPosition.y -= _font->height();
|
||||
}
|
||||
}
|
||||
|
||||
glm::vec2 DashboardItemInputState::size() const {
|
||||
ZoneScoped
|
||||
|
||||
std::vector<std::string> text;
|
||||
if (_showKeyboard) {
|
||||
if (global::navigationHandler->disabledKeybindings()) {
|
||||
if (_showWhenDisabled) {
|
||||
text.push_back("Keyboard shortcuts disabled");
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (_showWhenEnabled) {
|
||||
text.push_back("Keyboard shortcuts enabled");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (_showMouse) {
|
||||
if (global::navigationHandler->disabledMouse()) {
|
||||
if (_showWhenDisabled) {
|
||||
text.push_back("Mouse input disabled");
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (_showWhenEnabled) {
|
||||
text.push_back("Mouse input disabled");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (_showJoystick) {
|
||||
if (global::navigationHandler->disabledJoystick()) {
|
||||
if (_showWhenDisabled) {
|
||||
text.push_back("Joystick input disabled");
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (_showWhenEnabled) {
|
||||
text.push_back("Joystick input disabled");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!text.empty()) {
|
||||
std::string t = ghoul::join(std::move(text), "\n");
|
||||
return _font->boundingBox(t);
|
||||
}
|
||||
else {
|
||||
return glm::vec2(0.f, 0.f);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace openspace
|
||||
59
modules/base/dashboard/dashboarditeminputstate.h
Normal file
59
modules/base/dashboard/dashboarditeminputstate.h
Normal file
@@ -0,0 +1,59 @@
|
||||
/*****************************************************************************************
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
* 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 __OPENSPACE_MODULE_BASE___DASHBOARDITEMINPUTSTATE___H__
|
||||
#define __OPENSPACE_MODULE_BASE___DASHBOARDITEMINPUTSTATE___H__
|
||||
|
||||
#include <openspace/rendering/dashboardtextitem.h>
|
||||
|
||||
#include <openspace/properties/scalar/boolproperty.h>
|
||||
|
||||
namespace openspace {
|
||||
|
||||
namespace properties { class Property; }
|
||||
namespace documentation { struct Documentation; }
|
||||
|
||||
class DashboardItemInputState : public DashboardTextItem {
|
||||
public:
|
||||
DashboardItemInputState(const ghoul::Dictionary& dictionary);
|
||||
~DashboardItemInputState() override = default;
|
||||
|
||||
void render(glm::vec2& penPosition) override;
|
||||
|
||||
glm::vec2 size() const override;
|
||||
|
||||
static documentation::Documentation Documentation();
|
||||
|
||||
private:
|
||||
properties::BoolProperty _showWhenEnabled;
|
||||
properties::BoolProperty _showWhenDisabled;
|
||||
|
||||
properties::BoolProperty _showKeyboard;
|
||||
properties::BoolProperty _showMouse;
|
||||
properties::BoolProperty _showJoystick;
|
||||
};
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
#endif // __OPENSPACE_MODULE_BASE___DASHBOARDITEMINPUTSTATE___H__
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
@@ -167,17 +167,17 @@ void DashboardItemSimulationIncrement::render(glm::vec2& penPosition) {
|
||||
const TimeUnit unit = static_cast<TimeUnit>(_requestedUnit.value());
|
||||
|
||||
const double convTarget = convertTime(targetDt, TimeUnit::Second, unit);
|
||||
targetDeltaTime = {
|
||||
targetDeltaTime = std::pair(
|
||||
convTarget,
|
||||
std::string(nameForTimeUnit(unit, convTarget != 1.0))
|
||||
};
|
||||
);
|
||||
|
||||
if (targetDt != currentDt) {
|
||||
const double convCurrent = convertTime(currentDt, TimeUnit::Second, unit);
|
||||
currentDeltaTime = {
|
||||
currentDeltaTime = std::pair(
|
||||
convCurrent,
|
||||
std::string(nameForTimeUnit(unit, convCurrent != 1.0))
|
||||
};
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -225,10 +225,10 @@ glm::vec2 DashboardItemSimulationIncrement::size() const {
|
||||
else {
|
||||
TimeUnit unit = static_cast<TimeUnit>(_requestedUnit.value());
|
||||
double convertedT = convertTime(t, TimeUnit::Second, unit);
|
||||
deltaTime = {
|
||||
deltaTime = std::pair(
|
||||
convertedT,
|
||||
std::string(nameForTimeUnit(unit, convertedT != 1.0))
|
||||
};
|
||||
);
|
||||
}
|
||||
|
||||
return _font->boundingBox(
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
@@ -137,7 +137,7 @@ void DashboardItemVelocity::render(glm::vec2& penPosition) {
|
||||
else {
|
||||
const DistanceUnit unit = static_cast<DistanceUnit>(_requestedUnit.value());
|
||||
const double convertedD = convertMeters(speedPerSecond, unit);
|
||||
dist = { convertedD, nameForDistanceUnit(unit, convertedD != 1.0) };
|
||||
dist = std::pair(convertedD, nameForDistanceUnit(unit, convertedD != 1.0));
|
||||
}
|
||||
|
||||
RenderFont(
|
||||
@@ -163,7 +163,7 @@ glm::vec2 DashboardItemVelocity::size() const {
|
||||
else {
|
||||
DistanceUnit unit = static_cast<DistanceUnit>(_requestedUnit.value());
|
||||
double convertedD = convertMeters(d, unit);
|
||||
dist = { convertedD, nameForDistanceUnit(unit, convertedD != 1.0) };
|
||||
dist = std::pair(convertedD, nameForDistanceUnit(unit, convertedD != 1.0));
|
||||
}
|
||||
|
||||
return _font->boundingBox(
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
@@ -62,12 +62,6 @@ namespace {
|
||||
{ "Color Adding", ColorAddingBlending }
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo EnableAnimationInfo = {
|
||||
"EnableAnimation",
|
||||
"Enable Animation",
|
||||
"Enable or disable the animation for the model if it has any"
|
||||
};
|
||||
|
||||
constexpr std::array<const char*, 12> UniformNames = {
|
||||
"opacity", "nLightSources", "lightDirectionsViewSpace", "lightIntensities",
|
||||
"modelViewTransform", "normalTransform", "projectionTransform",
|
||||
@@ -75,6 +69,12 @@ namespace {
|
||||
"specularIntensity", "opacityBlending"
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo EnableAnimationInfo = {
|
||||
"EnableAnimation",
|
||||
"Enable Animation",
|
||||
"Enable or disable the animation for the model if it has any"
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo AmbientIntensityInfo = {
|
||||
"AmbientIntensity",
|
||||
"Ambient Intensity",
|
||||
@@ -732,7 +732,7 @@ void RenderableModel::update(const UpdateData& data) {
|
||||
// starts again
|
||||
// s/\/\/\/\ ...
|
||||
relativeTime =
|
||||
duration - abs(fmod(now - startTime, 2 * duration) - duration);
|
||||
duration - std::abs(fmod(now - startTime, 2 * duration) - duration);
|
||||
break;
|
||||
case AnimationMode::BounceInfinitely: {
|
||||
// Bounce both before and after the start time where the model is
|
||||
@@ -742,7 +742,7 @@ void RenderableModel::update(const UpdateData& data) {
|
||||
if (modulo < 0.0) {
|
||||
modulo += 2 * duration;
|
||||
}
|
||||
relativeTime = duration - abs(modulo - duration);
|
||||
relativeTime = duration - std::abs(modulo - duration);
|
||||
break;
|
||||
}
|
||||
case AnimationMode::Once:
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
@@ -42,15 +42,15 @@ namespace {
|
||||
constexpr openspace::properties::Property::PropertyInfo StartNodeInfo = {
|
||||
"StartNode",
|
||||
"Start Node",
|
||||
"The identifier of the node the line starts from. "
|
||||
"Defaults to 'Root' if not specified. "
|
||||
"The identifier of the node the line starts from. Defaults to 'Root' if not "
|
||||
"specified."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo EndNodeInfo = {
|
||||
"EndNode",
|
||||
"End Node",
|
||||
"The identifier of the node the line ends at. "
|
||||
"Defaults to 'Root' if not specified. "
|
||||
"The identifier of the node the line ends at. Defaults to 'Root' if not "
|
||||
"specified."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo LineColorInfo = {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
@@ -79,8 +79,8 @@ namespace {
|
||||
constexpr openspace::properties::Property::PropertyInfo MultiplyColorInfo = {
|
||||
"MultiplyColor",
|
||||
"Multiply Color",
|
||||
"If set, the plane's texture is multiplied with this color. "
|
||||
"Useful for applying a color grayscale images"
|
||||
"If set, the plane's texture is multiplied with this color. Useful for applying "
|
||||
"a color grayscale images"
|
||||
};
|
||||
|
||||
struct [[codegen::Dictionary(RenderablePlane)]] Parameters {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
@@ -49,9 +49,8 @@ namespace {
|
||||
constexpr openspace::properties::Property::PropertyInfo LinesInfo = {
|
||||
"NumLines",
|
||||
"Number of Lines",
|
||||
"The number of lines connecting the two shapes of the prism. "
|
||||
"They will be evenly distributed around the bounding circle that makes "
|
||||
"up the shape of the prism"
|
||||
"The number of lines connecting the two shapes of the prism. They will be evenly "
|
||||
"distributed around the bounding circle that makes up the shape of the prism"
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo RadiusInfo = {
|
||||
@@ -63,8 +62,8 @@ namespace {
|
||||
constexpr openspace::properties::Property::PropertyInfo BaseRadiusInfo = {
|
||||
"BaseRadius",
|
||||
"Base Radius",
|
||||
"The radius of the base of the prism's shape, in meters. By default it is "
|
||||
"given the same radius as the outer shape"
|
||||
"The radius of the base of the prism's shape, in meters. By default it is given "
|
||||
"the same radius as the outer shape"
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo LineWidthInfo = {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
@@ -107,7 +107,7 @@ namespace {
|
||||
"Enables/Disables the Fade-In/Out effects"
|
||||
};
|
||||
|
||||
struct [[codegen::Dictionary(RenerableTimeVaryingSphere)]] Parameters {
|
||||
struct [[codegen::Dictionary(RenderableTimeVaryingSphere)]] Parameters {
|
||||
// [[codegen::verbatim(SizeInfo.description)]]
|
||||
float size;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
@@ -117,7 +117,7 @@ namespace {
|
||||
constexpr openspace::properties::Property::PropertyInfo RenderingModeInfo = {
|
||||
"Rendering",
|
||||
"Rendering Mode",
|
||||
"Determines how the trail should be rendered to the screen.If 'Lines' is "
|
||||
"Determines how the trail should be rendered to the screen. If 'Lines' is "
|
||||
"selected, only the line part is visible, if 'Points' is selected, only the "
|
||||
"corresponding points (and subpoints) are shown. 'Lines+Points' shows both parts"
|
||||
};
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
@@ -240,9 +240,11 @@ void RenderableTrailTrajectory::update(const UpdateData& data) {
|
||||
|
||||
// If we are inside the valid time, we additionally want to draw a line from the last
|
||||
// correct point to the current location of the object
|
||||
if (data.time.j2000Seconds() >= _start &&
|
||||
if (data.time.j2000Seconds() > _start &&
|
||||
data.time.j2000Seconds() <= _end && !_renderFullTrail)
|
||||
{
|
||||
ghoul_assert(_primaryRenderInformation.count > 0, "No vertices available");
|
||||
|
||||
// Copy the last valid location
|
||||
glm::dvec3 v0(
|
||||
_vertexArray[_primaryRenderInformation.count - 1].x,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
@@ -119,7 +119,7 @@ bool ScreenSpaceDashboard::isReady() const {
|
||||
void ScreenSpaceDashboard::update() {
|
||||
if (global::windowDelegate->windowHasResized()) {
|
||||
const glm::ivec2 size = global::windowDelegate->currentDrawBufferResolution();
|
||||
_size = { 0.f, 0.f, size.x, size.y };
|
||||
_size = glm::vec4(0.f, 0.f, size.x, size.y);
|
||||
createFramebuffer();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2022 *
|
||||
* Copyright (c) 2014-2023 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
@@ -124,6 +124,10 @@ void ScreenSpaceImageLocal::update() {
|
||||
// image is only RGB
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
|
||||
if (texture->format() == ghoul::opengl::Texture::Format::Red) {
|
||||
texture->setSwizzleMask({ GL_RED, GL_RED, GL_RED, GL_ONE });
|
||||
}
|
||||
|
||||
texture->uploadTexture();
|
||||
texture->setFilter(ghoul::opengl::Texture::FilterMode::LinearMipMap);
|
||||
texture->purgeFromRAM();
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user