Merge branch 'master' of github.com:OpenSpace/OpenSpace into feature/data-management

Conflicts:
	src/rendering/renderengine.cpp
	src/scene/scene.cpp
	src/scene/sceneloader.cpp
	tests/test_concurrentjobmanager.inl
	tests/test_concurrentqueue.inl
	tests/test_sceneloader.inl
This commit is contained in:
Emil Axelsson
2017-08-15 11:43:18 +02:00
360 changed files with 2348 additions and 2015 deletions
+192 -16
View File
@@ -2,7 +2,7 @@
# #
# OpenSpace #
# #
# Copyright (c) 2014-2016 #
# Copyright (c) 2014-2017 #
# #
# 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,9 +22,9 @@
# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #
##########################################################################################
cmake_minimum_required (VERSION 3.4 FATAL_ERROR)
cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
project (OpenSpace)
project(OpenSpace)
message(STATUS "Generating OpenSpace project")
set(OPENSPACE_VERSION_MAJOR 0)
@@ -35,34 +35,210 @@ set(OPENSPACE_VERSION_STRING "prerelease-14 (Astronomy Live)")
set(OPENSPACE_BASE_DIR "${PROJECT_SOURCE_DIR}")
set(OPENSPACE_APPS_DIR "${OPENSPACE_BASE_DIR}/apps")
set(OPENSPACE_EXT_DIR "${OPENSPACE_BASE_DIR}/ext")
set(OPENSPACE_MODULE_DIR "${OPENSPACE_BASE_DIR}/modules")
set(OPENSPACE_CMAKE_EXT_DIR "${OPENSPACE_BASE_DIR}/support/cmake")
set(GHOUL_BASE_DIR "${OPENSPACE_BASE_DIR}/ext/ghoul")
include(${OPENSPACE_CMAKE_EXT_DIR}/support_macros.cmake)
include(${OPENSPACE_CMAKE_EXT_DIR}/module_common.cmake)
include(${GHOUL_BASE_DIR}/support/cmake/CopySharedLibraries.cmake)
include(${OPENSPACE_CMAKE_EXT_DIR}/global_variables.cmake)
include(${GHOUL_BASE_DIR}/support/cmake/copy_shared_libraries.cmake)
include(${OPENSPACE_CMAKE_EXT_DIR}/handle_applications.cmake)
include(${OPENSPACE_CMAKE_EXT_DIR}/handle_modules.cmake)
test_compiler_compatibility()
cleanup_project()
set_build_output_directories()
##########################################################################################
# Cleanup project #
##########################################################################################
set_property(GLOBAL PROPERTY USE_FOLDERS On)
set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER CMake)
# Test compiler
if (MSVC AND (MSVC_VERSION LESS 1910))
message(FATAL_ERROR "OpenSpace requires at least Visual Studio 2017.2")
endif ()
# Set build output directories
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${OPENSPACE_CMAKE_EXT_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${OPENSPACE_BASE_DIR}/bin)
option(OPENSPACE_WARNINGS_AS_ERRORS "Treat warnings as errors" OFF)
include(src/CMakeLists.txt)
create_openspace_target()
add_external_dependencies()
handle_applications()
##########################################################################################
# Add external dependencies #
##########################################################################################
# System libraries
if (APPLE)
target_include_directories(libOpenSpace PUBLIC "/Developer/Headers/FlatCarbon")
find_library(COREFOUNDATION_LIBRARY CoreFoundation)
find_library(CARBON_LIBRARY Carbon)
find_library(COCOA_LIBRARY Carbon)
find_library(APP_SERVICES_LIBRARY ApplicationServices)
mark_as_advanced(CARBON_LIBRARY COCOA_LIBRARY APP_SERVICES_LIBRARY)
target_link_libraries(libOpenSpace
${CARBON_LIBRARY}
${COREFOUNDATION_LIBRARY}
${COCOA_LIBRARY}
${APP_SERVICES_LIBRARY}
)
endif()
# Ghoul
add_subdirectory(${OPENSPACE_EXT_DIR}/ghoul)
target_link_libraries(libOpenSpace Ghoul)
set_property(TARGET Lua PROPERTY FOLDER "External")
set_property(TARGET lz4 PROPERTY FOLDER "External")
# SGCT
set(SGCT_TEXT OFF CACHE BOOL "" FORCE)
set(SGCT_BUILD_CSHARP_PROJECTS OFF CACHE BOOL "" FORCE)
set(SGCT_LIGHT_ONLY ON CACHE BOOL "" FORCE)
set(SGCT_CUSTOMOUTPUTDIRS OFF CACHE BOOL "" FORCE)
set(JPEG_TURBO_WITH_SIMD OFF CACHE BOOL "" FORCE)
add_subdirectory(${OPENSPACE_EXT_DIR}/sgct)
target_include_directories(libOpenSpace SYSTEM PUBLIC ${OPENSPACE_EXT_DIR}/sgct/include)
target_link_libraries(
libOpenSpace
sgct_light glew glfw png16_static quat tinyxml2static turbojpeg-static
vrpn
${GLFW_LIBRARIES}
)
set_property(TARGET sgct_light PROPERTY FOLDER "External")
if (TARGET glew)
set_property(TARGET glew PROPERTY FOLDER "External/SGCT")
endif ()
if (TARGET glfw)
set_property(TARGET glfw PROPERTY FOLDER "External/SGCT")
endif ()
if (TARGET png16_static)
set_property(TARGET png16_static PROPERTY FOLDER "External/SGCT")
endif ()
if (TARGET quat)
set_property(TARGET quat PROPERTY FOLDER "External/SGCT")
endif ()
if (TARGET simd)
set_property(TARGET simd PROPERTY FOLDER "External/SGCT")
endif ()
if (TARGET tinyxml2static)
set_property(TARGET tinyxml2static PROPERTY FOLDER "External/SGCT")
endif ()
if (TARGET turbojpeg-static)
set_property(TARGET turbojpeg-static PROPERTY FOLDER "External/SGCT")
endif ()
if (TARGET vrpn)
set_property(TARGET vrpn PROPERTY FOLDER "External/SGCT")
endif ()
if (TARGET zlibstatic)
set_property(TARGET zlibstatic PROPERTY FOLDER "External/SGCT")
endif ()
if (UNIX AND (NOT APPLE))
target_link_libraries(libOpenSpace Xcursor Xinerama X11)
endif ()
# Spice
add_subdirectory(${OPENSPACE_EXT_DIR}/spice)
target_link_libraries(libOpenSpace Spice)
set_property(TARGET Spice PROPERTY FOLDER "External")
# Curl
if (WIN32)
set(CURL_ROOT_DIR "${OPENSPACE_EXT_DIR}/curl")
target_include_directories(libOpenSpace SYSTEM PUBLIC ${CURL_ROOT_DIR}/include)
target_link_libraries(libOpenSpace ${CURL_ROOT_DIR}/lib/libcurl_imp.lib)
target_compile_definitions(libOpenSpace PUBLIC "OPENSPACE_CURL_ENABLED" "CURL_STATICLIB")
else ()
find_package(CURL)
if (CURL_FOUND)
target_include_directories(libOpenSpace SYSTEM PUBLIC ${CURL_INCLUDE_DIRS})
target_link_libraries(libOpenSpace ${CURL_LIBRARIES})
target_compile_definitions(libOpenSpace PUBLIC "OPENSPACE_CURL_ENABLED")
endif ()
endif()
# Qt
# Unfortunately, we have to set this value manually; sigh
# In the future, if the Qt version is updated, just add to this variable ---abock
if (APPLE)
set(CMAKE_PREFIX_PATH
"~/Qt/5.6/clang_64/lib/cmake"
"~/Qt/5.7/clang_64/lib/cmake"
"~/Qt/5.8/clang_64/lib/cmake"
PARENT_SCOPE
)
endif ()
if (MSVC)
option(OPENSPACE_ENABLE_VLD "Enable the Visual Leak Detector" OFF)
handle_option_vld()
if (OPENSPACE_ENABLE_VLD)
target_compile_definitions(libOpenSpace PUBLIC "OPENSPACE_ENABLE_VLD")
target_link_libraries(libOpenSpace ${OPENSPACE_EXT_DIR}/vld/lib/vld.lib)
target_include_directories(libOpenSpace PUBLIC ${OPENSPACE_EXT_DIR}/vld)
endif ()
endif ()
##########################################################################################
# Tests #
##########################################################################################
option(OPENSPACE_HAVE_TESTS "Activate the OpenSpace unit tests" ON)
handle_option_tests()
if (OPENSPACE_HAVE_TESTS)
if (NOT TARGET gtest)
set(BUILD_GTEST ON CACHE BOOL "")
set(BUILD_GMOCK OFF CACHE BOOL "")
set(gtest_force_shared_crt ON CACHE BOOL "")
add_subdirectory(${OPENSPACE_EXT_DIR}/ghoul/ext/googletest)
set_property(TARGET gtest PROPERTY FOLDER "External")
set_property(TARGET gtest_main PROPERTY FOLDER "External")
endif ()
handle_internal_modules()
copy_dynamic_libraries()
file(GLOB_RECURSE OPENSPACE_TEST_FILES ${OPENSPACE_BASE_DIR}/tests/*.inl)
add_executable(OpenSpaceTest ${OPENSPACE_BASE_DIR}/tests/main.cpp ${OPENSPACE_TEST_FILES})
target_include_directories(OpenSpaceTest PUBLIC
"${OPENSPACE_BASE_DIR}/include"
"${OPENSPACE_BASE_DIR}/tests"
"${OPENSPACE_EXT_DIR}/ghoul/ext/googletest/googletest/include"
)
target_compile_definitions(OpenSpaceTest PUBLIC
"GHL_THROW_ON_ASSERT"
"GTEST_HAS_TR1_TUPLE=0"
)
target_link_libraries(OpenSpaceTest gtest libOpenSpace)
if (MSVC)
set_target_properties(OpenSpaceTest PROPERTIES LINK_FLAGS
"/NODEFAULTLIB:LIBCMTD.lib /NODEFAULTLIB:LIBCMT.lib"
)
endif ()
set_openspace_compile_settings(OpenSpaceTest)
endif (OPENSPACE_HAVE_TESTS)
if (TARGET GhoulTest)
if (NOT TARGET gtest)
set(BUILD_GTEST ON CACHE BOOL "")
set(BUILD_GMOCK OFF CACHE BOOL "")
set(gtest_force_shared_crt ON CACHE BOOL "")
add_subdirectory(${OPENSPACE_EXT_DIR}/ghoul/ext/googletest)
endif ()
set_property(TARGET gtest PROPERTY FOLDER "External")
set_property(TARGET GhoulTest PROPERTY FOLDER "Unit Tests")
endif ()
set(OPENSPACE_EXTERNAL_MODULES_PATHS "" CACHE STRING "List of external modules")
handle_modules("${OPENSPACE_BASE_DIR}/modules" "${OPENSPACE_EXTERNAL_MODULES_PATHS}")
handle_applications()
##########################################################################################
# Misc settings #
##########################################################################################
# Just in case, create the bin directory
add_custom_command(
TARGET libOpenSpace
PRE_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
)
# Manage the CPack packaging
include(${OPENSPACE_CMAKE_EXT_DIR}/packaging.cmake)
Vendored
+6 -3
View File
@@ -26,7 +26,8 @@ echo flags
stage('Build') {
parallel linux: {
node('linux') {
timeout(time: 30, unit: 'MINUTES') {
timeout(time: 45, unit: 'MINUTES') {
deleteDir()
checkout scm
sh 'git submodule update --init --recursive'
sh '''
@@ -41,7 +42,8 @@ stage('Build') {
},
windows: {
node('windows') {
timeout(time: 30, unit: 'MINUTES') {
timeout(time: 45, unit: 'MINUTES') {
deleteDir()
checkout scm
bat '''
git submodule update --init --recursive
@@ -56,7 +58,8 @@ stage('Build') {
},
osx: {
node('osx') {
timeout(time: 30, unit: 'MINUTES') {
timeout(time: 45, unit: 'MINUTES') {
deleteDir()
checkout scm
sh 'git submodule update --init --recursive'
sh '''
+33 -41
View File
@@ -2,7 +2,7 @@
# #
# OpenSpace #
# #
# Copyright (c) 2014-2015 #
# Copyright (c) 2014-2017 #
# #
# 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,64 +22,56 @@
# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #
#########################################################################################
set(APPLICATION_NAME Launcher)
set(APPLICATION_LINK_TO_OPENSPACE ON)
if (WIN32)
set(RESOURCE_FILE ${OPENSPACE_APPS_DIR}/Launcher/openspace.rc)
endif ()
include(${OPENSPACE_CMAKE_EXT_DIR}/application_definition.cmake)
include(${GHOUL_BASE_DIR}/support/cmake/handle_external_library.cmake)
include(${OPENSPACE_CMAKE_EXT_DIR}/support_macros.cmake)
set(application_path ${OPENSPACE_APPS_DIR}/Launcher)
set(SOURCE_FILES
${application_path}/main.cpp
${application_path}/infowidget.cpp
${application_path}/mainwindow.cpp
${application_path}/shortcutwidget.cpp
${application_path}/syncwidget.cpp
${CMAKE_CURRENT_SOURCE_DIR}/main.cpp
${CMAKE_CURRENT_SOURCE_DIR}/infowidget.cpp
${CMAKE_CURRENT_SOURCE_DIR}/mainwindow.cpp
${CMAKE_CURRENT_SOURCE_DIR}/shortcutwidget.cpp
${CMAKE_CURRENT_SOURCE_DIR}/syncwidget.cpp
)
set(HEADER_FILES
${application_path}/infowidget.h
${application_path}/mainwindow.h
${application_path}/shortcutwidget.h
${application_path}/syncwidget.h
)
${CMAKE_CURRENT_SOURCE_DIR}/infowidget.h
${CMAKE_CURRENT_SOURCE_DIR}/mainwindow.h
${CMAKE_CURRENT_SOURCE_DIR}/shortcutwidget.h
${CMAKE_CURRENT_SOURCE_DIR}/syncwidget.h
)
find_package(Qt5Core REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5Network REQUIRED)
find_package(Qt5 COMPONENTS Core Widgets Network REQUIRED)
set(MOC_FILES "")
qt5_wrap_cpp(MOC_FILES ${HEADER_FILES})
set(RESOURCE_FILES "")
qt5_add_resources(RESOURCE_FILES ${application_path}/files.qrc)
qt5_add_resources(RESOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/files.qrc)
add_executable(${APPLICATION_NAME} MACOSX_BUNDLE
create_new_application(
Launcher
MACOSX_BUNDLE
${SOURCE_FILES}
${HEADER_FILES}
${OPENSPACE_APPS_DIR}/Launcher/openspace.rc
${MOC_FILES}
${RESOURCE_FILE}
${RESOURCE_FILES}
)
set_compile_settings(${APPLICATION_NAME})
target_link_libraries(${APPLICATION_NAME}
target_link_libraries(
Launcher
libOpenSpace
Qt5::Widgets
Qt5::Network
)
#if (APPLE)
# INSTALL(CODE "
# include(BundleUtilities)
# fixup_bundle(\"${application_path}/bin/openspace/Debug/Launcher.app/Contents/MacOS/Launcher\" \"${application_path}/bin/openspace/Debug/TimelineView.app/Contents/plugins/platforms/libqcocoa.dylib\" \"\")
# " COMPONENT Runtime)
#endif ()
#####
# Libtorrent
include_external_library(${APPLICATION_NAME} libtorrent ${application_path}/ext/libtorrent)
target_include_directories(${APPLICATION_NAME} SYSTEM PUBLIC ${application_path}/ext/libtorrent/include)
#####
include_external_library(
Launcher
libtorrent
${CMAKE_CURRENT_SOURCE_DIR}/ext/libtorrent
)
target_include_directories(
Launcher
SYSTEM PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/ext/libtorrent/include
)
+1
View File
@@ -0,0 +1 @@
set(DEFAULT_APPLICATION ON)
+43 -61
View File
@@ -22,20 +22,14 @@
# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #
##########################################################################################
include(${GHOUL_BASE_DIR}/support/cmake/CopySharedLibraries.cmake)
include(${OPENSPACE_CMAKE_EXT_DIR}/support_macros.cmake)
set(APPLICATION_NAME OpenSpace)
set(APPLICATION_LINK_TO_OPENSPACE ON)
if (WIN32)
set(RESOURCE_FILE ${OPENSPACE_APPS_DIR}/OpenSpace/openspace.rc)
endif ()
include(${GHOUL_BASE_DIR}/support/cmake/copy_shared_libraries.cmake)
include(${OPENSPACE_CMAKE_EXT_DIR}/application_definition.cmake)
include(${OPENSPACE_CMAKE_EXT_DIR}/global_variables.cmake)
########################
# OpenVR section start #
########################
#####
# OpenVR
#####
option(OPENSPACE_OPENVR_SUPPORT "Build OpenSpace application with OpenVR support" OFF)
if (OPENSPACE_OPENVR_SUPPORT)
@@ -45,91 +39,79 @@ if (OPENSPACE_OPENVR_SUPPORT)
set(SGCT_OPENVR_DEFINITIONS OPENVR_SUPPORT)
if(NOT SGCT_OPENVR_INCLUDE_DIRECTORY)
if( WIN32 )
if (NOT SGCT_OPENVR_INCLUDE_DIRECTORY)
if (WIN32)
find_path(SGCT_OPENVR_INCLUDE_DIRECTORY
NAMES SGCTOpenVR.h
PATHS $ENV{SGCT_ROOT_DIR}/additional_includes/openvr ${OPENSPACE_EXT_DIR}/sgct/additional_includes/openvr NO_DEFAULT_PATH
REQUIRED)
else()
PATHS
$ENV{SGCT_ROOT_DIR}/additional_includes/openvr
${OPENSPACE_EXT_DIR}/sgct/additional_includes/openvr
NO_DEFAULT_PATH
REQUIRED
)
else ()
find_path(SGCT_OPENVR_INCLUDE_DIRECTORY
NAMES SGCTOpenVR.h
PATH_SUFFIXES SGCTOpenVR
PATHS $ENV{SGCT_ROOT_DIR}/additional_includes/openvr ${OPENSPACE_EXT_DIR}/sgct/additional_includes/openvr
REQUIRED)
endif()
PATHS
$ENV{SGCT_ROOT_DIR}/additional_includes/openvr
${OPENSPACE_EXT_DIR}/sgct/additional_includes/openvr
REQUIRED
)
endif ()
else()
set(SGCT_OPENVR_FILES ${SGCT_OPENVR_INCLUDE_DIRECTORY}/SGCTOpenVR.h ${SGCT_OPENVR_INCLUDE_DIRECTORY}/SGCTOpenVR.cpp)
set(
SGCT_OPENVR_FILES
${SGCT_OPENVR_INCLUDE_DIRECTORY}/SGCTOpenVR.h
${SGCT_OPENVR_INCLUDE_DIRECTORY}/SGCTOpenVR.cpp
)
endif()
else()
set(OPENVR_INCLUDE_DIRS "")
set(SGCT_OPENVR_INCLUDE_DIRECTORY "")
set(OPENVR_LIBRARY "")
set(SGCT_OPENVR_DEFINITIONS "")
endif()
########################
# OpenVR section end #
########################
########################
# Spout section start #
########################
#####
# Spout
#####
if (WIN32)
option(OPENSPACE_SPOUT_SUPPORT "Build OpenSpace application with Spout support" OFF)
endif ()
set(SPOUT_INCLUDE_DIRS "")
set(SPOUT_LIBRARY "")
set(SPOUT_DEFINITIONS "")
if (OPENSPACE_SPOUT_SUPPORT)
set(SPOUT_INCLUDE_DIRS ${OPENSPACE_APPS_DIR}/OpenSpace/ext/spout)
set(SPOUT_LIBRARY ${OPENSPACE_APPS_DIR}/OpenSpace/ext/spout/SpoutLibrary.lib)
set(SPOUT_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/ext/spout)
set(SPOUT_LIBRARY ${CMAKE_CURRENT_SOURCE_DIR}/ext/spout/SpoutLibrary.lib)
set(SPOUT_DEFINITIONS "OPENSPACE_HAS_SPOUT")
set(SGCT_SPOUT_SUPPORT ON CACHE BOOL "" FORCE)
endif ()
########################
# Spout section end #
########################
add_executable(${APPLICATION_NAME}
${SGCT_OPENVR_FILES}
${OPENSPACE_APPS_DIR}/OpenSpace/main.cpp
${RESOURCE_FILE}
)
if (OPENSPACE_SPOUT_SUPPORT)
ghl_copy_files(
${APPLICATION_NAME}
${OPENSPACE_APPS_DIR}/OpenSpace/ext/spout/SpoutLibrary.dll
)
add_external_library_dependencies(${CMAKE_CURRENT_SOURCE_DIR}/ext/spout/SpoutLibrary.dll)
endif ()
create_new_application(OpenSpace
${SGCT_OPENVR_FILES}
${CMAKE_CURRENT_SOURCE_DIR}/main.cpp
${CMAKE_CURRENT_SOURCE_DIR}/openspace.rc
)
target_include_directories(
${APPLICATION_NAME} PUBLIC
${OPENSPACE_BASE_DIR}/include
OpenSpace PRIVATE
${OPENVR_INCLUDE_DIRS}
${SGCT_OPENVR_INCLUDE_DIRECTORY}
${SPOUT_INCLUDE_DIRS}
)
target_link_libraries(${APPLICATION_NAME}
target_link_libraries(OpenSpace
libOpenSpace
${OPENVR_LIBRARY}
${SPOUT_LIBRARY}
)
target_compile_definitions(${APPLICATION_NAME} PUBLIC
target_compile_definitions(OpenSpace PRIVATE
${SGCT_OPENVR_DEFINITIONS}
${SPOUT_DEFINITIONS}
)
if (MSVC)
target_link_libraries(${APPLICATION_NAME} Dbghelp.lib)
set_target_properties(${APPLICATION_NAME} PROPERTIES LINK_FLAGS
"/NODEFAULTLIB:LIBCMTD.lib /NODEFAULTLIB:LIBCMT.lib"
)
# This library is used for being able to output the callstack if an exception escapes
target_link_libraries(OpenSpace Dbghelp.lib)
endif()
set_compile_settings(${APPLICATION_NAME})
+1
View File
@@ -0,0 +1 @@
set(DEFAULT_APPLICATION ON)
+31 -36
View File
@@ -1,41 +1,36 @@
#########################################################################################
# #
# OpenSpace #
# #
# Copyright (c) 2014-2016 #
# #
# 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. #
#########################################################################################
##########################################################################################
# #
# OpenSpace #
# #
# Copyright (c) 2014-2017 #
# #
# 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. #
##########################################################################################
set(APPLICATION_NAME TaskRunner)
set(APPLICATION_LINK_TO_OPENSPACE ON)
include(${OPENSPACE_CMAKE_EXT_DIR}/application_definition.cmake)
include (${GHOUL_BASE_DIR}/support/cmake/handle_external_library.cmake)
include(${OPENSPACE_CMAKE_EXT_DIR}/support_macros.cmake)
set(application_path ${OPENSPACE_APPS_DIR}/TaskRunner)
set(SOURCE_FILES
${application_path}/main.cpp
create_new_application(
TaskRunner
MACOSX_BUNDLE
${CMAKE_CURRENT_SOURCE_DIR}/main.cpp
)
add_executable(${APPLICATION_NAME} MACOSX_BUNDLE
${SOURCE_FILES}
target_link_libraries(
TaskRunner
libOpenSpace
)
set_compile_settings(${APPLICATION_NAME})
+4 -2
View File
@@ -2,7 +2,7 @@
# #
# OpenSpace #
# #
# Copyright (c) 2014-2015 #
# Copyright (c) 2014-2017 #
# #
# 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,6 +22,8 @@
# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #
#########################################################################################
include(${OPENSPACE_CMAKE_EXT_DIR}/application_definition.cmake)
set(APPLICATION_NAME TimelineView)
set(APPLICATION_LINK_TO_OPENSPACE OFF)
@@ -48,7 +50,7 @@ find_package(Qt5Network)
set(MOC_FILES "")
qt5_wrap_cpp(MOC_FILES ${HEADER_FILES})
add_executable(${APPLICATION_NAME} MACOSX_BUNDLE ${SOURCE_FILES} ${HEADER_FILES} ${MOC_FILES})
create_new_application(${APPLICATION_NAME} MACOSX_BUNDLE ${SOURCE_FILES} ${HEADER_FILES} ${MOC_FILES})
target_link_libraries(${APPLICATION_NAME}
Qt5::Widgets
+1 -1
View File
@@ -426,7 +426,7 @@ struct LessVerifier : public OperatorVerifier<T, std::less<typename T::Type>> {
using OperatorVerifier<T, std::less<typename T::Type>>::OperatorVerifier;
std::string documentation() const;
std::string documentation() const override;
using OperatorVerifier<T, std::less<typename T::Type>>::value;
};
+28 -28
View File
@@ -38,14 +38,14 @@ TestResult TemplateVerifier<T>::operator()(const ghoul::Dictionary& dict,
const std::string& key) const
{
if (dict.hasKeyAndValue<Type>(key)) {
return { true, {} };
return { true, {}, {} };
}
else {
if (dict.hasKey(key)) {
return { false, { { key, TestResult::Offense::Reason::WrongType } } };
return { false, { { key, TestResult::Offense::Reason::WrongType } }, {} };
}
else {
return { false, { { key, TestResult::Offense::Reason::MissingKey } } };
return { false, { { key, TestResult::Offense::Reason::MissingKey } }, {} };
}
}
}
@@ -116,8 +116,8 @@ std::string Matrix4x4Verifier<T>::type() const {
}
template <typename T, typename Operator>
OperatorVerifier<T, Operator>::OperatorVerifier(typename T::Type value)
: value(std::move(value))
OperatorVerifier<T, Operator>::OperatorVerifier(typename T::Type val)
: value(std::move(val))
{}
template <typename T, typename Operator>
@@ -127,10 +127,10 @@ TestResult OperatorVerifier<T, Operator>::operator()(const ghoul::Dictionary& di
TestResult res = T::operator()(dict, key);
if (res.success) {
if (Operator()(dict.value<typename T::Type>(key), value)) {
return { true, {} };
return { true, {}, {} };
}
else {
return { false, { { key, TestResult::Offense::Reason::Verification }}};
return { false, { { key, TestResult::Offense::Reason::Verification } }, {} };
}
}
else {
@@ -169,8 +169,8 @@ std::string UnequalVerifier<T>::documentation() const {
}
template <typename T>
InListVerifier<T>::InListVerifier(std::vector<typename T::Type> values)
: values(std::move(values))
InListVerifier<T>::InListVerifier(std::vector<typename T::Type> vals)
: values(std::move(vals))
{}
template <typename T>
@@ -184,10 +184,10 @@ TestResult InListVerifier<T>::operator()(const ghoul::Dictionary& dict,
auto it = std::find(values.begin(), values.end(), value);
if (it != values.end()) {
return { true, {} };
return { true, {}, {} };
}
else {
return { false, { { key, TestResult::Offense::Reason::Verification } } };
return { false, { { key, TestResult::Offense::Reason::Verification } }, {} };
}
}
else {
@@ -215,8 +215,8 @@ std::string InListVerifier<T>::documentation() const {
}
template <typename T>
NotInListVerifier<T>::NotInListVerifier(std::vector<typename T::Type> values)
: values(std::move(values))
NotInListVerifier<T>::NotInListVerifier(std::vector<typename T::Type> vals)
: values(std::move(vals))
{}
template <typename T>
@@ -230,10 +230,10 @@ TestResult NotInListVerifier<T>::operator()(const ghoul::Dictionary& dict,
auto it = std::find(values.begin(), values.end(), value);
if (it == values.end()) {
return { true, {} };
return { true, {}, {} };
}
else {
return { false, { { key, TestResult::Offense::Reason::Verification } } };
return { false, { { key, TestResult::Offense::Reason::Verification } }, {} };
}
}
else {
@@ -261,9 +261,9 @@ std::string NotInListVerifier<T>::documentation() const {
}
template <typename T>
InRangeVerifier<T>::InRangeVerifier(typename T::Type lower, typename T::Type upper)
: lower(std::move(lower))
, upper(std::move(upper))
InRangeVerifier<T>::InRangeVerifier(typename T::Type l, typename T::Type u)
: lower(std::move(l))
, upper(std::move(u))
{
ghoul_assert(lower <= upper, "lower must be smaller or equal to upper");
}
@@ -277,10 +277,10 @@ TestResult InRangeVerifier<T>::operator()(const ghoul::Dictionary& dict,
typename T::Type val = dict.value<typename T::Type>(key);
if (val >= lower && val <= upper) {
return { true, {} };
return { true, {}, {} };
}
else {
return { false, { { key, TestResult::Offense::Reason::Verification } } };
return { false, { { key, TestResult::Offense::Reason::Verification } }, {} };
}
}
else {
@@ -295,9 +295,9 @@ std::string InRangeVerifier<T>::documentation() const {
}
template <typename T>
NotInRangeVerifier<T>::NotInRangeVerifier(typename T::Type lower, typename T::Type upper)
: lower(std::move(lower))
, upper(std::move(upper))
NotInRangeVerifier<T>::NotInRangeVerifier(typename T::Type l, typename T::Type u)
: lower(std::move(l))
, upper(std::move(u))
{
ghoul_assert(lower <= upper, "lower must be smaller or equal to upper");
}
@@ -310,10 +310,10 @@ TestResult NotInRangeVerifier<T>::operator()(const ghoul::Dictionary& dict,
typename T::Type val = dict.value<typename T::Type>(key);
if (val >= lower && val <= upper) {
return { false, { { key, TestResult::Offense::Reason::Verification } } };
return { false, { { key, TestResult::Offense::Reason::Verification } }, {} };
}
else {
return { true, {} };
return { true, {}, {} };
}
}
else {
@@ -329,10 +329,10 @@ std::string NotInRangeVerifier<T>::documentation() const {
template <typename T>
AnnotationVerifier<T>::AnnotationVerifier(std::string annotation)
: annotation(std::move(annotation))
AnnotationVerifier<T>::AnnotationVerifier(std::string a)
: annotation(std::move(a))
{
ghoul_assert(!this->annotation.empty(), "Annotation must not be empty");
ghoul_assert(!annotation.empty(), "Annotation must not be empty");
}
template <typename T>
+2 -2
View File
@@ -90,8 +90,8 @@ public:
template <class ModuleSubClass>
ModuleSubClass* module() const {
auto it = std::find_if(_modules.begin(), _modules.end(),
[](const std::unique_ptr<OpenSpaceModule>& module) {
return module->name() == ModuleSubClass::Name;
[](const std::unique_ptr<OpenSpaceModule>& m) {
return m->name() == ModuleSubClass::Name;
});
if (it != _modules.end()) {
return dynamic_cast<ModuleSubClass*>(it->get());
@@ -30,14 +30,15 @@ namespace openspace::interaction {
template <typename T>
Interpolator<T>::Interpolator()
: _transferFunction([](float t){ return t; })
, _t(0.0)
, _interpolationTime(1.0) {};
: _transferFunction([](float t){ return t; })
, _t(0.0)
, _interpolationTime(1.0)
{}
template <typename T>
void Interpolator<T>::start() {
_t = 0.0;
};
}
template <typename T>
void Interpolator<T>::end() {
@@ -75,8 +75,6 @@ private:
std::string generateJson() const override;
bool _cameraUpdatedFromScript = false;
std::multimap<KeyWithModifier, KeyInformation> _keyLua;
};
@@ -70,6 +70,8 @@ private:
properties::BoolProperty roll;
properties::BoolProperty rotational;
properties::BoolProperty zoom;
properties::FloatProperty friction;
};
Friction _friction;
@@ -77,7 +79,6 @@ private:
properties::FloatProperty _followFocusNodeRotationDistance;
properties::FloatProperty _minimumAllowedDistance;
properties::FloatProperty _sensitivity;
properties::FloatProperty _motionLag;
MouseStates _mouseStates;
@@ -96,11 +97,9 @@ private:
* from the global to the current total rotation so that
* <code>cameraRotation = globalRotation * localRotation</code>.
*/
CameraRotationDecomposition decomposeCameraRotation(
const glm::dvec3& cameraPosition,
const glm::dquat& cameraRotation,
const glm::dvec3& cameraLookUp,
const glm::dvec3& cameraViewDirection);
CameraRotationDecomposition decomposeCameraRotation(const glm::dvec3& cameraPosition,
const glm::dquat& cameraRotation, const glm::dvec3& cameraLookUp,
const glm::dvec3& cameraViewDirection);
/*
* Perform a camera roll on the local camera rotation
@@ -28,7 +28,7 @@
#include <string>
#include <vector>
#include <glm/gtx/quaternion.hpp>
//#include <glm/gtx/quaternion.hpp>
#include <openspace/util/camera.h>
@@ -72,6 +72,7 @@ public:
bool loggingEnabled() const;
PerformanceLayout* performanceData();
private:
bool _doPerformanceMeasurements;
bool _loggingEnabled;
@@ -31,7 +31,7 @@
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(DMat2Property, glm::dmat2x2);
REGISTER_NUMERICALPROPERTY_HEADER(DMat2Property, glm::dmat2x2)
} // namespace openspace::properties
@@ -31,7 +31,7 @@
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(DMat2x3Property, glm::dmat2x3);
REGISTER_NUMERICALPROPERTY_HEADER(DMat2x3Property, glm::dmat2x3)
} // namespace openspace::properties
@@ -31,7 +31,7 @@
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(DMat2x4Property, glm::dmat2x4);
REGISTER_NUMERICALPROPERTY_HEADER(DMat2x4Property, glm::dmat2x4)
} // namespace openspace::properties
@@ -31,7 +31,7 @@
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(DMat3Property, glm::dmat3x3);
REGISTER_NUMERICALPROPERTY_HEADER(DMat3Property, glm::dmat3x3)
} // namespace openspace::properties
@@ -31,7 +31,7 @@
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(DMat3x2Property, glm::dmat3x2);
REGISTER_NUMERICALPROPERTY_HEADER(DMat3x2Property, glm::dmat3x2)
} // namespace openspace::properties
@@ -31,7 +31,7 @@
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(DMat3x4Property, glm::dmat3x4);
REGISTER_NUMERICALPROPERTY_HEADER(DMat3x4Property, glm::dmat3x4)
} // namespace openspace::properties
@@ -31,7 +31,7 @@
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(DMat4Property, glm::dmat4x4);
REGISTER_NUMERICALPROPERTY_HEADER(DMat4Property, glm::dmat4x4)
} // namespace openspace::properties
@@ -31,7 +31,7 @@
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(DMat4x2Property, glm::dmat4x2);
REGISTER_NUMERICALPROPERTY_HEADER(DMat4x2Property, glm::dmat4x2)
} // namespace openspace::properties
@@ -31,7 +31,7 @@
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(DMat4x3Property, glm::dmat4x3);
REGISTER_NUMERICALPROPERTY_HEADER(DMat4x3Property, glm::dmat4x3)
} // namespace openspace::properties
@@ -31,7 +31,7 @@
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(Mat2Property, glm::mat2x2);
REGISTER_NUMERICALPROPERTY_HEADER(Mat2Property, glm::mat2x2)
} // namespace openspace::properties
@@ -31,7 +31,7 @@
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(Mat2x3Property, glm::mat2x3);
REGISTER_NUMERICALPROPERTY_HEADER(Mat2x3Property, glm::mat2x3)
} // namespace openspace::properties
@@ -31,7 +31,7 @@
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(Mat2x4Property, glm::mat2x4);
REGISTER_NUMERICALPROPERTY_HEADER(Mat2x4Property, glm::mat2x4)
} // namespace openspace::properties
@@ -31,7 +31,7 @@
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(Mat3Property, glm::mat3x3);
REGISTER_NUMERICALPROPERTY_HEADER(Mat3Property, glm::mat3x3)
} // namespace openspace::properties
@@ -31,7 +31,7 @@
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(Mat3x2Property, glm::mat3x2);
REGISTER_NUMERICALPROPERTY_HEADER(Mat3x2Property, glm::mat3x2)
} // namespace openspace::properties
@@ -31,7 +31,7 @@
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(Mat3x4Property, glm::mat3x4);
REGISTER_NUMERICALPROPERTY_HEADER(Mat3x4Property, glm::mat3x4)
} // namespace openspace::properties
@@ -31,7 +31,7 @@
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(Mat4Property, glm::mat4x4);
REGISTER_NUMERICALPROPERTY_HEADER(Mat4Property, glm::mat4x4)
} // namespace openspace::properties
@@ -31,7 +31,7 @@
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(Mat4x2Property, glm::mat4x2);
REGISTER_NUMERICALPROPERTY_HEADER(Mat4x2Property, glm::mat4x2)
} // namespace openspace::properties
@@ -31,7 +31,7 @@
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(Mat4x3Property, glm::mat4x3);
REGISTER_NUMERICALPROPERTY_HEADER(Mat4x3Property, glm::mat4x3)
} // namespace openspace::properties
@@ -60,7 +60,7 @@ protected:
static const std::string MaximumValueKey;
static const std::string SteppingValueKey;
std::string generateAdditionalDescription() const;
std::string generateAdditionalDescription() const override;
T _minimumValue;
T _maximumValue;
@@ -80,7 +80,7 @@ namespace openspace::properties {
template <> \
template <> \
TYPE PropertyDelegate<NumericalProperty<TYPE>>::fromString(std::string value, \
bool& success); \
bool& success); \
\
template <> \
template <> \
@@ -149,16 +149,16 @@ namespace openspace::properties {
\
template <> \
template <> \
TYPE PropertyDelegate<NumericalProperty<TYPE>>::fromLuaValue<TYPE>( \
lua_State* state, bool& success) \
TYPE PropertyDelegate<NumericalProperty<TYPE>>::fromLuaValue<TYPE>(lua_State* state, \
bool& success) \
{ \
return PropertyDelegate<TemplateProperty<TYPE>>::fromLuaValue<TYPE>(state, \
success); \
return PropertyDelegate<TemplateProperty<TYPE>>::fromLuaValue<TYPE>( \
state, success); \
} \
\
template <> \
template <> \
bool PropertyDelegate<TemplateProperty<TYPE>>::toLuaValue<TYPE>(lua_State * state, \
bool PropertyDelegate<TemplateProperty<TYPE>>::toLuaValue<TYPE>(lua_State* state, \
TYPE value) \
{ \
return TO_LUA_LAMBDA_EXPRESSION(state, value); \
@@ -166,7 +166,7 @@ namespace openspace::properties {
\
template <> \
template <> \
bool PropertyDelegate<NumericalProperty<TYPE>>::toLuaValue<TYPE>(lua_State * state, \
bool PropertyDelegate<NumericalProperty<TYPE>>::toLuaValue<TYPE>(lua_State* state, \
TYPE value) \
{ \
return PropertyDelegate<TemplateProperty<TYPE>>::toLuaValue<TYPE>(state, value); \
@@ -195,10 +195,12 @@ namespace openspace::properties {
template <> \
template <> \
TYPE PropertyDelegate<NumericalProperty<TYPE>>::fromString(std::string value, \
bool& success) \
bool& success) \
{ \
return PropertyDelegate<TemplateProperty<TYPE>>::fromString<TYPE>(value, \
success); \
return PropertyDelegate<TemplateProperty<TYPE>>::fromString<TYPE>( \
value, \
success \
); \
} \
\
template <> \
@@ -278,8 +280,7 @@ std::string NumericalProperty<T>::className() const {
}
template <typename T>
bool NumericalProperty<T>::setLuaValue(lua_State* state)
{
bool NumericalProperty<T>::setLuaValue(lua_State* state) {
bool success = false;
T value = PropertyDelegate<NumericalProperty<T>>::template fromLuaValue<T>(
state, success
@@ -290,8 +291,7 @@ bool NumericalProperty<T>::setLuaValue(lua_State* state)
}
template <typename T>
bool NumericalProperty<T>::getLuaValue(lua_State* state) const
{
bool NumericalProperty<T>::getLuaValue(lua_State* state) const {
bool success = PropertyDelegate<NumericalProperty<T>>::template toLuaValue<T>(
state, TemplateProperty<T>::_value
);
@@ -125,7 +125,7 @@ public:
private:
static const std::string OptionsKey;
std::string generateAdditionalDescription() const;
std::string generateAdditionalDescription() const override;
/// The list of options which have been registered with this OptionProperty
std::vector<Option> _options;
@@ -30,6 +30,7 @@ template <typename T>
std::string PropertyDelegate<T>::className() {
static_assert(sizeof(T) == 0,
"Unimplemented PropertyDelegate::className specialization");
return "";
}
template <typename T>
@@ -62,34 +63,37 @@ U PropertyDelegate<T>::defaultSteppingValue() {
template <typename T>
template <typename U>
U PropertyDelegate<T>::fromLuaValue(lua_State* state, bool& success) {
U PropertyDelegate<T>::fromLuaValue(lua_State*, bool&) {
static_assert(sizeof(T) == 0,
"Unimplemented PropertyDelegate::fromLuaValue specialization");
}
template <typename T>
template <typename U>
bool PropertyDelegate<T>::toLuaValue(lua_State* state, U value) {
bool PropertyDelegate<T>::toLuaValue(lua_State*, U) {
static_assert(sizeof(T) == 0,
"Unimplemented PropertyDelegate::toLuaValue specialization");
return false;
}
template <typename T>
int PropertyDelegate<T>::typeLua() {
static_assert(sizeof(T) == 0,
"Unimplemented PropertyDelegate::luaType specialization");
return 0;
}
template <typename T>
template <typename U>
bool PropertyDelegate<T>::toString(std::string& outValue, U inValue) {
bool PropertyDelegate<T>::toString(std::string&, U) {
static_assert(sizeof(T) == 0,
"Unimplemented PropertyDelegate::toString specialization");
return false;
}
template <typename T>
template <typename U>
U PropertyDelegate<T>::fromString(std::string value, bool& success) {
U PropertyDelegate<T>::fromString(std::string, bool&) {
static_assert(sizeof(T) == 0,
"Unimplemented PropertyDelegate::fromString specialization");
}
+1 -1
View File
@@ -54,7 +54,7 @@ public:
struct PropertyOwnerInfo {
std::string name;
std::string description;
std::string description = "";
};
/// The constructor initializing the PropertyOwner's name to <code>""</code>
@@ -44,7 +44,7 @@
namespace openspace::properties {
REGISTER_TEMPLATEPROPERTY_HEADER(BoolProperty, bool);
REGISTER_TEMPLATEPROPERTY_HEADER(BoolProperty, bool)
} // namespace openspace::properties
@@ -44,7 +44,7 @@
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(CharProperty, char);
REGISTER_NUMERICALPROPERTY_HEADER(CharProperty, char)
} // namespace openspace::properties
@@ -44,7 +44,7 @@
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(DoubleProperty, double);
REGISTER_NUMERICALPROPERTY_HEADER(DoubleProperty, double)
} // namespace openspace::properties
@@ -44,7 +44,7 @@
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(FloatProperty, float);
REGISTER_NUMERICALPROPERTY_HEADER(FloatProperty, float)
} // namespace openspace::properties
@@ -44,7 +44,7 @@
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(IntProperty, int);
REGISTER_NUMERICALPROPERTY_HEADER(IntProperty, int)
} // namespace openspace::properties
@@ -44,7 +44,7 @@
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(LongDoubleProperty, long double);
REGISTER_NUMERICALPROPERTY_HEADER(LongDoubleProperty, long double)
} // namespace openspace::properties
@@ -44,7 +44,7 @@
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(LongLongProperty, long long);
REGISTER_NUMERICALPROPERTY_HEADER(LongLongProperty, long long)
} // namespace openspace::properties
@@ -44,7 +44,7 @@
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(LongProperty, long);
REGISTER_NUMERICALPROPERTY_HEADER(LongProperty, long)
} // namespace openspace::properties
@@ -44,7 +44,7 @@
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(ShortProperty, short);
REGISTER_NUMERICALPROPERTY_HEADER(ShortProperty, short)
} // namespace openspace::properties
@@ -44,7 +44,7 @@
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(SignedCharProperty, signed char);
REGISTER_NUMERICALPROPERTY_HEADER(SignedCharProperty, signed char)
} // namespace openspace::properties
@@ -44,7 +44,7 @@
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(UCharProperty, unsigned char);
REGISTER_NUMERICALPROPERTY_HEADER(UCharProperty, unsigned char)
} // namespace openspace::properties
@@ -44,7 +44,7 @@
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(UIntProperty, unsigned int);
REGISTER_NUMERICALPROPERTY_HEADER(UIntProperty, unsigned int)
} // namespace openspace::properties
@@ -44,7 +44,7 @@
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(ULongLongProperty, unsigned long long);
REGISTER_NUMERICALPROPERTY_HEADER(ULongLongProperty, unsigned long long)
} // namespace openspace::properties
@@ -44,7 +44,7 @@
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(ULongProperty, unsigned long);
REGISTER_NUMERICALPROPERTY_HEADER(ULongProperty, unsigned long)
} // namespace openspace::properties
@@ -44,7 +44,7 @@
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(UShortProperty, unsigned short);
REGISTER_NUMERICALPROPERTY_HEADER(UShortProperty, unsigned short)
} // namespace openspace::properties
@@ -44,7 +44,7 @@
namespace openspace::properties {
//REGISTER_NUMERICALPROPERTY_HEADER(WCharProperty, wchar_t);
//REGISTER_NUMERICALPROPERTY_HEADER(WCharProperty, wchar_t)
} // namespace openspace::properties
@@ -51,7 +51,7 @@ public:
private:
static const std::string OptionsKey;
std::string generateAdditionalDescription() const;
std::string generateAdditionalDescription() const override;
/// The list of options which have been registered with this OptionProperty
std::vector<Option> _options;
@@ -29,7 +29,7 @@
namespace openspace::properties {
REGISTER_TEMPLATEPROPERTY_HEADER(StringProperty, std::string);
REGISTER_TEMPLATEPROPERTY_HEADER(StringProperty, std::string)
} // namespace openspace::properties
@@ -26,16 +26,16 @@
namespace openspace::properties {
// The following macros can be used to quickly generate the necessary PropertyDelegate
// specializations required by the TemplateProperty class. Use the
// REGISTER_TEMPLATEPROPERTY_HEADER macro in the header file and the
// REGISTER_TEMPLATEPROPERTY_SOURCE macro in the source file of your new specialization of
// a TemplateProperty
// The following macros can be used to quickly generate the necessary PropertyDelegate
// specializations required by the TemplateProperty class. Use the
// REGISTER_TEMPLATEPROPERTY_HEADER macro in the header file and the
// REGISTER_TEMPLATEPROPERTY_SOURCE macro in the source file of your new specialization of
// a TemplateProperty
// CLASS_NAME = The string that the Property::className() should return as well as the
// C++ class name for which a typedef will be created
// TYPE = The template parameter T for which the TemplateProperty is specialized
// CLASS_NAME = The string that the Property::className() should return as well as the
// C++ class name for which a typedef will be created
// TYPE = The template parameter T for which the TemplateProperty is specialized
#define REGISTER_TEMPLATEPROPERTY_HEADER(CLASS_NAME, TYPE) \
using CLASS_NAME = TemplateProperty<TYPE>; \
\
@@ -105,40 +105,38 @@ namespace openspace::properties {
\
template <> \
template <> \
TYPE PropertyDelegate<TemplateProperty<TYPE>>::fromLuaValue<TYPE>(lua_State * state, \
bool& success) \
TYPE PropertyDelegate<TemplateProperty<TYPE>>::fromLuaValue<TYPE>(lua_State* l, \
bool& s) \
{ \
return FROM_LUA_LAMBDA_EXPRESSION(state, success); \
return FROM_LUA_LAMBDA_EXPRESSION(l, s); \
} \
\
template <> \
template <> \
bool PropertyDelegate<TemplateProperty<TYPE>>::toLuaValue<TYPE>(lua_State * state, \
TYPE value) \
bool PropertyDelegate<TemplateProperty<TYPE>>::toLuaValue<TYPE>(lua_State* l, TYPE v)\
{ \
return TO_LUA_LAMBDA_EXPRESSION(state, value); \
return TO_LUA_LAMBDA_EXPRESSION(l, v); \
} \
\
template <> \
int PropertyDelegate<TemplateProperty<TYPE>>::typeLua() \
{ \
int PropertyDelegate<TemplateProperty<TYPE>>::typeLua() { \
return LUA_TYPE; \
} \
\
template <> \
template <> \
TYPE PropertyDelegate<TemplateProperty<TYPE>>::fromString(std::string value, \
bool& success) \
TYPE PropertyDelegate<TemplateProperty<TYPE>>::fromString(std::string v, \
bool& s) \
{ \
return FROM_STRING_LAMBDA_EXPRESSION(value, success); \
return FROM_STRING_LAMBDA_EXPRESSION(v, s); \
} \
\
template <> \
template <> \
bool PropertyDelegate<TemplateProperty<TYPE>>::toString(std::string& outValue, \
TYPE inValue) \
bool PropertyDelegate<TemplateProperty<TYPE>>::toString(std::string& outVal, \
TYPE inVal) \
{ \
return TO_STRING_LAMBDA_EXPRESSION(outValue, inValue); \
return TO_STRING_LAMBDA_EXPRESSION(outVal, inVal); \
} \
@@ -170,16 +168,13 @@ TemplateProperty<T>& TemplateProperty<T>::operator=(T val) {
}
template <typename T>
T openspace::properties::TemplateProperty<T>::value() const
{
T openspace::properties::TemplateProperty<T>::value() const {
return _value;
}
template <typename T>
void openspace::properties::TemplateProperty<T>::setValue(T val)
{
const bool changed = (val != _value);
if (changed) {
void openspace::properties::TemplateProperty<T>::setValue(T val) {
if (val != _value) {
_value = std::move(val);
notifyListener();
}
@@ -49,7 +49,7 @@ public:
* Returns the class name <code>TriggerProperty</code>.
* \return The class name <code>TriggerProperty</code>
*/
std::string className() const;
std::string className() const override;
/**
* Accepts only the <code>LUA_TNIL</code> type and will notify all the listeners
@@ -57,14 +57,14 @@ public:
* \param state The unused Lua state
* \return Returns always <code>true</code>
*/
bool setLuaValue(lua_State* state);
bool setLuaValue(lua_State* state) override;
/**
* Silently ignores any value that is passed into this function and will trigger the
* listeners regardless of the value
* \param value The ignored value
*/
void set(ghoul::any value);
void set(ghoul::any value) override;
};
} // namespace openspace::properties
@@ -31,7 +31,7 @@
namespace openspace::properties {
REGISTER_TEMPLATEPROPERTY_HEADER(BVec2Property, glm::bvec2);
REGISTER_TEMPLATEPROPERTY_HEADER(BVec2Property, glm::bvec2)
} // namespace openspace::properties
@@ -31,7 +31,7 @@
namespace openspace::properties {
REGISTER_TEMPLATEPROPERTY_HEADER(BVec3Property, glm::bvec3);
REGISTER_TEMPLATEPROPERTY_HEADER(BVec3Property, glm::bvec3)
} // namespace openspace::properties
@@ -31,7 +31,7 @@
namespace openspace::properties {
REGISTER_TEMPLATEPROPERTY_HEADER(BVec4Property, glm::bvec4);
REGISTER_TEMPLATEPROPERTY_HEADER(BVec4Property, glm::bvec4)
} // namespace openspace::properties
@@ -31,7 +31,7 @@
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(DVec2Property, glm::dvec2);
REGISTER_NUMERICALPROPERTY_HEADER(DVec2Property, glm::dvec2)
} // namespace openspace::properties
@@ -31,7 +31,7 @@
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(DVec3Property, glm::dvec3);
REGISTER_NUMERICALPROPERTY_HEADER(DVec3Property, glm::dvec3)
} // namespace openspace::properties
@@ -31,7 +31,7 @@
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(DVec4Property, glm::dvec4);
REGISTER_NUMERICALPROPERTY_HEADER(DVec4Property, glm::dvec4)
} // namespace openspace::properties
@@ -31,7 +31,7 @@
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(IVec2Property, glm::ivec2);
REGISTER_NUMERICALPROPERTY_HEADER(IVec2Property, glm::ivec2)
} // namespace openspace::properties
@@ -31,7 +31,7 @@
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(IVec3Property, glm::ivec3);
REGISTER_NUMERICALPROPERTY_HEADER(IVec3Property, glm::ivec3)
} // namespace openspace::properties
@@ -31,7 +31,7 @@
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(IVec4Property, glm::ivec4);
REGISTER_NUMERICALPROPERTY_HEADER(IVec4Property, glm::ivec4)
} // namespace openspace::properties
@@ -31,7 +31,7 @@
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(UVec2Property, glm::uvec2);
REGISTER_NUMERICALPROPERTY_HEADER(UVec2Property, glm::uvec2)
} // namespace openspace::properties
@@ -31,7 +31,7 @@
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(UVec3Property, glm::uvec3);
REGISTER_NUMERICALPROPERTY_HEADER(UVec3Property, glm::uvec3)
} // namespace openspace::properties
@@ -31,7 +31,7 @@
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(UVec4Property, glm::uvec4);
REGISTER_NUMERICALPROPERTY_HEADER(UVec4Property, glm::uvec4)
} // namespace openspace::properties
@@ -31,7 +31,7 @@
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(Vec2Property, glm::vec2);
REGISTER_NUMERICALPROPERTY_HEADER(Vec2Property, glm::vec2)
} // namespace openspace::properties
@@ -31,7 +31,7 @@
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(Vec3Property, glm::vec3);
REGISTER_NUMERICALPROPERTY_HEADER(Vec3Property, glm::vec3)
} // namespace openspace::properties
@@ -31,7 +31,7 @@
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(Vec4Property, glm::vec4);
REGISTER_NUMERICALPROPERTY_HEADER(Vec4Property, glm::vec4)
} // namespace openspace::properties
@@ -74,7 +74,7 @@ public:
void preRaycast(const RaycasterTask& raycasterTask);
void postRaycast(const RaycasterTask& raycasterTask);
void update();
void update() override;
void render(float blackoutFactor, bool doPerformanceMeasurements) override;
/**
@@ -76,8 +76,8 @@ public:
virtual void updateRendererData() override;
virtual void raycastersChanged(VolumeRaycaster& raycaster, bool attached) override;
private:
private:
std::map<VolumeRaycaster*, RaycastData> _raycastData;
std::map<VolumeRaycaster*, std::unique_ptr<ghoul::opengl::ProgramObject>> _exitPrograms;
std::map<VolumeRaycaster*, std::unique_ptr<ghoul::opengl::ProgramObject>> _raycastPrograms;
@@ -31,6 +31,7 @@ class VolumeRaycaster;
class RaycasterListener {
public:
virtual ~RaycasterListener() = default;
virtual void raycastersChanged(VolumeRaycaster& raycaster, bool attached) = 0;
};
+2
View File
@@ -47,6 +47,8 @@ class Scene;
class Renderer {
public:
virtual ~Renderer() = default;
virtual void initialize() = 0;
virtual void deinitialize() = 0;
+2 -1
View File
@@ -37,7 +37,7 @@ namespace openspace {
struct UpdateData;
namespace documentation { struct Documentation; };
namespace documentation { struct Documentation; }
class Scale : public properties::PropertyOwner {
public:
@@ -45,6 +45,7 @@ public:
Scale();
virtual ~Scale() = default;
virtual bool initialize();
virtual double scaleValue() const = 0;
virtual void update(const UpdateData& data);
+2 -2
View File
@@ -59,7 +59,7 @@ struct LuaLibrary {
/// The list of all C-based callback functions for this library
std::vector<Function> functions;
/// A list of script files that are executed for each Lua state
std::vector<std::string> scripts;
std::vector<std::string> scripts = std::vector<std::string>();
/// This struct contains information about a function or constant that is defined in
/// a Lua script
@@ -73,7 +73,7 @@ struct LuaLibrary {
};
/// The list of documentations will be populated automatically by parsing the Lua
/// scripts
std::vector<Documentation> documentations;
std::vector<Documentation> documentations = std::vector<Documentation>();
/// Comparison function that compares two LuaLibrary%s name
bool operator<(const LuaLibrary& rhs) const;
+4 -4
View File
@@ -79,10 +79,10 @@ public:
bool writeLog(const std::string& script);
virtual void presync(bool isMaster);
virtual void encode(SyncBuffer* syncBuffer);
virtual void decode(SyncBuffer* syncBuffer);
virtual void postsync(bool isMaster);
virtual void presync(bool isMaster) override;
virtual void encode(SyncBuffer* syncBuffer) override;
virtual void decode(SyncBuffer* syncBuffer) override;
virtual void postsync(bool isMaster) override;
void queueScript(const std::string &script, RemoteScripting remoteScripting);
+3 -3
View File
@@ -26,9 +26,9 @@ namespace openspace {
template <class T>
ghoul::TemplateFactory<T>* FactoryManager::factory() const {
for (auto& factory : _factories) {
if (factory.factory->baseClassType() == typeid(T))
return dynamic_cast<ghoul::TemplateFactory<T>*>(factory.factory.get());
for (auto& f : _factories) {
if (f.factory->baseClassType() == typeid(T))
return dynamic_cast<ghoul::TemplateFactory<T>*>(f.factory.get());
}
throw FactoryNotFoundError(typeid(T).name());
+3 -3
View File
@@ -97,19 +97,19 @@ public:
}
protected:
virtual void encode(SyncBuffer* syncBuffer) {
virtual void encode(SyncBuffer* syncBuffer) override {
_mutex.lock();
syncBuffer->encode(data);
_mutex.unlock();
}
virtual void decode(SyncBuffer* syncBuffer) {
virtual void decode(SyncBuffer* syncBuffer) override {
_mutex.lock();
syncBuffer->decode(doubleBufferedData);
_mutex.unlock();
}
virtual void postsync(bool isMaster) {
virtual void postsync(bool isMaster) override {
// apply synced update
if (!isMaster) {
_mutex.lock();
+1
View File
@@ -84,5 +84,6 @@ source_group("Shader Files" FILES ${SHADER_FILES})
create_new_module(
"Base"
base_module
STATIC
${HEADER_FILES} ${SOURCE_FILES} ${SHADER_FILES}
)
+2 -3
View File
@@ -38,7 +38,6 @@
namespace {
const char* _loggerCat = "ModelGeometry";
const char* KeyName = "Name";
const char* KeyType = "Type";
const char* KeyGeomModelFile = "GeometryFile";
const int8_t CurrentCacheVersion = 3;
@@ -114,7 +113,7 @@ double ModelGeometry::boundingRadius() const {
void ModelGeometry::render() {
glBindVertexArray(_vaoID);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _ibo);
glDrawElements(_mode, static_cast<GLsizei>(_indices.size()), GL_UNSIGNED_INT, 0);
glDrawElements(_mode, static_cast<GLsizei>(_indices.size()), GL_UNSIGNED_INT, nullptr);
glBindVertexArray(0);
}
@@ -158,7 +157,7 @@ bool ModelGeometry::initialize(Renderable* parent) {
GL_FLOAT,
GL_FALSE,
sizeof(Vertex),
reinterpret_cast<const GLvoid*>(offsetof(Vertex, location))
nullptr // = reinterpret_cast<const GLvoid*>(offsetof(Vertex, location))
);
glVertexAttribPointer(
1,
+2 -2
View File
@@ -188,7 +188,7 @@ void RenderableModel::render(const RenderData& data, RendererTasks&) {
glm::dmat4 modelTransform =
glm::translate(glm::dmat4(1.0), data.modelTransform.translation) * // Translation
glm::dmat4(data.modelTransform.rotation) * // Spice rotation
glm::dmat4(glm::scale(glm::dmat4(_modelTransform.value()), glm::dvec3(data.modelTransform.scale)));
glm::scale(glm::dmat4(_modelTransform.value()), glm::dvec3(data.modelTransform.scale));
glm::dmat4 modelViewTransform = data.camera.combinedViewMatrix() * modelTransform;
glm::vec3 directionToSun = glm::normalize(_sunPos - data.modelTransform.translation);
@@ -212,7 +212,7 @@ void RenderableModel::render(const RenderData& data, RendererTasks&) {
_programObject->deactivate();
}
void RenderableModel::update(const UpdateData& data) {
void RenderableModel::update(const UpdateData&) {
if (_programObject->isDirty()) {
_programObject->rebuildFromFile();
}
+2 -2
View File
@@ -231,7 +231,7 @@ void RenderablePlane::render(const RenderData& data, RendererTasks&) {
const glm::dmat4 modelTransform =
glm::translate(glm::dmat4(1.0), data.modelTransform.translation) *
rotationTransform *
glm::dmat4(glm::scale(glm::dmat4(1.0), glm::dvec3(data.modelTransform.scale))) *
glm::scale(glm::dmat4(1.0), glm::dvec3(data.modelTransform.scale)) *
glm::dmat4(1.0);
const glm::dmat4 modelViewTransform = data.camera.combinedViewMatrix() * modelTransform;
@@ -328,7 +328,7 @@ void RenderablePlane::createPlane() {
GL_FLOAT,
GL_FALSE,
sizeof(GLfloat) * 6,
reinterpret_cast<void*>(0)
nullptr
);
glEnableVertexAttribArray(1);
+2 -4
View File
@@ -31,15 +31,13 @@
#include <openspace/util/powerscaledsphere.h>
#include <openspace/util/updatestructures.h>
#include <ghoul/glm.h>
#include <ghoul/filesystem/filesystem.h>
#include <ghoul/io/texture/texturereader.h>
#include <ghoul/opengl/texture.h>
#include <ghoul/opengl/textureunit.h>
#include <ghoul/opengl/programobject.h>
#define _USE_MATH_DEFINES
#include <math.h>
namespace {
enum Orientation {
Outside = 1,
@@ -228,7 +226,7 @@ void RenderableSphere::deinitialize() {
void RenderableSphere::render(const RenderData& data, RendererTasks&) {
glm::mat4 transform = glm::mat4(1.0);
transform = glm::rotate(transform, static_cast<float>(M_PI_2), glm::vec3(1, 0, 0));
transform = glm::rotate(transform, glm::half_pi<float>(), glm::vec3(1, 0, 0));
// Activate shader
using IgnoreError = ghoul::opengl::ProgramObject::IgnoreError;
@@ -30,12 +30,10 @@
#include <openspace/util/spicemanager.h>
#include <openspace/util/updatestructures.h>
#include <openspace/documentation/verifier.h>
#include <ghoul/glm.h>
#include <ghoul/opengl/programobject.h>
#define _USE_MATH_DEFINES
#include <math.h>
namespace {
static const openspace::properties::Property::PropertyInfo GridColorInfo = {
"GridColor",
@@ -214,7 +212,7 @@ void RenderableSphericalGrid::render(const RenderData& data, RendererTasks&){
glm::dmat4 modelTransform =
glm::translate(glm::dmat4(1.0), data.modelTransform.translation) * // Translation
glm::dmat4(data.modelTransform.rotation) * // Spice rotation
glm::dmat4(glm::scale(glm::dmat4(1.0), glm::dvec3(data.modelTransform.scale)));
glm::scale(glm::dmat4(1.0), glm::dvec3(data.modelTransform.scale));
glm::dmat4 modelViewTransform = data.camera.combinedViewMatrix() * modelTransform;
@@ -230,16 +228,16 @@ void RenderableSphericalGrid::render(const RenderData& data, RendererTasks&){
glBindVertexArray(_vaoID);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _iBufferID);
glDrawElements(_mode, _isize, GL_UNSIGNED_INT, 0);
glDrawElements(_mode, _isize, GL_UNSIGNED_INT, nullptr);
glBindVertexArray(0);
_gridProgram->deactivate();
}
void RenderableSphericalGrid::update(const UpdateData& data) {
void RenderableSphericalGrid::update(const UpdateData&) {
if (_gridIsDirty) {
_isize = int(6 * _segments * _segments);
_vsize = int((_segments + 1) * (_segments + 1));
_isize = 6 * _segments * _segments;
_vsize = (_segments + 1) * (_segments + 1);
_varray.resize(_vsize);
_iarray.resize(_isize);
@@ -254,10 +252,10 @@ void RenderableSphericalGrid::update(const UpdateData& data) {
const float fj = static_cast<float>(j);
// inclination angle (north to south)
const float theta = fi * float(M_PI) / fsegments*2.f; // 0 -> PI
const float theta = fi * glm::pi<float>() / fsegments * 2.f; // 0 -> PI
// azimuth angle (east to west)
const float phi = fj * float(M_PI) * 2.0f / fsegments; // 0 -> 2*PI
const float phi = fj * glm::pi<float>() * 2.0f / fsegments; // 0 -> 2*PI
const float x = r * sin(phi) * sin(theta); //
const float y = r * cos(theta); // up
@@ -267,11 +265,8 @@ void RenderableSphericalGrid::update(const UpdateData& data) {
if (!(x == 0.f && y == 0.f && z == 0.f))
normal = glm::normalize(normal);
//const float t1 = fj / fsegments;
const float t2 = fi / fsegments;
glm::vec4 tmp(x, y, z, 1);
glm::mat4 rot = glm::rotate(glm::mat4(1), static_cast<float>(M_PI_2), glm::vec3(1, 0, 0));
glm::mat4 rot = glm::rotate(glm::mat4(1), glm::half_pi<float>(), glm::vec3(1, 0, 0));
tmp = glm::vec4(_gridMatrix.value() * glm::dmat4(rot) * glm::dvec4(tmp));
for (int i = 0; i < 3; i++) {
@@ -297,8 +292,14 @@ void RenderableSphericalGrid::update(const UpdateData& data) {
glBindBuffer(GL_ARRAY_BUFFER, _vBufferID);
glBufferData(GL_ARRAY_BUFFER, _vsize * sizeof(Vertex), _varray.data(), GL_STATIC_DRAW);
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex),
reinterpret_cast<const GLvoid*>(offsetof(Vertex, location)));
glVertexAttribPointer(
0,
3,
GL_FLOAT,
GL_FALSE,
sizeof(Vertex),
nullptr // = reinterpret_cast<const GLvoid*>(offsetof(Vertex, location))
);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _iBufferID);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, _isize * sizeof(int), _iarray.data(), GL_STATIC_DRAW);
@@ -54,7 +54,7 @@ public:
bool isReady() const override;
void render(const RenderData& data, RendererTasks& rendererTask) override;
void update(const UpdateData& data);
void update(const UpdateData& data) override;
static documentation::Documentation Documentation();
+3 -3
View File
@@ -168,9 +168,9 @@ RenderableTrail::RenderableTrail(const ghoul::Dictionary& dictionary)
, _renderingModes(RenderingModeInfo, properties::OptionProperty::DisplayType::Dropdown
)
{
_translation = std::unique_ptr<Translation>(Translation::createFromDictionary(
_translation = Translation::createFromDictionary(
dictionary.value<ghoul::Dictionary>(KeyTranslation)
));
);
addPropertySubOwner(_translation.get());
_lineColor = dictionary.value<glm::vec3>(LineColorInfo.identifier);
@@ -246,7 +246,7 @@ void RenderableTrail::render(const RenderData& data, RendererTasks&) {
glm::dmat4 modelTransform =
glm::translate(glm::dmat4(1.0), data.modelTransform.translation) *
glm::dmat4(data.modelTransform.rotation) *
glm::dmat4(glm::scale(glm::dmat4(1.0), glm::dvec3(data.modelTransform.scale)));
glm::scale(glm::dmat4(1.0), glm::dvec3(data.modelTransform.scale));
_programObject->setUniform("projectionTransform", data.camera.projectionMatrix());
@@ -309,7 +309,7 @@ void RenderableTrailOrbit::update(const UpdateData& data) {
}
glEnableVertexAttribArray(0);
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, 0);
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, nullptr);
glBindVertexArray(0);
_previousTime = data.time.j2000Seconds();
@@ -43,8 +43,6 @@
// _endTime. This buffer is updated every frame.
namespace {
const char* KeyTranslation = "Translation";
static const openspace::properties::Property::PropertyInfo StartTimeInfo = {
"StartTime",
"Start Time",
@@ -245,7 +243,7 @@ void RenderableTrailTrajectory::update(const UpdateData& data) {
);
glEnableVertexAttribArray(0);
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, 0);
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, nullptr);
// We clear the indexArray just in case. The base class will take care not to use
// it if it is empty
@@ -312,7 +310,7 @@ void RenderableTrailTrajectory::update(const UpdateData& data) {
);
glEnableVertexAttribArray(0);
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, 0);
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, nullptr);
}
else {
// if we are outside of the valid range, we don't render anything
+2 -1
View File
@@ -37,7 +37,8 @@ class StaticScale : public Scale {
public:
StaticScale();
StaticScale(const ghoul::Dictionary& dictionary);
double scaleValue() const;
double scaleValue() const override;
static documentation::Documentation Documentation();
+2 -1
View File
@@ -37,7 +37,8 @@ class StaticTranslation : public Translation {
public:
StaticTranslation();
StaticTranslation(const ghoul::Dictionary& dictionary);
virtual glm::dvec3 position() const;
virtual glm::dvec3 position() const override;
static documentation::Documentation Documentation();
+1
View File
@@ -46,5 +46,6 @@ source_group("Shader Files" FILES ${SHADER_FILES})
create_new_module(
"Debugging"
debugging_module
STATIC
${HEADER_FILES} ${SOURCE_FILES} ${SHADER_FILES}
)
@@ -31,7 +31,7 @@
#include <openspace/scene/scenegraphnode.h>
#include <openspace/rendering/renderengine.h>
#include <modules/newhorizons/rendering/renderableplanetprojection.h>
#include <modules/spacecraftinstruments/rendering/renderableplanetprojection.h>
#include <ghoul/filesystem/filesystem>
#include <ghoul/io/texture/texturereader.h>
@@ -272,7 +272,7 @@ void RenderableDebugPlane::createPlane() {
glBindBuffer(GL_ARRAY_BUFFER, _vertexPositionBuffer); // bind buffer
glBufferData(GL_ARRAY_BUFFER, sizeof(vertex_data), vertex_data, GL_STATIC_DRAW);
glEnableVertexAttribArray(0);
glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, sizeof(GLfloat) * 6, reinterpret_cast<void*>(0));
glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, sizeof(GLfloat) * 6, nullptr);
glEnableVertexAttribArray(1);
glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, sizeof(GLfloat) * 6, reinterpret_cast<void*>(sizeof(GLfloat) * 4));
}
+1
View File
@@ -44,5 +44,6 @@ source_group("Shader Files" FILES ${SHADER_FILES})
create_new_module(
"Fieldlines"
fieldlines_module
STATIC
${HEADER_FILES} ${SOURCE_FILES} ${SHADER_FILES}
)

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