From 41ec729d165f718542a1dd85e0ccdc7216a3ef51 Mon Sep 17 00:00:00 2001 From: Eric Myers Date: Mon, 12 Dec 2016 07:39:47 -0500 Subject: [PATCH 01/96] Update main.cpp Added #include to main.cpp for Mac --- apps/OpenSpace/main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/OpenSpace/main.cpp b/apps/OpenSpace/main.cpp index 49b47645a9..a84df70c2d 100644 --- a/apps/OpenSpace/main.cpp +++ b/apps/OpenSpace/main.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include From 17900049c574006fd7f371208925f1a989c157b3 Mon Sep 17 00:00:00 2001 From: Eric Myers Date: Sat, 7 Jan 2017 19:40:36 -0500 Subject: [PATCH 02/96] Remove extra headers. --- apps/OpenSpace/main.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/apps/OpenSpace/main.cpp b/apps/OpenSpace/main.cpp index 601e083df1..0401f0afe3 100644 --- a/apps/OpenSpace/main.cpp +++ b/apps/OpenSpace/main.cpp @@ -29,11 +29,7 @@ #include #include #include - -#include - #include - #include #include From 2d6d7cefa60a46a84352500f641e3e31e305907c Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Thu, 26 Jan 2017 17:20:09 -0700 Subject: [PATCH 03/96] Remove the out-of-order logging as it causes OpenSpace to crash when master is running at different speeds from slaves due to race conditions on the std::stringstream --- apps/OpenSpace/main.cpp | 83 +++++++++-------------------------------- 1 file changed, 17 insertions(+), 66 deletions(-) diff --git a/apps/OpenSpace/main.cpp b/apps/OpenSpace/main.cpp index 0401f0afe3..8f707acf78 100644 --- a/apps/OpenSpace/main.cpp +++ b/apps/OpenSpace/main.cpp @@ -235,59 +235,22 @@ void mainInitFunc() { } -struct FunctionLogKey { - char begin, end; -}; - -#include - - -std::stringstream& operator<<(std::stringstream& o, const FunctionLogKey& l) { - o << l.begin << l.end; - return o; -} - - - -const FunctionLogKey PRE_SYNC = { '1', '2' }; -const FunctionLogKey ENCODE = { 'E', 'e' }; -const FunctionLogKey DECODE = { 'D', 'd' }; -const FunctionLogKey POST_SYNC = { '3', '4' }; -const FunctionLogKey RENDER = { 'R', 'r' }; -const FunctionLogKey POST_DRAW = { 'P', 'p' }; - -std::stringstream minilog; -std::stringstream masterlog; -std::stringstream slavelog; - -const std::string EXPECTED_MASTER_LOG = (masterlog << PRE_SYNC << ENCODE << POST_SYNC << RENDER << POST_DRAW).str(); -const std::string EXPECTED_SLAVE_LOG = (slavelog << PRE_SYNC << DECODE << POST_SYNC << RENDER << POST_DRAW).str(); - -#define LOG_BEGIN(x) minilog << (x).begin -#define LOG_END(x) minilog << (x).end - - void mainPreSyncFunc() { - LOG_BEGIN(PRE_SYNC); OsEng.setRunTime(sgct::Engine::getTime()); OsEng.preSynchronization(); - LOG_END(PRE_SYNC); } volatile bool busyWaitDecode = false; void mainPostSyncPreDrawFunc() { - if (OsEng.useBusyWaitForDecode() && !sgct::Engine::instance()->isMaster()) { - while (minilog.str().size() && minilog.str().back() != DECODE.end) { - std::this_thread::sleep_for(std::chrono::microseconds(10)); - } - } - LOG_BEGIN(POST_SYNC); +// if (OsEng.useBusyWaitForDecode() && !sgct::Engine::instance()->isMaster()) { +// while (minilog.str().size() && minilog.str().back() != DECODE.end) { +// std::this_thread::sleep_for(std::chrono::microseconds(10)); +// } +// } OsEng.postSynchronizationPreDraw(); - LOG_END(POST_SYNC); } void mainRenderFunc() { - LOG_BEGIN(RENDER); using glm::mat4; using glm::translate; //not the most efficient, but for clarity @JK @@ -302,30 +265,23 @@ void mainRenderFunc() { mat4 projectionMatrix = _sgctEngine->getCurrentProjectionMatrix(); OsEng.render(projectionMatrix, viewMatrix); - LOG_END(RENDER); } void mainPostDrawFunc() { - LOG_BEGIN(POST_DRAW); OsEng.postDraw(); - LOG_END(POST_DRAW); - if (OsEng.logSGCTOutOfOrderErrors()) { - if (sgct::Engine::instance()->isMaster()) { - if (minilog.str() != EXPECTED_MASTER_LOG) { - LERRORC("Minilog", "Bad combination: " << minilog.str()); - } - } - else { - if (minilog.str() != EXPECTED_SLAVE_LOG) { - LERRORC("Minilog", "Bad combination: " << minilog.str()); - } - } - } - - - // clear - minilog.str(std::string()); +// if (OsEng.logSGCTOutOfOrderErrors()) { +// if (sgct::Engine::instance()->isMaster()) { +// if (minilog.str() != EXPECTED_MASTER_LOG) { +// LERRORC("Minilog", "Bad combination: " << minilog.str()); +// } +// } +// else { +// if (minilog.str() != EXPECTED_SLAVE_LOG) { +// LERRORC("Minilog", "Bad combination: " << minilog.str()); +// } +// } +// } } void mainExternalControlCallback(const char* receivedChars, int size) { @@ -368,16 +324,11 @@ void mainCharCallback(unsigned int codepoint, int mods) { } void mainEncodeFun() { - LOG_BEGIN(ENCODE); OsEng.encode(); - LOG_END(ENCODE); } void mainDecodeFun() { - LOG_BEGIN(DECODE); OsEng.decode(); - LOG_END(DECODE); - } void mainLogCallback(const char* msg) { From 94e3e11188d73fd4ef4e1ea64914553838b98dd3 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Mon, 6 Feb 2017 18:02:01 -0500 Subject: [PATCH 04/96] Update copyright header to 2017 Update Ghoul repository Remove libgdal link --- apps/DataConverter/main.cpp | 2 +- apps/Launcher/infowidget.cpp | 2 +- apps/Launcher/infowidget.h | 2 +- apps/Launcher/main.cpp | 2 +- apps/Launcher/mainwindow.cpp | 2 +- apps/Launcher/mainwindow.h | 2 +- apps/Launcher/shortcutwidget.cpp | 2 +- apps/Launcher/shortcutwidget.h | 2 +- apps/Launcher/syncwidget.cpp | 2 +- apps/Launcher/syncwidget.h | 2 +- apps/OpenSpace/main.cpp | 2 +- ext/ghoul | 2 +- include/openspace/documentation/core_registration.h | 2 +- include/openspace/documentation/documentation.h | 2 +- include/openspace/documentation/documentationengine.h | 2 +- include/openspace/documentation/verifier.h | 2 +- include/openspace/documentation/verifier.inl | 2 +- include/openspace/engine/configurationmanager.h | 2 +- include/openspace/engine/downloadmanager.h | 2 +- include/openspace/engine/logfactory.h | 2 +- include/openspace/engine/moduleengine.h | 2 +- include/openspace/engine/openspaceengine.h | 2 +- include/openspace/engine/settingsengine.h | 2 +- include/openspace/engine/syncengine.h | 2 +- include/openspace/engine/wrapper/sgctwindowwrapper.h | 2 +- include/openspace/engine/wrapper/windowwrapper.h | 2 +- include/openspace/interaction/controller.h | 2 +- include/openspace/interaction/deviceidentifier.h | 2 +- include/openspace/interaction/interactionhandler.h | 2 +- include/openspace/interaction/interactionmode.h | 2 +- include/openspace/interaction/keyboardcontroller.h | 2 +- include/openspace/interaction/luaconsole.h | 2 +- include/openspace/mission/mission.h | 2 +- include/openspace/mission/missionmanager.h | 2 +- include/openspace/network/messagestructures.h | 2 +- include/openspace/network/networkengine.h | 2 +- include/openspace/network/parallelconnection.h | 2 +- include/openspace/openspace.h | 2 +- include/openspace/performance/performancelayout.h | 2 +- include/openspace/performance/performancemanager.h | 2 +- include/openspace/performance/performancemeasurement.h | 2 +- include/openspace/properties/matrix/dmat2property.h | 2 +- include/openspace/properties/matrix/dmat2x3property.h | 2 +- include/openspace/properties/matrix/dmat2x4property.h | 2 +- include/openspace/properties/matrix/dmat3property.h | 2 +- include/openspace/properties/matrix/dmat3x2property.h | 2 +- include/openspace/properties/matrix/dmat3x4property.h | 2 +- include/openspace/properties/matrix/dmat4property.h | 2 +- include/openspace/properties/matrix/dmat4x2property.h | 2 +- include/openspace/properties/matrix/dmat4x3property.h | 2 +- include/openspace/properties/matrix/mat2property.h | 2 +- include/openspace/properties/matrix/mat2x3property.h | 2 +- include/openspace/properties/matrix/mat2x4property.h | 2 +- include/openspace/properties/matrix/mat3property.h | 2 +- include/openspace/properties/matrix/mat3x2property.h | 2 +- include/openspace/properties/matrix/mat3x4property.h | 2 +- include/openspace/properties/matrix/mat4property.h | 2 +- include/openspace/properties/matrix/mat4x2property.h | 2 +- include/openspace/properties/matrix/mat4x3property.h | 2 +- include/openspace/properties/matrixproperty.h | 2 +- include/openspace/properties/numericalproperty.h | 2 +- include/openspace/properties/numericalproperty.inl | 2 +- include/openspace/properties/optionproperty.h | 2 +- include/openspace/properties/property.h | 2 +- include/openspace/properties/propertydelegate.h | 2 +- include/openspace/properties/propertydelegate.inl | 2 +- include/openspace/properties/propertyowner.h | 2 +- include/openspace/properties/scalar/boolproperty.h | 2 +- include/openspace/properties/scalar/charproperty.h | 2 +- include/openspace/properties/scalar/doubleproperty.h | 2 +- include/openspace/properties/scalar/floatproperty.h | 2 +- include/openspace/properties/scalar/intproperty.h | 2 +- include/openspace/properties/scalar/longdoubleproperty.h | 2 +- include/openspace/properties/scalar/longlongproperty.h | 2 +- include/openspace/properties/scalar/longproperty.h | 2 +- include/openspace/properties/scalar/shortproperty.h | 2 +- include/openspace/properties/scalar/signedcharproperty.h | 2 +- include/openspace/properties/scalar/ucharproperty.h | 2 +- include/openspace/properties/scalar/uintproperty.h | 2 +- include/openspace/properties/scalar/ulonglongproperty.h | 2 +- include/openspace/properties/scalar/ulongproperty.h | 2 +- include/openspace/properties/scalar/ushortproperty.h | 2 +- include/openspace/properties/scalar/wcharproperty.h | 2 +- include/openspace/properties/scalarproperty.h | 2 +- include/openspace/properties/selectionproperty.h | 2 +- include/openspace/properties/stringproperty.h | 2 +- include/openspace/properties/templateproperty.h | 2 +- include/openspace/properties/templateproperty.inl | 2 +- include/openspace/properties/triggerproperty.h | 2 +- include/openspace/properties/ucharproperty.h | 2 +- include/openspace/properties/uintproperty.h | 2 +- include/openspace/properties/vector/bvec2property.h | 2 +- include/openspace/properties/vector/bvec3property.h | 2 +- include/openspace/properties/vector/bvec4property.h | 2 +- include/openspace/properties/vector/dvec2property.h | 2 +- include/openspace/properties/vector/dvec3property.h | 2 +- include/openspace/properties/vector/dvec4property.h | 2 +- include/openspace/properties/vector/ivec2property.h | 2 +- include/openspace/properties/vector/ivec3property.h | 2 +- include/openspace/properties/vector/ivec4property.h | 2 +- include/openspace/properties/vector/uvec2property.h | 2 +- include/openspace/properties/vector/uvec3property.h | 2 +- include/openspace/properties/vector/uvec4property.h | 2 +- include/openspace/properties/vector/vec2property.h | 2 +- include/openspace/properties/vector/vec3property.h | 2 +- include/openspace/properties/vector/vec4property.h | 2 +- include/openspace/properties/vectorproperty.h | 2 +- include/openspace/properties/wcharproperty.h | 2 +- include/openspace/query/query.h | 2 +- include/openspace/rendering/abufferrenderer.h | 2 +- include/openspace/rendering/framebufferrenderer.h | 2 +- include/openspace/rendering/raycasterlistener.h | 2 +- include/openspace/rendering/raycastermanager.h | 2 +- include/openspace/rendering/renderable.h | 2 +- include/openspace/rendering/renderengine.h | 2 +- include/openspace/rendering/renderer.h | 2 +- include/openspace/rendering/screenspacerenderable.h | 2 +- include/openspace/rendering/transferfunction.h | 2 +- include/openspace/rendering/volume.h | 2 +- include/openspace/rendering/volumeraycaster.h | 2 +- include/openspace/scene/rotation.h | 2 +- include/openspace/scene/scale.h | 2 +- include/openspace/scene/scene.h | 2 +- include/openspace/scene/scenegraph.h | 2 +- include/openspace/scene/scenegraphnode.h | 2 +- include/openspace/scene/translation.h | 2 +- include/openspace/scripting/lualibrary.h | 2 +- include/openspace/scripting/script_helper.h | 2 +- include/openspace/scripting/scriptengine.h | 2 +- include/openspace/scripting/scriptscheduler.h | 2 +- include/openspace/util/blockplaneintersectiongeometry.h | 2 +- include/openspace/util/boxgeometry.h | 2 +- include/openspace/util/factorymanager.h | 2 +- include/openspace/util/gpudata.h | 2 +- include/openspace/util/keys.h | 2 +- include/openspace/util/mouse.h | 2 +- include/openspace/util/openspacemodule.h | 2 +- include/openspace/util/powerscaledcoordinate.h | 2 +- include/openspace/util/powerscaledscalar.h | 2 +- include/openspace/util/powerscaledsphere.h | 2 +- include/openspace/util/progressbar.h | 2 +- include/openspace/util/screenlog.h | 2 +- include/openspace/util/spicemanager.h | 2 +- include/openspace/util/syncbuffer.h | 2 +- include/openspace/util/syncdata.h | 2 +- include/openspace/util/time.h | 2 +- include/openspace/util/timerange.h | 2 +- include/openspace/util/updatestructures.h | 2 +- libgdal.dylib | 1 - modules/base/basemodule.cpp | 2 +- modules/base/basemodule.h | 2 +- modules/base/rendering/modelgeometry.cpp | 2 +- modules/base/rendering/modelgeometry.h | 2 +- modules/base/rendering/multimodelgeometry.cpp | 2 +- modules/base/rendering/multimodelgeometry.h | 2 +- modules/base/rendering/renderablemodel.cpp | 2 +- modules/base/rendering/renderablemodel.h | 2 +- modules/base/rendering/renderablepath.cpp | 2 +- modules/base/rendering/renderablepath.h | 2 +- modules/base/rendering/renderableplane.cpp | 2 +- modules/base/rendering/renderableplane.h | 2 +- modules/base/rendering/renderablesphere.cpp | 2 +- modules/base/rendering/renderablesphere.h | 2 +- modules/base/rendering/renderablesphericalgrid.cpp | 2 +- modules/base/rendering/renderablesphericalgrid.h | 2 +- modules/base/rendering/renderabletrail.cpp | 2 +- modules/base/rendering/renderabletrail.h | 2 +- modules/base/rendering/renderabletrailorbit.cpp | 2 +- modules/base/rendering/renderabletrailorbit.h | 2 +- modules/base/rendering/renderabletrailtrajectory.cpp | 2 +- modules/base/rendering/renderabletrailtrajectory.h | 2 +- modules/base/rendering/screenspaceframebuffer.cpp | 2 +- modules/base/rendering/screenspaceframebuffer.h | 2 +- modules/base/rendering/screenspaceimage.cpp | 2 +- modules/base/rendering/screenspaceimage.h | 2 +- modules/base/rendering/wavefrontgeometry.cpp | 2 +- modules/base/rendering/wavefrontgeometry.h | 2 +- modules/base/rotation/staticrotation.cpp | 2 +- modules/base/rotation/staticrotation.h | 2 +- modules/base/scale/staticscale.cpp | 2 +- modules/base/scale/staticscale.h | 2 +- modules/base/shaders/imageplane_fs.glsl | 2 +- modules/base/shaders/imageplane_vs.glsl | 2 +- modules/base/shaders/model_fs.glsl | 2 +- modules/base/shaders/model_vs.glsl | 2 +- modules/base/shaders/path_fs.glsl | 2 +- modules/base/shaders/path_gs.glsl | 2 +- modules/base/shaders/path_vs.glsl | 2 +- modules/base/shaders/plane_fs.glsl | 2 +- modules/base/shaders/plane_vs.glsl | 2 +- modules/base/shaders/renderabletrail_fs.glsl | 2 +- modules/base/shaders/renderabletrail_vs.glsl | 2 +- modules/base/shaders/sphere_fs.glsl | 2 +- modules/base/shaders/sphere_vs.glsl | 2 +- modules/base/translation/statictranslation.cpp | 2 +- modules/base/translation/statictranslation.h | 2 +- modules/debugging/debuggingmodule.cpp | 2 +- modules/debugging/debuggingmodule.h | 2 +- modules/debugging/rendering/debugrenderer.cpp | 2 +- modules/debugging/rendering/debugrenderer.h | 2 +- modules/debugging/rendering/renderabledebugplane.cpp | 2 +- modules/debugging/rendering/renderabledebugplane.h | 2 +- modules/fieldlines/fieldlinesmodule.cpp | 2 +- modules/fieldlines/fieldlinesmodule.h | 2 +- modules/fieldlines/rendering/renderablefieldlines.cpp | 2 +- modules/fieldlines/rendering/renderablefieldlines.h | 2 +- modules/galaxy/galaxymodule.cpp | 2 +- modules/galaxy/galaxymodule.h | 2 +- modules/galaxy/rendering/galaxyraycaster.cpp | 2 +- modules/galaxy/rendering/galaxyraycaster.h | 2 +- modules/galaxy/rendering/renderablegalaxy.cpp | 2 +- modules/galaxy/rendering/renderablegalaxy.h | 2 +- modules/galaxy/shaders/points.fs | 2 +- modules/galaxy/shaders/points.vs | 2 +- modules/galaxy/shaders/raycasterbounds.fs | 2 +- modules/globebrowsing/chunk/chunk.cpp | 2 +- modules/globebrowsing/chunk/chunk.h | 2 +- modules/globebrowsing/chunk/chunklevelevaluator.cpp | 2 +- modules/globebrowsing/chunk/chunklevelevaluator.h | 2 +- modules/globebrowsing/chunk/chunknode.cpp | 2 +- modules/globebrowsing/chunk/chunknode.h | 2 +- modules/globebrowsing/chunk/culling.cpp | 2 +- modules/globebrowsing/chunk/culling.h | 2 +- modules/globebrowsing/geometry/aabb.cpp | 2 +- modules/globebrowsing/geometry/aabb.h | 2 +- modules/globebrowsing/geometry/angle.h | 2 +- modules/globebrowsing/geometry/angle.inl | 2 +- modules/globebrowsing/geometry/convexhull.cpp | 2 +- modules/globebrowsing/geometry/convexhull.h | 2 +- modules/globebrowsing/geometry/ellipsoid.cpp | 2 +- modules/globebrowsing/geometry/ellipsoid.h | 2 +- modules/globebrowsing/geometry/geodetic2.cpp | 2 +- modules/globebrowsing/geometry/geodetic2.h | 2 +- modules/globebrowsing/globebrowsingmodule.cpp | 2 +- modules/globebrowsing/globebrowsingmodule.h | 2 +- modules/globebrowsing/globes/chunkedlodglobe.cpp | 2 +- modules/globebrowsing/globes/chunkedlodglobe.h | 2 +- modules/globebrowsing/globes/pointglobe.cpp | 2 +- modules/globebrowsing/globes/pointglobe.h | 2 +- modules/globebrowsing/globes/renderableglobe.cpp | 2 +- modules/globebrowsing/globes/renderableglobe.h | 2 +- modules/globebrowsing/meshes/basicgrid.cpp | 2 +- modules/globebrowsing/meshes/grid.cpp | 2 +- modules/globebrowsing/meshes/grid.h | 2 +- modules/globebrowsing/meshes/skirtedgrid.cpp | 2 +- modules/globebrowsing/meshes/skirtedgrid.h | 2 +- modules/globebrowsing/meshes/trianglesoup.cpp | 2 +- modules/globebrowsing/meshes/trianglesoup.h | 2 +- modules/globebrowsing/other/concurrentjobmanager.h | 2 +- modules/globebrowsing/other/concurrentjobmanager.inl | 2 +- modules/globebrowsing/other/concurrentqueue.h | 2 +- modules/globebrowsing/other/concurrentqueue.inl | 2 +- modules/globebrowsing/other/distanceswitch.cpp | 2 +- modules/globebrowsing/other/distanceswitch.h | 2 +- modules/globebrowsing/other/lrucache.h | 2 +- modules/globebrowsing/other/lrucache.inl | 2 +- modules/globebrowsing/other/statscollector.cpp | 2 +- modules/globebrowsing/other/statscollector.h | 2 +- modules/globebrowsing/other/statscollector.inl | 2 +- modules/globebrowsing/other/threadpool.cpp | 2 +- modules/globebrowsing/other/threadpool.h | 2 +- modules/globebrowsing/rendering/chunkrenderer.cpp | 2 +- modules/globebrowsing/rendering/chunkrenderer.h | 2 +- modules/globebrowsing/rendering/gpulayermanager.cpp | 2 +- modules/globebrowsing/rendering/gpulayermanager.h | 2 +- modules/globebrowsing/rendering/layermanager.cpp | 2 +- modules/globebrowsing/rendering/layermanager.h | 2 +- modules/globebrowsing/rendering/layershadermanager.cpp | 2 +- modules/globebrowsing/rendering/layershadermanager.h | 2 +- modules/globebrowsing/tile/asynctilereader.cpp | 2 +- modules/globebrowsing/tile/asynctilereader.h | 2 +- modules/globebrowsing/tile/chunktile.h | 2 +- modules/globebrowsing/tile/pixelregion.cpp | 2 +- modules/globebrowsing/tile/pixelregion.h | 2 +- modules/globebrowsing/tile/tile.cpp | 2 +- modules/globebrowsing/tile/tile.h | 2 +- modules/globebrowsing/tile/tiledataset.cpp | 2 +- modules/globebrowsing/tile/tiledataset.h | 2 +- modules/globebrowsing/tile/tiledatatype.h | 2 +- modules/globebrowsing/tile/tilediskcache.cpp | 2 +- modules/globebrowsing/tile/tilediskcache.h | 2 +- modules/globebrowsing/tile/tileindex.cpp | 2 +- modules/globebrowsing/tile/tileindex.h | 2 +- .../tile/tileprovider/cachingtileprovider.cpp | 2 +- .../globebrowsing/tile/tileprovider/cachingtileprovider.h | 2 +- .../tile/tileprovider/singleimageprovider.cpp | 2 +- .../globebrowsing/tile/tileprovider/singleimageprovider.h | 2 +- .../tile/tileprovider/temporaltileprovider.cpp | 2 +- .../tile/tileprovider/temporaltileprovider.h | 2 +- .../globebrowsing/tile/tileprovider/texttileprovider.cpp | 2 +- .../globebrowsing/tile/tileprovider/texttileprovider.h | 2 +- modules/globebrowsing/tile/tileprovider/tileprovider.cpp | 2 +- modules/globebrowsing/tile/tileprovider/tileprovider.h | 2 +- .../globebrowsing/tile/tileprovider/tileproviderbyindex.h | 2 +- .../tile/tileprovider/tileproviderbylevel.cpp | 2 +- .../globebrowsing/tile/tileprovider/tileproviderbylevel.h | 2 +- modules/globebrowsing/tile/tileselector.cpp | 2 +- modules/globebrowsing/tile/tileselector.h | 2 +- modules/iswa/iswamodule.cpp | 2 +- modules/iswa/iswamodule.h | 2 +- modules/iswa/rendering/datacygnet.cpp | 2 +- modules/iswa/rendering/datacygnet.h | 2 +- modules/iswa/rendering/dataplane.cpp | 2 +- modules/iswa/rendering/dataplane.h | 2 +- modules/iswa/rendering/datasphere.cpp | 2 +- modules/iswa/rendering/datasphere.h | 2 +- modules/iswa/rendering/iswabasegroup.cpp | 2 +- modules/iswa/rendering/iswabasegroup.h | 2 +- modules/iswa/rendering/iswacygnet.cpp | 2 +- modules/iswa/rendering/iswacygnet.h | 2 +- modules/iswa/rendering/iswadatagroup.cpp | 2 +- modules/iswa/rendering/iswadatagroup.h | 2 +- modules/iswa/rendering/iswakameleongroup.cpp | 2 +- modules/iswa/rendering/iswakameleongroup.h | 2 +- modules/iswa/rendering/kameleonplane.cpp | 2 +- modules/iswa/rendering/kameleonplane.h | 2 +- modules/iswa/rendering/screenspacecygnet.h | 2 +- modules/iswa/rendering/texturecygnet.cpp | 2 +- modules/iswa/rendering/texturecygnet.h | 2 +- modules/iswa/rendering/textureplane.cpp | 2 +- modules/iswa/rendering/textureplane.h | 2 +- modules/iswa/shaders/dataplane_fs.glsl | 2 +- modules/iswa/shaders/dataplane_vs.glsl | 2 +- modules/iswa/shaders/datasphere_fs.glsl | 2 +- modules/iswa/shaders/textureplane_fs.glsl | 2 +- modules/iswa/shaders/textureplane_vs.glsl | 2 +- modules/iswa/util/dataprocessor.cpp | 2 +- modules/iswa/util/dataprocessor.h | 2 +- modules/iswa/util/dataprocessorjson.cpp | 2 +- modules/iswa/util/dataprocessorjson.h | 2 +- modules/iswa/util/dataprocessorkameleon.cpp | 2 +- modules/iswa/util/dataprocessorkameleon.h | 2 +- modules/iswa/util/dataprocessortext.cpp | 2 +- modules/iswa/util/dataprocessortext.h | 2 +- modules/iswa/util/iswamanager.cpp | 2 +- modules/iswa/util/iswamanager.h | 2 +- modules/iswa/util/iswamanager_lua.inl | 2 +- modules/kameleon/include/kameleonwrapper.h | 2 +- modules/kameleon/kameleonmodule.cpp | 2 +- modules/kameleon/kameleonmodule.h | 2 +- modules/multiresvolume/multiresvolumemodule.cpp | 2 +- modules/multiresvolume/multiresvolumemodule.h | 2 +- modules/multiresvolume/rendering/atlasmanager.cpp | 2 +- modules/multiresvolume/rendering/atlasmanager.h | 2 +- modules/multiresvolume/rendering/brickcover.h | 2 +- modules/multiresvolume/rendering/brickmanager.cpp | 2 +- modules/multiresvolume/rendering/brickmanager.h | 2 +- modules/multiresvolume/rendering/brickselection.h | 2 +- modules/multiresvolume/rendering/brickselector.h | 2 +- .../multiresvolume/rendering/errorhistogrammanager.cpp | 2 +- modules/multiresvolume/rendering/errorhistogrammanager.h | 2 +- modules/multiresvolume/rendering/histogrammanager.cpp | 2 +- modules/multiresvolume/rendering/histogrammanager.h | 2 +- .../rendering/localerrorhistogrammanager.cpp | 2 +- .../multiresvolume/rendering/localerrorhistogrammanager.h | 2 +- modules/multiresvolume/rendering/localtfbrickselector.cpp | 2 +- modules/multiresvolume/rendering/localtfbrickselector.h | 2 +- .../multiresvolume/rendering/multiresvolumeraycaster.cpp | 2 +- .../multiresvolume/rendering/multiresvolumeraycaster.h | 2 +- .../multiresvolume/rendering/renderablemultiresvolume.cpp | 2 +- .../multiresvolume/rendering/renderablemultiresvolume.h | 2 +- modules/multiresvolume/rendering/shenbrickselector.cpp | 2 +- modules/multiresvolume/rendering/shenbrickselector.h | 2 +- .../multiresvolume/rendering/simpletfbrickselector.cpp | 2 +- modules/multiresvolume/rendering/simpletfbrickselector.h | 2 +- modules/multiresvolume/rendering/tfbrickselector.cpp | 2 +- modules/multiresvolume/rendering/tfbrickselector.h | 2 +- modules/multiresvolume/rendering/tsp.cpp | 2 +- modules/multiresvolume/rendering/tsp.h | 2 +- modules/multiresvolume/shaders/boundsFs.glsl | 2 +- modules/newhorizons/newhorizonsmodule.cpp | 2 +- modules/newhorizons/newhorizonsmodule.h | 2 +- modules/newhorizons/rendering/renderablecrawlingline.cpp | 2 +- modules/newhorizons/rendering/renderablecrawlingline.h | 2 +- modules/newhorizons/rendering/renderablefov.cpp | 2 +- modules/newhorizons/rendering/renderablefov.h | 2 +- .../newhorizons/rendering/renderablemodelprojection.cpp | 2 +- modules/newhorizons/rendering/renderablemodelprojection.h | 2 +- modules/newhorizons/rendering/renderableplaneprojection.h | 2 +- .../newhorizons/rendering/renderableplanetprojection.cpp | 2 +- .../newhorizons/rendering/renderableplanetprojection.h | 2 +- .../newhorizons/rendering/renderableshadowcylinder.cpp | 2 +- modules/newhorizons/rendering/renderableshadowcylinder.h | 2 +- modules/newhorizons/rendering/writeToTexture.h | 2 +- modules/newhorizons/shaders/crawlingline_fs.glsl | 2 +- modules/newhorizons/shaders/crawlingline_vs.glsl | 2 +- modules/newhorizons/shaders/dilation_fs.glsl | 2 +- modules/newhorizons/shaders/dilation_vs.glsl | 2 +- modules/newhorizons/shaders/fov_fs.glsl | 2 +- modules/newhorizons/shaders/fov_vs.glsl | 2 +- modules/newhorizons/shaders/renderableModelDepth_fs.glsl | 2 +- .../newhorizons/shaders/renderableModelProjection_fs.glsl | 2 +- .../newhorizons/shaders/renderableModelProjection_vs.glsl | 2 +- modules/newhorizons/shaders/renderableModel_fs.glsl | 2 +- modules/newhorizons/shaders/renderablePlanet_fs.glsl | 2 +- modules/newhorizons/shaders/renderablePlanet_vs.glsl | 2 +- modules/newhorizons/shaders/terminatorshadow_fs.glsl | 2 +- modules/newhorizons/shaders/terminatorshadow_vs.glsl | 2 +- modules/newhorizons/util/decoder.cpp | 2 +- modules/newhorizons/util/decoder.h | 2 +- modules/newhorizons/util/hongkangparser.cpp | 2 +- modules/newhorizons/util/hongkangparser.h | 2 +- modules/newhorizons/util/imagesequencer.cpp | 2 +- modules/newhorizons/util/imagesequencer.h | 2 +- modules/newhorizons/util/instrumentdecoder.cpp | 2 +- modules/newhorizons/util/instrumentdecoder.h | 2 +- modules/newhorizons/util/instrumenttimesparser.cpp | 2 +- modules/newhorizons/util/instrumenttimesparser.h | 2 +- modules/newhorizons/util/labelparser.cpp | 2 +- modules/newhorizons/util/labelparser.h | 2 +- modules/newhorizons/util/projectioncomponent.cpp | 2 +- modules/newhorizons/util/projectioncomponent.h | 2 +- modules/newhorizons/util/scannerdecoder.cpp | 2 +- modules/newhorizons/util/scannerdecoder.h | 2 +- modules/newhorizons/util/sequenceparser.cpp | 2 +- modules/newhorizons/util/sequenceparser.h | 2 +- modules/newhorizons/util/targetdecoder.cpp | 2 +- modules/newhorizons/util/targetdecoder.h | 2 +- modules/onscreengui/include/gui.h | 2 +- modules/onscreengui/include/guicomponent.h | 2 +- modules/onscreengui/include/guihelpcomponent.h | 2 +- modules/onscreengui/include/guiiswacomponent.h | 2 +- modules/onscreengui/include/guiorigincomponent.h | 2 +- modules/onscreengui/include/guiperformancecomponent.h | 2 +- modules/onscreengui/include/guipropertycomponent.h | 2 +- modules/onscreengui/include/guitimecomponent.h | 2 +- modules/onscreengui/include/renderproperties.h | 2 +- modules/onscreengui/onscreenguimodule.cpp | 2 +- modules/onscreengui/onscreenguimodule.h | 2 +- modules/onscreengui/shaders/gui_fs.glsl | 2 +- modules/onscreengui/shaders/gui_vs.glsl | 2 +- modules/onscreengui/src/gui.cpp | 2 +- modules/onscreengui/src/gui_lua.inl | 2 +- modules/onscreengui/src/guicomponent.cpp | 2 +- modules/onscreengui/src/guihelpcomponent.cpp | 2 +- modules/onscreengui/src/guiiswacomponent.cpp | 2 +- modules/onscreengui/src/guiorigincomponent.cpp | 2 +- modules/onscreengui/src/guiperformancecomponent.cpp | 2 +- modules/onscreengui/src/guipropertycomponent.cpp | 2 +- modules/onscreengui/src/guitimecomponent.cpp | 2 +- modules/onscreengui/src/renderproperties.cpp | 2 +- modules/space/rendering/planetgeometry.cpp | 2 +- modules/space/rendering/planetgeometry.h | 2 +- modules/space/rendering/renderableconstellationbounds.cpp | 2 +- modules/space/rendering/renderableconstellationbounds.h | 2 +- modules/space/rendering/renderableplanet.cpp | 2 +- modules/space/rendering/renderableplanet.h | 2 +- modules/space/rendering/renderablerings.cpp | 2 +- modules/space/rendering/renderablerings.h | 2 +- modules/space/rendering/renderablestars.cpp | 2 +- modules/space/rendering/renderablestars.h | 2 +- modules/space/rendering/simplespheregeometry.cpp | 2 +- modules/space/rendering/simplespheregeometry.h | 2 +- modules/space/rotation/spicerotation.cpp | 2 +- modules/space/rotation/spicerotation.h | 2 +- modules/space/shaders/constellationbounds_fs.glsl | 2 +- modules/space/shaders/constellationbounds_vs.glsl | 2 +- modules/space/shaders/rings_fs.glsl | 2 +- modules/space/shaders/rings_vs.glsl | 2 +- modules/space/shaders/star_fs.glsl | 2 +- modules/space/shaders/star_ge.glsl | 2 +- modules/space/shaders/star_vs.glsl | 2 +- modules/space/spacemodule.cpp | 2 +- modules/space/spacemodule.h | 2 +- modules/space/translation/keplertranslation.cpp | 2 +- modules/space/translation/keplertranslation.h | 2 +- modules/space/translation/spicetranslation.cpp | 2 +- modules/space/translation/spicetranslation.h | 2 +- modules/space/translation/tletranslation.cpp | 2 +- modules/space/translation/tletranslation.h | 2 +- modules/toyvolume/rendering/renderabletoyvolume.cpp | 2 +- modules/toyvolume/rendering/renderabletoyvolume.h | 2 +- modules/toyvolume/rendering/toyvolumeraycaster.cpp | 2 +- modules/toyvolume/rendering/toyvolumeraycaster.h | 2 +- modules/toyvolume/shaders/boundsfs.glsl | 2 +- modules/toyvolume/toyvolumemodule.cpp | 2 +- modules/toyvolume/toyvolumemodule.h | 2 +- modules/volume/linearlrucache.h | 2 +- modules/volume/lrucache.h | 2 +- modules/volume/rawvolume.h | 2 +- modules/volume/rawvolume.inl | 2 +- modules/volume/rawvolumereader.h | 2 +- modules/volume/rawvolumereader.inl | 2 +- modules/volume/rawvolumewriter.h | 2 +- modules/volume/rawvolumewriter.inl | 2 +- modules/volume/textureslicevolumereader.h | 2 +- modules/volume/textureslicevolumereader.inl | 2 +- modules/volume/volumemodule.cpp | 2 +- modules/volume/volumemodule.h | 2 +- modules/volume/volumesampler.h | 2 +- modules/volume/volumesampler.inl | 2 +- modules/volume/volumeutils.cpp | 2 +- modules/volume/volumeutils.h | 2 +- shaders/framebuffer/exitframebuffer.frag | 2 +- shaders/framebuffer/renderframebuffer.frag | 2 +- src/documentation/core_registration.cpp | 2 +- src/documentation/documentation.cpp | 2 +- src/documentation/documentationengine.cpp | 2 +- src/documentation/verifier.cpp | 2 +- src/engine/configurationmanager.cpp | 2 +- src/engine/configurationmanager_doc.inl | 2 +- src/engine/downloadmanager.cpp | 2 +- src/engine/logfactory.cpp | 2 +- src/engine/moduleengine.cpp | 2 +- src/engine/moduleengine_lua.inl | 2 +- src/engine/openspaceengine.cpp | 2 +- src/engine/openspaceengine_lua.inl | 2 +- src/engine/settingsengine.cpp | 2 +- src/engine/syncengine.cpp | 2 +- src/engine/wrapper/sgctwindowwrapper.cpp | 2 +- src/engine/wrapper/windowwrapper.cpp | 2 +- src/interaction/controller.cpp | 2 +- src/interaction/deviceidentifier.cpp | 2 +- src/interaction/interactionhandler.cpp | 2 +- src/interaction/interactionhandler_lua.inl | 2 +- src/interaction/interactionmode.cpp | 2 +- src/interaction/keyboardcontroller.cpp | 2 +- src/interaction/luaconsole.cpp | 2 +- src/interaction/luaconsole_lua.inl | 2 +- src/mission/mission.cpp | 2 +- src/mission/missionmanager.cpp | 2 +- src/mission/missionmanager_lua.inl | 2 +- src/network/networkengine.cpp | 2 +- src/network/parallelconnection.cpp | 2 +- src/network/parallelconnection_lua.inl | 2 +- src/openspace.cpp | 2 +- src/performance/performancelayout.cpp | 2 +- src/performance/performancemanager.cpp | 2 +- src/performance/performancemeasurement.cpp | 2 +- src/properties/matrix/dmat2property.cpp | 2 +- src/properties/matrix/dmat2x3property.cpp | 2 +- src/properties/matrix/dmat2x4property.cpp | 2 +- src/properties/matrix/dmat3property.cpp | 2 +- src/properties/matrix/dmat3x2property.cpp | 2 +- src/properties/matrix/dmat3x4property.cpp | 2 +- src/properties/matrix/dmat4property.cpp | 2 +- src/properties/matrix/dmat4x2property.cpp | 2 +- src/properties/matrix/dmat4x3property.cpp | 2 +- src/properties/matrix/mat2property.cpp | 2 +- src/properties/matrix/mat2x3property.cpp | 2 +- src/properties/matrix/mat2x4property.cpp | 2 +- src/properties/matrix/mat3property.cpp | 2 +- src/properties/matrix/mat3x2property.cpp | 2 +- src/properties/matrix/mat3x4property.cpp | 2 +- src/properties/matrix/mat4property.cpp | 2 +- src/properties/matrix/mat4x2property.cpp | 2 +- src/properties/matrix/mat4x3property.cpp | 2 +- src/properties/optionproperty.cpp | 2 +- src/properties/property.cpp | 2 +- src/properties/propertyowner.cpp | 2 +- src/properties/scalar/boolproperty.cpp | 2 +- src/properties/scalar/charproperty.cpp | 2 +- src/properties/scalar/doubleproperty.cpp | 2 +- src/properties/scalar/floatproperty.cpp | 2 +- src/properties/scalar/intproperty.cpp | 2 +- src/properties/scalar/longdoubleproperty.cpp | 2 +- src/properties/scalar/longlongproperty.cpp | 2 +- src/properties/scalar/longproperty.cpp | 2 +- src/properties/scalar/shortproperty.cpp | 2 +- src/properties/scalar/signedcharproperty.cpp | 2 +- src/properties/scalar/ucharproperty.cpp | 2 +- src/properties/scalar/uintproperty.cpp | 2 +- src/properties/scalar/ulonglongproperty.cpp | 2 +- src/properties/scalar/ulongproperty.cpp | 2 +- src/properties/scalar/ushortproperty.cpp | 2 +- src/properties/scalar/wcharproperty.cpp | 2 +- src/properties/selectionproperty.cpp | 2 +- src/properties/stringproperty.cpp | 2 +- src/properties/triggerproperty.cpp | 2 +- src/properties/vector/bvec2property.cpp | 2 +- src/properties/vector/bvec3property.cpp | 2 +- src/properties/vector/bvec4property.cpp | 2 +- src/properties/vector/dvec2property.cpp | 2 +- src/properties/vector/dvec3property.cpp | 2 +- src/properties/vector/dvec4property.cpp | 2 +- src/properties/vector/ivec2property.cpp | 2 +- src/properties/vector/ivec3property.cpp | 2 +- src/properties/vector/ivec4property.cpp | 2 +- src/properties/vector/uvec2property.cpp | 2 +- src/properties/vector/uvec3property.cpp | 2 +- src/properties/vector/uvec4property.cpp | 2 +- src/properties/vector/vec2property.cpp | 2 +- src/properties/vector/vec3property.cpp | 2 +- src/properties/vector/vec4property.cpp | 2 +- src/query/query.cpp | 2 +- src/rendering/abufferrenderer.cpp | 2 +- src/rendering/framebufferrenderer.cpp | 2 +- src/rendering/raycastermanager.cpp | 2 +- src/rendering/renderable.cpp | 2 +- src/rendering/renderengine.cpp | 2 +- src/rendering/renderengine_lua.inl | 2 +- src/rendering/screenspacerenderable.cpp | 2 +- src/scene/rotation.cpp | 2 +- src/scene/scale.cpp | 2 +- src/scene/scene.cpp | 2 +- src/scene/scene_doc.inl | 2 +- src/scene/scene_lua.inl | 2 +- src/scene/scenegraph.cpp | 2 +- src/scene/scenegraphnode.cpp | 2 +- src/scene/scenegraphnode_doc.inl | 2 +- src/scene/translation.cpp | 2 +- src/scripting/lualibrary.cpp | 2 +- src/scripting/scriptengine.cpp | 2 +- src/scripting/scriptengine_lua.inl | 2 +- src/scripting/scriptscheduler.cpp | 2 +- src/scripting/scriptscheduler_lua.inl | 2 +- src/util/blockplaneintersectiongeometry.cpp | 2 +- src/util/boxgeometry.cpp | 2 +- src/util/factorymanager.cpp | 2 +- src/util/gpudata.cpp | 2 +- src/util/openspacemodule.cpp | 2 +- src/util/powerscaledcoordinate.cpp | 2 +- src/util/powerscaledscalar.cpp | 2 +- src/util/powerscaledsphere.cpp | 2 +- src/util/progressbar.cpp | 2 +- src/util/screenlog.cpp | 2 +- src/util/spicemanager.cpp | 2 +- src/util/spicemanager_lua.inl | 2 +- src/util/syncbuffer.cpp | 2 +- src/util/syncdata.cpp | 2 +- src/util/time.cpp | 2 +- src/util/time_lua.inl | 2 +- src/util/timerange.cpp | 2 +- src/util/transformationmanager.cpp | 2 +- support/cmake/module_common.cmake | 2 +- support/cmake/module_definition.cmake | 2 +- support/cmake/support_macros.cmake | 8 ++++++-- support/coding/convert_tabs.py | 2 +- support/coding/new_files.py | 6 +++--- tests/main.cpp | 2 +- tests/test_aabb.inl | 2 +- tests/test_angle.inl | 2 +- tests/test_chunknode.inl | 2 +- tests/test_common.inl | 2 +- tests/test_concurrentjobmanager.inl | 2 +- tests/test_concurrentqueue.inl | 2 +- tests/test_configurationmanager.inl | 2 +- tests/test_convexhull.inl | 2 +- tests/test_documentation.inl | 2 +- tests/test_ellipsoid.inl | 2 +- tests/test_gdalwms.inl | 2 +- tests/test_iswamanager.inl | 2 +- tests/test_latlonpatch.inl | 2 +- tests/test_lrucache.inl | 2 +- tests/test_luaconversions.inl | 2 +- tests/test_patchcoverageprovider.inl | 2 +- tests/test_powerscalecoordinates.inl | 2 +- tests/test_scenegraphloader.inl | 2 +- tests/test_screenspaceimage.inl | 2 +- tests/test_scriptscheduler.inl | 2 +- tests/test_spicemanager.inl | 2 +- tests/test_temporaltileprovider.inl | 2 +- 652 files changed, 658 insertions(+), 655 deletions(-) delete mode 120000 libgdal.dylib diff --git a/apps/DataConverter/main.cpp b/apps/DataConverter/main.cpp index d0f8579a0a..1a66cd100c 100644 --- a/apps/DataConverter/main.cpp +++ b/apps/DataConverter/main.cpp @@ -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 * diff --git a/apps/Launcher/infowidget.cpp b/apps/Launcher/infowidget.cpp index ddde63591a..af5c89b8a1 100644 --- a/apps/Launcher/infowidget.cpp +++ b/apps/Launcher/infowidget.cpp @@ -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 * diff --git a/apps/Launcher/infowidget.h b/apps/Launcher/infowidget.h index 2eaec279b9..967e22de43 100644 --- a/apps/Launcher/infowidget.h +++ b/apps/Launcher/infowidget.h @@ -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 * diff --git a/apps/Launcher/main.cpp b/apps/Launcher/main.cpp index c802f468cc..066ab974d0 100644 --- a/apps/Launcher/main.cpp +++ b/apps/Launcher/main.cpp @@ -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 * diff --git a/apps/Launcher/mainwindow.cpp b/apps/Launcher/mainwindow.cpp index 502c97a400..e9b65ccbf4 100644 --- a/apps/Launcher/mainwindow.cpp +++ b/apps/Launcher/mainwindow.cpp @@ -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 * diff --git a/apps/Launcher/mainwindow.h b/apps/Launcher/mainwindow.h index 9b9d9bd10e..60fd0f1aa2 100644 --- a/apps/Launcher/mainwindow.h +++ b/apps/Launcher/mainwindow.h @@ -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 * diff --git a/apps/Launcher/shortcutwidget.cpp b/apps/Launcher/shortcutwidget.cpp index 3f26becb99..3e4885ab34 100644 --- a/apps/Launcher/shortcutwidget.cpp +++ b/apps/Launcher/shortcutwidget.cpp @@ -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 * diff --git a/apps/Launcher/shortcutwidget.h b/apps/Launcher/shortcutwidget.h index 1601be7843..ad4ff319b0 100644 --- a/apps/Launcher/shortcutwidget.h +++ b/apps/Launcher/shortcutwidget.h @@ -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 * diff --git a/apps/Launcher/syncwidget.cpp b/apps/Launcher/syncwidget.cpp index 1f4099ac4e..8a41155e5c 100644 --- a/apps/Launcher/syncwidget.cpp +++ b/apps/Launcher/syncwidget.cpp @@ -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 * diff --git a/apps/Launcher/syncwidget.h b/apps/Launcher/syncwidget.h index 6306fea1f3..8f2c203c13 100644 --- a/apps/Launcher/syncwidget.h +++ b/apps/Launcher/syncwidget.h @@ -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 * diff --git a/apps/OpenSpace/main.cpp b/apps/OpenSpace/main.cpp index 8f707acf78..b60284dab3 100644 --- a/apps/OpenSpace/main.cpp +++ b/apps/OpenSpace/main.cpp @@ -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 * diff --git a/ext/ghoul b/ext/ghoul index f341d33a3b..a3b333ba99 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit f341d33a3bf968d7d6304039a111ad295b315939 +Subproject commit a3b333ba997758c3bd9022fb431c322fbdc5945c diff --git a/include/openspace/documentation/core_registration.h b/include/openspace/documentation/core_registration.h index 5688a6c24e..4ceff8f4ee 100644 --- a/include/openspace/documentation/core_registration.h +++ b/include/openspace/documentation/core_registration.h @@ -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 * diff --git a/include/openspace/documentation/documentation.h b/include/openspace/documentation/documentation.h index 2c4e39fcf2..19d9433664 100644 --- a/include/openspace/documentation/documentation.h +++ b/include/openspace/documentation/documentation.h @@ -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 * diff --git a/include/openspace/documentation/documentationengine.h b/include/openspace/documentation/documentationengine.h index 95fcca5f98..4841c3efc4 100644 --- a/include/openspace/documentation/documentationengine.h +++ b/include/openspace/documentation/documentationengine.h @@ -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 * diff --git a/include/openspace/documentation/verifier.h b/include/openspace/documentation/verifier.h index 22ae0452d5..07579a747d 100644 --- a/include/openspace/documentation/verifier.h +++ b/include/openspace/documentation/verifier.h @@ -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 * diff --git a/include/openspace/documentation/verifier.inl b/include/openspace/documentation/verifier.inl index 8df5f6e3f6..d03a05a2b9 100644 --- a/include/openspace/documentation/verifier.inl +++ b/include/openspace/documentation/verifier.inl @@ -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 * diff --git a/include/openspace/engine/configurationmanager.h b/include/openspace/engine/configurationmanager.h index 3fef274c62..ef893ce5df 100644 --- a/include/openspace/engine/configurationmanager.h +++ b/include/openspace/engine/configurationmanager.h @@ -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 * diff --git a/include/openspace/engine/downloadmanager.h b/include/openspace/engine/downloadmanager.h index 900c99eebc..366ff8ea58 100644 --- a/include/openspace/engine/downloadmanager.h +++ b/include/openspace/engine/downloadmanager.h @@ -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 * diff --git a/include/openspace/engine/logfactory.h b/include/openspace/engine/logfactory.h index a2fb2b3c21..b32d3c6380 100644 --- a/include/openspace/engine/logfactory.h +++ b/include/openspace/engine/logfactory.h @@ -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 * diff --git a/include/openspace/engine/moduleengine.h b/include/openspace/engine/moduleengine.h index df40f23983..cb6d6357c0 100644 --- a/include/openspace/engine/moduleengine.h +++ b/include/openspace/engine/moduleengine.h @@ -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 * diff --git a/include/openspace/engine/openspaceengine.h b/include/openspace/engine/openspaceengine.h index 9070e07f92..01298c97c6 100644 --- a/include/openspace/engine/openspaceengine.h +++ b/include/openspace/engine/openspaceengine.h @@ -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 * diff --git a/include/openspace/engine/settingsengine.h b/include/openspace/engine/settingsengine.h index e42ab81f23..bcce9884f5 100644 --- a/include/openspace/engine/settingsengine.h +++ b/include/openspace/engine/settingsengine.h @@ -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 * diff --git a/include/openspace/engine/syncengine.h b/include/openspace/engine/syncengine.h index aa87c909f9..77f8a7c51b 100644 --- a/include/openspace/engine/syncengine.h +++ b/include/openspace/engine/syncengine.h @@ -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 * diff --git a/include/openspace/engine/wrapper/sgctwindowwrapper.h b/include/openspace/engine/wrapper/sgctwindowwrapper.h index 377bda3f42..3a0fd67131 100644 --- a/include/openspace/engine/wrapper/sgctwindowwrapper.h +++ b/include/openspace/engine/wrapper/sgctwindowwrapper.h @@ -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 * diff --git a/include/openspace/engine/wrapper/windowwrapper.h b/include/openspace/engine/wrapper/windowwrapper.h index 89c92121f9..b3ed6797fb 100644 --- a/include/openspace/engine/wrapper/windowwrapper.h +++ b/include/openspace/engine/wrapper/windowwrapper.h @@ -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 * diff --git a/include/openspace/interaction/controller.h b/include/openspace/interaction/controller.h index 5daf93cd01..4e262a0287 100644 --- a/include/openspace/interaction/controller.h +++ b/include/openspace/interaction/controller.h @@ -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 * diff --git a/include/openspace/interaction/deviceidentifier.h b/include/openspace/interaction/deviceidentifier.h index 828bf4fa42..6f714d9de0 100644 --- a/include/openspace/interaction/deviceidentifier.h +++ b/include/openspace/interaction/deviceidentifier.h @@ -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 * diff --git a/include/openspace/interaction/interactionhandler.h b/include/openspace/interaction/interactionhandler.h index f4e9589573..aa9e04fc43 100644 --- a/include/openspace/interaction/interactionhandler.h +++ b/include/openspace/interaction/interactionhandler.h @@ -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 * diff --git a/include/openspace/interaction/interactionmode.h b/include/openspace/interaction/interactionmode.h index a3a479453f..4022383ae9 100644 --- a/include/openspace/interaction/interactionmode.h +++ b/include/openspace/interaction/interactionmode.h @@ -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 * diff --git a/include/openspace/interaction/keyboardcontroller.h b/include/openspace/interaction/keyboardcontroller.h index 07933e5bc7..b222f9058d 100644 --- a/include/openspace/interaction/keyboardcontroller.h +++ b/include/openspace/interaction/keyboardcontroller.h @@ -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 * diff --git a/include/openspace/interaction/luaconsole.h b/include/openspace/interaction/luaconsole.h index cf863107b3..00890d18fb 100644 --- a/include/openspace/interaction/luaconsole.h +++ b/include/openspace/interaction/luaconsole.h @@ -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 * diff --git a/include/openspace/mission/mission.h b/include/openspace/mission/mission.h index 5783461813..24d89829d1 100644 --- a/include/openspace/mission/mission.h +++ b/include/openspace/mission/mission.h @@ -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 * diff --git a/include/openspace/mission/missionmanager.h b/include/openspace/mission/missionmanager.h index 56fee42f45..2d31f89ba4 100644 --- a/include/openspace/mission/missionmanager.h +++ b/include/openspace/mission/missionmanager.h @@ -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 * diff --git a/include/openspace/network/messagestructures.h b/include/openspace/network/messagestructures.h index 8b06233f2c..5f85c57bcb 100644 --- a/include/openspace/network/messagestructures.h +++ b/include/openspace/network/messagestructures.h @@ -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 * diff --git a/include/openspace/network/networkengine.h b/include/openspace/network/networkengine.h index e3f92e3264..c603c07668 100644 --- a/include/openspace/network/networkengine.h +++ b/include/openspace/network/networkengine.h @@ -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 * diff --git a/include/openspace/network/parallelconnection.h b/include/openspace/network/parallelconnection.h index 2822b1e398..d95060d7c0 100644 --- a/include/openspace/network/parallelconnection.h +++ b/include/openspace/network/parallelconnection.h @@ -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 * diff --git a/include/openspace/openspace.h b/include/openspace/openspace.h index 5359b5f360..38568d3af3 100644 --- a/include/openspace/openspace.h +++ b/include/openspace/openspace.h @@ -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 * diff --git a/include/openspace/performance/performancelayout.h b/include/openspace/performance/performancelayout.h index 29feabaca5..de9f5a450f 100644 --- a/include/openspace/performance/performancelayout.h +++ b/include/openspace/performance/performancelayout.h @@ -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 * diff --git a/include/openspace/performance/performancemanager.h b/include/openspace/performance/performancemanager.h index ebad4f61ff..55fca53f5b 100644 --- a/include/openspace/performance/performancemanager.h +++ b/include/openspace/performance/performancemanager.h @@ -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 * diff --git a/include/openspace/performance/performancemeasurement.h b/include/openspace/performance/performancemeasurement.h index 3be224cf1e..c820f81230 100644 --- a/include/openspace/performance/performancemeasurement.h +++ b/include/openspace/performance/performancemeasurement.h @@ -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 * diff --git a/include/openspace/properties/matrix/dmat2property.h b/include/openspace/properties/matrix/dmat2property.h index d50900234a..978090b4a3 100644 --- a/include/openspace/properties/matrix/dmat2property.h +++ b/include/openspace/properties/matrix/dmat2property.h @@ -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 * diff --git a/include/openspace/properties/matrix/dmat2x3property.h b/include/openspace/properties/matrix/dmat2x3property.h index c6ec775b38..900f31faad 100644 --- a/include/openspace/properties/matrix/dmat2x3property.h +++ b/include/openspace/properties/matrix/dmat2x3property.h @@ -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 * diff --git a/include/openspace/properties/matrix/dmat2x4property.h b/include/openspace/properties/matrix/dmat2x4property.h index 060569bdb9..720ceae492 100644 --- a/include/openspace/properties/matrix/dmat2x4property.h +++ b/include/openspace/properties/matrix/dmat2x4property.h @@ -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 * diff --git a/include/openspace/properties/matrix/dmat3property.h b/include/openspace/properties/matrix/dmat3property.h index c94c94694b..4052005316 100644 --- a/include/openspace/properties/matrix/dmat3property.h +++ b/include/openspace/properties/matrix/dmat3property.h @@ -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 * diff --git a/include/openspace/properties/matrix/dmat3x2property.h b/include/openspace/properties/matrix/dmat3x2property.h index e94c0f7f13..9424c3880c 100644 --- a/include/openspace/properties/matrix/dmat3x2property.h +++ b/include/openspace/properties/matrix/dmat3x2property.h @@ -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 * diff --git a/include/openspace/properties/matrix/dmat3x4property.h b/include/openspace/properties/matrix/dmat3x4property.h index 7d6c190766..535ccbae92 100644 --- a/include/openspace/properties/matrix/dmat3x4property.h +++ b/include/openspace/properties/matrix/dmat3x4property.h @@ -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 * diff --git a/include/openspace/properties/matrix/dmat4property.h b/include/openspace/properties/matrix/dmat4property.h index 927587f1eb..3124aa57d8 100644 --- a/include/openspace/properties/matrix/dmat4property.h +++ b/include/openspace/properties/matrix/dmat4property.h @@ -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 * diff --git a/include/openspace/properties/matrix/dmat4x2property.h b/include/openspace/properties/matrix/dmat4x2property.h index 3ab7f82af6..1151b54b4e 100644 --- a/include/openspace/properties/matrix/dmat4x2property.h +++ b/include/openspace/properties/matrix/dmat4x2property.h @@ -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 * diff --git a/include/openspace/properties/matrix/dmat4x3property.h b/include/openspace/properties/matrix/dmat4x3property.h index 013fe01794..89bb9464e0 100644 --- a/include/openspace/properties/matrix/dmat4x3property.h +++ b/include/openspace/properties/matrix/dmat4x3property.h @@ -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 * diff --git a/include/openspace/properties/matrix/mat2property.h b/include/openspace/properties/matrix/mat2property.h index f8deb63b3d..8b48a60c3a 100644 --- a/include/openspace/properties/matrix/mat2property.h +++ b/include/openspace/properties/matrix/mat2property.h @@ -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 * diff --git a/include/openspace/properties/matrix/mat2x3property.h b/include/openspace/properties/matrix/mat2x3property.h index 822a11d5b5..8389e34e61 100644 --- a/include/openspace/properties/matrix/mat2x3property.h +++ b/include/openspace/properties/matrix/mat2x3property.h @@ -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 * diff --git a/include/openspace/properties/matrix/mat2x4property.h b/include/openspace/properties/matrix/mat2x4property.h index 19230ac699..a6417c0fba 100644 --- a/include/openspace/properties/matrix/mat2x4property.h +++ b/include/openspace/properties/matrix/mat2x4property.h @@ -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 * diff --git a/include/openspace/properties/matrix/mat3property.h b/include/openspace/properties/matrix/mat3property.h index b9451c2d55..8c428fce4f 100644 --- a/include/openspace/properties/matrix/mat3property.h +++ b/include/openspace/properties/matrix/mat3property.h @@ -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 * diff --git a/include/openspace/properties/matrix/mat3x2property.h b/include/openspace/properties/matrix/mat3x2property.h index a8caac4361..999ea31e3e 100644 --- a/include/openspace/properties/matrix/mat3x2property.h +++ b/include/openspace/properties/matrix/mat3x2property.h @@ -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 * diff --git a/include/openspace/properties/matrix/mat3x4property.h b/include/openspace/properties/matrix/mat3x4property.h index bf65b1857a..2386f25efe 100644 --- a/include/openspace/properties/matrix/mat3x4property.h +++ b/include/openspace/properties/matrix/mat3x4property.h @@ -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 * diff --git a/include/openspace/properties/matrix/mat4property.h b/include/openspace/properties/matrix/mat4property.h index edbab9cda2..da2175ec20 100644 --- a/include/openspace/properties/matrix/mat4property.h +++ b/include/openspace/properties/matrix/mat4property.h @@ -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 * diff --git a/include/openspace/properties/matrix/mat4x2property.h b/include/openspace/properties/matrix/mat4x2property.h index 19ae107a6c..42c51dd17d 100644 --- a/include/openspace/properties/matrix/mat4x2property.h +++ b/include/openspace/properties/matrix/mat4x2property.h @@ -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 * diff --git a/include/openspace/properties/matrix/mat4x3property.h b/include/openspace/properties/matrix/mat4x3property.h index 17621ab924..e91203d23e 100644 --- a/include/openspace/properties/matrix/mat4x3property.h +++ b/include/openspace/properties/matrix/mat4x3property.h @@ -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 * diff --git a/include/openspace/properties/matrixproperty.h b/include/openspace/properties/matrixproperty.h index 2b26259c11..f45db10f9a 100644 --- a/include/openspace/properties/matrixproperty.h +++ b/include/openspace/properties/matrixproperty.h @@ -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 * diff --git a/include/openspace/properties/numericalproperty.h b/include/openspace/properties/numericalproperty.h index 2a5a5a3c7a..77ee822063 100644 --- a/include/openspace/properties/numericalproperty.h +++ b/include/openspace/properties/numericalproperty.h @@ -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 * diff --git a/include/openspace/properties/numericalproperty.inl b/include/openspace/properties/numericalproperty.inl index 89a47f9b66..e7d46cf07e 100644 --- a/include/openspace/properties/numericalproperty.inl +++ b/include/openspace/properties/numericalproperty.inl @@ -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 * diff --git a/include/openspace/properties/optionproperty.h b/include/openspace/properties/optionproperty.h index 4263120deb..60d2fdc12f 100644 --- a/include/openspace/properties/optionproperty.h +++ b/include/openspace/properties/optionproperty.h @@ -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 * diff --git a/include/openspace/properties/property.h b/include/openspace/properties/property.h index 0baa569612..80b224bf76 100644 --- a/include/openspace/properties/property.h +++ b/include/openspace/properties/property.h @@ -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 * diff --git a/include/openspace/properties/propertydelegate.h b/include/openspace/properties/propertydelegate.h index ff63e25fa7..9611d8f1f4 100644 --- a/include/openspace/properties/propertydelegate.h +++ b/include/openspace/properties/propertydelegate.h @@ -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 * diff --git a/include/openspace/properties/propertydelegate.inl b/include/openspace/properties/propertydelegate.inl index a4740d4707..36ac0ed6ea 100644 --- a/include/openspace/properties/propertydelegate.inl +++ b/include/openspace/properties/propertydelegate.inl @@ -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 * diff --git a/include/openspace/properties/propertyowner.h b/include/openspace/properties/propertyowner.h index 51b26dac96..09f6f0cc0b 100644 --- a/include/openspace/properties/propertyowner.h +++ b/include/openspace/properties/propertyowner.h @@ -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 * diff --git a/include/openspace/properties/scalar/boolproperty.h b/include/openspace/properties/scalar/boolproperty.h index e615368b1c..35ead669c1 100644 --- a/include/openspace/properties/scalar/boolproperty.h +++ b/include/openspace/properties/scalar/boolproperty.h @@ -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 * diff --git a/include/openspace/properties/scalar/charproperty.h b/include/openspace/properties/scalar/charproperty.h index 3357d47c7e..c8a2c9910e 100644 --- a/include/openspace/properties/scalar/charproperty.h +++ b/include/openspace/properties/scalar/charproperty.h @@ -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 * diff --git a/include/openspace/properties/scalar/doubleproperty.h b/include/openspace/properties/scalar/doubleproperty.h index f47abe8b85..27401c7422 100644 --- a/include/openspace/properties/scalar/doubleproperty.h +++ b/include/openspace/properties/scalar/doubleproperty.h @@ -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 * diff --git a/include/openspace/properties/scalar/floatproperty.h b/include/openspace/properties/scalar/floatproperty.h index 11acdebbb4..fc780787a4 100644 --- a/include/openspace/properties/scalar/floatproperty.h +++ b/include/openspace/properties/scalar/floatproperty.h @@ -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 * diff --git a/include/openspace/properties/scalar/intproperty.h b/include/openspace/properties/scalar/intproperty.h index 3aa9f82b62..4c55848994 100644 --- a/include/openspace/properties/scalar/intproperty.h +++ b/include/openspace/properties/scalar/intproperty.h @@ -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 * diff --git a/include/openspace/properties/scalar/longdoubleproperty.h b/include/openspace/properties/scalar/longdoubleproperty.h index 40358f602b..47db702438 100644 --- a/include/openspace/properties/scalar/longdoubleproperty.h +++ b/include/openspace/properties/scalar/longdoubleproperty.h @@ -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 * diff --git a/include/openspace/properties/scalar/longlongproperty.h b/include/openspace/properties/scalar/longlongproperty.h index 65e176e09d..b95de8c278 100644 --- a/include/openspace/properties/scalar/longlongproperty.h +++ b/include/openspace/properties/scalar/longlongproperty.h @@ -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 * diff --git a/include/openspace/properties/scalar/longproperty.h b/include/openspace/properties/scalar/longproperty.h index 444fc6c15a..5b09507df9 100644 --- a/include/openspace/properties/scalar/longproperty.h +++ b/include/openspace/properties/scalar/longproperty.h @@ -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 * diff --git a/include/openspace/properties/scalar/shortproperty.h b/include/openspace/properties/scalar/shortproperty.h index da37c72a60..7a2dd2c6a5 100644 --- a/include/openspace/properties/scalar/shortproperty.h +++ b/include/openspace/properties/scalar/shortproperty.h @@ -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 * diff --git a/include/openspace/properties/scalar/signedcharproperty.h b/include/openspace/properties/scalar/signedcharproperty.h index 2ff7ff0d03..d808e1bb4d 100644 --- a/include/openspace/properties/scalar/signedcharproperty.h +++ b/include/openspace/properties/scalar/signedcharproperty.h @@ -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 * diff --git a/include/openspace/properties/scalar/ucharproperty.h b/include/openspace/properties/scalar/ucharproperty.h index c91b5051b5..8460a72710 100644 --- a/include/openspace/properties/scalar/ucharproperty.h +++ b/include/openspace/properties/scalar/ucharproperty.h @@ -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 * diff --git a/include/openspace/properties/scalar/uintproperty.h b/include/openspace/properties/scalar/uintproperty.h index bf83adc31f..53c11668a0 100644 --- a/include/openspace/properties/scalar/uintproperty.h +++ b/include/openspace/properties/scalar/uintproperty.h @@ -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 * diff --git a/include/openspace/properties/scalar/ulonglongproperty.h b/include/openspace/properties/scalar/ulonglongproperty.h index 045da7a9b9..7e57f0c28a 100644 --- a/include/openspace/properties/scalar/ulonglongproperty.h +++ b/include/openspace/properties/scalar/ulonglongproperty.h @@ -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 * diff --git a/include/openspace/properties/scalar/ulongproperty.h b/include/openspace/properties/scalar/ulongproperty.h index 4350c0ae46..8be77cc026 100644 --- a/include/openspace/properties/scalar/ulongproperty.h +++ b/include/openspace/properties/scalar/ulongproperty.h @@ -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 * diff --git a/include/openspace/properties/scalar/ushortproperty.h b/include/openspace/properties/scalar/ushortproperty.h index 9c2d20320d..890ca2b881 100644 --- a/include/openspace/properties/scalar/ushortproperty.h +++ b/include/openspace/properties/scalar/ushortproperty.h @@ -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 * diff --git a/include/openspace/properties/scalar/wcharproperty.h b/include/openspace/properties/scalar/wcharproperty.h index d19a460884..07f10d03cb 100644 --- a/include/openspace/properties/scalar/wcharproperty.h +++ b/include/openspace/properties/scalar/wcharproperty.h @@ -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 * diff --git a/include/openspace/properties/scalarproperty.h b/include/openspace/properties/scalarproperty.h index 16c620c3e9..4b4fe36b5e 100644 --- a/include/openspace/properties/scalarproperty.h +++ b/include/openspace/properties/scalarproperty.h @@ -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 * diff --git a/include/openspace/properties/selectionproperty.h b/include/openspace/properties/selectionproperty.h index 39dc560508..672659ebdb 100644 --- a/include/openspace/properties/selectionproperty.h +++ b/include/openspace/properties/selectionproperty.h @@ -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 * diff --git a/include/openspace/properties/stringproperty.h b/include/openspace/properties/stringproperty.h index d6840cd016..43b7761722 100644 --- a/include/openspace/properties/stringproperty.h +++ b/include/openspace/properties/stringproperty.h @@ -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 * diff --git a/include/openspace/properties/templateproperty.h b/include/openspace/properties/templateproperty.h index a562b59020..feddc84167 100644 --- a/include/openspace/properties/templateproperty.h +++ b/include/openspace/properties/templateproperty.h @@ -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 * diff --git a/include/openspace/properties/templateproperty.inl b/include/openspace/properties/templateproperty.inl index bacccfafe6..7e4c2b790e 100644 --- a/include/openspace/properties/templateproperty.inl +++ b/include/openspace/properties/templateproperty.inl @@ -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 * diff --git a/include/openspace/properties/triggerproperty.h b/include/openspace/properties/triggerproperty.h index c6bcf6c9e9..47afb82b25 100644 --- a/include/openspace/properties/triggerproperty.h +++ b/include/openspace/properties/triggerproperty.h @@ -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 * diff --git a/include/openspace/properties/ucharproperty.h b/include/openspace/properties/ucharproperty.h index f0d7de59ef..f08278b23e 100644 --- a/include/openspace/properties/ucharproperty.h +++ b/include/openspace/properties/ucharproperty.h @@ -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 * diff --git a/include/openspace/properties/uintproperty.h b/include/openspace/properties/uintproperty.h index 2e4b50b103..f5a97eac3c 100644 --- a/include/openspace/properties/uintproperty.h +++ b/include/openspace/properties/uintproperty.h @@ -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 * diff --git a/include/openspace/properties/vector/bvec2property.h b/include/openspace/properties/vector/bvec2property.h index 79d94c97e8..5f5164ea2f 100644 --- a/include/openspace/properties/vector/bvec2property.h +++ b/include/openspace/properties/vector/bvec2property.h @@ -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 * diff --git a/include/openspace/properties/vector/bvec3property.h b/include/openspace/properties/vector/bvec3property.h index 4dbfc678b0..f50fccbfb0 100644 --- a/include/openspace/properties/vector/bvec3property.h +++ b/include/openspace/properties/vector/bvec3property.h @@ -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 * diff --git a/include/openspace/properties/vector/bvec4property.h b/include/openspace/properties/vector/bvec4property.h index 9912c72506..0bd80ad32f 100644 --- a/include/openspace/properties/vector/bvec4property.h +++ b/include/openspace/properties/vector/bvec4property.h @@ -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 * diff --git a/include/openspace/properties/vector/dvec2property.h b/include/openspace/properties/vector/dvec2property.h index 2ad7df993f..84cd253505 100644 --- a/include/openspace/properties/vector/dvec2property.h +++ b/include/openspace/properties/vector/dvec2property.h @@ -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 * diff --git a/include/openspace/properties/vector/dvec3property.h b/include/openspace/properties/vector/dvec3property.h index 57463d6c41..63a057d8fb 100644 --- a/include/openspace/properties/vector/dvec3property.h +++ b/include/openspace/properties/vector/dvec3property.h @@ -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 * diff --git a/include/openspace/properties/vector/dvec4property.h b/include/openspace/properties/vector/dvec4property.h index eae10fe920..6fbd0b337d 100644 --- a/include/openspace/properties/vector/dvec4property.h +++ b/include/openspace/properties/vector/dvec4property.h @@ -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 * diff --git a/include/openspace/properties/vector/ivec2property.h b/include/openspace/properties/vector/ivec2property.h index 3c70c7a915..e9c986dfc7 100644 --- a/include/openspace/properties/vector/ivec2property.h +++ b/include/openspace/properties/vector/ivec2property.h @@ -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 * diff --git a/include/openspace/properties/vector/ivec3property.h b/include/openspace/properties/vector/ivec3property.h index f1a61401c9..d6242dd434 100644 --- a/include/openspace/properties/vector/ivec3property.h +++ b/include/openspace/properties/vector/ivec3property.h @@ -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 * diff --git a/include/openspace/properties/vector/ivec4property.h b/include/openspace/properties/vector/ivec4property.h index c4baa75d08..8d234e7f5c 100644 --- a/include/openspace/properties/vector/ivec4property.h +++ b/include/openspace/properties/vector/ivec4property.h @@ -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 * diff --git a/include/openspace/properties/vector/uvec2property.h b/include/openspace/properties/vector/uvec2property.h index 48a2629432..fd0cad517b 100644 --- a/include/openspace/properties/vector/uvec2property.h +++ b/include/openspace/properties/vector/uvec2property.h @@ -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 * diff --git a/include/openspace/properties/vector/uvec3property.h b/include/openspace/properties/vector/uvec3property.h index defc195ec1..b46ed1e6d9 100644 --- a/include/openspace/properties/vector/uvec3property.h +++ b/include/openspace/properties/vector/uvec3property.h @@ -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 * diff --git a/include/openspace/properties/vector/uvec4property.h b/include/openspace/properties/vector/uvec4property.h index e750f00e6a..367ffea1a5 100644 --- a/include/openspace/properties/vector/uvec4property.h +++ b/include/openspace/properties/vector/uvec4property.h @@ -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 * diff --git a/include/openspace/properties/vector/vec2property.h b/include/openspace/properties/vector/vec2property.h index ad26b1e9c4..3476c013c7 100644 --- a/include/openspace/properties/vector/vec2property.h +++ b/include/openspace/properties/vector/vec2property.h @@ -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 * diff --git a/include/openspace/properties/vector/vec3property.h b/include/openspace/properties/vector/vec3property.h index 0daceaad4a..5c43e59606 100644 --- a/include/openspace/properties/vector/vec3property.h +++ b/include/openspace/properties/vector/vec3property.h @@ -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 * diff --git a/include/openspace/properties/vector/vec4property.h b/include/openspace/properties/vector/vec4property.h index ae019c0e22..85bf3a3e87 100644 --- a/include/openspace/properties/vector/vec4property.h +++ b/include/openspace/properties/vector/vec4property.h @@ -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 * diff --git a/include/openspace/properties/vectorproperty.h b/include/openspace/properties/vectorproperty.h index d7792f1915..4fce75374c 100644 --- a/include/openspace/properties/vectorproperty.h +++ b/include/openspace/properties/vectorproperty.h @@ -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 * diff --git a/include/openspace/properties/wcharproperty.h b/include/openspace/properties/wcharproperty.h index 38d12030ce..231b8e3c05 100644 --- a/include/openspace/properties/wcharproperty.h +++ b/include/openspace/properties/wcharproperty.h @@ -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 * diff --git a/include/openspace/query/query.h b/include/openspace/query/query.h index 8941b8823e..52fafb8d85 100644 --- a/include/openspace/query/query.h +++ b/include/openspace/query/query.h @@ -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 * diff --git a/include/openspace/rendering/abufferrenderer.h b/include/openspace/rendering/abufferrenderer.h index 4d3972d38e..bd708f1fbf 100644 --- a/include/openspace/rendering/abufferrenderer.h +++ b/include/openspace/rendering/abufferrenderer.h @@ -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 * diff --git a/include/openspace/rendering/framebufferrenderer.h b/include/openspace/rendering/framebufferrenderer.h index 9ec20629d2..2bc0ec760e 100644 --- a/include/openspace/rendering/framebufferrenderer.h +++ b/include/openspace/rendering/framebufferrenderer.h @@ -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 * diff --git a/include/openspace/rendering/raycasterlistener.h b/include/openspace/rendering/raycasterlistener.h index 9c5b2df027..142c8ccf49 100644 --- a/include/openspace/rendering/raycasterlistener.h +++ b/include/openspace/rendering/raycasterlistener.h @@ -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 * diff --git a/include/openspace/rendering/raycastermanager.h b/include/openspace/rendering/raycastermanager.h index 8108ab756a..552f0460f9 100644 --- a/include/openspace/rendering/raycastermanager.h +++ b/include/openspace/rendering/raycastermanager.h @@ -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 * diff --git a/include/openspace/rendering/renderable.h b/include/openspace/rendering/renderable.h index fc3b9c61d9..3c77d09fbe 100644 --- a/include/openspace/rendering/renderable.h +++ b/include/openspace/rendering/renderable.h @@ -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 * diff --git a/include/openspace/rendering/renderengine.h b/include/openspace/rendering/renderengine.h index 725bfcbfa7..a9644fd41c 100644 --- a/include/openspace/rendering/renderengine.h +++ b/include/openspace/rendering/renderengine.h @@ -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 * diff --git a/include/openspace/rendering/renderer.h b/include/openspace/rendering/renderer.h index a09a433497..825a2ce5ad 100644 --- a/include/openspace/rendering/renderer.h +++ b/include/openspace/rendering/renderer.h @@ -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 * diff --git a/include/openspace/rendering/screenspacerenderable.h b/include/openspace/rendering/screenspacerenderable.h index aaebcb64b3..ec24a67848 100644 --- a/include/openspace/rendering/screenspacerenderable.h +++ b/include/openspace/rendering/screenspacerenderable.h @@ -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 * diff --git a/include/openspace/rendering/transferfunction.h b/include/openspace/rendering/transferfunction.h index 1bccef366e..dc6d1c9f15 100644 --- a/include/openspace/rendering/transferfunction.h +++ b/include/openspace/rendering/transferfunction.h @@ -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 * diff --git a/include/openspace/rendering/volume.h b/include/openspace/rendering/volume.h index 0a01f23c34..206715c4d9 100644 --- a/include/openspace/rendering/volume.h +++ b/include/openspace/rendering/volume.h @@ -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 * diff --git a/include/openspace/rendering/volumeraycaster.h b/include/openspace/rendering/volumeraycaster.h index 652d906e6e..72f3ca95c6 100644 --- a/include/openspace/rendering/volumeraycaster.h +++ b/include/openspace/rendering/volumeraycaster.h @@ -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 * diff --git a/include/openspace/scene/rotation.h b/include/openspace/scene/rotation.h index d831046280..b09883d2f6 100644 --- a/include/openspace/scene/rotation.h +++ b/include/openspace/scene/rotation.h @@ -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 * diff --git a/include/openspace/scene/scale.h b/include/openspace/scene/scale.h index f3af6473fd..91a2bfcf30 100644 --- a/include/openspace/scene/scale.h +++ b/include/openspace/scene/scale.h @@ -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 * diff --git a/include/openspace/scene/scene.h b/include/openspace/scene/scene.h index 31dec8b3dd..7ebc087e0d 100644 --- a/include/openspace/scene/scene.h +++ b/include/openspace/scene/scene.h @@ -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 * diff --git a/include/openspace/scene/scenegraph.h b/include/openspace/scene/scenegraph.h index effc22a3cc..01126bcc60 100644 --- a/include/openspace/scene/scenegraph.h +++ b/include/openspace/scene/scenegraph.h @@ -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 * diff --git a/include/openspace/scene/scenegraphnode.h b/include/openspace/scene/scenegraphnode.h index b028462909..9f178aa530 100644 --- a/include/openspace/scene/scenegraphnode.h +++ b/include/openspace/scene/scenegraphnode.h @@ -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 * diff --git a/include/openspace/scene/translation.h b/include/openspace/scene/translation.h index b8b2e211bf..c7abb4ba6c 100644 --- a/include/openspace/scene/translation.h +++ b/include/openspace/scene/translation.h @@ -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 * diff --git a/include/openspace/scripting/lualibrary.h b/include/openspace/scripting/lualibrary.h index 7c9f25c3a9..07e0b54794 100644 --- a/include/openspace/scripting/lualibrary.h +++ b/include/openspace/scripting/lualibrary.h @@ -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 * diff --git a/include/openspace/scripting/script_helper.h b/include/openspace/scripting/script_helper.h index cee943a0c1..01f2f7b352 100644 --- a/include/openspace/scripting/script_helper.h +++ b/include/openspace/scripting/script_helper.h @@ -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 * diff --git a/include/openspace/scripting/scriptengine.h b/include/openspace/scripting/scriptengine.h index c87beddaa8..5dad097168 100644 --- a/include/openspace/scripting/scriptengine.h +++ b/include/openspace/scripting/scriptengine.h @@ -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 * diff --git a/include/openspace/scripting/scriptscheduler.h b/include/openspace/scripting/scriptscheduler.h index 3f9f44916d..cd30739b90 100644 --- a/include/openspace/scripting/scriptscheduler.h +++ b/include/openspace/scripting/scriptscheduler.h @@ -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 * diff --git a/include/openspace/util/blockplaneintersectiongeometry.h b/include/openspace/util/blockplaneintersectiongeometry.h index 70117c36cd..2e49687f4a 100644 --- a/include/openspace/util/blockplaneintersectiongeometry.h +++ b/include/openspace/util/blockplaneintersectiongeometry.h @@ -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 * diff --git a/include/openspace/util/boxgeometry.h b/include/openspace/util/boxgeometry.h index 8b87f29397..c6ca91247c 100644 --- a/include/openspace/util/boxgeometry.h +++ b/include/openspace/util/boxgeometry.h @@ -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 * diff --git a/include/openspace/util/factorymanager.h b/include/openspace/util/factorymanager.h index 663376d7f1..7b815ca065 100644 --- a/include/openspace/util/factorymanager.h +++ b/include/openspace/util/factorymanager.h @@ -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 * diff --git a/include/openspace/util/gpudata.h b/include/openspace/util/gpudata.h index aac40f5ba8..2a3af70d21 100644 --- a/include/openspace/util/gpudata.h +++ b/include/openspace/util/gpudata.h @@ -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 * diff --git a/include/openspace/util/keys.h b/include/openspace/util/keys.h index f65c13a261..8294cad88f 100644 --- a/include/openspace/util/keys.h +++ b/include/openspace/util/keys.h @@ -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 * diff --git a/include/openspace/util/mouse.h b/include/openspace/util/mouse.h index c616ec73a4..8dcbaed06f 100644 --- a/include/openspace/util/mouse.h +++ b/include/openspace/util/mouse.h @@ -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 * diff --git a/include/openspace/util/openspacemodule.h b/include/openspace/util/openspacemodule.h index 266c07a0c9..a88cae8a6e 100644 --- a/include/openspace/util/openspacemodule.h +++ b/include/openspace/util/openspacemodule.h @@ -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 * diff --git a/include/openspace/util/powerscaledcoordinate.h b/include/openspace/util/powerscaledcoordinate.h index 75cfb94e85..24b9925abc 100644 --- a/include/openspace/util/powerscaledcoordinate.h +++ b/include/openspace/util/powerscaledcoordinate.h @@ -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 * diff --git a/include/openspace/util/powerscaledscalar.h b/include/openspace/util/powerscaledscalar.h index 2fe2aea57d..3e1e06e1a2 100644 --- a/include/openspace/util/powerscaledscalar.h +++ b/include/openspace/util/powerscaledscalar.h @@ -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 * diff --git a/include/openspace/util/powerscaledsphere.h b/include/openspace/util/powerscaledsphere.h index da8e80ba90..0e51bb4364 100644 --- a/include/openspace/util/powerscaledsphere.h +++ b/include/openspace/util/powerscaledsphere.h @@ -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 * diff --git a/include/openspace/util/progressbar.h b/include/openspace/util/progressbar.h index 92f988958f..cbc0afe3d3 100644 --- a/include/openspace/util/progressbar.h +++ b/include/openspace/util/progressbar.h @@ -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 * diff --git a/include/openspace/util/screenlog.h b/include/openspace/util/screenlog.h index f800991555..b9769f7b01 100644 --- a/include/openspace/util/screenlog.h +++ b/include/openspace/util/screenlog.h @@ -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 * diff --git a/include/openspace/util/spicemanager.h b/include/openspace/util/spicemanager.h index 6350a26a43..5327b8004a 100644 --- a/include/openspace/util/spicemanager.h +++ b/include/openspace/util/spicemanager.h @@ -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 * diff --git a/include/openspace/util/syncbuffer.h b/include/openspace/util/syncbuffer.h index 2e00eba951..a64ee9191e 100644 --- a/include/openspace/util/syncbuffer.h +++ b/include/openspace/util/syncbuffer.h @@ -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 * diff --git a/include/openspace/util/syncdata.h b/include/openspace/util/syncdata.h index 4c491b539c..daeeaeedc0 100644 --- a/include/openspace/util/syncdata.h +++ b/include/openspace/util/syncdata.h @@ -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 * diff --git a/include/openspace/util/time.h b/include/openspace/util/time.h index e8b525539b..5241d21a61 100644 --- a/include/openspace/util/time.h +++ b/include/openspace/util/time.h @@ -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 * diff --git a/include/openspace/util/timerange.h b/include/openspace/util/timerange.h index 80a99c1fbf..fb22514ea5 100644 --- a/include/openspace/util/timerange.h +++ b/include/openspace/util/timerange.h @@ -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 * diff --git a/include/openspace/util/updatestructures.h b/include/openspace/util/updatestructures.h index 6708532276..423b30e37a 100644 --- a/include/openspace/util/updatestructures.h +++ b/include/openspace/util/updatestructures.h @@ -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 * diff --git a/libgdal.dylib b/libgdal.dylib deleted file mode 120000 index ea01525cd6..0000000000 --- a/libgdal.dylib +++ /dev/null @@ -1 +0,0 @@ -libgdal.1.dylib \ No newline at end of file diff --git a/modules/base/basemodule.cpp b/modules/base/basemodule.cpp index 73c6a5779b..3a55a853fb 100644 --- a/modules/base/basemodule.cpp +++ b/modules/base/basemodule.cpp @@ -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 * diff --git a/modules/base/basemodule.h b/modules/base/basemodule.h index ab115abb1a..a49a4ebf8f 100644 --- a/modules/base/basemodule.h +++ b/modules/base/basemodule.h @@ -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 * diff --git a/modules/base/rendering/modelgeometry.cpp b/modules/base/rendering/modelgeometry.cpp index 28e90ed083..3244fe062a 100644 --- a/modules/base/rendering/modelgeometry.cpp +++ b/modules/base/rendering/modelgeometry.cpp @@ -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 * diff --git a/modules/base/rendering/modelgeometry.h b/modules/base/rendering/modelgeometry.h index 8cd5a9abba..355f9ce1fb 100644 --- a/modules/base/rendering/modelgeometry.h +++ b/modules/base/rendering/modelgeometry.h @@ -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 * diff --git a/modules/base/rendering/multimodelgeometry.cpp b/modules/base/rendering/multimodelgeometry.cpp index 27bf69034b..49e5b77e43 100644 --- a/modules/base/rendering/multimodelgeometry.cpp +++ b/modules/base/rendering/multimodelgeometry.cpp @@ -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 * diff --git a/modules/base/rendering/multimodelgeometry.h b/modules/base/rendering/multimodelgeometry.h index ce4d8436e7..dedd7f256c 100644 --- a/modules/base/rendering/multimodelgeometry.h +++ b/modules/base/rendering/multimodelgeometry.h @@ -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 * diff --git a/modules/base/rendering/renderablemodel.cpp b/modules/base/rendering/renderablemodel.cpp index aab085b9ae..2b5746f21b 100644 --- a/modules/base/rendering/renderablemodel.cpp +++ b/modules/base/rendering/renderablemodel.cpp @@ -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 * diff --git a/modules/base/rendering/renderablemodel.h b/modules/base/rendering/renderablemodel.h index 2921b47ee4..c8c066e233 100644 --- a/modules/base/rendering/renderablemodel.h +++ b/modules/base/rendering/renderablemodel.h @@ -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 * diff --git a/modules/base/rendering/renderablepath.cpp b/modules/base/rendering/renderablepath.cpp index f0e3623950..ebea0891cb 100644 --- a/modules/base/rendering/renderablepath.cpp +++ b/modules/base/rendering/renderablepath.cpp @@ -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 * diff --git a/modules/base/rendering/renderablepath.h b/modules/base/rendering/renderablepath.h index e83fc305da..44c7dfb1b8 100644 --- a/modules/base/rendering/renderablepath.h +++ b/modules/base/rendering/renderablepath.h @@ -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 * diff --git a/modules/base/rendering/renderableplane.cpp b/modules/base/rendering/renderableplane.cpp index 3c88efce3a..744c94e83e 100644 --- a/modules/base/rendering/renderableplane.cpp +++ b/modules/base/rendering/renderableplane.cpp @@ -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 * diff --git a/modules/base/rendering/renderableplane.h b/modules/base/rendering/renderableplane.h index 3b8ce519dd..3c26807882 100644 --- a/modules/base/rendering/renderableplane.h +++ b/modules/base/rendering/renderableplane.h @@ -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 * diff --git a/modules/base/rendering/renderablesphere.cpp b/modules/base/rendering/renderablesphere.cpp index ce5049df5a..5453db84c6 100644 --- a/modules/base/rendering/renderablesphere.cpp +++ b/modules/base/rendering/renderablesphere.cpp @@ -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 * diff --git a/modules/base/rendering/renderablesphere.h b/modules/base/rendering/renderablesphere.h index b423a864a7..e697ca7f5a 100644 --- a/modules/base/rendering/renderablesphere.h +++ b/modules/base/rendering/renderablesphere.h @@ -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 * diff --git a/modules/base/rendering/renderablesphericalgrid.cpp b/modules/base/rendering/renderablesphericalgrid.cpp index 6fc2743814..4af5bc3a82 100644 --- a/modules/base/rendering/renderablesphericalgrid.cpp +++ b/modules/base/rendering/renderablesphericalgrid.cpp @@ -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 * diff --git a/modules/base/rendering/renderablesphericalgrid.h b/modules/base/rendering/renderablesphericalgrid.h index 47bfabc849..1980018c48 100644 --- a/modules/base/rendering/renderablesphericalgrid.h +++ b/modules/base/rendering/renderablesphericalgrid.h @@ -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 * diff --git a/modules/base/rendering/renderabletrail.cpp b/modules/base/rendering/renderabletrail.cpp index 0313f59687..59b16a2ec5 100644 --- a/modules/base/rendering/renderabletrail.cpp +++ b/modules/base/rendering/renderabletrail.cpp @@ -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 * diff --git a/modules/base/rendering/renderabletrail.h b/modules/base/rendering/renderabletrail.h index 4b421cf88a..661c7524ad 100644 --- a/modules/base/rendering/renderabletrail.h +++ b/modules/base/rendering/renderabletrail.h @@ -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 * diff --git a/modules/base/rendering/renderabletrailorbit.cpp b/modules/base/rendering/renderabletrailorbit.cpp index 7215c17ab0..422d4eb8ce 100644 --- a/modules/base/rendering/renderabletrailorbit.cpp +++ b/modules/base/rendering/renderabletrailorbit.cpp @@ -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 * diff --git a/modules/base/rendering/renderabletrailorbit.h b/modules/base/rendering/renderabletrailorbit.h index 79371ce5d9..66703e1c76 100644 --- a/modules/base/rendering/renderabletrailorbit.h +++ b/modules/base/rendering/renderabletrailorbit.h @@ -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 * diff --git a/modules/base/rendering/renderabletrailtrajectory.cpp b/modules/base/rendering/renderabletrailtrajectory.cpp index 89f2f7d947..2e987f592a 100644 --- a/modules/base/rendering/renderabletrailtrajectory.cpp +++ b/modules/base/rendering/renderabletrailtrajectory.cpp @@ -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 * diff --git a/modules/base/rendering/renderabletrailtrajectory.h b/modules/base/rendering/renderabletrailtrajectory.h index 519b505c6c..2d3d8cf12a 100644 --- a/modules/base/rendering/renderabletrailtrajectory.h +++ b/modules/base/rendering/renderabletrailtrajectory.h @@ -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 * diff --git a/modules/base/rendering/screenspaceframebuffer.cpp b/modules/base/rendering/screenspaceframebuffer.cpp index 1e9502a9f1..630bb6d39b 100644 --- a/modules/base/rendering/screenspaceframebuffer.cpp +++ b/modules/base/rendering/screenspaceframebuffer.cpp @@ -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 * diff --git a/modules/base/rendering/screenspaceframebuffer.h b/modules/base/rendering/screenspaceframebuffer.h index ab408e77ba..21ccd5ab09 100644 --- a/modules/base/rendering/screenspaceframebuffer.h +++ b/modules/base/rendering/screenspaceframebuffer.h @@ -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 * diff --git a/modules/base/rendering/screenspaceimage.cpp b/modules/base/rendering/screenspaceimage.cpp index d68bd151c0..d5822c567c 100644 --- a/modules/base/rendering/screenspaceimage.cpp +++ b/modules/base/rendering/screenspaceimage.cpp @@ -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 * diff --git a/modules/base/rendering/screenspaceimage.h b/modules/base/rendering/screenspaceimage.h index 190598b430..9ae890cac1 100644 --- a/modules/base/rendering/screenspaceimage.h +++ b/modules/base/rendering/screenspaceimage.h @@ -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 * diff --git a/modules/base/rendering/wavefrontgeometry.cpp b/modules/base/rendering/wavefrontgeometry.cpp index c24014f7ee..bb4debc3ee 100644 --- a/modules/base/rendering/wavefrontgeometry.cpp +++ b/modules/base/rendering/wavefrontgeometry.cpp @@ -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 * diff --git a/modules/base/rendering/wavefrontgeometry.h b/modules/base/rendering/wavefrontgeometry.h index 5bc949942f..838149bd67 100644 --- a/modules/base/rendering/wavefrontgeometry.h +++ b/modules/base/rendering/wavefrontgeometry.h @@ -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 * diff --git a/modules/base/rotation/staticrotation.cpp b/modules/base/rotation/staticrotation.cpp index 5c645d4143..39d4cd4232 100644 --- a/modules/base/rotation/staticrotation.cpp +++ b/modules/base/rotation/staticrotation.cpp @@ -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 * diff --git a/modules/base/rotation/staticrotation.h b/modules/base/rotation/staticrotation.h index c2439edde1..7cf5f7af8f 100644 --- a/modules/base/rotation/staticrotation.h +++ b/modules/base/rotation/staticrotation.h @@ -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 * diff --git a/modules/base/scale/staticscale.cpp b/modules/base/scale/staticscale.cpp index b868291e43..b546751f72 100644 --- a/modules/base/scale/staticscale.cpp +++ b/modules/base/scale/staticscale.cpp @@ -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 * diff --git a/modules/base/scale/staticscale.h b/modules/base/scale/staticscale.h index 8ab3e36c3e..f7be8ecfeb 100644 --- a/modules/base/scale/staticscale.h +++ b/modules/base/scale/staticscale.h @@ -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 * diff --git a/modules/base/shaders/imageplane_fs.glsl b/modules/base/shaders/imageplane_fs.glsl index 581ebb46ef..0673ba4782 100644 --- a/modules/base/shaders/imageplane_fs.glsl +++ b/modules/base/shaders/imageplane_fs.glsl @@ -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 * diff --git a/modules/base/shaders/imageplane_vs.glsl b/modules/base/shaders/imageplane_vs.glsl index e98713c544..4b0bb8424d 100644 --- a/modules/base/shaders/imageplane_vs.glsl +++ b/modules/base/shaders/imageplane_vs.glsl @@ -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 * diff --git a/modules/base/shaders/model_fs.glsl b/modules/base/shaders/model_fs.glsl index c3f87451ec..3a14dc24dd 100644 --- a/modules/base/shaders/model_fs.glsl +++ b/modules/base/shaders/model_fs.glsl @@ -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 * diff --git a/modules/base/shaders/model_vs.glsl b/modules/base/shaders/model_vs.glsl index be60d9162e..2837c67a44 100644 --- a/modules/base/shaders/model_vs.glsl +++ b/modules/base/shaders/model_vs.glsl @@ -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 * diff --git a/modules/base/shaders/path_fs.glsl b/modules/base/shaders/path_fs.glsl index f2c701ae64..101d592048 100644 --- a/modules/base/shaders/path_fs.glsl +++ b/modules/base/shaders/path_fs.glsl @@ -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 * diff --git a/modules/base/shaders/path_gs.glsl b/modules/base/shaders/path_gs.glsl index 871001236f..b5305ff15f 100644 --- a/modules/base/shaders/path_gs.glsl +++ b/modules/base/shaders/path_gs.glsl @@ -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 * diff --git a/modules/base/shaders/path_vs.glsl b/modules/base/shaders/path_vs.glsl index b8f9697e9d..e492beaa3e 100644 --- a/modules/base/shaders/path_vs.glsl +++ b/modules/base/shaders/path_vs.glsl @@ -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 * diff --git a/modules/base/shaders/plane_fs.glsl b/modules/base/shaders/plane_fs.glsl index bfabe1ccb9..aa2902a829 100644 --- a/modules/base/shaders/plane_fs.glsl +++ b/modules/base/shaders/plane_fs.glsl @@ -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 * diff --git a/modules/base/shaders/plane_vs.glsl b/modules/base/shaders/plane_vs.glsl index 45d0125d7e..b64c7c2423 100644 --- a/modules/base/shaders/plane_vs.glsl +++ b/modules/base/shaders/plane_vs.glsl @@ -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 * diff --git a/modules/base/shaders/renderabletrail_fs.glsl b/modules/base/shaders/renderabletrail_fs.glsl index 288aa5dc12..600ccb8240 100644 --- a/modules/base/shaders/renderabletrail_fs.glsl +++ b/modules/base/shaders/renderabletrail_fs.glsl @@ -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 * diff --git a/modules/base/shaders/renderabletrail_vs.glsl b/modules/base/shaders/renderabletrail_vs.glsl index 2db1690fda..3aa70b8575 100644 --- a/modules/base/shaders/renderabletrail_vs.glsl +++ b/modules/base/shaders/renderabletrail_vs.glsl @@ -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 * diff --git a/modules/base/shaders/sphere_fs.glsl b/modules/base/shaders/sphere_fs.glsl index f059466731..0fb59c43f2 100644 --- a/modules/base/shaders/sphere_fs.glsl +++ b/modules/base/shaders/sphere_fs.glsl @@ -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 * diff --git a/modules/base/shaders/sphere_vs.glsl b/modules/base/shaders/sphere_vs.glsl index 7c64455d68..6add629a6d 100644 --- a/modules/base/shaders/sphere_vs.glsl +++ b/modules/base/shaders/sphere_vs.glsl @@ -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 * diff --git a/modules/base/translation/statictranslation.cpp b/modules/base/translation/statictranslation.cpp index e0e3e85b42..3cabdbf7b5 100644 --- a/modules/base/translation/statictranslation.cpp +++ b/modules/base/translation/statictranslation.cpp @@ -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 * diff --git a/modules/base/translation/statictranslation.h b/modules/base/translation/statictranslation.h index a699497888..d5c1f64a48 100644 --- a/modules/base/translation/statictranslation.h +++ b/modules/base/translation/statictranslation.h @@ -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 * diff --git a/modules/debugging/debuggingmodule.cpp b/modules/debugging/debuggingmodule.cpp index b1e28763ac..4793bbb81e 100644 --- a/modules/debugging/debuggingmodule.cpp +++ b/modules/debugging/debuggingmodule.cpp @@ -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 * diff --git a/modules/debugging/debuggingmodule.h b/modules/debugging/debuggingmodule.h index 8ea478a4d0..ecfb7d791d 100644 --- a/modules/debugging/debuggingmodule.h +++ b/modules/debugging/debuggingmodule.h @@ -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 * diff --git a/modules/debugging/rendering/debugrenderer.cpp b/modules/debugging/rendering/debugrenderer.cpp index de3305a842..2fc223b1ad 100644 --- a/modules/debugging/rendering/debugrenderer.cpp +++ b/modules/debugging/rendering/debugrenderer.cpp @@ -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 * diff --git a/modules/debugging/rendering/debugrenderer.h b/modules/debugging/rendering/debugrenderer.h index 95e143e87c..158ebd3351 100644 --- a/modules/debugging/rendering/debugrenderer.h +++ b/modules/debugging/rendering/debugrenderer.h @@ -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 * diff --git a/modules/debugging/rendering/renderabledebugplane.cpp b/modules/debugging/rendering/renderabledebugplane.cpp index 98077c7a7b..e40dd68cd5 100644 --- a/modules/debugging/rendering/renderabledebugplane.cpp +++ b/modules/debugging/rendering/renderabledebugplane.cpp @@ -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 * diff --git a/modules/debugging/rendering/renderabledebugplane.h b/modules/debugging/rendering/renderabledebugplane.h index ffa476d0e9..7ce37d423e 100644 --- a/modules/debugging/rendering/renderabledebugplane.h +++ b/modules/debugging/rendering/renderabledebugplane.h @@ -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 * diff --git a/modules/fieldlines/fieldlinesmodule.cpp b/modules/fieldlines/fieldlinesmodule.cpp index 734ede9741..bc74add3d4 100644 --- a/modules/fieldlines/fieldlinesmodule.cpp +++ b/modules/fieldlines/fieldlinesmodule.cpp @@ -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 * diff --git a/modules/fieldlines/fieldlinesmodule.h b/modules/fieldlines/fieldlinesmodule.h index 4d6731383c..ef06ed869c 100644 --- a/modules/fieldlines/fieldlinesmodule.h +++ b/modules/fieldlines/fieldlinesmodule.h @@ -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 * diff --git a/modules/fieldlines/rendering/renderablefieldlines.cpp b/modules/fieldlines/rendering/renderablefieldlines.cpp index c9ed83c96e..1d855b278a 100644 --- a/modules/fieldlines/rendering/renderablefieldlines.cpp +++ b/modules/fieldlines/rendering/renderablefieldlines.cpp @@ -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 * diff --git a/modules/fieldlines/rendering/renderablefieldlines.h b/modules/fieldlines/rendering/renderablefieldlines.h index 6ffbf0ed09..a6b28821b2 100644 --- a/modules/fieldlines/rendering/renderablefieldlines.h +++ b/modules/fieldlines/rendering/renderablefieldlines.h @@ -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 * diff --git a/modules/galaxy/galaxymodule.cpp b/modules/galaxy/galaxymodule.cpp index 193cf9f5bb..1555ddc184 100644 --- a/modules/galaxy/galaxymodule.cpp +++ b/modules/galaxy/galaxymodule.cpp @@ -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 * diff --git a/modules/galaxy/galaxymodule.h b/modules/galaxy/galaxymodule.h index 0171435b68..6525a9a5a8 100644 --- a/modules/galaxy/galaxymodule.h +++ b/modules/galaxy/galaxymodule.h @@ -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 * diff --git a/modules/galaxy/rendering/galaxyraycaster.cpp b/modules/galaxy/rendering/galaxyraycaster.cpp index 84b12f6be8..ce2f8d68e4 100644 --- a/modules/galaxy/rendering/galaxyraycaster.cpp +++ b/modules/galaxy/rendering/galaxyraycaster.cpp @@ -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 * diff --git a/modules/galaxy/rendering/galaxyraycaster.h b/modules/galaxy/rendering/galaxyraycaster.h index fce9370fb5..b55a98df86 100644 --- a/modules/galaxy/rendering/galaxyraycaster.h +++ b/modules/galaxy/rendering/galaxyraycaster.h @@ -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 * diff --git a/modules/galaxy/rendering/renderablegalaxy.cpp b/modules/galaxy/rendering/renderablegalaxy.cpp index cd891e87eb..24ebec8484 100644 --- a/modules/galaxy/rendering/renderablegalaxy.cpp +++ b/modules/galaxy/rendering/renderablegalaxy.cpp @@ -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 * diff --git a/modules/galaxy/rendering/renderablegalaxy.h b/modules/galaxy/rendering/renderablegalaxy.h index fc104b36e4..77c5608a0a 100644 --- a/modules/galaxy/rendering/renderablegalaxy.h +++ b/modules/galaxy/rendering/renderablegalaxy.h @@ -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 * diff --git a/modules/galaxy/shaders/points.fs b/modules/galaxy/shaders/points.fs index 74548099fe..5ab9374fc8 100644 --- a/modules/galaxy/shaders/points.fs +++ b/modules/galaxy/shaders/points.fs @@ -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 * diff --git a/modules/galaxy/shaders/points.vs b/modules/galaxy/shaders/points.vs index 2e1170fdcd..b4b3f5dfb3 100644 --- a/modules/galaxy/shaders/points.vs +++ b/modules/galaxy/shaders/points.vs @@ -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 * diff --git a/modules/galaxy/shaders/raycasterbounds.fs b/modules/galaxy/shaders/raycasterbounds.fs index a335c00b51..76b85b859b 100644 --- a/modules/galaxy/shaders/raycasterbounds.fs +++ b/modules/galaxy/shaders/raycasterbounds.fs @@ -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 * diff --git a/modules/globebrowsing/chunk/chunk.cpp b/modules/globebrowsing/chunk/chunk.cpp index a70509c48c..490739c24b 100644 --- a/modules/globebrowsing/chunk/chunk.cpp +++ b/modules/globebrowsing/chunk/chunk.cpp @@ -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 * diff --git a/modules/globebrowsing/chunk/chunk.h b/modules/globebrowsing/chunk/chunk.h index d32955adf7..05c66f3dc5 100644 --- a/modules/globebrowsing/chunk/chunk.h +++ b/modules/globebrowsing/chunk/chunk.h @@ -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 * diff --git a/modules/globebrowsing/chunk/chunklevelevaluator.cpp b/modules/globebrowsing/chunk/chunklevelevaluator.cpp index b536df2dfa..be15e7712c 100644 --- a/modules/globebrowsing/chunk/chunklevelevaluator.cpp +++ b/modules/globebrowsing/chunk/chunklevelevaluator.cpp @@ -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 * diff --git a/modules/globebrowsing/chunk/chunklevelevaluator.h b/modules/globebrowsing/chunk/chunklevelevaluator.h index f8998a0cbf..40f09810e7 100644 --- a/modules/globebrowsing/chunk/chunklevelevaluator.h +++ b/modules/globebrowsing/chunk/chunklevelevaluator.h @@ -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 * diff --git a/modules/globebrowsing/chunk/chunknode.cpp b/modules/globebrowsing/chunk/chunknode.cpp index 9d67ebcbe8..56a13314c4 100644 --- a/modules/globebrowsing/chunk/chunknode.cpp +++ b/modules/globebrowsing/chunk/chunknode.cpp @@ -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 * diff --git a/modules/globebrowsing/chunk/chunknode.h b/modules/globebrowsing/chunk/chunknode.h index 8f4d59f023..bb7f0b719e 100644 --- a/modules/globebrowsing/chunk/chunknode.h +++ b/modules/globebrowsing/chunk/chunknode.h @@ -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 * diff --git a/modules/globebrowsing/chunk/culling.cpp b/modules/globebrowsing/chunk/culling.cpp index cac47f264b..73120626f7 100644 --- a/modules/globebrowsing/chunk/culling.cpp +++ b/modules/globebrowsing/chunk/culling.cpp @@ -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 * diff --git a/modules/globebrowsing/chunk/culling.h b/modules/globebrowsing/chunk/culling.h index 36105980ef..899e426040 100644 --- a/modules/globebrowsing/chunk/culling.h +++ b/modules/globebrowsing/chunk/culling.h @@ -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 * diff --git a/modules/globebrowsing/geometry/aabb.cpp b/modules/globebrowsing/geometry/aabb.cpp index 0eab00c376..e4eac43a16 100644 --- a/modules/globebrowsing/geometry/aabb.cpp +++ b/modules/globebrowsing/geometry/aabb.cpp @@ -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 * diff --git a/modules/globebrowsing/geometry/aabb.h b/modules/globebrowsing/geometry/aabb.h index a50ea6a6c1..b2310d85b7 100644 --- a/modules/globebrowsing/geometry/aabb.h +++ b/modules/globebrowsing/geometry/aabb.h @@ -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 * diff --git a/modules/globebrowsing/geometry/angle.h b/modules/globebrowsing/geometry/angle.h index 3af8e78cde..7836d2c21b 100644 --- a/modules/globebrowsing/geometry/angle.h +++ b/modules/globebrowsing/geometry/angle.h @@ -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 * diff --git a/modules/globebrowsing/geometry/angle.inl b/modules/globebrowsing/geometry/angle.inl index 341b35893b..f84431f91f 100644 --- a/modules/globebrowsing/geometry/angle.inl +++ b/modules/globebrowsing/geometry/angle.inl @@ -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 * diff --git a/modules/globebrowsing/geometry/convexhull.cpp b/modules/globebrowsing/geometry/convexhull.cpp index 48411c55ec..11ab3373f5 100644 --- a/modules/globebrowsing/geometry/convexhull.cpp +++ b/modules/globebrowsing/geometry/convexhull.cpp @@ -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 * diff --git a/modules/globebrowsing/geometry/convexhull.h b/modules/globebrowsing/geometry/convexhull.h index 7fc1da2c86..31a87f366f 100644 --- a/modules/globebrowsing/geometry/convexhull.h +++ b/modules/globebrowsing/geometry/convexhull.h @@ -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 * diff --git a/modules/globebrowsing/geometry/ellipsoid.cpp b/modules/globebrowsing/geometry/ellipsoid.cpp index f89f15e84a..4f756f575b 100644 --- a/modules/globebrowsing/geometry/ellipsoid.cpp +++ b/modules/globebrowsing/geometry/ellipsoid.cpp @@ -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 * diff --git a/modules/globebrowsing/geometry/ellipsoid.h b/modules/globebrowsing/geometry/ellipsoid.h index f4931a85d9..79b45b2075 100644 --- a/modules/globebrowsing/geometry/ellipsoid.h +++ b/modules/globebrowsing/geometry/ellipsoid.h @@ -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 * diff --git a/modules/globebrowsing/geometry/geodetic2.cpp b/modules/globebrowsing/geometry/geodetic2.cpp index b0f7f81d98..2039d31ef1 100644 --- a/modules/globebrowsing/geometry/geodetic2.cpp +++ b/modules/globebrowsing/geometry/geodetic2.cpp @@ -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 * diff --git a/modules/globebrowsing/geometry/geodetic2.h b/modules/globebrowsing/geometry/geodetic2.h index d9732077c7..39650626a0 100644 --- a/modules/globebrowsing/geometry/geodetic2.h +++ b/modules/globebrowsing/geometry/geodetic2.h @@ -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 * diff --git a/modules/globebrowsing/globebrowsingmodule.cpp b/modules/globebrowsing/globebrowsingmodule.cpp index c251b976eb..11928c22fb 100644 --- a/modules/globebrowsing/globebrowsingmodule.cpp +++ b/modules/globebrowsing/globebrowsingmodule.cpp @@ -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 * diff --git a/modules/globebrowsing/globebrowsingmodule.h b/modules/globebrowsing/globebrowsingmodule.h index 9431aa8bce..407152848b 100644 --- a/modules/globebrowsing/globebrowsingmodule.h +++ b/modules/globebrowsing/globebrowsingmodule.h @@ -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 * diff --git a/modules/globebrowsing/globes/chunkedlodglobe.cpp b/modules/globebrowsing/globes/chunkedlodglobe.cpp index 296c69ebe1..d1130bee96 100644 --- a/modules/globebrowsing/globes/chunkedlodglobe.cpp +++ b/modules/globebrowsing/globes/chunkedlodglobe.cpp @@ -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 * diff --git a/modules/globebrowsing/globes/chunkedlodglobe.h b/modules/globebrowsing/globes/chunkedlodglobe.h index 74a820f921..7a830c8ff9 100644 --- a/modules/globebrowsing/globes/chunkedlodglobe.h +++ b/modules/globebrowsing/globes/chunkedlodglobe.h @@ -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 * diff --git a/modules/globebrowsing/globes/pointglobe.cpp b/modules/globebrowsing/globes/pointglobe.cpp index 5e47fdede8..d4d796c18f 100644 --- a/modules/globebrowsing/globes/pointglobe.cpp +++ b/modules/globebrowsing/globes/pointglobe.cpp @@ -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 * diff --git a/modules/globebrowsing/globes/pointglobe.h b/modules/globebrowsing/globes/pointglobe.h index a377ad27e2..e8b24ddc19 100644 --- a/modules/globebrowsing/globes/pointglobe.h +++ b/modules/globebrowsing/globes/pointglobe.h @@ -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 * diff --git a/modules/globebrowsing/globes/renderableglobe.cpp b/modules/globebrowsing/globes/renderableglobe.cpp index 3441fc86fa..f093a79f2e 100644 --- a/modules/globebrowsing/globes/renderableglobe.cpp +++ b/modules/globebrowsing/globes/renderableglobe.cpp @@ -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 * diff --git a/modules/globebrowsing/globes/renderableglobe.h b/modules/globebrowsing/globes/renderableglobe.h index 2305f9246c..df9e58fe0c 100644 --- a/modules/globebrowsing/globes/renderableglobe.h +++ b/modules/globebrowsing/globes/renderableglobe.h @@ -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 * diff --git a/modules/globebrowsing/meshes/basicgrid.cpp b/modules/globebrowsing/meshes/basicgrid.cpp index 6f86f2a672..70e1ab5917 100644 --- a/modules/globebrowsing/meshes/basicgrid.cpp +++ b/modules/globebrowsing/meshes/basicgrid.cpp @@ -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 * diff --git a/modules/globebrowsing/meshes/grid.cpp b/modules/globebrowsing/meshes/grid.cpp index f6d6a1f2e3..4673e787aa 100644 --- a/modules/globebrowsing/meshes/grid.cpp +++ b/modules/globebrowsing/meshes/grid.cpp @@ -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 * diff --git a/modules/globebrowsing/meshes/grid.h b/modules/globebrowsing/meshes/grid.h index 37d169d696..d96d9ec35f 100644 --- a/modules/globebrowsing/meshes/grid.h +++ b/modules/globebrowsing/meshes/grid.h @@ -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 * diff --git a/modules/globebrowsing/meshes/skirtedgrid.cpp b/modules/globebrowsing/meshes/skirtedgrid.cpp index 9ccea91d28..66eeaaf30a 100644 --- a/modules/globebrowsing/meshes/skirtedgrid.cpp +++ b/modules/globebrowsing/meshes/skirtedgrid.cpp @@ -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 * diff --git a/modules/globebrowsing/meshes/skirtedgrid.h b/modules/globebrowsing/meshes/skirtedgrid.h index 1119c206f9..19cd2b7927 100644 --- a/modules/globebrowsing/meshes/skirtedgrid.h +++ b/modules/globebrowsing/meshes/skirtedgrid.h @@ -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 * diff --git a/modules/globebrowsing/meshes/trianglesoup.cpp b/modules/globebrowsing/meshes/trianglesoup.cpp index 74e9508d96..91b17e075a 100644 --- a/modules/globebrowsing/meshes/trianglesoup.cpp +++ b/modules/globebrowsing/meshes/trianglesoup.cpp @@ -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 * diff --git a/modules/globebrowsing/meshes/trianglesoup.h b/modules/globebrowsing/meshes/trianglesoup.h index dd84ef078f..91d3e59540 100644 --- a/modules/globebrowsing/meshes/trianglesoup.h +++ b/modules/globebrowsing/meshes/trianglesoup.h @@ -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 * diff --git a/modules/globebrowsing/other/concurrentjobmanager.h b/modules/globebrowsing/other/concurrentjobmanager.h index 5020d0682e..4f0ba44136 100644 --- a/modules/globebrowsing/other/concurrentjobmanager.h +++ b/modules/globebrowsing/other/concurrentjobmanager.h @@ -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 * diff --git a/modules/globebrowsing/other/concurrentjobmanager.inl b/modules/globebrowsing/other/concurrentjobmanager.inl index 58c75a7a9c..b7b862fd87 100644 --- a/modules/globebrowsing/other/concurrentjobmanager.inl +++ b/modules/globebrowsing/other/concurrentjobmanager.inl @@ -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 * diff --git a/modules/globebrowsing/other/concurrentqueue.h b/modules/globebrowsing/other/concurrentqueue.h index 7495b0124d..e66f64e734 100644 --- a/modules/globebrowsing/other/concurrentqueue.h +++ b/modules/globebrowsing/other/concurrentqueue.h @@ -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 * diff --git a/modules/globebrowsing/other/concurrentqueue.inl b/modules/globebrowsing/other/concurrentqueue.inl index 17b610c997..f493cacc7f 100644 --- a/modules/globebrowsing/other/concurrentqueue.inl +++ b/modules/globebrowsing/other/concurrentqueue.inl @@ -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 * diff --git a/modules/globebrowsing/other/distanceswitch.cpp b/modules/globebrowsing/other/distanceswitch.cpp index 2cee681bc6..4200e0c242 100644 --- a/modules/globebrowsing/other/distanceswitch.cpp +++ b/modules/globebrowsing/other/distanceswitch.cpp @@ -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 * diff --git a/modules/globebrowsing/other/distanceswitch.h b/modules/globebrowsing/other/distanceswitch.h index 009a3300ae..7a884cd5f1 100644 --- a/modules/globebrowsing/other/distanceswitch.h +++ b/modules/globebrowsing/other/distanceswitch.h @@ -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 * diff --git a/modules/globebrowsing/other/lrucache.h b/modules/globebrowsing/other/lrucache.h index 2758ed0c3d..649a222ae0 100644 --- a/modules/globebrowsing/other/lrucache.h +++ b/modules/globebrowsing/other/lrucache.h @@ -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 * diff --git a/modules/globebrowsing/other/lrucache.inl b/modules/globebrowsing/other/lrucache.inl index 83c37bbc88..4aacc3132e 100644 --- a/modules/globebrowsing/other/lrucache.inl +++ b/modules/globebrowsing/other/lrucache.inl @@ -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 * diff --git a/modules/globebrowsing/other/statscollector.cpp b/modules/globebrowsing/other/statscollector.cpp index 721a24b092..cd074b089b 100644 --- a/modules/globebrowsing/other/statscollector.cpp +++ b/modules/globebrowsing/other/statscollector.cpp @@ -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 * diff --git a/modules/globebrowsing/other/statscollector.h b/modules/globebrowsing/other/statscollector.h index 447e308ee4..043d2757a5 100644 --- a/modules/globebrowsing/other/statscollector.h +++ b/modules/globebrowsing/other/statscollector.h @@ -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 * diff --git a/modules/globebrowsing/other/statscollector.inl b/modules/globebrowsing/other/statscollector.inl index bd41627cb2..bafbc02366 100644 --- a/modules/globebrowsing/other/statscollector.inl +++ b/modules/globebrowsing/other/statscollector.inl @@ -3,7 +3,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 * diff --git a/modules/globebrowsing/other/threadpool.cpp b/modules/globebrowsing/other/threadpool.cpp index 517fa183c6..10de678202 100644 --- a/modules/globebrowsing/other/threadpool.cpp +++ b/modules/globebrowsing/other/threadpool.cpp @@ -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 * diff --git a/modules/globebrowsing/other/threadpool.h b/modules/globebrowsing/other/threadpool.h index 683d0064e7..97bf25190b 100644 --- a/modules/globebrowsing/other/threadpool.h +++ b/modules/globebrowsing/other/threadpool.h @@ -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 * diff --git a/modules/globebrowsing/rendering/chunkrenderer.cpp b/modules/globebrowsing/rendering/chunkrenderer.cpp index cca9bd191c..d98805df40 100644 --- a/modules/globebrowsing/rendering/chunkrenderer.cpp +++ b/modules/globebrowsing/rendering/chunkrenderer.cpp @@ -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 * diff --git a/modules/globebrowsing/rendering/chunkrenderer.h b/modules/globebrowsing/rendering/chunkrenderer.h index 2086f29d2d..7a4c3ef41a 100644 --- a/modules/globebrowsing/rendering/chunkrenderer.h +++ b/modules/globebrowsing/rendering/chunkrenderer.h @@ -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 * diff --git a/modules/globebrowsing/rendering/gpulayermanager.cpp b/modules/globebrowsing/rendering/gpulayermanager.cpp index 355b0af5ae..262e207585 100644 --- a/modules/globebrowsing/rendering/gpulayermanager.cpp +++ b/modules/globebrowsing/rendering/gpulayermanager.cpp @@ -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 * diff --git a/modules/globebrowsing/rendering/gpulayermanager.h b/modules/globebrowsing/rendering/gpulayermanager.h index ec9834a610..f901118286 100644 --- a/modules/globebrowsing/rendering/gpulayermanager.h +++ b/modules/globebrowsing/rendering/gpulayermanager.h @@ -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 * diff --git a/modules/globebrowsing/rendering/layermanager.cpp b/modules/globebrowsing/rendering/layermanager.cpp index b4dc908b5a..98533cd69f 100644 --- a/modules/globebrowsing/rendering/layermanager.cpp +++ b/modules/globebrowsing/rendering/layermanager.cpp @@ -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 * diff --git a/modules/globebrowsing/rendering/layermanager.h b/modules/globebrowsing/rendering/layermanager.h index 71963643a0..964545ee31 100644 --- a/modules/globebrowsing/rendering/layermanager.h +++ b/modules/globebrowsing/rendering/layermanager.h @@ -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 * diff --git a/modules/globebrowsing/rendering/layershadermanager.cpp b/modules/globebrowsing/rendering/layershadermanager.cpp index f43b73068a..1c2e647588 100644 --- a/modules/globebrowsing/rendering/layershadermanager.cpp +++ b/modules/globebrowsing/rendering/layershadermanager.cpp @@ -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 * diff --git a/modules/globebrowsing/rendering/layershadermanager.h b/modules/globebrowsing/rendering/layershadermanager.h index 4138bdd55b..03b0cc1d40 100644 --- a/modules/globebrowsing/rendering/layershadermanager.h +++ b/modules/globebrowsing/rendering/layershadermanager.h @@ -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 * diff --git a/modules/globebrowsing/tile/asynctilereader.cpp b/modules/globebrowsing/tile/asynctilereader.cpp index e79744ab33..3ea69d0d68 100644 --- a/modules/globebrowsing/tile/asynctilereader.cpp +++ b/modules/globebrowsing/tile/asynctilereader.cpp @@ -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 * diff --git a/modules/globebrowsing/tile/asynctilereader.h b/modules/globebrowsing/tile/asynctilereader.h index 748c95c62d..d24f8d98b2 100644 --- a/modules/globebrowsing/tile/asynctilereader.h +++ b/modules/globebrowsing/tile/asynctilereader.h @@ -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 * diff --git a/modules/globebrowsing/tile/chunktile.h b/modules/globebrowsing/tile/chunktile.h index 05f765c449..071c605616 100644 --- a/modules/globebrowsing/tile/chunktile.h +++ b/modules/globebrowsing/tile/chunktile.h @@ -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 * diff --git a/modules/globebrowsing/tile/pixelregion.cpp b/modules/globebrowsing/tile/pixelregion.cpp index 9649803e41..b0ea885c64 100644 --- a/modules/globebrowsing/tile/pixelregion.cpp +++ b/modules/globebrowsing/tile/pixelregion.cpp @@ -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 * diff --git a/modules/globebrowsing/tile/pixelregion.h b/modules/globebrowsing/tile/pixelregion.h index 84fbca1d0d..e77d51b289 100644 --- a/modules/globebrowsing/tile/pixelregion.h +++ b/modules/globebrowsing/tile/pixelregion.h @@ -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 * diff --git a/modules/globebrowsing/tile/tile.cpp b/modules/globebrowsing/tile/tile.cpp index 0ef46ef91e..1c585f6155 100644 --- a/modules/globebrowsing/tile/tile.cpp +++ b/modules/globebrowsing/tile/tile.cpp @@ -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 * diff --git a/modules/globebrowsing/tile/tile.h b/modules/globebrowsing/tile/tile.h index dc478a93d5..ccc2bac62a 100644 --- a/modules/globebrowsing/tile/tile.h +++ b/modules/globebrowsing/tile/tile.h @@ -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 * diff --git a/modules/globebrowsing/tile/tiledataset.cpp b/modules/globebrowsing/tile/tiledataset.cpp index 0cc2912cea..7c4652c770 100644 --- a/modules/globebrowsing/tile/tiledataset.cpp +++ b/modules/globebrowsing/tile/tiledataset.cpp @@ -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 * diff --git a/modules/globebrowsing/tile/tiledataset.h b/modules/globebrowsing/tile/tiledataset.h index 96b7c4dcc9..7fc27bff82 100644 --- a/modules/globebrowsing/tile/tiledataset.h +++ b/modules/globebrowsing/tile/tiledataset.h @@ -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 * diff --git a/modules/globebrowsing/tile/tiledatatype.h b/modules/globebrowsing/tile/tiledatatype.h index 5c26df5a37..8b26bc7e19 100644 --- a/modules/globebrowsing/tile/tiledatatype.h +++ b/modules/globebrowsing/tile/tiledatatype.h @@ -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 * diff --git a/modules/globebrowsing/tile/tilediskcache.cpp b/modules/globebrowsing/tile/tilediskcache.cpp index 63e172f0fe..5af4348ef8 100644 --- a/modules/globebrowsing/tile/tilediskcache.cpp +++ b/modules/globebrowsing/tile/tilediskcache.cpp @@ -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 * diff --git a/modules/globebrowsing/tile/tilediskcache.h b/modules/globebrowsing/tile/tilediskcache.h index 71880d8036..9abb901573 100644 --- a/modules/globebrowsing/tile/tilediskcache.h +++ b/modules/globebrowsing/tile/tilediskcache.h @@ -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 * diff --git a/modules/globebrowsing/tile/tileindex.cpp b/modules/globebrowsing/tile/tileindex.cpp index 4ae8590415..0ae301e087 100644 --- a/modules/globebrowsing/tile/tileindex.cpp +++ b/modules/globebrowsing/tile/tileindex.cpp @@ -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 * diff --git a/modules/globebrowsing/tile/tileindex.h b/modules/globebrowsing/tile/tileindex.h index d8d3314c2f..434097fcc0 100644 --- a/modules/globebrowsing/tile/tileindex.h +++ b/modules/globebrowsing/tile/tileindex.h @@ -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 * diff --git a/modules/globebrowsing/tile/tileprovider/cachingtileprovider.cpp b/modules/globebrowsing/tile/tileprovider/cachingtileprovider.cpp index 1b0efa1eff..d0e4e780fd 100644 --- a/modules/globebrowsing/tile/tileprovider/cachingtileprovider.cpp +++ b/modules/globebrowsing/tile/tileprovider/cachingtileprovider.cpp @@ -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 * diff --git a/modules/globebrowsing/tile/tileprovider/cachingtileprovider.h b/modules/globebrowsing/tile/tileprovider/cachingtileprovider.h index 5531c6e9d2..cb7a6fd56a 100644 --- a/modules/globebrowsing/tile/tileprovider/cachingtileprovider.h +++ b/modules/globebrowsing/tile/tileprovider/cachingtileprovider.h @@ -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 * diff --git a/modules/globebrowsing/tile/tileprovider/singleimageprovider.cpp b/modules/globebrowsing/tile/tileprovider/singleimageprovider.cpp index 240779820a..73b8d51232 100644 --- a/modules/globebrowsing/tile/tileprovider/singleimageprovider.cpp +++ b/modules/globebrowsing/tile/tileprovider/singleimageprovider.cpp @@ -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 * diff --git a/modules/globebrowsing/tile/tileprovider/singleimageprovider.h b/modules/globebrowsing/tile/tileprovider/singleimageprovider.h index 793337a0c4..33f30635e2 100644 --- a/modules/globebrowsing/tile/tileprovider/singleimageprovider.h +++ b/modules/globebrowsing/tile/tileprovider/singleimageprovider.h @@ -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 * diff --git a/modules/globebrowsing/tile/tileprovider/temporaltileprovider.cpp b/modules/globebrowsing/tile/tileprovider/temporaltileprovider.cpp index 3e187dc95f..f045099409 100644 --- a/modules/globebrowsing/tile/tileprovider/temporaltileprovider.cpp +++ b/modules/globebrowsing/tile/tileprovider/temporaltileprovider.cpp @@ -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 * diff --git a/modules/globebrowsing/tile/tileprovider/temporaltileprovider.h b/modules/globebrowsing/tile/tileprovider/temporaltileprovider.h index fa7b08103d..09b7f64e06 100644 --- a/modules/globebrowsing/tile/tileprovider/temporaltileprovider.h +++ b/modules/globebrowsing/tile/tileprovider/temporaltileprovider.h @@ -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 * diff --git a/modules/globebrowsing/tile/tileprovider/texttileprovider.cpp b/modules/globebrowsing/tile/tileprovider/texttileprovider.cpp index 278a7d4234..6c54c24b37 100644 --- a/modules/globebrowsing/tile/tileprovider/texttileprovider.cpp +++ b/modules/globebrowsing/tile/tileprovider/texttileprovider.cpp @@ -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 * diff --git a/modules/globebrowsing/tile/tileprovider/texttileprovider.h b/modules/globebrowsing/tile/tileprovider/texttileprovider.h index a158fb7416..1db21fa6fa 100644 --- a/modules/globebrowsing/tile/tileprovider/texttileprovider.h +++ b/modules/globebrowsing/tile/tileprovider/texttileprovider.h @@ -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 * diff --git a/modules/globebrowsing/tile/tileprovider/tileprovider.cpp b/modules/globebrowsing/tile/tileprovider/tileprovider.cpp index b3f25fbc66..9332b576b3 100644 --- a/modules/globebrowsing/tile/tileprovider/tileprovider.cpp +++ b/modules/globebrowsing/tile/tileprovider/tileprovider.cpp @@ -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 * diff --git a/modules/globebrowsing/tile/tileprovider/tileprovider.h b/modules/globebrowsing/tile/tileprovider/tileprovider.h index 7a43c24482..8d2e1008ff 100644 --- a/modules/globebrowsing/tile/tileprovider/tileprovider.h +++ b/modules/globebrowsing/tile/tileprovider/tileprovider.h @@ -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 * diff --git a/modules/globebrowsing/tile/tileprovider/tileproviderbyindex.h b/modules/globebrowsing/tile/tileprovider/tileproviderbyindex.h index 09e4922e71..58673ad5ee 100644 --- a/modules/globebrowsing/tile/tileprovider/tileproviderbyindex.h +++ b/modules/globebrowsing/tile/tileprovider/tileproviderbyindex.h @@ -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 * diff --git a/modules/globebrowsing/tile/tileprovider/tileproviderbylevel.cpp b/modules/globebrowsing/tile/tileprovider/tileproviderbylevel.cpp index 7a0edaf313..1cd1351e56 100644 --- a/modules/globebrowsing/tile/tileprovider/tileproviderbylevel.cpp +++ b/modules/globebrowsing/tile/tileprovider/tileproviderbylevel.cpp @@ -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 * diff --git a/modules/globebrowsing/tile/tileprovider/tileproviderbylevel.h b/modules/globebrowsing/tile/tileprovider/tileproviderbylevel.h index 3477c92e86..05c9dba3b3 100644 --- a/modules/globebrowsing/tile/tileprovider/tileproviderbylevel.h +++ b/modules/globebrowsing/tile/tileprovider/tileproviderbylevel.h @@ -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 * diff --git a/modules/globebrowsing/tile/tileselector.cpp b/modules/globebrowsing/tile/tileselector.cpp index 870c706645..9ded4d96a2 100644 --- a/modules/globebrowsing/tile/tileselector.cpp +++ b/modules/globebrowsing/tile/tileselector.cpp @@ -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 * diff --git a/modules/globebrowsing/tile/tileselector.h b/modules/globebrowsing/tile/tileselector.h index 3a5b960b36..61f6ee2cc1 100644 --- a/modules/globebrowsing/tile/tileselector.h +++ b/modules/globebrowsing/tile/tileselector.h @@ -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 * diff --git a/modules/iswa/iswamodule.cpp b/modules/iswa/iswamodule.cpp index 98d0094eef..6c7d5e7ceb 100644 --- a/modules/iswa/iswamodule.cpp +++ b/modules/iswa/iswamodule.cpp @@ -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 * diff --git a/modules/iswa/iswamodule.h b/modules/iswa/iswamodule.h index 5d1bbb19a9..e337a2facb 100644 --- a/modules/iswa/iswamodule.h +++ b/modules/iswa/iswamodule.h @@ -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 * diff --git a/modules/iswa/rendering/datacygnet.cpp b/modules/iswa/rendering/datacygnet.cpp index 9c765cde09..aebb3bedd1 100644 --- a/modules/iswa/rendering/datacygnet.cpp +++ b/modules/iswa/rendering/datacygnet.cpp @@ -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 * diff --git a/modules/iswa/rendering/datacygnet.h b/modules/iswa/rendering/datacygnet.h index 2fd73b17e1..f31cf037e3 100644 --- a/modules/iswa/rendering/datacygnet.h +++ b/modules/iswa/rendering/datacygnet.h @@ -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 * diff --git a/modules/iswa/rendering/dataplane.cpp b/modules/iswa/rendering/dataplane.cpp index c53bdc6381..299beea1fc 100644 --- a/modules/iswa/rendering/dataplane.cpp +++ b/modules/iswa/rendering/dataplane.cpp @@ -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 * diff --git a/modules/iswa/rendering/dataplane.h b/modules/iswa/rendering/dataplane.h index fcd609c6dd..7a6b998691 100644 --- a/modules/iswa/rendering/dataplane.h +++ b/modules/iswa/rendering/dataplane.h @@ -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 * diff --git a/modules/iswa/rendering/datasphere.cpp b/modules/iswa/rendering/datasphere.cpp index fde4d90932..2f4d2f2da7 100644 --- a/modules/iswa/rendering/datasphere.cpp +++ b/modules/iswa/rendering/datasphere.cpp @@ -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 * diff --git a/modules/iswa/rendering/datasphere.h b/modules/iswa/rendering/datasphere.h index c50ea616d8..f85c0da21e 100644 --- a/modules/iswa/rendering/datasphere.h +++ b/modules/iswa/rendering/datasphere.h @@ -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 * diff --git a/modules/iswa/rendering/iswabasegroup.cpp b/modules/iswa/rendering/iswabasegroup.cpp index 6050cd7e87..cc2ab43c5e 100644 --- a/modules/iswa/rendering/iswabasegroup.cpp +++ b/modules/iswa/rendering/iswabasegroup.cpp @@ -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 * diff --git a/modules/iswa/rendering/iswabasegroup.h b/modules/iswa/rendering/iswabasegroup.h index 0a97234dff..cae941a3da 100644 --- a/modules/iswa/rendering/iswabasegroup.h +++ b/modules/iswa/rendering/iswabasegroup.h @@ -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 * diff --git a/modules/iswa/rendering/iswacygnet.cpp b/modules/iswa/rendering/iswacygnet.cpp index 3f2e844672..39f595ae71 100644 --- a/modules/iswa/rendering/iswacygnet.cpp +++ b/modules/iswa/rendering/iswacygnet.cpp @@ -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 * diff --git a/modules/iswa/rendering/iswacygnet.h b/modules/iswa/rendering/iswacygnet.h index 11172e28bd..24cc04071b 100644 --- a/modules/iswa/rendering/iswacygnet.h +++ b/modules/iswa/rendering/iswacygnet.h @@ -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 * diff --git a/modules/iswa/rendering/iswadatagroup.cpp b/modules/iswa/rendering/iswadatagroup.cpp index eaa26b2362..cfe57695e3 100644 --- a/modules/iswa/rendering/iswadatagroup.cpp +++ b/modules/iswa/rendering/iswadatagroup.cpp @@ -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 * diff --git a/modules/iswa/rendering/iswadatagroup.h b/modules/iswa/rendering/iswadatagroup.h index 07f37e05ec..34543e734c 100644 --- a/modules/iswa/rendering/iswadatagroup.h +++ b/modules/iswa/rendering/iswadatagroup.h @@ -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 * diff --git a/modules/iswa/rendering/iswakameleongroup.cpp b/modules/iswa/rendering/iswakameleongroup.cpp index 9f57bbb6ab..31cf174525 100644 --- a/modules/iswa/rendering/iswakameleongroup.cpp +++ b/modules/iswa/rendering/iswakameleongroup.cpp @@ -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 * diff --git a/modules/iswa/rendering/iswakameleongroup.h b/modules/iswa/rendering/iswakameleongroup.h index 26e7c921b1..973310761b 100644 --- a/modules/iswa/rendering/iswakameleongroup.h +++ b/modules/iswa/rendering/iswakameleongroup.h @@ -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 * diff --git a/modules/iswa/rendering/kameleonplane.cpp b/modules/iswa/rendering/kameleonplane.cpp index 55fce2c729..4a59995f0e 100644 --- a/modules/iswa/rendering/kameleonplane.cpp +++ b/modules/iswa/rendering/kameleonplane.cpp @@ -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 * diff --git a/modules/iswa/rendering/kameleonplane.h b/modules/iswa/rendering/kameleonplane.h index 702a7f5aa7..fb8ad4016b 100644 --- a/modules/iswa/rendering/kameleonplane.h +++ b/modules/iswa/rendering/kameleonplane.h @@ -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 * diff --git a/modules/iswa/rendering/screenspacecygnet.h b/modules/iswa/rendering/screenspacecygnet.h index a34e51dd50..afc52d7769 100644 --- a/modules/iswa/rendering/screenspacecygnet.h +++ b/modules/iswa/rendering/screenspacecygnet.h @@ -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 * diff --git a/modules/iswa/rendering/texturecygnet.cpp b/modules/iswa/rendering/texturecygnet.cpp index 7a601e55d3..d1a94de9ca 100644 --- a/modules/iswa/rendering/texturecygnet.cpp +++ b/modules/iswa/rendering/texturecygnet.cpp @@ -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 * diff --git a/modules/iswa/rendering/texturecygnet.h b/modules/iswa/rendering/texturecygnet.h index c432ae3abb..3bba1b2df0 100644 --- a/modules/iswa/rendering/texturecygnet.h +++ b/modules/iswa/rendering/texturecygnet.h @@ -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 * diff --git a/modules/iswa/rendering/textureplane.cpp b/modules/iswa/rendering/textureplane.cpp index 5704a1bae5..e6106e7e38 100644 --- a/modules/iswa/rendering/textureplane.cpp +++ b/modules/iswa/rendering/textureplane.cpp @@ -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 * diff --git a/modules/iswa/rendering/textureplane.h b/modules/iswa/rendering/textureplane.h index 3f812e1847..753b2cc5e0 100644 --- a/modules/iswa/rendering/textureplane.h +++ b/modules/iswa/rendering/textureplane.h @@ -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 * diff --git a/modules/iswa/shaders/dataplane_fs.glsl b/modules/iswa/shaders/dataplane_fs.glsl index 7307cf0e6e..c6c64765fd 100644 --- a/modules/iswa/shaders/dataplane_fs.glsl +++ b/modules/iswa/shaders/dataplane_fs.glsl @@ -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 * diff --git a/modules/iswa/shaders/dataplane_vs.glsl b/modules/iswa/shaders/dataplane_vs.glsl index c13225412f..d79e72a5e0 100644 --- a/modules/iswa/shaders/dataplane_vs.glsl +++ b/modules/iswa/shaders/dataplane_vs.glsl @@ -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 * diff --git a/modules/iswa/shaders/datasphere_fs.glsl b/modules/iswa/shaders/datasphere_fs.glsl index 7331a347e4..3a350eeee7 100644 --- a/modules/iswa/shaders/datasphere_fs.glsl +++ b/modules/iswa/shaders/datasphere_fs.glsl @@ -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 * diff --git a/modules/iswa/shaders/textureplane_fs.glsl b/modules/iswa/shaders/textureplane_fs.glsl index d290d159c3..74e3727cb5 100644 --- a/modules/iswa/shaders/textureplane_fs.glsl +++ b/modules/iswa/shaders/textureplane_fs.glsl @@ -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 * diff --git a/modules/iswa/shaders/textureplane_vs.glsl b/modules/iswa/shaders/textureplane_vs.glsl index c13225412f..d79e72a5e0 100644 --- a/modules/iswa/shaders/textureplane_vs.glsl +++ b/modules/iswa/shaders/textureplane_vs.glsl @@ -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 * diff --git a/modules/iswa/util/dataprocessor.cpp b/modules/iswa/util/dataprocessor.cpp index b61fa59315..482318a754 100644 --- a/modules/iswa/util/dataprocessor.cpp +++ b/modules/iswa/util/dataprocessor.cpp @@ -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 * diff --git a/modules/iswa/util/dataprocessor.h b/modules/iswa/util/dataprocessor.h index 8a84fcd8f3..5bcb75bbd4 100644 --- a/modules/iswa/util/dataprocessor.h +++ b/modules/iswa/util/dataprocessor.h @@ -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 * diff --git a/modules/iswa/util/dataprocessorjson.cpp b/modules/iswa/util/dataprocessorjson.cpp index b966fefe09..29a45b06ef 100644 --- a/modules/iswa/util/dataprocessorjson.cpp +++ b/modules/iswa/util/dataprocessorjson.cpp @@ -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 * diff --git a/modules/iswa/util/dataprocessorjson.h b/modules/iswa/util/dataprocessorjson.h index 98f29aae4c..cec8253430 100644 --- a/modules/iswa/util/dataprocessorjson.h +++ b/modules/iswa/util/dataprocessorjson.h @@ -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 * diff --git a/modules/iswa/util/dataprocessorkameleon.cpp b/modules/iswa/util/dataprocessorkameleon.cpp index b1078cab58..a9270e8089 100644 --- a/modules/iswa/util/dataprocessorkameleon.cpp +++ b/modules/iswa/util/dataprocessorkameleon.cpp @@ -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 * diff --git a/modules/iswa/util/dataprocessorkameleon.h b/modules/iswa/util/dataprocessorkameleon.h index aa29aa0dc9..891c1eba94 100644 --- a/modules/iswa/util/dataprocessorkameleon.h +++ b/modules/iswa/util/dataprocessorkameleon.h @@ -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 * diff --git a/modules/iswa/util/dataprocessortext.cpp b/modules/iswa/util/dataprocessortext.cpp index 8e8e724844..cdb7becdc1 100644 --- a/modules/iswa/util/dataprocessortext.cpp +++ b/modules/iswa/util/dataprocessortext.cpp @@ -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 * diff --git a/modules/iswa/util/dataprocessortext.h b/modules/iswa/util/dataprocessortext.h index d4648d5018..3ecf61c68b 100644 --- a/modules/iswa/util/dataprocessortext.h +++ b/modules/iswa/util/dataprocessortext.h @@ -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 * diff --git a/modules/iswa/util/iswamanager.cpp b/modules/iswa/util/iswamanager.cpp index 7e243fea85..14ff791eaf 100644 --- a/modules/iswa/util/iswamanager.cpp +++ b/modules/iswa/util/iswamanager.cpp @@ -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 * diff --git a/modules/iswa/util/iswamanager.h b/modules/iswa/util/iswamanager.h index 24d926c05f..e7cc410f54 100644 --- a/modules/iswa/util/iswamanager.h +++ b/modules/iswa/util/iswamanager.h @@ -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 * diff --git a/modules/iswa/util/iswamanager_lua.inl b/modules/iswa/util/iswamanager_lua.inl index 1a704b8aee..6fd5763881 100644 --- a/modules/iswa/util/iswamanager_lua.inl +++ b/modules/iswa/util/iswamanager_lua.inl @@ -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 * diff --git a/modules/kameleon/include/kameleonwrapper.h b/modules/kameleon/include/kameleonwrapper.h index 08f717c8e1..2268b10695 100644 --- a/modules/kameleon/include/kameleonwrapper.h +++ b/modules/kameleon/include/kameleonwrapper.h @@ -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 * diff --git a/modules/kameleon/kameleonmodule.cpp b/modules/kameleon/kameleonmodule.cpp index 735d08248d..35950630f3 100644 --- a/modules/kameleon/kameleonmodule.cpp +++ b/modules/kameleon/kameleonmodule.cpp @@ -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 * diff --git a/modules/kameleon/kameleonmodule.h b/modules/kameleon/kameleonmodule.h index 458157ef79..d8acde2303 100644 --- a/modules/kameleon/kameleonmodule.h +++ b/modules/kameleon/kameleonmodule.h @@ -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 * diff --git a/modules/multiresvolume/multiresvolumemodule.cpp b/modules/multiresvolume/multiresvolumemodule.cpp index 13f988638c..e5c64dabcb 100644 --- a/modules/multiresvolume/multiresvolumemodule.cpp +++ b/modules/multiresvolume/multiresvolumemodule.cpp @@ -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 * diff --git a/modules/multiresvolume/multiresvolumemodule.h b/modules/multiresvolume/multiresvolumemodule.h index 5f12395790..9d0a504c0d 100644 --- a/modules/multiresvolume/multiresvolumemodule.h +++ b/modules/multiresvolume/multiresvolumemodule.h @@ -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 * diff --git a/modules/multiresvolume/rendering/atlasmanager.cpp b/modules/multiresvolume/rendering/atlasmanager.cpp index ad54463c76..761ab98184 100644 --- a/modules/multiresvolume/rendering/atlasmanager.cpp +++ b/modules/multiresvolume/rendering/atlasmanager.cpp @@ -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 * diff --git a/modules/multiresvolume/rendering/atlasmanager.h b/modules/multiresvolume/rendering/atlasmanager.h index 5da58ae0c0..9abf4c55d4 100644 --- a/modules/multiresvolume/rendering/atlasmanager.h +++ b/modules/multiresvolume/rendering/atlasmanager.h @@ -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 * diff --git a/modules/multiresvolume/rendering/brickcover.h b/modules/multiresvolume/rendering/brickcover.h index 463712e169..dee71e7fc4 100644 --- a/modules/multiresvolume/rendering/brickcover.h +++ b/modules/multiresvolume/rendering/brickcover.h @@ -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 * diff --git a/modules/multiresvolume/rendering/brickmanager.cpp b/modules/multiresvolume/rendering/brickmanager.cpp index 7d4d284c07..211da49921 100644 --- a/modules/multiresvolume/rendering/brickmanager.cpp +++ b/modules/multiresvolume/rendering/brickmanager.cpp @@ -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 * diff --git a/modules/multiresvolume/rendering/brickmanager.h b/modules/multiresvolume/rendering/brickmanager.h index e0be43600f..75e010041b 100644 --- a/modules/multiresvolume/rendering/brickmanager.h +++ b/modules/multiresvolume/rendering/brickmanager.h @@ -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 * diff --git a/modules/multiresvolume/rendering/brickselection.h b/modules/multiresvolume/rendering/brickselection.h index 27d899e3ba..7175497b4b 100644 --- a/modules/multiresvolume/rendering/brickselection.h +++ b/modules/multiresvolume/rendering/brickselection.h @@ -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 * diff --git a/modules/multiresvolume/rendering/brickselector.h b/modules/multiresvolume/rendering/brickselector.h index 80e5978060..b9dab1d1fb 100644 --- a/modules/multiresvolume/rendering/brickselector.h +++ b/modules/multiresvolume/rendering/brickselector.h @@ -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 * diff --git a/modules/multiresvolume/rendering/errorhistogrammanager.cpp b/modules/multiresvolume/rendering/errorhistogrammanager.cpp index 9db36064b4..f8a2e02250 100644 --- a/modules/multiresvolume/rendering/errorhistogrammanager.cpp +++ b/modules/multiresvolume/rendering/errorhistogrammanager.cpp @@ -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 * diff --git a/modules/multiresvolume/rendering/errorhistogrammanager.h b/modules/multiresvolume/rendering/errorhistogrammanager.h index 4237335a3a..973c4af441 100644 --- a/modules/multiresvolume/rendering/errorhistogrammanager.h +++ b/modules/multiresvolume/rendering/errorhistogrammanager.h @@ -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 * diff --git a/modules/multiresvolume/rendering/histogrammanager.cpp b/modules/multiresvolume/rendering/histogrammanager.cpp index d0ad52c000..4464a13ce1 100644 --- a/modules/multiresvolume/rendering/histogrammanager.cpp +++ b/modules/multiresvolume/rendering/histogrammanager.cpp @@ -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 * diff --git a/modules/multiresvolume/rendering/histogrammanager.h b/modules/multiresvolume/rendering/histogrammanager.h index fbdafaee11..f14a909101 100644 --- a/modules/multiresvolume/rendering/histogrammanager.h +++ b/modules/multiresvolume/rendering/histogrammanager.h @@ -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 * diff --git a/modules/multiresvolume/rendering/localerrorhistogrammanager.cpp b/modules/multiresvolume/rendering/localerrorhistogrammanager.cpp index 1b3926457b..fac133e991 100644 --- a/modules/multiresvolume/rendering/localerrorhistogrammanager.cpp +++ b/modules/multiresvolume/rendering/localerrorhistogrammanager.cpp @@ -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 * diff --git a/modules/multiresvolume/rendering/localerrorhistogrammanager.h b/modules/multiresvolume/rendering/localerrorhistogrammanager.h index c76b859aea..86f82a30cc 100644 --- a/modules/multiresvolume/rendering/localerrorhistogrammanager.h +++ b/modules/multiresvolume/rendering/localerrorhistogrammanager.h @@ -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 * diff --git a/modules/multiresvolume/rendering/localtfbrickselector.cpp b/modules/multiresvolume/rendering/localtfbrickselector.cpp index dcfa208c41..b74b8212d4 100644 --- a/modules/multiresvolume/rendering/localtfbrickselector.cpp +++ b/modules/multiresvolume/rendering/localtfbrickselector.cpp @@ -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 * diff --git a/modules/multiresvolume/rendering/localtfbrickselector.h b/modules/multiresvolume/rendering/localtfbrickselector.h index 62990e10f9..823cab52c9 100644 --- a/modules/multiresvolume/rendering/localtfbrickselector.h +++ b/modules/multiresvolume/rendering/localtfbrickselector.h @@ -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 * diff --git a/modules/multiresvolume/rendering/multiresvolumeraycaster.cpp b/modules/multiresvolume/rendering/multiresvolumeraycaster.cpp index 332e5d3ce9..0bbfe04258 100644 --- a/modules/multiresvolume/rendering/multiresvolumeraycaster.cpp +++ b/modules/multiresvolume/rendering/multiresvolumeraycaster.cpp @@ -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 * diff --git a/modules/multiresvolume/rendering/multiresvolumeraycaster.h b/modules/multiresvolume/rendering/multiresvolumeraycaster.h index bd8784d00b..2309cacf98 100644 --- a/modules/multiresvolume/rendering/multiresvolumeraycaster.h +++ b/modules/multiresvolume/rendering/multiresvolumeraycaster.h @@ -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 * diff --git a/modules/multiresvolume/rendering/renderablemultiresvolume.cpp b/modules/multiresvolume/rendering/renderablemultiresvolume.cpp index 2da28a3a05..b93b7b7a58 100644 --- a/modules/multiresvolume/rendering/renderablemultiresvolume.cpp +++ b/modules/multiresvolume/rendering/renderablemultiresvolume.cpp @@ -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 * diff --git a/modules/multiresvolume/rendering/renderablemultiresvolume.h b/modules/multiresvolume/rendering/renderablemultiresvolume.h index a24315d8de..c1c8556686 100644 --- a/modules/multiresvolume/rendering/renderablemultiresvolume.h +++ b/modules/multiresvolume/rendering/renderablemultiresvolume.h @@ -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 * diff --git a/modules/multiresvolume/rendering/shenbrickselector.cpp b/modules/multiresvolume/rendering/shenbrickselector.cpp index e0549b4859..89e346aa22 100644 --- a/modules/multiresvolume/rendering/shenbrickselector.cpp +++ b/modules/multiresvolume/rendering/shenbrickselector.cpp @@ -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 * diff --git a/modules/multiresvolume/rendering/shenbrickselector.h b/modules/multiresvolume/rendering/shenbrickselector.h index 3001b94b56..3dfe2b7645 100644 --- a/modules/multiresvolume/rendering/shenbrickselector.h +++ b/modules/multiresvolume/rendering/shenbrickselector.h @@ -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 * diff --git a/modules/multiresvolume/rendering/simpletfbrickselector.cpp b/modules/multiresvolume/rendering/simpletfbrickselector.cpp index c409e23666..63cf1b98e5 100644 --- a/modules/multiresvolume/rendering/simpletfbrickselector.cpp +++ b/modules/multiresvolume/rendering/simpletfbrickselector.cpp @@ -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 * diff --git a/modules/multiresvolume/rendering/simpletfbrickselector.h b/modules/multiresvolume/rendering/simpletfbrickselector.h index 11bbae032d..7b7463a1a4 100644 --- a/modules/multiresvolume/rendering/simpletfbrickselector.h +++ b/modules/multiresvolume/rendering/simpletfbrickselector.h @@ -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 * diff --git a/modules/multiresvolume/rendering/tfbrickselector.cpp b/modules/multiresvolume/rendering/tfbrickselector.cpp index b0d889bb20..3057459047 100644 --- a/modules/multiresvolume/rendering/tfbrickselector.cpp +++ b/modules/multiresvolume/rendering/tfbrickselector.cpp @@ -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 * diff --git a/modules/multiresvolume/rendering/tfbrickselector.h b/modules/multiresvolume/rendering/tfbrickselector.h index e411b453c6..4cc9a16706 100644 --- a/modules/multiresvolume/rendering/tfbrickselector.h +++ b/modules/multiresvolume/rendering/tfbrickselector.h @@ -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 * diff --git a/modules/multiresvolume/rendering/tsp.cpp b/modules/multiresvolume/rendering/tsp.cpp index 74c1cf0400..003c2af590 100644 --- a/modules/multiresvolume/rendering/tsp.cpp +++ b/modules/multiresvolume/rendering/tsp.cpp @@ -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 * diff --git a/modules/multiresvolume/rendering/tsp.h b/modules/multiresvolume/rendering/tsp.h index d182238284..9c7e34cb17 100644 --- a/modules/multiresvolume/rendering/tsp.h +++ b/modules/multiresvolume/rendering/tsp.h @@ -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 * diff --git a/modules/multiresvolume/shaders/boundsFs.glsl b/modules/multiresvolume/shaders/boundsFs.glsl index bb4f9c8cd3..e54fa90dbc 100644 --- a/modules/multiresvolume/shaders/boundsFs.glsl +++ b/modules/multiresvolume/shaders/boundsFs.glsl @@ -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 * diff --git a/modules/newhorizons/newhorizonsmodule.cpp b/modules/newhorizons/newhorizonsmodule.cpp index 59168a207c..79eba633d6 100644 --- a/modules/newhorizons/newhorizonsmodule.cpp +++ b/modules/newhorizons/newhorizonsmodule.cpp @@ -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 * diff --git a/modules/newhorizons/newhorizonsmodule.h b/modules/newhorizons/newhorizonsmodule.h index 8bd39cbce4..5bd6c0e3cb 100644 --- a/modules/newhorizons/newhorizonsmodule.h +++ b/modules/newhorizons/newhorizonsmodule.h @@ -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 * diff --git a/modules/newhorizons/rendering/renderablecrawlingline.cpp b/modules/newhorizons/rendering/renderablecrawlingline.cpp index 7a78fa451c..ebbc4183c1 100644 --- a/modules/newhorizons/rendering/renderablecrawlingline.cpp +++ b/modules/newhorizons/rendering/renderablecrawlingline.cpp @@ -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 * diff --git a/modules/newhorizons/rendering/renderablecrawlingline.h b/modules/newhorizons/rendering/renderablecrawlingline.h index 3b8728914e..06753a995c 100644 --- a/modules/newhorizons/rendering/renderablecrawlingline.h +++ b/modules/newhorizons/rendering/renderablecrawlingline.h @@ -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 * diff --git a/modules/newhorizons/rendering/renderablefov.cpp b/modules/newhorizons/rendering/renderablefov.cpp index f906129321..fe5048d60a 100644 --- a/modules/newhorizons/rendering/renderablefov.cpp +++ b/modules/newhorizons/rendering/renderablefov.cpp @@ -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 * diff --git a/modules/newhorizons/rendering/renderablefov.h b/modules/newhorizons/rendering/renderablefov.h index 58292e39d1..b28ef47cc4 100644 --- a/modules/newhorizons/rendering/renderablefov.h +++ b/modules/newhorizons/rendering/renderablefov.h @@ -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 * diff --git a/modules/newhorizons/rendering/renderablemodelprojection.cpp b/modules/newhorizons/rendering/renderablemodelprojection.cpp index 29b5b5a05e..2773f9942f 100644 --- a/modules/newhorizons/rendering/renderablemodelprojection.cpp +++ b/modules/newhorizons/rendering/renderablemodelprojection.cpp @@ -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 * diff --git a/modules/newhorizons/rendering/renderablemodelprojection.h b/modules/newhorizons/rendering/renderablemodelprojection.h index 4beaa8a52e..59211b9024 100644 --- a/modules/newhorizons/rendering/renderablemodelprojection.h +++ b/modules/newhorizons/rendering/renderablemodelprojection.h @@ -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 * diff --git a/modules/newhorizons/rendering/renderableplaneprojection.h b/modules/newhorizons/rendering/renderableplaneprojection.h index b38298833a..72a5413e5b 100644 --- a/modules/newhorizons/rendering/renderableplaneprojection.h +++ b/modules/newhorizons/rendering/renderableplaneprojection.h @@ -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 * diff --git a/modules/newhorizons/rendering/renderableplanetprojection.cpp b/modules/newhorizons/rendering/renderableplanetprojection.cpp index 3902c44978..857d7d8197 100644 --- a/modules/newhorizons/rendering/renderableplanetprojection.cpp +++ b/modules/newhorizons/rendering/renderableplanetprojection.cpp @@ -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 * diff --git a/modules/newhorizons/rendering/renderableplanetprojection.h b/modules/newhorizons/rendering/renderableplanetprojection.h index 5cc7c6d425..c44b5a9de0 100644 --- a/modules/newhorizons/rendering/renderableplanetprojection.h +++ b/modules/newhorizons/rendering/renderableplanetprojection.h @@ -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 * diff --git a/modules/newhorizons/rendering/renderableshadowcylinder.cpp b/modules/newhorizons/rendering/renderableshadowcylinder.cpp index 2c1d588011..2350cb5e5f 100644 --- a/modules/newhorizons/rendering/renderableshadowcylinder.cpp +++ b/modules/newhorizons/rendering/renderableshadowcylinder.cpp @@ -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 * diff --git a/modules/newhorizons/rendering/renderableshadowcylinder.h b/modules/newhorizons/rendering/renderableshadowcylinder.h index 8d33d95168..9e214a3581 100644 --- a/modules/newhorizons/rendering/renderableshadowcylinder.h +++ b/modules/newhorizons/rendering/renderableshadowcylinder.h @@ -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 * diff --git a/modules/newhorizons/rendering/writeToTexture.h b/modules/newhorizons/rendering/writeToTexture.h index cd0e584f60..b7b1004432 100644 --- a/modules/newhorizons/rendering/writeToTexture.h +++ b/modules/newhorizons/rendering/writeToTexture.h @@ -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 * diff --git a/modules/newhorizons/shaders/crawlingline_fs.glsl b/modules/newhorizons/shaders/crawlingline_fs.glsl index a01baaf749..9f0eb3b8ad 100644 --- a/modules/newhorizons/shaders/crawlingline_fs.glsl +++ b/modules/newhorizons/shaders/crawlingline_fs.glsl @@ -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 * diff --git a/modules/newhorizons/shaders/crawlingline_vs.glsl b/modules/newhorizons/shaders/crawlingline_vs.glsl index d5e5b1b681..8145739af4 100644 --- a/modules/newhorizons/shaders/crawlingline_vs.glsl +++ b/modules/newhorizons/shaders/crawlingline_vs.glsl @@ -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 * diff --git a/modules/newhorizons/shaders/dilation_fs.glsl b/modules/newhorizons/shaders/dilation_fs.glsl index d5a740d681..f81ca0518f 100644 --- a/modules/newhorizons/shaders/dilation_fs.glsl +++ b/modules/newhorizons/shaders/dilation_fs.glsl @@ -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 * diff --git a/modules/newhorizons/shaders/dilation_vs.glsl b/modules/newhorizons/shaders/dilation_vs.glsl index 2efb3027e4..71ecd298d7 100644 --- a/modules/newhorizons/shaders/dilation_vs.glsl +++ b/modules/newhorizons/shaders/dilation_vs.glsl @@ -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 * diff --git a/modules/newhorizons/shaders/fov_fs.glsl b/modules/newhorizons/shaders/fov_fs.glsl index fcd3bd2c65..0b29147ea5 100644 --- a/modules/newhorizons/shaders/fov_fs.glsl +++ b/modules/newhorizons/shaders/fov_fs.glsl @@ -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 * diff --git a/modules/newhorizons/shaders/fov_vs.glsl b/modules/newhorizons/shaders/fov_vs.glsl index 757b7dc336..be0a93f3a5 100644 --- a/modules/newhorizons/shaders/fov_vs.glsl +++ b/modules/newhorizons/shaders/fov_vs.glsl @@ -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 * diff --git a/modules/newhorizons/shaders/renderableModelDepth_fs.glsl b/modules/newhorizons/shaders/renderableModelDepth_fs.glsl index 2b7bcfdaec..d1fe2340d8 100644 --- a/modules/newhorizons/shaders/renderableModelDepth_fs.glsl +++ b/modules/newhorizons/shaders/renderableModelDepth_fs.glsl @@ -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 * diff --git a/modules/newhorizons/shaders/renderableModelProjection_fs.glsl b/modules/newhorizons/shaders/renderableModelProjection_fs.glsl index 7c69bc65bf..22313e8869 100644 --- a/modules/newhorizons/shaders/renderableModelProjection_fs.glsl +++ b/modules/newhorizons/shaders/renderableModelProjection_fs.glsl @@ -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 * diff --git a/modules/newhorizons/shaders/renderableModelProjection_vs.glsl b/modules/newhorizons/shaders/renderableModelProjection_vs.glsl index 2be32b0119..96e8832484 100644 --- a/modules/newhorizons/shaders/renderableModelProjection_vs.glsl +++ b/modules/newhorizons/shaders/renderableModelProjection_vs.glsl @@ -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 * diff --git a/modules/newhorizons/shaders/renderableModel_fs.glsl b/modules/newhorizons/shaders/renderableModel_fs.glsl index efe16cf13c..2b9f770cc0 100644 --- a/modules/newhorizons/shaders/renderableModel_fs.glsl +++ b/modules/newhorizons/shaders/renderableModel_fs.glsl @@ -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 * diff --git a/modules/newhorizons/shaders/renderablePlanet_fs.glsl b/modules/newhorizons/shaders/renderablePlanet_fs.glsl index c2a2b841ad..85eb2e1d8e 100644 --- a/modules/newhorizons/shaders/renderablePlanet_fs.glsl +++ b/modules/newhorizons/shaders/renderablePlanet_fs.glsl @@ -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 * diff --git a/modules/newhorizons/shaders/renderablePlanet_vs.glsl b/modules/newhorizons/shaders/renderablePlanet_vs.glsl index a4670af960..22e8c00bfb 100644 --- a/modules/newhorizons/shaders/renderablePlanet_vs.glsl +++ b/modules/newhorizons/shaders/renderablePlanet_vs.glsl @@ -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 * diff --git a/modules/newhorizons/shaders/terminatorshadow_fs.glsl b/modules/newhorizons/shaders/terminatorshadow_fs.glsl index 82af216b65..4160925e9f 100644 --- a/modules/newhorizons/shaders/terminatorshadow_fs.glsl +++ b/modules/newhorizons/shaders/terminatorshadow_fs.glsl @@ -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 * diff --git a/modules/newhorizons/shaders/terminatorshadow_vs.glsl b/modules/newhorizons/shaders/terminatorshadow_vs.glsl index 5b1c864925..8a215f8063 100644 --- a/modules/newhorizons/shaders/terminatorshadow_vs.glsl +++ b/modules/newhorizons/shaders/terminatorshadow_vs.glsl @@ -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 * diff --git a/modules/newhorizons/util/decoder.cpp b/modules/newhorizons/util/decoder.cpp index 76874d7e79..58c23dc138 100644 --- a/modules/newhorizons/util/decoder.cpp +++ b/modules/newhorizons/util/decoder.cpp @@ -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 * diff --git a/modules/newhorizons/util/decoder.h b/modules/newhorizons/util/decoder.h index dc112edbec..e7290112fa 100644 --- a/modules/newhorizons/util/decoder.h +++ b/modules/newhorizons/util/decoder.h @@ -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 * diff --git a/modules/newhorizons/util/hongkangparser.cpp b/modules/newhorizons/util/hongkangparser.cpp index 1d0f6fdd83..c09bf2a594 100644 --- a/modules/newhorizons/util/hongkangparser.cpp +++ b/modules/newhorizons/util/hongkangparser.cpp @@ -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 * diff --git a/modules/newhorizons/util/hongkangparser.h b/modules/newhorizons/util/hongkangparser.h index d8ba56ba30..8eb5169670 100644 --- a/modules/newhorizons/util/hongkangparser.h +++ b/modules/newhorizons/util/hongkangparser.h @@ -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 * diff --git a/modules/newhorizons/util/imagesequencer.cpp b/modules/newhorizons/util/imagesequencer.cpp index 641d171fe5..bf0b21dd0b 100644 --- a/modules/newhorizons/util/imagesequencer.cpp +++ b/modules/newhorizons/util/imagesequencer.cpp @@ -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 * diff --git a/modules/newhorizons/util/imagesequencer.h b/modules/newhorizons/util/imagesequencer.h index 3b4c85a28a..3f776c68ad 100644 --- a/modules/newhorizons/util/imagesequencer.h +++ b/modules/newhorizons/util/imagesequencer.h @@ -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 * diff --git a/modules/newhorizons/util/instrumentdecoder.cpp b/modules/newhorizons/util/instrumentdecoder.cpp index 3f6b168c09..33372a28fe 100644 --- a/modules/newhorizons/util/instrumentdecoder.cpp +++ b/modules/newhorizons/util/instrumentdecoder.cpp @@ -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 * diff --git a/modules/newhorizons/util/instrumentdecoder.h b/modules/newhorizons/util/instrumentdecoder.h index a8c871bd60..14b3689706 100644 --- a/modules/newhorizons/util/instrumentdecoder.h +++ b/modules/newhorizons/util/instrumentdecoder.h @@ -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 * diff --git a/modules/newhorizons/util/instrumenttimesparser.cpp b/modules/newhorizons/util/instrumenttimesparser.cpp index f36fe308e5..fd1d3e3a90 100644 --- a/modules/newhorizons/util/instrumenttimesparser.cpp +++ b/modules/newhorizons/util/instrumenttimesparser.cpp @@ -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 * diff --git a/modules/newhorizons/util/instrumenttimesparser.h b/modules/newhorizons/util/instrumenttimesparser.h index 30f3ab2372..23a08b3f35 100644 --- a/modules/newhorizons/util/instrumenttimesparser.h +++ b/modules/newhorizons/util/instrumenttimesparser.h @@ -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 * diff --git a/modules/newhorizons/util/labelparser.cpp b/modules/newhorizons/util/labelparser.cpp index aee435c75c..8607848158 100644 --- a/modules/newhorizons/util/labelparser.cpp +++ b/modules/newhorizons/util/labelparser.cpp @@ -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 * diff --git a/modules/newhorizons/util/labelparser.h b/modules/newhorizons/util/labelparser.h index 6d914dce77..69c6ceaa4b 100644 --- a/modules/newhorizons/util/labelparser.h +++ b/modules/newhorizons/util/labelparser.h @@ -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 * diff --git a/modules/newhorizons/util/projectioncomponent.cpp b/modules/newhorizons/util/projectioncomponent.cpp index bb4a7b8d64..6ed193e351 100644 --- a/modules/newhorizons/util/projectioncomponent.cpp +++ b/modules/newhorizons/util/projectioncomponent.cpp @@ -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 * diff --git a/modules/newhorizons/util/projectioncomponent.h b/modules/newhorizons/util/projectioncomponent.h index 6d82b6d0c2..c9404a36ba 100644 --- a/modules/newhorizons/util/projectioncomponent.h +++ b/modules/newhorizons/util/projectioncomponent.h @@ -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 * diff --git a/modules/newhorizons/util/scannerdecoder.cpp b/modules/newhorizons/util/scannerdecoder.cpp index c1aaa49c80..cd87074f83 100644 --- a/modules/newhorizons/util/scannerdecoder.cpp +++ b/modules/newhorizons/util/scannerdecoder.cpp @@ -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 * diff --git a/modules/newhorizons/util/scannerdecoder.h b/modules/newhorizons/util/scannerdecoder.h index bd593ff691..b0453e2def 100644 --- a/modules/newhorizons/util/scannerdecoder.h +++ b/modules/newhorizons/util/scannerdecoder.h @@ -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 * diff --git a/modules/newhorizons/util/sequenceparser.cpp b/modules/newhorizons/util/sequenceparser.cpp index 65d05b64d8..d147fed0fe 100644 --- a/modules/newhorizons/util/sequenceparser.cpp +++ b/modules/newhorizons/util/sequenceparser.cpp @@ -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 * diff --git a/modules/newhorizons/util/sequenceparser.h b/modules/newhorizons/util/sequenceparser.h index fb42910e98..0ecd106149 100644 --- a/modules/newhorizons/util/sequenceparser.h +++ b/modules/newhorizons/util/sequenceparser.h @@ -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 * diff --git a/modules/newhorizons/util/targetdecoder.cpp b/modules/newhorizons/util/targetdecoder.cpp index 4bc27c8eff..a9870dd160 100644 --- a/modules/newhorizons/util/targetdecoder.cpp +++ b/modules/newhorizons/util/targetdecoder.cpp @@ -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 * diff --git a/modules/newhorizons/util/targetdecoder.h b/modules/newhorizons/util/targetdecoder.h index 04d65f3a56..6a3807b6e0 100644 --- a/modules/newhorizons/util/targetdecoder.h +++ b/modules/newhorizons/util/targetdecoder.h @@ -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 * diff --git a/modules/onscreengui/include/gui.h b/modules/onscreengui/include/gui.h index dcbffff069..6e8e688aa1 100644 --- a/modules/onscreengui/include/gui.h +++ b/modules/onscreengui/include/gui.h @@ -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 * diff --git a/modules/onscreengui/include/guicomponent.h b/modules/onscreengui/include/guicomponent.h index 7aed19c3d6..98896a4e56 100644 --- a/modules/onscreengui/include/guicomponent.h +++ b/modules/onscreengui/include/guicomponent.h @@ -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 * diff --git a/modules/onscreengui/include/guihelpcomponent.h b/modules/onscreengui/include/guihelpcomponent.h index 3f046405e6..2b55ccf0b3 100644 --- a/modules/onscreengui/include/guihelpcomponent.h +++ b/modules/onscreengui/include/guihelpcomponent.h @@ -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 * diff --git a/modules/onscreengui/include/guiiswacomponent.h b/modules/onscreengui/include/guiiswacomponent.h index 6f27fbf6de..379f33fda1 100644 --- a/modules/onscreengui/include/guiiswacomponent.h +++ b/modules/onscreengui/include/guiiswacomponent.h @@ -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 * diff --git a/modules/onscreengui/include/guiorigincomponent.h b/modules/onscreengui/include/guiorigincomponent.h index 79ec27f278..c97ffc4985 100644 --- a/modules/onscreengui/include/guiorigincomponent.h +++ b/modules/onscreengui/include/guiorigincomponent.h @@ -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 * diff --git a/modules/onscreengui/include/guiperformancecomponent.h b/modules/onscreengui/include/guiperformancecomponent.h index 241613c614..f81a072639 100644 --- a/modules/onscreengui/include/guiperformancecomponent.h +++ b/modules/onscreengui/include/guiperformancecomponent.h @@ -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 * diff --git a/modules/onscreengui/include/guipropertycomponent.h b/modules/onscreengui/include/guipropertycomponent.h index a97fe0e154..4fc0bb83ea 100644 --- a/modules/onscreengui/include/guipropertycomponent.h +++ b/modules/onscreengui/include/guipropertycomponent.h @@ -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 * diff --git a/modules/onscreengui/include/guitimecomponent.h b/modules/onscreengui/include/guitimecomponent.h index 4598eee0d1..a363bb390e 100644 --- a/modules/onscreengui/include/guitimecomponent.h +++ b/modules/onscreengui/include/guitimecomponent.h @@ -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 * diff --git a/modules/onscreengui/include/renderproperties.h b/modules/onscreengui/include/renderproperties.h index acbf461a8f..c1ecb539f8 100644 --- a/modules/onscreengui/include/renderproperties.h +++ b/modules/onscreengui/include/renderproperties.h @@ -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 * diff --git a/modules/onscreengui/onscreenguimodule.cpp b/modules/onscreengui/onscreenguimodule.cpp index 118beeb259..88636efe39 100644 --- a/modules/onscreengui/onscreenguimodule.cpp +++ b/modules/onscreengui/onscreenguimodule.cpp @@ -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 * diff --git a/modules/onscreengui/onscreenguimodule.h b/modules/onscreengui/onscreenguimodule.h index ca6c59c18e..80d7e76753 100644 --- a/modules/onscreengui/onscreenguimodule.h +++ b/modules/onscreengui/onscreenguimodule.h @@ -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 * diff --git a/modules/onscreengui/shaders/gui_fs.glsl b/modules/onscreengui/shaders/gui_fs.glsl index 6201873727..0a53791213 100644 --- a/modules/onscreengui/shaders/gui_fs.glsl +++ b/modules/onscreengui/shaders/gui_fs.glsl @@ -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 * diff --git a/modules/onscreengui/shaders/gui_vs.glsl b/modules/onscreengui/shaders/gui_vs.glsl index 1b3b67d860..ac38f75c29 100644 --- a/modules/onscreengui/shaders/gui_vs.glsl +++ b/modules/onscreengui/shaders/gui_vs.glsl @@ -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 * diff --git a/modules/onscreengui/src/gui.cpp b/modules/onscreengui/src/gui.cpp index d0802a4a9d..874b457f46 100644 --- a/modules/onscreengui/src/gui.cpp +++ b/modules/onscreengui/src/gui.cpp @@ -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 * diff --git a/modules/onscreengui/src/gui_lua.inl b/modules/onscreengui/src/gui_lua.inl index 49d4e02fc6..0c20aa07bd 100644 --- a/modules/onscreengui/src/gui_lua.inl +++ b/modules/onscreengui/src/gui_lua.inl @@ -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 * diff --git a/modules/onscreengui/src/guicomponent.cpp b/modules/onscreengui/src/guicomponent.cpp index 27373aadf7..806755440d 100644 --- a/modules/onscreengui/src/guicomponent.cpp +++ b/modules/onscreengui/src/guicomponent.cpp @@ -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 * diff --git a/modules/onscreengui/src/guihelpcomponent.cpp b/modules/onscreengui/src/guihelpcomponent.cpp index f7a7bf7aad..9fb1e86bda 100644 --- a/modules/onscreengui/src/guihelpcomponent.cpp +++ b/modules/onscreengui/src/guihelpcomponent.cpp @@ -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 * diff --git a/modules/onscreengui/src/guiiswacomponent.cpp b/modules/onscreengui/src/guiiswacomponent.cpp index 61d5b4548d..f21ab65189 100644 --- a/modules/onscreengui/src/guiiswacomponent.cpp +++ b/modules/onscreengui/src/guiiswacomponent.cpp @@ -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 * diff --git a/modules/onscreengui/src/guiorigincomponent.cpp b/modules/onscreengui/src/guiorigincomponent.cpp index 1e6efdd7aa..f22588dbf2 100644 --- a/modules/onscreengui/src/guiorigincomponent.cpp +++ b/modules/onscreengui/src/guiorigincomponent.cpp @@ -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 * diff --git a/modules/onscreengui/src/guiperformancecomponent.cpp b/modules/onscreengui/src/guiperformancecomponent.cpp index d11430f056..864c76c65e 100644 --- a/modules/onscreengui/src/guiperformancecomponent.cpp +++ b/modules/onscreengui/src/guiperformancecomponent.cpp @@ -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 * diff --git a/modules/onscreengui/src/guipropertycomponent.cpp b/modules/onscreengui/src/guipropertycomponent.cpp index edf2a1ed87..1730c48f55 100644 --- a/modules/onscreengui/src/guipropertycomponent.cpp +++ b/modules/onscreengui/src/guipropertycomponent.cpp @@ -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 * diff --git a/modules/onscreengui/src/guitimecomponent.cpp b/modules/onscreengui/src/guitimecomponent.cpp index 43178a2270..29ad93e8ce 100644 --- a/modules/onscreengui/src/guitimecomponent.cpp +++ b/modules/onscreengui/src/guitimecomponent.cpp @@ -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 * diff --git a/modules/onscreengui/src/renderproperties.cpp b/modules/onscreengui/src/renderproperties.cpp index 21489500ae..5a8b4dab1b 100644 --- a/modules/onscreengui/src/renderproperties.cpp +++ b/modules/onscreengui/src/renderproperties.cpp @@ -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 * diff --git a/modules/space/rendering/planetgeometry.cpp b/modules/space/rendering/planetgeometry.cpp index 8d437fb539..aaf30ac1fe 100644 --- a/modules/space/rendering/planetgeometry.cpp +++ b/modules/space/rendering/planetgeometry.cpp @@ -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 * diff --git a/modules/space/rendering/planetgeometry.h b/modules/space/rendering/planetgeometry.h index d1690a4924..1bb73add6c 100644 --- a/modules/space/rendering/planetgeometry.h +++ b/modules/space/rendering/planetgeometry.h @@ -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 * diff --git a/modules/space/rendering/renderableconstellationbounds.cpp b/modules/space/rendering/renderableconstellationbounds.cpp index 49e7f01968..7e6ada817e 100644 --- a/modules/space/rendering/renderableconstellationbounds.cpp +++ b/modules/space/rendering/renderableconstellationbounds.cpp @@ -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 * diff --git a/modules/space/rendering/renderableconstellationbounds.h b/modules/space/rendering/renderableconstellationbounds.h index 68a1014513..d000c0c3d5 100644 --- a/modules/space/rendering/renderableconstellationbounds.h +++ b/modules/space/rendering/renderableconstellationbounds.h @@ -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 * diff --git a/modules/space/rendering/renderableplanet.cpp b/modules/space/rendering/renderableplanet.cpp index f113d78f72..2b860fb361 100644 --- a/modules/space/rendering/renderableplanet.cpp +++ b/modules/space/rendering/renderableplanet.cpp @@ -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 * diff --git a/modules/space/rendering/renderableplanet.h b/modules/space/rendering/renderableplanet.h index 4c324cda3c..7a83462834 100644 --- a/modules/space/rendering/renderableplanet.h +++ b/modules/space/rendering/renderableplanet.h @@ -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 * diff --git a/modules/space/rendering/renderablerings.cpp b/modules/space/rendering/renderablerings.cpp index 75c3f8c08a..eca4b60018 100644 --- a/modules/space/rendering/renderablerings.cpp +++ b/modules/space/rendering/renderablerings.cpp @@ -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 * diff --git a/modules/space/rendering/renderablerings.h b/modules/space/rendering/renderablerings.h index 2df2c64a21..6e17d5abc1 100644 --- a/modules/space/rendering/renderablerings.h +++ b/modules/space/rendering/renderablerings.h @@ -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 * diff --git a/modules/space/rendering/renderablestars.cpp b/modules/space/rendering/renderablestars.cpp index 108bb4639b..3c68df329c 100644 --- a/modules/space/rendering/renderablestars.cpp +++ b/modules/space/rendering/renderablestars.cpp @@ -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 * diff --git a/modules/space/rendering/renderablestars.h b/modules/space/rendering/renderablestars.h index 69e24517b3..bd8b7d3f80 100644 --- a/modules/space/rendering/renderablestars.h +++ b/modules/space/rendering/renderablestars.h @@ -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 * diff --git a/modules/space/rendering/simplespheregeometry.cpp b/modules/space/rendering/simplespheregeometry.cpp index 468bc6403f..03d5aefbb8 100644 --- a/modules/space/rendering/simplespheregeometry.cpp +++ b/modules/space/rendering/simplespheregeometry.cpp @@ -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 * diff --git a/modules/space/rendering/simplespheregeometry.h b/modules/space/rendering/simplespheregeometry.h index c9b38220f2..35740746df 100644 --- a/modules/space/rendering/simplespheregeometry.h +++ b/modules/space/rendering/simplespheregeometry.h @@ -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 * diff --git a/modules/space/rotation/spicerotation.cpp b/modules/space/rotation/spicerotation.cpp index d6efccae16..0e38feadbc 100644 --- a/modules/space/rotation/spicerotation.cpp +++ b/modules/space/rotation/spicerotation.cpp @@ -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 * diff --git a/modules/space/rotation/spicerotation.h b/modules/space/rotation/spicerotation.h index 94a1ec0101..a8d91e5b3c 100644 --- a/modules/space/rotation/spicerotation.h +++ b/modules/space/rotation/spicerotation.h @@ -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 * diff --git a/modules/space/shaders/constellationbounds_fs.glsl b/modules/space/shaders/constellationbounds_fs.glsl index b970189e84..2c7421248f 100644 --- a/modules/space/shaders/constellationbounds_fs.glsl +++ b/modules/space/shaders/constellationbounds_fs.glsl @@ -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 * diff --git a/modules/space/shaders/constellationbounds_vs.glsl b/modules/space/shaders/constellationbounds_vs.glsl index 7c05a3c178..bfd6d12b0f 100644 --- a/modules/space/shaders/constellationbounds_vs.glsl +++ b/modules/space/shaders/constellationbounds_vs.glsl @@ -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 * diff --git a/modules/space/shaders/rings_fs.glsl b/modules/space/shaders/rings_fs.glsl index 6de4b8503f..84c363be0c 100644 --- a/modules/space/shaders/rings_fs.glsl +++ b/modules/space/shaders/rings_fs.glsl @@ -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 * diff --git a/modules/space/shaders/rings_vs.glsl b/modules/space/shaders/rings_vs.glsl index 86ecefef8e..97c65e94c3 100644 --- a/modules/space/shaders/rings_vs.glsl +++ b/modules/space/shaders/rings_vs.glsl @@ -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 * diff --git a/modules/space/shaders/star_fs.glsl b/modules/space/shaders/star_fs.glsl index 39cdcd0bc9..e81cb9e89b 100644 --- a/modules/space/shaders/star_fs.glsl +++ b/modules/space/shaders/star_fs.glsl @@ -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 * diff --git a/modules/space/shaders/star_ge.glsl b/modules/space/shaders/star_ge.glsl index 0315797b0a..4cd6b5ea5b 100644 --- a/modules/space/shaders/star_ge.glsl +++ b/modules/space/shaders/star_ge.glsl @@ -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 * diff --git a/modules/space/shaders/star_vs.glsl b/modules/space/shaders/star_vs.glsl index c0ff07a8a9..4186923954 100644 --- a/modules/space/shaders/star_vs.glsl +++ b/modules/space/shaders/star_vs.glsl @@ -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 * diff --git a/modules/space/spacemodule.cpp b/modules/space/spacemodule.cpp index 48cb89e9ff..968be76861 100644 --- a/modules/space/spacemodule.cpp +++ b/modules/space/spacemodule.cpp @@ -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 * diff --git a/modules/space/spacemodule.h b/modules/space/spacemodule.h index 02bb96f1c1..4ed6a2e951 100644 --- a/modules/space/spacemodule.h +++ b/modules/space/spacemodule.h @@ -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 * diff --git a/modules/space/translation/keplertranslation.cpp b/modules/space/translation/keplertranslation.cpp index eb184ee198..fd2d09af86 100644 --- a/modules/space/translation/keplertranslation.cpp +++ b/modules/space/translation/keplertranslation.cpp @@ -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 * diff --git a/modules/space/translation/keplertranslation.h b/modules/space/translation/keplertranslation.h index 8e74394fa0..a4d1cdf631 100644 --- a/modules/space/translation/keplertranslation.h +++ b/modules/space/translation/keplertranslation.h @@ -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 * diff --git a/modules/space/translation/spicetranslation.cpp b/modules/space/translation/spicetranslation.cpp index 7d1d9e451e..34a1f4e289 100644 --- a/modules/space/translation/spicetranslation.cpp +++ b/modules/space/translation/spicetranslation.cpp @@ -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 * diff --git a/modules/space/translation/spicetranslation.h b/modules/space/translation/spicetranslation.h index d815a4613f..87a261021d 100644 --- a/modules/space/translation/spicetranslation.h +++ b/modules/space/translation/spicetranslation.h @@ -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 * diff --git a/modules/space/translation/tletranslation.cpp b/modules/space/translation/tletranslation.cpp index c61d7519ac..5b3c16633b 100644 --- a/modules/space/translation/tletranslation.cpp +++ b/modules/space/translation/tletranslation.cpp @@ -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 * diff --git a/modules/space/translation/tletranslation.h b/modules/space/translation/tletranslation.h index ba8a5cb023..cdf6d6c7a4 100644 --- a/modules/space/translation/tletranslation.h +++ b/modules/space/translation/tletranslation.h @@ -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 * diff --git a/modules/toyvolume/rendering/renderabletoyvolume.cpp b/modules/toyvolume/rendering/renderabletoyvolume.cpp index 45e23a47af..1c26973574 100644 --- a/modules/toyvolume/rendering/renderabletoyvolume.cpp +++ b/modules/toyvolume/rendering/renderabletoyvolume.cpp @@ -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 * diff --git a/modules/toyvolume/rendering/renderabletoyvolume.h b/modules/toyvolume/rendering/renderabletoyvolume.h index 68f39da10a..b5e1390ffc 100644 --- a/modules/toyvolume/rendering/renderabletoyvolume.h +++ b/modules/toyvolume/rendering/renderabletoyvolume.h @@ -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 * diff --git a/modules/toyvolume/rendering/toyvolumeraycaster.cpp b/modules/toyvolume/rendering/toyvolumeraycaster.cpp index 66944a1fbe..fb8fa8d88c 100644 --- a/modules/toyvolume/rendering/toyvolumeraycaster.cpp +++ b/modules/toyvolume/rendering/toyvolumeraycaster.cpp @@ -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 * diff --git a/modules/toyvolume/rendering/toyvolumeraycaster.h b/modules/toyvolume/rendering/toyvolumeraycaster.h index b6159b0baf..9a8848ad55 100644 --- a/modules/toyvolume/rendering/toyvolumeraycaster.h +++ b/modules/toyvolume/rendering/toyvolumeraycaster.h @@ -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 * diff --git a/modules/toyvolume/shaders/boundsfs.glsl b/modules/toyvolume/shaders/boundsfs.glsl index bb4f9c8cd3..e54fa90dbc 100644 --- a/modules/toyvolume/shaders/boundsfs.glsl +++ b/modules/toyvolume/shaders/boundsfs.glsl @@ -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 * diff --git a/modules/toyvolume/toyvolumemodule.cpp b/modules/toyvolume/toyvolumemodule.cpp index f700830085..a5b62d5183 100644 --- a/modules/toyvolume/toyvolumemodule.cpp +++ b/modules/toyvolume/toyvolumemodule.cpp @@ -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 * diff --git a/modules/toyvolume/toyvolumemodule.h b/modules/toyvolume/toyvolumemodule.h index f4fb27661e..458ad42aeb 100644 --- a/modules/toyvolume/toyvolumemodule.h +++ b/modules/toyvolume/toyvolumemodule.h @@ -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 * diff --git a/modules/volume/linearlrucache.h b/modules/volume/linearlrucache.h index b3f7e4083b..8ec6d40f67 100644 --- a/modules/volume/linearlrucache.h +++ b/modules/volume/linearlrucache.h @@ -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 * diff --git a/modules/volume/lrucache.h b/modules/volume/lrucache.h index 94d5a0deed..0a4578048c 100644 --- a/modules/volume/lrucache.h +++ b/modules/volume/lrucache.h @@ -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 * diff --git a/modules/volume/rawvolume.h b/modules/volume/rawvolume.h index 7cce0ae066..065ff16faa 100644 --- a/modules/volume/rawvolume.h +++ b/modules/volume/rawvolume.h @@ -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 * diff --git a/modules/volume/rawvolume.inl b/modules/volume/rawvolume.inl index ba913e84bb..66cfb70b37 100644 --- a/modules/volume/rawvolume.inl +++ b/modules/volume/rawvolume.inl @@ -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 * diff --git a/modules/volume/rawvolumereader.h b/modules/volume/rawvolumereader.h index 75ecb0b694..8e915477e4 100644 --- a/modules/volume/rawvolumereader.h +++ b/modules/volume/rawvolumereader.h @@ -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 * diff --git a/modules/volume/rawvolumereader.inl b/modules/volume/rawvolumereader.inl index 135a046c8a..601968ee95 100644 --- a/modules/volume/rawvolumereader.inl +++ b/modules/volume/rawvolumereader.inl @@ -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 * diff --git a/modules/volume/rawvolumewriter.h b/modules/volume/rawvolumewriter.h index a173f53d9b..39988edcbb 100644 --- a/modules/volume/rawvolumewriter.h +++ b/modules/volume/rawvolumewriter.h @@ -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 * diff --git a/modules/volume/rawvolumewriter.inl b/modules/volume/rawvolumewriter.inl index 1e1fc8294d..b45ff93dcc 100644 --- a/modules/volume/rawvolumewriter.inl +++ b/modules/volume/rawvolumewriter.inl @@ -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 * diff --git a/modules/volume/textureslicevolumereader.h b/modules/volume/textureslicevolumereader.h index c8a96a1e6d..ebcb5f7a43 100644 --- a/modules/volume/textureslicevolumereader.h +++ b/modules/volume/textureslicevolumereader.h @@ -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 * diff --git a/modules/volume/textureslicevolumereader.inl b/modules/volume/textureslicevolumereader.inl index 9c859905cf..a7d2b09100 100644 --- a/modules/volume/textureslicevolumereader.inl +++ b/modules/volume/textureslicevolumereader.inl @@ -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 * diff --git a/modules/volume/volumemodule.cpp b/modules/volume/volumemodule.cpp index 10098fe698..5513daff5a 100644 --- a/modules/volume/volumemodule.cpp +++ b/modules/volume/volumemodule.cpp @@ -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 * diff --git a/modules/volume/volumemodule.h b/modules/volume/volumemodule.h index f21de012d3..31df179c3c 100644 --- a/modules/volume/volumemodule.h +++ b/modules/volume/volumemodule.h @@ -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 * diff --git a/modules/volume/volumesampler.h b/modules/volume/volumesampler.h index cc6bff50d5..f855e84572 100644 --- a/modules/volume/volumesampler.h +++ b/modules/volume/volumesampler.h @@ -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 * diff --git a/modules/volume/volumesampler.inl b/modules/volume/volumesampler.inl index a214dbd82b..82583189fb 100644 --- a/modules/volume/volumesampler.inl +++ b/modules/volume/volumesampler.inl @@ -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 * diff --git a/modules/volume/volumeutils.cpp b/modules/volume/volumeutils.cpp index ab9ef9c500..a8f19fc70e 100644 --- a/modules/volume/volumeutils.cpp +++ b/modules/volume/volumeutils.cpp @@ -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 * diff --git a/modules/volume/volumeutils.h b/modules/volume/volumeutils.h index 6d7b3fce26..9999f7f48d 100644 --- a/modules/volume/volumeutils.h +++ b/modules/volume/volumeutils.h @@ -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 * diff --git a/shaders/framebuffer/exitframebuffer.frag b/shaders/framebuffer/exitframebuffer.frag index e65beb9460..19b44c39b6 100644 --- a/shaders/framebuffer/exitframebuffer.frag +++ b/shaders/framebuffer/exitframebuffer.frag @@ -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 * diff --git a/shaders/framebuffer/renderframebuffer.frag b/shaders/framebuffer/renderframebuffer.frag index 98905b9952..2faeda1b26 100644 --- a/shaders/framebuffer/renderframebuffer.frag +++ b/shaders/framebuffer/renderframebuffer.frag @@ -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 * diff --git a/src/documentation/core_registration.cpp b/src/documentation/core_registration.cpp index 946a87e494..a3087dcda5 100644 --- a/src/documentation/core_registration.cpp +++ b/src/documentation/core_registration.cpp @@ -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 * diff --git a/src/documentation/documentation.cpp b/src/documentation/documentation.cpp index a866edd869..18e644dd65 100644 --- a/src/documentation/documentation.cpp +++ b/src/documentation/documentation.cpp @@ -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 * diff --git a/src/documentation/documentationengine.cpp b/src/documentation/documentationengine.cpp index 0181f0178d..5ce0311aea 100644 --- a/src/documentation/documentationengine.cpp +++ b/src/documentation/documentationengine.cpp @@ -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 * diff --git a/src/documentation/verifier.cpp b/src/documentation/verifier.cpp index 28b83f13d1..6103db744f 100644 --- a/src/documentation/verifier.cpp +++ b/src/documentation/verifier.cpp @@ -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 * diff --git a/src/engine/configurationmanager.cpp b/src/engine/configurationmanager.cpp index 8463283a9a..ccd98c0a69 100644 --- a/src/engine/configurationmanager.cpp +++ b/src/engine/configurationmanager.cpp @@ -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 * diff --git a/src/engine/configurationmanager_doc.inl b/src/engine/configurationmanager_doc.inl index 28c2980a6e..86943102a3 100644 --- a/src/engine/configurationmanager_doc.inl +++ b/src/engine/configurationmanager_doc.inl @@ -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 * diff --git a/src/engine/downloadmanager.cpp b/src/engine/downloadmanager.cpp index 8f56ba23d0..d594dcd494 100644 --- a/src/engine/downloadmanager.cpp +++ b/src/engine/downloadmanager.cpp @@ -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 * diff --git a/src/engine/logfactory.cpp b/src/engine/logfactory.cpp index 7cf10928ee..02268dd6fe 100644 --- a/src/engine/logfactory.cpp +++ b/src/engine/logfactory.cpp @@ -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 * diff --git a/src/engine/moduleengine.cpp b/src/engine/moduleengine.cpp index 4527c6041f..a163131845 100644 --- a/src/engine/moduleengine.cpp +++ b/src/engine/moduleengine.cpp @@ -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 * diff --git a/src/engine/moduleengine_lua.inl b/src/engine/moduleengine_lua.inl index a0524891e0..bd33e3875c 100644 --- a/src/engine/moduleengine_lua.inl +++ b/src/engine/moduleengine_lua.inl @@ -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 * diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index 3759113f64..588bc1d550 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -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 * diff --git a/src/engine/openspaceengine_lua.inl b/src/engine/openspaceengine_lua.inl index 3d4de94b78..b83b472aa0 100644 --- a/src/engine/openspaceengine_lua.inl +++ b/src/engine/openspaceengine_lua.inl @@ -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 * diff --git a/src/engine/settingsengine.cpp b/src/engine/settingsengine.cpp index 808a2fb5ca..4663641de3 100644 --- a/src/engine/settingsengine.cpp +++ b/src/engine/settingsengine.cpp @@ -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 * diff --git a/src/engine/syncengine.cpp b/src/engine/syncengine.cpp index 1960169917..9cee862af9 100644 --- a/src/engine/syncengine.cpp +++ b/src/engine/syncengine.cpp @@ -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 * diff --git a/src/engine/wrapper/sgctwindowwrapper.cpp b/src/engine/wrapper/sgctwindowwrapper.cpp index d70db6044d..c1edb1d17a 100644 --- a/src/engine/wrapper/sgctwindowwrapper.cpp +++ b/src/engine/wrapper/sgctwindowwrapper.cpp @@ -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 * diff --git a/src/engine/wrapper/windowwrapper.cpp b/src/engine/wrapper/windowwrapper.cpp index 436c34d87f..12e6875a1c 100644 --- a/src/engine/wrapper/windowwrapper.cpp +++ b/src/engine/wrapper/windowwrapper.cpp @@ -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 * diff --git a/src/interaction/controller.cpp b/src/interaction/controller.cpp index 0b46d4d82f..5e844f6a1d 100644 --- a/src/interaction/controller.cpp +++ b/src/interaction/controller.cpp @@ -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 * diff --git a/src/interaction/deviceidentifier.cpp b/src/interaction/deviceidentifier.cpp index 2da4ec2509..992777c17f 100644 --- a/src/interaction/deviceidentifier.cpp +++ b/src/interaction/deviceidentifier.cpp @@ -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 * diff --git a/src/interaction/interactionhandler.cpp b/src/interaction/interactionhandler.cpp index 94be1f99dd..c40760645d 100644 --- a/src/interaction/interactionhandler.cpp +++ b/src/interaction/interactionhandler.cpp @@ -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 * diff --git a/src/interaction/interactionhandler_lua.inl b/src/interaction/interactionhandler_lua.inl index b810761ecb..50e99139e0 100644 --- a/src/interaction/interactionhandler_lua.inl +++ b/src/interaction/interactionhandler_lua.inl @@ -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 * diff --git a/src/interaction/interactionmode.cpp b/src/interaction/interactionmode.cpp index 70274c1876..d6d18bed88 100644 --- a/src/interaction/interactionmode.cpp +++ b/src/interaction/interactionmode.cpp @@ -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 * diff --git a/src/interaction/keyboardcontroller.cpp b/src/interaction/keyboardcontroller.cpp index 0a5d69bc76..1424da3169 100644 --- a/src/interaction/keyboardcontroller.cpp +++ b/src/interaction/keyboardcontroller.cpp @@ -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 * diff --git a/src/interaction/luaconsole.cpp b/src/interaction/luaconsole.cpp index 2a5b8847b3..c7be4369a4 100644 --- a/src/interaction/luaconsole.cpp +++ b/src/interaction/luaconsole.cpp @@ -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 * diff --git a/src/interaction/luaconsole_lua.inl b/src/interaction/luaconsole_lua.inl index 97d6ec0b51..0a2a606262 100644 --- a/src/interaction/luaconsole_lua.inl +++ b/src/interaction/luaconsole_lua.inl @@ -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 * diff --git a/src/mission/mission.cpp b/src/mission/mission.cpp index b8bdb20db8..8f95e2f52b 100644 --- a/src/mission/mission.cpp +++ b/src/mission/mission.cpp @@ -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 * diff --git a/src/mission/missionmanager.cpp b/src/mission/missionmanager.cpp index 56cb58be64..ee028078e3 100644 --- a/src/mission/missionmanager.cpp +++ b/src/mission/missionmanager.cpp @@ -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 * diff --git a/src/mission/missionmanager_lua.inl b/src/mission/missionmanager_lua.inl index 75840b3f27..9d2bcee237 100644 --- a/src/mission/missionmanager_lua.inl +++ b/src/mission/missionmanager_lua.inl @@ -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 * diff --git a/src/network/networkengine.cpp b/src/network/networkengine.cpp index a3a9c3e375..b7f2573657 100644 --- a/src/network/networkengine.cpp +++ b/src/network/networkengine.cpp @@ -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 * diff --git a/src/network/parallelconnection.cpp b/src/network/parallelconnection.cpp index 9eb0a8d60c..23c97a114a 100644 --- a/src/network/parallelconnection.cpp +++ b/src/network/parallelconnection.cpp @@ -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 * diff --git a/src/network/parallelconnection_lua.inl b/src/network/parallelconnection_lua.inl index 13b3b4bcf8..659115103f 100644 --- a/src/network/parallelconnection_lua.inl +++ b/src/network/parallelconnection_lua.inl @@ -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 * diff --git a/src/openspace.cpp b/src/openspace.cpp index 8fa5d3e266..6bfda13b32 100644 --- a/src/openspace.cpp +++ b/src/openspace.cpp @@ -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 * diff --git a/src/performance/performancelayout.cpp b/src/performance/performancelayout.cpp index 5856f9f7e4..f432f543f0 100644 --- a/src/performance/performancelayout.cpp +++ b/src/performance/performancelayout.cpp @@ -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 * diff --git a/src/performance/performancemanager.cpp b/src/performance/performancemanager.cpp index fae9acafbc..383cb25e4f 100644 --- a/src/performance/performancemanager.cpp +++ b/src/performance/performancemanager.cpp @@ -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 * diff --git a/src/performance/performancemeasurement.cpp b/src/performance/performancemeasurement.cpp index 722d7b965d..ae6465cd4f 100644 --- a/src/performance/performancemeasurement.cpp +++ b/src/performance/performancemeasurement.cpp @@ -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 * diff --git a/src/properties/matrix/dmat2property.cpp b/src/properties/matrix/dmat2property.cpp index 5803a22efa..0696ab916d 100644 --- a/src/properties/matrix/dmat2property.cpp +++ b/src/properties/matrix/dmat2property.cpp @@ -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 * diff --git a/src/properties/matrix/dmat2x3property.cpp b/src/properties/matrix/dmat2x3property.cpp index d19e4c2ab5..4451261c25 100644 --- a/src/properties/matrix/dmat2x3property.cpp +++ b/src/properties/matrix/dmat2x3property.cpp @@ -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 * diff --git a/src/properties/matrix/dmat2x4property.cpp b/src/properties/matrix/dmat2x4property.cpp index c98c3c6457..b0b4eff710 100644 --- a/src/properties/matrix/dmat2x4property.cpp +++ b/src/properties/matrix/dmat2x4property.cpp @@ -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 * diff --git a/src/properties/matrix/dmat3property.cpp b/src/properties/matrix/dmat3property.cpp index 5b5bed6e59..77ee5324e2 100644 --- a/src/properties/matrix/dmat3property.cpp +++ b/src/properties/matrix/dmat3property.cpp @@ -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 * diff --git a/src/properties/matrix/dmat3x2property.cpp b/src/properties/matrix/dmat3x2property.cpp index 1bd04eb146..70935e2d14 100644 --- a/src/properties/matrix/dmat3x2property.cpp +++ b/src/properties/matrix/dmat3x2property.cpp @@ -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 * diff --git a/src/properties/matrix/dmat3x4property.cpp b/src/properties/matrix/dmat3x4property.cpp index 99dfe5283a..a5ac727045 100644 --- a/src/properties/matrix/dmat3x4property.cpp +++ b/src/properties/matrix/dmat3x4property.cpp @@ -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 * diff --git a/src/properties/matrix/dmat4property.cpp b/src/properties/matrix/dmat4property.cpp index 2d9c24003c..6951f9e81c 100644 --- a/src/properties/matrix/dmat4property.cpp +++ b/src/properties/matrix/dmat4property.cpp @@ -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 * diff --git a/src/properties/matrix/dmat4x2property.cpp b/src/properties/matrix/dmat4x2property.cpp index b4b132d47b..86412db0c1 100644 --- a/src/properties/matrix/dmat4x2property.cpp +++ b/src/properties/matrix/dmat4x2property.cpp @@ -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 * diff --git a/src/properties/matrix/dmat4x3property.cpp b/src/properties/matrix/dmat4x3property.cpp index 306e259976..ea2d21d3d3 100644 --- a/src/properties/matrix/dmat4x3property.cpp +++ b/src/properties/matrix/dmat4x3property.cpp @@ -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 * diff --git a/src/properties/matrix/mat2property.cpp b/src/properties/matrix/mat2property.cpp index f2736c6a9e..afffaac69f 100644 --- a/src/properties/matrix/mat2property.cpp +++ b/src/properties/matrix/mat2property.cpp @@ -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 * diff --git a/src/properties/matrix/mat2x3property.cpp b/src/properties/matrix/mat2x3property.cpp index cf42b7261a..85ef35813a 100644 --- a/src/properties/matrix/mat2x3property.cpp +++ b/src/properties/matrix/mat2x3property.cpp @@ -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 * diff --git a/src/properties/matrix/mat2x4property.cpp b/src/properties/matrix/mat2x4property.cpp index fac1405f6a..c38c138cbd 100644 --- a/src/properties/matrix/mat2x4property.cpp +++ b/src/properties/matrix/mat2x4property.cpp @@ -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 * diff --git a/src/properties/matrix/mat3property.cpp b/src/properties/matrix/mat3property.cpp index fb8f473434..a38a07db76 100644 --- a/src/properties/matrix/mat3property.cpp +++ b/src/properties/matrix/mat3property.cpp @@ -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 * diff --git a/src/properties/matrix/mat3x2property.cpp b/src/properties/matrix/mat3x2property.cpp index e230b7904d..2becdb6934 100644 --- a/src/properties/matrix/mat3x2property.cpp +++ b/src/properties/matrix/mat3x2property.cpp @@ -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 * diff --git a/src/properties/matrix/mat3x4property.cpp b/src/properties/matrix/mat3x4property.cpp index f17c44d825..6a0dbee999 100644 --- a/src/properties/matrix/mat3x4property.cpp +++ b/src/properties/matrix/mat3x4property.cpp @@ -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 * diff --git a/src/properties/matrix/mat4property.cpp b/src/properties/matrix/mat4property.cpp index 1d7ff0b614..3c40d1b979 100644 --- a/src/properties/matrix/mat4property.cpp +++ b/src/properties/matrix/mat4property.cpp @@ -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 * diff --git a/src/properties/matrix/mat4x2property.cpp b/src/properties/matrix/mat4x2property.cpp index ca90cf41f6..3fccfdd740 100644 --- a/src/properties/matrix/mat4x2property.cpp +++ b/src/properties/matrix/mat4x2property.cpp @@ -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 * diff --git a/src/properties/matrix/mat4x3property.cpp b/src/properties/matrix/mat4x3property.cpp index bdc1fecb21..c9f00f8cb9 100644 --- a/src/properties/matrix/mat4x3property.cpp +++ b/src/properties/matrix/mat4x3property.cpp @@ -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 * diff --git a/src/properties/optionproperty.cpp b/src/properties/optionproperty.cpp index 8c24ba9036..0eb83a96fc 100644 --- a/src/properties/optionproperty.cpp +++ b/src/properties/optionproperty.cpp @@ -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 * diff --git a/src/properties/property.cpp b/src/properties/property.cpp index aee0f405a8..6b495248aa 100644 --- a/src/properties/property.cpp +++ b/src/properties/property.cpp @@ -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 * diff --git a/src/properties/propertyowner.cpp b/src/properties/propertyowner.cpp index 24221357a5..09c9abc648 100644 --- a/src/properties/propertyowner.cpp +++ b/src/properties/propertyowner.cpp @@ -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 * diff --git a/src/properties/scalar/boolproperty.cpp b/src/properties/scalar/boolproperty.cpp index c150cf276b..d61df03e23 100644 --- a/src/properties/scalar/boolproperty.cpp +++ b/src/properties/scalar/boolproperty.cpp @@ -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 * diff --git a/src/properties/scalar/charproperty.cpp b/src/properties/scalar/charproperty.cpp index 57e3b78ff0..f266f1829e 100644 --- a/src/properties/scalar/charproperty.cpp +++ b/src/properties/scalar/charproperty.cpp @@ -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 * diff --git a/src/properties/scalar/doubleproperty.cpp b/src/properties/scalar/doubleproperty.cpp index 0e6d97eb5b..535b3ba60c 100644 --- a/src/properties/scalar/doubleproperty.cpp +++ b/src/properties/scalar/doubleproperty.cpp @@ -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 * diff --git a/src/properties/scalar/floatproperty.cpp b/src/properties/scalar/floatproperty.cpp index c42df70e76..5cc0f4c4f3 100644 --- a/src/properties/scalar/floatproperty.cpp +++ b/src/properties/scalar/floatproperty.cpp @@ -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 * diff --git a/src/properties/scalar/intproperty.cpp b/src/properties/scalar/intproperty.cpp index 43ac9a85f2..52b85fbf74 100644 --- a/src/properties/scalar/intproperty.cpp +++ b/src/properties/scalar/intproperty.cpp @@ -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 * diff --git a/src/properties/scalar/longdoubleproperty.cpp b/src/properties/scalar/longdoubleproperty.cpp index 2917978abd..be16d8ea79 100644 --- a/src/properties/scalar/longdoubleproperty.cpp +++ b/src/properties/scalar/longdoubleproperty.cpp @@ -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 * diff --git a/src/properties/scalar/longlongproperty.cpp b/src/properties/scalar/longlongproperty.cpp index 706ed6cba2..ea67efb837 100644 --- a/src/properties/scalar/longlongproperty.cpp +++ b/src/properties/scalar/longlongproperty.cpp @@ -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 * diff --git a/src/properties/scalar/longproperty.cpp b/src/properties/scalar/longproperty.cpp index 2e3ddf76f9..fbf1ce7311 100644 --- a/src/properties/scalar/longproperty.cpp +++ b/src/properties/scalar/longproperty.cpp @@ -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 * diff --git a/src/properties/scalar/shortproperty.cpp b/src/properties/scalar/shortproperty.cpp index d95b09bbee..33b31ca106 100644 --- a/src/properties/scalar/shortproperty.cpp +++ b/src/properties/scalar/shortproperty.cpp @@ -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 * diff --git a/src/properties/scalar/signedcharproperty.cpp b/src/properties/scalar/signedcharproperty.cpp index 3f0e7e068a..fbe17b194c 100644 --- a/src/properties/scalar/signedcharproperty.cpp +++ b/src/properties/scalar/signedcharproperty.cpp @@ -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 * diff --git a/src/properties/scalar/ucharproperty.cpp b/src/properties/scalar/ucharproperty.cpp index 17ecca1c52..be8e9e674a 100644 --- a/src/properties/scalar/ucharproperty.cpp +++ b/src/properties/scalar/ucharproperty.cpp @@ -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 * diff --git a/src/properties/scalar/uintproperty.cpp b/src/properties/scalar/uintproperty.cpp index f60782cbd8..3957fd5431 100644 --- a/src/properties/scalar/uintproperty.cpp +++ b/src/properties/scalar/uintproperty.cpp @@ -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 * diff --git a/src/properties/scalar/ulonglongproperty.cpp b/src/properties/scalar/ulonglongproperty.cpp index 6dc195639c..363dc66cc5 100644 --- a/src/properties/scalar/ulonglongproperty.cpp +++ b/src/properties/scalar/ulonglongproperty.cpp @@ -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 * diff --git a/src/properties/scalar/ulongproperty.cpp b/src/properties/scalar/ulongproperty.cpp index 974204164d..6cffb80d0d 100644 --- a/src/properties/scalar/ulongproperty.cpp +++ b/src/properties/scalar/ulongproperty.cpp @@ -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 * diff --git a/src/properties/scalar/ushortproperty.cpp b/src/properties/scalar/ushortproperty.cpp index 3369f51f44..dd1f5e0a01 100644 --- a/src/properties/scalar/ushortproperty.cpp +++ b/src/properties/scalar/ushortproperty.cpp @@ -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 * diff --git a/src/properties/scalar/wcharproperty.cpp b/src/properties/scalar/wcharproperty.cpp index 9a8c60b1a3..e48924f5b2 100644 --- a/src/properties/scalar/wcharproperty.cpp +++ b/src/properties/scalar/wcharproperty.cpp @@ -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 * diff --git a/src/properties/selectionproperty.cpp b/src/properties/selectionproperty.cpp index adeefb3f5b..b1029fd910 100644 --- a/src/properties/selectionproperty.cpp +++ b/src/properties/selectionproperty.cpp @@ -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 * diff --git a/src/properties/stringproperty.cpp b/src/properties/stringproperty.cpp index 125469beec..435394b95b 100644 --- a/src/properties/stringproperty.cpp +++ b/src/properties/stringproperty.cpp @@ -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 * diff --git a/src/properties/triggerproperty.cpp b/src/properties/triggerproperty.cpp index 9f40a36345..ddb99b2649 100644 --- a/src/properties/triggerproperty.cpp +++ b/src/properties/triggerproperty.cpp @@ -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 * diff --git a/src/properties/vector/bvec2property.cpp b/src/properties/vector/bvec2property.cpp index 4e48dd1de5..a80ea44176 100644 --- a/src/properties/vector/bvec2property.cpp +++ b/src/properties/vector/bvec2property.cpp @@ -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 * diff --git a/src/properties/vector/bvec3property.cpp b/src/properties/vector/bvec3property.cpp index 9891b42f2f..74e99f3e36 100644 --- a/src/properties/vector/bvec3property.cpp +++ b/src/properties/vector/bvec3property.cpp @@ -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 * diff --git a/src/properties/vector/bvec4property.cpp b/src/properties/vector/bvec4property.cpp index 9ec01527e2..4c0da13839 100644 --- a/src/properties/vector/bvec4property.cpp +++ b/src/properties/vector/bvec4property.cpp @@ -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 * diff --git a/src/properties/vector/dvec2property.cpp b/src/properties/vector/dvec2property.cpp index 2c70902f22..104a4789af 100644 --- a/src/properties/vector/dvec2property.cpp +++ b/src/properties/vector/dvec2property.cpp @@ -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 * diff --git a/src/properties/vector/dvec3property.cpp b/src/properties/vector/dvec3property.cpp index 80d9b4db3f..7a2c88925b 100644 --- a/src/properties/vector/dvec3property.cpp +++ b/src/properties/vector/dvec3property.cpp @@ -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 * diff --git a/src/properties/vector/dvec4property.cpp b/src/properties/vector/dvec4property.cpp index 2a8393437b..6b388a390d 100644 --- a/src/properties/vector/dvec4property.cpp +++ b/src/properties/vector/dvec4property.cpp @@ -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 * diff --git a/src/properties/vector/ivec2property.cpp b/src/properties/vector/ivec2property.cpp index 3949a09bb1..4f62edee53 100644 --- a/src/properties/vector/ivec2property.cpp +++ b/src/properties/vector/ivec2property.cpp @@ -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 * diff --git a/src/properties/vector/ivec3property.cpp b/src/properties/vector/ivec3property.cpp index f7e4207e87..fce00ab2dc 100644 --- a/src/properties/vector/ivec3property.cpp +++ b/src/properties/vector/ivec3property.cpp @@ -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 * diff --git a/src/properties/vector/ivec4property.cpp b/src/properties/vector/ivec4property.cpp index 2c357001d6..7beb3a4cb8 100644 --- a/src/properties/vector/ivec4property.cpp +++ b/src/properties/vector/ivec4property.cpp @@ -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 * diff --git a/src/properties/vector/uvec2property.cpp b/src/properties/vector/uvec2property.cpp index 50bc166cba..d375eb0437 100644 --- a/src/properties/vector/uvec2property.cpp +++ b/src/properties/vector/uvec2property.cpp @@ -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 * diff --git a/src/properties/vector/uvec3property.cpp b/src/properties/vector/uvec3property.cpp index 0feb1188e8..62baf60b65 100644 --- a/src/properties/vector/uvec3property.cpp +++ b/src/properties/vector/uvec3property.cpp @@ -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 * diff --git a/src/properties/vector/uvec4property.cpp b/src/properties/vector/uvec4property.cpp index 333907eb7c..b1e6cb3222 100644 --- a/src/properties/vector/uvec4property.cpp +++ b/src/properties/vector/uvec4property.cpp @@ -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 * diff --git a/src/properties/vector/vec2property.cpp b/src/properties/vector/vec2property.cpp index 4cef6f2c28..c974e0333f 100644 --- a/src/properties/vector/vec2property.cpp +++ b/src/properties/vector/vec2property.cpp @@ -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 * diff --git a/src/properties/vector/vec3property.cpp b/src/properties/vector/vec3property.cpp index 3c237bea2a..b4673383b1 100644 --- a/src/properties/vector/vec3property.cpp +++ b/src/properties/vector/vec3property.cpp @@ -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 * diff --git a/src/properties/vector/vec4property.cpp b/src/properties/vector/vec4property.cpp index 196fc28036..1d61039d22 100644 --- a/src/properties/vector/vec4property.cpp +++ b/src/properties/vector/vec4property.cpp @@ -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 * diff --git a/src/query/query.cpp b/src/query/query.cpp index 224fd7fb1c..12bbc7ebd8 100644 --- a/src/query/query.cpp +++ b/src/query/query.cpp @@ -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 * diff --git a/src/rendering/abufferrenderer.cpp b/src/rendering/abufferrenderer.cpp index 2cc1c2025e..39d7e66ce7 100644 --- a/src/rendering/abufferrenderer.cpp +++ b/src/rendering/abufferrenderer.cpp @@ -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 * diff --git a/src/rendering/framebufferrenderer.cpp b/src/rendering/framebufferrenderer.cpp index 63041636f3..c6b283556b 100644 --- a/src/rendering/framebufferrenderer.cpp +++ b/src/rendering/framebufferrenderer.cpp @@ -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 * diff --git a/src/rendering/raycastermanager.cpp b/src/rendering/raycastermanager.cpp index 0b0f65ef71..f5ca284d2c 100644 --- a/src/rendering/raycastermanager.cpp +++ b/src/rendering/raycastermanager.cpp @@ -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 * diff --git a/src/rendering/renderable.cpp b/src/rendering/renderable.cpp index 58826b0b0d..0d85a020c1 100644 --- a/src/rendering/renderable.cpp +++ b/src/rendering/renderable.cpp @@ -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 * diff --git a/src/rendering/renderengine.cpp b/src/rendering/renderengine.cpp index 85fd0b77a6..42c50e3953 100644 --- a/src/rendering/renderengine.cpp +++ b/src/rendering/renderengine.cpp @@ -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 * diff --git a/src/rendering/renderengine_lua.inl b/src/rendering/renderengine_lua.inl index 4134ce44fc..117496ef49 100644 --- a/src/rendering/renderengine_lua.inl +++ b/src/rendering/renderengine_lua.inl @@ -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 * diff --git a/src/rendering/screenspacerenderable.cpp b/src/rendering/screenspacerenderable.cpp index a48ed62025..7d3c6f21d1 100644 --- a/src/rendering/screenspacerenderable.cpp +++ b/src/rendering/screenspacerenderable.cpp @@ -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 * diff --git a/src/scene/rotation.cpp b/src/scene/rotation.cpp index ac814c8ec2..34333b6a78 100644 --- a/src/scene/rotation.cpp +++ b/src/scene/rotation.cpp @@ -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 * diff --git a/src/scene/scale.cpp b/src/scene/scale.cpp index ef43e0b4f6..d5fe9b542b 100644 --- a/src/scene/scale.cpp +++ b/src/scene/scale.cpp @@ -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 * diff --git a/src/scene/scene.cpp b/src/scene/scene.cpp index 7b0185b8a6..4e0f32252f 100644 --- a/src/scene/scene.cpp +++ b/src/scene/scene.cpp @@ -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 * diff --git a/src/scene/scene_doc.inl b/src/scene/scene_doc.inl index 5968782602..dc9de91c1e 100644 --- a/src/scene/scene_doc.inl +++ b/src/scene/scene_doc.inl @@ -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 * diff --git a/src/scene/scene_lua.inl b/src/scene/scene_lua.inl index 68d7b3bd4e..fc849204b7 100644 --- a/src/scene/scene_lua.inl +++ b/src/scene/scene_lua.inl @@ -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 * diff --git a/src/scene/scenegraph.cpp b/src/scene/scenegraph.cpp index ed78e988c0..898328ee69 100644 --- a/src/scene/scenegraph.cpp +++ b/src/scene/scenegraph.cpp @@ -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 * diff --git a/src/scene/scenegraphnode.cpp b/src/scene/scenegraphnode.cpp index c7d58b84ea..7f48351423 100644 --- a/src/scene/scenegraphnode.cpp +++ b/src/scene/scenegraphnode.cpp @@ -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 * diff --git a/src/scene/scenegraphnode_doc.inl b/src/scene/scenegraphnode_doc.inl index ba183dd42f..719c7a0275 100644 --- a/src/scene/scenegraphnode_doc.inl +++ b/src/scene/scenegraphnode_doc.inl @@ -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 * diff --git a/src/scene/translation.cpp b/src/scene/translation.cpp index 0f0c19fefd..33cee491cc 100644 --- a/src/scene/translation.cpp +++ b/src/scene/translation.cpp @@ -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 * diff --git a/src/scripting/lualibrary.cpp b/src/scripting/lualibrary.cpp index 4aff78390c..359ee27f4e 100644 --- a/src/scripting/lualibrary.cpp +++ b/src/scripting/lualibrary.cpp @@ -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 * diff --git a/src/scripting/scriptengine.cpp b/src/scripting/scriptengine.cpp index 4bb3892a4a..68ad95f34a 100644 --- a/src/scripting/scriptengine.cpp +++ b/src/scripting/scriptengine.cpp @@ -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 * diff --git a/src/scripting/scriptengine_lua.inl b/src/scripting/scriptengine_lua.inl index 7f6e8865df..d1880ad536 100644 --- a/src/scripting/scriptengine_lua.inl +++ b/src/scripting/scriptengine_lua.inl @@ -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 * diff --git a/src/scripting/scriptscheduler.cpp b/src/scripting/scriptscheduler.cpp index 05eb6fb76e..e3126aa8ce 100644 --- a/src/scripting/scriptscheduler.cpp +++ b/src/scripting/scriptscheduler.cpp @@ -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 * diff --git a/src/scripting/scriptscheduler_lua.inl b/src/scripting/scriptscheduler_lua.inl index a041e8a172..cca380d9c0 100644 --- a/src/scripting/scriptscheduler_lua.inl +++ b/src/scripting/scriptscheduler_lua.inl @@ -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 * diff --git a/src/util/blockplaneintersectiongeometry.cpp b/src/util/blockplaneintersectiongeometry.cpp index 92e7bc2537..105c6893d0 100644 --- a/src/util/blockplaneintersectiongeometry.cpp +++ b/src/util/blockplaneintersectiongeometry.cpp @@ -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 * diff --git a/src/util/boxgeometry.cpp b/src/util/boxgeometry.cpp index ded5c4c954..fbb795981c 100644 --- a/src/util/boxgeometry.cpp +++ b/src/util/boxgeometry.cpp @@ -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 * diff --git a/src/util/factorymanager.cpp b/src/util/factorymanager.cpp index 4d979bbad6..404d80a4f8 100644 --- a/src/util/factorymanager.cpp +++ b/src/util/factorymanager.cpp @@ -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 * diff --git a/src/util/gpudata.cpp b/src/util/gpudata.cpp index 1aa901f8b3..be4d438942 100644 --- a/src/util/gpudata.cpp +++ b/src/util/gpudata.cpp @@ -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 * diff --git a/src/util/openspacemodule.cpp b/src/util/openspacemodule.cpp index c326e3256c..06e0ca5009 100644 --- a/src/util/openspacemodule.cpp +++ b/src/util/openspacemodule.cpp @@ -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 * diff --git a/src/util/powerscaledcoordinate.cpp b/src/util/powerscaledcoordinate.cpp index c86544d48f..aa0595b305 100644 --- a/src/util/powerscaledcoordinate.cpp +++ b/src/util/powerscaledcoordinate.cpp @@ -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 * diff --git a/src/util/powerscaledscalar.cpp b/src/util/powerscaledscalar.cpp index 4828e3d97d..dcf78e00e0 100644 --- a/src/util/powerscaledscalar.cpp +++ b/src/util/powerscaledscalar.cpp @@ -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 * diff --git a/src/util/powerscaledsphere.cpp b/src/util/powerscaledsphere.cpp index 0373332a7a..9d646a78ec 100644 --- a/src/util/powerscaledsphere.cpp +++ b/src/util/powerscaledsphere.cpp @@ -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 * diff --git a/src/util/progressbar.cpp b/src/util/progressbar.cpp index d38dd33c82..9f650e782b 100644 --- a/src/util/progressbar.cpp +++ b/src/util/progressbar.cpp @@ -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 * diff --git a/src/util/screenlog.cpp b/src/util/screenlog.cpp index 6299b87a7b..d6fff903f4 100644 --- a/src/util/screenlog.cpp +++ b/src/util/screenlog.cpp @@ -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 * diff --git a/src/util/spicemanager.cpp b/src/util/spicemanager.cpp index dbaf862d15..c0fa008399 100644 --- a/src/util/spicemanager.cpp +++ b/src/util/spicemanager.cpp @@ -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 * diff --git a/src/util/spicemanager_lua.inl b/src/util/spicemanager_lua.inl index 87e8c58e3a..b820f3078c 100644 --- a/src/util/spicemanager_lua.inl +++ b/src/util/spicemanager_lua.inl @@ -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 * diff --git a/src/util/syncbuffer.cpp b/src/util/syncbuffer.cpp index ceb0886476..a870486251 100644 --- a/src/util/syncbuffer.cpp +++ b/src/util/syncbuffer.cpp @@ -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 * diff --git a/src/util/syncdata.cpp b/src/util/syncdata.cpp index dbbb4b8f11..83e25d0c85 100644 --- a/src/util/syncdata.cpp +++ b/src/util/syncdata.cpp @@ -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 * diff --git a/src/util/time.cpp b/src/util/time.cpp index 89204ab623..1d3fd6ba02 100644 --- a/src/util/time.cpp +++ b/src/util/time.cpp @@ -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 * diff --git a/src/util/time_lua.inl b/src/util/time_lua.inl index 3a5a935d69..1b1d6f5e06 100644 --- a/src/util/time_lua.inl +++ b/src/util/time_lua.inl @@ -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 * diff --git a/src/util/timerange.cpp b/src/util/timerange.cpp index 1df1c08661..33bd6c66ee 100644 --- a/src/util/timerange.cpp +++ b/src/util/timerange.cpp @@ -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 * diff --git a/src/util/transformationmanager.cpp b/src/util/transformationmanager.cpp index 0838c1318c..2aef61c482 100644 --- a/src/util/transformationmanager.cpp +++ b/src/util/transformationmanager.cpp @@ -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 * diff --git a/support/cmake/module_common.cmake b/support/cmake/module_common.cmake index db2d954043..74e58d6c4e 100644 --- a/support/cmake/module_common.cmake +++ b/support/cmake/module_common.cmake @@ -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 # diff --git a/support/cmake/module_definition.cmake b/support/cmake/module_definition.cmake index fc8da28aa2..a060121f17 100644 --- a/support/cmake/module_definition.cmake +++ b/support/cmake/module_definition.cmake @@ -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 # diff --git a/support/cmake/support_macros.cmake b/support/cmake/support_macros.cmake index ce84b0d9c8..c97971b989 100644 --- a/support/cmake/support_macros.cmake +++ b/support/cmake/support_macros.cmake @@ -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 # @@ -179,7 +179,11 @@ function (add_external_dependencies) # 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" PARENT_SCOPE) + set(CMAKE_PREFIX_PATH + "~/Qt/5.6/clang_64/lib/cmake" + "~/Qt/5.7/clang_64/lib/cmake" + PARENT_SCOPE + ) endif () endfunction () diff --git a/support/coding/convert_tabs.py b/support/coding/convert_tabs.py index 82813b5858..8e386a81dd 100644 --- a/support/coding/convert_tabs.py +++ b/support/coding/convert_tabs.py @@ -1,7 +1,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 diff --git a/support/coding/new_files.py b/support/coding/new_files.py index 6736d5c495..ed2f45d809 100644 --- a/support/coding/new_files.py +++ b/support/coding/new_files.py @@ -1,7 +1,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 @@ -33,8 +33,8 @@ Project = { } License = { - 'OpenSpace': '/*****************************************************************************************\n * *\n * OpenSpace *\n * *\n * Copyright (c) 2014-2016 *\n * *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this *\n * software and associated documentation files (the "Software"), to deal in the Software *\n * without restriction, including without limitation the rights to use, copy, modify, *\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *\n * permit persons to whom the Software is furnished to do so, subject to the following *\n * conditions: *\n * *\n * The above copyright notice and this permission notice shall be included in all copies *\n * or substantial portions of the Software. *\n * *\n * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *\n * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *\n * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *\n * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *\n ****************************************************************************************/', - 'Ghoul': '/*****************************************************************************************\n * *\n * GHOUL *\n * General Helpful Open Utility Library *\n * *\n * Copyright (c) 2012-2016 *\n * *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this *\n * software and associated documentation files (the "Software"), to deal in the Software *\n * without restriction, including without limitation the rights to use, copy, modify, *\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *\n * permit persons to whom the Software is furnished to do so, subject to the following *\n * conditions: *\n * *\n * The above copyright notice and this permission notice shall be included in all copies *\n * or substantial portions of the Software. *\n * *\n * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *\n * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *\n * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *\n * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *\n ****************************************************************************************/' + 'OpenSpace': '/*****************************************************************************************\n * *\n * OpenSpace *\n * *\n * Copyright (c) 2014-2017 *\n * *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this *\n * software and associated documentation files (the "Software"), to deal in the Software *\n * without restriction, including without limitation the rights to use, copy, modify, *\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *\n * permit persons to whom the Software is furnished to do so, subject to the following *\n * conditions: *\n * *\n * The above copyright notice and this permission notice shall be included in all copies *\n * or substantial portions of the Software. *\n * *\n * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *\n * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *\n * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *\n * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *\n ****************************************************************************************/', + 'Ghoul': '/*****************************************************************************************\n * *\n * GHOUL *\n * General Helpful Open Utility Library *\n * *\n * Copyright (c) 2012-2017 *\n * *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this *\n * software and associated documentation files (the "Software"), to deal in the Software *\n * without restriction, including without limitation the rights to use, copy, modify, *\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *\n * permit persons to whom the Software is furnished to do so, subject to the following *\n * conditions: *\n * *\n * The above copyright notice and this permission notice shall be included in all copies *\n * or substantial portions of the Software. *\n * *\n * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *\n * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *\n * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *\n * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *\n ****************************************************************************************/' } Namespace = { diff --git a/tests/main.cpp b/tests/main.cpp index a0c491f33b..a1f2cd02b9 100644 --- a/tests/main.cpp +++ b/tests/main.cpp @@ -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 * diff --git a/tests/test_aabb.inl b/tests/test_aabb.inl index 8d49293335..e145bdca71 100644 --- a/tests/test_aabb.inl +++ b/tests/test_aabb.inl @@ -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 * diff --git a/tests/test_angle.inl b/tests/test_angle.inl index 9658982f89..5f1746c68e 100644 --- a/tests/test_angle.inl +++ b/tests/test_angle.inl @@ -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 * diff --git a/tests/test_chunknode.inl b/tests/test_chunknode.inl index 35f12a0890..56d29d9b6f 100644 --- a/tests/test_chunknode.inl +++ b/tests/test_chunknode.inl @@ -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 * diff --git a/tests/test_common.inl b/tests/test_common.inl index 60093e7325..460bf019dc 100644 --- a/tests/test_common.inl +++ b/tests/test_common.inl @@ -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 * diff --git a/tests/test_concurrentjobmanager.inl b/tests/test_concurrentjobmanager.inl index a84ab45fee..1938cfbdee 100644 --- a/tests/test_concurrentjobmanager.inl +++ b/tests/test_concurrentjobmanager.inl @@ -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 * diff --git a/tests/test_concurrentqueue.inl b/tests/test_concurrentqueue.inl index fda05e577d..5aecfe171d 100644 --- a/tests/test_concurrentqueue.inl +++ b/tests/test_concurrentqueue.inl @@ -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 * diff --git a/tests/test_configurationmanager.inl b/tests/test_configurationmanager.inl index a43cf73e9b..e54a198400 100644 --- a/tests/test_configurationmanager.inl +++ b/tests/test_configurationmanager.inl @@ -3,7 +3,7 @@ * GHOUL * * General Helpful Open Utility Library * * * - * Copyright (c) 2012-2016 * + * Copyright (c) 2012-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 * diff --git a/tests/test_convexhull.inl b/tests/test_convexhull.inl index df6493ccb5..3584d9d7f5 100644 --- a/tests/test_convexhull.inl +++ b/tests/test_convexhull.inl @@ -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 * diff --git a/tests/test_documentation.inl b/tests/test_documentation.inl index c14af8d1df..2f1f168c0d 100644 --- a/tests/test_documentation.inl +++ b/tests/test_documentation.inl @@ -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 * diff --git a/tests/test_ellipsoid.inl b/tests/test_ellipsoid.inl index cc7a4aa8e1..a70d5a7ada 100644 --- a/tests/test_ellipsoid.inl +++ b/tests/test_ellipsoid.inl @@ -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 * diff --git a/tests/test_gdalwms.inl b/tests/test_gdalwms.inl index fa082702d8..f1cfc0261d 100644 --- a/tests/test_gdalwms.inl +++ b/tests/test_gdalwms.inl @@ -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 * diff --git a/tests/test_iswamanager.inl b/tests/test_iswamanager.inl index 89541198c5..46299808f0 100644 --- a/tests/test_iswamanager.inl +++ b/tests/test_iswamanager.inl @@ -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 * diff --git a/tests/test_latlonpatch.inl b/tests/test_latlonpatch.inl index 55eccc9df5..d8e38b3a11 100644 --- a/tests/test_latlonpatch.inl +++ b/tests/test_latlonpatch.inl @@ -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 * diff --git a/tests/test_lrucache.inl b/tests/test_lrucache.inl index 53151b86ee..29000b820c 100644 --- a/tests/test_lrucache.inl +++ b/tests/test_lrucache.inl @@ -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 * diff --git a/tests/test_luaconversions.inl b/tests/test_luaconversions.inl index 0b907d00ad..ef86b6ca6b 100644 --- a/tests/test_luaconversions.inl +++ b/tests/test_luaconversions.inl @@ -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 * diff --git a/tests/test_patchcoverageprovider.inl b/tests/test_patchcoverageprovider.inl index 732a718681..b249bcd701 100644 --- a/tests/test_patchcoverageprovider.inl +++ b/tests/test_patchcoverageprovider.inl @@ -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 * diff --git a/tests/test_powerscalecoordinates.inl b/tests/test_powerscalecoordinates.inl index 946ee7afc4..88f666d9be 100644 --- a/tests/test_powerscalecoordinates.inl +++ b/tests/test_powerscalecoordinates.inl @@ -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 * diff --git a/tests/test_scenegraphloader.inl b/tests/test_scenegraphloader.inl index 3561d3018e..bbd6c51067 100644 --- a/tests/test_scenegraphloader.inl +++ b/tests/test_scenegraphloader.inl @@ -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 * diff --git a/tests/test_screenspaceimage.inl b/tests/test_screenspaceimage.inl index f031038da7..5f1b724277 100644 --- a/tests/test_screenspaceimage.inl +++ b/tests/test_screenspaceimage.inl @@ -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 * diff --git a/tests/test_scriptscheduler.inl b/tests/test_scriptscheduler.inl index 1dee4d8cc8..0515055c1e 100644 --- a/tests/test_scriptscheduler.inl +++ b/tests/test_scriptscheduler.inl @@ -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 * diff --git a/tests/test_spicemanager.inl b/tests/test_spicemanager.inl index 8fd60a96a8..74c78f0a84 100644 --- a/tests/test_spicemanager.inl +++ b/tests/test_spicemanager.inl @@ -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 * diff --git a/tests/test_temporaltileprovider.inl b/tests/test_temporaltileprovider.inl index 081d19425d..5ae94b6101 100644 --- a/tests/test_temporaltileprovider.inl +++ b/tests/test_temporaltileprovider.inl @@ -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 * From 41fda78792caa069af0475db4979b2a61c7de25f Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Mon, 6 Feb 2017 19:14:42 -0500 Subject: [PATCH 05/96] Add check for empty lines in DownloadManager --- src/engine/downloadmanager.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/engine/downloadmanager.cpp b/src/engine/downloadmanager.cpp index d594dcd494..8c57588f6b 100644 --- a/src/engine/downloadmanager.cpp +++ b/src/engine/downloadmanager.cpp @@ -299,6 +299,12 @@ std::vector> DownloadManager::downl std::string line; int nFiles = 0; while (std::getline(temporary, line)) { + if (line.empty()) { + // This might occur if someone added multiple newlines + // or mixing carriage return and newlines + continue; + } + ++nFiles; #ifdef __APPLE__ // @TODO: Fix this so that the ifdef is not necessary anymore ---abock From 5f98ec2ca9ec690ef32cdf27392ce03feec33e6a Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Tue, 7 Feb 2017 17:02:43 -0500 Subject: [PATCH 06/96] Update Ghoul repository Make changes to accommodate the new Lua state class --- ext/ghoul | 2 +- src/engine/openspaceengine.cpp | 14 ++++---------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/ext/ghoul b/ext/ghoul index a3b333ba99..bf38f9131c 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit a3b333ba997758c3bd9022fb431c322fbdc5945c +Subproject commit bf38f9131cce7d0ca85551728e223431dd95b9ce diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index 588bc1d550..d7b2b74161 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -66,6 +66,7 @@ #include #include #include +#include #include #include #include @@ -680,11 +681,8 @@ void OpenSpaceEngine::runScripts(const ghoul::Dictionary& scripts) { void OpenSpaceEngine::runPreInitializationScripts(const std::string& sceneDescription) { LINFO("Running Initialization scripts"); - lua_State* state = ghoul::lua::createNewLuaState(); - OnExit( - // Delete the Lua state at the end of the scope, no matter what - [state](){ghoul::lua::destroyLuaState(state);} - ); + + ghoul::lua::LuaState state; OsEng.scriptEngine().initializeLuaState(state); // First execute the script to get all global variables @@ -710,11 +708,7 @@ void OpenSpaceEngine::runPreInitializationScripts(const std::string& sceneDescri void OpenSpaceEngine::runPostInitializationScripts(const std::string& sceneDescription) { LINFO("Running Setup scripts"); - lua_State* state = ghoul::lua::createNewLuaState(); - OnExit( - // Delete the Lua state at the end of the scope, no matter what - [state](){ghoul::lua::destroyLuaState(state);} - ); + ghoul::lua::LuaState state; OsEng.scriptEngine().initializeLuaState(state); // First execute the script to get all global variables From a6c422c38e8000995ed62c4576271ec42b6e35ed Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Wed, 8 Feb 2017 14:42:28 -0500 Subject: [PATCH 07/96] Fix runtime error with moving classes from `base` to `space` module Add additional logging information to initialization --- apps/OpenSpace/main.cpp | 7 ++++++- .../newhorizons/rendering/renderableplanetprojection.cpp | 2 +- src/engine/openspaceengine.cpp | 8 ++++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/apps/OpenSpace/main.cpp b/apps/OpenSpace/main.cpp index b60284dab3..ae175f5218 100644 --- a/apps/OpenSpace/main.cpp +++ b/apps/OpenSpace/main.cpp @@ -210,12 +210,17 @@ void mainInitFunc() { //is this node the master? (must be set after call to _sgctEngine->init()) OsEng.setMaster(_sgctEngine->isMaster()); + LDEBUG("Initializing OpenSpace Engine"); bool success = OsEng.initialize(); - if (success) + + LDEBUG("Initializing OpenGL in OpenSpace Engine"); + if (success) { success = OsEng.initializeGL(); + } if (!success) { LFATAL("Initializing OpenSpaceEngine failed"); + LogMgr.flushLogs(); exit(EXIT_FAILURE); } diff --git a/modules/newhorizons/rendering/renderableplanetprojection.cpp b/modules/newhorizons/rendering/renderableplanetprojection.cpp index 857d7d8197..d5ee50ceae 100644 --- a/modules/newhorizons/rendering/renderableplanetprojection.cpp +++ b/modules/newhorizons/rendering/renderableplanetprojection.cpp @@ -80,7 +80,7 @@ Documentation RenderablePlanetProjection::Documentation() { }, { keyGeometry, - new ReferencingVerifier("base_geometry_planet"), + new ReferencingVerifier("space_geometry_planet"), "The geometry that is used for rendering this planet.", Optional::No }, diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index d7b2b74161..b3824c0d93 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -407,8 +407,10 @@ void OpenSpaceEngine::destroy() { bool OpenSpaceEngine::initialize() { // clear the screen so the user don't have to see old buffer contents from the // graphics card + LDEBUG("Clearing all Windows"); clearAllWindows(); + LDEBUG("Adding system components"); // Detect and log OpenCL and OpenGL versions and available devices SysCap.addComponent( std::make_unique() @@ -416,13 +418,15 @@ bool OpenSpaceEngine::initialize() { SysCap.addComponent( std::make_unique() ); + + LDEBUG("Detecting capabilities"); SysCap.detectCapabilities(); using Verbosity = ghoul::systemcapabilities::SystemCapabilitiesComponent::Verbosity; Verbosity verbosity = Verbosity::Default; if (configurationManager().hasKeyAndValue( - - ConfigurationManager::KeyCapabilitiesVerbosity)) { + ConfigurationManager::KeyCapabilitiesVerbosity)) + { std::map verbosityMap = { { "None", Verbosity::None }, { "Minimal", Verbosity::Minimal }, From 77d0b382827f4a81fc4ba979539521fdac83e26a Mon Sep 17 00:00:00 2001 From: Matthew Territo Date: Wed, 8 Feb 2017 21:41:11 -0700 Subject: [PATCH 08/96] Update Ghoul with typo fix (#224) Yey \o/ --- ext/ghoul | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/ghoul b/ext/ghoul index bf38f9131c..be0ffdb2f1 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit bf38f9131cce7d0ca85551728e223431dd95b9ce +Subproject commit be0ffdb2f132e5b5b7aff99c73e4a4aac1d7b0dd From 9e4cf8196d27ffa9eb75b030a40a7b35f748d661 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Thu, 9 Feb 2017 18:23:33 -0500 Subject: [PATCH 09/96] Add script to check include guards --- support/coding/check_include_guard.py | 184 ++++++++++++++++++++++++++ 1 file changed, 184 insertions(+) create mode 100644 support/coding/check_include_guard.py diff --git a/support/coding/check_include_guard.py b/support/coding/check_include_guard.py new file mode 100644 index 0000000000..fba3f5b4b3 --- /dev/null +++ b/support/coding/check_include_guard.py @@ -0,0 +1,184 @@ +""" +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. + + +This script traverses the file tree of OpenSpace and will check all files' include +guards for correctness. At the moment this includes: + * Correctness (file has a #ifndef. #define, and #endif lines) + * Equality (using the same name for the #ifdef and #define) + * Styling (no empty line between #ifndef and #define lines, empty lines before and + after #ifndef #define block) + * Correct usage of the name in the final comment of the file + * Naming convention (OpenSpace include guards start with OPENSPACE, Ghoul with GHOUL, + module includes have the module name in it) + * Checking for duplicates between all files + +If this script is executed from the base directory of OpenSpace, no arguments need to +be passed, otherwise the first and only argument has to point to the base directory. +Thus, the default value of the first argument is '.' +""" + +import glob +import re +import sys + +def get_ifndef_symbol(lines): + index = [i for i,s in enumerate(lines) if '#ifndef ' in s] + + if len(index) == 0: + return '', -1 + + result = re.search('#ifndef (.*)\n', lines[index[0]]) + return result.group(1), index[0] + +def get_define_symbol(lines): + index = [i for i,s in enumerate(lines) if '#define ' in s] + + if len(index) == 0: + return '', -1 + + result = re.search('#define (.*)\n', lines[index[0]]) + return result.group(1), index[0] + +def check_correctness(lines): + ifndef_symbol, line_number = get_ifndef_symbol(lines) + if line_number == -1: + return 'No #ifndef in file' + + define_symbol, line_number = get_define_symbol(lines) + if (line_number == -1): + return 'No #define in file' + + index = [i for i,s in enumerate(lines) if '#endif' in s] + if len(index) == 0: + return 'No #endif in file' + + return '' + +def check_equality(lines): + ifndef, _ = get_ifndef_symbol(lines) + define, _ = get_define_symbol(lines) + + if ifndef == define: + return '' + else: + return ifndef + ' ' + define + +def check_styling(lines): + _, ifndef_line = get_ifndef_symbol(lines) + _, define_line = get_define_symbol(lines) + + if abs(ifndef_line - define_line) != 1: + return '#ifndef and #define lines are not subsequent' + + if lines[ifndef_line - 1].strip() != '': + return 'Preceding line is not empty' + + if lines[define_line + 1].strip() != '': + return 'Following line is not empty' + + return '' + +def check_comment(lines): + ifndef_symbol, _ = get_ifndef_symbol(lines) + + index = [i for i,s in enumerate(lines) if '#endif' in s] + endif_line = lines[index[-1]].strip() + + if endif_line != '#endif // ' + ifndef_symbol: + return '#endif line is not correctly formatted' + else: + return '' + +def check_duplicates(lines, previousSymbols): + ifndef_symbol, _ = get_ifndef_symbol(lines) + + if ifndef_symbol in previousSymbols: + return False, ifndef_symbol + else: + return True, ifndef_symbol + +basePath = './' +if len(sys.argv) > 1: + basePath = sys.argv[1] + '/' + +positivePathList = [ + 'include/**/*.h', + 'apps/**/*.h', + 'modules/**/*.h', + 'ext/ghoul/include/**/*.h' +] + +negativePathList = [ + 'modules/**/ext/**/*.h', + 'apps/**/ext/**/*.h', +] + +# Collect all the files that we might apply this script to +files = [] +for p in positivePathList: + f = glob.glob(basePath + p, recursive=True) + files = files + f + +# Collect all files that we want to remove from the full list +# These are mostly the external directories from modules +negativeFiles = [] +for p in negativePathList: + f = glob.glob(basePath + p, recursive=True) + negativeFiles = negativeFiles + f + +# Actually remove the negative files from the positive ones +files = [f for f in files if f not in negativeFiles] + +previousSymbols = {} + +for file in files: + success = True + with open(file, 'r+') as f: + lines = f.readlines() + + correctness = check_correctness(lines) + if correctness: + print(file, '\t', 'Correctness check failed', '\t', correctness) + continue + + equality = check_equality(lines) + if equality: + print(file, '\t', 'Equality check failed', '\t', equality) + continue + + styling = check_styling(lines) + if styling: + print(file, '\t', 'Styling check failed', '\t', styling) + continue + + comment = check_comment(lines) + if comment: + print(file, '\t', 'Comment check failed', '\t', comment) + continue + + duplicates, symbol = check_duplicates(lines, previousSymbols) + if not duplicates: + print(file, '\t', 'Duplicate include guard', symbol, 'first in', previousSymbols[symbol]) + continue + else: + previousSymbols[symbol] = file From 6d9dc2bfebe43d0bdbc8a2772828fed10469418e Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Thu, 9 Feb 2017 19:12:21 -0500 Subject: [PATCH 10/96] Fixed include guards Removed unused writeToTexture file --- apps/DataConverter/conversiontask.h | 2 +- apps/DataConverter/milkywayconversiontask.h | 2 +- .../milkywaypointsconversiontask.h | 2 +- ext/ghoul | 2 +- .../openspace/engine/configurationmanager.h | 2 +- include/openspace/engine/openspaceengine.h | 2 +- include/openspace/network/networkengine.h | 4 +- include/openspace/rendering/abufferrenderer.h | 2 +- .../openspace/rendering/raycasterlistener.h | 2 +- .../openspace/rendering/raycastermanager.h | 2 +- include/openspace/rendering/volume.h | 2 +- include/openspace/rendering/volumeraycaster.h | 2 +- include/openspace/util/histogram.h | 2 +- include/openspace/util/timerange.h | 2 +- .../openspace/util/transformationmanager.h | 2 +- modules/base/rendering/modelgeometry.h | 2 +- modules/base/rendering/renderablemodel.h | 2 +- .../base/rendering/screenspaceframebuffer.h | 2 +- modules/base/rendering/screenspaceimage.h | 4 +- modules/base/rendering/wavefrontgeometry.h | 2 +- modules/galaxy/rendering/galaxyraycaster.h | 2 +- modules/globebrowsing/chunk/culling.h | 2 +- modules/globebrowsing/geometry/aabb.h | 2 +- modules/globebrowsing/geometry/convexhull.h | 2 +- .../globebrowsing/globes/chunkedlodglobe.h | 2 +- modules/globebrowsing/globes/pointglobe.h | 2 +- .../globebrowsing/globes/renderableglobe.h | 2 +- modules/globebrowsing/other/distanceswitch.h | 2 +- modules/globebrowsing/other/statscollector.h | 2 +- .../globebrowsing/rendering/chunkrenderer.h | 2 +- .../globebrowsing/rendering/gpulayermanager.h | 2 +- .../globebrowsing/rendering/layermanager.h | 2 +- .../rendering/layershadermanager.h | 2 +- modules/globebrowsing/tile/asynctilereader.h | 2 +- modules/globebrowsing/tile/chunktile.h | 2 +- modules/globebrowsing/tile/pixelregion.h | 2 +- modules/globebrowsing/tile/tile.h | 2 +- modules/globebrowsing/tile/tiledataset.h | 2 +- modules/globebrowsing/tile/tiledatatype.h | 2 +- modules/globebrowsing/tile/tilediskcache.h | 2 +- .../tile/tileprovider/cachingtileprovider.h | 2 +- .../tile/tileprovider/singleimageprovider.h | 2 +- .../tile/tileprovider/temporaltileprovider.h | 2 +- .../tile/tileprovider/texttileprovider.h | 2 +- .../tile/tileprovider/tileprovider.h | 2 +- .../tile/tileprovider/tileproviderbyindex.h | 2 +- .../tile/tileprovider/tileproviderbylevel.h | 2 +- modules/globebrowsing/tile/tileselector.h | 2 +- modules/iswa/rendering/datacygnet.h | 2 +- modules/iswa/rendering/dataplane.h | 2 +- modules/iswa/rendering/datasphere.h | 2 +- modules/iswa/rendering/kameleonplane.h | 2 +- modules/iswa/rendering/screenspacecygnet.h | 2 +- modules/iswa/rendering/texturecygnet.h | 2 +- modules/iswa/util/dataprocessor.h | 2 +- modules/iswa/util/dataprocessorjson.h | 4 +- modules/iswa/util/dataprocessorkameleon.h | 2 +- modules/iswa/util/dataprocessortext.h | 2 +- modules/iswa/util/iswamanager.h | 2 +- .../rendering/multiresvolumeraycaster.h | 2 +- .../rendering/renderablemodelprojection.h | 2 +- .../rendering/renderableplanetprojection.h | 2 +- .../newhorizons/rendering/writeToTexture.h | 71 ------------------- modules/newhorizons/util/hongkangparser.h | 2 +- .../newhorizons/util/instrumenttimesparser.h | 2 +- modules/newhorizons/util/labelparser.h | 2 +- modules/newhorizons/util/sequenceparser.h | 2 +- .../onscreengui/include/renderproperties.h | 2 +- modules/space/rendering/planetgeometry.h | 2 +- modules/space/rendering/renderableplanet.h | 4 +- modules/space/rendering/renderablestars.h | 2 +- .../toyvolume/rendering/toyvolumeraycaster.h | 2 +- modules/volume/rendering/renderablevolume.h | 2 +- modules/volume/rendering/renderablevolumegl.h | 2 +- 74 files changed, 77 insertions(+), 148 deletions(-) delete mode 100644 modules/newhorizons/rendering/writeToTexture.h diff --git a/apps/DataConverter/conversiontask.h b/apps/DataConverter/conversiontask.h index 4719803e40..5e9d4b6ce2 100644 --- a/apps/DataConverter/conversiontask.h +++ b/apps/DataConverter/conversiontask.h @@ -14,4 +14,4 @@ public: } } -#endif +#endif // __CONVERSIONTASK_H__ diff --git a/apps/DataConverter/milkywayconversiontask.h b/apps/DataConverter/milkywayconversiontask.h index 3927debd90..30cf16e824 100644 --- a/apps/DataConverter/milkywayconversiontask.h +++ b/apps/DataConverter/milkywayconversiontask.h @@ -38,4 +38,4 @@ private: } } -#endif +#endif // __MILKYWAYCONVERSIONTASK_H__ diff --git a/apps/DataConverter/milkywaypointsconversiontask.h b/apps/DataConverter/milkywaypointsconversiontask.h index 3b5e8abb15..795425646f 100644 --- a/apps/DataConverter/milkywaypointsconversiontask.h +++ b/apps/DataConverter/milkywaypointsconversiontask.h @@ -32,4 +32,4 @@ private: } } -#endif +#endif // __MILKYWAYPOINTSCONVERSIONTASK_H__ diff --git a/ext/ghoul b/ext/ghoul index be0ffdb2f1..1e6400a9e6 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit be0ffdb2f132e5b5b7aff99c73e4a4aac1d7b0dd +Subproject commit 1e6400a9e6d5a4e0b8d2fd656a06168b40ef0f71 diff --git a/include/openspace/engine/configurationmanager.h b/include/openspace/engine/configurationmanager.h index ef893ce5df..ed4f0fd6b0 100644 --- a/include/openspace/engine/configurationmanager.h +++ b/include/openspace/engine/configurationmanager.h @@ -167,4 +167,4 @@ private: } // namespace openspace -#endif // __OPENSPACE_CORE___CONFIGURATIONMANAGER___H__ +#endif // __OPENSPACE_CORE___CONFIGURATIONMANAGER___H__ diff --git a/include/openspace/engine/openspaceengine.h b/include/openspace/engine/openspaceengine.h index 01298c97c6..fcfc69b447 100644 --- a/include/openspace/engine/openspaceengine.h +++ b/include/openspace/engine/openspaceengine.h @@ -187,4 +187,4 @@ private: } // namespace openspace -#endif // __OPENSPACE_CORE___OPENSPACEENGINE___H__ +#endif // __OPENSPACE_CORE___OPENSPACEENGINE___H__ diff --git a/include/openspace/network/networkengine.h b/include/openspace/network/networkengine.h index c603c07668..dc0a06de0d 100644 --- a/include/openspace/network/networkengine.h +++ b/include/openspace/network/networkengine.h @@ -22,7 +22,7 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_CORE___NETWORKENGINE___H__ +#ifndef PARALLELCONNECTION__OPENSPACE_CORE___NETWORKENGINE___H__ #define PARALLELCONNECTION__OPENSPACE_CORE___NETWORKENGINE___H__ #include @@ -75,4 +75,4 @@ private: } // namespace openspace -#endif // __OPENSPACE_CORE___NETWORKENGINE___H__ +#endif // PARALLELCONNECTION__OPENSPACE_CORE___NETWORKENGINE___H__ diff --git a/include/openspace/rendering/abufferrenderer.h b/include/openspace/rendering/abufferrenderer.h index bd708f1fbf..042c0380dd 100644 --- a/include/openspace/rendering/abufferrenderer.h +++ b/include/openspace/rendering/abufferrenderer.h @@ -140,4 +140,4 @@ private: } // namespace openspace -#endif // __OPENSPACE_CORE___ABUFFERRENDERER___H__ +#endif // __OPENSPACE_CORE___ABUFFERRENDERER___H__ diff --git a/include/openspace/rendering/raycasterlistener.h b/include/openspace/rendering/raycasterlistener.h index 142c8ccf49..3efa452113 100644 --- a/include/openspace/rendering/raycasterlistener.h +++ b/include/openspace/rendering/raycasterlistener.h @@ -36,4 +36,4 @@ public: } // openspace -#endif // __OPENSPACE_CORE___RAYCASTERLISTENER___H__ +#endif // __OPENSPACE_CORE___RAYCASTERLISTENER___H__ diff --git a/include/openspace/rendering/raycastermanager.h b/include/openspace/rendering/raycastermanager.h index 552f0460f9..64792e48e1 100644 --- a/include/openspace/rendering/raycastermanager.h +++ b/include/openspace/rendering/raycastermanager.h @@ -50,4 +50,4 @@ private: } // namespace openspace -#endif // __OPENSPACE_CORE___RAYCASTERMANAGER___H__ +#endif // __OPENSPACE_CORE___RAYCASTERMANAGER___H__ diff --git a/include/openspace/rendering/volume.h b/include/openspace/rendering/volume.h index 206715c4d9..f175a029e0 100644 --- a/include/openspace/rendering/volume.h +++ b/include/openspace/rendering/volume.h @@ -129,4 +129,4 @@ public: } // namespace openspace -#endif // __OPENSPACE_CORE___VOLUME___H__ +#endif // __OPENSPACE_CORE___VOLUME___H__ diff --git a/include/openspace/rendering/volumeraycaster.h b/include/openspace/rendering/volumeraycaster.h index 72f3ca95c6..4315ebc5cc 100644 --- a/include/openspace/rendering/volumeraycaster.h +++ b/include/openspace/rendering/volumeraycaster.h @@ -126,4 +126,4 @@ public: } // namespace openspace -#endif // __OPENSPACE_CORE___VOLUMERAYCASTER___H__ +#endif // __OPENSPACE_CORE___VOLUMERAYCASTER___H__ diff --git a/include/openspace/util/histogram.h b/include/openspace/util/histogram.h index 1324b08096..92e807f441 100644 --- a/include/openspace/util/histogram.h +++ b/include/openspace/util/histogram.h @@ -90,4 +90,4 @@ private: } // namespace openspace -#endif //__OPENSPACE_CORE___HISTOGRAM___H__ +#endif // __OPENSPACE_CORE___HISTOGRAM___H__ diff --git a/include/openspace/util/timerange.h b/include/openspace/util/timerange.h index fb22514ea5..2bd19e9274 100644 --- a/include/openspace/util/timerange.h +++ b/include/openspace/util/timerange.h @@ -78,4 +78,4 @@ struct TimeRange { } // namespace openspace -#endif //__OPENSPACE_CORE___TIMERANGE___H__ +#endif // __OPENSPACE_CORE___TIMERANGE___H__ diff --git a/include/openspace/util/transformationmanager.h b/include/openspace/util/transformationmanager.h index c2b655fd5b..29d2e54f7b 100644 --- a/include/openspace/util/transformationmanager.h +++ b/include/openspace/util/transformationmanager.h @@ -61,4 +61,4 @@ private: } // namespace openspace - #endif //__OPENSPACE_CORE___TRANSFORMATIONMANAGER___H__ +#endif // __OPENSPACE_CORE___TRANSFORMATIONMANAGER___H__ diff --git a/modules/base/rendering/modelgeometry.h b/modules/base/rendering/modelgeometry.h index 355f9ce1fb..690e7271c3 100644 --- a/modules/base/rendering/modelgeometry.h +++ b/modules/base/rendering/modelgeometry.h @@ -81,4 +81,4 @@ protected: } // namespace modelgeometry } // namespace openspace -#endif // __OPENSPACE_MODULE_BASE___MODELGEOMETRY___H__ +#endif // __OPENSPACE_MODULE_BASE___MODELGEOMETRY___H__ diff --git a/modules/base/rendering/renderablemodel.h b/modules/base/rendering/renderablemodel.h index c8c066e233..c885b8dd84 100644 --- a/modules/base/rendering/renderablemodel.h +++ b/modules/base/rendering/renderablemodel.h @@ -87,4 +87,4 @@ private: } // namespace openspace -#endif // __OPENSPACE_MODULE_BASE___RENDERABLEMODEL___H__ +#endif // __OPENSPACE_MODULE_BASE___RENDERABLEMODEL___H__ diff --git a/modules/base/rendering/screenspaceframebuffer.h b/modules/base/rendering/screenspaceframebuffer.h index 21ccd5ab09..33a04a3655 100644 --- a/modules/base/rendering/screenspaceframebuffer.h +++ b/modules/base/rendering/screenspaceframebuffer.h @@ -68,4 +68,4 @@ private: } //namespace openspace -#endif //__OPENSPACE_MODULE_BASE___SCREENSPACEFRAMEBUFFER___H__ +#endif // __OPENSPACE_MODULE_BASE___SCREENSPACEFRAMEBUFFER___H__ diff --git a/modules/base/rendering/screenspaceimage.h b/modules/base/rendering/screenspaceimage.h index 9ae890cac1..7316722608 100644 --- a/modules/base/rendering/screenspaceimage.h +++ b/modules/base/rendering/screenspaceimage.h @@ -61,6 +61,6 @@ private: properties::StringProperty _texturePath; }; -} //namespace openspace +} // namespace openspace -#endif //__OPENSPACE_MODULE_BASE___SCREENSPACEIMAGE___H__ +#endif // __OPENSPACE_MODULE_BASE___SCREENSPACEIMAGE___H__ diff --git a/modules/base/rendering/wavefrontgeometry.h b/modules/base/rendering/wavefrontgeometry.h index 838149bd67..d4a315dbe1 100644 --- a/modules/base/rendering/wavefrontgeometry.h +++ b/modules/base/rendering/wavefrontgeometry.h @@ -48,4 +48,4 @@ namespace modelgeometry { } // namespace modelgeometry } // namespace openspace -#endif // __WAVEFRONTOBJECT_H__ +#endif // __WAVEFRONTGEOMETRY_H__ diff --git a/modules/galaxy/rendering/galaxyraycaster.h b/modules/galaxy/rendering/galaxyraycaster.h index b55a98df86..dcd34063e6 100644 --- a/modules/galaxy/rendering/galaxyraycaster.h +++ b/modules/galaxy/rendering/galaxyraycaster.h @@ -85,4 +85,4 @@ private: } // namespace openspace -#endif // __OPENSPACE_MODULE_GALAXY___GALAXYRAYCASTER___H__ +#endif // __OPENSPACE_MODULE_GALAXY___GALAXYRAYCASTER___H__ diff --git a/modules/globebrowsing/chunk/culling.h b/modules/globebrowsing/chunk/culling.h index 899e426040..5e0758b42d 100644 --- a/modules/globebrowsing/chunk/culling.h +++ b/modules/globebrowsing/chunk/culling.h @@ -85,4 +85,4 @@ public: } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING___CULLING___H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___CULLING___H__ diff --git a/modules/globebrowsing/geometry/aabb.h b/modules/globebrowsing/geometry/aabb.h index b2310d85b7..5cc2bdf660 100644 --- a/modules/globebrowsing/geometry/aabb.h +++ b/modules/globebrowsing/geometry/aabb.h @@ -88,4 +88,4 @@ struct AABB3 { } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING___AABB___H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___AABB___H__ diff --git a/modules/globebrowsing/geometry/convexhull.h b/modules/globebrowsing/geometry/convexhull.h index 31a87f366f..048201c295 100644 --- a/modules/globebrowsing/geometry/convexhull.h +++ b/modules/globebrowsing/geometry/convexhull.h @@ -69,4 +69,4 @@ private: } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING___CONVEX_HULL___H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___CONVEX_HULL___H__ diff --git a/modules/globebrowsing/globes/chunkedlodglobe.h b/modules/globebrowsing/globes/chunkedlodglobe.h index 7a830c8ff9..965bc627d3 100644 --- a/modules/globebrowsing/globes/chunkedlodglobe.h +++ b/modules/globebrowsing/globes/chunkedlodglobe.h @@ -137,4 +137,4 @@ private: } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING___CHUNKED_LOD_GLOBE___H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___CHUNKED_LOD_GLOBE___H__ diff --git a/modules/globebrowsing/globes/pointglobe.h b/modules/globebrowsing/globes/pointglobe.h index e8b24ddc19..5407f9a49e 100644 --- a/modules/globebrowsing/globes/pointglobe.h +++ b/modules/globebrowsing/globes/pointglobe.h @@ -59,4 +59,4 @@ private: } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING___POINTGLOBE___H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___POINTGLOBE___H__ diff --git a/modules/globebrowsing/globes/renderableglobe.h b/modules/globebrowsing/globes/renderableglobe.h index df9e58fe0c..bd5c5b4ea3 100644 --- a/modules/globebrowsing/globes/renderableglobe.h +++ b/modules/globebrowsing/globes/renderableglobe.h @@ -128,4 +128,4 @@ private: } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING___RENDERABLEGLOBE___H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___RENDERABLEGLOBE___H__ diff --git a/modules/globebrowsing/other/distanceswitch.h b/modules/globebrowsing/other/distanceswitch.h index 7a884cd5f1..ddff5a156e 100644 --- a/modules/globebrowsing/other/distanceswitch.h +++ b/modules/globebrowsing/other/distanceswitch.h @@ -67,4 +67,4 @@ private: } // namespace globebrowsing } // openspace -#endif //__OPENSPACE_MODULE_GLOBEBROWSING___DISTANCESWITCH___H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___DISTANCESWITCH___H__ diff --git a/modules/globebrowsing/other/statscollector.h b/modules/globebrowsing/other/statscollector.h index 043d2757a5..5d12d3159c 100644 --- a/modules/globebrowsing/other/statscollector.h +++ b/modules/globebrowsing/other/statscollector.h @@ -121,4 +121,4 @@ private: #include "statscollector.inl" -#endif // __OPENSPACE_MODULE_GLOBEBROWSING___STATS_TRACKER___H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___STATS_TRACKER___H__ diff --git a/modules/globebrowsing/rendering/chunkrenderer.h b/modules/globebrowsing/rendering/chunkrenderer.h index 7a4c3ef41a..026263905f 100644 --- a/modules/globebrowsing/rendering/chunkrenderer.h +++ b/modules/globebrowsing/rendering/chunkrenderer.h @@ -100,4 +100,4 @@ private: } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING___CHUNK_RENDERER___H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___CHUNK_RENDERER___H__ diff --git a/modules/globebrowsing/rendering/gpulayermanager.h b/modules/globebrowsing/rendering/gpulayermanager.h index f901118286..bc15df9bd5 100644 --- a/modules/globebrowsing/rendering/gpulayermanager.h +++ b/modules/globebrowsing/rendering/gpulayermanager.h @@ -317,4 +317,4 @@ private: } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING___GPU_LAYER_MANAGER___H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___GPU_LAYER_MANAGER___H__ diff --git a/modules/globebrowsing/rendering/layermanager.h b/modules/globebrowsing/rendering/layermanager.h index 964545ee31..6ec735b455 100644 --- a/modules/globebrowsing/rendering/layermanager.h +++ b/modules/globebrowsing/rendering/layermanager.h @@ -129,4 +129,4 @@ private: } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING___LAYERMANAGER___H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___LAYERMANAGER___H__ diff --git a/modules/globebrowsing/rendering/layershadermanager.h b/modules/globebrowsing/rendering/layershadermanager.h index 03b0cc1d40..12074ab1ee 100644 --- a/modules/globebrowsing/rendering/layershadermanager.h +++ b/modules/globebrowsing/rendering/layershadermanager.h @@ -104,4 +104,4 @@ private: } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING___LAYER_SHADER_MANAGER___H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___LAYER_SHADER_MANAGER___H__ diff --git a/modules/globebrowsing/tile/asynctilereader.h b/modules/globebrowsing/tile/asynctilereader.h index d24f8d98b2..1e34209002 100644 --- a/modules/globebrowsing/tile/asynctilereader.h +++ b/modules/globebrowsing/tile/asynctilereader.h @@ -107,4 +107,4 @@ private: } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING___ASYNC_TILE_DATA_PROVIDER___H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___ASYNC_TILE_DATA_PROVIDER___H__ diff --git a/modules/globebrowsing/tile/chunktile.h b/modules/globebrowsing/tile/chunktile.h index 071c605616..313c92965e 100644 --- a/modules/globebrowsing/tile/chunktile.h +++ b/modules/globebrowsing/tile/chunktile.h @@ -46,4 +46,4 @@ struct ChunkTilePile { } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING___CHUNKTILE___H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___CHUNKTILE___H__ diff --git a/modules/globebrowsing/tile/pixelregion.h b/modules/globebrowsing/tile/pixelregion.h index e77d51b289..d364929053 100644 --- a/modules/globebrowsing/tile/pixelregion.h +++ b/modules/globebrowsing/tile/pixelregion.h @@ -103,4 +103,4 @@ struct PixelRegion { } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING___PIXELREGION___H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___PIXELREGION___H__ diff --git a/modules/globebrowsing/tile/tile.h b/modules/globebrowsing/tile/tile.h index ccc2bac62a..4c2dc4f7a0 100644 --- a/modules/globebrowsing/tile/tile.h +++ b/modules/globebrowsing/tile/tile.h @@ -140,4 +140,4 @@ struct Tile { } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING___TILE___H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___TILE___H__ diff --git a/modules/globebrowsing/tile/tiledataset.h b/modules/globebrowsing/tile/tiledataset.h index 7fc27bff82..84a685271b 100644 --- a/modules/globebrowsing/tile/tiledataset.h +++ b/modules/globebrowsing/tile/tiledataset.h @@ -195,4 +195,4 @@ private: } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING___TILE_DATASET___H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___TILE_DATASET___H__ diff --git a/modules/globebrowsing/tile/tiledatatype.h b/modules/globebrowsing/tile/tiledatatype.h index 8b26bc7e19..e69fb50673 100644 --- a/modules/globebrowsing/tile/tiledatatype.h +++ b/modules/globebrowsing/tile/tiledatatype.h @@ -51,4 +51,4 @@ struct TileDataType { } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING___TILE_DATA_TYPE___H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___TILE_DATA_TYPE___H__ diff --git a/modules/globebrowsing/tile/tilediskcache.h b/modules/globebrowsing/tile/tilediskcache.h index 9abb901573..cacff0ab89 100644 --- a/modules/globebrowsing/tile/tilediskcache.h +++ b/modules/globebrowsing/tile/tilediskcache.h @@ -60,4 +60,4 @@ private: } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING___TILE_DISK_CACHE___H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___TILE_DISK_CACHE___H__ diff --git a/modules/globebrowsing/tile/tileprovider/cachingtileprovider.h b/modules/globebrowsing/tile/tileprovider/cachingtileprovider.h index cb7a6fd56a..2263b1d10e 100644 --- a/modules/globebrowsing/tile/tileprovider/cachingtileprovider.h +++ b/modules/globebrowsing/tile/tileprovider/cachingtileprovider.h @@ -95,4 +95,4 @@ private: } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING___CACHING_TILE_PROVIDER___H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___CACHING_TILE_PROVIDER___H__ diff --git a/modules/globebrowsing/tile/tileprovider/singleimageprovider.h b/modules/globebrowsing/tile/tileprovider/singleimageprovider.h index 33f30635e2..e5c4b8ad7b 100644 --- a/modules/globebrowsing/tile/tileprovider/singleimageprovider.h +++ b/modules/globebrowsing/tile/tileprovider/singleimageprovider.h @@ -54,4 +54,4 @@ private: } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING___SINGLE_IMAGE_PROVIDER___H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___SINGLE_IMAGE_PROVIDER___H__ diff --git a/modules/globebrowsing/tile/tileprovider/temporaltileprovider.h b/modules/globebrowsing/tile/tileprovider/temporaltileprovider.h index 09b7f64e06..7733393561 100644 --- a/modules/globebrowsing/tile/tileprovider/temporaltileprovider.h +++ b/modules/globebrowsing/tile/tileprovider/temporaltileprovider.h @@ -295,4 +295,4 @@ private: } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING___TEMPORAL_TILE_PROVIDER___H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___TEMPORAL_TILE_PROVIDER___H__ diff --git a/modules/globebrowsing/tile/tileprovider/texttileprovider.h b/modules/globebrowsing/tile/tileprovider/texttileprovider.h index 1db21fa6fa..4d952cab21 100644 --- a/modules/globebrowsing/tile/tileprovider/texttileprovider.h +++ b/modules/globebrowsing/tile/tileprovider/texttileprovider.h @@ -134,4 +134,4 @@ private: } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING___TEXT_TILE_PROVIDER___H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___TEXT_TILE_PROVIDER___H__ diff --git a/modules/globebrowsing/tile/tileprovider/tileprovider.h b/modules/globebrowsing/tile/tileprovider/tileprovider.h index 8d2e1008ff..a46bf100cd 100644 --- a/modules/globebrowsing/tile/tileprovider/tileprovider.h +++ b/modules/globebrowsing/tile/tileprovider/tileprovider.h @@ -146,4 +146,4 @@ using TileCache = LRUCache; } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING___TILE_PROVIDER___H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___TILE_PROVIDER___H__ diff --git a/modules/globebrowsing/tile/tileprovider/tileproviderbyindex.h b/modules/globebrowsing/tile/tileprovider/tileproviderbyindex.h index 58673ad5ee..a4d9a3bc66 100644 --- a/modules/globebrowsing/tile/tileprovider/tileproviderbyindex.h +++ b/modules/globebrowsing/tile/tileprovider/tileproviderbyindex.h @@ -54,4 +54,4 @@ private: } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING___TILE_PROVIDER_BY_INDEX___H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___TILE_PROVIDER_BY_INDEX___H__ diff --git a/modules/globebrowsing/tile/tileprovider/tileproviderbylevel.h b/modules/globebrowsing/tile/tileprovider/tileproviderbylevel.h index 05c9dba3b3..8419f30523 100644 --- a/modules/globebrowsing/tile/tileprovider/tileproviderbylevel.h +++ b/modules/globebrowsing/tile/tileprovider/tileproviderbylevel.h @@ -54,4 +54,4 @@ private: } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING___TILE_PROVIDER_BY_LEVEL___H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___TILE_PROVIDER_BY_LEVEL___H__ diff --git a/modules/globebrowsing/tile/tileselector.h b/modules/globebrowsing/tile/tileselector.h index 61f6ee2cc1..2faaa7a5a1 100644 --- a/modules/globebrowsing/tile/tileselector.h +++ b/modules/globebrowsing/tile/tileselector.h @@ -49,4 +49,4 @@ public: } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING___TILE_SELECTOR___H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___TILE_SELECTOR___H__ diff --git a/modules/iswa/rendering/datacygnet.h b/modules/iswa/rendering/datacygnet.h index f31cf037e3..fcd5f2389f 100644 --- a/modules/iswa/rendering/datacygnet.h +++ b/modules/iswa/rendering/datacygnet.h @@ -113,4 +113,4 @@ private: } //namespace openspace -#endif //__OPENSPACE_MODULE_ISWA___DATACYGNET___H__ +#endif // __OPENSPACE_MODULE_ISWA___DATACYGNET___H__ diff --git a/modules/iswa/rendering/dataplane.h b/modules/iswa/rendering/dataplane.h index 7a6b998691..149ba8f2d2 100644 --- a/modules/iswa/rendering/dataplane.h +++ b/modules/iswa/rendering/dataplane.h @@ -59,4 +59,4 @@ private: } // namespace openspace -#endif //__OPENSPACE_MODULE_ISWA___DATAPLANE___H__ +#endif // __OPENSPACE_MODULE_ISWA___DATAPLANE___H__ diff --git a/modules/iswa/rendering/datasphere.h b/modules/iswa/rendering/datasphere.h index f85c0da21e..57aac2fcfd 100644 --- a/modules/iswa/rendering/datasphere.h +++ b/modules/iswa/rendering/datasphere.h @@ -58,4 +58,4 @@ protected: } // namespace openspace -#endif //__OPENSPACE_MODULE_ISWA___DATASPHERE___H__ +#endif // __OPENSPACE_MODULE_ISWA___DATASPHERE___H__ diff --git a/modules/iswa/rendering/kameleonplane.h b/modules/iswa/rendering/kameleonplane.h index fb8ad4016b..4b6be6c4c3 100644 --- a/modules/iswa/rendering/kameleonplane.h +++ b/modules/iswa/rendering/kameleonplane.h @@ -106,4 +106,4 @@ private: } // namespace openspace -#endif //__OPENSPACE_MODULE_ISWA___KAMELEONPLANE___H__ +#endif // __OPENSPACE_MODULE_ISWA___KAMELEONPLANE___H__ diff --git a/modules/iswa/rendering/screenspacecygnet.h b/modules/iswa/rendering/screenspacecygnet.h index afc52d7769..924a74fc70 100644 --- a/modules/iswa/rendering/screenspacecygnet.h +++ b/modules/iswa/rendering/screenspacecygnet.h @@ -56,4 +56,4 @@ private: } // namespace openspace -#endif //__OPENSPACE_MODULE_ISWA___SCREENSPACECYGNET___H__ +#endif // __OPENSPACE_MODULE_ISWA___SCREENSPACECYGNET___H__ diff --git a/modules/iswa/rendering/texturecygnet.h b/modules/iswa/rendering/texturecygnet.h index 3bba1b2df0..65351125be 100644 --- a/modules/iswa/rendering/texturecygnet.h +++ b/modules/iswa/rendering/texturecygnet.h @@ -58,4 +58,4 @@ private: }; } //namespace openspace -#endif //__OPENSPACE_MODULE_ISWA___TEXTURECYGNET___H__ +#endif // __OPENSPACE_MODULE_ISWA___TEXTURECYGNET___H__ diff --git a/modules/iswa/util/dataprocessor.h b/modules/iswa/util/dataprocessor.h index 5bcb75bbd4..3f62a8557a 100644 --- a/modules/iswa/util/dataprocessor.h +++ b/modules/iswa/util/dataprocessor.h @@ -78,4 +78,4 @@ protected: } // namespace openspace -#endif //__OPENSPACE_MODULE_ISWA___DATAPROCESSOR___H__ +#endif // __OPENSPACE_MODULE_ISWA___DATAPROCESSOR___H__ diff --git a/modules/iswa/util/dataprocessorjson.h b/modules/iswa/util/dataprocessorjson.h index cec8253430..a2f1a411de 100644 --- a/modules/iswa/util/dataprocessorjson.h +++ b/modules/iswa/util/dataprocessorjson.h @@ -39,6 +39,6 @@ public: virtual std::vector processData(std::string data, properties::SelectionProperty& dataOptions, glm::size3_t& dimensions) override; }; -}// namespace openspace +} // namespace openspace -#endif __OPENSPACE_MODULE_ISWA___DATAPROCESSORJSON___H__ +#endif // __OPENSPACE_MODULE_ISWA___DATAPROCESSORJSON___H__ diff --git a/modules/iswa/util/dataprocessorkameleon.h b/modules/iswa/util/dataprocessorkameleon.h index 891c1eba94..f7206bea11 100644 --- a/modules/iswa/util/dataprocessorkameleon.h +++ b/modules/iswa/util/dataprocessorkameleon.h @@ -54,4 +54,4 @@ private: } // namespace openspace -#endif __OPENSPACE_MODULE_ISWA___DATAPROCESSORKAMELEON___H__ +#endif // __OPENSPACE_MODULE_ISWA___DATAPROCESSORKAMELEON___H__ diff --git a/modules/iswa/util/dataprocessortext.h b/modules/iswa/util/dataprocessortext.h index 3ecf61c68b..6e67aee407 100644 --- a/modules/iswa/util/dataprocessortext.h +++ b/modules/iswa/util/dataprocessortext.h @@ -46,4 +46,4 @@ private: } // namespace openspace -#endif __OPENSPACE_MODULE_ISWA___DATAPROCESSORTEXT___H__ +#endif // __OPENSPACE_MODULE_ISWA___DATAPROCESSORTEXT___H__ diff --git a/modules/iswa/util/iswamanager.h b/modules/iswa/util/iswamanager.h index e7cc410f54..3af0a8048f 100644 --- a/modules/iswa/util/iswamanager.h +++ b/modules/iswa/util/iswamanager.h @@ -139,4 +139,4 @@ private: } //namespace openspace -#endif //__OPENSPACE_MODULE_ISWA___ISWAMANAGER___H__ +#endif // __OPENSPACE_MODULE_ISWA___ISWAMANAGER___H__ diff --git a/modules/multiresvolume/rendering/multiresvolumeraycaster.h b/modules/multiresvolume/rendering/multiresvolumeraycaster.h index 2309cacf98..c08a75e0c4 100644 --- a/modules/multiresvolume/rendering/multiresvolumeraycaster.h +++ b/modules/multiresvolume/rendering/multiresvolumeraycaster.h @@ -95,4 +95,4 @@ private: } // namespace openspace -#endif // __OPENSPACE_MODULE_MULTIRESVOLUME___MULTIRESVOLUMERAYCASTER___H__ +#endif // __OPENSPACE_MODULE_MULTIRESVOLUME___MULTIRESVOLUMERAYCASTER___H__ diff --git a/modules/newhorizons/rendering/renderablemodelprojection.h b/modules/newhorizons/rendering/renderablemodelprojection.h index 59211b9024..5e9fb2d47e 100644 --- a/modules/newhorizons/rendering/renderablemodelprojection.h +++ b/modules/newhorizons/rendering/renderablemodelprojection.h @@ -110,4 +110,4 @@ private: } // namespace openspace -#endif // __OPENSPACE_MODULE_NEWHORIZONS___RENDERABLEMODELPROJECTION___H__ +#endif // __OPENSPACE_MODULE_NEWHORIZONS___RENDERABLEMODELPROJECTION___H__ diff --git a/modules/newhorizons/rendering/renderableplanetprojection.h b/modules/newhorizons/rendering/renderableplanetprojection.h index c44b5a9de0..8c94c4a66b 100644 --- a/modules/newhorizons/rendering/renderableplanetprojection.h +++ b/modules/newhorizons/rendering/renderableplanetprojection.h @@ -103,4 +103,4 @@ private: } // namespace openspace -#endif // __OPENSPACE_MODULE_NEWHORIZONS___RENDERABLEPLANETPROJECTION___H__ +#endif // __OPENSPACE_MODULE_NEWHORIZONS___RENDERABLEPLANETPROJECTION___H__ diff --git a/modules/newhorizons/rendering/writeToTexture.h b/modules/newhorizons/rendering/writeToTexture.h deleted file mode 100644 index b7b1004432..0000000000 --- a/modules/newhorizons/rendering/writeToTexture.h +++ /dev/null @@ -1,71 +0,0 @@ -/***************************************************************************************** - * * - * 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. * - ****************************************************************************************/ - -#ifndef __RENDERABLEPLANET_H__ -#define __RENDERABLEPLANET_H__ - -// open space includes -#include - -#include -#include - -// ghoul includes -#include -#include - -namespace openspace { - -namespace planetgeometry { -class PlanetGeometry; -} - -class RenderablePlanet : public Renderable { -public: - RenderablePlanet(const ghoul::Dictionary& dictionary); - ~RenderablePlanet(); - - bool initialize() override; - bool deinitialize() override; - - void render(const RenderData& data) override; - void update(const UpdateData& data) override; - -protected: - void loadTexture(); - -private: - properties::StringProperty _colorTexturePath; - ghoul::opengl::ProgramObject* _programObject; - ghoul::opengl::Texture* _texture; - planetgeometry::PlanetGeometry* _geometry; - - glm::dmat3 _stateMatrix; - - std::string _target; -}; - -} // namespace openspace - -#endif // __RENDERABLEPLANET_H__ \ No newline at end of file diff --git a/modules/newhorizons/util/hongkangparser.h b/modules/newhorizons/util/hongkangparser.h index 8eb5169670..8a20e21faa 100644 --- a/modules/newhorizons/util/hongkangparser.h +++ b/modules/newhorizons/util/hongkangparser.h @@ -58,4 +58,4 @@ private: } // namespace openspace -#endif //__OPENSPACE_MODULE_NEWHORIZONS___HONGKANGPARSER___H__ +#endif // __OPENSPACE_MODULE_NEWHORIZONS___HONGKANGPARSER___H__ diff --git a/modules/newhorizons/util/instrumenttimesparser.h b/modules/newhorizons/util/instrumenttimesparser.h index 23a08b3f35..0238bb20ec 100644 --- a/modules/newhorizons/util/instrumenttimesparser.h +++ b/modules/newhorizons/util/instrumenttimesparser.h @@ -59,4 +59,4 @@ private: } // namespace openspace -#endif //__OPENSPACE_MODULE_NEWHORIZONS___INSTRUMENTTIMESPARSER___H__ +#endif // __OPENSPACE_MODULE_NEWHORIZONS___INSTRUMENTTIMESPARSER___H__ diff --git a/modules/newhorizons/util/labelparser.h b/modules/newhorizons/util/labelparser.h index 69c6ceaa4b..d55c555022 100644 --- a/modules/newhorizons/util/labelparser.h +++ b/modules/newhorizons/util/labelparser.h @@ -72,4 +72,4 @@ private: } // namespace openspace -#endif //__OPENSPACE_MODULE_NEWHORIZONS___LABELPARSER___H__ +#endif // __OPENSPACE_MODULE_NEWHORIZONS___LABELPARSER___H__ diff --git a/modules/newhorizons/util/sequenceparser.h b/modules/newhorizons/util/sequenceparser.h index 0ecd106149..974046cacb 100644 --- a/modules/newhorizons/util/sequenceparser.h +++ b/modules/newhorizons/util/sequenceparser.h @@ -74,4 +74,4 @@ protected: } // namespace openspace -#endif //__OPENSPACE_MODULE_NEWHORIZONS___SEQUENCEPARSER___H__ +#endif // __OPENSPACE_MODULE_NEWHORIZONS___SEQUENCEPARSER___H__ diff --git a/modules/onscreengui/include/renderproperties.h b/modules/onscreengui/include/renderproperties.h index c1ecb539f8..8f6cb2de88 100644 --- a/modules/onscreengui/include/renderproperties.h +++ b/modules/onscreengui/include/renderproperties.h @@ -54,4 +54,4 @@ void renderTriggerProperty(properties::Property* prop, const std::string& ownerN } // namespace openspace -#endif __OPENSPACE_MODULE_ONSCREENGUI___RENDERPROPERTIES___H__ +#endif // __OPENSPACE_MODULE_ONSCREENGUI___RENDERPROPERTIES___H__ diff --git a/modules/space/rendering/planetgeometry.h b/modules/space/rendering/planetgeometry.h index 1bb73add6c..2d735b79d4 100644 --- a/modules/space/rendering/planetgeometry.h +++ b/modules/space/rendering/planetgeometry.h @@ -53,4 +53,4 @@ protected: } // namespace planetgeometry } // namespace openspace -#endif // __OPENSPACE_MODULE_SPACE___PLANETGEOMETRY___H__ +#endif // __OPENSPACE_MODULE_SPACE___PLANETGEOMETRY___H__ diff --git a/modules/space/rendering/renderableplanet.h b/modules/space/rendering/renderableplanet.h index 7a83462834..9c2bd4d08a 100644 --- a/modules/space/rendering/renderableplanet.h +++ b/modules/space/rendering/renderableplanet.h @@ -111,6 +111,6 @@ private: bool tempPic; }; -} // namespace openspace +} // namespace openspace -#endif // __OPENSPACE_MODULE_SPACE___RENDERABLEPLANET___H__ +#endif // __OPENSPACE_MODULE_SPACE___RENDERABLEPLANET___H__ diff --git a/modules/space/rendering/renderablestars.h b/modules/space/rendering/renderablestars.h index bd8b7d3f80..0f79e88924 100644 --- a/modules/space/rendering/renderablestars.h +++ b/modules/space/rendering/renderablestars.h @@ -105,4 +105,4 @@ private: } // namespace openspace -#endif // __OPENSPACE_MODULE_SPACE___RENDERABLESTARS___H__ +#endif // __OPENSPACE_MODULE_SPACE___RENDERABLESTARS___H__ diff --git a/modules/toyvolume/rendering/toyvolumeraycaster.h b/modules/toyvolume/rendering/toyvolumeraycaster.h index 9a8848ad55..08569987bf 100644 --- a/modules/toyvolume/rendering/toyvolumeraycaster.h +++ b/modules/toyvolume/rendering/toyvolumeraycaster.h @@ -77,4 +77,4 @@ private: } // openspace -#endif // __OPENSPACE_MODULE_TOYVOLUME___TOYVOLUMERAYCASTER___H__ +#endif // __OPENSPACE_MODULE_TOYVOLUME___TOYVOLUMERAYCASTER___H__ diff --git a/modules/volume/rendering/renderablevolume.h b/modules/volume/rendering/renderablevolume.h index 1b82fa25a5..4ef03bbe72 100644 --- a/modules/volume/rendering/renderablevolume.h +++ b/modules/volume/rendering/renderablevolume.h @@ -60,4 +60,4 @@ private: } // namespace openspace -#endif +#endif // __RENDERABLEVOLUME_H__ diff --git a/modules/volume/rendering/renderablevolumegl.h b/modules/volume/rendering/renderablevolumegl.h index c3d484edad..99e6efe9f3 100644 --- a/modules/volume/rendering/renderablevolumegl.h +++ b/modules/volume/rendering/renderablevolumegl.h @@ -83,4 +83,4 @@ private: } // namespace openspace -#endif +#endif // __RENDERABLEVOLUMEGL_H__ From ea485fd4182b539bfd75d1799e94bc68c7849dd4 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Thu, 9 Feb 2017 22:20:17 -0500 Subject: [PATCH 11/96] More include guard fixes --- apps/DataConverter/conversiontask.h | 1 + apps/DataConverter/milkywayconversiontask.h | 1 + apps/DataConverter/milkywaypointsconversiontask.h | 1 + apps/Launcher/infowidget.h | 6 +++--- apps/Launcher/mainwindow.h | 6 +++--- apps/Launcher/shortcutwidget.h | 6 +++--- apps/Launcher/syncwidget.h | 6 +++--- apps/TimelineView/configurationwidget.h | 6 +++--- apps/TimelineView/controlwidget.h | 6 +++--- apps/TimelineView/informationwidget.h | 6 +++--- apps/TimelineView/mainwindow.h | 6 +++--- apps/TimelineView/timelinewidget.h | 6 +++--- 12 files changed, 30 insertions(+), 27 deletions(-) diff --git a/apps/DataConverter/conversiontask.h b/apps/DataConverter/conversiontask.h index 5e9d4b6ce2..218336c509 100644 --- a/apps/DataConverter/conversiontask.h +++ b/apps/DataConverter/conversiontask.h @@ -1,3 +1,4 @@ + #ifndef __CONVERSIONTASK_H__ #define __CONVERSIONTASK_H__ diff --git a/apps/DataConverter/milkywayconversiontask.h b/apps/DataConverter/milkywayconversiontask.h index 30cf16e824..7d0db7105e 100644 --- a/apps/DataConverter/milkywayconversiontask.h +++ b/apps/DataConverter/milkywayconversiontask.h @@ -1,3 +1,4 @@ + #ifndef __MILKYWAYCONVERSIONTASK_H__ #define __MILKYWAYCONVERSIONTASK_H__ diff --git a/apps/DataConverter/milkywaypointsconversiontask.h b/apps/DataConverter/milkywaypointsconversiontask.h index 795425646f..e142282374 100644 --- a/apps/DataConverter/milkywaypointsconversiontask.h +++ b/apps/DataConverter/milkywaypointsconversiontask.h @@ -1,3 +1,4 @@ + #ifndef __MILKYWAYPOINTSCONVERSIONTASK_H__ #define __MILKYWAYPOINTSCONVERSIONTASK_H__ diff --git a/apps/Launcher/infowidget.h b/apps/Launcher/infowidget.h index 967e22de43..9bbc17e1a6 100644 --- a/apps/Launcher/infowidget.h +++ b/apps/Launcher/infowidget.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __INFOWIDGET_H__ -#define __INFOWIDGET_H__ +#ifndef __OPENSPACE_APP_LAUNCHER___INFOWIDGET___H__ +#define __OPENSPACE_APP_LAUNCHER___INFOWIDGET___H__ //#include #include @@ -58,4 +58,4 @@ private: int _totalBytes; }; -#endif // __INFOWIDGET_H__ +#endif // __OPENSPACE_APP_LAUNCHER___INFOWIDGET___H__ diff --git a/apps/Launcher/mainwindow.h b/apps/Launcher/mainwindow.h index 60fd0f1aa2..9fd2626d4d 100644 --- a/apps/Launcher/mainwindow.h +++ b/apps/Launcher/mainwindow.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __MAINWINDOW_H__ -#define __MAINWINDOW_H__ +#ifndef __OPENSPACE_APP_LAUNCHER___MAINWINDOW___H__ +#define __OPENSPACE_APP_LAUNCHER___MAINWINDOW___H__ #include @@ -112,4 +112,4 @@ private: // bool _hasLabelTimeline = false; //}; -#endif // __MAINWINDOW_H__ +#endif // __OPENSPACE_APP_LAUNCHER___MAINWINDOW___H__ diff --git a/apps/Launcher/shortcutwidget.h b/apps/Launcher/shortcutwidget.h index ad4ff319b0..82d96fa118 100644 --- a/apps/Launcher/shortcutwidget.h +++ b/apps/Launcher/shortcutwidget.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __SHORTCUTWIDGET_H__ -#define __SHORTCUTWIDGET_H__ +#ifndef __OPENSPACE_APP_LAUNCHER___SHORTCUTWIDGET___H__ +#define __OPENSPACE_APP_LAUNCHER___SHORTCUTWIDGET___H__ #include @@ -33,4 +33,4 @@ public: ShortcutWidget(QWidget* parent, Qt::WindowFlags f = 0); }; -#endif // __SHORTCUTWIDGET_H__ +#endif // __OPENSPACE_APP_LAUNCHER___SHORTCUTWIDGET___H__ diff --git a/apps/Launcher/syncwidget.h b/apps/Launcher/syncwidget.h index 8f2c203c13..f9a77e2861 100644 --- a/apps/Launcher/syncwidget.h +++ b/apps/Launcher/syncwidget.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __SYNCWIDGET_H__ -#define __SYNCWIDGET_H__ +#ifndef __OPENSPACE_APP_LAUNCHER___SYNCWIDGET___H__ +#define __OPENSPACE_APP_LAUNCHER___SYNCWIDGET___H__ #include @@ -121,4 +121,4 @@ private: }; -#endif // __SYNCWIDGET_H__ +#endif // __OPENSPACE_APP_LAUNCHER___SYNCWIDGET___H__ diff --git a/apps/TimelineView/configurationwidget.h b/apps/TimelineView/configurationwidget.h index 1f7ff034c2..2d0c9e44d8 100644 --- a/apps/TimelineView/configurationwidget.h +++ b/apps/TimelineView/configurationwidget.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __CONFIGURATIONWIDGET_H__ -#define __CONFIGURATIONWIDGET_H__ +#ifndef __OPENSPACE_APP_TIMELINEVIEW___CONFIGURATIONWIDGET___H__ +#define __OPENSPACE_APP_TIMELINEVIEW___CONFIGURATIONWIDGET___H__ #include #include @@ -50,4 +50,4 @@ private: QPushButton* _connect; }; -#endif // __CONFIGURATIONWIDGET_H__ +#endif // __OPENSPACE_APP_TIMELINEVIEW___CONFIGURATIONWIDGET___H__ diff --git a/apps/TimelineView/controlwidget.h b/apps/TimelineView/controlwidget.h index 5c6e99e5df..d7d946cc50 100644 --- a/apps/TimelineView/controlwidget.h +++ b/apps/TimelineView/controlwidget.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __CONTROLWIDGET_H__ -#define __CONTROLWIDGET_H__ +#ifndef __OPENSPACE_APP_TIMELINEVIEW___CONTROLWIDGET___H__ +#define __OPENSPACE_APP_TIMELINEVIEW___CONTROLWIDGET___H__ #include @@ -66,4 +66,4 @@ private: QPushButton* _setFocusToNewHorizons; }; -#endif // __CONTROLWIDGET_H__ +#endif // __OPENSPACE_APP_TIMELINEVIEW___CONTROLWIDGET___H__ diff --git a/apps/TimelineView/informationwidget.h b/apps/TimelineView/informationwidget.h index 811151a415..09929dcabd 100644 --- a/apps/TimelineView/informationwidget.h +++ b/apps/TimelineView/informationwidget.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __INFORMATIONWIDGET_H__ -#define __INFORMATIONWIDGET_H__ +#ifndef __OPENSPACE_APP_TIMELINEVIEW___INFORMATIONWIDGET___H__ +#define __OPENSPACE_APP_TIMELINEVIEW___INFORMATIONWIDGET___H__ #include @@ -38,4 +38,4 @@ public slots: void logInformation(QString text); }; -#endif // __INFORMATIONWIDGET_H__ +#endif // __OPENSPACE_APP_TIMELINEVIEW___INFORMATIONWIDGET___H__ diff --git a/apps/TimelineView/mainwindow.h b/apps/TimelineView/mainwindow.h index 9c23cf8448..5a74e197f2 100644 --- a/apps/TimelineView/mainwindow.h +++ b/apps/TimelineView/mainwindow.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __MAINWINDOW_H__ -#define __MAINWINDOW_H__ +#ifndef __OPENSPACE_APP_TIMELINEVIEW___MAINWINDOW___H__ +#define __OPENSPACE_APP_TIMELINEVIEW___MAINWINDOW___H__ #include #include @@ -71,4 +71,4 @@ private: bool _isConnected = false; }; -#endif // __MAINWINDOW_H__ +#endif // __OPENSPACE_APP_TIMELINEVIEW___MAINWINDOW___H__ diff --git a/apps/TimelineView/timelinewidget.h b/apps/TimelineView/timelinewidget.h index be3a880d00..38294ccac0 100644 --- a/apps/TimelineView/timelinewidget.h +++ b/apps/TimelineView/timelinewidget.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __TIMELINEWIDGET_H__ -#define __TIMELINEWIDGET_H__ +#ifndef __OPENSPACE_APP_TIMELINEVIEW___TIMELINEWIDGET___H__ +#define __OPENSPACE_APP_TIMELINEVIEW___TIMELINEWIDGET___H__ #include @@ -67,4 +67,4 @@ private: } _currentTime; }; -#endif // __TIMELINEWIDGET_H__ +#endif // __OPENSPACE_APP_TIMELINEVIEW___TIMELINEWIDGET___H__ From 23ea86949f44fec38e860c15f87a8d2957f613e6 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Thu, 9 Feb 2017 23:55:39 -0500 Subject: [PATCH 12/96] Updated `check_style_guide` to test for include guards and copyright notices - Fix include guards - Fix copyright header indentation - Update copyright years --- apps/DataConverter/conversiontask.h | 33 ++++- apps/DataConverter/milkywayconversiontask.cpp | 24 ++++ apps/DataConverter/milkywayconversiontask.h | 33 ++++- .../milkywaypointsconversiontask.cpp | 24 ++++ .../milkywaypointsconversiontask.h | 33 ++++- apps/TimelineView/common.h | 8 +- apps/TimelineView/configurationwidget.cpp | 2 +- apps/TimelineView/configurationwidget.h | 2 +- apps/TimelineView/controlwidget.cpp | 2 +- apps/TimelineView/controlwidget.h | 2 +- apps/TimelineView/informationwidget.cpp | 2 +- apps/TimelineView/informationwidget.h | 2 +- apps/TimelineView/main.cpp | 2 +- apps/TimelineView/mainwindow.cpp | 2 +- apps/TimelineView/mainwindow.h | 2 +- apps/TimelineView/timelinewidget.cpp | 2 +- apps/TimelineView/timelinewidget.h | 2 +- ext/ghoul | 2 +- include/openspace/network/networkengine.h | 6 +- include/openspace/properties/ucharproperty.h | 53 -------- include/openspace/properties/uintproperty.h | 53 -------- include/openspace/properties/wcharproperty.h | 53 -------- include/openspace/scripting/script_helper.h | 6 +- include/openspace/util/camera.h | 44 +++---- include/openspace/util/histogram.h | 2 +- include/openspace/util/timemanager.h | 44 +++---- .../openspace/util/transformationmanager.h | 44 +++---- modules/base/rendering/wavefrontgeometry.h | 10 +- modules/globebrowsing/meshes/basicgrid.h | 44 +++---- .../globebrowsing/tile/tiledepthtransform.h | 44 +++---- modules/kameleon/src/kameleonwrapper.cpp | 2 +- modules/newhorizons/newhorizonsmodule.h | 6 +- modules/volume/rendering/renderablevolume.cpp | 2 +- modules/volume/rendering/renderablevolume.h | 8 +- .../volume/rendering/renderablevolumegl.cpp | 2 +- modules/volume/rendering/renderablevolumegl.h | 8 +- src/rendering/transferfunction.cpp | 2 +- ..._include_guard.py => check_style_guide.py} | 117 +++++++++++------- 38 files changed, 360 insertions(+), 369 deletions(-) delete mode 100644 include/openspace/properties/ucharproperty.h delete mode 100644 include/openspace/properties/uintproperty.h delete mode 100644 include/openspace/properties/wcharproperty.h rename support/coding/{check_include_guard.py => check_style_guide.py} (68%) diff --git a/apps/DataConverter/conversiontask.h b/apps/DataConverter/conversiontask.h index 218336c509..388088977f 100644 --- a/apps/DataConverter/conversiontask.h +++ b/apps/DataConverter/conversiontask.h @@ -1,6 +1,29 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ -#ifndef __CONVERSIONTASK_H__ -#define __CONVERSIONTASK_H__ +#ifndef __OPENSPACE_APP_DATACONVERTER___CONVERSIONTASK___H__ +#define __OPENSPACE_APP_DATACONVERTER___CONVERSIONTASK___H__ #include @@ -12,7 +35,7 @@ public: virtual void perform(const std::function& onProgress) = 0; }; -} -} +} // namespace dataconverter +} // namespace openspace -#endif // __CONVERSIONTASK_H__ +#endif // __OPENSPACE_APP_DATACONVERTER___CONVERSIONTASK___H__ diff --git a/apps/DataConverter/milkywayconversiontask.cpp b/apps/DataConverter/milkywayconversiontask.cpp index 6537070b8e..72482738a6 100644 --- a/apps/DataConverter/milkywayconversiontask.cpp +++ b/apps/DataConverter/milkywayconversiontask.cpp @@ -1,3 +1,27 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + #include #include #include diff --git a/apps/DataConverter/milkywayconversiontask.h b/apps/DataConverter/milkywayconversiontask.h index 7d0db7105e..f3952d312c 100644 --- a/apps/DataConverter/milkywayconversiontask.h +++ b/apps/DataConverter/milkywayconversiontask.h @@ -1,6 +1,29 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ -#ifndef __MILKYWAYCONVERSIONTASK_H__ -#define __MILKYWAYCONVERSIONTASK_H__ +#ifndef __OPENSPACE_APP_DATACONVERTER___MILKYWAYCONVERSIONTASK___H__ +#define __OPENSPACE_APP_DATACONVERTER___MILKYWAYCONVERSIONTASK___H__ #include #include @@ -36,7 +59,7 @@ private: glm::ivec3 _outDimensions; }; -} -} +} // namespace dataconverter +} // namespace openspace -#endif // __MILKYWAYCONVERSIONTASK_H__ +#endif // __OPENSPACE_APP_DATACONVERTER___MILKYWAYCONVERSIONTASK___H__ diff --git a/apps/DataConverter/milkywaypointsconversiontask.cpp b/apps/DataConverter/milkywaypointsconversiontask.cpp index 0287bbf80b..790d2be279 100644 --- a/apps/DataConverter/milkywaypointsconversiontask.cpp +++ b/apps/DataConverter/milkywaypointsconversiontask.cpp @@ -1,3 +1,27 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + #include #include #include diff --git a/apps/DataConverter/milkywaypointsconversiontask.h b/apps/DataConverter/milkywaypointsconversiontask.h index e142282374..47ab744e8e 100644 --- a/apps/DataConverter/milkywaypointsconversiontask.h +++ b/apps/DataConverter/milkywaypointsconversiontask.h @@ -1,6 +1,29 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ -#ifndef __MILKYWAYPOINTSCONVERSIONTASK_H__ -#define __MILKYWAYPOINTSCONVERSIONTASK_H__ +#ifndef __OPENSPACE_APP_DATACONVERTER___MILKYWAYPOINTSCONVERSIONTASK___H__ +#define __OPENSPACE_APP_DATACONVERTER___MILKYWAYPOINTSCONVERSIONTASK___H__ #include #include @@ -30,7 +53,7 @@ private: std::string _outFilename; }; -} -} +} // namespace dataconverter +} // namespace openspace -#endif // __MILKYWAYPOINTSCONVERSIONTASK_H__ +#endif // __OPENSPACE_APP_DATACONVERTER___MILKYWAYPOINTSCONVERSIONTASK___H__ diff --git a/apps/TimelineView/common.h b/apps/TimelineView/common.h index ddc0bad206..bf0506a02a 100644 --- a/apps/TimelineView/common.h +++ b/apps/TimelineView/common.h @@ -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,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __COMMON_H__ -#define __COMMON_H__ +#ifndef __OPENSPACE_APP_TIMELINEVIEW___COMMON___H__ +#define __OPENSPACE_APP_TIMELINEVIEW___COMMON___H__ struct Image { double beginning; @@ -34,4 +34,4 @@ struct Image { std::vector instruments; }; -#endif // __COMMON_H__ +#endif // __OPENSPACE_APP_TIMELINEVIEW___COMMON___H__ diff --git a/apps/TimelineView/configurationwidget.cpp b/apps/TimelineView/configurationwidget.cpp index 97961abf20..9537b21953 100644 --- a/apps/TimelineView/configurationwidget.cpp +++ b/apps/TimelineView/configurationwidget.cpp @@ -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 * diff --git a/apps/TimelineView/configurationwidget.h b/apps/TimelineView/configurationwidget.h index 2d0c9e44d8..4b59ddd8f0 100644 --- a/apps/TimelineView/configurationwidget.h +++ b/apps/TimelineView/configurationwidget.h @@ -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 * diff --git a/apps/TimelineView/controlwidget.cpp b/apps/TimelineView/controlwidget.cpp index b082de3f13..010e00a9cd 100644 --- a/apps/TimelineView/controlwidget.cpp +++ b/apps/TimelineView/controlwidget.cpp @@ -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 * diff --git a/apps/TimelineView/controlwidget.h b/apps/TimelineView/controlwidget.h index d7d946cc50..da52b729fb 100644 --- a/apps/TimelineView/controlwidget.h +++ b/apps/TimelineView/controlwidget.h @@ -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 * diff --git a/apps/TimelineView/informationwidget.cpp b/apps/TimelineView/informationwidget.cpp index ac7ae9935a..ca357ff538 100644 --- a/apps/TimelineView/informationwidget.cpp +++ b/apps/TimelineView/informationwidget.cpp @@ -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 * diff --git a/apps/TimelineView/informationwidget.h b/apps/TimelineView/informationwidget.h index 09929dcabd..5d87292856 100644 --- a/apps/TimelineView/informationwidget.h +++ b/apps/TimelineView/informationwidget.h @@ -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 * diff --git a/apps/TimelineView/main.cpp b/apps/TimelineView/main.cpp index f9bd72520c..420f02fcd7 100644 --- a/apps/TimelineView/main.cpp +++ b/apps/TimelineView/main.cpp @@ -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 * diff --git a/apps/TimelineView/mainwindow.cpp b/apps/TimelineView/mainwindow.cpp index dc5e623e88..088f4f3a95 100644 --- a/apps/TimelineView/mainwindow.cpp +++ b/apps/TimelineView/mainwindow.cpp @@ -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 * diff --git a/apps/TimelineView/mainwindow.h b/apps/TimelineView/mainwindow.h index 5a74e197f2..5bb3774885 100644 --- a/apps/TimelineView/mainwindow.h +++ b/apps/TimelineView/mainwindow.h @@ -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 * diff --git a/apps/TimelineView/timelinewidget.cpp b/apps/TimelineView/timelinewidget.cpp index 791e90dba1..1003a82d24 100644 --- a/apps/TimelineView/timelinewidget.cpp +++ b/apps/TimelineView/timelinewidget.cpp @@ -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 * diff --git a/apps/TimelineView/timelinewidget.h b/apps/TimelineView/timelinewidget.h index 38294ccac0..3ad24c33b5 100644 --- a/apps/TimelineView/timelinewidget.h +++ b/apps/TimelineView/timelinewidget.h @@ -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 * diff --git a/ext/ghoul b/ext/ghoul index 1e6400a9e6..151b528b94 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 1e6400a9e6d5a4e0b8d2fd656a06168b40ef0f71 +Subproject commit 151b528b94bb4670e52b5e32342da0100cc3e078 diff --git a/include/openspace/network/networkengine.h b/include/openspace/network/networkengine.h index dc0a06de0d..8d0008b406 100644 --- a/include/openspace/network/networkengine.h +++ b/include/openspace/network/networkengine.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef PARALLELCONNECTION__OPENSPACE_CORE___NETWORKENGINE___H__ -#define PARALLELCONNECTION__OPENSPACE_CORE___NETWORKENGINE___H__ +#ifndef __OPENSPACE_CORE___NETWORKENGINE___H__ +#define __OPENSPACE_CORE___NETWORKENGINE___H__ #include #include @@ -75,4 +75,4 @@ private: } // namespace openspace -#endif // PARALLELCONNECTION__OPENSPACE_CORE___NETWORKENGINE___H__ +#endif // __OPENSPACE_CORE___NETWORKENGINE___H__ diff --git a/include/openspace/properties/ucharproperty.h b/include/openspace/properties/ucharproperty.h deleted file mode 100644 index f08278b23e..0000000000 --- a/include/openspace/properties/ucharproperty.h +++ /dev/null @@ -1,53 +0,0 @@ -/***************************************************************************************** - * * - * 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. * - ****************************************************************************************/ - -#ifndef __UCHARPROPERTY_H__ -#define __UCHARPROPERTY_H__ - - /** - * \file ucharproperty.h - * - * \addtogroup openspace - * @{ - * \addtogroup properties - * @{ - - * \class UCharProperty - * This class is a concrete implementation of openspace::properties::TemplateProperty with - * the type unsigned char. - - * @} @} - */ - -#include "openspace/properties/numericalproperty.h" - -namespace openspace { -namespace properties { - -REGISTER_NUMERICALPROPERTY_HEADER(UCharProperty, unsigned char); - -} // namespace properties -} // namespace openspace - -#endif // __UCHARPROPERTY_H__ diff --git a/include/openspace/properties/uintproperty.h b/include/openspace/properties/uintproperty.h deleted file mode 100644 index f5a97eac3c..0000000000 --- a/include/openspace/properties/uintproperty.h +++ /dev/null @@ -1,53 +0,0 @@ -/***************************************************************************************** - * * - * 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. * - ****************************************************************************************/ - -#ifndef __UINTPROPERTY_H__ -#define __UINTPROPERTY_H__ - - /** - * \file uintproperty.h - * - * \addtogroup openspace - * @{ - * \addtogroup properties - * @{ - - * \class UIntProperty - * This class is a concrete implementation of openspace::properties::TemplateProperty with - * the type unsigned int. - - * @} @} - */ - -#include "openspace/properties/numericalproperty.h" - -namespace openspace { -namespace properties { - -REGISTER_NUMERICALPROPERTY_HEADER(UIntProperty, unsigned int); - -} // namespace properties -} // namespace openspace - -#endif // __UINTPROPERTY_H__ diff --git a/include/openspace/properties/wcharproperty.h b/include/openspace/properties/wcharproperty.h deleted file mode 100644 index 231b8e3c05..0000000000 --- a/include/openspace/properties/wcharproperty.h +++ /dev/null @@ -1,53 +0,0 @@ -/***************************************************************************************** - * * - * 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. * - ****************************************************************************************/ - -#ifndef __WCHARPROPERTY_H__ -#define __WCHARPROPERTY_H__ - - /** - * \file wcharproperty.h - * - * \addtogroup openspace - * @{ - * \addtogroup properties - * @{ - - * \class WCharProperty - * This class is a concrete implementation of openspace::properties::TemplateProperty with - * the type wchar_t. - - * @} @} - */ - -#include "openspace/properties/numericalproperty.h" - -namespace openspace { -namespace properties { - -//REGISTER_NUMERICALPROPERTY_HEADER(WCharProperty, wchar_t); - -} // namespace properties -} // namespace openspace - -#endif // __WCHARPROPERTY_H__ diff --git a/include/openspace/scripting/script_helper.h b/include/openspace/scripting/script_helper.h index 01f2f7b352..4241e0e81f 100644 --- a/include/openspace/scripting/script_helper.h +++ b/include/openspace/scripting/script_helper.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __SCRIPT_HELPER_H__ -#define __SCRIPT_HELPER_H__ +#ifndef __OPENSPACE_CORE___SCRIPTHELPER___H__ +#define __OPENSPACE_CORE___SCRIPTHELPER___H__ #define SCRIPT_CHECK_ARGUMENTS(__category__, __stack__, __reqArg__, __realArg__) \ if (__realArg__ != __reqArg__) { \ @@ -33,4 +33,4 @@ } -#endif // __SCRIPT_HELPER_H__ +#endif // __OPENSPACE_CORE___SCRIPTHELPER___H__ diff --git a/include/openspace/util/camera.h b/include/openspace/util/camera.h index 87184d080d..b67d82feab 100644 --- a/include/openspace/util/camera.h +++ b/include/openspace/util/camera.h @@ -1,26 +1,26 @@ /***************************************************************************************** -* * -* 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. * + ****************************************************************************************/ #ifndef __OPENSPACE_CORE___CAMERA___H__ #define __OPENSPACE_CORE___CAMERA___H__ diff --git a/include/openspace/util/histogram.h b/include/openspace/util/histogram.h index 92e807f441..20ee8304cd 100644 --- a/include/openspace/util/histogram.h +++ b/include/openspace/util/histogram.h @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2015 * + * Copyright (c) 2015-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 * diff --git a/include/openspace/util/timemanager.h b/include/openspace/util/timemanager.h index fb9468bcc9..376e8d35e5 100644 --- a/include/openspace/util/timemanager.h +++ b/include/openspace/util/timemanager.h @@ -1,26 +1,26 @@ /***************************************************************************************** -* * -* 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. * + ****************************************************************************************/ #ifndef __OPENSPACE_CORE___TIMEMANAGER___H__ #define __OPENSPACE_CORE___TIMEMANAGER___H__ diff --git a/include/openspace/util/transformationmanager.h b/include/openspace/util/transformationmanager.h index 29d2e54f7b..1c0c93f9d1 100644 --- a/include/openspace/util/transformationmanager.h +++ b/include/openspace/util/transformationmanager.h @@ -1,26 +1,26 @@ /***************************************************************************************** -* * -* 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. * + ****************************************************************************************/ #ifndef __OPENSPACE_CORE___TRANSFORMATIONMANAGER___H__ #define __OPENSPACE_CORE___TRANSFORMATIONMANAGER___H__ diff --git a/modules/base/rendering/wavefrontgeometry.h b/modules/base/rendering/wavefrontgeometry.h index d4a315dbe1..862efb26ed 100644 --- a/modules/base/rendering/wavefrontgeometry.h +++ b/modules/base/rendering/wavefrontgeometry.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __WAVEFRONTGEOMETRY_H__ -#define __WAVEFRONTGEOMETRY_H__ +#ifndef __OPENSPACE_MODULE_BASE___WAVEFRONTGEOMETRY___H__ +#define __OPENSPACE_MODULE_BASE___WAVEFRONTGEOMETRY___H__ #include @@ -45,7 +45,7 @@ namespace modelgeometry { bool loadModel(const std::string& filename); }; -} // namespace modelgeometry -} // namespace openspace +} // namespace modelgeometry +} // namespace openspace -#endif // __WAVEFRONTGEOMETRY_H__ +#endif // __OPENSPACE_MODULE_BASE___WAVEFRONTGEOMETRY___H__ diff --git a/modules/globebrowsing/meshes/basicgrid.h b/modules/globebrowsing/meshes/basicgrid.h index 648d423daf..0356de513b 100644 --- a/modules/globebrowsing/meshes/basicgrid.h +++ b/modules/globebrowsing/meshes/basicgrid.h @@ -1,26 +1,26 @@ /***************************************************************************************** -* * -* 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. * + ****************************************************************************************/ #ifndef __OPENSPACE_MODULE_GLOBEBROWSING___BASICGRIDGEOMETRY___H__ #define __OPENSPACE_MODULE_GLOBEBROWSING___BASICGRIDGEOMETRY___H__ diff --git a/modules/globebrowsing/tile/tiledepthtransform.h b/modules/globebrowsing/tile/tiledepthtransform.h index 2d71672b17..9212863b72 100644 --- a/modules/globebrowsing/tile/tiledepthtransform.h +++ b/modules/globebrowsing/tile/tiledepthtransform.h @@ -1,26 +1,26 @@ /***************************************************************************************** -* * -* 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. * + ****************************************************************************************/ #ifndef __OPENSPACE_MODULE_GLOBEBROWSING___TILEDEPTHTRANSFORM___H__ #define __OPENSPACE_MODULE_GLOBEBROWSING___TILEDEPTHTRANSFORM___H__ diff --git a/modules/kameleon/src/kameleonwrapper.cpp b/modules/kameleon/src/kameleonwrapper.cpp index 3a08b6c153..2d96133ac7 100644 --- a/modules/kameleon/src/kameleonwrapper.cpp +++ b/modules/kameleon/src/kameleonwrapper.cpp @@ -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 * diff --git a/modules/newhorizons/newhorizonsmodule.h b/modules/newhorizons/newhorizonsmodule.h index 5bd6c0e3cb..c44edcdb9a 100644 --- a/modules/newhorizons/newhorizonsmodule.h +++ b/modules/newhorizons/newhorizonsmodule.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __NEWHORIZONSMODULE_H__ -#define __NEWHORIZONSMODULE_H__ +#ifndef __OPENSPACE_MODULE_NEWHORIZONS___NEWHORIZONS___H__ +#define __OPENSPACE_MODULE_NEWHORIZONS___NEWHORIZONS___H__ #include @@ -41,4 +41,4 @@ protected: } // namespace openspace -#endif // __NEWHORIZONSMODULE_H__ +#endif // __OPENSPACE_MODULE_NEWHORIZONS___NEWHORIZONS___H__ diff --git a/modules/volume/rendering/renderablevolume.cpp b/modules/volume/rendering/renderablevolume.cpp index 33dce60490..558bed474f 100644 --- a/modules/volume/rendering/renderablevolume.cpp +++ b/modules/volume/rendering/renderablevolume.cpp @@ -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 * diff --git a/modules/volume/rendering/renderablevolume.h b/modules/volume/rendering/renderablevolume.h index 4ef03bbe72..8912155460 100644 --- a/modules/volume/rendering/renderablevolume.h +++ b/modules/volume/rendering/renderablevolume.h @@ -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,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __RENDERABLEVOLUME_H__ -#define __RENDERABLEVOLUME_H__ +#ifndef __OPENSPACE_MODULE_VOLUME___RENDERABLEVOLUME___H__ +#define __OPENSPACE_MODULE_VOLUME___RENDERABLEVOLUME___H__ // open space includes #include @@ -60,4 +60,4 @@ private: } // namespace openspace -#endif // __RENDERABLEVOLUME_H__ +#endif // __OPENSPACE_MODULE_VOLUME___RENDERABLEVOLUME___H__ diff --git a/modules/volume/rendering/renderablevolumegl.cpp b/modules/volume/rendering/renderablevolumegl.cpp index b6e6e22aa9..8c85e21353 100644 --- a/modules/volume/rendering/renderablevolumegl.cpp +++ b/modules/volume/rendering/renderablevolumegl.cpp @@ -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 * diff --git a/modules/volume/rendering/renderablevolumegl.h b/modules/volume/rendering/renderablevolumegl.h index 99e6efe9f3..8e7153ce73 100644 --- a/modules/volume/rendering/renderablevolumegl.h +++ b/modules/volume/rendering/renderablevolumegl.h @@ -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,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __RENDERABLEVOLUMEGL_H__ -#define __RENDERABLEVOLUMEGL_H__ +#ifndef __OPENSPACE_MODULE_VOLUME___RENDERABLEVOLUMEGL___H__ +#define __OPENSPACE_MODULE_VOLUME___RENDERABLEVOLUMEGL___H__ #include #include @@ -83,4 +83,4 @@ private: } // namespace openspace -#endif // __RENDERABLEVOLUMEGL_H__ +#endif // __OPENSPACE_MODULE_VOLUME___RENDERABLEVOLUMEGL___H__ diff --git a/src/rendering/transferfunction.cpp b/src/rendering/transferfunction.cpp index 5a596fe8c5..edb3e55749 100644 --- a/src/rendering/transferfunction.cpp +++ b/src/rendering/transferfunction.cpp @@ -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 * diff --git a/support/coding/check_include_guard.py b/support/coding/check_style_guide.py similarity index 68% rename from support/coding/check_include_guard.py rename to support/coding/check_style_guide.py index fba3f5b4b3..e5f81ca23e 100644 --- a/support/coding/check_include_guard.py +++ b/support/coding/check_style_guide.py @@ -26,8 +26,10 @@ guards for correctness. At the moment this includes: * Correctness (file has a #ifndef. #define, and #endif lines) * Equality (using the same name for the #ifdef and #define) * Styling (no empty line between #ifndef and #define lines, empty lines before and - after #ifndef #define block) + after #ifndef #define block, files end with an empty line, and copyright header + is correctly indented) * Correct usage of the name in the final comment of the file + * Correct year of copyright notice * Naming convention (OpenSpace include guards start with OPENSPACE, Ghoul with GHOUL, module includes have the module name in it) * Checking for duplicates between all files @@ -37,10 +39,13 @@ be passed, otherwise the first and only argument has to point to the base direct Thus, the default value of the first argument is '.' """ +import fnmatch import glob import re import sys +current_year = '2017' + def get_ifndef_symbol(lines): index = [i for i,s in enumerate(lines) if '#ifndef ' in s] @@ -96,6 +101,13 @@ def check_styling(lines): if lines[define_line + 1].strip() != '': return 'Following line is not empty' + if not lines[-1][-1] in ['\n', '\r']: + return 'Last line must end with a newline' + + for l in lines[2:23]: + if l[0] != ' ': + return 'Copyright header must be indented' + return '' def check_comment(lines): @@ -109,6 +121,32 @@ def check_comment(lines): else: return '' +def check_copyright(lines): + index = [i for i,s in enumerate(lines[0:23]) if 'Copyright' in s] + + if len(index) == 0: + return 'No copyright header found' + + beginning_string = ' * Copyright (c) 2012-' + # * Copyright (c) 2014- + + year = lines[index[0]][len(beginning_string) : len(beginning_string) + 4] + + if year != current_year: + return 'Out of date copyright notice ' + year + ' || ' + current_year + else: + return '' + +def check_naming_convention(lines, component): + ifndef_symbol, _ = get_ifndef_symbol(lines) + + component_part = ifndef_symbol[2:2 + len(component)] + + if component_part != component.upper(): + return '#ifndef naming convention broken: ' + ifndef_symbol + ' // ' + component.upper() + else: + return '' + def check_duplicates(lines, previousSymbols): ifndef_symbol, _ = get_ifndef_symbol(lines) @@ -117,68 +155,63 @@ def check_duplicates(lines, previousSymbols): else: return True, ifndef_symbol -basePath = './' -if len(sys.argv) > 1: - basePath = sys.argv[1] + '/' - -positivePathList = [ - 'include/**/*.h', - 'apps/**/*.h', - 'modules/**/*.h', - 'ext/ghoul/include/**/*.h' -] - -negativePathList = [ - 'modules/**/ext/**/*.h', - 'apps/**/ext/**/*.h', -] - -# Collect all the files that we might apply this script to -files = [] -for p in positivePathList: - f = glob.glob(basePath + p, recursive=True) - files = files + f - -# Collect all files that we want to remove from the full list -# These are mostly the external directories from modules -negativeFiles = [] -for p in negativePathList: - f = glob.glob(basePath + p, recursive=True) - negativeFiles = negativeFiles + f - -# Actually remove the negative files from the positive ones -files = [f for f in files if f not in negativeFiles] - previousSymbols = {} - -for file in files: - success = True +def check_file(file, component): with open(file, 'r+') as f: lines = f.readlines() correctness = check_correctness(lines) if correctness: print(file, '\t', 'Correctness check failed', '\t', correctness) - continue + return equality = check_equality(lines) if equality: print(file, '\t', 'Equality check failed', '\t', equality) - continue + return styling = check_styling(lines) if styling: print(file, '\t', 'Styling check failed', '\t', styling) - continue + return comment = check_comment(lines) if comment: print(file, '\t', 'Comment check failed', '\t', comment) - continue + return + + copyright = check_copyright(lines) + if copyright: + print(file, '\t', 'Copyright check failed', '\t', copyright) + return + + naming = check_naming_convention(lines, component) + if naming: + print(file, '\t', 'Naming convention broken', '\t', naming) + return duplicates, symbol = check_duplicates(lines, previousSymbols) if not duplicates: print(file, '\t', 'Duplicate include guard', symbol, 'first in', previousSymbols[symbol]) - continue + return else: - previousSymbols[symbol] = file + previousSymbols[symbol] = file + +def check_files(positiveList, negativeList, component): + files = glob.glob(positiveList, recursive=True) + negativeFiles = glob.glob(negativeList, recursive=True) + + files = [f for f in files if f not in negativeFiles] + + for file in files: + check_file(file, component) + + +basePath = './' +if len(sys.argv) > 1: + basePath = sys.argv[1] + '/' + +check_files(basePath + 'include/**/*.h', '', 'openspace_core') +check_files(basePath + 'apps/**/*.h', basePath + 'apps/**/ext/**/*.h', 'openspace_app') +check_files(basePath + 'modules/**/*.h', basePath + 'modules/**/ext/**/*.h', 'openspace_module') +check_files(basePath + 'ext/ghoul/include/**/*.h', '', 'ghoul') From 70020e3de771994701eecb868aee6e5f38946594 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Fri, 10 Feb 2017 14:46:51 -0500 Subject: [PATCH 13/96] - Add style check for correct use of components and subcomponents in include guards - Disallow use of lower case characters in include guards - Fix wrong components and subcomponents --- ext/ghoul | 2 +- .../documentation/core_registration.h | 6 +- .../properties/matrix/dmat2x3property.h | 6 +- .../properties/matrix/dmat2x4property.h | 6 +- .../properties/matrix/dmat3x2property.h | 6 +- .../properties/matrix/dmat3x4property.h | 6 +- .../properties/matrix/dmat4x2property.h | 6 +- .../properties/matrix/dmat4x3property.h | 6 +- .../properties/matrix/mat2x3property.h | 6 +- .../properties/matrix/mat2x4property.h | 6 +- .../properties/matrix/mat3x2property.h | 6 +- .../properties/matrix/mat3x4property.h | 6 +- .../properties/matrix/mat4x2property.h | 6 +- .../properties/matrix/mat4x3property.h | 6 +- include/openspace/scripting/script_helper.h | 7 +- modules/debugging/debuggingmodule.h | 6 +- modules/debugging/rendering/debugrenderer.h | 6 +- .../rendering/renderabledebugplane.h | 6 +- modules/globebrowsing/globebrowsingmodule.h | 6 +- modules/globebrowsing/other/statscollector.h | 6 +- modules/globebrowsing/tile/asynctilereader.h | 6 +- modules/kameleon/include/kameleonwrapper.h | 6 +- modules/kameleon/kameleonmodule.h | 6 +- modules/newhorizons/newhorizonsmodule.h | 6 +- support/coding/check_style_guide.py | 66 +++++++++++++++---- 25 files changed, 125 insertions(+), 82 deletions(-) diff --git a/ext/ghoul b/ext/ghoul index 151b528b94..3ee30f00c1 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 151b528b94bb4670e52b5e32342da0100cc3e078 +Subproject commit 3ee30f00c198b65ce34ef9f2032831c6729ff35d diff --git a/include/openspace/documentation/core_registration.h b/include/openspace/documentation/core_registration.h index 4ceff8f4ee..9cac4fca85 100644 --- a/include/openspace/documentation/core_registration.h +++ b/include/openspace/documentation/core_registration.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_CORE___REGISTRATION___H__ -#define __OPENSPACE_CORE___REGISTRATION___H__ +#ifndef __OPENSPACE_CORE___CORE_REGISTRATION___H__ +#define __OPENSPACE_CORE___CORE_REGISTRATION___H__ namespace openspace { @@ -35,4 +35,4 @@ void registerCoreClasses(scripting::ScriptEngine& engine); } // namespace openspace -#endif // __OPENSPACE_CORE___REGISTRATION___H__ +#endif // __OPENSPACE_CORE___CORE_REGISTRATION___H__ diff --git a/include/openspace/properties/matrix/dmat2x3property.h b/include/openspace/properties/matrix/dmat2x3property.h index 900f31faad..69603e57c4 100644 --- a/include/openspace/properties/matrix/dmat2x3property.h +++ b/include/openspace/properties/matrix/dmat2x3property.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_CORE___DMAT2x3PROPERTY___H__ -#define __OPENSPACE_CORE___DMAT2x3PROPERTY___H__ +#ifndef __OPENSPACE_CORE___DMAT2X3PROPERTY___H__ +#define __OPENSPACE_CORE___DMAT2X3PROPERTY___H__ #include @@ -37,4 +37,4 @@ REGISTER_NUMERICALPROPERTY_HEADER(DMat2x3Property, glm::dmat2x3); } // namespace properties } // namespace openspace -#endif // __OPENSPACE_CORE___DMAT2x3PROPERTY___H__ +#endif // __OPENSPACE_CORE___DMAT2X3PROPERTY___H__ diff --git a/include/openspace/properties/matrix/dmat2x4property.h b/include/openspace/properties/matrix/dmat2x4property.h index 720ceae492..3300ec67d7 100644 --- a/include/openspace/properties/matrix/dmat2x4property.h +++ b/include/openspace/properties/matrix/dmat2x4property.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_CORE___DMAT2x4PROPERTY___H__ -#define __OPENSPACE_CORE___DMAT2x4PROPERTY___H__ +#ifndef __OPENSPACE_CORE___DMAT2X4PROPERTY___H__ +#define __OPENSPACE_CORE___DMAT2X4PROPERTY___H__ #include @@ -37,4 +37,4 @@ REGISTER_NUMERICALPROPERTY_HEADER(DMat2x4Property, glm::dmat2x4); } // namespace properties } // namespace openspace -#endif // __OPENSPACE_CORE___DMAT2x4PROPERTY___H__ +#endif // __OPENSPACE_CORE___DMAT2X4PROPERTY___H__ diff --git a/include/openspace/properties/matrix/dmat3x2property.h b/include/openspace/properties/matrix/dmat3x2property.h index 9424c3880c..15a01d557a 100644 --- a/include/openspace/properties/matrix/dmat3x2property.h +++ b/include/openspace/properties/matrix/dmat3x2property.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_CORE___DMAT3x2PROPERTY___H__ -#define __OPENSPACE_CORE___DMAT3x2PROPERTY___H__ +#ifndef __OPENSPACE_CORE___DMAT3X2PROPERTY___H__ +#define __OPENSPACE_CORE___DMAT3X2PROPERTY___H__ #include @@ -37,4 +37,4 @@ REGISTER_NUMERICALPROPERTY_HEADER(DMat3x2Property, glm::dmat3x2); } // namespace properties } // namespace openspace -#endif // __OPENSPACE_CORE___DMAT3x2PROPERTY___H__ +#endif // __OPENSPACE_CORE___DMAT3X2PROPERTY___H__ diff --git a/include/openspace/properties/matrix/dmat3x4property.h b/include/openspace/properties/matrix/dmat3x4property.h index 535ccbae92..ba460f5714 100644 --- a/include/openspace/properties/matrix/dmat3x4property.h +++ b/include/openspace/properties/matrix/dmat3x4property.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_CORE___DMAT3x4PROPERTY___H__ -#define __OPENSPACE_CORE___DMAT3x4PROPERTY___H__ +#ifndef __OPENSPACE_CORE___DMAT3X4PROPERTY___H__ +#define __OPENSPACE_CORE___DMAT3X4PROPERTY___H__ #include @@ -37,4 +37,4 @@ REGISTER_NUMERICALPROPERTY_HEADER(DMat3x4Property, glm::dmat3x4); } // namespace properties } // namespace openspace -#endif // __OPENSPACE_CORE___DMAT3x4PROPERTY___H__ +#endif // __OPENSPACE_CORE___DMAT3X4PROPERTY___H__ diff --git a/include/openspace/properties/matrix/dmat4x2property.h b/include/openspace/properties/matrix/dmat4x2property.h index 1151b54b4e..1d0e1bfc94 100644 --- a/include/openspace/properties/matrix/dmat4x2property.h +++ b/include/openspace/properties/matrix/dmat4x2property.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_CORE___DMAT4x2PROPERTY___H__ -#define __OPENSPACE_CORE___DMAT4x2PROPERTY___H__ +#ifndef __OPENSPACE_CORE___DMAT4X2PROPERTY___H__ +#define __OPENSPACE_CORE___DMAT4X2PROPERTY___H__ #include @@ -37,4 +37,4 @@ REGISTER_NUMERICALPROPERTY_HEADER(DMat4x2Property, glm::dmat4x2); } // namespace properties } // namespace openspace -#endif // __OPENSPACE_CORE___DMAT4x2PROPERTY___H__ +#endif // __OPENSPACE_CORE___DMAT4X2PROPERTY___H__ diff --git a/include/openspace/properties/matrix/dmat4x3property.h b/include/openspace/properties/matrix/dmat4x3property.h index 89bb9464e0..0843a3c944 100644 --- a/include/openspace/properties/matrix/dmat4x3property.h +++ b/include/openspace/properties/matrix/dmat4x3property.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_CORE___DMAT4x3PROPERTY___H__ -#define __OPENSPACE_CORE___DMAT4x3PROPERTY___H__ +#ifndef __OPENSPACE_CORE___DMAT4X3PROPERTY___H__ +#define __OPENSPACE_CORE___DMAT4X3PROPERTY___H__ #include @@ -37,4 +37,4 @@ REGISTER_NUMERICALPROPERTY_HEADER(DMat4x3Property, glm::dmat4x3); } // namespace properties } // namespace openspace -#endif // __OPENSPACE_CORE___DMAT4x3PROPERTY___H__ +#endif // __OPENSPACE_CORE___DMAT4X3PROPERTY___H__ diff --git a/include/openspace/properties/matrix/mat2x3property.h b/include/openspace/properties/matrix/mat2x3property.h index 8389e34e61..406834f057 100644 --- a/include/openspace/properties/matrix/mat2x3property.h +++ b/include/openspace/properties/matrix/mat2x3property.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_CORE___MAT2x3PROPERTY___H__ -#define __OPENSPACE_CORE___MAT2x3PROPERTY___H__ +#ifndef __OPENSPACE_CORE___MAT2X3PROPERTY___H__ +#define __OPENSPACE_CORE___MAT2X3PROPERTY___H__ #include @@ -37,4 +37,4 @@ REGISTER_NUMERICALPROPERTY_HEADER(Mat2x3Property, glm::mat2x3); } // namespace properties } // namespace openspace -#endif // __OPENSPACE_CORE___MAT2x3PROPERTY___H__ +#endif // __OPENSPACE_CORE___MAT2X3PROPERTY___H__ diff --git a/include/openspace/properties/matrix/mat2x4property.h b/include/openspace/properties/matrix/mat2x4property.h index a6417c0fba..a678da4051 100644 --- a/include/openspace/properties/matrix/mat2x4property.h +++ b/include/openspace/properties/matrix/mat2x4property.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_CORE___MAT2x4PROPERTY___H__ -#define __OPENSPACE_CORE___MAT2x4PROPERTY___H__ +#ifndef __OPENSPACE_CORE___MAT2X4PROPERTY___H__ +#define __OPENSPACE_CORE___MAT2X4PROPERTY___H__ #include @@ -37,4 +37,4 @@ REGISTER_NUMERICALPROPERTY_HEADER(Mat2x4Property, glm::mat2x4); } // namespace properties } // namespace openspace -#endif // __OPENSPACE_CORE___MAT2x4PROPERTY___H__ +#endif // __OPENSPACE_CORE___MAT2X4PROPERTY___H__ diff --git a/include/openspace/properties/matrix/mat3x2property.h b/include/openspace/properties/matrix/mat3x2property.h index 999ea31e3e..bfc5e2ef58 100644 --- a/include/openspace/properties/matrix/mat3x2property.h +++ b/include/openspace/properties/matrix/mat3x2property.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_CORE___MAT3x2PROPERTY___H__ -#define __OPENSPACE_CORE___MAT3x2PROPERTY___H__ +#ifndef __OPENSPACE_CORE___MAT3X2PROPERTY___H__ +#define __OPENSPACE_CORE___MAT3X2PROPERTY___H__ #include @@ -37,4 +37,4 @@ REGISTER_NUMERICALPROPERTY_HEADER(Mat3x2Property, glm::mat3x2); } // namespace properties } // namespace openspace -#endif // __OPENSPACE_CORE___MAT3x2PROPERTY___H__ +#endif // __OPENSPACE_CORE___MAT3X2PROPERTY___H__ diff --git a/include/openspace/properties/matrix/mat3x4property.h b/include/openspace/properties/matrix/mat3x4property.h index 2386f25efe..8f87c3ca52 100644 --- a/include/openspace/properties/matrix/mat3x4property.h +++ b/include/openspace/properties/matrix/mat3x4property.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_CORE___MAT3x4PROPERTY___H__ -#define __OPENSPACE_CORE___MAT3x4PROPERTY___H__ +#ifndef __OPENSPACE_CORE___MAT3X4PROPERTY___H__ +#define __OPENSPACE_CORE___MAT3X4PROPERTY___H__ #include @@ -37,4 +37,4 @@ REGISTER_NUMERICALPROPERTY_HEADER(Mat3x4Property, glm::mat3x4); } // namespace properties } // namespace openspace -#endif // __OPENSPACE_CORE___MAT3x4PROPERTY___H__ +#endif // __OPENSPACE_CORE___MAT3X4PROPERTY___H__ diff --git a/include/openspace/properties/matrix/mat4x2property.h b/include/openspace/properties/matrix/mat4x2property.h index 42c51dd17d..e57ecdaaee 100644 --- a/include/openspace/properties/matrix/mat4x2property.h +++ b/include/openspace/properties/matrix/mat4x2property.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_CORE___MAT4x2PROPERTY___H__ -#define __OPENSPACE_CORE___MAT4x2PROPERTY___H__ +#ifndef __OPENSPACE_CORE___MAT4X2PROPERTY___H__ +#define __OPENSPACE_CORE___MAT4X2PROPERTY___H__ #include @@ -37,4 +37,4 @@ REGISTER_NUMERICALPROPERTY_HEADER(Mat4x2Property, glm::mat4x2); } // namespace properties } // namespace openspace -#endif // __OPENSPACE_CORE___MAT4x2PROPERTY___H__ +#endif // __OPENSPACE_CORE___MAT4X2PROPERTY___H__ diff --git a/include/openspace/properties/matrix/mat4x3property.h b/include/openspace/properties/matrix/mat4x3property.h index e91203d23e..cd8931479b 100644 --- a/include/openspace/properties/matrix/mat4x3property.h +++ b/include/openspace/properties/matrix/mat4x3property.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_CORE___MAT4x3PROPERTY___H__ -#define __OPENSPACE_CORE___MAT4x3PROPERTY___H__ +#ifndef __OPENSPACE_CORE___MAT4X3PROPERTY___H__ +#define __OPENSPACE_CORE___MAT4X3PROPERTY___H__ #include @@ -37,4 +37,4 @@ REGISTER_NUMERICALPROPERTY_HEADER(Mat4x3Property, glm::mat4x3); } // namespace properties } // namespace openspace -#endif // __OPENSPACE_CORE___MAT4x3PROPERTY___H__ +#endif // __OPENSPACE_CORE___MAT4X3PROPERTY___H__ diff --git a/include/openspace/scripting/script_helper.h b/include/openspace/scripting/script_helper.h index 4241e0e81f..a2c9231a26 100644 --- a/include/openspace/scripting/script_helper.h +++ b/include/openspace/scripting/script_helper.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_CORE___SCRIPTHELPER___H__ -#define __OPENSPACE_CORE___SCRIPTHELPER___H__ +#ifndef __OPENSPACE_CORE___SCRIPT_HELPER___H__ +#define __OPENSPACE_CORE___SCRIPT_HELPER___H__ #define SCRIPT_CHECK_ARGUMENTS(__category__, __stack__, __reqArg__, __realArg__) \ if (__realArg__ != __reqArg__) { \ @@ -32,5 +32,4 @@ return 0; \ } - -#endif // __OPENSPACE_CORE___SCRIPTHELPER___H__ +#endif // __OPENSPACE_CORE___SCRIPT_HELPER___H__ diff --git a/modules/debugging/debuggingmodule.h b/modules/debugging/debuggingmodule.h index ecfb7d791d..a626899a89 100644 --- a/modules/debugging/debuggingmodule.h +++ b/modules/debugging/debuggingmodule.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_BASE___DEBUGGINGMODULE___H__ -#define __OPENSPACE_MODULE_BASE___DEBUGGINGMODULE___H__ +#ifndef __OPENSPACE_MODULE_DEBUGGING___DEBUGGINGMODULE___H__ +#define __OPENSPACE_MODULE_DEBUGGING___DEBUGGINGMODULE___H__ #include @@ -39,4 +39,4 @@ protected: } // namespace openspace -#endif // __OPENSPACE_MODULE_BASE___DEBUGGINGMODULE___H__ +#endif // __OPENSPACE_MODULE_DEBUGGING___DEBUGGINGMODULE___H__ diff --git a/modules/debugging/rendering/debugrenderer.h b/modules/debugging/rendering/debugrenderer.h index 158ebd3351..8d792ffc01 100644 --- a/modules/debugging/rendering/debugrenderer.h +++ b/modules/debugging/rendering/debugrenderer.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_BASE___DEBUGRENDERER___H__ -#define __OPENSPACE_MODULE_BASE___DEBUGRENDERER___H__ +#ifndef __OPENSPACE_MODULE_DEBUGGING___DEBUGRENDERER___H__ +#define __OPENSPACE_MODULE_DEBUGGING___DEBUGRENDERER___H__ #include #include @@ -162,4 +162,4 @@ protected: } // namespace openspace -#endif // __OPENSPACE_MODULE_BASE___DEBUGRENDERER___H__ +#endif // __OPENSPACE_MODULE_DEBUGGING___DEBUGRENDERER___H__ diff --git a/modules/debugging/rendering/renderabledebugplane.h b/modules/debugging/rendering/renderabledebugplane.h index 7ce37d423e..96df652354 100644 --- a/modules/debugging/rendering/renderabledebugplane.h +++ b/modules/debugging/rendering/renderabledebugplane.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_BASE___RENDERABLEDEBUGPLANE___H__ -#define __OPENSPACE_MODULE_BASE___RENDERABLEDEBUGPLANE___H__ +#ifndef __OPENSPACE_MODULE_DEBUGGING___RENDERABLEDEBUGPLANE___H__ +#define __OPENSPACE_MODULE_DEBUGGING___RENDERABLEDEBUGPLANE___H__ #include @@ -82,4 +82,4 @@ private: } // namespace openspace -#endif // __OPENSPACE_MODULE_BASE___RENDERABLEDEBUGPLANE___H__ +#endif // __OPENSPACE_MODULE_DEBUGGING___RENDERABLEDEBUGPLANE___H__ diff --git a/modules/globebrowsing/globebrowsingmodule.h b/modules/globebrowsing/globebrowsingmodule.h index 407152848b..942aea1819 100644 --- a/modules/globebrowsing/globebrowsingmodule.h +++ b/modules/globebrowsing/globebrowsingmodule.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___GLOBEBROWSING___H__ -#define __OPENSPACE_MODULE_GLOBEBROWSING___GLOBEBROWSING___H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___GLOBEBROWSING_MODULE___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___GLOBEBROWSING_MODULE___H__ #include @@ -39,4 +39,4 @@ protected: } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING___GLOBEBROWSING___H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___GLOBEBROWSING_MODULE___H__ diff --git a/modules/globebrowsing/other/statscollector.h b/modules/globebrowsing/other/statscollector.h index 5d12d3159c..af1f6e57e6 100644 --- a/modules/globebrowsing/other/statscollector.h +++ b/modules/globebrowsing/other/statscollector.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___STATS_TRACKER___H__ -#define __OPENSPACE_MODULE_GLOBEBROWSING___STATS_TRACKER___H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___STATS_COLLECTOR___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___STATS_COLLECTOR___H__ #include @@ -121,4 +121,4 @@ private: #include "statscollector.inl" -#endif // __OPENSPACE_MODULE_GLOBEBROWSING___STATS_TRACKER___H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___STATS_COLLECTOR___H__ diff --git a/modules/globebrowsing/tile/asynctilereader.h b/modules/globebrowsing/tile/asynctilereader.h index 1e34209002..3208783b45 100644 --- a/modules/globebrowsing/tile/asynctilereader.h +++ b/modules/globebrowsing/tile/asynctilereader.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___ASYNC_TILE_DATA_PROVIDER___H__ -#define __OPENSPACE_MODULE_GLOBEBROWSING___ASYNC_TILE_DATA_PROVIDER___H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___ASYNC_TILE_READER___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___ASYNC_TILE_READER___H__ #include #include @@ -107,4 +107,4 @@ private: } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING___ASYNC_TILE_DATA_PROVIDER___H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___ASYNC_TILE_READER___H__ diff --git a/modules/kameleon/include/kameleonwrapper.h b/modules/kameleon/include/kameleonwrapper.h index 2268b10695..1b4149e95f 100644 --- a/modules/kameleon/include/kameleonwrapper.h +++ b/modules/kameleon/include/kameleonwrapper.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_ISWA___KAMELEONWRAPPER___H__ -#define __OPENSPACE_MODULE_ISWA___KAMELEONWRAPPER___H__ +#ifndef __OPENSPACE_MODULE_KAMELEON___KAMELEONWRAPPER___H__ +#define __OPENSPACE_MODULE_KAMELEON___KAMELEONWRAPPER___H__ #include @@ -179,4 +179,4 @@ private: } // namespace openspace -#endif // __OPENSPACE_MODULE_ISWA___KAMELEONWRAPPER___H__ +#endif // __OPENSPACE_MODULE_KAMELEON___KAMELEONWRAPPER___H__ diff --git a/modules/kameleon/kameleonmodule.h b/modules/kameleon/kameleonmodule.h index d8acde2303..fce0c25746 100644 --- a/modules/kameleon/kameleonmodule.h +++ b/modules/kameleon/kameleonmodule.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_ISWA___KAMELEONMODULE___H__ -#define __OPENSPACE_MODULE_ISWA___KAMELEONMODULE___H__ +#ifndef __OPENSPACE_MODULE_KAMELEON___KAMELEONMODULE___H__ +#define __OPENSPACE_MODULE_KAMELEON___KAMELEONMODULE___H__ #include @@ -36,4 +36,4 @@ public: } // namespace openspace -#endif // __OPENSPACE_MODULE_ISWA___KAMELEONMODULE___H__ +#endif // __OPENSPACE_MODULE_KAMELEON___KAMELEONMODULE___H__ diff --git a/modules/newhorizons/newhorizonsmodule.h b/modules/newhorizons/newhorizonsmodule.h index c44edcdb9a..ac5bbcf5b1 100644 --- a/modules/newhorizons/newhorizonsmodule.h +++ b/modules/newhorizons/newhorizonsmodule.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_NEWHORIZONS___NEWHORIZONS___H__ -#define __OPENSPACE_MODULE_NEWHORIZONS___NEWHORIZONS___H__ +#ifndef __OPENSPACE_MODULE_NEWHORIZONS___NEWHORIZONS_MODULE___H__ +#define __OPENSPACE_MODULE_NEWHORIZONS___NEWHORIZONS_MODULE___H__ #include @@ -41,4 +41,4 @@ protected: } // namespace openspace -#endif // __OPENSPACE_MODULE_NEWHORIZONS___NEWHORIZONS___H__ +#endif // __OPENSPACE_MODULE_NEWHORIZONS___NEWHORIZONS_MODULE___H__ diff --git a/support/coding/check_style_guide.py b/support/coding/check_style_guide.py index e5f81ca23e..4940eede90 100644 --- a/support/coding/check_style_guide.py +++ b/support/coding/check_style_guide.py @@ -25,13 +25,19 @@ This script traverses the file tree of OpenSpace and will check all files' inclu guards for correctness. At the moment this includes: * Correctness (file has a #ifndef. #define, and #endif lines) * Equality (using the same name for the #ifdef and #define) - * Styling (no empty line between #ifndef and #define lines, empty lines before and - after #ifndef #define block, files end with an empty line, and copyright header - is correctly indented) + * Styling + * no empty line between #ifndef and #define lines + * Empty lines before and after #ifndef #define block + * Files end with an empty line + * Copyright header is correctly indented + * Include guard correctly uses the filename + * Include guard is all upper case * Correct usage of the name in the final comment of the file * Correct year of copyright notice - * Naming convention (OpenSpace include guards start with OPENSPACE, Ghoul with GHOUL, - module includes have the module name in it) + * Naming convention + * OpenSpace include guards start with OPENSPACE, Ghoul with GHOUL, + module includes have the module name in it + * The correct submodule is used * Checking for duplicates between all files If this script is executed from the base directory of OpenSpace, no arguments need to @@ -41,6 +47,7 @@ Thus, the default value of the first argument is '.' import fnmatch import glob +import os import re import sys @@ -89,7 +96,7 @@ def check_equality(lines): return ifndef + ' ' + define def check_styling(lines): - _, ifndef_line = get_ifndef_symbol(lines) + ifndef_symbol, ifndef_line = get_ifndef_symbol(lines) _, define_line = get_define_symbol(lines) if abs(ifndef_line - define_line) != 1: @@ -108,8 +115,18 @@ def check_styling(lines): if l[0] != ' ': return 'Copyright header must be indented' + if ifndef_symbol != ifndef_symbol.upper(): + return 'Include guard is not all upper case' + return '' +def check_styling_filename(lines, filename): + ifndef_symbol, _ = get_ifndef_symbol(lines) + file = os.path.splitext(os.path.basename(filename))[0].upper() + + if not (file in ifndef_symbol or file in ifndef_symbol.replace('_', '')): + return 'Malformed include guard: ' + ifndef_symbol + ' || ' + file + def check_comment(lines): ifndef_symbol, _ = get_ifndef_symbol(lines) @@ -137,13 +154,29 @@ def check_copyright(lines): else: return '' -def check_naming_convention(lines, component): +def check_naming_convention_component(lines, component): ifndef_symbol, _ = get_ifndef_symbol(lines) component_part = ifndef_symbol[2:2 + len(component)] if component_part != component.upper(): - return '#ifndef naming convention broken: ' + ifndef_symbol + ' // ' + component.upper() + return '#ifndef naming convention broken: ' + ifndef_symbol + ' || ' + component.upper() + else: + return '' + +def check_naming_convention_subcomponent(lines, component, file): + ifndef_symbol, _ = get_ifndef_symbol(lines) + + if component == "ghoul" or component == "openspace_core": + return + + subcomponent_part = ifndef_symbol[2 + len(component) + 1 :] + subcomponent_part = subcomponent_part[: subcomponent_part.find('_')] + + path_part = file.split(os.sep)[2] + + if path_part.upper() != subcomponent_part: + return 'Subcomponent naming convention broken: ' + ifndef_symbol else: return '' @@ -175,6 +208,12 @@ def check_file(file, component): print(file, '\t', 'Styling check failed', '\t', styling) return + styling_filename = check_styling_filename(lines, file) + if styling_filename: + print(file, '\t', 'Filename styling check failed', '\t', styling_filename) + return + + comment = check_comment(lines) if comment: print(file, '\t', 'Comment check failed', '\t', comment) @@ -185,9 +224,14 @@ def check_file(file, component): print(file, '\t', 'Copyright check failed', '\t', copyright) return - naming = check_naming_convention(lines, component) - if naming: - print(file, '\t', 'Naming convention broken', '\t', naming) + naming_component = check_naming_convention_component(lines, component) + if naming_component: + print(file, '\t', 'Naming convention broken', '\t', naming_component) + return + + naming_subcomponent = check_naming_convention_subcomponent(lines, component, file) + if naming_subcomponent: + print(file, '\t', 'Naming convention broken', '\t', naming_subcomponent) return duplicates, symbol = check_duplicates(lines, previousSymbols) From 15867d684922c0d011eee47be1923fe310747537 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Mon, 13 Feb 2017 13:45:27 -0500 Subject: [PATCH 14/96] Cleanup of warnings in external libraries --- ext/ghoul | 2 +- ext/sgct | 2 +- modules/kameleon/CMakeLists.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/ghoul b/ext/ghoul index 3ee30f00c1..6adcb40525 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 3ee30f00c198b65ce34ef9f2032831c6729ff35d +Subproject commit 6adcb40525e5c052b63a7a764d12ea4da897c015 diff --git a/ext/sgct b/ext/sgct index d47e9d6d1d..b3bf32e8bd 160000 --- a/ext/sgct +++ b/ext/sgct @@ -1 +1 @@ -Subproject commit d47e9d6d1d55a1730a6f3a8f58abee4a4a0b95de +Subproject commit b3bf32e8bd59c7a79e899face441a26a361fe982 diff --git a/modules/kameleon/CMakeLists.txt b/modules/kameleon/CMakeLists.txt index 22b1e2c13b..2171629667 100644 --- a/modules/kameleon/CMakeLists.txt +++ b/modules/kameleon/CMakeLists.txt @@ -63,7 +63,7 @@ create_new_module( endif () set_property(TARGET ccmc PROPERTY FOLDER "External") if (TARGET cdf) - if (OPENSPACE_DISABLE_EXTERNAL_WARNINGS) + if (GHOUL_DISABLE_EXTERNAL_WARNINGS) if (MSVC) target_compile_options(cdf PUBLIC "/W0" "/MP") else () From 48e77f6106979c9d2b602534e6bccebcbb1aadad Mon Sep 17 00:00:00 2001 From: noahdasanaike Date: Mon, 13 Feb 2017 16:12:35 -0500 Subject: [PATCH 15/96] Modified launcher checkboxes to have clearly defined check-indicators; (#228) green indicates a check, whereas red does not. --- apps/Launcher/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/Launcher/main.cpp b/apps/Launcher/main.cpp index c802f468cc..ecc15ca4ea 100644 --- a/apps/Launcher/main.cpp +++ b/apps/Launcher/main.cpp @@ -82,14 +82,14 @@ QCheckBox::indicator { } QCheckBox::indicator::unchecked { border: 1px solid #5A5A5A; - background: transparent; + background: #a10000; } QCheckBox::indicator:unchecked:hover { border: 1px solid #DDDDDD; } QCheckBox::indicator::checked { - border: 1px solid #AAAAAA; - background: #666666; + border: 1px solid #5A5A5A; + background: #8dc73f; } QCheckBox::indicator:checked:hover { border: 1px solid #DDDDDD; From 8456087cf59acac1556e3a73dc1bbb9e31ac5236 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Tue, 14 Feb 2017 13:12:59 -0500 Subject: [PATCH 16/96] Add a style check that checks whether the correct GLM header is used Adapted files to use the correct GLM headers --- apps/DataConverter/main.cpp | 2 +- apps/DataConverter/milkywayconversiontask.h | 2 +- .../milkywaypointsconversiontask.h | 2 +- .../openspace/rendering/transferfunction.h | 2 +- .../util/blockplaneintersectiongeometry.h | 2 +- include/openspace/util/boxgeometry.h | 2 +- modules/debugging/rendering/debugrenderer.cpp | 2 +- modules/debugging/rendering/debugrenderer.h | 3 +- modules/galaxy/rendering/galaxyraycaster.cpp | 3 +- modules/galaxy/rendering/renderablegalaxy.cpp | 2 +- modules/globebrowsing/chunk/chunk.h | 2 +- modules/globebrowsing/geometry/aabb.h | 2 +- modules/globebrowsing/geometry/angle.h | 2 +- modules/globebrowsing/geometry/convexhull.h | 2 +- modules/globebrowsing/meshes/basicgrid.h | 2 +- modules/globebrowsing/meshes/grid.h | 2 +- modules/globebrowsing/meshes/skirtedgrid.h | 2 +- modules/globebrowsing/tile/pixelregion.h | 2 +- .../rendering/multiresvolumeraycaster.cpp | 2 +- .../rendering/renderablemultiresvolume.cpp | 2 +- .../rendering/renderabletoyvolume.cpp | 2 +- .../rendering/toyvolumeraycaster.cpp | 2 +- modules/volume/linearlrucache.h | 2 +- modules/volume/lrucache.h | 2 +- modules/volume/volumeutils.h | 2 +- src/util/blockplaneintersectiongeometry.cpp | 2 +- support/coding/check_style_guide.py | 82 +++++++++++++++++-- 27 files changed, 101 insertions(+), 35 deletions(-) diff --git a/apps/DataConverter/main.cpp b/apps/DataConverter/main.cpp index 1a66cd100c..eb147ec43d 100644 --- a/apps/DataConverter/main.cpp +++ b/apps/DataConverter/main.cpp @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include diff --git a/apps/DataConverter/milkywayconversiontask.h b/apps/DataConverter/milkywayconversiontask.h index f3952d312c..6eb7233c75 100644 --- a/apps/DataConverter/milkywayconversiontask.h +++ b/apps/DataConverter/milkywayconversiontask.h @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include #include diff --git a/apps/DataConverter/milkywaypointsconversiontask.h b/apps/DataConverter/milkywaypointsconversiontask.h index 47ab744e8e..a11bc64230 100644 --- a/apps/DataConverter/milkywaypointsconversiontask.h +++ b/apps/DataConverter/milkywaypointsconversiontask.h @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include #include diff --git a/include/openspace/rendering/transferfunction.h b/include/openspace/rendering/transferfunction.h index dc6d1c9f15..2c462f7845 100644 --- a/include/openspace/rendering/transferfunction.h +++ b/include/openspace/rendering/transferfunction.h @@ -26,7 +26,7 @@ #define __OPENSPACE_CORE___TRANSFERFUNCTION___H__ #include -#include +#include #include #include #include diff --git a/include/openspace/util/blockplaneintersectiongeometry.h b/include/openspace/util/blockplaneintersectiongeometry.h index 2e49687f4a..c861cb8835 100644 --- a/include/openspace/util/blockplaneintersectiongeometry.h +++ b/include/openspace/util/blockplaneintersectiongeometry.h @@ -26,7 +26,7 @@ #define __OPENSPACE_CORE___BLOCKPLANEINTERSECTIONGEOMETRY___H__ #include -#include +#include #include diff --git a/include/openspace/util/boxgeometry.h b/include/openspace/util/boxgeometry.h index c6ca91247c..7016f87435 100644 --- a/include/openspace/util/boxgeometry.h +++ b/include/openspace/util/boxgeometry.h @@ -26,7 +26,7 @@ #define __OPENSPACE_CORE___BOXGEOMETRY___H__ #include -#include +#include namespace openspace { diff --git a/modules/debugging/rendering/debugrenderer.cpp b/modules/debugging/rendering/debugrenderer.cpp index 2fc223b1ad..3f028ecb6a 100644 --- a/modules/debugging/rendering/debugrenderer.cpp +++ b/modules/debugging/rendering/debugrenderer.cpp @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include diff --git a/modules/debugging/rendering/debugrenderer.h b/modules/debugging/rendering/debugrenderer.h index 8d792ffc01..31145a9eeb 100644 --- a/modules/debugging/rendering/debugrenderer.h +++ b/modules/debugging/rendering/debugrenderer.h @@ -31,8 +31,7 @@ #include #include - -#include +#include #include #include diff --git a/modules/galaxy/rendering/galaxyraycaster.cpp b/modules/galaxy/rendering/galaxyraycaster.cpp index ce2f8d68e4..81be4f08b2 100644 --- a/modules/galaxy/rendering/galaxyraycaster.cpp +++ b/modules/galaxy/rendering/galaxyraycaster.cpp @@ -24,8 +24,9 @@ #include -#include +#include #include + #include #include #include diff --git a/modules/galaxy/rendering/renderablegalaxy.cpp b/modules/galaxy/rendering/renderablegalaxy.cpp index 24ebec8484..812dc33619 100644 --- a/modules/galaxy/rendering/renderablegalaxy.cpp +++ b/modules/galaxy/rendering/renderablegalaxy.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include diff --git a/modules/globebrowsing/chunk/chunk.h b/modules/globebrowsing/chunk/chunk.h index 05c66f3dc5..e2f7ea7759 100644 --- a/modules/globebrowsing/chunk/chunk.h +++ b/modules/globebrowsing/chunk/chunk.h @@ -28,7 +28,7 @@ #include #include -#include +#include #include namespace openspace { diff --git a/modules/globebrowsing/geometry/aabb.h b/modules/globebrowsing/geometry/aabb.h index 5cc2bdf660..e88f20e17b 100644 --- a/modules/globebrowsing/geometry/aabb.h +++ b/modules/globebrowsing/geometry/aabb.h @@ -25,7 +25,7 @@ #ifndef __OPENSPACE_MODULE_GLOBEBROWSING___AABB___H__ #define __OPENSPACE_MODULE_GLOBEBROWSING___AABB___H__ -#include +#include namespace openspace { namespace globebrowsing { diff --git a/modules/globebrowsing/geometry/angle.h b/modules/globebrowsing/geometry/angle.h index 7836d2c21b..1963f0d0a2 100644 --- a/modules/globebrowsing/geometry/angle.h +++ b/modules/globebrowsing/geometry/angle.h @@ -25,7 +25,7 @@ #ifndef __OPENSPACE_MODULE_GLOBEBROWSING___ANGLE___H__ #define __OPENSPACE_MODULE_GLOBEBROWSING___ANGLE___H__ -#include +#include #include #include diff --git a/modules/globebrowsing/geometry/convexhull.h b/modules/globebrowsing/geometry/convexhull.h index 048201c295..03cce41b75 100644 --- a/modules/globebrowsing/geometry/convexhull.h +++ b/modules/globebrowsing/geometry/convexhull.h @@ -30,7 +30,7 @@ #include #include -#include +#include namespace openspace { namespace globebrowsing { diff --git a/modules/globebrowsing/meshes/basicgrid.h b/modules/globebrowsing/meshes/basicgrid.h index 0356de513b..6a357ad38f 100644 --- a/modules/globebrowsing/meshes/basicgrid.h +++ b/modules/globebrowsing/meshes/basicgrid.h @@ -27,7 +27,7 @@ #include -#include +#include #include diff --git a/modules/globebrowsing/meshes/grid.h b/modules/globebrowsing/meshes/grid.h index d96d9ec35f..3b6e07e59b 100644 --- a/modules/globebrowsing/meshes/grid.h +++ b/modules/globebrowsing/meshes/grid.h @@ -27,7 +27,7 @@ #include -#include +#include #include #include diff --git a/modules/globebrowsing/meshes/skirtedgrid.h b/modules/globebrowsing/meshes/skirtedgrid.h index 19cd2b7927..6bccff1565 100644 --- a/modules/globebrowsing/meshes/skirtedgrid.h +++ b/modules/globebrowsing/meshes/skirtedgrid.h @@ -27,7 +27,7 @@ #include -#include +#include #include namespace openspace { diff --git a/modules/globebrowsing/tile/pixelregion.h b/modules/globebrowsing/tile/pixelregion.h index d364929053..b4df7184c6 100644 --- a/modules/globebrowsing/tile/pixelregion.h +++ b/modules/globebrowsing/tile/pixelregion.h @@ -25,7 +25,7 @@ #ifndef __OPENSPACE_MODULE_GLOBEBROWSING___PIXELREGION___H__ #define __OPENSPACE_MODULE_GLOBEBROWSING___PIXELREGION___H__ -#include +#include namespace openspace { namespace globebrowsing { diff --git a/modules/multiresvolume/rendering/multiresvolumeraycaster.cpp b/modules/multiresvolume/rendering/multiresvolumeraycaster.cpp index 0bbfe04258..5d9c2ed3ba 100644 --- a/modules/multiresvolume/rendering/multiresvolumeraycaster.cpp +++ b/modules/multiresvolume/rendering/multiresvolumeraycaster.cpp @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include diff --git a/modules/multiresvolume/rendering/renderablemultiresvolume.cpp b/modules/multiresvolume/rendering/renderablemultiresvolume.cpp index b93b7b7a58..7da992b017 100644 --- a/modules/multiresvolume/rendering/renderablemultiresvolume.cpp +++ b/modules/multiresvolume/rendering/renderablemultiresvolume.cpp @@ -30,7 +30,7 @@ #include #include -#include +#include #include #include diff --git a/modules/toyvolume/rendering/renderabletoyvolume.cpp b/modules/toyvolume/rendering/renderabletoyvolume.cpp index 1c26973574..0f16045129 100644 --- a/modules/toyvolume/rendering/renderabletoyvolume.cpp +++ b/modules/toyvolume/rendering/renderabletoyvolume.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include diff --git a/modules/toyvolume/rendering/toyvolumeraycaster.cpp b/modules/toyvolume/rendering/toyvolumeraycaster.cpp index fb8fa8d88c..49f6dfb469 100644 --- a/modules/toyvolume/rendering/toyvolumeraycaster.cpp +++ b/modules/toyvolume/rendering/toyvolumeraycaster.cpp @@ -24,7 +24,7 @@ #include -#include +#include #include #include #include diff --git a/modules/volume/linearlrucache.h b/modules/volume/linearlrucache.h index 8ec6d40f67..8dad14e140 100644 --- a/modules/volume/linearlrucache.h +++ b/modules/volume/linearlrucache.h @@ -25,7 +25,7 @@ #ifndef __OPENSPACE_MODULE_VOLUME___LINEARLRUCACHE___H__ #define __OPENSPACE_MODULE_VOLUME___LINEARLRUCACHE___H__ -#include +#include #include #include diff --git a/modules/volume/lrucache.h b/modules/volume/lrucache.h index 0a4578048c..5959ea128f 100644 --- a/modules/volume/lrucache.h +++ b/modules/volume/lrucache.h @@ -25,7 +25,7 @@ #ifndef __OPENSPACE_MODULE_VOLUME___LRUCACHE___H__ #define __OPENSPACE_MODULE_VOLUME___LRUCACHE___H__ -#include +#include #include #include diff --git a/modules/volume/volumeutils.h b/modules/volume/volumeutils.h index 9999f7f48d..cf7aeaef13 100644 --- a/modules/volume/volumeutils.h +++ b/modules/volume/volumeutils.h @@ -25,7 +25,7 @@ #ifndef __OPENSPACE_MODULE_VOLUME___VOLUMEUTILS___H__ #define __OPENSPACE_MODULE_VOLUME___VOLUMEUTILS___H__ -#include +#include namespace openspace { namespace volumeutils { diff --git a/src/util/blockplaneintersectiongeometry.cpp b/src/util/blockplaneintersectiongeometry.cpp index 105c6893d0..a3e5bcb2eb 100644 --- a/src/util/blockplaneintersectiongeometry.cpp +++ b/src/util/blockplaneintersectiongeometry.cpp @@ -26,7 +26,7 @@ #include -#include +#include #include #include diff --git a/support/coding/check_style_guide.py b/support/coding/check_style_guide.py index 4940eede90..502e872025 100644 --- a/support/coding/check_style_guide.py +++ b/support/coding/check_style_guide.py @@ -39,6 +39,7 @@ guards for correctness. At the moment this includes: module includes have the module name in it * The correct submodule is used * Checking for duplicates between all files + * Checking that no file includes glm header directly If this script is executed from the base directory of OpenSpace, no arguments need to be passed, otherwise the first and only argument has to point to the base directory. @@ -62,6 +63,8 @@ def get_ifndef_symbol(lines): result = re.search('#ifndef (.*)\n', lines[index[0]]) return result.group(1), index[0] + + def get_define_symbol(lines): index = [i for i,s in enumerate(lines) if '#define ' in s] @@ -71,6 +74,8 @@ def get_define_symbol(lines): result = re.search('#define (.*)\n', lines[index[0]]) return result.group(1), index[0] + + def check_correctness(lines): ifndef_symbol, line_number = get_ifndef_symbol(lines) if line_number == -1: @@ -86,6 +91,8 @@ def check_correctness(lines): return '' + + def check_equality(lines): ifndef, _ = get_ifndef_symbol(lines) define, _ = get_define_symbol(lines) @@ -95,6 +102,8 @@ def check_equality(lines): else: return ifndef + ' ' + define + + def check_styling(lines): ifndef_symbol, ifndef_line = get_ifndef_symbol(lines) _, define_line = get_define_symbol(lines) @@ -120,6 +129,8 @@ def check_styling(lines): return '' + + def check_styling_filename(lines, filename): ifndef_symbol, _ = get_ifndef_symbol(lines) file = os.path.splitext(os.path.basename(filename))[0].upper() @@ -127,6 +138,8 @@ def check_styling_filename(lines, filename): if not (file in ifndef_symbol or file in ifndef_symbol.replace('_', '')): return 'Malformed include guard: ' + ifndef_symbol + ' || ' + file + + def check_comment(lines): ifndef_symbol, _ = get_ifndef_symbol(lines) @@ -138,6 +151,8 @@ def check_comment(lines): else: return '' + + def check_copyright(lines): index = [i for i,s in enumerate(lines[0:23]) if 'Copyright' in s] @@ -154,6 +169,8 @@ def check_copyright(lines): else: return '' + + def check_naming_convention_component(lines, component): ifndef_symbol, _ = get_ifndef_symbol(lines) @@ -164,6 +181,8 @@ def check_naming_convention_component(lines, component): else: return '' + + def check_naming_convention_subcomponent(lines, component, file): ifndef_symbol, _ = get_ifndef_symbol(lines) @@ -180,6 +199,8 @@ def check_naming_convention_subcomponent(lines, component, file): else: return '' + + def check_duplicates(lines, previousSymbols): ifndef_symbol, _ = get_ifndef_symbol(lines) @@ -188,8 +209,29 @@ def check_duplicates(lines, previousSymbols): else: return True, ifndef_symbol + + +def check_glm_header(lines, file): + Allowed_Files = [ + 'ghoul/glm.h' + ] + + for f in Allowed_Files: + if f in file: + return '' + + index = [i for i,s in enumerate(lines) + if '#include ' in s or + '#include "glm/glm.hpp>"' in s] + + if len(index) > 0: + return 'File used wrong glm include. Use "#include " instead' + else: + return '' + + previousSymbols = {} -def check_file(file, component): +def check_header_file(file, component): with open(file, 'r+') as f: lines = f.readlines() @@ -239,23 +281,47 @@ def check_file(file, component): print(file, '\t', 'Duplicate include guard', symbol, 'first in', previousSymbols[symbol]) return else: - previousSymbols[symbol] = file + previousSymbols[symbol] = file -def check_files(positiveList, negativeList, component): + header = check_glm_header(lines, file) + if header: + print(file, '\t', 'Illegal glm header include', header) + return + + +def check_source_file(file, component): + with open(file, 'r+') as f: + lines = f.readlines() + + header = check_glm_header(lines, file) + if header: + print(file, '\t', 'Illegal glm header include', header) + return + + + +def check_files(positiveList, negativeList, component, check_function): files = glob.glob(positiveList, recursive=True) negativeFiles = glob.glob(negativeList, recursive=True) files = [f for f in files if f not in negativeFiles] for file in files: - check_file(file, component) + check_function(file, component) + + basePath = './' if len(sys.argv) > 1: basePath = sys.argv[1] + '/' -check_files(basePath + 'include/**/*.h', '', 'openspace_core') -check_files(basePath + 'apps/**/*.h', basePath + 'apps/**/ext/**/*.h', 'openspace_app') -check_files(basePath + 'modules/**/*.h', basePath + 'modules/**/ext/**/*.h', 'openspace_module') -check_files(basePath + 'ext/ghoul/include/**/*.h', '', 'ghoul') +check_files(basePath + 'include/**/*.h', '', 'openspace_core', check_header_file) +check_files(basePath + 'apps/**/*.h', basePath + 'apps/**/ext/**/*.h', 'openspace_app', check_header_file) +check_files(basePath + 'modules/**/*.h', basePath + 'modules/**/ext/**/*.h', 'openspace_module', check_header_file) +check_files(basePath + 'ext/ghoul/include/**/*.h', '', 'ghoul', check_header_file) + +check_files(basePath + 'src/**/*.cpp', '', 'openspace_core', check_source_file) +check_files(basePath + 'apps/**/*.cpp', basePath + 'apps/**/ext/**/*.cpp', 'openspace_app', check_source_file) +check_files(basePath + 'modules/**/*.cpp', basePath + 'modules/**/ext/**/*.cpp', 'openspace_module', check_source_file) +check_files(basePath + 'ext/ghoul/include/**/*.cpp', '', 'ghoul', check_source_file) From efe205c2096edde1c5defe572d5457d29a118376 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Tue, 14 Feb 2017 18:10:28 -0500 Subject: [PATCH 17/96] =?UTF-8?q?-=20Add=20initial=20tracing=20calls=20ada?= =?UTF-8?q?pting=20to=20new=20Ghoul=20change=20of=20adding=20a=20loglevel?= =?UTF-8?q?=20of=20=E2=80=98Trace=E2=80=99=20-=20Adapt=20js=20and=20css=20?= =?UTF-8?q?files=20to=20show=20trace=20files=20in=20log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/OpenSpace/main.cpp | 27 ++++++++++++++++++++++++--- data/web/log/script.js | 2 +- data/web/log/style.css | 9 +++++++++ ext/ghoul | 2 +- src/engine/openspaceengine.cpp | 11 +++++++++++ src/rendering/renderengine.cpp | 5 +++++ src/scene/scene.cpp | 4 ++++ src/scripting/scriptengine.cpp | 7 +++++++ src/scripting/scriptengine_lua.inl | 11 +++++++++++ 9 files changed, 73 insertions(+), 5 deletions(-) diff --git a/apps/OpenSpace/main.cpp b/apps/OpenSpace/main.cpp index ae175f5218..90fe52a028 100644 --- a/apps/OpenSpace/main.cpp +++ b/apps/OpenSpace/main.cpp @@ -168,9 +168,10 @@ int main(int argc, char** argv) { } // Main loop - LDEBUG("Starting rendering loop"); try { + LDEBUG("Starting rendering loop"); _sgctEngine->render(); + LDEBUG("Ending rendering loop"); } catch (const ghoul::RuntimeError& e) { // Write out all of the information about the exception, flush the logs, and throw @@ -207,6 +208,7 @@ int main(int argc, char** argv) { } void mainInitFunc() { + LTRACE("main::mainInitFunc(begin)"); //is this node the master? (must be set after call to _sgctEngine->init()) OsEng.setMaster(_sgctEngine->isMaster()); @@ -237,12 +239,14 @@ void mainInitFunc() { p->setClearColor(glm::vec4(0.f, 0.f, 0.f, 1.f)); } } - + LTRACE("main::mainInitFunc(end)"); } void mainPreSyncFunc() { + LTRACE("main::mainPreSyncFunc(begin)"); OsEng.setRunTime(sgct::Engine::getTime()); OsEng.preSynchronization(); + LTRACE("main::mainPreSyncFunc(end)"); } volatile bool busyWaitDecode = false; @@ -252,10 +256,13 @@ void mainPostSyncPreDrawFunc() { // std::this_thread::sleep_for(std::chrono::microseconds(10)); // } // } + LTRACE("main::postSynchronizationPreDraw(begin)"); OsEng.postSynchronizationPreDraw(); + LTRACE("main::postSynchronizationPreDraw(end)"); } void mainRenderFunc() { + LTRACE("main::mainRenderFunc(begin)"); using glm::mat4; using glm::translate; //not the most efficient, but for clarity @JK @@ -270,10 +277,13 @@ void mainRenderFunc() { mat4 projectionMatrix = _sgctEngine->getCurrentProjectionMatrix(); OsEng.render(projectionMatrix, viewMatrix); + LTRACE("main::mainRenderFunc(end)"); } void mainPostDrawFunc() { + LTRACE("main::mainPostDrawFunc(begin)"); OsEng.postDraw(); + LTRACE("main::mainPostDrawFunc(end)"); // if (OsEng.logSGCTOutOfOrderErrors()) { // if (sgct::Engine::instance()->isMaster()) { @@ -290,11 +300,15 @@ void mainPostDrawFunc() { } void mainExternalControlCallback(const char* receivedChars, int size) { - if (OsEng.isMaster()) + LTRACE("main::mainExternalControlCallback(begin)"); + if (OsEng.isMaster()) { OsEng.externalControlCallback(receivedChars, size, 0); + } + LTRACE("main::mainExternalControlCallback(end)"); } void mainKeyboardCallback(int key, int, int action, int mods) { + LTRACE("main::mainKeyboardCallback(begin)"); if (OsEng.isMaster()) { OsEng.keyboardCallback( openspace::Key(key), @@ -302,15 +316,18 @@ void mainKeyboardCallback(int key, int, int action, int mods) { openspace::KeyAction(action) ); } + LTRACE("main::mainKeyboardCallback(begin)"); } void mainMouseButtonCallback(int key, int action) { + LTRACE("main::mainMouseButtonCallback(begin)"); if (OsEng.isMaster()) { OsEng.mouseButtonCallback( openspace::MouseButton(key), openspace::MouseAction(action) ); } + LTRACE("main::mainMouseButtonCallback(end)"); } void mainMousePosCallback(double x, double y) { @@ -329,11 +346,15 @@ void mainCharCallback(unsigned int codepoint, int mods) { } void mainEncodeFun() { + LTRACE("main::mainEncodeFun(begin)"); OsEng.encode(); + LTRACE("main::mainEncodeFun(end)"); } void mainDecodeFun() { + LTRACE("main::mainDecodeFun(begin)"); OsEng.decode(); + LTRACE("main::mainDecodeFun(end)"); } void mainLogCallback(const char* msg) { diff --git a/data/web/log/script.js b/data/web/log/script.js index fea743117f..ac198a1189 100644 --- a/data/web/log/script.js +++ b/data/web/log/script.js @@ -1,4 +1,4 @@ -var levels = ['debug', 'info', 'warning', 'error', 'fatal']; +var levels = ['trace', 'debug', 'info', 'warning', 'error', 'fatal']; var filterLevel = 0; function insertAfter(newNode, referenceNode) { diff --git a/data/web/log/style.css b/data/web/log/style.css index 3aa140b30e..80a17198ed 100644 --- a/data/web/log/style.css +++ b/data/web/log/style.css @@ -27,6 +27,15 @@ label { margin-right: 0.5em; } +.log-level-trace { + color: #eeeeee; + background-color: #aaaaaa; + border-bottom: 1px solid #eaeaea; +} +.log-level-trace td:first-child { + border-left: 10px solid #eaeaea; +} + .log-level-debug { background-color: #bbdda9; border-bottom: 1px solid #7bc142; diff --git a/ext/ghoul b/ext/ghoul index 6adcb40525..11ebef1385 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 6adcb40525e5c052b63a7a764d12ea4da897c015 +Subproject commit 11ebef1385689d62e2b08e93aaf755533d0ab343 diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index b3824c0d93..0c48ebdfaa 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -822,6 +822,17 @@ void OpenSpaceEngine::configureLogging() { LogMgr.addLog(std::make_unique()); } #endif // WIN32 + +#ifndef GHOUL_LOGGING_ENABLE_TRACE + std::string logLevel; + configurationManager().getValue(KeyLogLevel, logLevel); + LogLevel level = ghoul::logging::levelFromString(logLevel); + + if (level == ghoul::logging::LogLevel::Trace) { + LWARNING("Desired logging level is set to 'Trace' but application was " << + "compiled without Trace support"); + } +#endif // GHOUL_LOGGING_ENABLE_TRACE } bool OpenSpaceEngine::initializeGL() { diff --git a/src/rendering/renderengine.cpp b/src/rendering/renderengine.cpp index 42c50e3953..deb3e0a974 100644 --- a/src/rendering/renderengine.cpp +++ b/src/rendering/renderengine.cpp @@ -362,6 +362,7 @@ bool RenderEngine::initializeGL() { } void RenderEngine::updateSceneGraph() { + LTRACE("RenderEngine::updateSceneGraph(begin)"); _sceneGraph->update({ glm::dvec3(0), glm::dmat3(1), @@ -380,6 +381,8 @@ void RenderEngine::updateSceneGraph() { //if (const SceneGraphNode* node = OsEng.ref().interactionHandler().focusNode()){ //node->updateCamera(_mainCamera); //} + + LTRACE("RenderEngine::updateSceneGraph(end)"); } void RenderEngine::updateShaderPrograms() { @@ -466,6 +469,7 @@ void RenderEngine::updateFade() { } void RenderEngine::render(const glm::mat4& projectionMatrix, const glm::mat4& viewMatrix){ + LTRACE("RenderEngine::render(begin)"); _mainCamera->sgctInternal.setViewMatrix(viewMatrix); _mainCamera->sgctInternal.setProjectionMatrix(projectionMatrix); @@ -494,6 +498,7 @@ void RenderEngine::render(const glm::mat4& projectionMatrix, const glm::mat4& vi if (screenSpaceRenderable->isEnabled() && screenSpaceRenderable->isReady()) screenSpaceRenderable->render(); } + LTRACE("RenderEngine::render(end)"); } void RenderEngine::renderShutdownInformation(float timer, float fullTime) { diff --git a/src/scene/scene.cpp b/src/scene/scene.cpp index 4e0f32252f..423720a905 100644 --- a/src/scene/scene.cpp +++ b/src/scene/scene.cpp @@ -144,7 +144,9 @@ void Scene::update(const UpdateData& data) { for (SceneGraphNode* node : _graph.nodes()) { try { + LTRACE("Scene::update(begin '" + node->name() + "')"); node->update(data); + LTRACE("Scene::update(end '" + node->name() + "')"); } catch (const ghoul::RuntimeError& e) { LERRORC(e.component, e.what()); @@ -160,7 +162,9 @@ void Scene::evaluate(Camera* camera) { void Scene::render(const RenderData& data, RendererTasks& tasks) { for (SceneGraphNode* node : _graph.nodes()) { + LTRACE("Scene::render(begin '" + node->name() + "')"); node->render(data, tasks); + LTRACE("Scene::render(end '" + node->name() + "')"); } } diff --git a/src/scripting/scriptengine.cpp b/src/scripting/scriptengine.cpp index 68ad95f34a..64e559ab9a 100644 --- a/src/scripting/scriptengine.cpp +++ b/src/scripting/scriptengine.cpp @@ -369,6 +369,13 @@ void ScriptEngine::addBaseLibrary() { LuaLibrary lib = { "", { + { + "printTrace", + &luascriptfunctions::printTrace, + "*", + "Logs the passed value to the installed LogManager with a LogLevel of " + "'Trace'" + }, { "printDebug", &luascriptfunctions::printDebug, diff --git a/src/scripting/scriptengine_lua.inl b/src/scripting/scriptengine_lua.inl index d1880ad536..0f5fe9355b 100644 --- a/src/scripting/scriptengine_lua.inl +++ b/src/scripting/scriptengine_lua.inl @@ -59,6 +59,17 @@ namespace luascriptfunctions { return 0; } + /** + * \ingroup LuaScripts + * printTrace(*): + * Logs the passed value to the installed LogManager with a LogLevel of 'Trace'. + * For Boolean, numbers, and strings, the internal values are printed, for all other + * types, the type is printed instead + */ + int printTrace(lua_State* L) { + return printInternal(ghoul::logging::LogLevel::Trace, L); + } + /** * \ingroup LuaScripts * printDebug(*): From 729bffb0f93ad133b207f251892a194792153da4 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Tue, 14 Feb 2017 18:11:02 -0500 Subject: [PATCH 18/96] Improve SpecificationError reporting Fix spelling error in ModuleEngine --- include/openspace/documentation/documentation.h | 1 + openspace.cfg | 1 + src/documentation/documentation.cpp | 13 +++++++++++++ src/engine/configurationmanager_doc.inl | 4 ++-- src/engine/moduleengine.cpp | 2 +- src/engine/openspaceengine.cpp | 12 ++++++++++++ 6 files changed, 30 insertions(+), 3 deletions(-) diff --git a/include/openspace/documentation/documentation.h b/include/openspace/documentation/documentation.h index 19d9433664..28f777cbef 100644 --- a/include/openspace/documentation/documentation.h +++ b/include/openspace/documentation/documentation.h @@ -316,6 +316,7 @@ using documentation::Documentation; namespace std { std::string to_string(openspace::documentation::TestResult::Offense::Reason reason); +std::string to_string(openspace::documentation::TestResult::Warning::Reason reason); } // namespace std diff --git a/openspace.cfg b/openspace.cfg index 277e10f809..5233af0293 100644 --- a/openspace.cfg +++ b/openspace.cfg @@ -34,6 +34,7 @@ return { Light = "${FONTS}/Roboto/Roboto-Regular.ttf" }, Logging = { + -- LogLevel = "Trace", LogLevel = "Debug", ImmediateFlush = false, Logs = { diff --git a/src/documentation/documentation.cpp b/src/documentation/documentation.cpp index 18e644dd65..ee1ee34ee8 100644 --- a/src/documentation/documentation.cpp +++ b/src/documentation/documentation.cpp @@ -78,6 +78,13 @@ std::string to_string(openspace::documentation::TestResult::Offense::Reason reas return "Wrong type"; } } + +std::string to_string(openspace::documentation::TestResult::Warning::Reason reason) { + switch (reason) { + case openspace::documentation::TestResult::Warning::Reason::Deprecated: + return "Deprecated"; + } +} } // namespace std @@ -91,6 +98,12 @@ SpecificationError::SpecificationError(TestResult res, std::string component) , result(std::move(res)) { ghoul_assert(!result.success, "Result's success must be false"); + + message += " ("; + for (const TestResult::Offense& o : result.offenses) { + message += o.offender + ','; + } + message.back() = ')'; } DocumentationEntry::DocumentationEntry(std::string k, std::shared_ptr v, diff --git a/src/engine/configurationmanager_doc.inl b/src/engine/configurationmanager_doc.inl index 86943102a3..2577033c89 100644 --- a/src/engine/configurationmanager_doc.inl +++ b/src/engine/configurationmanager_doc.inl @@ -72,7 +72,7 @@ Documentation ConfigurationManager::Documentation() { ConfigurationManager::PartLogLevel, new StringInListVerifier( // List from logmanager.cpp::levelFromString - { "Debug", "Info", "Warning", "Error", "Fatal", "None" } + { "Trace", "Debug", "Info", "Warning", "Error", "Fatal", "None" } ), "The severity of log messages that will be displayed. Only " "messages of the selected level or higher will be displayed. All " @@ -386,4 +386,4 @@ Documentation ConfigurationManager::Documentation() { }; -} // namespace openspace \ No newline at end of file +} // namespace openspace diff --git a/src/engine/moduleengine.cpp b/src/engine/moduleengine.cpp index a163131845..0b06d6f858 100644 --- a/src/engine/moduleengine.cpp +++ b/src/engine/moduleengine.cpp @@ -48,7 +48,7 @@ void ModuleEngine::initialize() { void ModuleEngine::deinitialize() { LDEBUG("Deinitializing modules"); for (auto& m : _modules) { - LDEBUG("Deinitialieing module '" << m->name() << "'"); + LDEBUG("Deinitializing module '" << m->name() << "'"); m->deinitialize(); } _modules.clear(); diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index 0c48ebdfaa..5b20b44cc9 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -291,6 +292,17 @@ bool OpenSpaceEngine::create(int argc, char** argv, try { _engine->configurationManager().loadFromFile(configurationFilePath); } + catch (const documentation::SpecificationError& e) { + LFATAL("Loading of configuration file '" << configurationFilePath << "' failed"); + for (const documentation::TestResult::Offense& o : e.result.offenses) { + LERRORC(o.offender, std::to_string(o.reason)); + } + for (const documentation::TestResult::Warning& w : e.result.warnings) { + LWARNINGC(w.offender, std::to_string(w.reason)); + } + return false; + + } catch (const ghoul::RuntimeError& e) { LFATAL("Loading of configuration file '" << configurationFilePath << "' failed"); LFATALC(e.component, e.message); From 0d03177d436241213118b96a6e8d119cf989677a Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Wed, 15 Feb 2017 21:20:05 +0100 Subject: [PATCH 19/96] Feature/globebrowsingcleanup (#230) * Initial restructuring of the Globebrowsing branch * Update Ghoul repository Fix include guards * More cleanup * Split texttileprovider subclasses into separate files * Move TileProviders into namespace * Convert static class methods into free functions * Splitting tile subclasses into their own files Remove `using namespace` from header file * Split TileDataSet subclass into separate file Update SGCT reference * Move shader preprocessing data into internal class * More Globebrowsing cleanup * More cleanup Remove unused Convexhull class --- apps/OpenSpace/main.cpp | 2 +- ext/sgct | 2 +- .../openspace/interaction/interactionmode.h | 1 + modules/globebrowsing/CMakeLists.txt | 70 +++- modules/globebrowsing/chunk/chunk.cpp | 52 +-- modules/globebrowsing/chunk/chunk.h | 28 +- .../availabletiledataevaluator.cpp | 57 ++++ .../availabletiledataevaluator.h | 48 +++ .../chunklevelevaluator.h | 40 +-- .../chunklevelevaluator/distanceevaluator.cpp | 75 ++++ .../chunklevelevaluator/distanceevaluator.h | 48 +++ .../projectedareaevaluator.cpp} | 68 +--- .../projectedareaevaluator.h | 51 +++ modules/globebrowsing/chunk/chunknode.cpp | 18 +- modules/globebrowsing/chunk/chunknode.h | 9 +- .../globebrowsing/chunk/culling/chunkculler.h | 52 +++ .../chunk/culling/frustumculler.cpp | 63 ++++ .../culling/frustumculler.h} | 60 ++-- .../horizonculler.cpp} | 33 +- .../{culling.h => culling/horizonculler.h} | 50 +-- modules/globebrowsing/geometry/aabb.cpp | 42 +-- modules/globebrowsing/geometry/aabb.h | 32 +- modules/globebrowsing/geometry/convexhull.cpp | 170 ---------- modules/globebrowsing/geometry/ellipsoid.h | 1 + modules/globebrowsing/geometry/geodetic2.cpp | 210 ------------ modules/globebrowsing/geometry/geodetic2.h | 87 ----- modules/globebrowsing/geometry/geodetic3.h | 41 +++ .../globebrowsing/geometry/geodeticpatch.cpp | 242 +++++++++++++ .../globebrowsing/geometry/geodeticpatch.h | 117 +++++++ modules/globebrowsing/globebrowsingmodule.cpp | 18 +- .../globebrowsing/globes/chunkedlodglobe.cpp | 27 +- .../globebrowsing/globes/chunkedlodglobe.h | 23 +- modules/globebrowsing/globes/pointglobe.h | 2 +- .../globebrowsing/globes/renderableglobe.cpp | 2 +- modules/globebrowsing/meshes/basicgrid.cpp | 18 +- modules/globebrowsing/meshes/basicgrid.h | 15 +- modules/globebrowsing/meshes/grid.h | 10 +- modules/globebrowsing/meshes/skirtedgrid.cpp | 18 +- modules/globebrowsing/meshes/skirtedgrid.h | 8 +- modules/globebrowsing/meshes/trianglesoup.h | 6 +- .../globebrowsing/other/distanceswitch.cpp | 4 + modules/globebrowsing/other/distanceswitch.h | 5 +- modules/globebrowsing/other/lrucache.h | 2 - modules/globebrowsing/other/statscollector.h | 16 +- .../globebrowsing/rendering/chunkrenderer.cpp | 7 +- .../rendering/gpu/gpuchunktile.cpp | 48 +++ .../rendering/gpu/gpuchunktile.h | 77 +++++ .../rendering/gpu/gpuchunktilepile.cpp | 60 ++++ .../rendering/gpu/gpuchunktilepile.h | 76 +++++ .../rendering/gpu/gpuheightlayer.cpp | 52 +++ .../rendering/gpu/gpuheightlayer.h | 74 ++++ .../globebrowsing/rendering/gpu/gpulayer.cpp | 52 +++ .../globebrowsing/rendering/gpu/gpulayer.h | 79 +++++ .../rendering/gpu/gpulayergroup.cpp | 80 +++++ .../rendering/gpu/gpulayergroup.h | 86 +++++ .../rendering/gpu/gpulayermanager.cpp | 65 ++++ .../rendering/gpu/gpulayermanager.h | 75 ++++ .../rendering/gpu/gpulayerrendersettings.cpp | 49 +++ .../rendering/gpu/gpulayerrendersettings.h | 69 ++++ .../rendering/gpu/gputiledepthtransform.cpp | 47 +++ .../rendering/gpu/gputiledepthtransform.h | 68 ++++ .../rendering/gpu/gputileuvtransform.cpp | 49 +++ .../rendering/gpu/gputileuvtransform.h | 68 ++++ .../rendering/gpulayermanager.cpp | 232 ------------- .../globebrowsing/rendering/gpulayermanager.h | 320 ------------------ .../globebrowsing/rendering/layer/layer.cpp | 60 ++++ modules/globebrowsing/rendering/layer/layer.h | 66 ++++ .../rendering/layer/layergroup.cpp | 85 +++++ .../rendering/layer/layergroup.h | 71 ++++ .../rendering/{ => layer}/layermanager.cpp | 94 +---- .../rendering/{ => layer}/layermanager.h | 63 +--- .../rendering/layer/layerrendersettings.cpp | 43 +++ .../rendering/layer/layerrendersettings.h | 45 +++ .../rendering/layershadermanager.cpp | 8 +- .../rendering/layershadermanager.h | 59 ++-- .../globebrowsing/tile/asynctilereader.cpp | 58 +--- modules/globebrowsing/tile/asynctilereader.h | 54 +-- modules/globebrowsing/tile/chunktile.h | 4 +- .../tile/loadjob/diskcachedtileloadjob.cpp | 84 +++++ .../tile/loadjob/diskcachedtileloadjob.h | 58 ++++ modules/globebrowsing/tile/loadjob/loadjob.h | 45 +++ .../tile/loadjob/tileloadjob.cpp | 41 +++ .../globebrowsing/tile/loadjob/tileloadjob.h | 61 ++++ modules/globebrowsing/tile/pixelregion.cpp | 108 +++--- modules/globebrowsing/tile/pixelregion.h | 8 +- modules/globebrowsing/tile/quad.h | 42 +++ modules/globebrowsing/tile/rawtile.cpp | 96 ++++++ modules/globebrowsing/tile/rawtile.h | 61 ++++ modules/globebrowsing/tile/textureformat.h | 43 +++ modules/globebrowsing/tile/tile.cpp | 86 +---- modules/globebrowsing/tile/tile.h | 50 +-- modules/globebrowsing/tile/tiledatalayout.cpp | 92 +++++ modules/globebrowsing/tile/tiledatalayout.h | 57 ++++ modules/globebrowsing/tile/tiledataset.cpp | 53 +-- modules/globebrowsing/tile/tiledataset.h | 54 ++- modules/globebrowsing/tile/tiledatatype.cpp | 24 +- modules/globebrowsing/tile/tiledatatype.h | 18 +- modules/globebrowsing/tile/tilediskcache.cpp | 1 + modules/globebrowsing/tile/tilediskcache.h | 1 - modules/globebrowsing/tile/tileindex.cpp | 2 +- modules/globebrowsing/tile/tileindex.h | 13 +- modules/globebrowsing/tile/tilemetadata.cpp | 60 ++++ modules/globebrowsing/tile/tilemetadata.h | 47 +++ .../tile/tileprovider/cachingtileprovider.cpp | 14 +- .../tile/tileprovider/cachingtileprovider.h | 4 + .../tile/tileprovider/singleimageprovider.cpp | 5 +- .../tile/tileprovider/singleimageprovider.h | 2 + .../sizereferencetileprovider.cpp | 154 +++++++++ .../tileprovider/sizereferencetileprovider.h | 61 ++++ .../tileprovider/temporaltileprovider.cpp | 4 +- .../tile/tileprovider/temporaltileprovider.h | 4 +- .../tile/tileprovider/texttileprovider.cpp | 133 +------- .../tile/tileprovider/texttileprovider.h | 39 +-- .../tileprovider/tileindextileprovider.cpp | 49 +++ .../tile/tileprovider/tileindextileprovider.h | 47 +++ .../tile/tileprovider/tileprovider.cpp | 28 +- .../tile/tileprovider/tileprovider.h | 4 +- .../tile/tileprovider/tileproviderbyindex.cpp | 4 +- .../tile/tileprovider/tileproviderbyindex.h | 4 +- .../tile/tileprovider/tileproviderbylevel.cpp | 12 +- .../tile/tileprovider/tileproviderbylevel.h | 2 + modules/globebrowsing/tile/tileselector.cpp | 15 +- modules/globebrowsing/tile/tileselector.h | 19 +- modules/globebrowsing/tile/tileuvtransform.h | 41 +++ modules/volume/textureslicevolumereader.h | 1 + tests/main.cpp | 1 - tests/test_aabb.inl | 16 +- tests/test_convexhull.inl | 122 ------- 128 files changed, 4073 insertions(+), 2303 deletions(-) create mode 100644 modules/globebrowsing/chunk/chunklevelevaluator/availabletiledataevaluator.cpp create mode 100644 modules/globebrowsing/chunk/chunklevelevaluator/availabletiledataevaluator.h rename modules/globebrowsing/chunk/{ => chunklevelevaluator}/chunklevelevaluator.h (66%) create mode 100644 modules/globebrowsing/chunk/chunklevelevaluator/distanceevaluator.cpp create mode 100644 modules/globebrowsing/chunk/chunklevelevaluator/distanceevaluator.h rename modules/globebrowsing/chunk/{chunklevelevaluator.cpp => chunklevelevaluator/projectedareaevaluator.cpp} (68%) create mode 100644 modules/globebrowsing/chunk/chunklevelevaluator/projectedareaevaluator.h create mode 100644 modules/globebrowsing/chunk/culling/chunkculler.h create mode 100644 modules/globebrowsing/chunk/culling/frustumculler.cpp rename modules/globebrowsing/{geometry/convexhull.h => chunk/culling/frustumculler.h} (64%) rename modules/globebrowsing/chunk/{culling.cpp => culling/horizonculler.cpp} (82%) rename modules/globebrowsing/chunk/{culling.h => culling/horizonculler.h} (67%) delete mode 100644 modules/globebrowsing/geometry/convexhull.cpp create mode 100644 modules/globebrowsing/geometry/geodetic3.h create mode 100644 modules/globebrowsing/geometry/geodeticpatch.cpp create mode 100644 modules/globebrowsing/geometry/geodeticpatch.h create mode 100644 modules/globebrowsing/rendering/gpu/gpuchunktile.cpp create mode 100644 modules/globebrowsing/rendering/gpu/gpuchunktile.h create mode 100644 modules/globebrowsing/rendering/gpu/gpuchunktilepile.cpp create mode 100644 modules/globebrowsing/rendering/gpu/gpuchunktilepile.h create mode 100644 modules/globebrowsing/rendering/gpu/gpuheightlayer.cpp create mode 100644 modules/globebrowsing/rendering/gpu/gpuheightlayer.h create mode 100644 modules/globebrowsing/rendering/gpu/gpulayer.cpp create mode 100644 modules/globebrowsing/rendering/gpu/gpulayer.h create mode 100644 modules/globebrowsing/rendering/gpu/gpulayergroup.cpp create mode 100644 modules/globebrowsing/rendering/gpu/gpulayergroup.h create mode 100644 modules/globebrowsing/rendering/gpu/gpulayermanager.cpp create mode 100644 modules/globebrowsing/rendering/gpu/gpulayermanager.h create mode 100644 modules/globebrowsing/rendering/gpu/gpulayerrendersettings.cpp create mode 100644 modules/globebrowsing/rendering/gpu/gpulayerrendersettings.h create mode 100644 modules/globebrowsing/rendering/gpu/gputiledepthtransform.cpp create mode 100644 modules/globebrowsing/rendering/gpu/gputiledepthtransform.h create mode 100644 modules/globebrowsing/rendering/gpu/gputileuvtransform.cpp create mode 100644 modules/globebrowsing/rendering/gpu/gputileuvtransform.h delete mode 100644 modules/globebrowsing/rendering/gpulayermanager.cpp delete mode 100644 modules/globebrowsing/rendering/gpulayermanager.h create mode 100644 modules/globebrowsing/rendering/layer/layer.cpp create mode 100644 modules/globebrowsing/rendering/layer/layer.h create mode 100644 modules/globebrowsing/rendering/layer/layergroup.cpp create mode 100644 modules/globebrowsing/rendering/layer/layergroup.h rename modules/globebrowsing/rendering/{ => layer}/layermanager.cpp (60%) rename modules/globebrowsing/rendering/{ => layer}/layermanager.h (62%) create mode 100644 modules/globebrowsing/rendering/layer/layerrendersettings.cpp create mode 100644 modules/globebrowsing/rendering/layer/layerrendersettings.h create mode 100644 modules/globebrowsing/tile/loadjob/diskcachedtileloadjob.cpp create mode 100644 modules/globebrowsing/tile/loadjob/diskcachedtileloadjob.h create mode 100644 modules/globebrowsing/tile/loadjob/loadjob.h create mode 100644 modules/globebrowsing/tile/loadjob/tileloadjob.cpp create mode 100644 modules/globebrowsing/tile/loadjob/tileloadjob.h create mode 100644 modules/globebrowsing/tile/quad.h create mode 100644 modules/globebrowsing/tile/rawtile.cpp create mode 100644 modules/globebrowsing/tile/rawtile.h create mode 100644 modules/globebrowsing/tile/textureformat.h create mode 100644 modules/globebrowsing/tile/tiledatalayout.cpp create mode 100644 modules/globebrowsing/tile/tiledatalayout.h create mode 100644 modules/globebrowsing/tile/tilemetadata.cpp create mode 100644 modules/globebrowsing/tile/tilemetadata.h create mode 100644 modules/globebrowsing/tile/tileprovider/sizereferencetileprovider.cpp create mode 100644 modules/globebrowsing/tile/tileprovider/sizereferencetileprovider.h create mode 100644 modules/globebrowsing/tile/tileprovider/tileindextileprovider.cpp create mode 100644 modules/globebrowsing/tile/tileprovider/tileindextileprovider.h create mode 100644 modules/globebrowsing/tile/tileuvtransform.h delete mode 100644 tests/test_convexhull.inl diff --git a/apps/OpenSpace/main.cpp b/apps/OpenSpace/main.cpp index 90fe52a028..f0cc00ece2 100644 --- a/apps/OpenSpace/main.cpp +++ b/apps/OpenSpace/main.cpp @@ -117,7 +117,7 @@ int main(int argc, char** argv) { // deallocate sgct c arguments delete[] newArgv; - + // Bind functions _sgctEngine->setInitOGLFunction(mainInitFunc); _sgctEngine->setPreSyncFunction(mainPreSyncFunc); diff --git a/ext/sgct b/ext/sgct index b3bf32e8bd..32ca27704f 160000 --- a/ext/sgct +++ b/ext/sgct @@ -1 +1 @@ -Subproject commit b3bf32e8bd59c7a79e899face441a26a361fe982 +Subproject commit 32ca27704ff5839ad8d5b2df46c5fdac8ed03749 diff --git a/include/openspace/interaction/interactionmode.h b/include/openspace/interaction/interactionmode.h index 4022383ae9..f383866c73 100644 --- a/include/openspace/interaction/interactionmode.h +++ b/include/openspace/interaction/interactionmode.h @@ -33,6 +33,7 @@ #ifdef OPENSPACE_MODULE_GLOBEBROWSING_ENABLED #include #include +#include #endif #include diff --git a/modules/globebrowsing/CMakeLists.txt b/modules/globebrowsing/CMakeLists.txt index d5859f8bed..c91053e164 100644 --- a/modules/globebrowsing/CMakeLists.txt +++ b/modules/globebrowsing/CMakeLists.txt @@ -26,16 +26,22 @@ include(${OPENSPACE_CMAKE_EXT_DIR}/module_definition.cmake) set(HEADER_FILES ${CMAKE_CURRENT_SOURCE_DIR}/chunk/chunk.h - ${CMAKE_CURRENT_SOURCE_DIR}/chunk/chunklevelevaluator.h ${CMAKE_CURRENT_SOURCE_DIR}/chunk/chunknode.h - ${CMAKE_CURRENT_SOURCE_DIR}/chunk/culling.h + ${CMAKE_CURRENT_SOURCE_DIR}/chunk/chunklevelevaluator/chunklevelevaluator.h + ${CMAKE_CURRENT_SOURCE_DIR}/chunk/chunklevelevaluator/availabletiledataevaluator.h + ${CMAKE_CURRENT_SOURCE_DIR}/chunk/chunklevelevaluator/distanceevaluator.h + ${CMAKE_CURRENT_SOURCE_DIR}/chunk/chunklevelevaluator/projectedareaevaluator.h + ${CMAKE_CURRENT_SOURCE_DIR}/chunk/culling/chunkculler.h + ${CMAKE_CURRENT_SOURCE_DIR}/chunk/culling/frustumculler.h + ${CMAKE_CURRENT_SOURCE_DIR}/chunk/culling/horizonculler.h ${CMAKE_CURRENT_SOURCE_DIR}/geometry/aabb.h ${CMAKE_CURRENT_SOURCE_DIR}/geometry/angle.h ${CMAKE_CURRENT_SOURCE_DIR}/geometry/angle.inl - ${CMAKE_CURRENT_SOURCE_DIR}/geometry/convexhull.h ${CMAKE_CURRENT_SOURCE_DIR}/geometry/ellipsoid.h ${CMAKE_CURRENT_SOURCE_DIR}/geometry/geodetic2.h + ${CMAKE_CURRENT_SOURCE_DIR}/geometry/geodetic3.h + ${CMAKE_CURRENT_SOURCE_DIR}/geometry/geodeticpatch.h ${CMAKE_CURRENT_SOURCE_DIR}/globes/chunkedlodglobe.h ${CMAKE_CURRENT_SOURCE_DIR}/globes/pointglobe.h @@ -58,24 +64,45 @@ set(HEADER_FILES ${CMAKE_CURRENT_SOURCE_DIR}/other/threadpool.h ${CMAKE_CURRENT_SOURCE_DIR}/rendering/chunkrenderer.h - ${CMAKE_CURRENT_SOURCE_DIR}/rendering/gpulayermanager.h - ${CMAKE_CURRENT_SOURCE_DIR}/rendering/layermanager.h ${CMAKE_CURRENT_SOURCE_DIR}/rendering/layershadermanager.h + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/gpu/gpuchunktile.h + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/gpu/gpuchunktilepile.h + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/gpu/gpuheightlayer.h + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/gpu/gpulayer.h + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/gpu/gpulayergroup.h + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/gpu/gpulayermanager.h + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/gpu/gpulayerrendersettings.h + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/gpu/gputiledepthtransform.h + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/gpu/gputileuvtransform.h + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/layer/layer.h + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/layer/layergroup.h + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/layer/layermanager.h + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/layer/layerrendersettings.h ${CMAKE_CURRENT_SOURCE_DIR}/tile/asynctilereader.h ${CMAKE_CURRENT_SOURCE_DIR}/tile/chunktile.h ${CMAKE_CURRENT_SOURCE_DIR}/tile/pixelregion.h + ${CMAKE_CURRENT_SOURCE_DIR}/tile/rawtile.h + ${CMAKE_CURRENT_SOURCE_DIR}/tile/textureformat.h ${CMAKE_CURRENT_SOURCE_DIR}/tile/tile.h + ${CMAKE_CURRENT_SOURCE_DIR}/tile/tiledatalayout.h ${CMAKE_CURRENT_SOURCE_DIR}/tile/tiledataset.h ${CMAKE_CURRENT_SOURCE_DIR}/tile/tiledatatype.h ${CMAKE_CURRENT_SOURCE_DIR}/tile/tiledepthtransform.h ${CMAKE_CURRENT_SOURCE_DIR}/tile/tilediskcache.h ${CMAKE_CURRENT_SOURCE_DIR}/tile/tileindex.h + ${CMAKE_CURRENT_SOURCE_DIR}/tile/tilemetadata.h ${CMAKE_CURRENT_SOURCE_DIR}/tile/tileselector.h + ${CMAKE_CURRENT_SOURCE_DIR}/tile/tileuvtransform.h + ${CMAKE_CURRENT_SOURCE_DIR}/tile/loadjob/diskcachedtileloadjob.h + ${CMAKE_CURRENT_SOURCE_DIR}/tile/loadjob/loadjob.h + ${CMAKE_CURRENT_SOURCE_DIR}/tile/loadjob/tileloadjob.h ${CMAKE_CURRENT_SOURCE_DIR}/tile/tileprovider/cachingtileprovider.h ${CMAKE_CURRENT_SOURCE_DIR}/tile/tileprovider/singleimageprovider.h + ${CMAKE_CURRENT_SOURCE_DIR}/tile/tileprovider/sizereferencetileprovider.h ${CMAKE_CURRENT_SOURCE_DIR}/tile/tileprovider/temporaltileprovider.h ${CMAKE_CURRENT_SOURCE_DIR}/tile/tileprovider/texttileprovider.h + ${CMAKE_CURRENT_SOURCE_DIR}/tile/tileprovider/tileindextileprovider.h ${CMAKE_CURRENT_SOURCE_DIR}/tile/tileprovider/tileprovider.h ${CMAKE_CURRENT_SOURCE_DIR}/tile/tileprovider/tileproviderbyindex.h ${CMAKE_CURRENT_SOURCE_DIR}/tile/tileprovider/tileproviderbylevel.h @@ -83,14 +110,19 @@ set(HEADER_FILES set(SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/chunk/chunk.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/chunk/chunklevelevaluator.cpp ${CMAKE_CURRENT_SOURCE_DIR}/chunk/chunknode.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/chunk/culling.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/chunk/chunklevelevaluator/availabletiledataevaluator.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/chunk/chunklevelevaluator/distanceevaluator.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/chunk/chunklevelevaluator/projectedareaevaluator.cpp + + ${CMAKE_CURRENT_SOURCE_DIR}/chunk/culling/frustumculler.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/chunk/culling/horizonculler.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/geometry/aabb.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/geometry/convexhull.cpp ${CMAKE_CURRENT_SOURCE_DIR}/geometry/ellipsoid.cpp ${CMAKE_CURRENT_SOURCE_DIR}/geometry/geodetic2.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/geometry/geodeticpatch.cpp ${CMAKE_CURRENT_SOURCE_DIR}/globes/chunkedlodglobe.cpp ${CMAKE_CURRENT_SOURCE_DIR}/globes/pointglobe.cpp @@ -106,22 +138,40 @@ set(SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/other/threadpool.cpp ${CMAKE_CURRENT_SOURCE_DIR}/rendering/chunkrenderer.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/rendering/gpulayermanager.cpp ${CMAKE_CURRENT_SOURCE_DIR}/rendering/layershadermanager.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/rendering/layermanager.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/gpu/gpuchunktile.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/gpu/gpuchunktilepile.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/gpu/gpuheightlayer.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/gpu/gpulayer.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/gpu/gpulayergroup.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/gpu/gpulayermanager.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/gpu/gpulayerrendersettings.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/gpu/gputiledepthtransform.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/gpu/gputileuvtransform.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/layer/layer.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/layer/layergroup.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/layer/layermanager.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/layer/layerrendersettings.cpp ${CMAKE_CURRENT_SOURCE_DIR}/tile/asynctilereader.cpp ${CMAKE_CURRENT_SOURCE_DIR}/tile/pixelregion.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/tile/rawtile.cpp ${CMAKE_CURRENT_SOURCE_DIR}/tile/tile.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/tile/tiledatalayout.cpp ${CMAKE_CURRENT_SOURCE_DIR}/tile/tiledataset.cpp ${CMAKE_CURRENT_SOURCE_DIR}/tile/tiledatatype.cpp ${CMAKE_CURRENT_SOURCE_DIR}/tile/tilediskcache.cpp ${CMAKE_CURRENT_SOURCE_DIR}/tile/tileindex.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/tile/tilemetadata.cpp ${CMAKE_CURRENT_SOURCE_DIR}/tile/tileselector.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/tile/loadjob/diskcachedtileloadjob.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/tile/loadjob/tileloadjob.cpp ${CMAKE_CURRENT_SOURCE_DIR}/tile/tileprovider/cachingtileprovider.cpp ${CMAKE_CURRENT_SOURCE_DIR}/tile/tileprovider/singleimageprovider.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/tile/tileprovider/sizereferencetileprovider.cpp ${CMAKE_CURRENT_SOURCE_DIR}/tile/tileprovider/temporaltileprovider.cpp ${CMAKE_CURRENT_SOURCE_DIR}/tile/tileprovider/texttileprovider.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/tile/tileprovider/tileindextileprovider.cpp ${CMAKE_CURRENT_SOURCE_DIR}/tile/tileprovider/tileprovider.cpp ${CMAKE_CURRENT_SOURCE_DIR}/tile/tileprovider/tileproviderbyindex.cpp ${CMAKE_CURRENT_SOURCE_DIR}/tile/tileprovider/tileproviderbylevel.cpp diff --git a/modules/globebrowsing/chunk/chunk.cpp b/modules/globebrowsing/chunk/chunk.cpp index 490739c24b..54284da290 100644 --- a/modules/globebrowsing/chunk/chunk.cpp +++ b/modules/globebrowsing/chunk/chunk.cpp @@ -26,8 +26,9 @@ #include #include -#include +#include #include +#include namespace openspace { namespace globebrowsing { @@ -58,34 +59,34 @@ bool Chunk::isVisible() const { } Chunk::Status Chunk::update(const RenderData& data) { - auto savedCamera = _owner.savedCamera(); + const auto& savedCamera = _owner.savedCamera(); const Camera& camRef = savedCamera != nullptr ? *savedCamera : data.camera; RenderData myRenderData = { camRef, data.position, data.doPerformanceMeasurement }; _isVisible = true; if (_owner.chunkedLodGlobe()->testIfCullable(*this, myRenderData)) { _isVisible = false; - return Status::WANT_MERGE; + return Status::WantMerge; } int desiredLevel = _owner.chunkedLodGlobe()->getDesiredLevel(*this, myRenderData); if (desiredLevel < _tileIndex.level) { - return Status::WANT_MERGE; + return Status::WantMerge; } else if (_tileIndex.level < desiredLevel) { - return Status::WANT_SPLIT; + return Status::WantSplit; } else { - return Status::DO_NOTHING; + return Status::DoNothing; } } Chunk::BoundingHeights Chunk::getBoundingHeights() const { - BoundingHeights boundingHeights; - boundingHeights.max = 0; - boundingHeights.min = 0; - boundingHeights.available = false; + BoundingHeights boundingHeights { + 0.f, 0.f, + false + }; // In the future, this should be abstracted away and more easily queryable. // One must also handle how to sample pick one out of multiplte heightmaps @@ -94,48 +95,48 @@ Chunk::BoundingHeights Chunk::getBoundingHeights() const { // The raster of a height map is the first one. We assume that the height map is // a single raster image. If it is not we will just use the first raster // (that is channel 0). - size_t HEIGHT_CHANNEL = 0; + const size_t HeightChannel = 0; const LayerGroup& heightmaps = layerManager->layerGroup(LayerManager::HeightLayers); - std::vector chunkTiles = TileSelector::getTilesSortedByHighestResolution( + std::vector chunkTiles = tileselector::getTilesSortedByHighestResolution( heightmaps, _tileIndex ); bool lastHadMissingData = true; - for (auto chunkTile : chunkTiles) { - bool goodTile = chunkTile.tile.status == Tile::Status::OK; - bool hastileMetaData = chunkTile.tile.metaData != nullptr; + for (const auto& chunkTile : chunkTiles) { + bool goodTile = (chunkTile.tile.status == Tile::Status::OK); + bool hasTileMetaData = (chunkTile.tile.metaData != nullptr); - if (goodTile && hastileMetaData) { + if (goodTile && hasTileMetaData) { auto tileMetaData = chunkTile.tile.metaData; if (!boundingHeights.available) { - if (tileMetaData->hasMissingData[HEIGHT_CHANNEL]) { + if (tileMetaData->hasMissingData[HeightChannel]) { boundingHeights.min = std::min( DEFAULT_HEIGHT, - tileMetaData->minValues[HEIGHT_CHANNEL] + tileMetaData->minValues[HeightChannel] ); boundingHeights.max = std::max( DEFAULT_HEIGHT, - tileMetaData->maxValues[HEIGHT_CHANNEL] + tileMetaData->maxValues[HeightChannel] ); } else { - boundingHeights.min = tileMetaData->minValues[HEIGHT_CHANNEL]; - boundingHeights.max = tileMetaData->maxValues[HEIGHT_CHANNEL]; + boundingHeights.min = tileMetaData->minValues[HeightChannel]; + boundingHeights.max = tileMetaData->maxValues[HeightChannel]; } boundingHeights.available = true; } else { boundingHeights.min = std::min( boundingHeights.min, - tileMetaData->minValues[HEIGHT_CHANNEL] + tileMetaData->minValues[HeightChannel] ); boundingHeights.max = std::max( boundingHeights.max, - tileMetaData->maxValues[HEIGHT_CHANNEL] + tileMetaData->maxValues[HeightChannel] ); } - lastHadMissingData = tileMetaData->hasMissingData[HEIGHT_CHANNEL]; + lastHadMissingData = tileMetaData->hasMissingData[HeightChannel]; } // Allow for early termination @@ -192,7 +193,7 @@ std::vector Chunk::getBoundingPolyhedronCorners() const { double latDiff = latCloseToEquator - pGeodetic.lat; for (size_t i = 0; i < 8; ++i) { - Quad q = (Quad)(i % 4); + Quad q = static_cast(i % 4); double cornerHeight = i < 4 ? minCornerHeight : maxCornerHeight; Geodetic3 cornerGeodetic = { patch.getCorner(q), cornerHeight }; @@ -204,6 +205,7 @@ std::vector Chunk::getBoundingPolyhedronCorners() const { corners[i] = glm::dvec4(ellipsoid.cartesianPosition(cornerGeodetic), 1); } + return corners; } diff --git a/modules/globebrowsing/chunk/chunk.h b/modules/globebrowsing/chunk/chunk.h index e2f7ea7759..c235fa4525 100644 --- a/modules/globebrowsing/chunk/chunk.h +++ b/modules/globebrowsing/chunk/chunk.h @@ -25,10 +25,11 @@ #ifndef __OPENSPACE_MODULE_GLOBEBROWSING___CHUNK___H__ #define __OPENSPACE_MODULE_GLOBEBROWSING___CHUNK___H__ -#include +#include #include #include + #include namespace openspace { @@ -37,7 +38,6 @@ struct RenderData; namespace globebrowsing { -class GeodeticPatch; class RenderableGlobe; struct TileIndex; @@ -51,9 +51,9 @@ public: }; enum class Status { - DO_NOTHING, - WANT_MERGE, - WANT_SPLIT, + DoNothing, + WantMerge, + WantSplit, }; Chunk(const RenderableGlobe& owner, const TileIndex& tileIndex, @@ -73,8 +73,8 @@ public: Status update(const RenderData& data); /** - * Returns a convex polyhedron of eight vertices tightly bounding the volume of - * the Chunk. + * Returns a convex polyhedron of eight vertices tightly bounding the volume of + * the Chunk. */ std::vector getBoundingPolyhedronCorners() const; @@ -84,13 +84,13 @@ public: bool isVisible() const; /** - * Returns BoundingHeights that fits the Chunk as tightly as possible. - * - * If the Chunk uses more than one HightLayer, the BoundingHeights will be set - * to cover all HightLayers. If the Chunk has a higher level than its highest - * resolution HightLayer Tile, it will base its BoundingHeights on that Tile. - * This means that high level Chunks can have BoundingHeights that are not - * tightly fitting. + * Returns BoundingHeights that fits the Chunk as tightly as possible. + * + * If the Chunk uses more than one HightLayer, the BoundingHeights will be set + * to cover all HeightLayers. If the Chunk has a higher level than its highest + * resolution HightLayer Tile, it will base its BoundingHeights on that Tile. + * This means that high level Chunks can have BoundingHeights that are not + * tightly fitting. */ BoundingHeights getBoundingHeights() const; diff --git a/modules/globebrowsing/chunk/chunklevelevaluator/availabletiledataevaluator.cpp b/modules/globebrowsing/chunk/chunklevelevaluator/availabletiledataevaluator.cpp new file mode 100644 index 0000000000..835f61a5cd --- /dev/null +++ b/modules/globebrowsing/chunk/chunklevelevaluator/availabletiledataevaluator.cpp @@ -0,0 +1,57 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#include + +#include +#include +#include +#include +#include +#include + +namespace openspace { +namespace globebrowsing { +namespace chunklevelevaluator { + +int AvailableTileData::getDesiredLevel(const Chunk& chunk, const RenderData& data) const { + auto layerManager = chunk.owner().chunkedLodGlobe()->layerManager(); + // auto layers = layerManager->layerGroup(LayerManager::HeightLayers).activeLayers(); + int currLevel = chunk.tileIndex().level; + + for (size_t i = 0; i < LayerManager::NUM_LAYER_GROUPS; ++i) { + for (const auto& layer : layerManager->layerGroup(i).activeLayers()) { + Tile::Status status = layer->tileProvider()->getTileStatus(chunk.tileIndex()); + if (status == Tile::Status::OK) { + return UnknownDesiredLevel; + } + } + } + + return currLevel - 1; +} + +} // namespace chunklevelevaluator +} // namespace globebrowsing +} // namespace openspace diff --git a/modules/globebrowsing/chunk/chunklevelevaluator/availabletiledataevaluator.h b/modules/globebrowsing/chunk/chunklevelevaluator/availabletiledataevaluator.h new file mode 100644 index 0000000000..f3d144997c --- /dev/null +++ b/modules/globebrowsing/chunk/chunklevelevaluator/availabletiledataevaluator.h @@ -0,0 +1,48 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___AVAILABLETILEDATAEVALUATOR___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___AVAILABLETILEDATAEVALUATOR___H__ + +#include + +namespace openspace { +namespace globebrowsing { +namespace chunklevelevaluator { + +/** + * If this chunk has available tile data for any LayerGroup on any of its active + * Layers it will return an UNKNOWN_DESIRED_LEVEL. If no data is available it will + * evaluate to a level that is current level -1. +*/ +class AvailableTileData : public Evaluator { +public: + int getDesiredLevel(const Chunk& chunk, const RenderData& data) const override; +}; + +} // namespace chunklevelevaluator +} // namespace globebrowsing +} // namespace openspace + +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___AVAILABLETILEDATAEVALUATOR___H__ diff --git a/modules/globebrowsing/chunk/chunklevelevaluator.h b/modules/globebrowsing/chunk/chunklevelevaluator/chunklevelevaluator.h similarity index 66% rename from modules/globebrowsing/chunk/chunklevelevaluator.h rename to modules/globebrowsing/chunk/chunklevelevaluator/chunklevelevaluator.h index 40f09810e7..40c511d2aa 100644 --- a/modules/globebrowsing/chunk/chunklevelevaluator.h +++ b/modules/globebrowsing/chunk/chunklevelevaluator/chunklevelevaluator.h @@ -32,50 +32,22 @@ struct RenderData; namespace globebrowsing { class Chunk; + +namespace chunklevelevaluator { /** * Abstract class defining an interface for accessing a desired level of a Chunk. * The desired level can be used in the process of determining whether a Chunk should * want to split, merge or do nothing. */ -class ChunkLevelEvaluator { +class Evaluator { public: + static const int UnknownDesiredLevel = -1; + virtual int getDesiredLevel(const Chunk& chunk, const RenderData& data) const = 0; - static const int UNKNOWN_DESIRED_LEVEL = -1; -}; - -/** - * Evaluate the Chunk level depending on the distance from the Camera to the Chunk. - * This evaluation method aims to keep the screen size (horizontal length and not - * area) of all chunks constant. -*/ -class EvaluateChunkLevelByDistance : public ChunkLevelEvaluator { -public: - virtual int getDesiredLevel(const Chunk& chunk, const RenderData& data) const; -}; - -/** - * Evaluate the chunk level using the area of the non-heightmapped Chunk projected - * on a sphere with the center in the position of the camera. A Chunk near the - * horizon will have a small projected area and hence a lower desired level. This - * evaluation is more forgiving than EvaluateChunkLevelByDistance, meaning it results - * in lower desired levels. -*/ -class EvaluateChunkLevelByProjectedArea : public ChunkLevelEvaluator { -public: - virtual int getDesiredLevel(const Chunk& chunk, const RenderData& data) const; -}; - -/** - * If this chunk has available tile data for any LayerGroup on any of its active - * Layers it will return an UNKNOWN_DESIRED_LEVEL. If no data is available it will - * evaluate to a level that is current level -1. -*/ -class EvaluateChunkLevelByAvailableTileData : public ChunkLevelEvaluator { -public: - virtual int getDesiredLevel(const Chunk& chunk, const RenderData& data) const; }; +} // namespace chunklevelevaluator } // namespace globebrowsing } // namespace openspace diff --git a/modules/globebrowsing/chunk/chunklevelevaluator/distanceevaluator.cpp b/modules/globebrowsing/chunk/chunklevelevaluator/distanceevaluator.cpp new file mode 100644 index 0000000000..d1cc671b49 --- /dev/null +++ b/modules/globebrowsing/chunk/chunklevelevaluator/distanceevaluator.cpp @@ -0,0 +1,75 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#include + +#include +#include +#include +#include +#include + +namespace openspace { +namespace globebrowsing { +namespace chunklevelevaluator { + +int Distance::getDesiredLevel(const Chunk& chunk, const RenderData& data) const { + // Calculations are done in the reference frame of the globe + // (model space). Hence, the camera position needs to be transformed + // with the inverse model matrix + glm::dmat4 inverseModelTransform = chunk.owner().inverseModelTransform(); + const RenderableGlobe& globe = chunk.owner(); + const Ellipsoid& ellipsoid = globe.ellipsoid(); + + glm::dvec3 cameraPosition = + glm::dvec3(inverseModelTransform * glm::dvec4(data.camera.positionVec3(), 1)); + + Geodetic2 pointOnPatch = chunk.surfacePatch().closestPoint( + ellipsoid.cartesianToGeodetic2(cameraPosition) + ); + glm::dvec3 patchNormal = ellipsoid.geodeticSurfaceNormal(pointOnPatch); + glm::dvec3 patchPosition = ellipsoid.cartesianSurfacePosition(pointOnPatch); + + Chunk::BoundingHeights heights = chunk.getBoundingHeights(); + double heightToChunk = heights.min; + + // Offset position according to height + patchPosition += patchNormal * heightToChunk; + + glm::dvec3 cameraToChunk = patchPosition - cameraPosition; + + // Calculate desired level based on distance + double distanceToPatch = glm::length(cameraToChunk); + double distance = distanceToPatch; + + double scaleFactor = + globe.generalProperties().lodScaleFactor * ellipsoid.minimumRadius(); + double projectedScaleFactor = scaleFactor / distance; + int desiredLevel = ceil(log2(projectedScaleFactor)); + return desiredLevel; +} + +} // namespace chunklevelevaluator +} // namespace globebrowsing +} // namespace openspace diff --git a/modules/globebrowsing/chunk/chunklevelevaluator/distanceevaluator.h b/modules/globebrowsing/chunk/chunklevelevaluator/distanceevaluator.h new file mode 100644 index 0000000000..ead3ba050d --- /dev/null +++ b/modules/globebrowsing/chunk/chunklevelevaluator/distanceevaluator.h @@ -0,0 +1,48 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___DISTANCEEVALUATOR___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___DISTANCEEVALUATOR___H__ + +#include + +namespace openspace { +namespace globebrowsing { +namespace chunklevelevaluator { + +/** + * Evaluate the Chunk level depending on the distance from the Camera to the Chunk. + * This evaluation method aims to keep the screen size (horizontal length and not + * area) of all chunks constant. +*/ +class Distance : public Evaluator { +public: + int getDesiredLevel(const Chunk& chunk, const RenderData& data) const override; +}; + +} // namespace chunklevelevaluator +} // namespace globebrowsing +} // namespace openspace + +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___DISTANCEEVALUATOR___H__ diff --git a/modules/globebrowsing/chunk/chunklevelevaluator.cpp b/modules/globebrowsing/chunk/chunklevelevaluator/projectedareaevaluator.cpp similarity index 68% rename from modules/globebrowsing/chunk/chunklevelevaluator.cpp rename to modules/globebrowsing/chunk/chunklevelevaluator/projectedareaevaluator.cpp index be15e7712c..a92a9c62e8 100644 --- a/modules/globebrowsing/chunk/chunklevelevaluator.cpp +++ b/modules/globebrowsing/chunk/chunklevelevaluator/projectedareaevaluator.cpp @@ -22,58 +22,19 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#include +#include #include #include #include -#include +#include #include namespace openspace { namespace globebrowsing { +namespace chunklevelevaluator { -int EvaluateChunkLevelByDistance::getDesiredLevel(const Chunk& chunk, - const RenderData& data) const -{ - // Calculations are done in the reference frame of the globe - // (model space). Hence, the camera position needs to be transformed - // with the inverse model matrix - glm::dmat4 inverseModelTransform = chunk.owner().inverseModelTransform(); - const RenderableGlobe& globe = chunk.owner(); - const Ellipsoid& ellipsoid = globe.ellipsoid(); - - glm::dvec3 cameraPosition = - glm::dvec3(inverseModelTransform * glm::dvec4(data.camera.positionVec3(), 1)); - - Geodetic2 pointOnPatch = chunk.surfacePatch().closestPoint( - ellipsoid.cartesianToGeodetic2(cameraPosition) - ); - glm::dvec3 patchNormal = ellipsoid.geodeticSurfaceNormal(pointOnPatch); - glm::dvec3 patchPosition = ellipsoid.cartesianSurfacePosition(pointOnPatch); - - Chunk::BoundingHeights heights = chunk.getBoundingHeights(); - double heightToChunk = heights.min; - - // Offset position according to height - patchPosition += patchNormal * heightToChunk; - - glm::dvec3 cameraToChunk = patchPosition - cameraPosition; - - // Calculate desired level based on distance - double distanceToPatch = glm::length(cameraToChunk); - double distance = distanceToPatch; - - double scaleFactor = - globe.generalProperties().lodScaleFactor * ellipsoid.minimumRadius(); - double projectedScaleFactor = scaleFactor / distance; - int desiredLevel = ceil(log2(projectedScaleFactor)); - return desiredLevel; -} - -int EvaluateChunkLevelByProjectedArea::getDesiredLevel(const Chunk& chunk, - const RenderData& data) const -{ +int ProjectedArea::getDesiredLevel(const Chunk& chunk, const RenderData& data) const { // Calculations are done in the reference frame of the globe // (model space). Hence, the camera position needs to be transformed // with the inverse model matrix @@ -163,25 +124,6 @@ int EvaluateChunkLevelByProjectedArea::getDesiredLevel(const Chunk& chunk, return chunk.tileIndex().level + round(scaledArea - 1); } -int EvaluateChunkLevelByAvailableTileData::getDesiredLevel(const Chunk& chunk, - const RenderData& data) const -{ - auto layerManager = chunk.owner().chunkedLodGlobe()->layerManager(); - auto heightLayers = layerManager->layerGroup(LayerManager::HeightLayers).activeLayers(); - int currLevel = chunk.tileIndex().level; - - for (size_t i = 0; i < LayerManager::NUM_LAYER_GROUPS; ++i) { - for (auto& layer : layerManager->layerGroup(i).activeLayers()) { - Tile::Status tileStatus = - layer->tileProvider()->getTileStatus(chunk.tileIndex()); - if (tileStatus == Tile::Status::OK) { - return UNKNOWN_DESIRED_LEVEL; - } - } - } - - return currLevel - 1; -} - +} // namespace chunklevelevaluator } // namespace globebrowsing } // namespace openspace diff --git a/modules/globebrowsing/chunk/chunklevelevaluator/projectedareaevaluator.h b/modules/globebrowsing/chunk/chunklevelevaluator/projectedareaevaluator.h new file mode 100644 index 0000000000..0bd0bee3f1 --- /dev/null +++ b/modules/globebrowsing/chunk/chunklevelevaluator/projectedareaevaluator.h @@ -0,0 +1,51 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___PROJECTEDAREAEVALUATOR___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___PROJECTEDAREAEVALUATOR___H__ + +#include + +namespace openspace { +namespace globebrowsing { +namespace chunklevelevaluator { + +/** + * Evaluate the chunk level using the area of the non-heightmapped Chunk projected + * on a sphere with the center in the position of the camera. A Chunk near the + * horizon will have a small projected area and hence a lower desired level. This + * evaluation is more forgiving than EvaluateChunkLevelByDistance, meaning it results + * in lower desired levels. +*/ +class ProjectedArea : public Evaluator { +public: + virtual int getDesiredLevel(const Chunk& chunk, const RenderData& data) const; +}; + + +} // namespace chunklevelevaluator +} // namespace globebrowsing +} // namespace openspace + +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___PROJECTEDAREAEVALUATOR___H__ diff --git a/modules/globebrowsing/chunk/chunknode.cpp b/modules/globebrowsing/chunk/chunknode.cpp index 56a13314c4..408fd613a9 100644 --- a/modules/globebrowsing/chunk/chunknode.cpp +++ b/modules/globebrowsing/chunk/chunknode.cpp @@ -32,19 +32,11 @@ namespace openspace { namespace globebrowsing { -int ChunkNode::chunkNodeCount = 0; - ChunkNode::ChunkNode(const Chunk& chunk, ChunkNode* parent) : _chunk(chunk) , _parent(parent) , _children({ nullptr, nullptr, nullptr, nullptr }) -{ - chunkNodeCount++; -} - -ChunkNode::~ChunkNode() { - chunkNodeCount--; -} +{} bool ChunkNode::isRoot() const { return _parent == nullptr; @@ -57,10 +49,10 @@ bool ChunkNode::isLeaf() const { bool ChunkNode::updateChunkTree(const RenderData& data) { if (isLeaf()) { Chunk::Status status = _chunk.update(data); - if (status == Chunk::Status::WANT_SPLIT) { + if (status == Chunk::Status::WantSplit) { split(); } - return status == Chunk::Status::WANT_MERGE; + return status == Chunk::Status::WantMerge; } else { char requestedMergeMask = 0; @@ -71,7 +63,7 @@ bool ChunkNode::updateChunkTree(const RenderData& data) { } bool allChildrenWantsMerge = requestedMergeMask == 0xf; - bool thisChunkWantsSplit = _chunk.update(data) == Chunk::Status::WANT_SPLIT; + bool thisChunkWantsSplit = _chunk.update(data) == Chunk::Status::WantSplit; if (allChildrenWantsMerge && !thisChunkWantsSplit) { merge(); @@ -166,7 +158,7 @@ const ChunkNode& ChunkNode::getChild(Quad quad) const { void ChunkNode::split(int depth) { if (depth > 0 && isLeaf()) { - for (size_t i = 0; i < _children.size(); i++) { + for (size_t i = 0; i < _children.size(); ++i) { Chunk chunk(_chunk.owner(), _chunk.tileIndex().child((Quad)i)); _children[i] = std::make_unique(chunk, this); } diff --git a/modules/globebrowsing/chunk/chunknode.h b/modules/globebrowsing/chunk/chunknode.h index bb7f0b719e..09ff70d302 100644 --- a/modules/globebrowsing/chunk/chunknode.h +++ b/modules/globebrowsing/chunk/chunknode.h @@ -39,19 +39,18 @@ class ChunkedLodGlobe; class ChunkNode { public: ChunkNode(const Chunk& chunk, ChunkNode* parent = nullptr); - ~ChunkNode(); /** * Recursively split the ChunkNode. * * \param depth defines how deep the recursion should go. If depth == 1 (default), * the ChunkNode will only split once. - */ + */ void split(int depth = 1); /** * Deletes all children of the ChunkNode recursively. - */ + */ void merge(); bool isRoot() const; @@ -74,9 +73,7 @@ public: */ bool updateChunkTree(const RenderData& data); - static int chunkNodeCount; - -private: +private: ChunkNode* _parent; std::array, 4> _children; diff --git a/modules/globebrowsing/chunk/culling/chunkculler.h b/modules/globebrowsing/chunk/culling/chunkculler.h new file mode 100644 index 0000000000..0321544d01 --- /dev/null +++ b/modules/globebrowsing/chunk/culling/chunkculler.h @@ -0,0 +1,52 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___CHUNKCULLER___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___CHUNKCULLER___H__ + +namespace openspace { + +struct RenderData; + +namespace globebrowsing { + +class Chunk; + +namespace culling { + +class ChunkCuller { +public: + /** + * Determine if the Chunk is cullable. That is return true if removing the + * Chunk 'culling it' will not have any result on the final rendering. Culling + * it will make the rendering faster. + */ + virtual bool isCullable(const Chunk& chunk, const RenderData& renderData) = 0; +}; + +} // namespace culling +} // namespace globebrowsing +} // namespace openspace + +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___CHUNKCULLER___H__ diff --git a/modules/globebrowsing/chunk/culling/frustumculler.cpp b/modules/globebrowsing/chunk/culling/frustumculler.cpp new file mode 100644 index 0000000000..03410a4dd0 --- /dev/null +++ b/modules/globebrowsing/chunk/culling/frustumculler.cpp @@ -0,0 +1,63 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#include + +#include +#include + +namespace openspace { +namespace globebrowsing { +namespace culling { + +FrustumCuller::FrustumCuller(AABB3 viewFrustum) + : _viewFrustum(std::move(viewFrustum)) +{} + +bool FrustumCuller::isCullable(const Chunk& chunk, const RenderData& data) { + // Calculate the MVP matrix + glm::dmat4 modelTransform = chunk.owner().modelTransform(); + glm::dmat4 viewTransform = glm::dmat4(data.camera.combinedViewMatrix()); + glm::dmat4 modelViewProjectionTransform = glm::dmat4(data.camera.projectionMatrix()) + * viewTransform * modelTransform; + + const std::vector& corners = chunk.getBoundingPolyhedronCorners(); + + // Create a bounding box that fits the patch corners + AABB3 bounds; // in screen space + std::vector clippingSpaceCorners(8); + for (size_t i = 0; i < 8; ++i) { + glm::dvec4 cornerClippingSpace = modelViewProjectionTransform * corners[i]; + clippingSpaceCorners[i] = cornerClippingSpace; + + glm::dvec3 ndc = (1.0f / glm::abs(cornerClippingSpace.w)) * cornerClippingSpace; + bounds.expand(ndc); + } + + return !(_viewFrustum.intersects(bounds)); +} + +} // namespace culling +} // namespace globebrowsing +} // namespace openspace diff --git a/modules/globebrowsing/geometry/convexhull.h b/modules/globebrowsing/chunk/culling/frustumculler.h similarity index 64% rename from modules/globebrowsing/geometry/convexhull.h rename to modules/globebrowsing/chunk/culling/frustumculler.h index 03cce41b75..6f86d073cd 100644 --- a/modules/globebrowsing/geometry/convexhull.h +++ b/modules/globebrowsing/chunk/culling/frustumculler.h @@ -22,51 +22,41 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___CONVEX_HULL___H__ -#define __OPENSPACE_MODULE_GLOBEBROWSING___CONVEX_HULL___H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___FRUSTUMCULLER___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___FRUSTUMCULLER___H__ + +#include #include -#include -#include - -#include - namespace openspace { namespace globebrowsing { +namespace culling { -// Implementation based on -// http://www.sanfoundry.com/cpp-program-implement-graham-scan-algorithm-find-convex-hull/ +/** + * Culls all chunks that are completely outside the view frustum. + * + * The frustum culling uses a 2D axis aligned bounding box for the Chunk in + * screen space. This is calculated from a bounding polyhedron bounding the + * Chunk. Hence the culling will not be 'perfect' but fast and good enough for + * culling chunks outside the frustum with some margin. + */ +class FrustumCuller : public ChunkCuller { +public: + /** + * \param viewFrustum is the view space in normalized device coordinates space. + * Hence it is an axis aligned bounding box and not a real frustum. + */ + FrustumCuller(AABB3 viewFrustum); -class ConvexHull2 { -public: - static ConvexHull2 grahamScan_NOT_THREAD_SAFE(std::vector& points, - int yMinIndex = -1); - - const std::vector points() const; - - bool intersects(const ConvexHull2& o) const; - - AABB1 projectedRegion(glm::vec2 direction) const; - -private: - bool hasPerpendicularLineWhereProjectedPointsOverlap(const ConvexHull2& other) const; - - static int compare(const void* vp1, const void* vp2); - - static glm::vec2 oneBelowTop(std::stack&); - static void swap(glm::vec2& p1, glm::vec2& p2); - - // returns 0 = colinear, 1 = clockwise, 2 = counterclockwise - static int orientation(const glm::vec2& p, const glm::vec2& q, const glm::vec2& r); - static float dist(const glm::vec2& p1, const glm::vec2& p2); + bool isCullable(const Chunk& chunk, const RenderData& renderData) override; private: - static glm::vec2 p0; - std::vector _points; + const AABB3 _viewFrustum; }; -} // namespace globebrowsing +} // namespace culling +} // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING___CONVEX_HULL___H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___FRUSTUMCULLER___H__ diff --git a/modules/globebrowsing/chunk/culling.cpp b/modules/globebrowsing/chunk/culling/horizonculler.cpp similarity index 82% rename from modules/globebrowsing/chunk/culling.cpp rename to modules/globebrowsing/chunk/culling/horizonculler.cpp index 73120626f7..5e7e09b989 100644 --- a/modules/globebrowsing/chunk/culling.cpp +++ b/modules/globebrowsing/chunk/culling/horizonculler.cpp @@ -22,39 +22,14 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#include +#include #include #include namespace openspace { namespace globebrowsing { - -FrustumCuller::FrustumCuller(const AABB3 viewFrustum) : _viewFrustum(viewFrustum) {} - -bool FrustumCuller::isCullable(const Chunk& chunk, const RenderData& data) { - // Calculate the MVP matrix - glm::dmat4 modelTransform = chunk.owner().modelTransform(); - glm::dmat4 viewTransform = glm::dmat4(data.camera.combinedViewMatrix()); - glm::dmat4 modelViewProjectionTransform = glm::dmat4(data.camera.projectionMatrix()) - * viewTransform * modelTransform; - - const std::vector& corners = chunk.getBoundingPolyhedronCorners(); - - // Create a bounding box that fits the patch corners - AABB3 bounds; // in screen space - std::vector clippingSpaceCorners(8); - for (size_t i = 0; i < 8; i++) { - glm::dvec4 cornerClippingSpace = modelViewProjectionTransform * corners[i]; - clippingSpaceCorners[i] = cornerClippingSpace; - - glm::dvec3 cornerNDC = - (1.0f / glm::abs(cornerClippingSpace.w)) * cornerClippingSpace; - bounds.expand(cornerNDC); - } - - return !_viewFrustum.intersects(bounds); -} +namespace culling { bool HorizonCuller::isCullable(const Chunk& chunk, const RenderData& data) { // Calculations are done in the reference frame of the globe. Hence, the camera @@ -110,16 +85,20 @@ bool HorizonCuller::isCullable(const glm::dvec3& cameraPosition, double distanceToHorizon = sqrt(pow(length(cameraPosition - globePosition), 2) - pow(minimumGlobeRadius, 2)); + double minimumAllowedDistanceToObjectFromHorizon = sqrt( pow(length(objectPosition - globePosition), 2) - pow(minimumGlobeRadius - objectBoundingSphereRadius, 2)); + // Minimum allowed for the object to be occluded double minimumAllowedDistanceToObjectSquared = pow(distanceToHorizon + minimumAllowedDistanceToObjectFromHorizon, 2) + pow(objectBoundingSphereRadius, 2); + double distanceToObjectSquared = pow(length(objectPosition - cameraPosition), 2); return distanceToObjectSquared > minimumAllowedDistanceToObjectSquared; } +} // namespace culling } // namespace globebrowsing } // namespace openspace diff --git a/modules/globebrowsing/chunk/culling.h b/modules/globebrowsing/chunk/culling/horizonculler.h similarity index 67% rename from modules/globebrowsing/chunk/culling.h rename to modules/globebrowsing/chunk/culling/horizonculler.h index 5e0758b42d..8ee695ab7d 100644 --- a/modules/globebrowsing/chunk/culling.h +++ b/modules/globebrowsing/chunk/culling/horizonculler.h @@ -22,50 +22,16 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___CULLING___H__ -#define __OPENSPACE_MODULE_GLOBEBROWSING___CULLING___H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___HORIZONCULLER___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___HORIZONCULLER___H__ -#include +#include + +#include namespace openspace { - -struct RenderData; - namespace globebrowsing { - -class Chunk; - -class ChunkCuller { -public: - /** - * Determine if the Chunk is cullable. That is return true if removing the - * Chunk 'culling it' will not have any result on the final rendering. Culling - * it will make the rendering faster. - */ - virtual bool isCullable(const Chunk& chunk, const RenderData& renderData) = 0; -}; - - /** - * Culls all chunks that are completely outside the view frustum. - * - * The frustum culling uses a 2D axis aligned bounding box for the Chunk in - * screen space. This is calculated from a bounding polyhedron bounding the - * Chunk. Hence the culling will not be 'perfect' but fast and good enough for - * culling chunks outside the frustum with some margin. - */ -class FrustumCuller : public ChunkCuller { -public: - /** - * \param viewFrustum is the view space in normalized device coordinates space. - * Hence it is an axis aligned bounding box and not a real frustum. - */ - FrustumCuller(const AABB3 viewFrustum); - - bool isCullable(const Chunk& chunk, const RenderData& renderData) override; - -private: - const AABB3 _viewFrustum; -}; +namespace culling { /** * In this implementation of the horizon culling, the closer the ellipsoid is to a @@ -77,12 +43,14 @@ class HorizonCuller : public ChunkCuller { public: bool isCullable(const Chunk& chunk, const RenderData& renderData) override; +private: bool isCullable(const glm::dvec3& cameraPosition, const glm::dvec3& globePosition, const glm::dvec3& objectPosition, double objectBoundingSphereRadius, double minimumGlobeRadius); }; +} // namespace culling } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING___CULLING___H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___HORIZONCULLER___H__ diff --git a/modules/globebrowsing/geometry/aabb.cpp b/modules/globebrowsing/geometry/aabb.cpp index e4eac43a16..d9e47cc691 100644 --- a/modules/globebrowsing/geometry/aabb.cpp +++ b/modules/globebrowsing/geometry/aabb.cpp @@ -63,17 +63,17 @@ bool AABB1::intersects(const AABB1& o) const { return (min <= o.max) && (o.min <= max); } -AABBSpatialRelation AABB1::relationTo(const AABB1& o) const { +AABB1::AABBSpatialRelation AABB1::relationTo(const AABB1& o) const { if (intersects(o)) { if (contains(o)) { - return AABBSpatialRelation::Containing; + return AABB1::AABBSpatialRelation::Containing; } if (o.contains(*this)) { - return AABBSpatialRelation::Contained; + return AABB1::AABBSpatialRelation::Contained; } - return AABBSpatialRelation::Intersecting; + return AABB1::AABBSpatialRelation::Intersecting; } - return AABBSpatialRelation::None; + return AABB1::AABBSpatialRelation::None; } AABB2::AABB2() @@ -83,9 +83,9 @@ AABB2::AABB2() ) {} -AABB2::AABB2(const glm::vec2& min, const glm::vec2& max) - : min(min) - , max(max) +AABB2::AABB2(glm::vec2 min, glm::vec2 max) + : min(std::move(min)) + , max(std::move(max)) {} void AABB2::expand(const glm::vec2& p) { @@ -116,17 +116,17 @@ bool AABB2::intersects(const AABB2& o) const { && (min.y <= o.max.y) && (o.min.y <= max.y); } -AABBSpatialRelation AABB2::relationTo(const AABB2& o) const { +AABB2::AABBSpatialRelation AABB2::relationTo(const AABB2& o) const { if (intersects(o)) { if (contains(o)) { - return AABBSpatialRelation::Containing; + return AABB2::AABBSpatialRelation::Containing; } if (o.contains(*this)) { - return AABBSpatialRelation::Contained; + return AABB2::AABBSpatialRelation::Contained; } - return AABBSpatialRelation::Intersecting; + return AABB2::AABBSpatialRelation::Intersecting; } - return AABBSpatialRelation::None; + return AABB2::AABBSpatialRelation::None; } AABB3::AABB3() @@ -136,9 +136,9 @@ AABB3::AABB3() ) {} -AABB3::AABB3(const glm::vec3& min, const glm::vec3& max) - : min(min), - max(max) +AABB3::AABB3(glm::vec3 min, glm::vec3 max) + : min(std::move(min)) + , max(std::move(max)) {} void AABB3::expand(const glm::vec3 p) { @@ -172,17 +172,17 @@ bool AABB3::intersects(const AABB3& o) const { && (min.z <= o.max.z) && (o.min.z <= max.z); } -AABBSpatialRelation AABB3::relationTo(const AABB3& o) const { +AABB3::AABBSpatialRelation AABB3::relationTo(const AABB3& o) const { if (intersects(o)) { if (contains(o)) { - return AABBSpatialRelation::Containing; + return AABB3::AABBSpatialRelation::Containing; } if (o.contains(*this)) { - return AABBSpatialRelation::Contained; + return AABB3::AABBSpatialRelation::Contained; } - return AABBSpatialRelation::Intersecting; + return AABB3::AABBSpatialRelation::Intersecting; } - return AABBSpatialRelation::None; + return AABB3::AABBSpatialRelation::None; } } // namespace globebrowsing diff --git a/modules/globebrowsing/geometry/aabb.h b/modules/globebrowsing/geometry/aabb.h index e88f20e17b..5277230fcb 100644 --- a/modules/globebrowsing/geometry/aabb.h +++ b/modules/globebrowsing/geometry/aabb.h @@ -30,14 +30,14 @@ namespace openspace { namespace globebrowsing { -enum class AABBSpatialRelation { - None, - Intersecting, - Contained, - Containing -}; - struct AABB1 { + enum class AABBSpatialRelation { + None, + Intersecting, + Contained, + Containing + }; + AABB1(); AABB1(float min, float max); @@ -54,8 +54,15 @@ struct AABB1 { }; struct AABB2 { + enum class AABBSpatialRelation { + None, + Intersecting, + Contained, + Containing + }; + AABB2(); - AABB2(const glm::vec2& min, const glm::vec2& max); + AABB2(glm::vec2 min, glm::vec2 max); void expand(const glm::vec2& p); glm::vec2 center() const; @@ -70,8 +77,15 @@ struct AABB2 { }; struct AABB3 { + enum class AABBSpatialRelation { + None, + Intersecting, + Contained, + Containing + }; + AABB3(); - AABB3(const glm::vec3& min, const glm::vec3& max); + AABB3(glm::vec3 min, glm::vec3 max); void expand(const glm::vec3 p); glm::vec3 center() const; diff --git a/modules/globebrowsing/geometry/convexhull.cpp b/modules/globebrowsing/geometry/convexhull.cpp deleted file mode 100644 index 11ab3373f5..0000000000 --- a/modules/globebrowsing/geometry/convexhull.cpp +++ /dev/null @@ -1,170 +0,0 @@ -/***************************************************************************************** - * * - * 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. * - ****************************************************************************************/ - -#include - -namespace openspace { -namespace globebrowsing { - -glm::vec2 ConvexHull2::p0(0,0); - -ConvexHull2 ConvexHull2::grahamScan_NOT_THREAD_SAFE(std::vector& points, - int yMinIndex) -{ - ConvexHull2 hull; - - if (yMinIndex == -1) { - yMinIndex = 0; - float ymin = points[0].y; - for (int i = 1; i < points.size(); i++) { - float y = points[i].y; - // Pick the bottom-most or chose the left most point in case of tie - if ((y < ymin) || (ymin == y && points[i].x < points[yMinIndex].x)) { - ymin = points[i].y; - yMinIndex = i; - } - } - } - - // Place the bottom-most point at first position - swap(points[0], points[yMinIndex]); - - // Sort n-1 points with respect to the first point. A point p1 comes - // before p2 in sorted ouput if p2 has larger polar angle (in - // counterclockwise direction) than p1 - hull.p0 = points[0]; - - // Replace with std::sort - qsort(&(points.data()[1]), points.size()-1, sizeof(glm::vec2), &(hull.compare)); - - // Create an empty stack and push first three points to it. - std::stack S; - S.push(points[0]); - S.push(points[1]); - S.push(points[2]); - - // Process remaining n-3 points - for (int i = 3; i < points.size(); i++) { - // Keep removing top while the angle formed by points next-to-top, - // top, and points[i] makes a non-left turn - while (orientation(oneBelowTop(S), S.top(), points[i]) == 1) - S.pop(); - S.push(points[i]); - } - - // Now stack has the output points, print contents of stack - while (!S.empty()) { - glm::vec2 p = S.top(); - hull._points.push_back(p); - S.pop(); - } - - return hull; -} - -bool ConvexHull2::intersects(const ConvexHull2& other) const { - // uses Separating Axis Theorem - // ref: http://stackoverflow.com/questions/753140/how-do-i-determine-if-two-convex-polygons-intersect - return this->hasPerpendicularLineWhereProjectedPointsOverlap(other) || - other.hasPerpendicularLineWhereProjectedPointsOverlap(*this); -} - - -bool ConvexHull2::hasPerpendicularLineWhereProjectedPointsOverlap(const ConvexHull2& other) const { - for (size_t i = 1; i < _points.size(); i++) { - glm::vec2 dividingAxis = _points[i] - _points[i - 1]; - // project all points onto the vector perpendicular to the dividing axis - glm::vec2 projAxis(glm::normalize(glm::vec2(-dividingAxis.y, dividingAxis.x))); - const AABB1& myBounds = projectedRegion(projAxis); - const AABB1& otherBounds = other.projectedRegion(projAxis); - if (!myBounds.intersects(otherBounds)) { - return false; - } - } - - // test line defined by last-to-first point - glm::vec2 dividingAxis = _points[0] - _points.back(); - glm::vec2 projAxis(glm::normalize(glm::vec2(-dividingAxis.y, dividingAxis.x))); - const AABB1& myBounds = projectedRegion(projAxis); - const AABB1& otherBounds = other.projectedRegion(projAxis); - if (!myBounds.intersects(otherBounds)) { - return false; - } - - return true; -} - -AABB1 ConvexHull2::projectedRegion(glm::vec2 direction) const { - AABB1 projectedRegion; - for (const glm::vec2& p : _points) { - projectedRegion.expand(glm::dot(p, direction)); - } - //for (size_t i = 0; i < _points.size(); i++) { - // projectedRegion.expand(glm::dot(_points[i], direction)); - //} - return projectedRegion; -} - -glm::vec2 ConvexHull2::oneBelowTop(std::stack& S) { - glm::vec2 p = S.top(); - S.pop(); - glm::vec2 res = S.top(); - S.push(p); - return res; -} - -void ConvexHull2::swap(glm::vec2& p1, glm::vec2& p2) { - glm::vec2 temp = p1; - p1 = p2; - p2 = temp; -} - -const std::vector ConvexHull2::points() const { - return _points; -} - -int ConvexHull2::orientation(const glm::vec2& p, const glm::vec2& q, const glm::vec2& r) { - float val = (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y); - return (val == 0) ? 0 : (val > 0) ? 1 : 2; -} - -float ConvexHull2::dist(const glm::vec2& p1, const glm::vec2& p2) { - return (p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y); -} - -int ConvexHull2::compare(const void *vp1, const void *vp2) { - glm::vec2* p1 = (glm::vec2 *)vp1; - glm::vec2* p2 = (glm::vec2 *)vp2; - - // Find orientation - int o = orientation(p0, *p1, *p2); - if (o == 0) { - return (dist(p0, *p2) >= dist(p0, *p1)) ? -1 : 1; - } - - return (o == 2) ? -1 : 1; -} - -} // namespace globebrowsing -} // namespace openspace \ No newline at end of file diff --git a/modules/globebrowsing/geometry/ellipsoid.h b/modules/globebrowsing/geometry/ellipsoid.h index 79b45b2075..9dac318f5b 100644 --- a/modules/globebrowsing/geometry/ellipsoid.h +++ b/modules/globebrowsing/geometry/ellipsoid.h @@ -26,6 +26,7 @@ #define __OPENSPACE_MODULE_GLOBEBROWSING___ELLIPSOID___H__ #include +#include #include diff --git a/modules/globebrowsing/geometry/geodetic2.cpp b/modules/globebrowsing/geometry/geodetic2.cpp index 2039d31ef1..b97d0a2e5e 100644 --- a/modules/globebrowsing/geometry/geodetic2.cpp +++ b/modules/globebrowsing/geometry/geodetic2.cpp @@ -24,8 +24,6 @@ #include -#include - namespace openspace { namespace globebrowsing { @@ -62,213 +60,5 @@ Geodetic2 Geodetic2::operator/(double scalar) const { return Geodetic2(lat / scalar, lon / scalar); } -GeodeticPatch::GeodeticPatch(double centerLat, double centerLon, double halfSizeLat, - double halfSizeLon) - : _center(Geodetic2(centerLat, centerLon)) - , _halfSize(Geodetic2(halfSizeLat, halfSizeLon)) -{} - -GeodeticPatch::GeodeticPatch(const Geodetic2& center, const Geodetic2& halfSize) - : _center(center) - , _halfSize(halfSize) -{} - -GeodeticPatch::GeodeticPatch(const GeodeticPatch& patch) - : _center(patch._center) - , _halfSize(patch._halfSize) -{} - -GeodeticPatch::GeodeticPatch(const TileIndex& tileIndex) { - double deltaLat = (2 * glm::pi()) / ((double)(1 << tileIndex.level)); - double deltaLon = (2 * glm::pi()) / ((double)(1 << tileIndex.level)); - Geodetic2 nwCorner(glm::pi() / 2 - deltaLat * tileIndex.y, -glm::pi() + deltaLon * tileIndex.x); - _halfSize = Geodetic2(deltaLat / 2, deltaLon / 2); - _center = Geodetic2(nwCorner.lat - _halfSize.lat, nwCorner.lon + _halfSize.lon); -} - -void GeodeticPatch::setCenter(const Geodetic2& center) { - _center = center; -} - -void GeodeticPatch::setHalfSize(const Geodetic2& halfSize) { - _halfSize = halfSize; -} - -double GeodeticPatch::maximumTileLevel() const { - // Numerator is just pi, not 2*pi, since we are dealing with HALF sizes - return log2(glm::pi() / glm::min(_halfSize.lat, _halfSize.lon)); -} - -double GeodeticPatch::minimumTileLevel() const { - // Numerator is just pi, not 2*pi, since we are dealing with HALF sizes - return log2(glm::pi() / glm::max(_halfSize.lat, _halfSize.lon)); -} - -const Geodetic2& GeodeticPatch::center() const { - return _center; -} - -const Geodetic2& GeodeticPatch::halfSize() const { - return _halfSize; -} - -Geodetic2 GeodeticPatch::size() const { - return Geodetic2(2 * _halfSize.lat, 2 * _halfSize.lon); -} - -Geodetic2 GeodeticPatch::getCorner(Quad q) const { - switch (q) { - case NORTH_WEST: return Geodetic2(maxLat(), minLon());// northWestCorner(); - case NORTH_EAST: return Geodetic2(maxLat(), maxLon());// northEastCorner(); - case SOUTH_WEST: return Geodetic2(minLat(), minLon());// southWestCorner(); - case SOUTH_EAST: return Geodetic2(minLat(), maxLon());// southEastCorner(); - } -} - -Geodetic2 GeodeticPatch::getSize() const { - return _halfSize * 2; -} - -double GeodeticPatch::minLat() const { - return _center.lat - _halfSize.lat; -} - -double GeodeticPatch::maxLat() const { - return _center.lat + _halfSize.lat; -} - -double GeodeticPatch::minLon() const { - return _center.lon - _halfSize.lon; -} - -double GeodeticPatch::maxLon() const { - return _center.lon + _halfSize.lon; -} - -bool GeodeticPatch::contains(const Geodetic2& p) const { - Geodetic2 diff = _center - p; - return glm::abs(diff.lat) <= _halfSize.lat && glm::abs(diff.lon) <= _halfSize.lon; -} - -double GeodeticPatch::edgeLatitudeNearestEquator() const { - return _center.lat + _halfSize.lat * (isNorthern() ? -1 : 1); -} - -double GeodeticPatch::isNorthern() const { - return _center.lat > 0.0; -} - -Geodetic2 GeodeticPatch::clamp(const Geodetic2& p) const { - using Ang = Angle; - - // Convert to Angles for normalization - Ang centerLat = Ang::fromRadians(_center.lat); - Ang centerLon = Ang::fromRadians(_center.lon); - Ang pointLat = Ang::fromRadians(p.lat); - Ang pointLon = Ang::fromRadians(p.lon); - - // Normalize w.r.t. the center in order for the clamping to done correctly - // - // Example: - // centerLat = 0 deg, halfSize.lat = 10 deg, pointLat = 330 deg - // --> Just clamping pointLat would be clamp(330, -10, 10) = 10 // WRONG! - // Instead, if we first normalize 330 deg around 0, we get -30 deg - // --> clamp(-30, -10, 10) = -10 // CORRECT! - pointLat.normalizeAround(centerLat); - pointLon.normalizeAround(centerLon); - - return Geodetic2( - glm::clamp(pointLat.asRadians(), minLat(), maxLat()), - glm::clamp(pointLon.asRadians(), minLon(), maxLon()) - ); -} - -Geodetic2 GeodeticPatch::closestCorner(const Geodetic2& p) const { - using Ang = Angle; - - // LatLon vector from patch center to the point - Geodetic2 centerToPoint = p - _center; - - // Normalize the difference angles to be centered around 0. - Ang latDiff = Ang::fromRadians(centerToPoint.lat).normalizeAround(Ang::ZERO); - Ang lonDiff = Ang::fromRadians(centerToPoint.lon).normalizeAround(Ang::ZERO); - - // If latDiff > 0 - // --> point p is north of the patch center - // --> the closest corner to the point must be a northern one - // --> set the corner's latitude coordinate to center.lat + halfSize.lat - // else - // --> set corner's latidude coordinate to center.lat - halfSize.lat - double cornerLat = _center.lat + _halfSize.lat * (latDiff > Ang::ZERO ? 1 : -1); - - // We then assigned the corner's longitude coordinate in a similar fashion - double cornerLon = _center.lon + _halfSize.lon * (lonDiff > Ang::ZERO ? 1 : -1); - - return Geodetic2(cornerLat, cornerLon); -} - -Geodetic2 GeodeticPatch::closestPoint(const Geodetic2& p) const { - // This method finds the closest point on the patch, to the provided - // point p. As we are deali ng with latitude-longitude patches, distance in this - // context refers to great-circle distance. - // (https://en.wikipedia.org/wiki/Great-circle_distance) - // - // This uses a simple clamping approach to find the closest point on the - // patch. A naive castesian clamp is not sufficient for this purpose, - // as illustrated with an example below. - - // Example: (degrees are used for latidude, longitude) - // patchCenter = (0,0), patchHalfSize = (45,45), point = (5, 170) - // Note, the point and the patch are on opposite sides of the sphere - // - // cartesian clamp: - // --> clampedPointLat = clamp(5, -45, 45) = 5 - // --> clampedPointLon = clamp(170, -45, 45) = 45 - // --> result: (5, 45) - // --> closest point is actually (45, 45) - // --> The error is significant - // - // This method simply adds an extra clamp on the latitude in these cases. In the - // above example, that would be the following: - // --> clampedPointLat = clamp(180 - 5, -45, 45) = 45 - // - // Just doing this actually makes points returned from this methods being the - // true closest point, great-circle distance-wise. - - - using Ang = Angle; - - // Convert to Angles for normalization - Ang centerLat = Ang::fromRadians(_center.lat); - Ang centerLon = Ang::fromRadians(_center.lon); - Ang pointLat = Ang::fromRadians(p.lat); - Ang pointLon = Ang::fromRadians(p.lon); - - // Normalize point with respect to center. This is done because the point - // will later be clamped. See LatLonPatch::clamp(const LatLon&) for explanation - pointLat.normalizeAround(centerLat); - pointLon.normalizeAround(centerLon); - - // Calculate the longitud difference between center and point. We normalize around - // zero because we want the "shortest distance" difference, i.e the difference - // should be in the interval [-180 deg, 180 deg] - Ang centerToPointLon = (centerLon - pointLon).normalizeAround(Ang::ZERO); - - // Calculate the longitudinal distance to the closest patch edge - Ang longitudeDistanceToClosestPatchEdge = centerToPointLon.abs() - Ang::fromRadians(_halfSize.lon); - - // If the longitude distance to the closest patch edge is larger than 90 deg - // the latitude will have to be clamped to its closest corner, as explained in - // the example above. - double clampedLat = longitudeDistanceToClosestPatchEdge > Ang::QUARTER ? - clampedLat = glm::clamp((Ang::HALF - pointLat).normalizeAround(centerLat).asRadians(), minLat(), maxLat()) : - clampedLat = glm::clamp(pointLat.asRadians(), minLat(), maxLat()); - - // Longitude is just clamped normally - double clampedLon = glm::clamp(pointLon.asRadians(), minLon(), maxLon()); - - return Geodetic2(clampedLat, clampedLon); -} - } // namespace globebrowsing } // namespace openspace diff --git a/modules/globebrowsing/geometry/geodetic2.h b/modules/globebrowsing/geometry/geodetic2.h index 39650626a0..9c4e029fb5 100644 --- a/modules/globebrowsing/geometry/geodetic2.h +++ b/modules/globebrowsing/geometry/geodetic2.h @@ -25,15 +25,11 @@ #ifndef __OPENSPACE_MODULE_GLOBEBROWSING___GEODETIC2___H__ #define __OPENSPACE_MODULE_GLOBEBROWSING___GEODETIC2___H__ -#include - #include namespace openspace { namespace globebrowsing { -class Ellipsoid; - struct Geodetic2 { Geodetic2(double latitude = 0.0, double longitude = 0.0); Geodetic2(const Geodetic2& src); @@ -55,89 +51,6 @@ struct Geodetic2 { double lon; }; -struct Geodetic3 { - Geodetic2 geodetic2; - double height; -}; - -class GeodeticPatch { -public: - GeodeticPatch( - double centerLat, - double centerLon, - double halfSizeLat, - double halfSizeLon); - - GeodeticPatch( - const Geodetic2& center, - const Geodetic2& halfSize); - - GeodeticPatch(const GeodeticPatch& patch); - - GeodeticPatch(const TileIndex& tileIndex); - - void setCenter(const Geodetic2&); - void setHalfSize(const Geodetic2&); - - /** - returns the latitude boundary which is closest to the equator - */ - double edgeLatitudeNearestEquator() const; - - /** - Returns true if the center above the equator - */ - double isNorthern() const; - - Geodetic2 getCorner(Quad q) const; - Geodetic2 getSize() const; - - double minLat() const; - double maxLat() const; - double minLon() const; - double maxLon() const; - - /** - * returns true if the specified coordinate is contained within the patch - */ - bool contains(const Geodetic2& p) const; - - - /** - * Clamps a point to the patch region - */ - Geodetic2 clamp(const Geodetic2& p) const; - - /** - * Returns the corner of the patch that is closest to the given point p - */ - Geodetic2 closestCorner(const Geodetic2& p) const; - - /** - * Returns a point on the patch that minimizes the great-circle distance to - * the given point p. - */ - Geodetic2 closestPoint(const Geodetic2& p) const; - - /** - * Returns the minimum tile level of the patch (based on largest side) - */ - double minimumTileLevel() const; - - /** - * Returns the maximum level of the patch (based on smallest side) - */ - double maximumTileLevel() const; - - const Geodetic2& center() const; - const Geodetic2& halfSize() const; - Geodetic2 size() const; - -private: - Geodetic2 _center; - Geodetic2 _halfSize; -}; - } // namespace globebrowsing } // namespace openspace diff --git a/modules/globebrowsing/geometry/geodetic3.h b/modules/globebrowsing/geometry/geodetic3.h new file mode 100644 index 0000000000..e0d6bb337d --- /dev/null +++ b/modules/globebrowsing/geometry/geodetic3.h @@ -0,0 +1,41 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___GEODETIC3___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___GEODETIC3___H__ + +#include + +namespace openspace { +namespace globebrowsing { + +struct Geodetic3 { + Geodetic2 geodetic2; + double height; +}; + +} // namespace globebrowsing +} // namespace openspace + +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___GEODETIC3___H__ diff --git a/modules/globebrowsing/geometry/geodeticpatch.cpp b/modules/globebrowsing/geometry/geodeticpatch.cpp new file mode 100644 index 0000000000..8aca1219fb --- /dev/null +++ b/modules/globebrowsing/geometry/geodeticpatch.cpp @@ -0,0 +1,242 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#include + +#include +#include + +namespace openspace { +namespace globebrowsing { + +GeodeticPatch::GeodeticPatch(double centerLat, double centerLon, double halfSizeLat, + double halfSizeLon) + : _center(Geodetic2(centerLat, centerLon)) + , _halfSize(Geodetic2(halfSizeLat, halfSizeLon)) +{} + +GeodeticPatch::GeodeticPatch(const Geodetic2& center, const Geodetic2& halfSize) + : _center(center) + , _halfSize(halfSize) +{} + +GeodeticPatch::GeodeticPatch(const GeodeticPatch& patch) + : _center(patch._center) + , _halfSize(patch._halfSize) +{} + +GeodeticPatch::GeodeticPatch(const TileIndex& tileIndex) { + double deltaLat = (2 * glm::pi()) / ((double)(1 << tileIndex.level)); + double deltaLon = (2 * glm::pi()) / ((double)(1 << tileIndex.level)); + Geodetic2 nwCorner(glm::pi() / 2 - deltaLat * tileIndex.y, -glm::pi() + deltaLon * tileIndex.x); + _halfSize = Geodetic2(deltaLat / 2, deltaLon / 2); + _center = Geodetic2(nwCorner.lat - _halfSize.lat, nwCorner.lon + _halfSize.lon); +} + +void GeodeticPatch::setCenter(const Geodetic2& center) { + _center = center; +} + +void GeodeticPatch::setHalfSize(const Geodetic2& halfSize) { + _halfSize = halfSize; +} + +double GeodeticPatch::maximumTileLevel() const { + // Numerator is just pi, not 2*pi, since we are dealing with HALF sizes + return log2(glm::pi() / glm::min(_halfSize.lat, _halfSize.lon)); +} + +double GeodeticPatch::minimumTileLevel() const { + // Numerator is just pi, not 2*pi, since we are dealing with HALF sizes + return log2(glm::pi() / glm::max(_halfSize.lat, _halfSize.lon)); +} + +const Geodetic2& GeodeticPatch::center() const { + return _center; +} + +const Geodetic2& GeodeticPatch::halfSize() const { + return _halfSize; +} + +Geodetic2 GeodeticPatch::size() const { + return Geodetic2(2 * _halfSize.lat, 2 * _halfSize.lon); +} + +Geodetic2 GeodeticPatch::getCorner(Quad q) const { + switch (q) { + case NORTH_WEST: return Geodetic2(maxLat(), minLon());// northWestCorner(); + case NORTH_EAST: return Geodetic2(maxLat(), maxLon());// northEastCorner(); + case SOUTH_WEST: return Geodetic2(minLat(), minLon());// southWestCorner(); + case SOUTH_EAST: return Geodetic2(minLat(), maxLon());// southEastCorner(); + } +} + +Geodetic2 GeodeticPatch::getSize() const { + return _halfSize * 2; +} + +double GeodeticPatch::minLat() const { + return _center.lat - _halfSize.lat; +} + +double GeodeticPatch::maxLat() const { + return _center.lat + _halfSize.lat; +} + +double GeodeticPatch::minLon() const { + return _center.lon - _halfSize.lon; +} + +double GeodeticPatch::maxLon() const { + return _center.lon + _halfSize.lon; +} + +bool GeodeticPatch::contains(const Geodetic2& p) const { + Geodetic2 diff = _center - p; + return glm::abs(diff.lat) <= _halfSize.lat && glm::abs(diff.lon) <= _halfSize.lon; +} + +double GeodeticPatch::edgeLatitudeNearestEquator() const { + return _center.lat + _halfSize.lat * (isNorthern() ? -1 : 1); +} + +double GeodeticPatch::isNorthern() const { + return _center.lat > 0.0; +} + +Geodetic2 GeodeticPatch::clamp(const Geodetic2& p) const { + using Ang = Angle; + + // Convert to Angles for normalization + Ang centerLat = Ang::fromRadians(_center.lat); + Ang centerLon = Ang::fromRadians(_center.lon); + Ang pointLat = Ang::fromRadians(p.lat); + Ang pointLon = Ang::fromRadians(p.lon); + + // Normalize w.r.t. the center in order for the clamping to done correctly + // + // Example: + // centerLat = 0 deg, halfSize.lat = 10 deg, pointLat = 330 deg + // --> Just clamping pointLat would be clamp(330, -10, 10) = 10 // WRONG! + // Instead, if we first normalize 330 deg around 0, we get -30 deg + // --> clamp(-30, -10, 10) = -10 // CORRECT! + pointLat.normalizeAround(centerLat); + pointLon.normalizeAround(centerLon); + + return Geodetic2( + glm::clamp(pointLat.asRadians(), minLat(), maxLat()), + glm::clamp(pointLon.asRadians(), minLon(), maxLon()) + ); +} + +Geodetic2 GeodeticPatch::closestCorner(const Geodetic2& p) const { + using Ang = Angle; + + // LatLon vector from patch center to the point + Geodetic2 centerToPoint = p - _center; + + // Normalize the difference angles to be centered around 0. + Ang latDiff = Ang::fromRadians(centerToPoint.lat).normalizeAround(Ang::ZERO); + Ang lonDiff = Ang::fromRadians(centerToPoint.lon).normalizeAround(Ang::ZERO); + + // If latDiff > 0 + // --> point p is north of the patch center + // --> the closest corner to the point must be a northern one + // --> set the corner's latitude coordinate to center.lat + halfSize.lat + // else + // --> set corner's latidude coordinate to center.lat - halfSize.lat + double cornerLat = _center.lat + _halfSize.lat * (latDiff > Ang::ZERO ? 1 : -1); + + // We then assigned the corner's longitude coordinate in a similar fashion + double cornerLon = _center.lon + _halfSize.lon * (lonDiff > Ang::ZERO ? 1 : -1); + + return Geodetic2(cornerLat, cornerLon); +} + +Geodetic2 GeodeticPatch::closestPoint(const Geodetic2& p) const { + // This method finds the closest point on the patch, to the provided + // point p. As we are deali ng with latitude-longitude patches, distance in this + // context refers to great-circle distance. + // (https://en.wikipedia.org/wiki/Great-circle_distance) + // + // This uses a simple clamping approach to find the closest point on the + // patch. A naive castesian clamp is not sufficient for this purpose, + // as illustrated with an example below. + + // Example: (degrees are used for latidude, longitude) + // patchCenter = (0,0), patchHalfSize = (45,45), point = (5, 170) + // Note, the point and the patch are on opposite sides of the sphere + // + // cartesian clamp: + // --> clampedPointLat = clamp(5, -45, 45) = 5 + // --> clampedPointLon = clamp(170, -45, 45) = 45 + // --> result: (5, 45) + // --> closest point is actually (45, 45) + // --> The error is significant + // + // This method simply adds an extra clamp on the latitude in these cases. In the + // above example, that would be the following: + // --> clampedPointLat = clamp(180 - 5, -45, 45) = 45 + // + // Just doing this actually makes points returned from this methods being the + // true closest point, great-circle distance-wise. + + + using Ang = Angle; + + // Convert to Angles for normalization + Ang centerLat = Ang::fromRadians(_center.lat); + Ang centerLon = Ang::fromRadians(_center.lon); + Ang pointLat = Ang::fromRadians(p.lat); + Ang pointLon = Ang::fromRadians(p.lon); + + // Normalize point with respect to center. This is done because the point + // will later be clamped. See LatLonPatch::clamp(const LatLon&) for explanation + pointLat.normalizeAround(centerLat); + pointLon.normalizeAround(centerLon); + + // Calculate the longitud difference between center and point. We normalize around + // zero because we want the "shortest distance" difference, i.e the difference + // should be in the interval [-180 deg, 180 deg] + Ang centerToPointLon = (centerLon - pointLon).normalizeAround(Ang::ZERO); + + // Calculate the longitudinal distance to the closest patch edge + Ang longitudeDistanceToClosestPatchEdge = centerToPointLon.abs() - Ang::fromRadians(_halfSize.lon); + + // If the longitude distance to the closest patch edge is larger than 90 deg + // the latitude will have to be clamped to its closest corner, as explained in + // the example above. + double clampedLat = longitudeDistanceToClosestPatchEdge > Ang::QUARTER ? + clampedLat = glm::clamp((Ang::HALF - pointLat).normalizeAround(centerLat).asRadians(), minLat(), maxLat()) : + clampedLat = glm::clamp(pointLat.asRadians(), minLat(), maxLat()); + + // Longitude is just clamped normally + double clampedLon = glm::clamp(pointLon.asRadians(), minLon(), maxLon()); + + return Geodetic2(clampedLat, clampedLon); +} + +} // namespace globebrowsing +} // namespace openspace diff --git a/modules/globebrowsing/geometry/geodeticpatch.h b/modules/globebrowsing/geometry/geodeticpatch.h new file mode 100644 index 0000000000..6ebc01733f --- /dev/null +++ b/modules/globebrowsing/geometry/geodeticpatch.h @@ -0,0 +1,117 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___GEODETICPATCH___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___GEODETICPATCH___H__ + +#include +#include + +namespace openspace { +namespace globebrowsing { + +class TileIndex; + +class GeodeticPatch { +public: + GeodeticPatch( + double centerLat, + double centerLon, + double halfSizeLat, + double halfSizeLon); + + GeodeticPatch( + const Geodetic2& center, + const Geodetic2& halfSize); + + GeodeticPatch(const GeodeticPatch& patch); + + GeodeticPatch(const TileIndex& tileIndex); + + void setCenter(const Geodetic2&); + void setHalfSize(const Geodetic2&); + + /** + * Returns the latitude boundary which is closest to the equator + */ + double edgeLatitudeNearestEquator() const; + + /** + * Returns \c true if the center above the equator + */ + double isNorthern() const; + + Geodetic2 getCorner(Quad q) const; + Geodetic2 getSize() const; + + double minLat() const; + double maxLat() const; + double minLon() const; + double maxLon() const; + + /** + * Returns \c true if the specified coordinate is contained within the patch + */ + bool contains(const Geodetic2& p) const; + + + /** + * Clamps a point to the patch region + */ + Geodetic2 clamp(const Geodetic2& p) const; + + /** + * Returns the corner of the patch that is closest to the given point p + */ + Geodetic2 closestCorner(const Geodetic2& p) const; + + /** + * Returns a point on the patch that minimizes the great-circle distance to + * the given point p. + */ + Geodetic2 closestPoint(const Geodetic2& p) const; + + /** + * Returns the minimum tile level of the patch (based on largest side) + */ + double minimumTileLevel() const; + + /** + * Returns the maximum level of the patch (based on smallest side) + */ + double maximumTileLevel() const; + + const Geodetic2& center() const; + const Geodetic2& halfSize() const; + Geodetic2 size() const; + +private: + Geodetic2 _center; + Geodetic2 _halfSize; +}; + +} // namespace globebrowsing +} // namespace openspace + +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___GEODETICPATCH___H__ diff --git a/modules/globebrowsing/globebrowsingmodule.cpp b/modules/globebrowsing/globebrowsingmodule.cpp index 11928c22fb..808e5ce072 100644 --- a/modules/globebrowsing/globebrowsingmodule.cpp +++ b/modules/globebrowsing/globebrowsingmodule.cpp @@ -28,8 +28,10 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -52,17 +54,17 @@ void GlobeBrowsingModule::internalInitialize() { fRenderable->registerClass("RenderableGlobe"); // add Tile Provider factory - auto fTileProvider = std::make_unique>(); + auto fTileProvider = std::make_unique>(); - fTileProvider->registerClass("LRUCaching"); - fTileProvider->registerClass("SingleImage"); - fTileProvider->registerClass("Temporal"); - fTileProvider->registerClass("TileIndex"); - fTileProvider->registerClass("SizeReference"); + fTileProvider->registerClass("LRUCaching"); + fTileProvider->registerClass("SingleImage"); + fTileProvider->registerClass("Temporal"); + fTileProvider->registerClass("TileIndex"); + fTileProvider->registerClass("SizeReference"); // Combining Tile Providers - fTileProvider->registerClass("ByLevel"); - fTileProvider->registerClass("ByIndex"); + fTileProvider->registerClass("ByLevel"); + fTileProvider->registerClass("ByIndex"); FactoryManager::ref().addFactory(std::move(fTileProvider)); } diff --git a/modules/globebrowsing/globes/chunkedlodglobe.cpp b/modules/globebrowsing/globes/chunkedlodglobe.cpp index d1130bee96..8df8299544 100644 --- a/modules/globebrowsing/globes/chunkedlodglobe.cpp +++ b/modules/globebrowsing/globes/chunkedlodglobe.cpp @@ -25,19 +25,26 @@ #include #include -#include +#include +#include +#include +#include #include -#include +#include +#include +#include #include #include #include #include -#include +#include +#include #include #include #include +#include #include @@ -66,17 +73,17 @@ ChunkedLodGlobe::ChunkedLodGlobe(const RenderableGlobe& owner, size_t segmentsPe TriangleSoup::Normals::No ); - _chunkCullers.push_back(std::make_unique()); - _chunkCullers.push_back(std::make_unique( + _chunkCullers.push_back(std::make_unique()); + _chunkCullers.push_back(std::make_unique( AABB3(glm::vec3(-1, -1, 0), glm::vec3(1, 1, 1e35))) ); _chunkEvaluatorByAvailableTiles = - std::make_unique(); + std::make_unique(); _chunkEvaluatorByProjectedArea = - std::make_unique(); + std::make_unique(); _chunkEvaluatorByDistance = - std::make_unique(); + std::make_unique(); _renderer = std::make_unique(geometry, layerManager); } @@ -135,7 +142,7 @@ int ChunkedLodGlobe::getDesiredLevel( int desiredLevelByAvailableData = _chunkEvaluatorByAvailableTiles->getDesiredLevel( chunk, renderData ); - if (desiredLevelByAvailableData != ChunkLevelEvaluator::UNKNOWN_DESIRED_LEVEL) { + if (desiredLevelByAvailableData != chunklevelevaluator::Evaluator::UnknownDesiredLevel) { desiredLevel = glm::min(desiredLevel, desiredLevelByAvailableData); } @@ -166,7 +173,7 @@ float ChunkedLodGlobe::getHeight(glm::dvec3 position) const { const auto& heightMapLayers = _layerManager->layerGroup(LayerManager::HeightLayers).activeLayers(); for (const auto& layer : heightMapLayers) { - TileProvider* tileProvider = layer->tileProvider(); + tileprovider::TileProvider* tileProvider = layer->tileProvider(); // Transform the uv coordinates to the current tile texture ChunkTile chunkTile = tileProvider->getChunkTile(tileIndex); const auto& tile = chunkTile.tile; diff --git a/modules/globebrowsing/globes/chunkedlodglobe.h b/modules/globebrowsing/globes/chunkedlodglobe.h index 965bc627d3..c34695d1c6 100644 --- a/modules/globebrowsing/globes/chunkedlodglobe.h +++ b/modules/globebrowsing/globes/chunkedlodglobe.h @@ -29,15 +29,22 @@ #include #include +#include #include namespace openspace { namespace globebrowsing { +namespace chunklevelevaluator { + class Evaluator; +} // namespace chunklevelevaluator + +namespace culling { + class ChunkCuller; +} // namespace culling + class Chunk; -class ChunkCuller; -class ChunkLevelEvaluator; class ChunkNode; class ChunkRenderer; class Geodetic2; @@ -61,13 +68,13 @@ public: * Traverse the chunk tree and find the highest level chunk node. * * \param location is given in geodetic coordinates and must be in the range - * latitude [-90. 90] and longitude [-180, 180]. In other words, it must be a + * latitude [-90, 90] and longitude [-180, 180]. In other words, it must be a * position defined on the globe in georeferenced coordinates. */ const ChunkNode& findChunkNode(const Geodetic2& location) const; /** - * Test if a specific chunk can saefely be culled without affecting the rendered + * Test if a specific chunk can saf;ely be culled without affecting the rendered * image. * * Goes through all available ChunkCullers and check if any of them @@ -123,11 +130,11 @@ private: // the patch used for actual rendering std::unique_ptr _renderer; - std::vector> _chunkCullers; + std::vector> _chunkCullers; - std::unique_ptr _chunkEvaluatorByAvailableTiles; - std::unique_ptr _chunkEvaluatorByProjectedArea; - std::unique_ptr _chunkEvaluatorByDistance; + std::unique_ptr _chunkEvaluatorByAvailableTiles; + std::unique_ptr _chunkEvaluatorByProjectedArea; + std::unique_ptr _chunkEvaluatorByDistance; std::shared_ptr _layerManager; diff --git a/modules/globebrowsing/globes/pointglobe.h b/modules/globebrowsing/globes/pointglobe.h index 5407f9a49e..2c41a38e8a 100644 --- a/modules/globebrowsing/globes/pointglobe.h +++ b/modules/globebrowsing/globes/pointglobe.h @@ -29,7 +29,7 @@ namespace ghoul { namespace opengl { class ProgramObject; -}} +} } namespace openspace { namespace globebrowsing { diff --git a/modules/globebrowsing/globes/renderableglobe.cpp b/modules/globebrowsing/globes/renderableglobe.cpp index f093a79f2e..6c050a57aa 100644 --- a/modules/globebrowsing/globes/renderableglobe.cpp +++ b/modules/globebrowsing/globes/renderableglobe.cpp @@ -26,7 +26,7 @@ #include #include -#include +#include namespace { const char* keyFrame = "Frame"; diff --git a/modules/globebrowsing/meshes/basicgrid.cpp b/modules/globebrowsing/meshes/basicgrid.cpp index 70e1ab5917..88d33512d6 100644 --- a/modules/globebrowsing/meshes/basicgrid.cpp +++ b/modules/globebrowsing/meshes/basicgrid.cpp @@ -36,22 +36,22 @@ BasicGrid::BasicGrid(unsigned int xSegments, unsigned int ySegments, : Grid(xSegments, ySegments, usePositions, useTextureCoordinates, useNormals) { _geometry = std::make_unique( - CreateElements(xSegments, ySegments), + createElements(xSegments, ySegments), usePositions, useTextureCoordinates, useNormals ); if (usePositions) { - _geometry->setVertexPositions(CreatePositions(_xSegments, _ySegments)); + _geometry->setVertexPositions(createPositions(_xSegments, _ySegments)); } if (useTextureCoordinates) { _geometry->setVertexTextureCoordinates( - CreateTextureCoordinates(_xSegments, _ySegments) + createTextureCoordinates(_xSegments, _ySegments) ); } if (useNormals) { - _geometry->setVertexNormals(CreateNormals(_xSegments, _ySegments)); + _geometry->setVertexNormals(createNormals(_xSegments, _ySegments)); } } @@ -76,7 +76,7 @@ inline size_t BasicGrid::numVertices(int xSegments, int ySegments) { return (xSegments + 1) * (ySegments + 1); } -std::vector BasicGrid::CreateElements(int xSegments, int ySegments) { +std::vector BasicGrid::createElements(int xSegments, int ySegments) { validate(xSegments, ySegments); std::vector elements; @@ -111,13 +111,13 @@ std::vector BasicGrid::CreateElements(int xSegments, int ySegments) { return elements; } -std::vector BasicGrid::CreatePositions(int xSegments, int ySegments) { +std::vector BasicGrid::createPositions(int xSegments, int ySegments) { validate(xSegments, ySegments); std::vector positions; positions.reserve(numVertices(xSegments, ySegments)); // Copy from 2d texture coordinates and use as template to create positions - std::vector templateTextureCoords = CreateTextureCoordinates( + std::vector templateTextureCoords = createTextureCoordinates( xSegments, ySegments ); for (const glm::vec2& coords : templateTextureCoords) { @@ -133,7 +133,7 @@ std::vector BasicGrid::CreatePositions(int xSegments, int ySegments) return positions; } -std::vector BasicGrid::CreateTextureCoordinates(int xSegments, int ySegments) { +std::vector BasicGrid::createTextureCoordinates(int xSegments, int ySegments) { validate(xSegments, ySegments); std::vector textureCoordinates; textureCoordinates.reserve(numVertices(xSegments, ySegments)); @@ -149,7 +149,7 @@ std::vector BasicGrid::CreateTextureCoordinates(int xSegments, int yS return textureCoordinates; } -std::vector BasicGrid::CreateNormals(int xSegments, int ySegments) { +std::vector BasicGrid::createNormals(int xSegments, int ySegments) { validate(xSegments, ySegments); std::vector normals; normals.reserve(numVertices(xSegments, ySegments)); diff --git a/modules/globebrowsing/meshes/basicgrid.h b/modules/globebrowsing/meshes/basicgrid.h index 6a357ad38f..73514cdf77 100644 --- a/modules/globebrowsing/meshes/basicgrid.h +++ b/modules/globebrowsing/meshes/basicgrid.h @@ -47,18 +47,19 @@ public: * to the GPU. */ BasicGrid(unsigned int xSegments, unsigned int ySegments, - TriangleSoup::Positions usePositions, - TriangleSoup::TextureCoordinates useTextureCoordinates, - TriangleSoup::Normals useNormals); + TriangleSoup::Positions usePositions, + TriangleSoup::TextureCoordinates useTextureCoordinates, + TriangleSoup::Normals useNormals); virtual int xSegments() const; virtual int ySegments() const; private: - virtual std::vector CreateElements(int xRes, int yRes); - virtual std::vector CreatePositions(int xRes, int yRes); - virtual std::vector CreateTextureCoordinates(int xRes, int yRes); - virtual std::vector CreateNormals(int xRes, int yRes); + std::vector createElements(int xRes, int yRes) override; + std::vector createPositions(int xRes, int yRes) override; + std::vector createTextureCoordinates(int xRes, int yRes) + override; + std::vector createNormals(int xRes, int yRes) override; void validate(int xSegments, int ySegments); diff --git a/modules/globebrowsing/meshes/grid.h b/modules/globebrowsing/meshes/grid.h index 3b6e07e59b..d0058ec51f 100644 --- a/modules/globebrowsing/meshes/grid.h +++ b/modules/globebrowsing/meshes/grid.h @@ -46,7 +46,7 @@ public: Grid(int xSegments, int ySegments, TriangleSoup::Positions usePositions = TriangleSoup::Positions::No, TriangleSoup::TextureCoordinates useTextures = - TriangleSoup::TextureCoordinates::No, + TriangleSoup::TextureCoordinates::No, TriangleSoup::Normals useNormals = TriangleSoup::Normals::No); virtual ~Grid() = default; @@ -71,14 +71,14 @@ protected: * ySegments. Where the number of vertices in each direction is the number * of segments + 1. */ - virtual std::vector CreateElements(int xSegments, int ySegments) = 0; + virtual std::vector createElements(int xSegments, int ySegments) = 0; /** * Should return the positions of vertices for a grid with size xSegments * * ySegments. Where the number of vertices in each direction is the * number of segments + 1. */ - virtual std::vector CreatePositions(int xSegments, int ySegments) = 0; + virtual std::vector createPositions(int xSegments, int ySegments) = 0; /** * Should return the texture coordinates of vertices for a grid with size @@ -86,14 +86,14 @@ protected: * each direction is the number of segments + 1. */ virtual std::vector - CreateTextureCoordinates(int xSegments, int ySegments) = 0; + createTextureCoordinates(int xSegments, int ySegments) = 0; /** * Should return the normals of vertices for a grid with size xSegments * * ySegments. Where the number of vertices in each direction is the number * of segments + 1. */ - virtual std::vector CreateNormals(int xSegments, int ySegments) = 0; + virtual std::vector createNormals(int xSegments, int ySegments) = 0; std::unique_ptr _geometry; diff --git a/modules/globebrowsing/meshes/skirtedgrid.cpp b/modules/globebrowsing/meshes/skirtedgrid.cpp index 66eeaaf30a..ee632af4b6 100644 --- a/modules/globebrowsing/meshes/skirtedgrid.cpp +++ b/modules/globebrowsing/meshes/skirtedgrid.cpp @@ -40,20 +40,20 @@ SkirtedGrid::SkirtedGrid(unsigned int xSegments, unsigned int ySegments, : Grid(xSegments, ySegments, usePositions, useTextureCoordinates, useNormals) { _geometry = std::make_unique( - CreateElements(xSegments, ySegments), + createElements(xSegments, ySegments), usePositions, useTextureCoordinates, useNormals ); if (usePositions) { - _geometry->setVertexPositions(CreatePositions(_xSegments, _ySegments)); + _geometry->setVertexPositions(createPositions(_xSegments, _ySegments)); } if (useTextureCoordinates) { - _geometry->setVertexTextureCoordinates(CreateTextureCoordinates(_xSegments, _ySegments)); + _geometry->setVertexTextureCoordinates(createTextureCoordinates(_xSegments, _ySegments)); } if (useNormals) { - _geometry->setVertexNormals(CreateNormals(_xSegments, _ySegments)); + _geometry->setVertexNormals(createNormals(_xSegments, _ySegments)); } } @@ -80,7 +80,7 @@ inline size_t SkirtedGrid::numVertices(int xSegments, int ySegments) { return (xSegments + 1) * (ySegments + 1); } -std::vector SkirtedGrid::CreateElements(int xSegments, int ySegments) { +std::vector SkirtedGrid::createElements(int xSegments, int ySegments) { validate(xSegments, ySegments); std::vector elements; @@ -115,13 +115,13 @@ std::vector SkirtedGrid::CreateElements(int xSegments, int ySegments) { return elements; } -std::vector SkirtedGrid::CreatePositions(int xSegments, int ySegments) { +std::vector SkirtedGrid::createPositions(int xSegments, int ySegments) { validate(xSegments, ySegments); std::vector positions; positions.reserve(numVertices(xSegments, ySegments)); // Copy from 2d texture coordinates and use as template to create positions - std::vector templateTextureCoords = CreateTextureCoordinates( + std::vector templateTextureCoords = createTextureCoordinates( xSegments, ySegments ); for (const auto& c : templateTextureCoords) { @@ -137,7 +137,7 @@ std::vector SkirtedGrid::CreatePositions(int xSegments, int ySegments return positions; } -std::vector SkirtedGrid::CreateTextureCoordinates(int xSegments, int ySegments) +std::vector SkirtedGrid::createTextureCoordinates(int xSegments, int ySegments) { validate(xSegments, ySegments); std::vector textureCoordinates; @@ -162,7 +162,7 @@ std::vector SkirtedGrid::CreateTextureCoordinates(int xSegments, int return textureCoordinates; } -std::vector SkirtedGrid::CreateNormals(int xSegments, int ySegments) { +std::vector SkirtedGrid::createNormals(int xSegments, int ySegments) { validate(xSegments, ySegments); std::vector normals; normals.reserve(numVertices(xSegments + 2, ySegments + 2)); diff --git a/modules/globebrowsing/meshes/skirtedgrid.h b/modules/globebrowsing/meshes/skirtedgrid.h index 6bccff1565..06749e2719 100644 --- a/modules/globebrowsing/meshes/skirtedgrid.h +++ b/modules/globebrowsing/meshes/skirtedgrid.h @@ -61,10 +61,10 @@ public: virtual int ySegments() const; private: - virtual std::vector CreateElements(int xRes, int yRes); - virtual std::vector CreatePositions(int xRes, int yRes); - virtual std::vector CreateTextureCoordinates(int xRes, int yRes); - virtual std::vector CreateNormals(int xRes, int yRes); + std::vector createElements(int xRes, int yRes) override; + std::vector createPositions(int xRes, int yRes) override; + std::vector createTextureCoordinates(int xRes, int yRes) override; + std::vector createNormals(int xRes, int yRes) override; void validate(int xSegments, int ySegments); diff --git a/modules/globebrowsing/meshes/trianglesoup.h b/modules/globebrowsing/meshes/trianglesoup.h index 91d3e59540..d754b0b244 100644 --- a/modules/globebrowsing/meshes/trianglesoup.h +++ b/modules/globebrowsing/meshes/trianglesoup.h @@ -54,6 +54,7 @@ public: Positions usePositions = Positions::No, TextureCoordinates useTextures = TextureCoordinates::No, Normals useNormals = Normals::No); + ~TriangleSoup(); // Setters @@ -78,14 +79,13 @@ protected: bool _useTextureCoordinates; bool _useVertexNormals; - typedef struct { - public: + struct Vertex { GLfloat position[4]; GLfloat texture[2]; GLfloat normal[3]; private: GLubyte padding[28]; // Pads the struct out to 64 bytes for performance increase - } Vertex; + }; // Vertex data std::vector _vertexData; diff --git a/modules/globebrowsing/other/distanceswitch.cpp b/modules/globebrowsing/other/distanceswitch.cpp index 4200e0c242..971f2e32d0 100644 --- a/modules/globebrowsing/other/distanceswitch.cpp +++ b/modules/globebrowsing/other/distanceswitch.cpp @@ -24,9 +24,13 @@ #include +#include + namespace openspace { namespace globebrowsing { +DistanceSwitch::~DistanceSwitch() {} + bool DistanceSwitch::initialize() { for (int i = 0; i < _renderables.size(); ++i) { _renderables[i]->initialize(); diff --git a/modules/globebrowsing/other/distanceswitch.h b/modules/globebrowsing/other/distanceswitch.h index ddff5a156e..59a87d41c8 100644 --- a/modules/globebrowsing/other/distanceswitch.h +++ b/modules/globebrowsing/other/distanceswitch.h @@ -25,13 +25,12 @@ #ifndef __OPENSPACE_MODULE_GLOBEBROWSING___DISTANCESWITCH___H__ #define __OPENSPACE_MODULE_GLOBEBROWSING___DISTANCESWITCH___H__ -#include - #include #include namespace openspace { +class Renderable; struct RenderData; struct UpdateData; @@ -43,6 +42,8 @@ namespace globebrowsing { */ class DistanceSwitch { public: + ~DistanceSwitch(); + bool initialize(); bool deinitialize(); diff --git a/modules/globebrowsing/other/lrucache.h b/modules/globebrowsing/other/lrucache.h index 649a222ae0..d410ab4985 100644 --- a/modules/globebrowsing/other/lrucache.h +++ b/modules/globebrowsing/other/lrucache.h @@ -46,8 +46,6 @@ public: private: void clean(); -// Member varialbes -private: std::list> _itemList; std::unordered_map _itemMap; size_t _cacheSize; diff --git a/modules/globebrowsing/other/statscollector.h b/modules/globebrowsing/other/statscollector.h index af1f6e57e6..1d78e81eb9 100644 --- a/modules/globebrowsing/other/statscollector.h +++ b/modules/globebrowsing/other/statscollector.h @@ -35,14 +35,6 @@ namespace openspace { namespace globebrowsing { -template -using StatsRecord = std::unordered_map; - -template -struct StatsCollection : public std::vector> { - std::set keys; -}; - template class TemplatedStatsCollector { public: @@ -67,6 +59,14 @@ public: void writeNextRecord(std::ostream& os); private: + template + using StatsRecord = std::unordered_map; + + template + struct StatsCollection : public std::vector> { + std::set keys; + }; + StatsCollection _data; T _dummy; // used when disabled bool& _enabled; diff --git a/modules/globebrowsing/rendering/chunkrenderer.cpp b/modules/globebrowsing/rendering/chunkrenderer.cpp index d98805df40..05af587eec 100644 --- a/modules/globebrowsing/rendering/chunkrenderer.cpp +++ b/modules/globebrowsing/rendering/chunkrenderer.cpp @@ -28,7 +28,8 @@ #include #include #include -#include +#include +#include namespace { const char* keyFrame = "Frame"; @@ -82,10 +83,10 @@ ghoul::opengl::ProgramObject* ChunkRenderer::getActivatedProgramWithTileData( { const TileIndex& tileIndex = chunk.tileIndex(); - LayerShaderPreprocessingData layeredTexturePreprocessingData; + LayerShaderManager::LayerShaderPreprocessingData layeredTexturePreprocessingData; for (size_t i = 0; i < LayerManager::NUM_LAYER_GROUPS; i++) { - LayerGroupPreprocessingData layeredTextureInfo; + LayerShaderManager::LayerShaderPreprocessingData::LayerGroupPreprocessingData layeredTextureInfo; auto layerGroup = _layerManager->layerGroup(i); layeredTextureInfo.lastLayerIdx = layerGroup.activeLayers().size() - 1; layeredTextureInfo.layerBlendingEnabled = layerGroup.layerBlendingEnabled(); diff --git a/modules/globebrowsing/rendering/gpu/gpuchunktile.cpp b/modules/globebrowsing/rendering/gpu/gpuchunktile.cpp new file mode 100644 index 0000000000..4467241bfa --- /dev/null +++ b/modules/globebrowsing/rendering/gpu/gpuchunktile.cpp @@ -0,0 +1,48 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#include + +#include +#include + +namespace openspace { +namespace globebrowsing { + +void GPUChunkTile::setValue(ProgramObject* programObject, const ChunkTile& chunkTile) { + gpuTexture.setValue(programObject, chunkTile.tile.texture); + gpuTileUvTransform.setValue(programObject, chunkTile.uvTransform); +} + +void GPUChunkTile::bind(ProgramObject* programObject, const std::string& nameBase) { + gpuTexture.bind(programObject, nameBase + "textureSampler"); + gpuTileUvTransform.bind(programObject, nameBase + "uvTransform."); +} + +void GPUChunkTile::deactivate() { + gpuTexture.deactivate(); +} + +} // namespace globebrowsing +} // namespace openspace diff --git a/modules/globebrowsing/rendering/gpu/gpuchunktile.h b/modules/globebrowsing/rendering/gpu/gpuchunktile.h new file mode 100644 index 0000000000..4a85ab13ad --- /dev/null +++ b/modules/globebrowsing/rendering/gpu/gpuchunktile.h @@ -0,0 +1,77 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___GPUCHUNKTILE___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___GPUCHUNKTILE___H__ + +#include + +#include + +#include + +namespace ghoul { namespace opengl { +class ProgramObject; +}} + +namespace openspace { +namespace globebrowsing { + +struct ChunkTile; + +/** + * Manages a GPU representation of a ChunkTile + */ +class GPUChunkTile { +public: + + /** + * Sets the value of ChunkTile to its corresponding + * GPU struct. OBS! Users must ensure bind has been + * called before setting using this method. + */ + void setValue(ProgramObject* programObject, const ChunkTile& chunkTile); + + /** + * Binds GLSL variables with identifiers starting with + * nameBase within the provided shader program with this object. + * After this method has been called, users may invoke setValue. + */ + void bind(ProgramObject* programObject, const std::string& nameBase); + + /** + * Deactivates any TextureUnits assigned by this object. + * This method should be called after the OpenGL draw call. + */ + void deactivate(); + +private: + GPUTexture gpuTexture; + GPUTileUvTransform gpuTileUvTransform; +}; + +} // namespace globebrowsing +} // namespace openspace + +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___GPUCHUNKTILE___H__ diff --git a/modules/globebrowsing/rendering/gpu/gpuchunktilepile.cpp b/modules/globebrowsing/rendering/gpu/gpuchunktilepile.cpp new file mode 100644 index 0000000000..52562ac90a --- /dev/null +++ b/modules/globebrowsing/rendering/gpu/gpuchunktilepile.cpp @@ -0,0 +1,60 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#include + + +namespace openspace { +namespace globebrowsing { + +void GPUChunkTilePile::setValue(ProgramObject* programObject, + const ChunkTilePile& chunkTilePile) +{ + ghoul_assert( + gpuChunkTiles.size() == chunkTilePile.size(), + "GPU and CPU ChunkTilePile must have same size!" + ); + for (size_t i = 0; i < gpuChunkTiles.size(); ++i) { + gpuChunkTiles[i].setValue(programObject, chunkTilePile[i]); + } +} + +void GPUChunkTilePile::bind(ProgramObject* programObject, const std::string& nameBase, + int pileSize) +{ + gpuChunkTiles.resize(pileSize); + for (size_t i = 0; i < gpuChunkTiles.size(); ++i) { + std::string nameExtension = "chunkTile" + std::to_string(i) + "."; + gpuChunkTiles[i].bind(programObject, nameBase + nameExtension); + } +} + +void GPUChunkTilePile::deactivate() { + for (auto& gpuChunkTile : gpuChunkTiles) { + gpuChunkTile.deactivate(); + } +} + +} // namespace globebrowsing +} // namespace openspace diff --git a/modules/globebrowsing/rendering/gpu/gpuchunktilepile.h b/modules/globebrowsing/rendering/gpu/gpuchunktilepile.h new file mode 100644 index 0000000000..76d34ac1b9 --- /dev/null +++ b/modules/globebrowsing/rendering/gpu/gpuchunktilepile.h @@ -0,0 +1,76 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___GPUCHUNKTILEPILE___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___GPUCHUNKTILEPILE___H__ + +#include + +#include + +#include + +#include + +namespace ghoul { namespace opengl { +class ProgramObject; +}} + +namespace openspace { +namespace globebrowsing { + +/** + * Manages a GPU representation of a ChunkTilePile + */ +class GPUChunkTilePile { +public: + + /** + * Sets the value of ChunkTilePile to its corresponding + * GPU struct. OBS! Users must ensure bind has been + * called before setting using this method. + */ + void setValue(ProgramObject* programObject, const ChunkTilePile& chunkTilePile); + + /** + * Binds this object with GLSL variables with identifiers starting + * with nameBase within the provided shader program. + * After this method has been called, users may invoke setValue. + */ + void bind(ProgramObject* programObject, const std::string& nameBase, + int pileSize); + /** + * Deactivates any TextureUnits assigned by this object. + * This method should be called after the OpenGL draw call. + */ + void deactivate(); + +private: + std::vector gpuChunkTiles; +}; + +} // namespace globebrowsing +} // namespace openspace + +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___GPUCHUNKTILEPILE___H__ diff --git a/modules/globebrowsing/rendering/gpu/gpuheightlayer.cpp b/modules/globebrowsing/rendering/gpu/gpuheightlayer.cpp new file mode 100644 index 0000000000..2db24d540f --- /dev/null +++ b/modules/globebrowsing/rendering/gpu/gpuheightlayer.cpp @@ -0,0 +1,52 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#include + +#include +#include +#include +#include +#include + +namespace openspace { +namespace globebrowsing { + +void GPUHeightLayer::setValue(ProgramObject* programObject, const Layer& layer, + const TileIndex& tileIndex, int pileSize) +{ + GPULayer::setValue(programObject, layer, tileIndex, pileSize); + gpuDepthTransform.setValue(programObject, layer.tileProvider()->depthTransform()); +} + +void GPUHeightLayer::bind(ProgramObject* programObject, const Layer& layer, + const std::string& nameBase, int pileSize) +{ + GPULayer::bind(programObject, layer, nameBase, pileSize); + gpuDepthTransform.bind(programObject, nameBase + "depthTransform."); +} + + +} // namespace globebrowsing +} // namespace openspace diff --git a/modules/globebrowsing/rendering/gpu/gpuheightlayer.h b/modules/globebrowsing/rendering/gpu/gpuheightlayer.h new file mode 100644 index 0000000000..466fb0909f --- /dev/null +++ b/modules/globebrowsing/rendering/gpu/gpuheightlayer.h @@ -0,0 +1,74 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___GPUHEIGHTLAYER___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___GPUHEIGHTLAYER___H__ + +#include + +#include +#include +#include + +namespace ghoul { namespace opengl { +class ProgramObject; +}} + +namespace openspace { +namespace globebrowsing { + +class Layer; +struct TileIndex; + +/** + * Manages a GPU representation of a Layer representing + * a height map. + */ +class GPUHeightLayer : public GPULayer { +public: + + /** + * Sets the value of Layer to its corresponding + * GPU struct. OBS! Users must ensure bind has been + * called before setting using this method. + */ + virtual void setValue(ProgramObject* programObject, const Layer& layer, + const TileIndex& tileIndex, int pileSize); + + /** + * Binds this object with GLSL variables with identifiers starting + * with nameBase within the provided shader program. + * After this method has been called, users may invoke setValue. + */ + virtual void bind(ProgramObject* programObject, const Layer& layer, + const std::string& nameBase, int pileSize); + +private: + GPUTileDepthTransform gpuDepthTransform; +}; + +} // namespace globebrowsing +} // namespace openspace + +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___GPUHEIGHTLAYER___H__ diff --git a/modules/globebrowsing/rendering/gpu/gpulayer.cpp b/modules/globebrowsing/rendering/gpu/gpulayer.cpp new file mode 100644 index 0000000000..b54d9586f8 --- /dev/null +++ b/modules/globebrowsing/rendering/gpu/gpulayer.cpp @@ -0,0 +1,52 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#include + +#include + +namespace openspace { +namespace globebrowsing { + +void GPULayer::setValue(ProgramObject* programObject, const Layer& layer, + const TileIndex& tileIndex, int pileSize) +{ + ChunkTilePile chunkTilePile = layer.getChunkTilePile(tileIndex, pileSize); + gpuChunkTilePile.setValue(programObject, chunkTilePile); + gpuRenderSettings.setValue(programObject, layer.renderSettings()); +} + +void GPULayer::bind(ProgramObject* programObject, const Layer& layer, + const std::string& nameBase, int pileSize) +{ + gpuChunkTilePile.bind(programObject, nameBase + "pile.", pileSize); + gpuRenderSettings.bind(programObject, nameBase + "settings."); +} + +void GPULayer::deactivate() { + gpuChunkTilePile.deactivate(); +} + +} // namespace globebrowsing +} // namespace openspace diff --git a/modules/globebrowsing/rendering/gpu/gpulayer.h b/modules/globebrowsing/rendering/gpu/gpulayer.h new file mode 100644 index 0000000000..bd07af9d6b --- /dev/null +++ b/modules/globebrowsing/rendering/gpu/gpulayer.h @@ -0,0 +1,79 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___GPULAYER___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___GPULAYER___H__ + +#include +#include +#include +#include + +namespace ghoul { namespace opengl { +class ProgramObject; +}} + +namespace openspace { +namespace globebrowsing { + +class Layer; +struct TileIndex; + +/** + * Manages a GPU representation of a Layer + */ +class GPULayer { +public: + + /** + * Sets the value of Layer to its corresponding + * GPU struct. OBS! Users must ensure bind has been + * called before setting using this method. + */ + virtual void setValue(ProgramObject* programObject, const Layer& layer, + const TileIndex& tileIndex, int pileSize); + + /** + * Binds this object with GLSL variables with identifiers starting + * with nameBase within the provided shader program. + * After this method has been called, users may invoke setValue. + */ + virtual void bind(ProgramObject* programObject, const Layer& layer, + const std::string& nameBase, int pileSize); + + /** + * Deactivates any TextureUnits assigned by this object. + * This method should be called after the OpenGL draw call. + */ + virtual void deactivate(); + +private: + GPUChunkTilePile gpuChunkTilePile; + GPULayerRenderSettings gpuRenderSettings; +}; + +} // namespace globebrowsing +} // namespace openspace + +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___GPULAYER___H__ diff --git a/modules/globebrowsing/rendering/gpu/gpulayergroup.cpp b/modules/globebrowsing/rendering/gpu/gpulayergroup.cpp new file mode 100644 index 0000000000..0a14a317b5 --- /dev/null +++ b/modules/globebrowsing/rendering/gpu/gpulayergroup.cpp @@ -0,0 +1,80 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#include + +#include +#include +#include + +namespace openspace { +namespace globebrowsing { + +void GPULayerGroup::setValue(ProgramObject* programObject, const LayerGroup& layerGroup, + const TileIndex& tileIndex) +{ + auto& activeLayers = layerGroup.activeLayers(); + ghoul_assert( + activeLayers.size() == gpuActiveLayers.size(), + "GPU and CPU active layers must have same size!" + ); + for (int i = 0; i < activeLayers.size(); ++i) { + gpuActiveLayers[i]->setValue( + programObject, + *activeLayers[i], + tileIndex, + layerGroup.pileSize() + ); + } +} + +void GPULayerGroup::bind(ProgramObject* programObject, const LayerGroup& layerGroup, + const std::string& nameBase, int category) +{ + auto activeLayers = layerGroup.activeLayers(); + gpuActiveLayers.resize(activeLayers.size()); + int pileSize = layerGroup.pileSize(); + for (size_t i = 0; i < gpuActiveLayers.size(); ++i) { + // should maybe a proper GPULayer factory + gpuActiveLayers[i] = (category == LayerManager::HeightLayers) ? + std::make_unique() : + std::make_unique(); + std::string nameExtension = "[" + std::to_string(i) + "]."; + gpuActiveLayers[i]->bind( + programObject, + *activeLayers[i], + nameBase + nameExtension, + pileSize + ); + } +} + +void GPULayerGroup::deactivate() { + for (size_t i = 0; i < gpuActiveLayers.size(); ++i) { + gpuActiveLayers[i]->deactivate(); + } +} + +} // namespace globebrowsing +} // namespace openspace diff --git a/modules/globebrowsing/rendering/gpu/gpulayergroup.h b/modules/globebrowsing/rendering/gpu/gpulayergroup.h new file mode 100644 index 0000000000..4863921f2f --- /dev/null +++ b/modules/globebrowsing/rendering/gpu/gpulayergroup.h @@ -0,0 +1,86 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___GPULAYERGROUP___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___GPULAYERGROUP___H__ + +#include +#include + +#include + +#include + +namespace ghoul { namespace opengl { +class ProgramObject; +}} + +namespace openspace { +namespace globebrowsing { + +struct ChunkTile; +class Layer; +class LayerRenderSettings; +struct TileDepthTransform; +struct TileUvTransform; + +class LayerGroup; +struct TileIndex; + +/** + * Manages a GPU representation of a LayerGroup + */ +class GPULayerGroup { +public: + + /** + * Sets the value of LayerGroup to its corresponding + * GPU struct. OBS! Users must ensure bind has been + * called before setting using this method. + */ + virtual void setValue(ProgramObject* programObject, const LayerGroup& layerGroup, + const TileIndex& tileIndex); + + /** + * Binds this object with GLSL variables with identifiers starting + * with nameBase within the provided shader program. + * After this method has been called, users may invoke setValue. + */ + virtual void bind(ProgramObject* programObject, const LayerGroup& layerGroup, + const std::string& nameBase, int category); + + /** + * Deactivates any TextureUnits assigned by this object. + * This method should be called after the OpenGL draw call. + */ + virtual void deactivate(); + +private: + std::vector> gpuActiveLayers; +}; + +} // namespace globebrowsing +} // namespace openspace + +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___GPULAYERGROUP___H__ diff --git a/modules/globebrowsing/rendering/gpu/gpulayermanager.cpp b/modules/globebrowsing/rendering/gpu/gpulayermanager.cpp new file mode 100644 index 0000000000..ab68ae2bec --- /dev/null +++ b/modules/globebrowsing/rendering/gpu/gpulayermanager.cpp @@ -0,0 +1,65 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#include + +#include + +namespace openspace { +namespace globebrowsing { + +void GPULayerManager::setValue(ProgramObject* programObject, + const LayerManager& layerManager, + const TileIndex& tileIndex) +{ + auto layerGroups = layerManager.layerGroups(); + for (size_t i = 0; i < layerGroups.size(); ++i) { + gpuLayerGroups[i]->setValue(programObject, *layerGroups[i], tileIndex); + } +} + +void GPULayerManager::bind(ProgramObject* programObject, const LayerManager& layerManager) +{ + auto layerGroups = layerManager.layerGroups(); + if (gpuLayerGroups.size() != layerGroups.size()) { + gpuLayerGroups.resize(layerGroups.size()); + for (auto& gpuLayerGroup : gpuLayerGroups){ + gpuLayerGroup = std::make_unique(); + } + } + + for (size_t i = 0; i < layerGroups.size(); ++i) { + std::string nameBase = LayerManager::LAYER_GROUP_NAMES[i]; + gpuLayerGroups[i]->bind(programObject, *layerGroups[i], nameBase, i); + } +} + +void GPULayerManager::deactivate() { + for (size_t i = 0; i < gpuLayerGroups.size(); ++i) { + gpuLayerGroups[i]->deactivate(); + } +} + +} // namespace globebrowsing +} // namespace openspace diff --git a/modules/globebrowsing/rendering/gpu/gpulayermanager.h b/modules/globebrowsing/rendering/gpu/gpulayermanager.h new file mode 100644 index 0000000000..6da1c15160 --- /dev/null +++ b/modules/globebrowsing/rendering/gpu/gpulayermanager.h @@ -0,0 +1,75 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___GPULAYERMANAGER___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___GPULAYERMANAGER___H__ + +#include +#include + +#include + +namespace ghoul { namespace opengl { +class ProgramObject; +}} + +namespace openspace { +namespace globebrowsing { + +class LayerManager; + +/** + * Manages a GPU representation of a LayerGroup + */ +class GPULayerManager { +public: + /** + * Sets the value of LayerGroup to its corresponding + * GPU struct. OBS! Users must ensure bind has been + * called before setting using this method. + */ + virtual void setValue(ProgramObject* programObject, const LayerManager& layerManager, + const TileIndex& tileIndex); + + /** + * Binds this object with GLSL variables with identifiers starting + * with nameBase within the provided shader program. + * After this method has been called, users may invoke setValue. + */ + virtual void bind(ProgramObject* programObject, const LayerManager& layerManager); + + /** + * Deactivates any TextureUnits assigned by this object. + * This method should be called after the OpenGL draw call. + */ + virtual void deactivate(); + +private: + std::vector> gpuLayerGroups; +}; + +} // namespace globebrowsing +} // namespace openspace + +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___GPULAYERMANAGER___H__ diff --git a/modules/globebrowsing/rendering/gpu/gpulayerrendersettings.cpp b/modules/globebrowsing/rendering/gpu/gpulayerrendersettings.cpp new file mode 100644 index 0000000000..6edbabb209 --- /dev/null +++ b/modules/globebrowsing/rendering/gpu/gpulayerrendersettings.cpp @@ -0,0 +1,49 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#include + +#include + +namespace openspace { +namespace globebrowsing { + +void GPULayerRenderSettings::setValue(ProgramObject* programObject, + const LayerRenderSettings& layerSettings) +{ + gpuOpacity.setValue(programObject, layerSettings.opacity.value()); + gpuGamma.setValue(programObject, layerSettings.gamma.value()); + gpuMultiplier.setValue(programObject, layerSettings.multiplier.value()); +} + +void GPULayerRenderSettings::bind(ProgramObject* programObject, + const std::string& nameBase) +{ + gpuOpacity.bind(programObject, nameBase + "opacity"); + gpuGamma.bind(programObject, nameBase + "gamma"); + gpuMultiplier.bind(programObject, nameBase + "multiplier"); +} + +} // namespace globebrowsing +} // namespace openspace diff --git a/modules/globebrowsing/rendering/gpu/gpulayerrendersettings.h b/modules/globebrowsing/rendering/gpu/gpulayerrendersettings.h new file mode 100644 index 0000000000..deee12bbc6 --- /dev/null +++ b/modules/globebrowsing/rendering/gpu/gpulayerrendersettings.h @@ -0,0 +1,69 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___GPULAYERRENDERSETTINGS___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___GPULAYERRENDERSETTINGS___H__ + +#include + +#include + +namespace ghoul { namespace opengl { +class ProgramObject; +}} + +namespace openspace { +namespace globebrowsing { + +class LayerRenderSettings; + +/** + * Manages a GPU representation of a LayerRenderSettings + */ +class GPULayerRenderSettings{ +public: + /** + * Sets the value of LayerRenderSettings to its corresponding + * GPU struct. OBS! Users must ensure bind has been + * called before setting using this method. + */ + void setValue(ProgramObject* programObject, const LayerRenderSettings& layerSettings); + + /** + * Binds this object with GLSL variables with identifiers starting + * with nameBase within the provided shader program. + * After this method has been called, users may invoke setValue. + */ + void bind(ProgramObject* programObject, const std::string& nameBase); + +private: + GPUData gpuOpacity; + GPUData gpuGamma; + GPUData gpuMultiplier; +}; + +} // namespace globebrowsing +} // namespace openspace + +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___GPULAYERRENDERSETTINGS___H__ diff --git a/modules/globebrowsing/rendering/gpu/gputiledepthtransform.cpp b/modules/globebrowsing/rendering/gpu/gputiledepthtransform.cpp new file mode 100644 index 0000000000..9ae18d0191 --- /dev/null +++ b/modules/globebrowsing/rendering/gpu/gputiledepthtransform.cpp @@ -0,0 +1,47 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#include + +#include + +namespace openspace { +namespace globebrowsing { + +void GPUTileDepthTransform::setValue(ProgramObject* programObject, + const TileDepthTransform& depthTransform) +{ + gpuDepthOffset.setValue(programObject, depthTransform.depthOffset); + gpuDepthScale.setValue(programObject, depthTransform.depthScale); +} + +void GPUTileDepthTransform::bind(ProgramObject* programObject, + const std::string& nameBase) +{ + gpuDepthOffset.bind(programObject, nameBase + "depthOffset"); + gpuDepthScale.bind(programObject, nameBase + "depthScale"); +} + +} // namespace globebrowsing +} // namespace openspace diff --git a/modules/globebrowsing/rendering/gpu/gputiledepthtransform.h b/modules/globebrowsing/rendering/gpu/gputiledepthtransform.h new file mode 100644 index 0000000000..8f1c943cc1 --- /dev/null +++ b/modules/globebrowsing/rendering/gpu/gputiledepthtransform.h @@ -0,0 +1,68 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___GPUTILEDEPTHTRANSFORM___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___GPUTILEDEPTHTRANSFORM___H__ + +#include + +#include + +namespace ghoul { namespace opengl { +class ProgramObject; +}} + +namespace openspace { +namespace globebrowsing { + +struct TileDepthTransform; + +/** + * Manages a GPU representation of a TileDepthTransform + */ +class GPUTileDepthTransform { +public: + /** + * Sets the value of TileDepthTransform to its corresponding + * GPU struct. OBS! Users must ensure bind has been + * called before setting using this method. + */ + void setValue(ProgramObject* programObject, const TileDepthTransform& depthTransform); + + /** + * Binds GLSL variables with identifiers starting with + * nameBase within the provided shader program with this object. + * After this method has been called, users may invoke setValue. + */ + void bind(ProgramObject* programObject, const std::string& nameBase); + +private: + GPUData gpuDepthOffset; + GPUData gpuDepthScale; +}; + +} // namespace globebrowsing +} // namespace openspace + +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___GPUTILEDEPTHTRANSFORM___H__ diff --git a/modules/globebrowsing/rendering/gpu/gputileuvtransform.cpp b/modules/globebrowsing/rendering/gpu/gputileuvtransform.cpp new file mode 100644 index 0000000000..ab9e3cd51d --- /dev/null +++ b/modules/globebrowsing/rendering/gpu/gputileuvtransform.cpp @@ -0,0 +1,49 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#include + +//#include +//#include +//#include +//#include +#include + +namespace openspace { +namespace globebrowsing { + +void GPUTileUvTransform::setValue(ProgramObject* programObject, + const TileUvTransform& tileUvTransform) +{ + gpuUvOffset.setValue(programObject, tileUvTransform.uvOffset); + gpuUvScale.setValue(programObject, tileUvTransform.uvScale); +} + +void GPUTileUvTransform::bind(ProgramObject* programObject, const std::string& nameBase) { + gpuUvOffset.bind(programObject, nameBase + "uvOffset"); + gpuUvScale.bind(programObject, nameBase + "uvScale"); +} + +} // namespace globebrowsing +} // namespace openspace diff --git a/modules/globebrowsing/rendering/gpu/gputileuvtransform.h b/modules/globebrowsing/rendering/gpu/gputileuvtransform.h new file mode 100644 index 0000000000..df7b838e17 --- /dev/null +++ b/modules/globebrowsing/rendering/gpu/gputileuvtransform.h @@ -0,0 +1,68 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___GPUTILEUVTRANSFORM___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___GPUTILEUVTRANSFORM___H__ + +#include + +#include + +namespace ghoul { namespace opengl { +class ProgramObject; +}} + +namespace openspace { +namespace globebrowsing { + +struct TileUvTransform; + +/** + * Manages a GPU representation of a TileUvTransform + */ +class GPUTileUvTransform { +public: + /** + * Sets the value of TileUvTransform to its corresponding + * GPU struct. OBS! Users must ensure bind has been + * called before setting using this method. + */ + void setValue(ProgramObject* programObject, const TileUvTransform& uvTransform); + + /** + * Binds GLSL variables with identifiers starting with + * nameBase within the provided shader program with this object. + * After this method has been called, users may invoke setValue. + */ + void bind(ProgramObject* programObject, const std::string& nameBase); + +private: + GPUData gpuUvOffset; + GPUData gpuUvScale; +}; + +} // namespace globebrowsing +} // namespace openspace + +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___GPUTILEUVTRANSFORM___H__ diff --git a/modules/globebrowsing/rendering/gpulayermanager.cpp b/modules/globebrowsing/rendering/gpulayermanager.cpp deleted file mode 100644 index 262e207585..0000000000 --- a/modules/globebrowsing/rendering/gpulayermanager.cpp +++ /dev/null @@ -1,232 +0,0 @@ -/***************************************************************************************** - * * - * 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. * - ****************************************************************************************/ - -#include - -#include -#include -#include -#include -#include - -namespace openspace { -namespace globebrowsing { - -void GPUTileUvTransform::setValue(ProgramObject* programObject, - const TileUvTransform& tileUvTransform) -{ - gpuUvOffset.setValue(programObject, tileUvTransform.uvOffset); - gpuUvScale.setValue(programObject, tileUvTransform.uvScale); -} - -void GPUTileUvTransform::bind(ProgramObject* programObject, const std::string& nameBase) { - gpuUvOffset.bind(programObject, nameBase + "uvOffset"); - gpuUvScale.bind(programObject, nameBase + "uvScale"); -} - -void GPUTileDepthTransform::setValue(ProgramObject* programObject, - const TileDepthTransform& depthTransform) -{ - gpuDepthOffset.setValue(programObject, depthTransform.depthOffset); - gpuDepthScale.setValue(programObject, depthTransform.depthScale); -} - -void GPUTileDepthTransform::bind(ProgramObject* programObject, - const std::string& nameBase) -{ - gpuDepthOffset.bind(programObject, nameBase + "depthOffset"); - gpuDepthScale.bind(programObject, nameBase + "depthScale"); -} - -void GPUChunkTile::setValue(ProgramObject* programObject, const ChunkTile& chunkTile) { - gpuTexture.setValue(programObject, chunkTile.tile.texture); - gpuTileUvTransform.setValue(programObject, chunkTile.uvTransform); -} - -void GPUChunkTile::bind(ProgramObject* programObject, const std::string& nameBase) { - gpuTexture.bind(programObject, nameBase + "textureSampler"); - gpuTileUvTransform.bind(programObject, nameBase + "uvTransform."); -} - -void GPUChunkTile::deactivate() { - gpuTexture.deactivate(); -} - -void GPUChunkTilePile::setValue(ProgramObject* programObject, - const ChunkTilePile& chunkTilePile) -{ - ghoul_assert( - gpuChunkTiles.size() == chunkTilePile.chunkTiles.size(), - "GPU and CPU ChunkTilePile must have same size!" - ); - for (size_t i = 0; i < gpuChunkTiles.size(); ++i) { - gpuChunkTiles[i].setValue(programObject, chunkTilePile.chunkTiles[i]); - } -} - -void GPUChunkTilePile::bind(ProgramObject* programObject, const std::string& nameBase, - int pileSize) -{ - gpuChunkTiles.resize(pileSize); - for (size_t i = 0; i < gpuChunkTiles.size(); ++i) { - std::string nameExtension = "chunkTile" + std::to_string(i) + "."; - gpuChunkTiles[i].bind(programObject, nameBase + nameExtension); - } -} - -void GPUChunkTilePile::deactivate() { - for (auto& gpuChunkTile : gpuChunkTiles) { - gpuChunkTile.deactivate(); - } -} - - -void GPULayerRenderSettings::setValue(ProgramObject* programObject, - const LayerRenderSettings& layerSettings) -{ - gpuOpacity.setValue(programObject, layerSettings.opacity.value()); - gpuGamma.setValue(programObject, layerSettings.gamma.value()); - gpuMultiplier.setValue(programObject, layerSettings.multiplier.value()); -} - -void GPULayerRenderSettings::bind(ProgramObject* programObject, - const std::string& nameBase) -{ - gpuOpacity.bind(programObject, nameBase + "opacity"); - gpuGamma.bind(programObject, nameBase + "gamma"); - gpuMultiplier.bind(programObject, nameBase + "multiplier"); -} - -void GPULayer::setValue(ProgramObject* programObject, const Layer& layer, - const TileIndex& tileIndex, int pileSize) -{ - ChunkTilePile chunkTilePile = layer.getChunkTilePile(tileIndex, pileSize); - gpuChunkTilePile.setValue(programObject, chunkTilePile); - gpuRenderSettings.setValue(programObject, layer.renderSettings()); -} - -void GPULayer::bind(ProgramObject* programObject, const Layer& layer, - const std::string& nameBase, int pileSize) -{ - gpuChunkTilePile.bind(programObject, nameBase + "pile.", pileSize); - gpuRenderSettings.bind(programObject, nameBase + "settings."); -} - -void GPULayer::deactivate() { - gpuChunkTilePile.deactivate(); -} - -void GPUHeightLayer::setValue(ProgramObject* programObject, const Layer& layer, - const TileIndex& tileIndex, int pileSize) -{ - GPULayer::setValue(programObject, layer, tileIndex, pileSize); - gpuDepthTransform.setValue(programObject, layer.tileProvider()->depthTransform()); -} - -void GPUHeightLayer::bind(ProgramObject* programObject, const Layer& layer, - const std::string& nameBase, int pileSize) -{ - GPULayer::bind(programObject, layer, nameBase, pileSize); - gpuDepthTransform.bind(programObject, nameBase + "depthTransform."); -} - -void GPULayerGroup::setValue(ProgramObject* programObject, const LayerGroup& layerGroup, - const TileIndex& tileIndex) -{ - auto& activeLayers = layerGroup.activeLayers(); - ghoul_assert( - activeLayers.size() == gpuActiveLayers.size(), - "GPU and CPU active layers must have same size!" - ); - for (int i = 0; i < activeLayers.size(); ++i) { - gpuActiveLayers[i]->setValue( - programObject, - *activeLayers[i], - tileIndex, - layerGroup.pileSize() - ); - } -} - -void GPULayerGroup::bind(ProgramObject* programObject, const LayerGroup& layerGroup, - const std::string& nameBase, int category) -{ - auto activeLayers = layerGroup.activeLayers(); - gpuActiveLayers.resize(activeLayers.size()); - int pileSize = layerGroup.pileSize(); - for (size_t i = 0; i < gpuActiveLayers.size(); ++i) { - // should maybe a proper GPULayer factory - gpuActiveLayers[i] = (category == LayerManager::HeightLayers) ? - std::make_unique() : - std::make_unique(); - std::string nameExtension = "[" + std::to_string(i) + "]."; - gpuActiveLayers[i]->bind( - programObject, - *activeLayers[i], - nameBase + nameExtension, - pileSize - ); - } -} - -void GPULayerGroup::deactivate() { - for (size_t i = 0; i < gpuActiveLayers.size(); ++i) { - gpuActiveLayers[i]->deactivate(); - } -} - -void GPULayerManager::setValue(ProgramObject* programObject, - const LayerManager& layerManager, - const TileIndex& tileIndex) -{ - auto layerGroups = layerManager.layerGroups(); - for (size_t i = 0; i < layerGroups.size(); ++i) { - gpuLayerGroups[i]->setValue(programObject, *layerGroups[i], tileIndex); - } -} - -void GPULayerManager::bind(ProgramObject* programObject, const LayerManager& layerManager) -{ - auto layerGroups = layerManager.layerGroups(); - if (gpuLayerGroups.size() != layerGroups.size()) { - gpuLayerGroups.resize(layerGroups.size()); - for (auto& gpuLayerGroup : gpuLayerGroups){ - gpuLayerGroup = std::make_unique(); - } - } - - for (size_t i = 0; i < layerGroups.size(); ++i) { - std::string nameBase = LayerManager::LAYER_GROUP_NAMES[i]; - gpuLayerGroups[i]->bind(programObject, *layerGroups[i], nameBase, i); - } -} - -void GPULayerManager::deactivate() { - for (size_t i = 0; i < gpuLayerGroups.size(); ++i) { - gpuLayerGroups[i]->deactivate(); - } -} - -} // namespace globebrowsing -} // namespace openspace diff --git a/modules/globebrowsing/rendering/gpulayermanager.h b/modules/globebrowsing/rendering/gpulayermanager.h deleted file mode 100644 index bc15df9bd5..0000000000 --- a/modules/globebrowsing/rendering/gpulayermanager.h +++ /dev/null @@ -1,320 +0,0 @@ -/***************************************************************************************** - * * - * 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. * - ****************************************************************************************/ - -#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___GPU_LAYER_MANAGER___H__ -#define __OPENSPACE_MODULE_GLOBEBROWSING___GPU_LAYER_MANAGER___H__ - -#include - -#include - -namespace ghoul { namespace opengl { -class ProgramObject; -}} - -namespace openspace { -namespace globebrowsing { - -struct ChunkTile; -struct ChunkTilePile; -class Layer; -class LayerRenderSettings; -struct TileDepthTransform; -struct TileIndex; -struct TileUvTransform; - -/** - * Manages a GPU representation of a TileUvTransform - */ -class GPUTileUvTransform { -public: - /** - * Sets the value of TileUvTransform to its corresponding - * GPU struct. OBS! Users must ensure bind has been - * called before setting using this method. - */ - void setValue(ProgramObject* programObject, const TileUvTransform& uvTransform); - - /** - * Binds GLSL variables with identifiers starting with - * nameBase within the provided shader program with this object. - * After this method has been called, users may invoke setValue. - */ - void bind(ProgramObject* programObject, const std::string& nameBase); - -private: - GPUData gpuUvOffset; - GPUData gpuUvScale; -}; - - -/** - * Manages a GPU representation of a TileDepthTransform - */ -class GPUTileDepthTransform { -public: - /** - * Sets the value of TileDepthTransform to its corresponding - * GPU struct. OBS! Users must ensure bind has been - * called before setting using this method. - */ - void setValue(ProgramObject* programObject, const TileDepthTransform& depthTransform); - - /** - * Binds GLSL variables with identifiers starting with - * nameBase within the provided shader program with this object. - * After this method has been called, users may invoke setValue. - */ - void bind(ProgramObject* programObject, const std::string& nameBase); - -private: - GPUData gpuDepthOffset; - GPUData gpuDepthScale; -}; - -/** - * Manages a GPU representation of a ChunkTile - */ -class GPUChunkTile { -public: - - /** - * Sets the value of ChunkTile to its corresponding - * GPU struct. OBS! Users must ensure bind has been - * called before setting using this method. - */ - void setValue(ProgramObject* programObject, const ChunkTile& chunkTile); - - /** - * Binds GLSL variables with identifiers starting with - * nameBase within the provided shader program with this object. - * After this method has been called, users may invoke setValue. - */ - void bind(ProgramObject* programObject, const std::string& nameBase); - - /** - * Deactivates any TextureUnits assigned by this object. - * This method should be called after the OpenGL draw call. - */ - void deactivate(); - -private: - GPUTexture gpuTexture; - GPUTileUvTransform gpuTileUvTransform; -}; - -/** - * Manages a GPU representation of a ChunkTilePile - */ -class GPUChunkTilePile{ -public: - - /** - * Sets the value of ChunkTilePile to its corresponding - * GPU struct. OBS! Users must ensure bind has been - * called before setting using this method. - */ - void setValue(ProgramObject* programObject, const ChunkTilePile& chunkTilePile); - - /** - * Binds this object with GLSL variables with identifiers starting - * with nameBase within the provided shader program. - * After this method has been called, users may invoke setValue. - */ - void bind(ProgramObject* programObject, const std::string& nameBase, - int pileSize); - /** - * Deactivates any TextureUnits assigned by this object. - * This method should be called after the OpenGL draw call. - */ - void deactivate(); - -private: - std::vector gpuChunkTiles; -}; - - -class LayerRenderSettings; - -/** - * Manages a GPU representation of a LayerRenderSettings - */ -class GPULayerRenderSettings{ -public: - - /** - * Sets the value of LayerRenderSettings to its corresponding - * GPU struct. OBS! Users must ensure bind has been - * called before setting using this method. - */ - void setValue(ProgramObject* programObject, const LayerRenderSettings& layerSettings); - - /** - * Binds this object with GLSL variables with identifiers starting - * with nameBase within the provided shader program. - * After this method has been called, users may invoke setValue. - */ - void bind(ProgramObject* programObject, const std::string& nameBase); - -private: - GPUData gpuOpacity; - GPUData gpuGamma; - GPUData gpuMultiplier; -}; - - -class Layer; - -/** - * Manages a GPU representation of a Layer - */ -class GPULayer { -public: - - /** - * Sets the value of Layer to its corresponding - * GPU struct. OBS! Users must ensure bind has been - * called before setting using this method. - */ - virtual void setValue(ProgramObject* programObject, const Layer& layer, - const TileIndex& tileIndex, int pileSize); - - /** - * Binds this object with GLSL variables with identifiers starting - * with nameBase within the provided shader program. - * After this method has been called, users may invoke setValue. - */ - virtual void bind(ProgramObject* programObject, const Layer& layer, - const std::string& nameBase, int pileSize); - - /** - * Deactivates any TextureUnits assigned by this object. - * This method should be called after the OpenGL draw call. - */ - virtual void deactivate(); - -private: - GPUChunkTilePile gpuChunkTilePile; - GPULayerRenderSettings gpuRenderSettings; -}; - - -/** - * Manages a GPU representation of a Layer representing - * a height map. - */ -class GPUHeightLayer : public GPULayer { -public: - - /** - * Sets the value of Layer to its corresponding - * GPU struct. OBS! Users must ensure bind has been - * called before setting using this method. - */ - virtual void setValue(ProgramObject* programObject, const Layer& layer, - const TileIndex& tileIndex, int pileSize); - - /** - * Binds this object with GLSL variables with identifiers starting - * with nameBase within the provided shader program. - * After this method has been called, users may invoke setValue. - */ - virtual void bind(ProgramObject* programObject, const Layer& layer, - const std::string& nameBase, int pileSize); - -private: - GPUTileDepthTransform gpuDepthTransform; -}; - -class LayerGroup; - -/** - * Manages a GPU representation of a LayerGroup - */ -class GPULayerGroup{ -public: - - /** - * Sets the value of LayerGroup to its corresponding - * GPU struct. OBS! Users must ensure bind has been - * called before setting using this method. - */ - virtual void setValue(ProgramObject* programObject, const LayerGroup& layerGroup, - const TileIndex& tileIndex); - - /** - * Binds this object with GLSL variables with identifiers starting - * with nameBase within the provided shader program. - * After this method has been called, users may invoke setValue. - */ - virtual void bind(ProgramObject* programObject, const LayerGroup& layerGroup, - const std::string& nameBase, int category); - - /** - * Deactivates any TextureUnits assigned by this object. - * This method should be called after the OpenGL draw call. - */ - virtual void deactivate(); - -private: - std::vector> gpuActiveLayers; -}; - -class LayerManager; - -/** - * Manages a GPU representation of a LayerGroup - */ -class GPULayerManager{ -public: - - /** - * Sets the value of LayerGroup to its corresponding - * GPU struct. OBS! Users must ensure bind has been - * called before setting using this method. - */ - virtual void setValue(ProgramObject* programObject, const LayerManager& layerManager, - const TileIndex& tileIndex); - - /** - * Binds this object with GLSL variables with identifiers starting - * with nameBase within the provided shader program. - * After this method has been called, users may invoke setValue. - */ - virtual void bind(ProgramObject* programObject, const LayerManager& layerManager); - - /** - * Deactivates any TextureUnits assigned by this object. - * This method should be called after the OpenGL draw call. - */ - virtual void deactivate(); - -private: - std::vector> gpuLayerGroups; -}; - -} // namespace globebrowsing -} // namespace openspace - -#endif // __OPENSPACE_MODULE_GLOBEBROWSING___GPU_LAYER_MANAGER___H__ diff --git a/modules/globebrowsing/rendering/layer/layer.cpp b/modules/globebrowsing/rendering/layer/layer.cpp new file mode 100644 index 0000000000..e4f0aab166 --- /dev/null +++ b/modules/globebrowsing/rendering/layer/layer.cpp @@ -0,0 +1,60 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#include + +#include + +namespace openspace { +namespace globebrowsing { + +Layer::Layer(const ghoul::Dictionary& layerDict) + : _enabled(properties::BoolProperty("enabled", "enabled", false)) +{ + std::string layerName = "error!"; + layerDict.getValue("Name", layerName); + setName(layerName); + + _tileProvider = std::shared_ptr( + tileprovider::TileProvider::createFromDictionary(layerDict)); + + // Something else went wrong and no exception was thrown + if (_tileProvider == nullptr) { + throw ghoul::RuntimeError("Unable to create TileProvider '" + name() + "'"); + } + + bool enabled = false; // defaults to false if unspecified + layerDict.getValue("Enabled", enabled); + _enabled.setValue(enabled); + addProperty(_enabled); + + addPropertySubOwner(_renderSettings); +} + +ChunkTilePile Layer::getChunkTilePile(const TileIndex& tileIndex, int pileSize) const { + return std::move(_tileProvider->getChunkTilePile(tileIndex, pileSize)); +} + +} // namespace globebrowsing +} // namespace openspace diff --git a/modules/globebrowsing/rendering/layer/layer.h b/modules/globebrowsing/rendering/layer/layer.h new file mode 100644 index 0000000000..e933a70836 --- /dev/null +++ b/modules/globebrowsing/rendering/layer/layer.h @@ -0,0 +1,66 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___LAYER___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___LAYER___H__ + +#include + +#include +#include + +#include + +namespace openspace { +namespace globebrowsing { + +namespace tileprovider { + class TileProvider; +} + +/** + * Simple struct which is used to enable/disable TileProvider + * and associate is with a name. It also holds layer specific information + * which is used in rendering of layer. + */ +class Layer : public properties::PropertyOwner { +public: + Layer(const ghoul::Dictionary& layerDict); + + ChunkTilePile getChunkTilePile(const TileIndex& tileIndex, int pileSize) const; + + bool enabled() const { return _enabled.value(); } + tileprovider::TileProvider* tileProvider() const { return _tileProvider.get(); } + const LayerRenderSettings& renderSettings() const { return _renderSettings; } + +private: + properties::BoolProperty _enabled; + std::shared_ptr _tileProvider; + LayerRenderSettings _renderSettings; +}; + +} // namespace globebrowsing +} // namespace openspace + +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___LAYER___H__ diff --git a/modules/globebrowsing/rendering/layer/layergroup.cpp b/modules/globebrowsing/rendering/layer/layergroup.cpp new file mode 100644 index 0000000000..f6ab83687b --- /dev/null +++ b/modules/globebrowsing/rendering/layer/layergroup.cpp @@ -0,0 +1,85 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#include + +#include + +namespace openspace { +namespace globebrowsing { + +LayerGroup::LayerGroup(std::string name) + : _levelBlendingEnabled("blendTileLevels", "blend tile levels", true) +{ + setName(std::move(name)); + addProperty(_levelBlendingEnabled); +} + +LayerGroup::LayerGroup(std::string name, const ghoul::Dictionary& dict) + : LayerGroup(std::move(name)) +{ + for (size_t i = 0; i < dict.size(); i++) { + std::string dictKey = std::to_string(i + 1); + ghoul::Dictionary layerDict = dict.value(dictKey); + + try { + _layers.push_back(std::make_shared(layerDict)); + } + catch (const ghoul::RuntimeError& e) { + LERRORC(e.component, e.message); + continue; + } + //_layers.push_back(std::make_shared(layerDict)); + } + + for (const auto& layer : _layers) { + addPropertySubOwner(layer.get()); + } +} + +void LayerGroup::update() { + _activeLayers.clear(); + + for (const auto& layer : _layers) { + if (layer->enabled()) { + layer->tileProvider()->update(); + _activeLayers.push_back(layer); + } + } +} + +const std::vector>& LayerGroup::layers() const { + return _layers; +} + +const std::vector>& LayerGroup::activeLayers() const { + return _activeLayers; +} + +int LayerGroup::pileSize() const{ + return _levelBlendingEnabled.value() ? 3 : 1; +} + +} // namespace globebrowsing +} // namespace openspace diff --git a/modules/globebrowsing/rendering/layer/layergroup.h b/modules/globebrowsing/rendering/layer/layergroup.h new file mode 100644 index 0000000000..be7241de2c --- /dev/null +++ b/modules/globebrowsing/rendering/layer/layergroup.h @@ -0,0 +1,71 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___LAYERGROUP___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___LAYERGROUP___H__ + +#include + +#include +#include + +namespace openspace { +namespace globebrowsing { + +namespace tileprovider { + class TileProvider; +} + +/** + * Convenience class for dealing with multiple Layers. + */ +struct LayerGroup : public properties::PropertyOwner { + LayerGroup(std::string name); + LayerGroup(std::string name, const ghoul::Dictionary& dict); + + /// Updates all layers tile providers within this group + void update(); + + /// @returns const vector of all layers + const std::vector>& layers() const; + + /// @returns const vector of all active layers + const std::vector>& activeLayers() const; + + /// @returns the size of the pile to be used in rendering of this layer + int pileSize() const; + + bool layerBlendingEnabled() const { return _levelBlendingEnabled.value(); } + +private: + std::vector> _layers; + std::vector> _activeLayers; + + properties::BoolProperty _levelBlendingEnabled; +}; + +} // namespace globebrowsing +} // namespace openspace + +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___LAYERGROUP___H__ diff --git a/modules/globebrowsing/rendering/layermanager.cpp b/modules/globebrowsing/rendering/layer/layermanager.cpp similarity index 60% rename from modules/globebrowsing/rendering/layermanager.cpp rename to modules/globebrowsing/rendering/layer/layermanager.cpp index 98533cd69f..d8ea7b4a3b 100644 --- a/modules/globebrowsing/rendering/layermanager.cpp +++ b/modules/globebrowsing/rendering/layer/layermanager.cpp @@ -22,104 +22,14 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#include +#include +#include #include namespace openspace { namespace globebrowsing { -LayerRenderSettings::LayerRenderSettings() - : opacity(properties::FloatProperty("opacity", "opacity", 1.f, 0.f, 1.f)) - , gamma(properties::FloatProperty("gamma", "gamma", 1, 0, 5)) - , multiplier(properties::FloatProperty("multiplier", "multiplier", 1.f, 0.f, 20.f)) -{ - setName("settings"); - - addProperty(opacity); - addProperty(gamma); - addProperty(multiplier); -} - -Layer::Layer(const ghoul::Dictionary& layerDict) - : _enabled(properties::BoolProperty("enabled", "enabled", false)) -{ - std::string layerName = "error!"; - layerDict.getValue("Name", layerName); - setName(layerName); - - _tileProvider = std::shared_ptr( - TileProvider::createFromDictionary(layerDict)); - - // Something else went wrong and no exception was thrown - if (_tileProvider == nullptr) { - throw ghoul::RuntimeError("Unable to create TileProvider '" + name() + "'"); - } - - bool enabled = false; // defaults to false if unspecified - layerDict.getValue("Enabled", enabled); - _enabled.setValue(enabled); - addProperty(_enabled); - - addPropertySubOwner(_renderSettings); -} - -ChunkTilePile Layer::getChunkTilePile(const TileIndex& tileIndex, int pileSize) const { - return std::move(_tileProvider->getChunkTilePile(tileIndex, pileSize)); -} - -LayerGroup::LayerGroup(std::string name) - : _levelBlendingEnabled("blendTileLevels", "blend tile levels", true) -{ - setName(std::move(name)); - addProperty(_levelBlendingEnabled); -} - -LayerGroup::LayerGroup(std::string name, const ghoul::Dictionary& dict) - : LayerGroup(std::move(name)) -{ - for (size_t i = 0; i < dict.size(); i++) { - std::string dictKey = std::to_string(i + 1); - ghoul::Dictionary layerDict = dict.value(dictKey); - - try { - _layers.push_back(std::make_shared(layerDict)); - } - catch (const ghoul::RuntimeError& e) { - LERRORC(e.component, e.message); - continue; - } - //_layers.push_back(std::make_shared(layerDict)); - } - - for (const auto& layer : _layers) { - addPropertySubOwner(layer.get()); - } -} - -void LayerGroup::update() { - _activeLayers.clear(); - - for (const auto& layer : _layers) { - if (layer->enabled()) { - layer->tileProvider()->update(); - _activeLayers.push_back(layer); - } - } -} - -const std::vector>& LayerGroup::layers() const { - return _layers; -} - -const std::vector>& LayerGroup::activeLayers() const { - return _activeLayers; -} - -int LayerGroup::pileSize() const{ - return _levelBlendingEnabled.value() ? 3 : 1; -} - const char* LayerManager::LAYER_GROUP_NAMES[NUM_LAYER_GROUPS] = { "HeightLayers", "ColorLayers", diff --git a/modules/globebrowsing/rendering/layermanager.h b/modules/globebrowsing/rendering/layer/layermanager.h similarity index 62% rename from modules/globebrowsing/rendering/layermanager.h rename to modules/globebrowsing/rendering/layer/layermanager.h index 6ec735b455..03ff591e09 100644 --- a/modules/globebrowsing/rendering/layermanager.h +++ b/modules/globebrowsing/rendering/layer/layermanager.h @@ -29,69 +29,10 @@ #include -#include -#include - namespace openspace { namespace globebrowsing { - -class TileProvider; - -struct LayerRenderSettings : public properties::PropertyOwner { - LayerRenderSettings(); - properties::FloatProperty opacity; - properties::FloatProperty gamma; - properties::FloatProperty multiplier; -}; - -/** - * Simple struct which is used to enable/disable TileProvider - * and associate is with a name. It also holds layer specific information - * which is used in rendering of layer. - */ -class Layer : public properties::PropertyOwner { -public: - Layer(const ghoul::Dictionary& layerDict); - - ChunkTilePile getChunkTilePile(const TileIndex& tileIndex, int pileSize) const; - - bool enabled() const { return _enabled.value(); } - TileProvider* tileProvider() const { return _tileProvider.get(); } - const LayerRenderSettings& renderSettings() const { return _renderSettings; } - -private: - properties::BoolProperty _enabled; - std::shared_ptr _tileProvider; - LayerRenderSettings _renderSettings; -}; - -/** - * Convenience class for dealing with multiple Layers. - */ -struct LayerGroup : public properties::PropertyOwner { - LayerGroup(std::string name); - LayerGroup(std::string name, const ghoul::Dictionary& dict); - - /// Updates all layers tile providers within this group - void update(); - - /// @returns const vector of all layers - const std::vector>& layers() const; - - /// @returns const vector of all active layers - const std::vector>& activeLayers() const; - - /// @returns the size of the pile to be used in rendering of this layer - int pileSize() const; - - bool layerBlendingEnabled() const { return _levelBlendingEnabled.value(); } - -private: - std::vector> _layers; - std::vector> _activeLayers; - - properties::BoolProperty _levelBlendingEnabled; -}; + +class LayerGroup; /** * Manages multiple LayerGroups. diff --git a/modules/globebrowsing/rendering/layer/layerrendersettings.cpp b/modules/globebrowsing/rendering/layer/layerrendersettings.cpp new file mode 100644 index 0000000000..3a8427da8f --- /dev/null +++ b/modules/globebrowsing/rendering/layer/layerrendersettings.cpp @@ -0,0 +1,43 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#include + +namespace openspace { +namespace globebrowsing { + +LayerRenderSettings::LayerRenderSettings() + : opacity(properties::FloatProperty("opacity", "opacity", 1.f, 0.f, 1.f)) + , gamma(properties::FloatProperty("gamma", "gamma", 1, 0, 5)) + , multiplier(properties::FloatProperty("multiplier", "multiplier", 1.f, 0.f, 20.f)) +{ + setName("settings"); + + addProperty(opacity); + addProperty(gamma); + addProperty(multiplier); +} + +} // namespace globebrowsing +} // namespace openspace diff --git a/modules/globebrowsing/rendering/layer/layerrendersettings.h b/modules/globebrowsing/rendering/layer/layerrendersettings.h new file mode 100644 index 0000000000..7b794d8b3b --- /dev/null +++ b/modules/globebrowsing/rendering/layer/layerrendersettings.h @@ -0,0 +1,45 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___LAYERRENDERSETTINGS___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___LAYERRENDERSETTINGS___H__ + +#include + +#include + +namespace openspace { +namespace globebrowsing { + +struct LayerRenderSettings : public properties::PropertyOwner { + LayerRenderSettings(); + properties::FloatProperty opacity; + properties::FloatProperty gamma; + properties::FloatProperty multiplier; +}; + +} // namespace globebrowsing +} // namespace openspace + +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___LAYERRENDERSETTINGS___H__ diff --git a/modules/globebrowsing/rendering/layershadermanager.cpp b/modules/globebrowsing/rendering/layershadermanager.cpp index 1c2e647588..419699eaef 100644 --- a/modules/globebrowsing/rendering/layershadermanager.cpp +++ b/modules/globebrowsing/rendering/layershadermanager.cpp @@ -32,13 +32,13 @@ namespace openspace { namespace globebrowsing { -bool LayerGroupPreprocessingData::operator==( +bool LayerShaderManager::LayerShaderPreprocessingData::LayerGroupPreprocessingData::operator==( const LayerGroupPreprocessingData& other) const { return lastLayerIdx == other.lastLayerIdx && layerBlendingEnabled == other.layerBlendingEnabled; } -bool LayerShaderPreprocessingData::operator==( +bool LayerShaderManager::LayerShaderPreprocessingData::operator==( const LayerShaderPreprocessingData& other) const { if (layeredTextureInfo.size() != other.layeredTextureInfo.size() || keyValuePairs.size() != other.keyValuePairs.size()) { @@ -73,7 +73,7 @@ LayerShaderManager::~LayerShaderManager() { } } -ProgramObject* LayerShaderManager::programObject( +ghoul::opengl::ProgramObject* LayerShaderManager::programObject( LayerShaderPreprocessingData preprocessingData) { _updatedOnLastCall = false; @@ -128,7 +128,7 @@ void LayerShaderManager::recompileShaderProgram( ); ghoul_assert(_programObject != nullptr, "Failed to initialize programObject!"); - using IgnoreError = ProgramObject::IgnoreError; + using IgnoreError = ghoul::opengl::ProgramObject::ProgramObject::IgnoreError; _programObject->setIgnoreSubroutineUniformLocationError(IgnoreError::Yes); } diff --git a/modules/globebrowsing/rendering/layershadermanager.h b/modules/globebrowsing/rendering/layershadermanager.h index 12074ab1ee..2a5572841c 100644 --- a/modules/globebrowsing/rendering/layershadermanager.h +++ b/modules/globebrowsing/rendering/layershadermanager.h @@ -25,7 +25,7 @@ #ifndef __OPENSPACE_MODULE_GLOBEBROWSING___LAYER_SHADER_MANAGER___H__ #define __OPENSPACE_MODULE_GLOBEBROWSING___LAYER_SHADER_MANAGER___H__ -#include +#include #include #include @@ -35,40 +35,41 @@ namespace opengl { class ProgramObject; } } + namespace openspace { namespace globebrowsing { -/** - * Settings per texture group that contains shader preprocessing information. - */ -struct LayerGroupPreprocessingData { - int lastLayerIdx; - bool layerBlendingEnabled; - bool operator==(const LayerGroupPreprocessingData& other) const; -}; - -/** - * Data needed for shader preprocessing before compiling a layered texture shader - * program. - * - * If a LayerShaderPreprocessingData is compared with another it can - * be determined wheter or not a LayerShaderManager needs to - * recompile its shader program. For each TextureGroup there is - * information about how many layers it has and whether or not to blend the texture - * levels. - */ -struct LayerShaderPreprocessingData { - std::array - layeredTextureInfo; - std::vector > keyValuePairs; - bool operator==(const LayerShaderPreprocessingData& other) const; -}; - /** * This class has ownership of an updated shader program for rendering tiles. */ class LayerShaderManager { public: + /** + * Data needed for shader preprocessing before compiling a layered texture shader + * program. + * + * If a LayerShaderPreprocessingData is compared with another it can + * be determined wheter or not a LayerShaderManager needs to + * recompile its shader program. For each TextureGroup there is + * information about how many layers it has and whether or not to blend the texture + * levels. + */ + struct LayerShaderPreprocessingData { + /** + * Settings per texture group that contains shader preprocessing information. + */ + struct LayerGroupPreprocessingData { + int lastLayerIdx; + bool layerBlendingEnabled; + bool operator==(const LayerGroupPreprocessingData& other) const; + }; + + std::array + layeredTextureInfo; + std::vector > keyValuePairs; + bool operator==(const LayerShaderPreprocessingData& other) const; + }; + LayerShaderManager( const std::string& shaderName, const std::string& vsPath, @@ -82,7 +83,7 @@ public: * from the last time this function was called the shader program will be * recompiled before returned. */ - ProgramObject* programObject( + ghoul::opengl::ProgramObject* programObject( LayerShaderPreprocessingData preprocessingData); bool updatedOnLastCall(); @@ -91,7 +92,7 @@ private: void recompileShaderProgram(LayerShaderPreprocessingData preprocessingData); - std::unique_ptr _programObject; + std::unique_ptr _programObject; LayerShaderPreprocessingData _preprocessingData; const std::string _shaderName; diff --git a/modules/globebrowsing/tile/asynctilereader.cpp b/modules/globebrowsing/tile/asynctilereader.cpp index 3ea69d0d68..893bf70b58 100644 --- a/modules/globebrowsing/tile/asynctilereader.cpp +++ b/modules/globebrowsing/tile/asynctilereader.cpp @@ -24,69 +24,13 @@ #include +#include #include #include namespace openspace { namespace globebrowsing { -void TileLoadJob::execute() { - _rawTile = _tileDataset->readTileData(_chunkIndex); -} - -std::shared_ptr TileLoadJob::product() const { - return _rawTile; -} - -DiskCachedTileLoadJob::DiskCachedTileLoadJob( - std::shared_ptr textureDataProvider, - const TileIndex& tileIndex, - std::shared_ptr tdc, - CacheMode m) - : TileLoadJob(textureDataProvider, tileIndex) - , _tileDiskCache(tdc) - , _mode(m) -{} - -void DiskCachedTileLoadJob::execute() { - _rawTile = nullptr; - - switch (_mode) { - case CacheMode::Disabled: - _rawTile = _tileDataset->readTileData(_chunkIndex); - break; - - case CacheMode::ReadOnly: - _rawTile = _tileDiskCache->get(_chunkIndex); - if (_rawTile == nullptr) { - _rawTile = _tileDataset->readTileData(_chunkIndex); - } - break; - - case CacheMode::ReadAndWrite: - _rawTile = _tileDiskCache->get(_chunkIndex); - if (_rawTile == nullptr) { - _rawTile = _tileDataset->readTileData(_chunkIndex); - _tileDiskCache->put(_chunkIndex, _rawTile); - } - break; - - case CacheMode::WriteOnly: - _rawTile = _tileDataset->readTileData(_chunkIndex); - _tileDiskCache->put(_chunkIndex, _rawTile); - break; - - case CacheMode::CacheHitsOnly: - _rawTile = _tileDiskCache->get(_chunkIndex); - if (_rawTile == nullptr) { - RawTile res = RawTile::createDefaultRes(); - res.tileIndex = _chunkIndex; - _rawTile = std::make_shared(res); - } - break; - } -} - AsyncTileDataProvider::AsyncTileDataProvider(std::shared_ptr tileDataset, std::shared_ptr pool) : _tileDataset(tileDataset) diff --git a/modules/globebrowsing/tile/asynctilereader.h b/modules/globebrowsing/tile/asynctilereader.h index 3208783b45..445cd0c6f0 100644 --- a/modules/globebrowsing/tile/asynctilereader.h +++ b/modules/globebrowsing/tile/asynctilereader.h @@ -26,61 +26,17 @@ #define __OPENSPACE_MODULE_GLOBEBROWSING___ASYNC_TILE_READER___H__ #include -#include + +#include #include namespace openspace { namespace globebrowsing { - + +class RawTile; class TileDataset; -struct LoadJob : public Job { - virtual void execute() = 0; - virtual std::shared_ptr product() const = 0; -}; - -struct TileLoadJob : LoadJob { - TileLoadJob(std::shared_ptr textureDataProvider, - const TileIndex& tileIndex) - : _tileDataset(textureDataProvider) - , _chunkIndex(tileIndex) - {} - - virtual ~TileLoadJob() = default; - - virtual void execute() override; - - virtual std::shared_ptr product() const override; - -protected: - TileIndex _chunkIndex; - std::shared_ptr _tileDataset; - std::shared_ptr _rawTile; -}; - -class TileDiskCache; - -struct DiskCachedTileLoadJob : public TileLoadJob { - enum CacheMode { - Disabled, - ReadOnly, - ReadAndWrite, - WriteOnly, - CacheHitsOnly, - }; - - DiskCachedTileLoadJob(std::shared_ptr textureDataProvider, - const TileIndex& tileIndex, std::shared_ptr tdc, - CacheMode cacheMode = CacheMode::ReadOnly); - - void execute() override; - -protected: - std::shared_ptr _tileDiskCache; - CacheMode _mode; -}; - class AsyncTileDataProvider { public: AsyncTileDataProvider(std::shared_ptr textureDataProvider, @@ -101,7 +57,7 @@ protected: private: std::shared_ptr _tileDataset; ConcurrentJobManager _concurrentJobManager; - std::unordered_map _enqueuedTileRequests; + std::unordered_map _enqueuedTileRequests; }; } // namespace globebrowsing diff --git a/modules/globebrowsing/tile/chunktile.h b/modules/globebrowsing/tile/chunktile.h index 313c92965e..5679123b9a 100644 --- a/modules/globebrowsing/tile/chunktile.h +++ b/modules/globebrowsing/tile/chunktile.h @@ -39,9 +39,7 @@ struct ChunkTile { TileDepthTransform depthTransform; }; -struct ChunkTilePile { - std::vector chunkTiles; -}; +using ChunkTilePile = std::vector; } // namespace globebrowsing } // namespace openspace diff --git a/modules/globebrowsing/tile/loadjob/diskcachedtileloadjob.cpp b/modules/globebrowsing/tile/loadjob/diskcachedtileloadjob.cpp new file mode 100644 index 0000000000..41a16afb6b --- /dev/null +++ b/modules/globebrowsing/tile/loadjob/diskcachedtileloadjob.cpp @@ -0,0 +1,84 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#include + +#include +#include +#include + +namespace openspace { +namespace globebrowsing { + +DiskCachedTileLoadJob::DiskCachedTileLoadJob( + std::shared_ptr textureDataProvider, + const TileIndex& tileIndex, + std::shared_ptr tdc, + CacheMode m) + : TileLoadJob(textureDataProvider, tileIndex) + , _tileDiskCache(tdc) + , _mode(m) +{} + +void DiskCachedTileLoadJob::execute() { + _rawTile = nullptr; + + switch (_mode) { + case CacheMode::Disabled: + _rawTile = _tileDataset->readTileData(_chunkIndex); + break; + + case CacheMode::ReadOnly: + _rawTile = _tileDiskCache->get(_chunkIndex); + if (_rawTile == nullptr) { + _rawTile = _tileDataset->readTileData(_chunkIndex); + } + break; + + case CacheMode::ReadAndWrite: + _rawTile = _tileDiskCache->get(_chunkIndex); + if (_rawTile == nullptr) { + _rawTile = _tileDataset->readTileData(_chunkIndex); + _tileDiskCache->put(_chunkIndex, _rawTile); + } + break; + + case CacheMode::WriteOnly: + _rawTile = _tileDataset->readTileData(_chunkIndex); + _tileDiskCache->put(_chunkIndex, _rawTile); + break; + + case CacheMode::CacheHitsOnly: + _rawTile = _tileDiskCache->get(_chunkIndex); + if (_rawTile == nullptr) { + RawTile res = RawTile::createDefaultRes(); + res.tileIndex = _chunkIndex; + _rawTile = std::make_shared(res); + } + break; + } +} + +} // namespace globebrowsing +} // namespace openspace diff --git a/modules/globebrowsing/tile/loadjob/diskcachedtileloadjob.h b/modules/globebrowsing/tile/loadjob/diskcachedtileloadjob.h new file mode 100644 index 0000000000..98c25e8598 --- /dev/null +++ b/modules/globebrowsing/tile/loadjob/diskcachedtileloadjob.h @@ -0,0 +1,58 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___DISKCACHEDTILELOADJOB___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___DISKCACHEDTILELOADJOB___H__ + +#include + +namespace openspace { +namespace globebrowsing { + +class TileDiskCache; + +struct DiskCachedTileLoadJob : public TileLoadJob { + enum CacheMode { + Disabled, + ReadOnly, + ReadAndWrite, + WriteOnly, + CacheHitsOnly, + }; + + DiskCachedTileLoadJob(std::shared_ptr textureDataProvider, + const TileIndex& tileIndex, std::shared_ptr tdc, + CacheMode cacheMode = CacheMode::ReadOnly); + + void execute() override; + +protected: + std::shared_ptr _tileDiskCache; + CacheMode _mode; +}; + +} // namespace globebrowsing +} // namespace openspace + +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___DISKCACHEDTILELOADJOB___H__ diff --git a/modules/globebrowsing/tile/loadjob/loadjob.h b/modules/globebrowsing/tile/loadjob/loadjob.h new file mode 100644 index 0000000000..28aec76b70 --- /dev/null +++ b/modules/globebrowsing/tile/loadjob/loadjob.h @@ -0,0 +1,45 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___LOADJOB___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___LOADJOB___H__ + +#include + +#include + +namespace openspace { +namespace globebrowsing { + +class RawTile; + +struct LoadJob : public Job { + virtual void execute() = 0; + virtual std::shared_ptr product() const = 0; +}; + +} // namespace globebrowsing +} // namespace openspace + +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___LOADJOB___H__ diff --git a/modules/globebrowsing/tile/loadjob/tileloadjob.cpp b/modules/globebrowsing/tile/loadjob/tileloadjob.cpp new file mode 100644 index 0000000000..20be5d229b --- /dev/null +++ b/modules/globebrowsing/tile/loadjob/tileloadjob.cpp @@ -0,0 +1,41 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#include + +#include + +namespace openspace { +namespace globebrowsing { + +void TileLoadJob::execute() { + _rawTile = _tileDataset->readTileData(_chunkIndex); +} + +std::shared_ptr TileLoadJob::product() const { + return _rawTile; +} + +} // namespace globebrowsing +} // namespace openspace diff --git a/modules/globebrowsing/tile/loadjob/tileloadjob.h b/modules/globebrowsing/tile/loadjob/tileloadjob.h new file mode 100644 index 0000000000..a02538d1b7 --- /dev/null +++ b/modules/globebrowsing/tile/loadjob/tileloadjob.h @@ -0,0 +1,61 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___TILELOADJOB___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___TILELOADJOB___H__ + +#include + +#include +#include + +namespace openspace { +namespace globebrowsing { + +class TileDataset; +class RawTile; + +struct TileLoadJob : LoadJob { + TileLoadJob(std::shared_ptr textureDataProvider, + const TileIndex& tileIndex) + : _tileDataset(textureDataProvider) + , _chunkIndex(tileIndex) + {} + + virtual ~TileLoadJob() = default; + + virtual void execute() override; + + virtual std::shared_ptr product() const override; + +protected: + TileIndex _chunkIndex; + std::shared_ptr _tileDataset; + std::shared_ptr _rawTile; +}; + +} // namespace globebrowsing +} // namespace openspace + +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___TILELOADJOB___H__ diff --git a/modules/globebrowsing/tile/pixelregion.cpp b/modules/globebrowsing/tile/pixelregion.cpp index b0ea885c64..7130b5d318 100644 --- a/modules/globebrowsing/tile/pixelregion.cpp +++ b/modules/globebrowsing/tile/pixelregion.cpp @@ -42,18 +42,18 @@ PixelRegion::PixelRegion(const PixelRegion& o) void PixelRegion::setSide(Side side, int pos) { switch (side) { - case LEFT: - setLeft(pos); - break; - case TOP: - setTop(pos); - break; - case RIGHT: - setRight(pos); - break; - case BOTTOM: - setBottom(pos); - break; + case Side::LEFT: + setLeft(pos); + break; + case Side::TOP: + setTop(pos); + break; + case Side::RIGHT: + setRight(pos); + break; + case Side::BOTTOM: + setBottom(pos); + break; } } @@ -77,18 +77,18 @@ void PixelRegion::setBottom(int y) { void PixelRegion::align(Side side, int pos) { switch (side) { - case LEFT: - alignLeft(pos); - break; - case TOP: - alignTop(pos); - break; - case RIGHT: - alignRight(pos); - break; - case BOTTOM: - alignBottom(pos); - break; + case Side::LEFT: + alignLeft(pos); + break; + case Side::TOP: + alignTop(pos); + break; + case Side::RIGHT: + alignRight(pos); + break; + case Side::BOTTOM: + alignBottom(pos); + break; } } @@ -137,18 +137,18 @@ void PixelRegion::upscalePow2(int exponent, PixelCoordinate wrt) { void PixelRegion::move(Side side, int amount) { switch (side) { - case LEFT: - start.x -= amount; - break; - case TOP: - start.y -= amount; - break; - case RIGHT: - start.x += amount; - break; - case BOTTOM: - start.y += amount; - break; + case Side::LEFT: + start.x -= amount; + break; + case Side::TOP: + start.y -= amount; + break; + case Side::RIGHT: + start.x += amount; + break; + case Side::BOTTOM: + start.y += amount; + break; } } @@ -198,19 +198,19 @@ PixelRegion PixelRegion::globalCut(Side side, int p) { PixelRegion cutOff(*this); int cutSize = 0; switch (side) { - case LEFT: + case Side::LEFT: setLeft(p); cutOff.setRight(p - cutSize); break; - case TOP: + case Side::TOP: setTop(p); cutOff.setBottom(p - cutSize); break; - case RIGHT: + case Side::RIGHT: setRight(p); cutOff.setLeft(p + cutSize); break; - case BOTTOM: + case Side::BOTTOM: setBottom(p); cutOff.setTop(p + cutSize); break; @@ -233,30 +233,34 @@ int PixelRegion::area() const { int PixelRegion::edge(Side side) const { switch (side) { - case LEFT: return start.x; - case TOP: return start.y; - case RIGHT: return start.x + numPixels.x; - case BOTTOM: return start.y + numPixels.y; + case Side::LEFT: + return start.x; + case Side::TOP: + return start.y; + case Side::RIGHT: + return start.x + numPixels.x; + case Side::BOTTOM: + return start.y + numPixels.y; } } int PixelRegion::edgeDirectionSign(Side side) const { - return side < RIGHT ? -1 : 1; + return side < Side::RIGHT ? -1 : 1; } -PixelCoordinate PixelRegion::end() const { +PixelRegion::PixelCoordinate PixelRegion::end() const { return start + numPixels; } bool PixelRegion::lineIntersect(Side side, int p) { switch (side) { - case PixelRegion::LEFT: - case PixelRegion::RIGHT: - return start.x <= p && p <= (start.x + numPixels.x); + case Side::LEFT: + case Side::RIGHT: + return start.x <= p && p <= (start.x + numPixels.x); - case PixelRegion::TOP: - case PixelRegion::BOTTOM: - return start.y <= p && p <= (start.y + numPixels.y); + case Side::TOP: + case Side::BOTTOM: + return start.y <= p && p <= (start.y + numPixels.y); } } diff --git a/modules/globebrowsing/tile/pixelregion.h b/modules/globebrowsing/tile/pixelregion.h index b4df7184c6..9a86a82270 100644 --- a/modules/globebrowsing/tile/pixelregion.h +++ b/modules/globebrowsing/tile/pixelregion.h @@ -30,11 +30,11 @@ namespace openspace { namespace globebrowsing { -using PixelCoordinate = glm::ivec2; -using PixelRange= glm::ivec2; - struct PixelRegion { - enum Side { + using PixelCoordinate = glm::ivec2; + using PixelRange = glm::ivec2; + + enum class Side { LEFT = 0, TOP, RIGHT, diff --git a/modules/globebrowsing/tile/quad.h b/modules/globebrowsing/tile/quad.h new file mode 100644 index 0000000000..9d06ac0759 --- /dev/null +++ b/modules/globebrowsing/tile/quad.h @@ -0,0 +1,42 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___QUAD___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___QUAD___H__ + +namespace openspace { +namespace globebrowsing { + +enum Quad { + NORTH_WEST = 0, + NORTH_EAST, + SOUTH_WEST, + SOUTH_EAST +}; + + +} // namespace globebrowsing +} // namespace openspace + +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___QUAD___H__ diff --git a/modules/globebrowsing/tile/rawtile.cpp b/modules/globebrowsing/tile/rawtile.cpp new file mode 100644 index 0000000000..a0a3f4c00c --- /dev/null +++ b/modules/globebrowsing/tile/rawtile.cpp @@ -0,0 +1,96 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#include + +#include + +#include + +namespace { + const std::string _loggerCat = "Tile"; +} + +namespace openspace { +namespace globebrowsing { + +RawTile::RawTile() + : imageData(nullptr) + , dimensions(0, 0, 0) + , tileMetaData(nullptr) + , tileIndex(0, 0, 0) + , error(CE_None) + , nBytesImageData(0) +{} + +RawTile RawTile::createDefaultRes() { + RawTile defaultRes; + int w = 8; + int h = 8; + defaultRes.dimensions = glm::uvec3(w, h, 1); + defaultRes.nBytesImageData = w * h * 1 * 3 * 4; // assume max 3 channels, max 4 bytes per pixel + defaultRes.imageData = new char[defaultRes.nBytesImageData]; + std::fill_n((char*)defaultRes.imageData, defaultRes.nBytesImageData, 0); + return std::move(defaultRes); +} + +void RawTile::serializeMetaData(std::ostream& os) { + os << dimensions.x << " " << dimensions.y << " " << dimensions.z << std::endl; + os << tileIndex.x << " " << tileIndex.y << " " << tileIndex.level << std::endl; + os << error << std::endl; + + // preprocess data + os << (tileMetaData != nullptr) << std::endl; + if (tileMetaData != nullptr) { + tileMetaData->serialize(os); + } + + os << nBytesImageData << std::endl; +} + +RawTile RawTile::deserializeMetaData(std::istream& is) { + RawTile res; + is >> res.dimensions.x >> res.dimensions.y >> res.dimensions.z; + is >> res.tileIndex.x >> res.tileIndex.y >> res.tileIndex.level; + int err; is >> err; res.error = (CPLErr) err; + + res.tileMetaData = nullptr; + bool hastileMetaData; + is >> hastileMetaData; + if (hastileMetaData) { + TileMetaData tileMetaData = TileMetaData::deserialize(is); + res.tileMetaData = std::make_shared(tileMetaData); + } + + is >> res.nBytesImageData; + + char binaryDataSeparator; + is >> binaryDataSeparator; // not used + + char* buffer = new char[res.nBytesImageData](); + return std::move(res); +} + +} // namespace globebrowsing +} // namespace openspace diff --git a/modules/globebrowsing/tile/rawtile.h b/modules/globebrowsing/tile/rawtile.h new file mode 100644 index 0000000000..963aa4363a --- /dev/null +++ b/modules/globebrowsing/tile/rawtile.h @@ -0,0 +1,61 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___RAWTILE___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___RAWTILE___H__ + +#include + +#include + +#include + +#include + +namespace openspace { +namespace globebrowsing { + +struct TileMetaData; + +struct RawTile { + RawTile(); + + char* imageData; + glm::uvec3 dimensions; + std::shared_ptr tileMetaData; + TileIndex tileIndex; + CPLErr error; + size_t nBytesImageData; + + void serializeMetaData(std::ostream& s); + static RawTile deserializeMetaData(std::istream& s); + + static RawTile createDefaultRes(); +}; + +} // namespace globebrowsing +} // namespace openspace + + +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___RAWTILE___H__ diff --git a/modules/globebrowsing/tile/textureformat.h b/modules/globebrowsing/tile/textureformat.h new file mode 100644 index 0000000000..4149b14a33 --- /dev/null +++ b/modules/globebrowsing/tile/textureformat.h @@ -0,0 +1,43 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___TEXTUREFORMAT___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___TEXTUREFORMAT___H__ + +#include +#include + +namespace openspace { +namespace globebrowsing { + +struct TextureFormat { + ghoul::opengl::Texture::Format ghoulFormat; + GLuint glFormat; +}; + + +} // namespace globebrowsing +} // namespace openspace + +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___TEXTUREFORMAT___H__ diff --git a/modules/globebrowsing/tile/tile.cpp b/modules/globebrowsing/tile/tile.cpp index 1c585f6155..fb9307557e 100644 --- a/modules/globebrowsing/tile/tile.cpp +++ b/modules/globebrowsing/tile/tile.cpp @@ -33,90 +33,6 @@ namespace { namespace openspace { namespace globebrowsing { -void TileMetaData::serialize(std::ostream& os) { - os << maxValues.size() << std::endl; - for (float f : maxValues) { - os << f << " "; - } - os << std::endl; - for (float f : minValues) { - os << f << " "; - } - os << std::endl; -} - -TileMetaData TileMetaData::deserialize(std::istream& is) { - TileMetaData res; - int n; is >> n; - res.maxValues.resize(n); - for (int i = 0; i < n; i++) { - is >> res.maxValues[i]; - } - res.minValues.resize(n); - for (int i = 0; i < n; i++) { - is >> res.minValues[i]; - } - - return std::move(res); -} - -RawTile::RawTile() - : imageData(nullptr) - , dimensions(0, 0, 0) - , tileMetaData(nullptr) - , tileIndex(0, 0, 0) - , error(CE_None) - , nBytesImageData(0) -{} - -RawTile RawTile::createDefaultRes() { - RawTile defaultRes; - int w = 8; - int h = 8; - defaultRes.dimensions = glm::uvec3(w, h, 1); - defaultRes.nBytesImageData = w * h * 1 * 3 * 4; // assume max 3 channels, max 4 bytes per pixel - defaultRes.imageData = new char[defaultRes.nBytesImageData]; - std::fill_n((char*)defaultRes.imageData, defaultRes.nBytesImageData, 0); - return std::move(defaultRes); -} - -void RawTile::serializeMetaData(std::ostream& os) { - os << dimensions.x << " " << dimensions.y << " " << dimensions.z << std::endl; - os << tileIndex.x << " " << tileIndex.y << " " << tileIndex.level << std::endl; - os << error << std::endl; - - // preprocess data - os << (tileMetaData != nullptr) << std::endl; - if (tileMetaData != nullptr) { - tileMetaData->serialize(os); - } - - os << nBytesImageData << std::endl; -} - -RawTile RawTile::deserializeMetaData(std::istream& is) { - RawTile res; - is >> res.dimensions.x >> res.dimensions.y >> res.dimensions.z; - is >> res.tileIndex.x >> res.tileIndex.y >> res.tileIndex.level; - int err; is >> err; res.error = (CPLErr) err; - - res.tileMetaData = nullptr; - bool hastileMetaData; - is >> hastileMetaData; - if (hastileMetaData) { - TileMetaData tileMetaData = TileMetaData::deserialize(is); - res.tileMetaData = std::make_shared(tileMetaData); - } - - is >> res.nBytesImageData; - - char binaryDataSeparator; - is >> binaryDataSeparator; // not used - - char* buffer = new char[res.nBytesImageData](); - return std::move(res); -} - const Tile Tile::TileUnavailable = {nullptr, nullptr, Tile::Status::Unavailable }; Tile Tile::createPlainTile(const glm::uvec2& size, const glm::uvec4& color) { @@ -160,7 +76,7 @@ glm::vec2 Tile::compensateSourceTextureSampling(glm::vec2 startOffset, glm::vec2 return tileUV; } -glm::vec2 Tile::TileUvToTextureSamplePosition(const TileUvTransform uvTransform, +glm::vec2 Tile::TileUvToTextureSamplePosition(const TileUvTransform& uvTransform, glm::vec2 tileUV, glm::uvec2 resolution) { glm::vec2 uv = uvTransform.uvOffset + uvTransform.uvScale * tileUV; diff --git a/modules/globebrowsing/tile/tile.h b/modules/globebrowsing/tile/tile.h index 4c2dc4f7a0..5db9f53385 100644 --- a/modules/globebrowsing/tile/tile.h +++ b/modules/globebrowsing/tile/tile.h @@ -27,57 +27,25 @@ #include -#include +#include -#include #include -#include + +namespace ghoul { namespace opengl { + class Texture; +}} namespace openspace { namespace globebrowsing { -struct TileMetaData { - std::vector maxValues; - std::vector minValues; - std::vector hasMissingData; - - void serialize(std::ostream& s); - static TileMetaData deserialize(std::istream& s); -}; - -struct TextureFormat { - ghoul::opengl::Texture::Format ghoulFormat; - GLuint glFormat; -}; - -using namespace ghoul::opengl; - -struct RawTile { - RawTile(); - - char* imageData; - glm::uvec3 dimensions; - std::shared_ptr tileMetaData; - TileIndex tileIndex; - CPLErr error; - size_t nBytesImageData; - - void serializeMetaData(std::ostream& s); - static RawTile deserializeMetaData(std::istream& s); - - static RawTile createDefaultRes(); -}; - -struct TileUvTransform { - glm::vec2 uvOffset; - glm::vec2 uvScale; -}; +struct TileMetaData; +struct TileUvTransform; /** * Defines a status and may have a Texture and TileMetaData */ struct Tile { - std::shared_ptr texture; + std::shared_ptr texture; std::shared_ptr metaData; /** @@ -126,7 +94,7 @@ struct Tile { static glm::vec2 compensateSourceTextureSampling(glm::vec2 startOffset, glm::vec2 sizeDiff, glm::uvec2 resolution, glm::vec2 tileUV); - static glm::vec2 TileUvToTextureSamplePosition(const TileUvTransform uvTransform, + static glm::vec2 TileUvToTextureSamplePosition(const TileUvTransform& uvTransform, glm::vec2 tileUV, glm::uvec2 resolution); /** diff --git a/modules/globebrowsing/tile/tiledatalayout.cpp b/modules/globebrowsing/tile/tiledatalayout.cpp new file mode 100644 index 0000000000..f20a626f3e --- /dev/null +++ b/modules/globebrowsing/tile/tiledatalayout.cpp @@ -0,0 +1,92 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#include + +#include + +#include +#include + +#include +#include // abspath +#include + +#include +#include + + +#include + +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace { + const std::string _loggerCat = "TileDataset"; +} + +namespace openspace { +namespace globebrowsing { + +TileDataLayout::TileDataLayout() {} + +TileDataLayout::TileDataLayout(GDALDataset* dataSet, GLuint preferredGlType) { + // Assume all raster bands have the same data type + gdalType =preferredGlType != 0 ? + tiledatatype::getGdalDataType(preferredGlType) : + dataSet->GetRasterBand(1)->GetRasterDataType(); + + glType = tiledatatype::getOpenGLDataType(gdalType); + numRasters = dataSet->GetRasterCount(); + bytesPerDatum = tiledatatype::numberOfBytes(gdalType); + bytesPerPixel = bytesPerDatum * numRasters; + textureFormat = tiledatatype::getTextureFormat(numRasters, gdalType); +} + +} // namespace globebrowsing +} // namespace openspace diff --git a/modules/globebrowsing/tile/tiledatalayout.h b/modules/globebrowsing/tile/tiledatalayout.h new file mode 100644 index 0000000000..a030b13c13 --- /dev/null +++ b/modules/globebrowsing/tile/tiledatalayout.h @@ -0,0 +1,57 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___TILEDATALAYOUT___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___TILEDATALAYOUT___H__ + +#include + +#include +#include + +#include + +class GDALDataset; + +namespace openspace { +namespace globebrowsing { + +struct TileDataLayout { + TileDataLayout(); + TileDataLayout(GDALDataset* dataSet, GLuint preferredGlType); + + GDALDataType gdalType; + GLuint glType; + + size_t bytesPerDatum; + size_t numRasters; + size_t bytesPerPixel; + + TextureFormat textureFormat; +}; + +} // namespace globebrowsing +} // namespace openspace + +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___TILEDATALAYOUT___H__ diff --git a/modules/globebrowsing/tile/tiledataset.cpp b/modules/globebrowsing/tile/tiledataset.cpp index 7c4652c770..06fea0a143 100644 --- a/modules/globebrowsing/tile/tiledataset.cpp +++ b/modules/globebrowsing/tile/tiledataset.cpp @@ -24,7 +24,6 @@ #include - #include #include @@ -62,8 +61,10 @@ #include #include #include +#include +#include #include - +#include namespace { const std::string _loggerCat = "TileDataset"; @@ -81,17 +82,17 @@ TileDataLayout::TileDataLayout() {} TileDataLayout::TileDataLayout(GDALDataset* dataSet, GLuint preferredGlType) { // Assume all raster bands have the same data type gdalType =preferredGlType != 0 ? - TileDataType::getGdalDataType(preferredGlType) : + tiledatatype::getGdalDataType(preferredGlType) : dataSet->GetRasterBand(1)->GetRasterDataType(); - glType = TileDataType::getOpenGLDataType(gdalType); + glType = tiledatatype::getOpenGLDataType(gdalType); numRasters = dataSet->GetRasterCount(); - bytesPerDatum = TileDataType::numberOfBytes(gdalType); + bytesPerDatum = tiledatatype::numberOfBytes(gdalType); bytesPerPixel = bytesPerDatum * numRasters; - textureFormat = TileDataType::getTextureFormat(numRasters, gdalType); + textureFormat = tiledatatype::getTextureFormat(numRasters, gdalType); } -IODescription IODescription::cut(PixelRegion::Side side, int pos) { +TileDataset::IODescription TileDataset::IODescription::cut(PixelRegion::Side side, int pos) { PixelRegion readPreCut = read.region; PixelRegion writePreCut = write.region; @@ -106,8 +107,8 @@ IODescription IODescription::cut(PixelRegion::Side side, int pos) { IODescription whatCameOff = *this; whatCameOff.read.region = read.region.globalCut(side, pos); - PixelRange cutSize = whatCameOff.read.region.numPixels; - PixelRange localWriteCutSize = ratio * glm::dvec2(cutSize); + PixelRegion::PixelRange cutSize = whatCameOff.read.region.numPixels; + PixelRegion::PixelRange localWriteCutSize = ratio * glm::dvec2(cutSize); if (cutSize.x == 0 || cutSize.y == 0) { ghoul_assert( @@ -120,7 +121,8 @@ IODescription IODescription::cut(PixelRegion::Side side, int pos) { ); } - int localWriteCutPos = (side % 2 == 0) ? localWriteCutSize.x : localWriteCutSize.y; + int localWriteCutPos = (side == PixelRegion::Side::LEFT || side == PixelRegion::Side::RIGHT) + ? localWriteCutSize.x : localWriteCutSize.y; whatCameOff.write.region = write.region.localCut(side, localWriteCutPos); return whatCameOff; @@ -321,7 +323,10 @@ std::shared_ptr TileDataset::readTileData(TileIndex tileIndex) { std::shared_ptr TileDataset::defaultTileData() { ensureInitialized(); - PixelRegion pixelRegion = { PixelCoordinate(0, 0), PixelRange(16, 16) }; + PixelRegion pixelRegion = { + PixelRegion::PixelCoordinate(0, 0), + PixelRegion::PixelRange(16, 16) + }; std::shared_ptr rawTile = std::make_shared(); rawTile->tileIndex = { 0, 0, 0 }; rawTile->dimensions = glm::uvec3(pixelRegion.numPixels, 1); @@ -385,7 +390,7 @@ TileDepthTransform TileDataset::calculateTileDepthTransform() { bool isFloat = (_dataLayout.gdalType == GDT_Float32 || _dataLayout.gdalType == GDT_Float64); double maximumValue = - isFloat ? 1.0 : TileDataType::getMaximumValue(_dataLayout.gdalType); + isFloat ? 1.0 : tiledatatype::getMaximumValue(_dataLayout.gdalType); TileDepthTransform transform; transform.depthOffset = firstBand->GetOffset(); @@ -397,7 +402,7 @@ bool TileDataset::gdalHasOverviews() const { return _dataset->GetRasterBand(1)->GetOverviewCount() > 0; } -int TileDataset::gdalOverview(const PixelRange& regionSizeOverviewZero) const { +int TileDataset::gdalOverview(const PixelRegion::PixelRange& regionSizeOverviewZero) const { GDALRasterBand* firstBand = _dataset->GetRasterBand(1); int minNumPixels0 = glm::min(regionSizeOverviewZero.x, regionSizeOverviewZero.y); @@ -441,8 +446,8 @@ PixelRegion TileDataset::gdalPixelRegion(GDALRasterBand* rasterBand) const { PixelRegion TileDataset::gdalPixelRegion(const GeodeticPatch& geodeticPatch) const { Geodetic2 nwCorner = geodeticPatch.getCorner(Quad::NORTH_WEST); Geodetic2 swCorner = geodeticPatch.getCorner(Quad::SOUTH_EAST); - PixelCoordinate pixelStart = geodeticToPixel(nwCorner); - PixelCoordinate pixelEnd = geodeticToPixel(swCorner); + PixelRegion::PixelCoordinate pixelStart = geodeticToPixel(nwCorner); + PixelRegion::PixelCoordinate pixelEnd = geodeticToPixel(swCorner); PixelRegion gdalRegion(pixelStart, pixelEnd - pixelStart); return gdalRegion; } @@ -474,7 +479,7 @@ std::array TileDataset::getGeoTransform() const { return padfTransform; } -PixelCoordinate TileDataset::geodeticToPixel(const Geodetic2& geo) const { +PixelRegion::PixelCoordinate TileDataset::geodeticToPixel(const Geodetic2& geo) const { std::array padfTransform = getGeoTransform(); double Y = Angle::fromRadians(geo.lat).asDegrees(); @@ -505,10 +510,10 @@ PixelCoordinate TileDataset::geodeticToPixel(const Geodetic2& geo) const { ghoul_assert(abs(X - Xp) < 1e-10, "inverse should yield X as before"); ghoul_assert(abs(Y - Yp) < 1e-10, "inverse should yield Y as before"); - return PixelCoordinate(glm::round(P), glm::round(L)); + return PixelRegion::PixelCoordinate(glm::round(P), glm::round(L)); } -Geodetic2 TileDataset::pixelToGeodetic(const PixelCoordinate& p) const { +Geodetic2 TileDataset::pixelToGeodetic(const PixelRegion::PixelCoordinate& p) const { std::array padfTransform = getGeoTransform(); Geodetic2 geodetic; // Should be using radians and not degrees? @@ -517,7 +522,7 @@ Geodetic2 TileDataset::pixelToGeodetic(const PixelCoordinate& p) const { return geodetic; } -IODescription TileDataset::getIODescription(const TileIndex& tileIndex) const { +TileDataset::IODescription TileDataset::getIODescription(const TileIndex& tileIndex) const { IODescription io; io.read.region = gdalPixelRegion(tileIndex); @@ -541,14 +546,14 @@ IODescription TileDataset::getIODescription(const TileIndex& tileIndex) const { // For correct sampling in height dataset, we need to pad the texture tile io.write.region.pad(padding); - PixelRange preRound = io.write.region.numPixels; + PixelRegion::PixelRange preRound = io.write.region.numPixels; io.write.region.roundDownToQuadratic(); io.write.region.roundUpNumPixelToNearestMultipleOf(2); if (preRound != io.write.region.numPixels) { LDEBUG(tileIndex << " | " << preRound.x << ", " << preRound.y << " --> " << io.write.region.numPixels.x << ", " << io.write.region.numPixels.y); } - io.write.region.start = PixelCoordinate(0, 0); // write region starts in origin + io.write.region.start = PixelRegion::PixelCoordinate(0, 0); // write region starts in origin io.write.bytesPerLine = _dataLayout.bytesPerPixel * io.write.region.numPixels.x; io.write.totalNumBytes = io.write.bytesPerLine * io.write.region.numPixels.y; @@ -705,7 +710,7 @@ CPLErr TileDataset::rasterIO(GDALRasterBand* rasterBand, const IODescription& io "Invalid write region" ); - PixelCoordinate end = io.write.region.end(); + PixelRegion::PixelCoordinate end = io.write.region.end(); size_t largestIndex = (end.y - 1) * io.write.bytesPerLine + (end.x - 1) * _dataLayout.bytesPerPixel; ghoul_assert(largestIndex <= io.write.totalNumBytes, "Invalid write region"); @@ -765,7 +770,7 @@ std::shared_ptr TileDataset::getTileMetaData( for (size_t x = 0; x < region.numPixels.x; x++) { for (size_t c = 0; c < _dataLayout.numRasters; c++) { float noDataValue = _dataset->GetRasterBand(c + 1)->GetNoDataValue(); - float val = TileDataType::interpretFloat( + float val = tiledatatype::interpretFloat( _dataLayout.gdalType, &(rawTile->imageData[yi + i]) ); @@ -818,7 +823,7 @@ CPLErr TileDataset::postProcessErrorCheck(std::shared_ptr rawTile return CE_Fatal; } // ugly test for heightmap overlay - if (_dataLayout.textureFormat.ghoulFormat == Texture::Format::RG) { + if (_dataLayout.textureFormat.ghoulFormat == ghoul::opengl::Texture::Format::RG) { // check the alpha if (rawTile->tileMetaData->maxValues[1] == 0.0 && rawTile->tileMetaData->minValues[1] == 0.0) diff --git a/modules/globebrowsing/tile/tiledataset.h b/modules/globebrowsing/tile/tiledataset.h index 84a685271b..6bc692884d 100644 --- a/modules/globebrowsing/tile/tiledataset.h +++ b/modules/globebrowsing/tile/tiledataset.h @@ -25,13 +25,16 @@ #ifndef __OPENSPACE_MODULE_GLOBEBROWSING___TILE_DATASET___H__ #define __OPENSPACE_MODULE_GLOBEBROWSING___TILE_DATASET___H__ +#include #include #include +#include #include #include #include #include +#include #include #include @@ -42,37 +45,9 @@ class GDALRasterBand; namespace openspace { namespace globebrowsing { +class RawTile; class GeodeticPatch; -struct TileDataLayout { - TileDataLayout(); - TileDataLayout(GDALDataset* dataSet, GLuint preferredGlType); - - GDALDataType gdalType; - GLuint glType; - - size_t bytesPerDatum; - size_t numRasters; - size_t bytesPerPixel; - - TextureFormat textureFormat; -}; - -struct IODescription { - struct ReadData { - int overview; - PixelRegion region; - } read; - - struct WriteData { - PixelRegion region; - size_t bytesPerLine; - size_t totalNumBytes; - } write; - - IODescription cut(PixelRegion::Side side, int pos); -}; - class TileDataset { public: struct Configuration { @@ -113,6 +88,21 @@ public: private: + struct IODescription { + struct ReadData { + int overview; + PixelRegion region; + } read; + + struct WriteData { + PixelRegion region; + size_t bytesPerLine; + size_t totalNumBytes; + } write; + + IODescription cut(PixelRegion::Side side, int pos); + }; + ////////////////////////////////////////////////////////////////////////////////// // Initialization // @@ -132,7 +122,7 @@ private: void setGdalProxyConfiguration(); GDALDataset* gdalDataset(const std::string& gdalDatasetDesc); bool gdalHasOverviews() const; - int gdalOverview(const PixelRange& baseRegionSize) const; + int gdalOverview(const PixelRegion::PixelRange& baseRegionSize) const; int gdalOverview(const TileIndex& tileIndex) const; int gdalVirtualOverview(const TileIndex& tileIndex) const; PixelRegion gdalPixelRegion(const GeodeticPatch& geodeticPatch) const; @@ -153,8 +143,8 @@ private: */ std::array getGeoTransform() const; - PixelCoordinate geodeticToPixel(const Geodetic2& geo) const; - Geodetic2 pixelToGeodetic(const PixelCoordinate& p) const; + PixelRegion::PixelCoordinate geodeticToPixel(const Geodetic2& geo) const; + Geodetic2 pixelToGeodetic(const PixelRegion::PixelCoordinate& p) const; IODescription getIODescription(const TileIndex& tileIndex) const; char* readImageData(IODescription& io, CPLErr& worstError) const; CPLErr rasterIO(GDALRasterBand* rasterBand, const IODescription& io, char* dst) const; diff --git a/modules/globebrowsing/tile/tiledatatype.cpp b/modules/globebrowsing/tile/tiledatatype.cpp index 5f1b8e798d..675751876c 100644 --- a/modules/globebrowsing/tile/tiledatatype.cpp +++ b/modules/globebrowsing/tile/tiledatatype.cpp @@ -44,8 +44,9 @@ namespace { namespace openspace { namespace globebrowsing { +namespace tiledatatype { -float TileDataType::interpretFloat(GDALDataType gdalType, const char* src) { +float interpretFloat(GDALDataType gdalType, const char* src) { switch (gdalType) { case GDT_Byte: return static_cast(*reinterpret_cast(src)); @@ -66,7 +67,7 @@ float TileDataType::interpretFloat(GDALDataType gdalType, const char* src) { } } -size_t TileDataType::numberOfBytes(GDALDataType gdalType) { +size_t numberOfBytes(GDALDataType gdalType) { switch (gdalType) { case GDT_Byte: return sizeof(GLubyte); @@ -88,7 +89,7 @@ size_t TileDataType::numberOfBytes(GDALDataType gdalType) { } } -size_t TileDataType::getMaximumValue(GDALDataType gdalType) { +size_t getMaximumValue(GDALDataType gdalType) { switch (gdalType) { case GDT_Byte: return 1 << 8; @@ -106,14 +107,12 @@ size_t TileDataType::getMaximumValue(GDALDataType gdalType) { } } -TextureFormat TileDataType::getTextureFormat( - int rasterCount, GDALDataType gdalType) -{ +TextureFormat getTextureFormat(int rasterCount, GDALDataType gdalType) { TextureFormat format; switch (rasterCount) { case 1: // Red - format.ghoulFormat = Texture::Format::Red; + format.ghoulFormat = ghoul::opengl::Texture::Format::Red; switch (gdalType) { case GDT_Byte: format.glFormat = GL_R8; @@ -142,7 +141,7 @@ TextureFormat TileDataType::getTextureFormat( } break; case 2: - format.ghoulFormat = Texture::Format::RG; + format.ghoulFormat = ghoul::opengl::Texture::Format::RG; switch (gdalType) { case GDT_Byte: format.glFormat = GL_RG8; @@ -170,7 +169,7 @@ TextureFormat TileDataType::getTextureFormat( } break; case 3: - format.ghoulFormat = Texture::Format::RGB; + format.ghoulFormat = ghoul::opengl::Texture::Format::RGB; switch (gdalType) { case GDT_Byte: format.glFormat = GL_RGB8; @@ -199,7 +198,7 @@ TextureFormat TileDataType::getTextureFormat( } break; case 4: - format.ghoulFormat = Texture::Format::RGBA; + format.ghoulFormat = ghoul::opengl::Texture::Format::RGBA; switch (gdalType) { case GDT_Byte: format.glFormat = GL_RGBA8; @@ -234,7 +233,7 @@ TextureFormat TileDataType::getTextureFormat( return format; } -GLuint TileDataType::getOpenGLDataType(GDALDataType gdalType) { +GLuint getOpenGLDataType(GDALDataType gdalType) { switch (gdalType) { case GDT_Byte: return GL_UNSIGNED_BYTE; @@ -256,7 +255,7 @@ GLuint TileDataType::getOpenGLDataType(GDALDataType gdalType) { } } -GDALDataType TileDataType::getGdalDataType(GLuint glType) { +GDALDataType getGdalDataType(GLuint glType) { switch (glType) { case GL_UNSIGNED_BYTE: return GDT_Byte; @@ -278,5 +277,6 @@ GDALDataType TileDataType::getGdalDataType(GLuint glType) { } } +} // namespace tiledatatype } // namespace globebrowsing } // namespace openspace diff --git a/modules/globebrowsing/tile/tiledatatype.h b/modules/globebrowsing/tile/tiledatatype.h index e69fb50673..fd92aa07e0 100644 --- a/modules/globebrowsing/tile/tiledatatype.h +++ b/modules/globebrowsing/tile/tiledatatype.h @@ -27,27 +27,29 @@ #include +#include + #include #include namespace openspace { namespace globebrowsing { +namespace tiledatatype { -struct TileDataType { - static GLuint getOpenGLDataType(GDALDataType gdalType); +GLuint getOpenGLDataType(GDALDataType gdalType); - static GDALDataType getGdalDataType(GLuint glType); +GDALDataType getGdalDataType(GLuint glType); - static TextureFormat getTextureFormat(int rasterCount, GDALDataType gdalType); +TextureFormat getTextureFormat(int rasterCount, GDALDataType gdalType); - static size_t getMaximumValue(GDALDataType gdalType); +size_t getMaximumValue(GDALDataType gdalType); - static size_t numberOfBytes(GDALDataType gdalType); +size_t numberOfBytes(GDALDataType gdalType); - static float interpretFloat(GDALDataType gdalType, const char* src); -}; +float interpretFloat(GDALDataType gdalType, const char* src); +} // namespace tiledatatype } // namespace globebrowsing } // namespace openspace diff --git a/modules/globebrowsing/tile/tilediskcache.cpp b/modules/globebrowsing/tile/tilediskcache.cpp index 5af4348ef8..f8627df68d 100644 --- a/modules/globebrowsing/tile/tilediskcache.cpp +++ b/modules/globebrowsing/tile/tilediskcache.cpp @@ -24,6 +24,7 @@ #include +#include #include #include diff --git a/modules/globebrowsing/tile/tilediskcache.h b/modules/globebrowsing/tile/tilediskcache.h index cacff0ab89..7b01d0ecb5 100644 --- a/modules/globebrowsing/tile/tilediskcache.h +++ b/modules/globebrowsing/tile/tilediskcache.h @@ -54,7 +54,6 @@ private: std::string getFilePath(const TileIndex& tileIndex) const; ghoul::filesystem::File getMetaDataFile(const TileIndex& tileIndex) const; ghoul::filesystem::File getDataFile(const TileIndex& tileIndex) const; - }; } // namespace globebrowsing diff --git a/modules/globebrowsing/tile/tileindex.cpp b/modules/globebrowsing/tile/tileindex.cpp index 0ae301e087..44d0ef8b44 100644 --- a/modules/globebrowsing/tile/tileindex.cpp +++ b/modules/globebrowsing/tile/tileindex.cpp @@ -122,7 +122,7 @@ Creates a hash which can be used as key in hash maps. +-------+------------+-------+------------+ */ -TileHashKey TileIndex::hashKey() const { +TileIndex::TileHashKey TileIndex::hashKey() const { TileHashKey key = 0LL; key |= level; key |= x << 5; diff --git a/modules/globebrowsing/tile/tileindex.h b/modules/globebrowsing/tile/tileindex.h index 434097fcc0..dbcce40b7e 100644 --- a/modules/globebrowsing/tile/tileindex.h +++ b/modules/globebrowsing/tile/tileindex.h @@ -25,6 +25,8 @@ #ifndef __OPENSPACE_MODULE_GLOBEBROWSING___TILE_INDEX___H__ #define __OPENSPACE_MODULE_GLOBEBROWSING___TILE_INDEX___H__ +#include + #include #include @@ -37,13 +39,6 @@ namespace globebrowsing { class Geodetic2; -enum Quad { - NORTH_WEST = 0, - NORTH_EAST, - SOUTH_WEST, - SOUTH_EAST -}; - enum CardinalDirection { WEST = 0, EAST, @@ -51,9 +46,9 @@ enum CardinalDirection { SOUTH, }; -using TileHashKey = uint64_t; - struct TileIndex { + using TileHashKey = uint64_t; + int x, y, level; TileIndex(int x = 0, int y = 0, int level = 0); diff --git a/modules/globebrowsing/tile/tilemetadata.cpp b/modules/globebrowsing/tile/tilemetadata.cpp new file mode 100644 index 0000000000..6c6c2b344e --- /dev/null +++ b/modules/globebrowsing/tile/tilemetadata.cpp @@ -0,0 +1,60 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#include + +#include + +namespace openspace { +namespace globebrowsing { + +void TileMetaData::serialize(std::ostream& os) { + os << maxValues.size() << std::endl; + for (float f : maxValues) { + os << f << " "; + } + os << std::endl; + for (float f : minValues) { + os << f << " "; + } + os << std::endl; +} + +TileMetaData TileMetaData::deserialize(std::istream& is) { + TileMetaData res; + int n; is >> n; + res.maxValues.resize(n); + for (int i = 0; i < n; i++) { + is >> res.maxValues[i]; + } + res.minValues.resize(n); + for (int i = 0; i < n; i++) { + is >> res.minValues[i]; + } + + return std::move(res); +} + +} // namespace globebrowsing +} // namespace openspace diff --git a/modules/globebrowsing/tile/tilemetadata.h b/modules/globebrowsing/tile/tilemetadata.h new file mode 100644 index 0000000000..64c82db2e3 --- /dev/null +++ b/modules/globebrowsing/tile/tilemetadata.h @@ -0,0 +1,47 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___TILEMETADATA___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___TILEMETADATA___H__ + +#include +#include + +namespace openspace { +namespace globebrowsing { + +struct TileMetaData { + std::vector maxValues; + std::vector minValues; + std::vector hasMissingData; + + void serialize(std::ostream& s); + static TileMetaData deserialize(std::istream& s); +}; + +} // namespace globebrowsing +} // namespace openspace + + +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___TILEMETADATA___H__ diff --git a/modules/globebrowsing/tile/tileprovider/cachingtileprovider.cpp b/modules/globebrowsing/tile/tileprovider/cachingtileprovider.cpp index d0e4e780fd..5cbacec25f 100644 --- a/modules/globebrowsing/tile/tileprovider/cachingtileprovider.cpp +++ b/modules/globebrowsing/tile/tileprovider/cachingtileprovider.cpp @@ -26,6 +26,7 @@ #include #include +#include #include #include @@ -42,7 +43,8 @@ namespace { namespace openspace { namespace globebrowsing { - +namespace tileprovider { + CachingTileProvider::CachingTileProvider(const ghoul::Dictionary& dictionary) : _framesSinceLastRequestFlush(0) { @@ -134,7 +136,7 @@ Tile CachingTileProvider::getTile(const TileIndex& tileIndex) { return tile; } - TileHashKey key = tileIndex.hashKey(); + TileIndex::TileHashKey key = tileIndex.hashKey(); if (_tileCache->exist(key)) { return _tileCache->get(key); @@ -162,7 +164,7 @@ Tile CachingTileProvider::getDefaultTile() { void CachingTileProvider::initTexturesFromLoadedData() { auto rawTiles = _asyncTextureDataProvider->getRawTiles(); for (auto rawTile : rawTiles){ - TileHashKey key = rawTile->tileIndex.hashKey(); + TileIndex::TileHashKey key = rawTile->tileIndex.hashKey(); Tile tile = createTile(rawTile); _tileCache->put(key, tile); } @@ -179,7 +181,7 @@ Tile::Status CachingTileProvider::getTileStatus(const TileIndex& tileIndex) { return Tile::Status::OutOfRange; } - TileHashKey key = tileIndex.hashKey(); + TileIndex::TileHashKey key = tileIndex.hashKey(); if (_tileCache->exist(key)) { return _tileCache->get(key).status; @@ -197,11 +199,12 @@ Tile CachingTileProvider::createTile(std::shared_ptr rawTile) { return{ nullptr, nullptr, Tile::Status::IOError }; } - TileHashKey key = rawTile->tileIndex.hashKey(); + TileIndex::TileHashKey key = rawTile->tileIndex.hashKey(); TileDataLayout dataLayout = _asyncTextureDataProvider->getTextureDataProvider()->getDataLayout(); // The texture should take ownership of the data + using ghoul::opengl::Texture; std::shared_ptr texture = std::make_shared( rawTile->imageData, rawTile->dimensions, @@ -225,5 +228,6 @@ Tile CachingTileProvider::createTile(std::shared_ptr rawTile) { return tile; } +} // namespace tileprovider } // namespace globebrowsing } // namespace openspace diff --git a/modules/globebrowsing/tile/tileprovider/cachingtileprovider.h b/modules/globebrowsing/tile/tileprovider/cachingtileprovider.h index 2263b1d10e..8a1669cf96 100644 --- a/modules/globebrowsing/tile/tileprovider/cachingtileprovider.h +++ b/modules/globebrowsing/tile/tileprovider/cachingtileprovider.h @@ -31,6 +31,9 @@ namespace openspace { namespace globebrowsing { class AsyncTileDataProvider; +class RawTile; + +namespace tileprovider { /** * Provides tiles loaded by AsyncTileDataProvider and @@ -92,6 +95,7 @@ private: Tile _defaultTile; }; +} // namespace tileprovider } // namespace globebrowsing } // namespace openspace diff --git a/modules/globebrowsing/tile/tileprovider/singleimageprovider.cpp b/modules/globebrowsing/tile/tileprovider/singleimageprovider.cpp index 73b8d51232..5157f60072 100644 --- a/modules/globebrowsing/tile/tileprovider/singleimageprovider.cpp +++ b/modules/globebrowsing/tile/tileprovider/singleimageprovider.cpp @@ -26,6 +26,7 @@ #include #include +#include namespace { const char* KeyFilePath = "FilePath"; @@ -33,7 +34,8 @@ namespace { namespace openspace { namespace globebrowsing { - +namespace tileprovider { + SingleImageProvider::SingleImageProvider(const ghoul::Dictionary& dictionary) { // Required input if (!dictionary.getValue(KeyFilePath, _imagePath)) { @@ -86,5 +88,6 @@ int SingleImageProvider::maxLevel() { return 1337; // unlimited } +} // namespace tileprovider } // namespace globebrowsing } // namespace openspace diff --git a/modules/globebrowsing/tile/tileprovider/singleimageprovider.h b/modules/globebrowsing/tile/tileprovider/singleimageprovider.h index e5c4b8ad7b..0f79d4ace9 100644 --- a/modules/globebrowsing/tile/tileprovider/singleimageprovider.h +++ b/modules/globebrowsing/tile/tileprovider/singleimageprovider.h @@ -29,6 +29,7 @@ namespace openspace { namespace globebrowsing { +namespace tileprovider { using namespace ghoul::opengl; @@ -51,6 +52,7 @@ private: std::string _imagePath; }; +} // namespace tileprovider } // namespace globebrowsing } // namespace openspace diff --git a/modules/globebrowsing/tile/tileprovider/sizereferencetileprovider.cpp b/modules/globebrowsing/tile/tileprovider/sizereferencetileprovider.cpp new file mode 100644 index 0000000000..80a944405e --- /dev/null +++ b/modules/globebrowsing/tile/tileprovider/sizereferencetileprovider.cpp @@ -0,0 +1,154 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#include + +#include + +#include + +#include +#include +#include +#include +#include + +using namespace ghoul::fontrendering; + +namespace openspace { +namespace globebrowsing { +namespace tileprovider { + +namespace { + const char* KeyRadii = "Radii"; + const char* KeyBackgroundImagePath = "BackgroundImagePath"; +} + +SizeReferenceTileProvider::SizeReferenceTileProvider(const ghoul::Dictionary& dictionary) +{ + _fontSize = 50; + _font = OsEng.fontManager().font("Mono", _fontSize); + + glm::dvec3 radii(1,1,1); + if (!dictionary.getValue(KeyRadii, radii)) { + throw std::runtime_error("Must define key '" + std::string(KeyRadii) + "'"); + } + _ellipsoid = Ellipsoid(radii); + + _backgroundTile.status = Tile::Status::Unavailable; + std::string backgroundImagePath; + if (dictionary.getValue(KeyBackgroundImagePath, backgroundImagePath)) { + using namespace ghoul::io; + std::string imgAbsPath = absPath(backgroundImagePath); + _backgroundTile.texture = TextureReader::ref().loadTexture(imgAbsPath); + _backgroundTile.texture->uploadTexture(); + _backgroundTile.texture->setFilter(ghoul::opengl::Texture::FilterMode::Linear); + _backgroundTile.status = Tile::Status::OK; + } +} + +void SizeReferenceTileProvider::renderText(const ghoul::fontrendering::FontRenderer& + fontRenderer, + const TileIndex& tileIndex) const +{ + GeodeticPatch patch(tileIndex); + bool aboveEquator = patch.isNorthern(); + + double tileLongitudalLength = roundedLongitudalLength(tileIndex); + + std::string unit = "m"; + if (tileLongitudalLength > 9999) { + tileLongitudalLength *= 0.001; + unit = "km"; + } + + glm::vec2 textPosition; + textPosition.x = 0; + textPosition.y = aboveEquator ? _fontSize / 2 : _textureSize.y - 3 * _fontSize / 2; + glm::vec4 color(1.0, 1.0, 1.0, 1.0); + + fontRenderer.render( + *_font, + textPosition, + color, + " %.0f %s", + tileLongitudalLength, unit.c_str() + ); +} + +int SizeReferenceTileProvider::roundedLongitudalLength(const TileIndex& tileIndex) const { + GeodeticPatch patch(tileIndex); + bool aboveEquator = patch.isNorthern(); + double lat = aboveEquator ? patch.minLat() : patch.maxLat(); + double lon1 = patch.minLon(); + double lon2 = patch.maxLon(); + int l = static_cast(_ellipsoid.longitudalDistance(lat, lon1, lon2)); + + bool useKm = l > 9999; + if (useKm) { + l /= 1000; + } + l = std::round(l); + if (useKm) { + l *= 1000; + } + + return l; +} + +TileIndex::TileHashKey SizeReferenceTileProvider::toHash(const TileIndex& tileIndex) const { + int l = roundedLongitudalLength(tileIndex); + TileIndex::TileHashKey key = static_cast(l); + return key; +} + +Tile SizeReferenceTileProvider::backgroundTile(const TileIndex& tileIndex) const { + if (_backgroundTile.status == Tile::Status::OK) { + Tile tile; + auto t = _backgroundTile.texture; + void* pixelData = new char[t->expectedPixelDataSize()]; + memcpy(pixelData, t->pixelData(), t->expectedPixelDataSize()); + tile.texture = std::make_shared( + pixelData, + t->dimensions(), + t->format(), + t->internalFormat(), + t->dataType(), + t->filter(), + t->wrapping() + ); + tile.texture->uploadTexture(); + tile.texture->setDataOwnership(ghoul::opengl::Texture::TakeOwnership::Yes); + tile.status = Tile::Status::OK; + return tile; + } + else { + // use default background + return TextTileProvider::backgroundTile(tileIndex); + } +} + +} // namespace tileprovider +} // namespace globebrowsing +} // namespace openspace diff --git a/modules/globebrowsing/tile/tileprovider/sizereferencetileprovider.h b/modules/globebrowsing/tile/tileprovider/sizereferencetileprovider.h new file mode 100644 index 0000000000..20997490e8 --- /dev/null +++ b/modules/globebrowsing/tile/tileprovider/sizereferencetileprovider.h @@ -0,0 +1,61 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___SIZEREFERENCE_TILE_PROVIDER___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___SIZEREFERENCE_TILE_PROVIDER___H__ + +#include + +#include + +namespace openspace { +namespace globebrowsing { +namespace tileprovider { + +/** + * Constructed with an ellipsoid and uses that to render the longitudal length of each + * of each tile. + */ +class SizeReferenceTileProvider : public TextTileProvider { +public: + SizeReferenceTileProvider(const ghoul::Dictionary& dictionary); + + virtual void renderText(const ghoul::fontrendering::FontRenderer& fontRenderer, + const TileIndex& tileIndex) const; + virtual Tile backgroundTile(const TileIndex& tileIndex) const; + + virtual TileIndex::TileHashKey toHash(const TileIndex& tileIndex) const; + +private: + int roundedLongitudalLength(const TileIndex& tileIndex) const; + + Ellipsoid _ellipsoid; + Tile _backgroundTile; +}; + +} // namespace tileprovider +} // namespace globebrowsing +} // namespace openspace + +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___SIZEREFERENCE_TILE_PROVIDER___H__ diff --git a/modules/globebrowsing/tile/tileprovider/temporaltileprovider.cpp b/modules/globebrowsing/tile/tileprovider/temporaltileprovider.cpp index f045099409..7e5e213611 100644 --- a/modules/globebrowsing/tile/tileprovider/temporaltileprovider.cpp +++ b/modules/globebrowsing/tile/tileprovider/temporaltileprovider.cpp @@ -43,7 +43,8 @@ namespace { namespace openspace { namespace globebrowsing { - +namespace tileprovider { + const char* TemporalTileProvider::URL_TIME_PLACEHOLDER("${OpenSpaceTimeId}"); const char* TemporalTileProvider::TemporalXMLTags::TIME_START = "OpenSpaceTimeStart"; @@ -347,5 +348,6 @@ bool TimeQuantizer::quantize(Time& t, bool clamp) const { } } +} // namespace tileprovider } // namespace globebrowsing } // namespace openspace diff --git a/modules/globebrowsing/tile/tileprovider/temporaltileprovider.h b/modules/globebrowsing/tile/tileprovider/temporaltileprovider.h index 7733393561..70344997e5 100644 --- a/modules/globebrowsing/tile/tileprovider/temporaltileprovider.h +++ b/modules/globebrowsing/tile/tileprovider/temporaltileprovider.h @@ -38,7 +38,8 @@ struct CPLXMLNode; namespace openspace { namespace globebrowsing { - +namespace tileprovider { + /** * Interface for stringifying OpenSpace Time instances. * @@ -292,6 +293,7 @@ private: TimeQuantizer _timeQuantizer; }; +} // namespace tileprovider } // namespace globebrowsing } // namespace openspace diff --git a/modules/globebrowsing/tile/tileprovider/texttileprovider.cpp b/modules/globebrowsing/tile/tileprovider/texttileprovider.cpp index 6c54c24b37..74abeb3f18 100644 --- a/modules/globebrowsing/tile/tileprovider/texttileprovider.cpp +++ b/modules/globebrowsing/tile/tileprovider/texttileprovider.cpp @@ -24,6 +24,9 @@ #include +#include +#include + #include #include @@ -36,7 +39,8 @@ using namespace ghoul::fontrendering; namespace openspace { namespace globebrowsing { - +namespace tileprovider { + TextTileProvider::TextTileProvider(const glm::uvec2& textureSize, size_t fontSize) : _tileCache(500) , _textureSize(textureSize) @@ -55,7 +59,7 @@ TextTileProvider::~TextTileProvider() { } Tile TextTileProvider::getTile(const TileIndex& tileIndex) { - TileHashKey key = tileIndex.hashKey(); + TileIndex::TileHashKey key = tileIndex.hashKey(); if (!_tileCache.exist(key)) { _tileCache.put(key, createChunkIndexTile(tileIndex)); @@ -126,7 +130,7 @@ int TextTileProvider::maxLevel() { return 1337; // unlimited } -TileHashKey TextTileProvider::toHash(const TileIndex& tileIndex) const { +TileIndex::TileHashKey TextTileProvider::toHash(const TileIndex& tileIndex) const { return tileIndex.hashKey(); } @@ -135,127 +139,6 @@ Tile TextTileProvider::backgroundTile(const TileIndex& tileIndex) const { return Tile::createPlainTile(_textureSize, color); } -void TileIndexTileProvider::renderText(const FontRenderer& fontRenderer, const TileIndex& tileIndex) const { - fontRenderer.render( - *_font, - glm::vec2( - _textureSize.x / 4 - (_textureSize.x / 32) * log10(1 << tileIndex.level), - _textureSize.y / 2 + _fontSize), - glm::vec4(1.0, 0.0, 0.0, 1.0), - "level: %i \nx: %i \ny: %i", - tileIndex.level, tileIndex.x, tileIndex.y - ); -} - -namespace { - const char* KeyRadii = "Radii"; - const char* KeyBackgroundImagePath = "BackgroundImagePath"; -} - -SizeReferenceTileProvider::SizeReferenceTileProvider(const ghoul::Dictionary& dictionary) -{ - _fontSize = 50; - FontManager& fm = OsEng.fontManager(); - _font = fm.font("Mono", _fontSize); - - glm::dvec3 radii(1,1,1); - if (!dictionary.getValue(KeyRadii, radii)) { - throw std::runtime_error("Must define key '" + std::string(KeyRadii) + "'"); - } - _ellipsoid = Ellipsoid(radii); - - _backgroundTile.status = Tile::Status::Unavailable; - std::string backgroundImagePath; - if (dictionary.getValue(KeyBackgroundImagePath, backgroundImagePath)) { - using namespace ghoul::io; - std::string imgAbsPath = absPath(backgroundImagePath); - _backgroundTile.texture = TextureReader::ref().loadTexture(imgAbsPath); - _backgroundTile.texture->uploadTexture(); - _backgroundTile.texture->setFilter(ghoul::opengl::Texture::FilterMode::Linear); - _backgroundTile.status = Tile::Status::OK; - } - -} - -void SizeReferenceTileProvider::renderText(const FontRenderer& fontRenderer, - const TileIndex& tileIndex) const -{ - GeodeticPatch patch(tileIndex); - bool aboveEquator = patch.isNorthern(); - - double tileLongitudalLength = roundedLongitudalLength(tileIndex); - - std::string unit = "m"; - if (tileLongitudalLength > 9999) { - tileLongitudalLength *= 0.001; - unit = "km"; - } - - glm::vec2 textPosition; - textPosition.x = 0; - textPosition.y = aboveEquator ? _fontSize / 2 : _textureSize.y - 3 * _fontSize / 2; - glm::vec4 color(1.0, 1.0, 1.0, 1.0); - - fontRenderer.render( - *_font, - textPosition, - color, - " %.0f %s", - tileLongitudalLength, unit.c_str() - ); -} - -int SizeReferenceTileProvider::roundedLongitudalLength(const TileIndex& tileIndex) const { - GeodeticPatch patch(tileIndex); - bool aboveEquator = patch.isNorthern(); - double lat = aboveEquator ? patch.minLat() : patch.maxLat(); - double lon1 = patch.minLon(); - double lon2 = patch.maxLon(); - int l = static_cast(_ellipsoid.longitudalDistance(lat, lon1, lon2)); - - bool useKm = l > 9999; - if (useKm) { - l /= 1000; - } - l = std::round(l); - if (useKm) { - l *= 1000; - } - - return l; -} - -TileHashKey SizeReferenceTileProvider::toHash(const TileIndex& tileIndex) const { - int l = roundedLongitudalLength(tileIndex); - TileHashKey key = static_cast(l); - return key; -} - -Tile SizeReferenceTileProvider::backgroundTile(const TileIndex& tileIndex) const { - if (_backgroundTile.status == Tile::Status::OK) { - Tile tile; - auto t = _backgroundTile.texture; - void* pixelData = new char[t->expectedPixelDataSize()]; - memcpy(pixelData, t->pixelData(), t->expectedPixelDataSize()); - tile.texture = std::make_shared( - pixelData, - t->dimensions(), - t->format(), - t->internalFormat(), - t->dataType(), - t->filter(), - t->wrapping() - ); - tile.texture->uploadTexture(); - tile.texture->setDataOwnership(Texture::TakeOwnership::Yes); - tile.status = Tile::Status::OK; - return tile; - } - else { - // use default background - return TextTileProvider::backgroundTile(tileIndex); - } -} - +} // namespace tileprovider } // namespace globebrowsing } // namespace openspace diff --git a/modules/globebrowsing/tile/tileprovider/texttileprovider.h b/modules/globebrowsing/tile/tileprovider/texttileprovider.h index 4d952cab21..1da75a3f2a 100644 --- a/modules/globebrowsing/tile/tileprovider/texttileprovider.h +++ b/modules/globebrowsing/tile/tileprovider/texttileprovider.h @@ -27,17 +27,16 @@ #include -#include +#include namespace ghoul { namespace fontrendering { - class Font; class FontRenderer; - }} namespace openspace { namespace globebrowsing { +namespace tileprovider { /** * Enables a simple way of providing tiles with any type of rendered text. @@ -75,7 +74,7 @@ public: * \param tileIndex tileIndex to hash * \returns hashkey used for in LRU cache for this tile */ - virtual TileHashKey toHash(const TileIndex& tileIndex) const; + virtual TileIndex::TileHashKey toHash(const TileIndex& tileIndex) const; /** * Uses the fontRenderer to render some text onto the tile texture provided in @@ -100,37 +99,7 @@ private: GLuint _fbo; }; -/** - * Provides Tiles with the chunk index rendered as text onto its tiles. - */ -class TileIndexTileProvider : public TextTileProvider { -public: - virtual void renderText(const ghoul::fontrendering::FontRenderer& fontRenderer, - const TileIndex& tileIndex) const; -}; - -/** - * Constructed with an ellipsoid and uses that to render the longitudal length of each - * of each tile. - */ -class SizeReferenceTileProvider : public TextTileProvider { -public: - SizeReferenceTileProvider(const ghoul::Dictionary& dictionary); - - virtual void renderText(const ghoul::fontrendering::FontRenderer& fontRenderer, - const TileIndex& tileIndex) const; - virtual Tile backgroundTile(const TileIndex& tileIndex) const; - - virtual TileHashKey toHash(const TileIndex& tileIndex) const; - -private: - - int roundedLongitudalLength(const TileIndex& tileIndex) const; - - Ellipsoid _ellipsoid; - Tile _backgroundTile; -}; - +} // namespace tileprovider } // namespace globebrowsing } // namespace openspace diff --git a/modules/globebrowsing/tile/tileprovider/tileindextileprovider.cpp b/modules/globebrowsing/tile/tileprovider/tileindextileprovider.cpp new file mode 100644 index 0000000000..0398f18541 --- /dev/null +++ b/modules/globebrowsing/tile/tileprovider/tileindextileprovider.cpp @@ -0,0 +1,49 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#include + +#include + +namespace openspace { +namespace globebrowsing { +namespace tileprovider { + +void TileIndexTileProvider::renderText(const ghoul::fontrendering::FontRenderer& + fontRenderer, const TileIndex& tileIndex) const +{ + fontRenderer.render( + *_font, + glm::vec2( + _textureSize.x / 4 - (_textureSize.x / 32) * log10(1 << tileIndex.level), + _textureSize.y / 2 + _fontSize), + glm::vec4(1.0, 0.0, 0.0, 1.0), + "level: %i \nx: %i \ny: %i", + tileIndex.level, tileIndex.x, tileIndex.y + ); +} + +} // namespace tileprovider +} // namespace globebrowsing +} // namespace openspace diff --git a/modules/globebrowsing/tile/tileprovider/tileindextileprovider.h b/modules/globebrowsing/tile/tileprovider/tileindextileprovider.h new file mode 100644 index 0000000000..0e418bb2a9 --- /dev/null +++ b/modules/globebrowsing/tile/tileprovider/tileindextileprovider.h @@ -0,0 +1,47 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___TILEINDEX_TILE_PROVIDER___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___TILEINDEX_TILE_PROVIDER___H__ + +#include + +namespace openspace { +namespace globebrowsing { +namespace tileprovider { + +/** + * Provides Tiles with the chunk index rendered as text onto its tiles. + */ +class TileIndexTileProvider : public TextTileProvider { +public: + virtual void renderText(const ghoul::fontrendering::FontRenderer& fontRenderer, + const TileIndex& tileIndex) const; +}; + +} // namespace tileprovider +} // namespace globebrowsing +} // namespace openspace + +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___TILEINDEX_TILE_PROVIDER___H__ diff --git a/modules/globebrowsing/tile/tileprovider/tileprovider.cpp b/modules/globebrowsing/tile/tileprovider/tileprovider.cpp index 9332b576b3..f1a3ee74d5 100644 --- a/modules/globebrowsing/tile/tileprovider/tileprovider.cpp +++ b/modules/globebrowsing/tile/tileprovider/tileprovider.cpp @@ -39,7 +39,8 @@ namespace { namespace openspace { namespace globebrowsing { - +namespace tileprovider { + TileProvider* TileProvider::createFromDictionary(const ghoul::Dictionary& dictionary) { std::string type = "LRUCaching"; dictionary.getValue(KeyType, type); @@ -67,7 +68,7 @@ ChunkTile TileProvider::getChunkTile(TileIndex tileIndex, int parents, int maxPa // Step 1. Traverse 0 or more parents up the chunkTree as requested by the caller for (int i = 0; i < parents && tileIndex.level > 1; i++) { - TileSelector::ascendToParent(tileIndex, uvTransform); + tileselector::ascendToParent(tileIndex, uvTransform); } maxParents -= parents; @@ -75,7 +76,7 @@ ChunkTile TileProvider::getChunkTile(TileIndex tileIndex, int parents, int maxPa // the range of defined data. int maximumLevel = maxLevel(); while (tileIndex.level > maximumLevel){ - TileSelector::ascendToParent(tileIndex, uvTransform); + tileselector::ascendToParent(tileIndex, uvTransform); maxParents--; } if(maxParents < 0){ @@ -90,7 +91,7 @@ ChunkTile TileProvider::getChunkTile(TileIndex tileIndex, int parents, int maxPa if (--maxParents < 0){ return{ Tile::TileUnavailable, uvTransform }; } - TileSelector::ascendToParent(tileIndex, uvTransform); + tileselector::ascendToParent(tileIndex, uvTransform); } else { return { tile, uvTransform }; @@ -103,24 +104,25 @@ ChunkTile TileProvider::getChunkTile(TileIndex tileIndex, int parents, int maxPa ChunkTilePile TileProvider::getChunkTilePile(TileIndex tileIndex, int pileSize){ ghoul_assert(pileSize >= 0, "pileSize must be positive"); ChunkTilePile chunkTilePile; - chunkTilePile.chunkTiles.resize(pileSize); + chunkTilePile.resize(pileSize); for (size_t i = 0; i < pileSize; ++i) { - chunkTilePile.chunkTiles[i] = getChunkTile(tileIndex, i); - if (chunkTilePile.chunkTiles[i].tile.status == Tile::Status::Unavailable) { + chunkTilePile[i] = getChunkTile(tileIndex, i); + if (chunkTilePile[i].tile.status == Tile::Status::Unavailable) { if (i>0) { - chunkTilePile.chunkTiles[i].tile = chunkTilePile.chunkTiles[i-1].tile; - chunkTilePile.chunkTiles[i].uvTransform.uvOffset = chunkTilePile.chunkTiles[i-1].uvTransform.uvOffset; - chunkTilePile.chunkTiles[i].uvTransform.uvScale = chunkTilePile.chunkTiles[i-1].uvTransform.uvScale; + chunkTilePile[i].tile = chunkTilePile[i-1].tile; + chunkTilePile[i].uvTransform.uvOffset = chunkTilePile[i-1].uvTransform.uvOffset; + chunkTilePile[i].uvTransform.uvScale = chunkTilePile[i-1].uvTransform.uvScale; } else { - chunkTilePile.chunkTiles[i].tile = getDefaultTile(); - chunkTilePile.chunkTiles[i].uvTransform.uvOffset = { 0, 0 }; - chunkTilePile.chunkTiles[i].uvTransform.uvScale = { 1, 1 }; + chunkTilePile[i].tile = getDefaultTile(); + chunkTilePile[i].uvTransform.uvOffset = { 0, 0 }; + chunkTilePile[i].uvTransform.uvScale = { 1, 1 }; } } } return std::move(chunkTilePile); } +} // namespace tileprovider } // namespace globebrowsing } // namespace openspace diff --git a/modules/globebrowsing/tile/tileprovider/tileprovider.h b/modules/globebrowsing/tile/tileprovider/tileprovider.h index a46bf100cd..9d26165b4d 100644 --- a/modules/globebrowsing/tile/tileprovider/tileprovider.h +++ b/modules/globebrowsing/tile/tileprovider/tileprovider.h @@ -33,6 +33,7 @@ namespace openspace { namespace globebrowsing { +namespace tileprovider { /** * Interface for providing Tiles given a @@ -141,8 +142,9 @@ public: virtual float noDataValueAsFloat(); }; -using TileCache = LRUCache; +using TileCache = LRUCache; +} // namespace tileprovider } // namespace globebrowsing } // namespace openspace diff --git a/modules/globebrowsing/tile/tileprovider/tileproviderbyindex.cpp b/modules/globebrowsing/tile/tileprovider/tileproviderbyindex.cpp index 44e4eda06c..866f01a5d4 100644 --- a/modules/globebrowsing/tile/tileprovider/tileproviderbyindex.cpp +++ b/modules/globebrowsing/tile/tileprovider/tileproviderbyindex.cpp @@ -37,6 +37,7 @@ namespace { namespace openspace { namespace globebrowsing { +namespace tileprovider { TileProviderByIndex::TileProviderByIndex(const ghoul::Dictionary& dictionary) { ghoul::Dictionary defaultProviderDict = dictionary.value( @@ -65,7 +66,7 @@ TileProviderByIndex::TileProviderByIndex(const ghoul::Dictionary& dictionary) { TileIndex tileIndex(tileIndexDict); TileProvider* tileProvider = TileProvider::createFromDictionary(providerDict); std::shared_ptr stp = std::shared_ptr(tileProvider); - TileHashKey key = tileIndex.hashKey(); + TileIndex::TileHashKey key = tileIndex.hashKey(); _tileProviderMap.insert(std::make_pair(key, stp)); } } @@ -113,5 +114,6 @@ TileProvider* TileProviderByIndex::indexProvider(const TileIndex& tileIndex) con return (it != _tileProviderMap.end()) ? it->second.get() : nullptr; } +} // namespace tileprovider } // namespace globebrowsing } // namespace openspace diff --git a/modules/globebrowsing/tile/tileprovider/tileproviderbyindex.h b/modules/globebrowsing/tile/tileprovider/tileproviderbyindex.h index a4d9a3bc66..c20a047390 100644 --- a/modules/globebrowsing/tile/tileprovider/tileproviderbyindex.h +++ b/modules/globebrowsing/tile/tileprovider/tileproviderbyindex.h @@ -29,6 +29,7 @@ namespace openspace { namespace globebrowsing { +namespace tileprovider { class TileProviderByIndex : public TileProvider { public: @@ -47,10 +48,11 @@ public: private: TileProvider* indexProvider(const TileIndex& tileIndex) const; - std::unordered_map> _tileProviderMap; + std::unordered_map> _tileProviderMap; std::shared_ptr _defaultTileProvider; }; +} // namespace tileprovider } // namespace globebrowsing } // namespace openspace diff --git a/modules/globebrowsing/tile/tileprovider/tileproviderbylevel.cpp b/modules/globebrowsing/tile/tileprovider/tileproviderbylevel.cpp index 1cd1351e56..37a56007f8 100644 --- a/modules/globebrowsing/tile/tileprovider/tileproviderbylevel.cpp +++ b/modules/globebrowsing/tile/tileprovider/tileproviderbylevel.cpp @@ -27,8 +27,6 @@ #include namespace { - const std::string _loggerCat = "TileProviderByLevel"; - const char* KeyProviders = "LevelTileProviders"; const char* KeyMaxLevel = "MaxLevel"; const char* KeyTileProvider = "TileProvider"; @@ -36,15 +34,14 @@ namespace { namespace openspace { namespace globebrowsing { +namespace tileprovider { TileProviderByLevel::TileProviderByLevel(const ghoul::Dictionary& dictionary) { - ghoul::Dictionary levelProvidersDict = dictionary.value( - KeyProviders - ); + ghoul::Dictionary providers = dictionary.value(KeyProviders); - for (size_t i = 0; i < levelProvidersDict.size(); i++) { + for (size_t i = 0; i < providers.size(); i++) { std::string dictKey = std::to_string(i + 1); - ghoul::Dictionary levelProviderDict = levelProvidersDict.value( + ghoul::Dictionary levelProviderDict = providers.value( dictKey ); double floatMaxLevel; @@ -128,5 +125,6 @@ TileProvider* TileProviderByLevel::levelProvider(int level) const { return _levelTileProviders[providerIndex(level)].get(); } +} // namespace tileprovider } // namespace globebrowsing } // namespace openspace diff --git a/modules/globebrowsing/tile/tileprovider/tileproviderbylevel.h b/modules/globebrowsing/tile/tileprovider/tileproviderbylevel.h index 8419f30523..1e1f54a805 100644 --- a/modules/globebrowsing/tile/tileprovider/tileproviderbylevel.h +++ b/modules/globebrowsing/tile/tileprovider/tileproviderbylevel.h @@ -29,6 +29,7 @@ namespace openspace { namespace globebrowsing { +namespace tileprovider { class TileProviderByLevel : public TileProvider { public: @@ -51,6 +52,7 @@ private: std::vector> _levelTileProviders; }; +} // namespace tileprovider } // namespace globebrowsing } // namespace openspace diff --git a/modules/globebrowsing/tile/tileselector.cpp b/modules/globebrowsing/tile/tileselector.cpp index 9ded4d96a2..de2ca3a070 100644 --- a/modules/globebrowsing/tile/tileselector.cpp +++ b/modules/globebrowsing/tile/tileselector.cpp @@ -24,15 +24,14 @@ #include -#include +#include #include namespace openspace { namespace globebrowsing { +namespace tileselector { -ChunkTile TileSelector::getHighestResolutionTile(const LayerGroup& layerGroup, - TileIndex tileIndex) -{ +ChunkTile getHighestResolutionTile(const LayerGroup& layerGroup, TileIndex tileIndex) { ChunkTile mostHighResolution; mostHighResolution.tile = Tile::TileUnavailable; mostHighResolution.uvTransform.uvScale.x = 0; @@ -51,9 +50,8 @@ ChunkTile TileSelector::getHighestResolutionTile(const LayerGroup& layerGroup, return mostHighResolution; } -std::vector TileSelector::getTilesSortedByHighestResolution( - const LayerGroup& layerGroup, - const TileIndex& tileIndex) +std::vector getTilesSortedByHighestResolution(const LayerGroup& layerGroup, + const TileIndex& tileIndex) { std::vector tiles; for (const auto& layer : layerGroup.activeLayers()) { @@ -71,7 +69,7 @@ std::vector TileSelector::getTilesSortedByHighestResolution( return tiles; } -void TileSelector::ascendToParent(TileIndex& tileIndex, TileUvTransform& uv) { +void ascendToParent(TileIndex& tileIndex, TileUvTransform& uv) { uv.uvOffset *= 0.5; uv.uvScale *= 0.5; @@ -80,5 +78,6 @@ void TileSelector::ascendToParent(TileIndex& tileIndex, TileUvTransform& uv) { --tileIndex; } +} // namespace tileselector¢ } // namespace globebrowsing } // namespace openspace diff --git a/modules/globebrowsing/tile/tileselector.h b/modules/globebrowsing/tile/tileselector.h index 2faaa7a5a1..9af20b18dd 100644 --- a/modules/globebrowsing/tile/tileselector.h +++ b/modules/globebrowsing/tile/tileselector.h @@ -26,7 +26,6 @@ #define __OPENSPACE_MODULE_GLOBEBROWSING___TILE_SELECTOR___H__ #include -#include #include @@ -34,18 +33,18 @@ namespace openspace { namespace globebrowsing { struct LayerGroup; -class TileProvider; +struct TileIndex; -class TileSelector { -public: - static ChunkTile getHighestResolutionTile(const LayerGroup& layerGroup, - TileIndex tileIndex); - static std::vector getTilesSortedByHighestResolution( - const LayerGroup& layerGroup, const TileIndex& tileIndex); +namespace tileselector { - static void ascendToParent(TileIndex& tileIndex, TileUvTransform& uv); -}; +ChunkTile getHighestResolutionTile(const LayerGroup& layerGroup, TileIndex& tileIndex); +std::vector getTilesSortedByHighestResolution(const LayerGroup& layerGroup, + const TileIndex& tileIndex); + +void ascendToParent(TileIndex& tileIndex, TileUvTransform& uv); + +} // namespace tileselector } // namespace globebrowsing } // namespace openspace diff --git a/modules/globebrowsing/tile/tileuvtransform.h b/modules/globebrowsing/tile/tileuvtransform.h new file mode 100644 index 0000000000..533bcfa88a --- /dev/null +++ b/modules/globebrowsing/tile/tileuvtransform.h @@ -0,0 +1,41 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___TILEUVTRANSFORM___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___TILEUVTRANSFORM___H__ + +#include + +namespace openspace { +namespace globebrowsing { + +struct TileUvTransform { + glm::vec2 uvOffset; + glm::vec2 uvScale; +}; + +} // namespace globebrowsing +} // namespace openspace + +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___TILEUVTRANSFORM___H__ diff --git a/modules/volume/textureslicevolumereader.h b/modules/volume/textureslicevolumereader.h index ebcb5f7a43..b6f48b9a85 100644 --- a/modules/volume/textureslicevolumereader.h +++ b/modules/volume/textureslicevolumereader.h @@ -26,6 +26,7 @@ #define __OPENSPACE_MODULE_VOLUME___TEXTURESLICEVOLUMEREADER___H__ #include +#include #include #include #include diff --git a/tests/main.cpp b/tests/main.cpp index a1f2cd02b9..df340ba31b 100644 --- a/tests/main.cpp +++ b/tests/main.cpp @@ -39,7 +39,6 @@ //#include #include #include -#include #include //#include diff --git a/tests/test_aabb.inl b/tests/test_aabb.inl index e145bdca71..b0eb5e00c1 100644 --- a/tests/test_aabb.inl +++ b/tests/test_aabb.inl @@ -56,8 +56,8 @@ TEST_F(AABBTest, Contains2) { EXPECT_TRUE(a1.intersects(a2)) << "a1 should intersect a2"; EXPECT_TRUE(a2.intersects(a1)) << "a2 should intersect a1"; - EXPECT_EQ(AABBSpatialRelation::Containing, a1.relationTo(a2)) << "a1 contains a2"; - EXPECT_EQ(AABBSpatialRelation::Contained, a2.relationTo(a1)) << "a2 contained by a1"; + EXPECT_EQ(AABB2::AABBSpatialRelation::Containing, a1.relationTo(a2)) << "a1 contains a2"; + EXPECT_EQ(AABB2::AABBSpatialRelation::Contained, a2.relationTo(a1)) << "a2 contained by a1"; } @@ -90,8 +90,8 @@ TEST_F(AABBTest, Intersects2) { EXPECT_TRUE(a1.intersects(a2)) << "a1 should intersect a2"; EXPECT_TRUE(a2.intersects(a1)) << "a2 should intersect a1"; - EXPECT_EQ(AABBSpatialRelation::Intersecting, a1.relationTo(a2)) << "They should intersect"; - EXPECT_EQ(AABBSpatialRelation::Intersecting, a2.relationTo(a1)) << "They should intersect"; + EXPECT_EQ(AABB2::AABBSpatialRelation::Intersecting, a1.relationTo(a2)) << "They should intersect"; + EXPECT_EQ(AABB2::AABBSpatialRelation::Intersecting, a2.relationTo(a1)) << "They should intersect"; } @@ -111,8 +111,8 @@ TEST_F(AABBTest, Contains3) { EXPECT_TRUE(a1.intersects(a2)) << "a1 should intersect a2"; EXPECT_TRUE(a2.intersects(a1)) << "a2 should intersect a1"; - EXPECT_EQ(AABBSpatialRelation::Containing, a1.relationTo(a2)) << "a1 contains a2"; - EXPECT_EQ(AABBSpatialRelation::Contained, a2.relationTo(a1)) << "a2 contained by a1"; + EXPECT_EQ(AABB3::AABBSpatialRelation::Containing, a1.relationTo(a2)) << "a1 contains a2"; + EXPECT_EQ(AABB3::AABBSpatialRelation::Contained, a2.relationTo(a1)) << "a2 contained by a1"; } @@ -133,7 +133,7 @@ TEST_F(AABBTest, Intersects3) { EXPECT_FALSE(a1.contains(a2)) << "a1 should not contain a2"; EXPECT_FALSE(a2.contains(a1)) << "a2 should not contain a1"; - EXPECT_EQ(AABBSpatialRelation::Intersecting, a1.relationTo(a2)) << "They should intersect"; - EXPECT_EQ(AABBSpatialRelation::Intersecting, a2.relationTo(a1)) << "They should intersect"; + EXPECT_EQ(AABB3::AABBSpatialRelation::Intersecting, a1.relationTo(a2)) << "They should intersect"; + EXPECT_EQ(AABB3::AABBSpatialRelation::Intersecting, a2.relationTo(a1)) << "They should intersect"; } diff --git a/tests/test_convexhull.inl b/tests/test_convexhull.inl deleted file mode 100644 index 3584d9d7f5..0000000000 --- a/tests/test_convexhull.inl +++ /dev/null @@ -1,122 +0,0 @@ -/***************************************************************************************** - * * - * 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. * - ****************************************************************************************/ - -#include "gtest/gtest.h" - -#include -#include - -#include -#include - -class ConvexHull2Test : public testing::Test {}; - -TEST_F(ConvexHull2Test, basic) { - using namespace openspace::globebrowsing; - - // points - // 2 x - // 1 x - // 0 x x - // -1 0 1 - - std::vector points = { - { -1.0, 0.0 }, - { 1.0, 0.0 }, - { 0.0, 2.0 }, - { 0.0, 1.0 } - }; - - - // Convex hull - // 2 x - // 1 / \ - // 0 x ___ x - // -1 0 1 - - ConvexHull2 hull = ConvexHull2::grahamScan_NOT_THREAD_SAFE(points); - - - - EXPECT_EQ(3, hull.points().size()) << "Should have 3 points"; - EXPECT_EQ(4, points.size()) << "Should have 4 points"; - -} - -TEST_F(ConvexHull2Test, intersection) { - using namespace openspace::globebrowsing; - std::vector points1 = { - { -1.0, 0.0 }, - { 1.0, 0.0 }, - { 0.0, 2.0 }, - { 0.0, 1.0 } - }; - ConvexHull2 hull1 = ConvexHull2::grahamScan_NOT_THREAD_SAFE(points1); - - std::vector points2 = { - { 0.0, 0.0 }, - { 2.0, 0.0 }, - { 1.0, 2.0 }, - { 1.0, 1.0 } - }; - ConvexHull2 hull2 = ConvexHull2::grahamScan_NOT_THREAD_SAFE(points2); - - - // Convex hull - // 3 - // 2 x x - // 1 / /\ \ - // 0 x _x__x__x - // -1 0 1 2 3 - - EXPECT_TRUE(hull1.intersects(hull2)) << "They should intersect"; -} - - -TEST_F(ConvexHull2Test, non_intersection) { - using namespace openspace::globebrowsing; - std::vector points1 = { - { -2.0, 0.0 }, - { 2.0, 0.0 }, - { 0.0, 2.0 }, - }; - ConvexHull2 hull1 = ConvexHull2::grahamScan_NOT_THREAD_SAFE(points1); - - std::vector points2 = { - { 1.0, 2.0 }, - { 3.0, 0.0 }, - { 5.0, 2.0 } - }; - ConvexHull2 hull2 = ConvexHull2::grahamScan_NOT_THREAD_SAFE(points2); - - - // Convex hull - // 3 - // 2 x x-----------x - // 1 _-' '-_'-_ _-' - // 0 x___________x x - // -2 -1 0 1 2 3 4 5 - - EXPECT_FALSE(hull1.intersects(hull2)) << "They should not intersect"; -} From 2da100c001c609f2779a012a9ff9d3272c1ccbd9 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Thu, 16 Feb 2017 18:19:52 +0100 Subject: [PATCH 20/96] Windows compile fix --- ext/ghoul | 2 +- modules/globebrowsing/geometry/geodeticpatch.h | 2 +- modules/globebrowsing/globes/chunkedlodglobe.cpp | 1 + modules/globebrowsing/globes/chunkedlodglobe.h | 2 +- .../globebrowsing/rendering/gpu/gpulayergroup.h | 2 +- .../globebrowsing/rendering/layer/layermanager.h | 2 +- modules/globebrowsing/tile/rawtile.h | 1 + modules/globebrowsing/tile/tiledataset.cpp | 15 --------------- modules/globebrowsing/tile/tileindex.h | 2 +- 9 files changed, 8 insertions(+), 21 deletions(-) diff --git a/ext/ghoul b/ext/ghoul index 11ebef1385..c007df9d95 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 11ebef1385689d62e2b08e93aaf755533d0ab343 +Subproject commit c007df9d955b934624f4374505aa5912ab483dab diff --git a/modules/globebrowsing/geometry/geodeticpatch.h b/modules/globebrowsing/geometry/geodeticpatch.h index 6ebc01733f..e47cd5de3d 100644 --- a/modules/globebrowsing/geometry/geodeticpatch.h +++ b/modules/globebrowsing/geometry/geodeticpatch.h @@ -31,7 +31,7 @@ namespace openspace { namespace globebrowsing { -class TileIndex; +struct TileIndex; class GeodeticPatch { public: diff --git a/modules/globebrowsing/globes/chunkedlodglobe.cpp b/modules/globebrowsing/globes/chunkedlodglobe.cpp index 8df8299544..a4a6c6e823 100644 --- a/modules/globebrowsing/globes/chunkedlodglobe.cpp +++ b/modules/globebrowsing/globes/chunkedlodglobe.cpp @@ -40,6 +40,7 @@ #include #include #include +#include #include diff --git a/modules/globebrowsing/globes/chunkedlodglobe.h b/modules/globebrowsing/globes/chunkedlodglobe.h index c34695d1c6..7578bcb481 100644 --- a/modules/globebrowsing/globes/chunkedlodglobe.h +++ b/modules/globebrowsing/globes/chunkedlodglobe.h @@ -47,7 +47,7 @@ namespace culling { class Chunk; class ChunkNode; class ChunkRenderer; -class Geodetic2; +struct Geodetic2; class LayerManager; class RenderableGlobe; diff --git a/modules/globebrowsing/rendering/gpu/gpulayergroup.h b/modules/globebrowsing/rendering/gpu/gpulayergroup.h index 4863921f2f..8d93755b3f 100644 --- a/modules/globebrowsing/rendering/gpu/gpulayergroup.h +++ b/modules/globebrowsing/rendering/gpu/gpulayergroup.h @@ -45,7 +45,7 @@ class LayerRenderSettings; struct TileDepthTransform; struct TileUvTransform; -class LayerGroup; +struct LayerGroup; struct TileIndex; /** diff --git a/modules/globebrowsing/rendering/layer/layermanager.h b/modules/globebrowsing/rendering/layer/layermanager.h index 03ff591e09..dfcc2b916c 100644 --- a/modules/globebrowsing/rendering/layer/layermanager.h +++ b/modules/globebrowsing/rendering/layer/layermanager.h @@ -32,7 +32,7 @@ namespace openspace { namespace globebrowsing { -class LayerGroup; +struct LayerGroup; /** * Manages multiple LayerGroups. diff --git a/modules/globebrowsing/tile/rawtile.h b/modules/globebrowsing/tile/rawtile.h index 963aa4363a..fa436957f1 100644 --- a/modules/globebrowsing/tile/rawtile.h +++ b/modules/globebrowsing/tile/rawtile.h @@ -29,6 +29,7 @@ #include +#include #include #include diff --git a/modules/globebrowsing/tile/tiledataset.cpp b/modules/globebrowsing/tile/tiledataset.cpp index 06fea0a143..67cb2a5dcd 100644 --- a/modules/globebrowsing/tile/tiledataset.cpp +++ b/modules/globebrowsing/tile/tiledataset.cpp @@ -77,21 +77,6 @@ std::ostream& operator<<(std::ostream& os, const PixelRegion& pr) { return os << pr.start.x << ", " << pr.start.y << " with size " << pr.numPixels.x << ", " << pr.numPixels.y; } -TileDataLayout::TileDataLayout() {} - -TileDataLayout::TileDataLayout(GDALDataset* dataSet, GLuint preferredGlType) { - // Assume all raster bands have the same data type - gdalType =preferredGlType != 0 ? - tiledatatype::getGdalDataType(preferredGlType) : - dataSet->GetRasterBand(1)->GetRasterDataType(); - - glType = tiledatatype::getOpenGLDataType(gdalType); - numRasters = dataSet->GetRasterCount(); - bytesPerDatum = tiledatatype::numberOfBytes(gdalType); - bytesPerPixel = bytesPerDatum * numRasters; - textureFormat = tiledatatype::getTextureFormat(numRasters, gdalType); -} - TileDataset::IODescription TileDataset::IODescription::cut(PixelRegion::Side side, int pos) { PixelRegion readPreCut = read.region; PixelRegion writePreCut = write.region; diff --git a/modules/globebrowsing/tile/tileindex.h b/modules/globebrowsing/tile/tileindex.h index dbcce40b7e..6de6c20da1 100644 --- a/modules/globebrowsing/tile/tileindex.h +++ b/modules/globebrowsing/tile/tileindex.h @@ -37,7 +37,7 @@ namespace ghoul { namespace openspace { namespace globebrowsing { -class Geodetic2; +struct Geodetic2; enum CardinalDirection { WEST = 0, From 8167228d698079832f06e31f6b94394956d855cb Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Thu, 16 Feb 2017 12:30:58 -0500 Subject: [PATCH 21/96] Add global try-catch block around main function Add additional LDEBUG and LTRACE for debugging --- apps/OpenSpace/main.cpp | 54 +++++++++++++++++++--------------- src/engine/moduleengine.cpp | 1 + src/engine/openspaceengine.cpp | 2 ++ src/util/openspacemodule.cpp | 5 ++-- 4 files changed, 36 insertions(+), 26 deletions(-) diff --git a/apps/OpenSpace/main.cpp b/apps/OpenSpace/main.cpp index f0cc00ece2..0ff4b1d46d 100644 --- a/apps/OpenSpace/main.cpp +++ b/apps/OpenSpace/main.cpp @@ -35,6 +35,7 @@ sgct::Engine* _sgctEngine; +int main_main(int argc, char** argv); void mainInitFunc(); void mainPreSyncFunc(); void mainPostSyncPreDrawFunc(); @@ -82,6 +83,30 @@ namespace { } int main(int argc, char** argv) { + try { + return main_main(argc, argv); + } + catch (const ghoul::RuntimeError& e) { + // Write out all of the information about the exception, flush the logs, and throw + LFATALC(e.component, e.message); + LogMgr.flushLogs(); + throw; + } + catch (const std::exception& e) { + // Write out all of the information about the exception, flush the logs, and throw + LFATALC("Exception", e.what()); + LogMgr.flushLogs(); + throw; + } + catch (...) { + // Write out all of the information about the exception, flush the logs, and throw + LFATALC("Exception", "Unknown exception"); + LogMgr.flushLogs(); + throw; + } +} + +int main_main(int argc, char** argv) { auto glVersion = supportedOpenGLVersion(); // create the OpenSpace engine and get arguments for the sgct engine @@ -99,8 +124,9 @@ int main(int argc, char** argv) { // create sgct engine c arguments int newArgc = static_cast(sgctArguments.size()); char** newArgv = new char*[newArgc]; - for (int i = 0; i < newArgc; ++i) + for (int i = 0; i < newArgc; ++i) { newArgv[i] = const_cast(sgctArguments.at(i).c_str()); + } // Need to set this before the creation of the sgct::Engine sgct::MessageHandler::instance()->setLogToConsole(false); @@ -168,29 +194,9 @@ int main(int argc, char** argv) { } // Main loop - try { - LDEBUG("Starting rendering loop"); - _sgctEngine->render(); - LDEBUG("Ending rendering loop"); - } - catch (const ghoul::RuntimeError& e) { - // Write out all of the information about the exception, flush the logs, and throw - LFATALC(e.component, e.message); - LogMgr.flushLogs(); - throw; - } - catch (const std::exception& e) { - // Write out all of the information about the exception, flush the logs, and throw - LFATALC("Exception", e.what()); - LogMgr.flushLogs(); - throw; - } - catch (...) { - // Write out all of the information about the exception, flush the logs, and throw - LFATALC("Exception", "Unknown exception"); - LogMgr.flushLogs(); - throw; - } + LDEBUG("Starting rendering loop"); + _sgctEngine->render(); + LDEBUG("Ending rendering loop"); //clear function bindings to avoid crash after destroying the OpenSpace Engine sgct::MessageHandler::instance()->setLogToCallback(false); diff --git a/src/engine/moduleengine.cpp b/src/engine/moduleengine.cpp index 0b06d6f858..5aa8886d51 100644 --- a/src/engine/moduleengine.cpp +++ b/src/engine/moduleengine.cpp @@ -73,6 +73,7 @@ void ModuleEngine::registerModule(std::unique_ptr module) { LDEBUG("Registering module '" << module->name() << "'"); module->initialize(); + LDEBUG("Registered module '" << module->name() << "'"); _modules.push_back(std::move(module)); } diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index 5b20b44cc9..773b034e8c 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -975,7 +975,9 @@ void OpenSpaceEngine::postSynchronizationPreDraw() { } void OpenSpaceEngine::render(const glm::mat4& projectionMatrix, const glm::mat4& viewMatrix) { + LTRACE("OpenSpaceEngine::render(begin)"); _renderEngine->render(projectionMatrix, viewMatrix); + LTRACE("OpenSpaceEngine::render(end)"); } void OpenSpaceEngine::postDraw() { diff --git a/src/util/openspacemodule.cpp b/src/util/openspacemodule.cpp index 06e0ca5009..9482490ba5 100644 --- a/src/util/openspacemodule.cpp +++ b/src/util/openspacemodule.cpp @@ -39,7 +39,7 @@ namespace openspace { OpenSpaceModule::OpenSpaceModule(std::string name) { ghoul_assert(!name.empty(), "Name must not be empty"); - setName(name); + setName(std::move(name)); } void OpenSpaceModule::initialize() { @@ -77,8 +77,9 @@ std::string OpenSpaceModule::modulePath() const { std::string moduleName = name(); std::transform(moduleName.begin(), moduleName.end(), moduleName.begin(), tolower); - if (FileSys.directoryExists("${MODULES}/" + moduleName)) + if (FileSys.directoryExists("${MODULES}/" + moduleName)) { return absPath("${MODULES}/" + moduleName); + } #ifdef EXTERNAL_MODULES_PATHS From 11fbff5fbc87912d54f8f3424d199a3ef9476faf Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Thu, 16 Feb 2017 16:43:34 -0500 Subject: [PATCH 22/96] Reduce the dependency of libOpenSpace on modules - Enable module callbacks for OpenSpaceEngine - Add OpenSpaceModule function that returns a Lua library --- include/openspace/engine/openspaceengine.h | 96 +++++++- include/openspace/util/openspacemodule.h | 8 + modules/iswa/iswamodule.cpp | 13 +- modules/iswa/iswamodule.h | 2 + modules/onscreengui/include/gui.h | 1 - modules/onscreengui/onscreenguimodule.cpp | 149 +++++++++++- modules/onscreengui/onscreenguimodule.h | 6 +- modules/onscreengui/src/gui.cpp | 8 +- modules/onscreengui/src/gui_lua.inl | 6 +- src/engine/openspaceengine.cpp | 251 +++++++++------------ src/util/openspacemodule.cpp | 4 + 11 files changed, 382 insertions(+), 162 deletions(-) diff --git a/include/openspace/engine/openspaceengine.h b/include/openspace/engine/openspaceengine.h index fcfc69b447..e3b823f2e5 100644 --- a/include/openspace/engine/openspaceengine.h +++ b/include/openspace/engine/openspaceengine.h @@ -92,10 +92,7 @@ public: ghoul::fontrendering::FontManager& fontManager(); DownloadManager& downloadManager(); TimeManager& timeManager(); - -#ifdef OPENSPACE_MODULE_ONSCREENGUI_ENABLED - gui::GUI& gui(); -#endif + SettingsEngine& settingsEngine(); // SGCT callbacks bool initialize(); @@ -124,6 +121,70 @@ public: void runPostInitializationScripts(const std::string& sceneDescription); + + + // This method is only to be called from Modules + + enum class CallbackOption { + Initialize = 0, // Callback for the end of the initialization + Deinitialize, // Callback for the end of the deinitialization + InitializeGL, // Callback for the end of the OpenGL initialization + DeinitializeGL, // Callback for the end of the OpenGL deinitialization + PreSync, // Callback for the end of the pre-sync function + PostSyncPreDraw, // Callback for the end of the post-sync-pre-draw function + Render, // Callback for the end of the render function + PostDraw // Callback for the end of the post-draw function + }; + + // Registers a callback for a specific CallbackOption + void registerModuleCallback(CallbackOption option, std::function function) { + switch (option) { + case CallbackOption::Initialize: + _moduleCallbacks.initialize.push_back(std::move(function)); + break; + case CallbackOption::Deinitialize: + _moduleCallbacks.deinitialize.push_back(std::move(function)); + break; + case CallbackOption::InitializeGL: + _moduleCallbacks.initializeGL.push_back(std::move(function)); + break; + case CallbackOption::DeinitializeGL: + _moduleCallbacks.deinitializeGL.push_back(std::move(function)); + break; + case CallbackOption::PreSync: + _moduleCallbacks.preSync.push_back(std::move(function)); + break; + case CallbackOption::PostSyncPreDraw: + _moduleCallbacks.postSyncPreDraw.push_back(std::move(function)); + break; + case CallbackOption::Render: + _moduleCallbacks.render.push_back(std::move(function)); + break; + case CallbackOption::PostDraw: + _moduleCallbacks.postDraw.push_back(std::move(function)); + break; + } + } + + // Registers a callback that is called when a new keyboard event is received + void registerModuleKeyboardCallback( + std::function function); + + // Registers a callback that is called when a new character event is received + void registerModuleCharCallback( + std::function function); + + // Registers a callback that is called when a new mouse button is received + void registerModuleMouseButtonCallback( + std::function function); + + // Registers a callback that is called when a new mouse movement is received + void registerModuleMousePositionCallback( + std::function function); + + // Registers a callback that is called when a scroll wheel change is received + void registerModuleMouseScrollWheelCallback(std::function function); + /** * Returns the Lua library that contains all Lua functions available to affect the * application. @@ -155,9 +216,6 @@ private: std::unique_ptr _settingsEngine; std::unique_ptr _timeManager; std::unique_ptr _downloadManager; -#ifdef OPENSPACE_MODULE_ONSCREENGUI_ENABLED - std::unique_ptr _gui; -#endif std::unique_ptr _parallelConnection; std::unique_ptr _windowWrapper; std::unique_ptr _fontManager; @@ -165,6 +223,30 @@ private: // Others std::unique_ptr _globalPropertyNamespace; + struct { + std::vector> initialize; + std::vector> deinitialize; + + std::vector> initializeGL; + std::vector> deinitializeGL; + + std::vector> preSync; + std::vector> postSyncPreDraw; + std::vector> render; + std::vector> postDraw; + + std::vector> keyboard; + std::vector> character; + + std::vector> mouseButton; + std::vector> mousePosition; + std::vector> mouseScrollWheel; + + + + + } _moduleCallbacks; + bool _isMaster; double _runTime; diff --git a/include/openspace/util/openspacemodule.h b/include/openspace/util/openspacemodule.h index a88cae8a6e..992bd8459d 100644 --- a/include/openspace/util/openspacemodule.h +++ b/include/openspace/util/openspacemodule.h @@ -28,6 +28,7 @@ #include #include +#include #include @@ -73,6 +74,13 @@ public: * \return A list of Documentation classes that are valid for this OpenSapceModule */ virtual std::vector documentations() const; + + /** + * Returns the Lua library with functions defined by this OpenSpaceModule. The default + * implementation returns an empty library. + * \return The Lua library with functions defined by this OpenSpaceModule + */ + virtual scripting::LuaLibrary luaLibrary() const; /** * Returns the minimum required OpenGL version of this OpenSpaceModule. Unless diff --git a/modules/iswa/iswamodule.cpp b/modules/iswa/iswamodule.cpp index 6c7d5e7ceb..e9c1b5004b 100644 --- a/modules/iswa/iswamodule.cpp +++ b/modules/iswa/iswamodule.cpp @@ -40,7 +40,18 @@ namespace openspace { IswaModule::IswaModule() : OpenSpaceModule("ISWA") -{} +{ + OsEng.registerModuleCallback( + OpenSpaceEngine::CallbackOption::Initialize, + [](){ + IswaManager::initialize(); + } + ); +} + +scripting::LuaLibrary IswaModule::luaLibrary() const { + return IswaManager::luaLibrary(); +} void IswaModule::internalInitialize(){ auto fRenderable = FactoryManager::ref().factory(); diff --git a/modules/iswa/iswamodule.h b/modules/iswa/iswamodule.h index e337a2facb..6b92f37634 100644 --- a/modules/iswa/iswamodule.h +++ b/modules/iswa/iswamodule.h @@ -32,6 +32,8 @@ class IswaModule : public OpenSpaceModule { public: IswaModule(); + + scripting::LuaLibrary luaLibrary() const override; protected: void internalInitialize() override; diff --git a/modules/onscreengui/include/gui.h b/modules/onscreengui/include/gui.h index 6e8e688aa1..e1b3b45484 100644 --- a/modules/onscreengui/include/gui.h +++ b/modules/onscreengui/include/gui.h @@ -44,7 +44,6 @@ namespace gui { class GUI : public GuiComponent { public: GUI(); - ~GUI(); void initialize(); void deinitialize(); diff --git a/modules/onscreengui/onscreenguimodule.cpp b/modules/onscreengui/onscreenguimodule.cpp index 88636efe39..0a42166833 100644 --- a/modules/onscreengui/onscreenguimodule.cpp +++ b/modules/onscreengui/onscreenguimodule.cpp @@ -27,13 +27,158 @@ #include #include +#include +#include +#include +#include +#include + +#include namespace openspace { +gui::GUI OnScreenGUIModule::gui; + OnScreenGUIModule::OnScreenGUIModule() : OpenSpaceModule("OnScreenGUI") { - addPropertySubOwner(OsEng.gui()); -} + addPropertySubOwner(gui); + + OsEng.registerModuleCallback( + OpenSpaceEngine::CallbackOption::Initialize, + [](){ + LDEBUGC("OnScreenGUIModule", "Initializing GUI"); + gui.initialize(); + + gui._globalProperty.setSource( + []() { + std::vector res = { + &(OsEng.settingsEngine()), + &(OsEng.interactionHandler()), + &(OsEng.renderEngine()) + }; + return res; + } + ); + + gui._screenSpaceProperty.setSource( + []() { + const auto& ssr = OsEng.renderEngine().screenSpaceRenderables(); + return std::vector(ssr.begin(), ssr.end()); + } + ); + + gui._property.setSource( + []() { + const auto& nodes = OsEng.renderEngine().scene()->allSceneGraphNodes(); + return std::vector(nodes.begin(), nodes.end()); + } + ); + } + ); + + OsEng.registerModuleCallback( + OpenSpaceEngine::CallbackOption::Deinitialize, + [](){ + LDEBUGC("OnScreenGui", "Deinitialize GUI"); + gui.deinitialize(); + } + ); + + OsEng.registerModuleCallback( + OpenSpaceEngine::CallbackOption::InitializeGL, + [](){ + LDEBUGC("OnScreenGui", "Initializing GUI OpenGL"); + gui.initializeGL(); + } + ); + + OsEng.registerModuleCallback( + OpenSpaceEngine::CallbackOption::DeinitializeGL, + [](){ + LDEBUGC("OnScreenGui", "Deinitialize GUI OpenGL"); + gui.deinitializeGL(); + } + ); + OsEng.registerModuleCallback( + OpenSpaceEngine::CallbackOption::PostSyncPreDraw, + [](){ + WindowWrapper& wrapper = OsEng.windowWrapper(); + if (OsEng.isMaster() && wrapper.isRegularRendering()) { + glm::vec2 mousePosition = wrapper.mousePosition(); + //glm::ivec2 drawBufferResolution = _windowWrapper->currentDrawBufferResolution(); + glm::ivec2 windowSize = wrapper.currentWindowSize(); + glm::ivec2 renderingSize = wrapper.currentWindowResolution(); + uint32_t mouseButtons = wrapper.mouseButtons(2); + + double dt = std::max(wrapper.averageDeltaTime(), 0.0); + + gui.startFrame( + static_cast(dt), + glm::vec2(windowSize), + wrapper.dpiScaling(), + mousePosition, + mouseButtons + ); + } + } + ); + + OsEng.registerModuleCallback( + OpenSpaceEngine::CallbackOption::PostDraw, + [](){ + WindowWrapper& wrapper = OsEng.windowWrapper(); + bool showGui = wrapper.hasGuiWindow() ? wrapper.isGuiWindow() : true; + if (OsEng.isMaster() && wrapper.isRegularRendering() && showGui) { + gui.endFrame(); + } + } + ); + + OsEng.registerModuleKeyboardCallback( + [](Key key, KeyModifier mod, KeyAction action) -> bool { + if (gui.isEnabled()) { + return gui.keyCallback(key, mod, action); + } + else { + return false; + } + } + ); + + OsEng.registerModuleCharCallback( + [](unsigned int codepoint, KeyModifier modifier) -> bool { + if (gui.isEnabled()) { + return gui.charCallback(codepoint, modifier); + } + else { + return false; + } + } + ); + + OsEng.registerModuleMouseButtonCallback( + [](MouseButton button, MouseAction action) -> bool { + if (gui.isEnabled()) { + return gui.mouseButtonCallback(button, action); + } + else { + return false; + } + } + ); + + OsEng.registerModuleMouseScrollWheelCallback( + [](double pos) -> bool { + if (gui.isEnabled()) { + return gui.mouseWheelCallback(pos); + } + else { + return false; + } + } + ); +} + } // namespace openspace diff --git a/modules/onscreengui/onscreenguimodule.h b/modules/onscreengui/onscreenguimodule.h index 80d7e76753..6576843c68 100644 --- a/modules/onscreengui/onscreenguimodule.h +++ b/modules/onscreengui/onscreenguimodule.h @@ -27,11 +27,15 @@ #include -namespace openspace { +#include +namespace openspace { + class OnScreenGUIModule : public OpenSpaceModule { public: OnScreenGUIModule(); + + static gui::GUI gui; }; } // namespace openspace diff --git a/modules/onscreengui/src/gui.cpp b/modules/onscreengui/src/gui.cpp index 874b457f46..6fa3417705 100644 --- a/modules/onscreengui/src/gui.cpp +++ b/modules/onscreengui/src/gui.cpp @@ -24,6 +24,8 @@ #include +#include + #include #include #include @@ -237,10 +239,6 @@ GUI::GUI() addPropertySubOwner(_iswa); } -GUI::~GUI() { - ImGui::Shutdown(); -} - void GUI::initialize() { std::string cachedFile = FileSys.cacheManager()->cachedFilename( configurationFile, "", ghoul::filesystem::CacheManager::Persistent::Yes @@ -322,6 +320,8 @@ void GUI::initialize() { } void GUI::deinitialize() { + ImGui::Shutdown(); + _iswa.deinitialize(); _help.deinitialize(); _performance.deinitialize(); diff --git a/modules/onscreengui/src/gui_lua.inl b/modules/onscreengui/src/gui_lua.inl index 0c20aa07bd..9155ba5d2e 100644 --- a/modules/onscreengui/src/gui_lua.inl +++ b/modules/onscreengui/src/gui_lua.inl @@ -39,7 +39,7 @@ int show(lua_State* L) { return luaL_error(L, "Expected %i arguments, got %i", 0, nArguments); } - OsEng.gui().setEnabled(true); + OnScreenGUIModule::gui.setEnabled(true); return 0; } @@ -54,7 +54,7 @@ int hide(lua_State* L) { return luaL_error(L, "Expected %i arguments, got %i", 0, nArguments); } - OsEng.gui().setEnabled(false); + OnScreenGUIModule::gui.setEnabled(false); return 0; } @@ -69,7 +69,7 @@ int toggle(lua_State* L) { return luaL_error(L, "Expected %i arguments, got %i", 0, nArguments); } - OsEng.gui().setEnabled(!OsEng.gui().isEnabled()); + OnScreenGUIModule::gui.setEnabled(!OnScreenGUIModule::gui.isEnabled()); return 0; } diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index 773b034e8c..65db037815 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -75,15 +75,6 @@ #include #include -#ifdef OPENSPACE_MODULE_ONSCREENGUI_ENABLED -#include -#endif - -#ifdef OPENSPACE_MODULE_ISWA_ENABLED -#include -#include -#endif - #if defined(_MSC_VER) && defined(OPENSPACE_ENABLE_VLD) #include #endif @@ -145,9 +136,6 @@ OpenSpaceEngine::OpenSpaceEngine(std::string programName, , _settingsEngine(new SettingsEngine) , _timeManager(new TimeManager) , _downloadManager(nullptr) -#ifdef OPENSPACE_MODULE_ONSCREENGUI_ENABLED - , _gui(new gui::GUI) -#endif , _parallelConnection(new ParallelConnection) , _windowWrapper(std::move(windowWrapper)) , _globalPropertyNamespace(new properties::PropertyOwner) @@ -189,9 +177,6 @@ OpenSpaceEngine::OpenSpaceEngine(std::string programName, OpenSpaceEngine::~OpenSpaceEngine() { LINFO("_windowWrapper->isUsingSwapGroups(): " << _windowWrapper->isUsingSwapGroups()); LINFO("_windowWrapper->isSwapGroupMaster(): " << _windowWrapper->isSwapGroupMaster()); -#ifdef OPENSPACE_MODULE_ONSCREENGUI_ENABLED - _gui->deinitializeGL(); -#endif _interactionHandler->deinitialize(); _renderEngine->deinitialize(); @@ -208,9 +193,6 @@ OpenSpaceEngine::~OpenSpaceEngine() { _console = nullptr; _moduleEngine = nullptr; _settingsEngine = nullptr; -#ifdef OPENSPACE_MODULE_ONSCREENGUI_ENABLED - _gui = nullptr; -#endif } OpenSpaceEngine& OpenSpaceEngine::ref() { @@ -400,6 +382,14 @@ bool OpenSpaceEngine::create(int argc, char** argv, } void OpenSpaceEngine::destroy() { + for (const auto& func : _engine->_moduleCallbacks.deinitializeGL) { + func(); + } + + for (const auto& func : _engine->_moduleCallbacks.deinitialize) { + func(); + } + _engine->_moduleEngine->deinitialize(); _engine->_console->deinitialize(); @@ -471,11 +461,11 @@ bool OpenSpaceEngine::initialize() { // Register Lua script functions LDEBUG("Registering Lua libraries"); registerCoreClasses(*_scriptEngine); - -#ifdef OPENSPACE_MODULE_ISWA_ENABLED - _scriptEngine->addLibrary(IswaManager::luaLibrary()); -#endif - + + for (OpenSpaceModule* module : _moduleEngine->modules()) { + _scriptEngine->addLibrary(module->luaLibrary()); + } + // TODO: Maybe move all scenegraph and renderengine stuff to initializeGL scriptEngine().initialize(); @@ -518,6 +508,10 @@ bool OpenSpaceEngine::initialize() { _renderEngine->initialize(); _renderEngine->setGlobalBlackOutFactor(0.0); _renderEngine->startFading(1, 3.0); + + for (const auto& func : _moduleCallbacks.initialize) { + func(); + } // Run start up scripts try { @@ -527,58 +521,6 @@ bool OpenSpaceEngine::initialize() { LFATALC(e.component, e.message); } -#ifdef OPENSPACE_MODULE_ONSCREENGUI_ENABLED - LINFO("Initializing GUI"); - _gui->initialize(); - _gui->_globalProperty.setSource( - [&]() { - std::vector res = { - _settingsEngine.get(), - _interactionHandler.get(), - _renderEngine.get() - }; - return res; - } - ); - - OsEng.gui()._screenSpaceProperty.setSource( - [&]() { - const auto& ssr = renderEngine().screenSpaceRenderables(); - return std::vector(ssr.begin(), ssr.end()); - } - ); - - OsEng.gui()._property.setSource( - [&]() { - const auto& nodes = renderEngine().scene()->allSceneGraphNodes(); - return std::vector(nodes.begin(), nodes.end()); - } - ); - -#ifdef OPENSPACE_MODULE_ISWA_ENABLED - OsEng.gui()._iswa.setSource( - [&]() { - const auto& groups = IswaManager::ref().groups(); - std::vector res; - std::transform( - groups.begin(), - groups.end(), - std::back_inserter(res), - [](const auto& val) { - return val.second.get(); - } - ); - return res; - } - ); -#endif - -#endif - -#ifdef OPENSPACE_MODULE_ISWA_ENABLED - IswaManager::initialize(); -#endif - _syncEngine->addSyncables(Time::ref().getSyncables()); _syncEngine->addSyncables(_renderEngine->getSyncables()); _syncEngine->addSyncable(_scriptEngine.get()); @@ -850,15 +792,11 @@ void OpenSpaceEngine::configureLogging() { bool OpenSpaceEngine::initializeGL() { LINFO("Initializing Rendering Engine"); bool success = _renderEngine->initializeGL(); -#ifdef OPENSPACE_MODULE_ONSCREENGUI_ENABLED - LINFO("Initializing OnScreen GUI GL"); - try { - _gui->initializeGL(); + + for (const auto& func : _moduleCallbacks.initializeGL) { + func(); } - catch (const ghoul::RuntimeError& e) { - LERROR(e.what()); - } -#endif + LINFO("Finished initializing OpenGL"); // If using swapgroups, @@ -867,19 +805,19 @@ bool OpenSpaceEngine::initializeGL() { return success; } -bool OpenSpaceEngine::isMaster(){ +bool OpenSpaceEngine::isMaster() { return _isMaster; } -void OpenSpaceEngine::setMaster(bool master){ +void OpenSpaceEngine::setMaster(bool master) { _isMaster = master; } -double OpenSpaceEngine::runTime(){ +double OpenSpaceEngine::runTime() { return _runTime; } -void OpenSpaceEngine::setRunTime(double d){ +void OpenSpaceEngine::setRunTime(double d) { _runTime = d; } @@ -911,6 +849,10 @@ void OpenSpaceEngine::preSynchronization() { _parallelConnection->preSynchronization(); } + + for (const auto& func : _moduleCallbacks.preSync) { + func(); + } } void OpenSpaceEngine::postSynchronizationPreDraw() { @@ -936,26 +878,10 @@ void OpenSpaceEngine::postSynchronizationPreDraw() { // Step the camera using the current mouse velocities which are synced //_interactionHandler->updateCamera(); -#ifdef OPENSPACE_MODULE_ONSCREENGUI_ENABLED - if (_isMaster && _windowWrapper->isRegularRendering()) { - glm::vec2 mousePosition = _windowWrapper->mousePosition(); - //glm::ivec2 drawBufferResolution = _windowWrapper->currentDrawBufferResolution(); - glm::ivec2 windowSize = _windowWrapper->currentWindowSize(); - glm::ivec2 renderingSize = _windowWrapper->currentWindowResolution(); - uint32_t mouseButtons = _windowWrapper->mouseButtons(2); - - double dt = std::max(_windowWrapper->averageDeltaTime(), 0.0); - - _gui->startFrame( - static_cast(dt), - glm::vec2(windowSize), - _windowWrapper->dpiScaling(), - mousePosition, - mouseButtons - ); + for (const auto& func : _moduleCallbacks.postSyncPreDraw) { + func(); } -#endif - + // Testing this every frame has minimal impact on the performance --- abock // Debug build: 1-2 us ; Release build: <= 1 us using ghoul::logging::LogManager; @@ -963,35 +889,42 @@ void OpenSpaceEngine::postSynchronizationPreDraw() { int errorCounter = LogMgr.messageCounter(LogLevel::Error); int fatalCounter = LogMgr.messageCounter(LogLevel::Fatal); - if (warningCounter > 0) + if (warningCounter > 0) { LWARNINGC("Logging", "Number of Warnings raised: " << warningCounter); - if (errorCounter > 0) + } + if (errorCounter > 0) { LWARNINGC("Logging", "Number of Errors raised: " << errorCounter); - if (fatalCounter > 0) + } + if (fatalCounter > 0) { LWARNINGC("Logging", "Number of Fatals raised: " << fatalCounter); + } LogMgr.resetMessageCounters(); - } void OpenSpaceEngine::render(const glm::mat4& projectionMatrix, const glm::mat4& viewMatrix) { LTRACE("OpenSpaceEngine::render(begin)"); _renderEngine->render(projectionMatrix, viewMatrix); + + for (const auto& func : _moduleCallbacks.render) { + func(); + } + LTRACE("OpenSpaceEngine::render(end)"); } void OpenSpaceEngine::postDraw() { _renderEngine->postDraw(); + for (const auto& func : _moduleCallbacks.postDraw) { + func(); + } + bool showGui = _windowWrapper->hasGuiWindow() ? _windowWrapper->isGuiWindow() : true; if (showGui) { _renderEngine->renderScreenLog(); if (_console->isVisible()) _console->render(); -#ifdef OPENSPACE_MODULE_ONSCREENGUI_ENABLED - if (_isMaster && _windowWrapper->isRegularRendering()) - _gui->endFrame(); -#endif } if (_isInShutdownMode) { @@ -1007,14 +940,13 @@ void OpenSpaceEngine::postDraw() { void OpenSpaceEngine::keyboardCallback(Key key, KeyModifier mod, KeyAction action) { if (_isMaster) { -#ifdef OPENSPACE_MODULE_ONSCREENGUI_ENABLED - if (_gui->isEnabled()) { - bool isConsumed = _gui->keyCallback(key, mod, action); - if (isConsumed) { + for (const auto& func : _moduleCallbacks.keyboard) { + bool consumed = func(key, mod, action); + if (consumed) { return; } } -#endif + if (key == _console->commandInputButton()) { if (action == KeyAction::Press) { _console->toggleMode(); @@ -1029,13 +961,13 @@ void OpenSpaceEngine::keyboardCallback(Key key, KeyModifier mod, KeyAction actio void OpenSpaceEngine::charCallback(unsigned int codepoint, KeyModifier modifier) { if (_isMaster) { -#ifdef OPENSPACE_MODULE_ONSCREENGUI_ENABLED - if (_gui->isEnabled()) { - const bool isConsumed = _gui->charCallback(codepoint, modifier); - if (isConsumed) + for (const auto& func : _moduleCallbacks.character) { + bool consumed = func(codepoint, modifier); + if (consumed) { return; + } } -#endif + if (_console->isVisible()) { _console->charCallback(codepoint, modifier); } @@ -1044,32 +976,36 @@ void OpenSpaceEngine::charCallback(unsigned int codepoint, KeyModifier modifier) void OpenSpaceEngine::mouseButtonCallback(MouseButton button, MouseAction action) { if (_isMaster) { -#ifdef OPENSPACE_MODULE_ONSCREENGUI_ENABLED - if (_gui->isEnabled()) { - const bool isConsumed = _gui->mouseButtonCallback(button, action); - if (isConsumed /*&& action != MouseAction::Release*/) + for (const auto& func : _moduleCallbacks.mouseButton) { + bool consumed = func(button, action); + if (consumed) { return; + } } -#endif + _interactionHandler->mouseButtonCallback(button, action); } } void OpenSpaceEngine::mousePositionCallback(double x, double y) { if (_isMaster) { + for (const auto& func : _moduleCallbacks.mousePosition) { + func(x, y); + } + _interactionHandler->mousePositionCallback(x, y); } } void OpenSpaceEngine::mouseScrollWheelCallback(double pos) { if (_isMaster) { -#ifdef OPENSPACE_MODULE_ONSCREENGUI_ENABLED - if (_gui->isEnabled()) { - const bool isConsumed = _gui->mouseWheelCallback(pos); - if (isConsumed) + for (const auto& func : _moduleCallbacks.mouseScrollWheel) { + bool consumed = func(pos); + if (consumed) { return; + } } -#endif + _interactionHandler->mouseScrollWheelCallback(pos); } } @@ -1088,8 +1024,9 @@ void OpenSpaceEngine::decode() { void OpenSpaceEngine::externalControlCallback(const char* receivedChars, int size, int clientId) { - if (size == 0) + if (size == 0) { return; + } _networkEngine->handleMessage(std::string(receivedChars, size)); } @@ -1144,6 +1081,37 @@ void OpenSpaceEngine::enableBarrier() { void OpenSpaceEngine::disableBarrier() { _windowWrapper->setBarrier(false); } + + +void OpenSpaceEngine::registerModuleKeyboardCallback( + std::function function) +{ + _moduleCallbacks.keyboard.push_back(std::move(function)); +} + +void OpenSpaceEngine::registerModuleCharCallback( + std::function function) +{ + _moduleCallbacks.character.push_back(std::move(function)); +} + +void OpenSpaceEngine::registerModuleMouseButtonCallback( + std::function function) +{ + _moduleCallbacks.mouseButton.push_back(std::move(function)); +} + +void OpenSpaceEngine::registerModuleMousePositionCallback( + std::function function) +{ + _moduleCallbacks.mousePosition.push_back(std::move(function)); +} + +void OpenSpaceEngine::registerModuleMouseScrollWheelCallback( + std::function function) +{ + _moduleCallbacks.mouseScrollWheel.push_back(std::move(function)); +} NetworkEngine& OpenSpaceEngine::networkEngine() { ghoul_assert(_networkEngine, "NetworkEngine must not be nullptr"); @@ -1185,13 +1153,6 @@ LuaConsole& OpenSpaceEngine::console() { return *_console; } -#ifdef OPENSPACE_MODULE_ONSCREENGUI_ENABLED -gui::GUI& OpenSpaceEngine::gui() { - ghoul_assert(_gui, "GUI must not be nullptr"); - return *_gui; -} -#endif - ParallelConnection& OpenSpaceEngine::parallelConnection() { ghoul_assert(_parallelConnection, "ParallelConnection must not be nullptr"); return *_parallelConnection; @@ -1224,6 +1185,10 @@ TimeManager& OpenSpaceEngine::timeManager() { ghoul_assert(_timeManager, "Download Manager must not be nullptr"); return *_timeManager; } - + +SettingsEngine& OpenSpaceEngine::settingsEngine() { + ghoul_assert(_settingsEngine, "Settings Engine must not be nullptr"); + return *_settingsEngine; +} } // namespace openspace diff --git a/src/util/openspacemodule.cpp b/src/util/openspacemodule.cpp index 9482490ba5..fd64783648 100644 --- a/src/util/openspacemodule.cpp +++ b/src/util/openspacemodule.cpp @@ -66,6 +66,10 @@ void OpenSpaceModule::deinitialize() { std::vector OpenSpaceModule::documentations() const { return {}; } + +scripting::LuaLibrary OpenSpaceModule::luaLibrary() const { + return {}; +} ghoul::systemcapabilities::OpenGLCapabilitiesComponent::Version OpenSpaceModule::requiredOpenGLVersion() const From 2ebc803cb7c89d22c72db2ca67d18609d24485c9 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Thu, 16 Feb 2017 16:54:03 -0500 Subject: [PATCH 23/96] Reduce dependency of onscreengui module in libOpenspace Add check to `check_style_guide` that reports wrong dependencies --- src/documentation/core_registration.cpp | 4 ---- src/scene/scene.cpp | 4 ---- support/coding/check_style_guide.py | 24 +++++++++++++++++++++--- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/documentation/core_registration.cpp b/src/documentation/core_registration.cpp index a3087dcda5..badcb5586f 100644 --- a/src/documentation/core_registration.cpp +++ b/src/documentation/core_registration.cpp @@ -46,10 +46,6 @@ #include #include -#ifdef OPENSPACE_MODULE_ONSCREENGUI_ENABLED -#include -#endif - namespace openspace { void registerCoreClasses(documentation::DocumentationEngine& engine) { diff --git a/src/scene/scene.cpp b/src/scene/scene.cpp index 423720a905..abaa4e18eb 100644 --- a/src/scene/scene.cpp +++ b/src/scene/scene.cpp @@ -54,10 +54,6 @@ #include #include -#ifdef OPENSPACE_MODULE_ONSCREENGUI_ENABLED -#include -#endif - #include "scene_doc.inl" #include "scene_lua.inl" diff --git a/support/coding/check_style_guide.py b/support/coding/check_style_guide.py index 502e872025..06b3b536c6 100644 --- a/support/coding/check_style_guide.py +++ b/support/coding/check_style_guide.py @@ -229,6 +229,17 @@ def check_glm_header(lines, file): else: return '' +def check_core_dependency(lines, component): + if component != "openspace_core": + return '' + + index = [i for i,s in enumerate(lines) if 'OPENSPACE_MODULE_' in s] + + if len(index) > 0: + return lines[index[0]][:-1] + else: + return '' + previousSymbols = {} def check_header_file(file, component): @@ -255,7 +266,6 @@ def check_header_file(file, component): print(file, '\t', 'Filename styling check failed', '\t', styling_filename) return - comment = check_comment(lines) if comment: print(file, '\t', 'Comment check failed', '\t', comment) @@ -278,16 +288,20 @@ def check_header_file(file, component): duplicates, symbol = check_duplicates(lines, previousSymbols) if not duplicates: - print(file, '\t', 'Duplicate include guard', symbol, 'first in', previousSymbols[symbol]) + print(file, '\t', 'Duplicate include guard', symbol, 'first in', previousSymbols[symbol]) return else: previousSymbols[symbol] = file header = check_glm_header(lines, file) if header: - print(file, '\t', 'Illegal glm header include', header) + print(file, '\t', 'Illegal glm header include', header) return + core_dependency = check_core_dependency(lines, component) + if core_dependency: + print(file, '\t' 'Wrong core dependency', core_dependency) + def check_source_file(file, component): with open(file, 'r+') as f: @@ -298,6 +312,10 @@ def check_source_file(file, component): print(file, '\t', 'Illegal glm header include', header) return + core_dependency = check_core_dependency(lines, component) + if core_dependency: + print(file, '\t' 'Wrong core dependency', core_dependency) + def check_files(positiveList, negativeList, component, check_function): From fe47845703ba8475653fd001aadb4a3989f64e5d Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Thu, 16 Feb 2017 23:13:38 +0100 Subject: [PATCH 24/96] Windows compile fix --- include/openspace/engine/openspaceengine.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/openspace/engine/openspaceengine.h b/include/openspace/engine/openspaceengine.h index e3b823f2e5..1c7ac2db50 100644 --- a/include/openspace/engine/openspaceengine.h +++ b/include/openspace/engine/openspaceengine.h @@ -30,6 +30,7 @@ #include +#include #include #include #include From 6d1f0c7029dba734039805a9a47d9a64320d2014 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Sun, 19 Feb 2017 04:12:19 +0100 Subject: [PATCH 25/96] Updated version number to 0.7.0 (prerelease-12 NAOJ) --- include/openspace/openspace.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/openspace/openspace.h b/include/openspace/openspace.h index 38568d3af3..199359475a 100644 --- a/include/openspace/openspace.h +++ b/include/openspace/openspace.h @@ -32,10 +32,10 @@ namespace openspace { std::string licenseText(); const int OPENSPACE_VERSION_MAJOR = 0; -const int OPENSPACE_VERSION_MINOR = 6; +const int OPENSPACE_VERSION_MINOR = 7; const int OPENSPACE_VERSION_PATCH = 0; -const std::string OPENSPACE_VERSION_STRING = "prerelease-11 (AGU)"; +const std::string OPENSPACE_VERSION_STRING = "prerelease-12 (NAOJ)"; } // namespace openspace From 30477f49f846c77193418f31653cb692bcdf58b2 Mon Sep 17 00:00:00 2001 From: Eric Myers Date: Sun, 19 Feb 2017 09:13:45 -0500 Subject: [PATCH 26/96] * Launcher checkbox colors are green (not so bright) or grey (not red) * Changed "Cancel" button to "Exit" --- apps/Launcher/main.cpp | 5 ++--- apps/Launcher/mainwindow.cpp | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/Launcher/main.cpp b/apps/Launcher/main.cpp index 5b17ef774d..ccf862687c 100644 --- a/apps/Launcher/main.cpp +++ b/apps/Launcher/main.cpp @@ -82,18 +82,17 @@ QCheckBox::indicator { } QCheckBox::indicator::unchecked { border: 1px solid #5A5A5A; - background: #a10000; + background: #A0A0A0; } QCheckBox::indicator:unchecked:hover { border: 1px solid #DDDDDD; } QCheckBox::indicator::checked { border: 1px solid #5A5A5A; - background: #8dc73f; + background: #5AB65A; } QCheckBox::indicator:checked:hover { border: 1px solid #DDDDDD; - background: #555555; } QGroupBox, QScrollArea { border: 0px; diff --git a/apps/Launcher/mainwindow.cpp b/apps/Launcher/mainwindow.cpp index e9b65ccbf4..d1f6012f14 100644 --- a/apps/Launcher/mainwindow.cpp +++ b/apps/Launcher/mainwindow.cpp @@ -134,7 +134,7 @@ MainWindow::MainWindow() { QBoxLayout* innerLayout = new QHBoxLayout; - QPushButton* cancelButton = new QPushButton("Cancel"); + QPushButton* cancelButton = new QPushButton("Exit"); QObject::connect( cancelButton, SIGNAL(clicked(bool)), QApplication::instance(), SLOT(quit()) From c104eeffc7f99029a640e9a825de07c9b7bcf4af Mon Sep 17 00:00:00 2001 From: Eric Myers Date: Sun, 19 Feb 2017 10:54:54 -0500 Subject: [PATCH 27/96] * When Launcher first starts only the default scene is selected. --- apps/Launcher/syncwidget.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/Launcher/syncwidget.cpp b/apps/Launcher/syncwidget.cpp index 8a41155e5c..3798c484b3 100644 --- a/apps/Launcher/syncwidget.cpp +++ b/apps/Launcher/syncwidget.cpp @@ -225,8 +225,11 @@ void SyncWidget::setSceneFiles(QMap sceneFiles) { const QString& sceneName = keys[i]; QCheckBox* checkbox = new QCheckBox(sceneName); - checkbox->setChecked(true); - + checkbox->setChecked(false); + QString defaultName = "default"; + if(QString::compare(defaultName, sceneName, Qt::CaseInsensitive)==0){ + checkbox->setChecked(true); + } _sceneLayout->addWidget(checkbox, i / nColumns, i % nColumns); } } From 1ac45a90777282032988a7619e8b64f9e38596b5 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Sun, 19 Feb 2017 15:55:18 -0500 Subject: [PATCH 28/96] Fix OsirisRex configuration file --- data/scene/osirisrex.scene | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/scene/osirisrex.scene b/data/scene/osirisrex.scene index e59ce808d3..71838f2b26 100644 --- a/data/scene/osirisrex.scene +++ b/data/scene/osirisrex.scene @@ -61,7 +61,7 @@ return { "sun", "mercury", "venus", - "lodglobes/lodearth", + "lodglobes/earth", "moon", "mars", "jupiter", From b876c3553bd6c7fe040ec8ece4aa34268bb407b0 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Sun, 19 Feb 2017 22:17:00 +0100 Subject: [PATCH 29/96] Feature/luaextensions (#232) * Add systemcapabilities bindings that make the functions of GeneralSystemCapabilitiesComponent and OpenGLSystemCapabilitiesComponent available in Lua scripts * Windows compile fix * Return OpenGL extensions as array in Lua --- include/openspace/scripting/scriptengine.h | 6 +- .../scripting/systemcapabilitiesbinding.h | 39 ++ src/CMakeLists.txt | 2 + src/documentation/core_registration.cpp | 4 + src/scripting/scriptengine.cpp | 49 ++- src/scripting/systemcapabilitiesbinding.cpp | 347 ++++++++++++++++++ 6 files changed, 419 insertions(+), 28 deletions(-) create mode 100644 include/openspace/scripting/systemcapabilitiesbinding.h create mode 100644 src/scripting/systemcapabilitiesbinding.cpp diff --git a/include/openspace/scripting/scriptengine.h b/include/openspace/scripting/scriptengine.h index 5dad097168..cc272e577f 100644 --- a/include/openspace/scripting/scriptengine.h +++ b/include/openspace/scripting/scriptengine.h @@ -29,6 +29,7 @@ #include #include +#include #include #include @@ -93,8 +94,9 @@ public: //bool shouldScriptBeSent(const std::string &library, const std::string &function); //void cacheScript(const std::string &library, const std::string &function, const std::string &script); + static std::string OpenSpaceLibraryName; + private: - bool registerLuaLibrary(lua_State* state, const LuaLibrary& library); void addLibraryFunctions(lua_State* state, const LuaLibrary& library, bool replace); @@ -103,7 +105,7 @@ private: void addBaseLibrary(); void remapPrintFunction(); - lua_State* _state = nullptr; + ghoul::lua::LuaState _state; std::set _registeredLibraries; //sync variables diff --git a/include/openspace/scripting/systemcapabilitiesbinding.h b/include/openspace/scripting/systemcapabilitiesbinding.h new file mode 100644 index 0000000000..c470140a86 --- /dev/null +++ b/include/openspace/scripting/systemcapabilitiesbinding.h @@ -0,0 +1,39 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#ifndef __OPENSPACE_CORE___SYSTEMCAPABLITIESBINDING___H__ +#define __OPENSPACE_CORE___SYSTEMCAPABLITIESBINDING___H__ + +#include + +namespace openspace { +namespace scripting { + +LuaLibrary generalSystemCapabilities(); +LuaLibrary openglSystemCapabilities(); + +} // namespace scripting +} // namespace openspace + +#endif // __OPENSPACE_CORE___SYSTEMCAPABLITIESBINDING___H__ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6522114623..9727ee0ca3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -135,6 +135,7 @@ set(OPENSPACE_SOURCE ${OPENSPACE_BASE_DIR}/src/scripting/scriptengine_lua.inl ${OPENSPACE_BASE_DIR}/src/scripting/scriptscheduler.cpp ${OPENSPACE_BASE_DIR}/src/scripting/scriptscheduler_lua.inl + ${OPENSPACE_BASE_DIR}/src/scripting/systemcapabilitiesbinding.cpp ${OPENSPACE_BASE_DIR}/src/util/blockplaneintersectiongeometry.cpp ${OPENSPACE_BASE_DIR}/src/util/boxgeometry.cpp ${OPENSPACE_BASE_DIR}/src/util/camera.cpp @@ -275,6 +276,7 @@ set(OPENSPACE_HEADER ${OPENSPACE_BASE_DIR}/include/openspace/scripting/script_helper.h ${OPENSPACE_BASE_DIR}/include/openspace/scripting/scriptengine.h ${OPENSPACE_BASE_DIR}/include/openspace/scripting/scriptscheduler.h + ${OPENSPACE_BASE_DIR}/include/openspace/scripting/systemcapabilitiesbinding.h ${OPENSPACE_BASE_DIR}/include/openspace/util/blockplaneintersectiongeometry.h ${OPENSPACE_BASE_DIR}/include/openspace/util/boxgeometry.h ${OPENSPACE_BASE_DIR}/include/openspace/util/camera.h diff --git a/src/documentation/core_registration.cpp b/src/documentation/core_registration.cpp index badcb5586f..5d4ff2436f 100644 --- a/src/documentation/core_registration.cpp +++ b/src/documentation/core_registration.cpp @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -74,6 +75,9 @@ void registerCoreClasses(scripting::ScriptEngine& engine) { engine.addLibrary(scripting::ScriptScheduler::luaLibrary()); engine.addLibrary(WindowWrapper::luaLibrary()); engine.addLibrary(MissionManager::luaLibrary()); + + engine.addLibrary(scripting::generalSystemCapabilities()); + engine.addLibrary(scripting::openglSystemCapabilities()); } } // namespace openspace diff --git a/src/scripting/scriptengine.cpp b/src/scripting/scriptengine.cpp index 64e559ab9a..72e9536eeb 100644 --- a/src/scripting/scriptengine.cpp +++ b/src/scripting/scriptengine.cpp @@ -41,12 +41,12 @@ #include "scriptengine_lua.inl" namespace { - const std::string MainTemplateFilename = "${OPENSPACE_DATA}/web/luascripting/main.hbs"; - const std::string ScriptingTemplateFilename = "${OPENSPACE_DATA}/web/luascripting/scripting.hbs"; - const std::string HandlebarsFilename = "${OPENSPACE_DATA}/web/common/handlebars-v4.0.5.js"; - const std::string JsFilename = "${OPENSPACE_DATA}/web/luascripting/script.js"; - const std::string BootstrapFilename = "${OPENSPACE_DATA}/web/common/bootstrap.min.css"; - const std::string CssFilename = "${OPENSPACE_DATA}/web/common/style.css"; + const char* MainTemplateFilename = "${OPENSPACE_DATA}/web/luascripting/main.hbs"; + const char* ScriptingTemplateFilename = "${OPENSPACE_DATA}/web/luascripting/scripting.hbs"; + const char* HandlebarsFilename = "${OPENSPACE_DATA}/web/common/handlebars-v4.0.5.js"; + const char* JsFilename = "${OPENSPACE_DATA}/web/luascripting/script.js"; + const char* BootstrapFilename = "${OPENSPACE_DATA}/web/common/bootstrap.min.css"; + const char* CssFilename = "${OPENSPACE_DATA}/web/common/style.css"; } namespace openspace { @@ -56,40 +56,35 @@ namespace scripting { namespace { const std::string _loggerCat = "ScriptEngine"; - const std::string _openspaceLibraryName = "openspace"; - const std::string _luaGlobalNamespace = "_G"; - const std::string _printFunctionName = "print"; + const char* LuaGlobalNamespace = "_G"; + const char* PrintFunctionName = "print"; //const lua_CFunction _printFunctionReplacement = luascriptfunctions::printInfo; - const int _setTableOffset = -3; // -1 (top) -1 (first argument) -1 (second argument) + const int TableOffset = -3; // -1 (top) -1 (first argument) -1 (second argument) } +std::string ScriptEngine::OpenSpaceLibraryName = "openspace"; + void ScriptEngine::initialize() { LDEBUG("Adding base library"); addBaseLibrary(); - LDEBUG("Creating new Lua state"); - _state = ghoul::lua::createNewLuaState(); LDEBUG("Initializing Lua state"); initializeLuaState(_state); LDEBUG("Remapping Print functions"); remapPrintFunction(); } -void ScriptEngine::deinitialize() { - if (_state) { - lua_close(_state); - _state = nullptr; - } -} +void ScriptEngine::deinitialize() {} void ScriptEngine::initializeLuaState(lua_State* state) { LDEBUG("Create openspace base library"); lua_newtable(state); - lua_setglobal(state, _openspaceLibraryName.c_str()); + lua_setglobal(state, OpenSpaceLibraryName.c_str()); LDEBUG("Add OpenSpace modules"); - for (const LuaLibrary& lib : _registeredLibraries) + for (const LuaLibrary& lib : _registeredLibraries) { registerLuaLibrary(state, lib); + } } void ScriptEngine::addLibrary(LuaLibrary library) { @@ -294,7 +289,7 @@ bool ScriptEngine::parseLibraryAndFunctionNames(std::string &library, std::strin */ bool ScriptEngine::isLibraryNameAllowed(lua_State* state, const std::string& name) { bool result = false; - lua_getglobal(state, _openspaceLibraryName.c_str()); + lua_getglobal(state, OpenSpaceLibraryName.c_str()); const bool hasOpenSpaceLibrary = lua_istable(state, -1); if (!hasOpenSpaceLibrary) { LFATAL("OpenSpace library was not created in initialize method"); @@ -360,7 +355,7 @@ void ScriptEngine::addLibraryFunctions(lua_State* state, const LuaLibrary& libra //ghoul::lua::logStack(_state); lua_pushcfunction(state, p.function); //ghoul::lua::logStack(_state); - lua_settable(state, _setTableOffset); + lua_settable(state, TableOffset); //ghoul::lua::logStack(_state); } } @@ -443,14 +438,15 @@ void ScriptEngine::remapPrintFunction() { } bool ScriptEngine::registerLuaLibrary(lua_State* state, const LuaLibrary& library) { - assert(state); + ghoul_assert(state, "State must not be nullptr"); + if (library.functions.empty()) { LERROR("Lua library '" << library.name << "' does not have any functions"); return false; } //ghoul::lua::logStack(_state); - lua_getglobal(state, _openspaceLibraryName.c_str()); + lua_getglobal(state, OpenSpaceLibraryName.c_str()); //ghoul::lua::logStack(_state); if (library.name.empty()) { //ghoul::lua::logStack(_state); @@ -461,8 +457,9 @@ bool ScriptEngine::registerLuaLibrary(lua_State* state, const LuaLibrary& librar } else { const bool allowed = isLibraryNameAllowed(state, library.name); - if (!allowed) + if (!allowed) { return false; + } //ghoul::lua::logStack(_state); @@ -471,7 +468,7 @@ bool ScriptEngine::registerLuaLibrary(lua_State* state, const LuaLibrary& librar lua_newtable(state); //ghoul::lua::logStack(_state); addLibraryFunctions(state, library, false); - lua_settable(state, _setTableOffset); + lua_settable(state, TableOffset); //ghoul::lua::logStack(_state); //_registeredLibraries.insert(library); diff --git a/src/scripting/systemcapabilitiesbinding.cpp b/src/scripting/systemcapabilitiesbinding.cpp new file mode 100644 index 0000000000..1c8bdb3595 --- /dev/null +++ b/src/scripting/systemcapabilitiesbinding.cpp @@ -0,0 +1,347 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#include + +#include +#include + +#include +#include +#include +#include + +#include + +using namespace ghoul::lua; +using namespace ghoul::systemcapabilities; + +namespace luascripting { +namespace general { + +int operatingSystem(lua_State* L) { + lua_pushstring(L, CpuCap.operatingSystemString().c_str()); + return 1; +} + +int fullOperatingSystem(lua_State* L) { + lua_pushstring(L, CpuCap.fullOperatingSystem().c_str()); + return 1; +} + +int installedMainMemory(lua_State* L) { + lua_pushnumber(L, CpuCap.installedMainMemory()); + return 1; +} + +int cores(lua_State* L) { + lua_pushnumber(L, CpuCap.cores()); + return 1; +} + +int cacheLineSize(lua_State* L) { + lua_pushnumber(L, CpuCap.cacheLineSize()); + return 1; +} + +int L2Associativity(lua_State* L) { + lua_pushnumber(L, CpuCap.L2Associativity()); + return 1; +} + +int cacheSize(lua_State* L) { + lua_pushnumber(L, CpuCap.cacheSize()); + return 1; +} + +int extensions(lua_State* L) { + lua_pushstring(L, CpuCap.extensions().c_str()); + return 1; + +} + +} // namespace general + +namespace opengl { + +int hasOpenGLVersion(lua_State* L) { + int nArguments = lua_gettop(L); + SCRIPT_CHECK_ARGUMENTS("hasVersion", L, 1, nArguments); + + std::vector v = ghoul::tokenizeString(luaL_checkstring(L, -1)); + if (v.size() != 2 && v.size() != 3) { + LERRORC("hasVersion", ghoul::lua::errorLocation(L) << "Malformed version string"); + return 0; + } + + for (const std::string& i : v) { + for (char c : i) { + if (!std::isdigit(c)) { + LERRORC( + "hasVersion", + ghoul::lua::errorLocation(L) << "Malformed version string" + ); + return 0; + + } + } + } + + int major = std::stoi(v[0]); + int minor = std::stoi(v[1]); + int release = v.size() == 3 ? std::stoi(v[2]) : 0; + OpenGLCapabilitiesComponent::Version version = { major, minor, release }; + + bool supported = OpenGLCap.openGLVersion() >= version; + + lua_pushboolean(L, supported); + + return 1; +} + +int openGLVersion(lua_State* L) { + lua_pushstring(L, OpenGLCap.openGLVersion().toString().c_str()); + return 1; +} + +int glslCompiler(lua_State* L) { + lua_pushstring(L, OpenGLCap.glslCompiler().c_str()); + return 1; +} + +int gpuVendor(lua_State* L) { + lua_pushstring(L, OpenGLCap.gpuVendorString().c_str()); + return 1; +} + +int extensions(lua_State* L) { + const std::vector& extensions = OpenGLCap.extensions(); + + lua_newtable(L); + + for (int i = 1; i <= extensions.size(); ++i) { + lua_pushstring(L, extensions[i].c_str()); + lua_rawseti(L, -2, i); + } + return 1; +} + +int isExtensionSupported(lua_State* L) { + int nArguments = lua_gettop(L); + SCRIPT_CHECK_ARGUMENTS("hasVersion", L, 1, nArguments); + + std::string extension = luaL_checkstring(L, -1); + + lua_pushboolean(L, OpenGLCap.isExtensionSupported(extension)); + return 1; +} + +int maxTextureUnits(lua_State* L) { + lua_pushnumber(L, OpenGLCap.maxTextureUnits()); + return 1; +} + +int max2DTextureSize(lua_State* L) { + lua_pushnumber(L, OpenGLCap.max2DTextureSize()); + return 1; +} + +int max3DTextureSize(lua_State* L) { + lua_pushnumber(L, OpenGLCap.max3DTextureSize()); + return 1; +} + +int maxAtomicCounterBufferBindings(lua_State* L) { + lua_pushnumber(L, OpenGLCap.maxAtomicCounterBufferBindings()); + return 1; +} + +int maxShaderStorageBufferBindings(lua_State* L) { + lua_pushnumber(L, OpenGLCap.maxShaderStorageBufferBindings()); + return 1; +} + +int maxUniformBufferBindings(lua_State* L) { + lua_pushnumber(L, OpenGLCap.maxUniformBufferBindings()); + return 1; +} + + +} // namespace opengl +} // namespace luascripting + +namespace openspace { +namespace scripting { + +LuaLibrary generalSystemCapabilities() { + return { + "systemCapabilities", + { + { + "operatingSystem", + &luascripting::general::operatingSystem, + "", + "Returns a parsed string of the operating system type, for example " + "Windows, Linux, MacOS, or others, together with the specific version, " + "where available." + }, + { + "fullOperatingSystem", + &luascripting::general::fullOperatingSystem, + "", + "Returns the operating system as a string. The exact format of the " + "returned string is implementation and operating system-dependent but it " + "should contain the manufacturer and the version." + }, + { + "installedMainMemory", + &luascripting::general::installedMainMemory, + "", + "Returns the amount of available, installed main memory (RAM) on the " + "system in MB." + }, + { + "cores", + &luascripting::general::cores, + "", + "Returns the number of cores." + }, + { + "cacheLineSize", + &luascripting::general::cacheLineSize, + "", + "Returns the cache line size." + }, + { + "L2Associativity", + &luascripting::general::L2Associativity, + "", + "Returns the L2 associativity." + }, + { + "cacheSize", + &luascripting::general::cacheSize, + "", + "Returns the cache size." + }, + { + "extensions", + &luascripting::general::extensions, + "", + "Returns all supported exteions as comma-separated string." + } + } + }; +} + +LuaLibrary openglSystemCapabilities() { + return { + "openglCapabilities", + { + { + "hasOpenGLVersion", + &luascripting::opengl::hasOpenGLVersion, + "string", + "Tests whether the current instance supports the passed OpenGL version. " + "The parameter has to have the form 'X.Y' or 'X.Y.Z'." + }, + { + "openGLVersion", + &luascripting::opengl::openGLVersion, + "", + "Returns the maximum OpenGL version that is supported on this platform." + }, + { + "glslCompiler", + &luascripting::opengl::glslCompiler, + "", + "Returns the value of a call to glGetString(GL_VENDOR). " + "This will give detailed information about the vendor of the main " + "graphics card. This string can be used if the automatic Vendor " + "detection failed." + }, + { + "gpuVendor", + &luascripting::opengl::gpuVendor, + "", + "Returns the vendor of the main graphics card." + }, + { + "extensions", + &luascripting::opengl::extensions, + "", + "Returns all available extensions as a list of names." + }, + { + "isExtensionSupported", + &luascripting::opengl::isExtensionSupported, + "string", + "Checks is a specific extension is supported or not." + }, + { + "maxTextureUnits", + &luascripting::opengl::maxTextureUnits, + "", + "Returns the maximum number of texture units that are available on the " + "main graphics card." + }, + { + "max2DTextureSize", + &luascripting::opengl::max2DTextureSize, + "", + "Returns the largest dimension for a 2D texture on this graphics card." + }, + { + "max3DTextureSize", + &luascripting::opengl::max3DTextureSize, + "", + "Returns the largest dimension for a 3D texture on this graphics card." + }, + { + "maxAtomicCounterBufferBindings", + &luascripting::opengl::maxAtomicCounterBufferBindings, + "", + "Returns the maximum number of atomic counter buffer bindings that are " + "available on the main graphics card." + }, + { + "maxShaderStorageBufferBindings", + &luascripting::opengl::maxShaderStorageBufferBindings, + "", + "Returns the maximum number of shader storage bindings that are " + "available on the main graphics card." + }, + { + "maxUniformBufferBindings", + &luascripting::opengl::maxUniformBufferBindings, + "", + "Returns the maximum number of uniform buffer bindings that are " + "available on the main graphics card." + } + } + }; +} + +} // namespace scripting +} // namespace openspace From d94940e6d2b0a5a8de390eee107d4dcf5e91ad72 Mon Sep 17 00:00:00 2001 From: Eric Myers Date: Sun, 19 Feb 2017 18:37:06 -0500 Subject: [PATCH 30/96] * cleaner coding to only select default checkbox for Launcher sync --- apps/Launcher/syncwidget.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/Launcher/syncwidget.cpp b/apps/Launcher/syncwidget.cpp index 3798c484b3..f0eef99760 100644 --- a/apps/Launcher/syncwidget.cpp +++ b/apps/Launcher/syncwidget.cpp @@ -225,9 +225,8 @@ void SyncWidget::setSceneFiles(QMap sceneFiles) { const QString& sceneName = keys[i]; QCheckBox* checkbox = new QCheckBox(sceneName); - checkbox->setChecked(false); QString defaultName = "default"; - if(QString::compare(defaultName, sceneName, Qt::CaseInsensitive)==0){ + if (sceneName == defaultName){ checkbox->setChecked(true); } _sceneLayout->addWidget(checkbox, i / nColumns, i % nColumns); From 965cf6bd9a21d827fd77d27f78de779b1f12c3d2 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Wed, 22 Feb 2017 15:31:59 -0500 Subject: [PATCH 31/96] Fix crash that occurs if there is an error in the SGCT configuration file --- apps/OpenSpace/main.cpp | 2 ++ include/openspace/engine/openspaceengine.h | 1 + modules/onscreengui/src/gui.cpp | 12 +++++++++--- src/engine/openspaceengine.cpp | 9 ++++----- src/engine/wrapper/sgctwindowwrapper.cpp | 1 - src/rendering/renderengine.cpp | 2 +- 6 files changed, 17 insertions(+), 10 deletions(-) diff --git a/apps/OpenSpace/main.cpp b/apps/OpenSpace/main.cpp index 0ff4b1d46d..31bdcea3ad 100644 --- a/apps/OpenSpace/main.cpp +++ b/apps/OpenSpace/main.cpp @@ -198,6 +198,8 @@ int main_main(int argc, char** argv) { _sgctEngine->render(); LDEBUG("Ending rendering loop"); + OsEng.deinitialize(); + //clear function bindings to avoid crash after destroying the OpenSpace Engine sgct::MessageHandler::instance()->setLogToCallback(false); sgct::MessageHandler::instance()->setLogCallback(nullptr); diff --git a/include/openspace/engine/openspaceengine.h b/include/openspace/engine/openspaceengine.h index 1c7ac2db50..d515aa46cc 100644 --- a/include/openspace/engine/openspaceengine.h +++ b/include/openspace/engine/openspaceengine.h @@ -98,6 +98,7 @@ public: // SGCT callbacks bool initialize(); bool initializeGL(); + void deinitialize(); void preSynchronization(); void postSynchronizationPreDraw(); void render(const glm::mat4& projectionMatrix, const glm::mat4& viewMatrix); diff --git a/modules/onscreengui/src/gui.cpp b/modules/onscreengui/src/gui.cpp index 6fa3417705..fa34ff997f 100644 --- a/modules/onscreengui/src/gui.cpp +++ b/modules/onscreengui/src/gui.cpp @@ -408,9 +408,15 @@ void GUI::deinitializeGL() { _program = nullptr; _fontTexture = nullptr; - glDeleteVertexArrays(1, &vao); - glDeleteBuffers(1, &vbo); - glDeleteBuffers(1, &vboElements); + if (vao) { + glDeleteVertexArrays(1, &vao); + } + if (vbo) { + glDeleteBuffers(1, &vbo); + } + if (vboElements) { + glDeleteBuffers(1, &vboElements); + } _iswa.deinitializeGL(); _help.deinitializeGL(); diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index 65db037815..f0f16e7ccf 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -175,11 +175,6 @@ OpenSpaceEngine::OpenSpaceEngine(std::string programName, } OpenSpaceEngine::~OpenSpaceEngine() { - LINFO("_windowWrapper->isUsingSwapGroups(): " << _windowWrapper->isUsingSwapGroups()); - LINFO("_windowWrapper->isSwapGroupMaster(): " << _windowWrapper->isSwapGroupMaster()); - _interactionHandler->deinitialize(); - _renderEngine->deinitialize(); - _globalPropertyNamespace = nullptr; _windowWrapper = nullptr; _parallelConnection = nullptr; @@ -529,6 +524,10 @@ bool OpenSpaceEngine::initialize() { return true; } +void OpenSpaceEngine::deinitialize() { + _interactionHandler->deinitialize(); + _renderEngine->deinitialize(); +} void OpenSpaceEngine::writeDocumentation() { // If a LuaDocumentationFile was specified, generate it now diff --git a/src/engine/wrapper/sgctwindowwrapper.cpp b/src/engine/wrapper/sgctwindowwrapper.cpp index c1edb1d17a..0693645023 100644 --- a/src/engine/wrapper/sgctwindowwrapper.cpp +++ b/src/engine/wrapper/sgctwindowwrapper.cpp @@ -170,7 +170,6 @@ bool SGCTWindowWrapper::isSwapGroupMaster() const { bool SGCTWindowWrapper::isUsingSwapGroups() const { return sgct::Engine::instance()->getCurrentWindowPtr()->isUsingSwapGroups(); } - glm::mat4 SGCTWindowWrapper::viewProjectionMatrix() const { return sgct::Engine::instance()->getCurrentModelViewProjectionMatrix(); diff --git a/src/rendering/renderengine.cpp b/src/rendering/renderengine.cpp index deb3e0a974..15cb24dec2 100644 --- a/src/rendering/renderengine.cpp +++ b/src/rendering/renderengine.cpp @@ -114,6 +114,7 @@ const std::vector RenderEngine::FrametimeTypes({ RenderEngine::RenderEngine() : _mainCamera(nullptr) + , _raycasterManager(nullptr) , _performanceMeasurements("performanceMeasurements", "Performance Measurements") , _frametimeType( "frametimeType", @@ -172,7 +173,6 @@ RenderEngine::~RenderEngine() { delete _mainCamera; delete _raycasterManager; - } bool RenderEngine::deinitialize() { From 85c3de9152789542b00bb96f38f7fe0737c7817b Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Wed, 22 Feb 2017 15:35:55 -0500 Subject: [PATCH 32/96] Feature/modular sgct config (#239) * Initial work to create SGCT configuration files from Lua * More work on modularizing the SGCT configs - Removing almost all pregenerated config files - Working functions to create configurations with single and fisheye rendering viewports * Some more work on modular SGCT configurations - Make more objects configurable - Add documentation - Make use of new `sgct.config.single` and `sgct.config.fisheye` functions * Fix accidental commit * Enable single configuration as default * Do not remove single_fisheye.xml for inspiration * Update single_fisheye.xml * Update configuration_helper.lua * Place multiview and multinode configuration files back --- apps/OpenSpace/main.cpp | 5 +- config/sgct/VRArenaSimCenter.xml | 82 ---- config/sgct/ccmc_lab_all.xml | 65 --- config/sgct/ccmc_lab_work.xml | 47 -- config/sgct/single.xml | 2 +- config/sgct/single_4k.xml | 25 -- config/sgct/single_sbs_stereo.xml | 21 - config/sgct/single_stereo.xml | 25 -- config/sgct/single_two_win.xml | 28 +- config/sgct/two_nodes.xml | 29 +- openspace.cfg | 19 +- scripts/configuration_helper.lua | 667 ++++++++++++++++++++++++++++ src/engine/configurationmanager.cpp | 10 +- 13 files changed, 714 insertions(+), 311 deletions(-) delete mode 100644 config/sgct/VRArenaSimCenter.xml delete mode 100644 config/sgct/ccmc_lab_all.xml delete mode 100644 config/sgct/ccmc_lab_work.xml delete mode 100644 config/sgct/single_4k.xml delete mode 100644 config/sgct/single_sbs_stereo.xml delete mode 100644 config/sgct/single_stereo.xml create mode 100644 scripts/configuration_helper.lua diff --git a/apps/OpenSpace/main.cpp b/apps/OpenSpace/main.cpp index 31bdcea3ad..1b9ea2ad42 100644 --- a/apps/OpenSpace/main.cpp +++ b/apps/OpenSpace/main.cpp @@ -108,7 +108,7 @@ int main(int argc, char** argv) { int main_main(int argc, char** argv) { auto glVersion = supportedOpenGLVersion(); - + // create the OpenSpace engine and get arguments for the sgct engine std::vector sgctArguments; const bool success = openspace::OpenSpaceEngine::create( @@ -116,8 +116,9 @@ int main_main(int argc, char** argv) { std::make_unique(), sgctArguments ); - if (!success) + if (!success) { return EXIT_FAILURE; + } LINFO("Detected OpenGL version: " << glVersion.first << "." << glVersion.second); diff --git a/config/sgct/VRArenaSimCenter.xml b/config/sgct/VRArenaSimCenter.xml deleted file mode 100644 index f57ec51789..0000000000 --- a/config/sgct/VRArenaSimCenter.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/config/sgct/ccmc_lab_all.xml b/config/sgct/ccmc_lab_all.xml deleted file mode 100644 index 9c2fcd4958..0000000000 --- a/config/sgct/ccmc_lab_all.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/config/sgct/ccmc_lab_work.xml b/config/sgct/ccmc_lab_work.xml deleted file mode 100644 index 0c9f4069b6..0000000000 --- a/config/sgct/ccmc_lab_work.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/config/sgct/single.xml b/config/sgct/single.xml index 7b20bcb10c..6f8f58b23b 100644 --- a/config/sgct/single.xml +++ b/config/sgct/single.xml @@ -4,7 +4,7 @@ - + diff --git a/config/sgct/single_4k.xml b/config/sgct/single_4k.xml deleted file mode 100644 index cb4dd6339c..0000000000 --- a/config/sgct/single_4k.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/config/sgct/single_sbs_stereo.xml b/config/sgct/single_sbs_stereo.xml deleted file mode 100644 index d92f95ed66..0000000000 --- a/config/sgct/single_sbs_stereo.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/config/sgct/single_stereo.xml b/config/sgct/single_stereo.xml deleted file mode 100644 index 8497af6188..0000000000 --- a/config/sgct/single_stereo.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/config/sgct/single_two_win.xml b/config/sgct/single_two_win.xml index 4cd802423a..2f7f49efc6 100644 --- a/config/sgct/single_two_win.xml +++ b/config/sgct/single_two_win.xml @@ -3,34 +3,26 @@ - + - - - - - - - - + + + + - + - - - - - - - - + + + + diff --git a/config/sgct/two_nodes.xml b/config/sgct/two_nodes.xml index 9ec00bf7bc..bbcd4a63e5 100644 --- a/config/sgct/two_nodes.xml +++ b/config/sgct/two_nodes.xml @@ -4,18 +4,13 @@ - - + - - - - - - - - + + + + @@ -23,18 +18,14 @@ - + - - - - - - - - + + + + diff --git a/openspace.cfg b/openspace.cfg index 5233af0293..754c5357ff 100644 --- a/openspace.cfg +++ b/openspace.cfg @@ -1,9 +1,19 @@ +-- The configuration has an implict +-- require('scripts/configuration_helper.lua') +-- which defines helper functions useful to customize the configuration + return { -- Determines which SGCT configuration file is loaded, that is, if there rendering -- occurs in a single window, a fisheye projection, or a dome cluster system - SGCTConfig = "${SGCT}/single.xml", - --SGCTConfig = "${SGCT}/single_fisheye.xml", - --SGCTConfig = "${SGCT}/two_nodes.xml", + -- A regular 1280x720 window + SGCTConfig = sgct.config.single{}, + + -- A regular 1920x1080 window + -- SGCTConfig = sgct.config.single{1920, 1080}, + + -- A 4k fisheye rendering in a 1024x1024 window + -- SGCTConfig = sgct.config.fisheye{1024, 1024, res={4096, 4096}, quality="2k", tilt=27}, + -- Sets the scene that is to be loaded by OpenSpace. A scene file is a description -- of all entities that will be visible during an instance of OpenSpace @@ -36,7 +46,7 @@ return { Logging = { -- LogLevel = "Trace", LogLevel = "Debug", - ImmediateFlush = false, + ImmediateFlush = true, Logs = { { Type = "html", File = "${BASE_PATH}/log.html", Append = false } }, @@ -72,5 +82,4 @@ return { DownloadRequestURL = "http://data.openspaceproject.com/request.cgi", RenderingMethod = "Framebuffer" --RenderingMethod = "ABuffer" -- alternative: "Framebuffer" - } \ No newline at end of file diff --git a/scripts/configuration_helper.lua b/scripts/configuration_helper.lua new file mode 100644 index 0000000000..8ce25c0330 --- /dev/null +++ b/scripts/configuration_helper.lua @@ -0,0 +1,667 @@ +-- Helper functions that are useful to customize the openspace.cfg loading + +--[[ +########################################################################################## + Public functions +########################################################################################## +]]-- + +-- SGCT related functions +sgct = {} +sgct.config = {} + +-- This function takes a text definition for an SGCT configuration file and returns the path +-- to a temporary file containing the string which SGCT can use +function sgct.makeConfig(config) end + +-- Creates a configuration file similar to the default 'single.xml': +-- The parameter is a table and can contain the follow attributes: + +-- first argument: horizontal window size {default: 1280} +-- second argument: vertical window size {default: 720} +-- res: A table containing the horizontal and vertical resolution [example: res={3840, 2160}] +-- windowPos: The position of the window on the screen [example: windowPos={50, 100}] {default: {50, 50}} +-- fullScreen: Whether the application should run in exclusive full screen [example: fullScreen=true] {default: false} +-- border: Whether the application should have window decorations (aka. border) [example: border=false] {default: true} +-- monitor: Determines the monitor on which the application is started [example: monitor=2] {default: 0} + +-- Expert settings: +-- name: The name of the window [example: window="Foobar"] {defualt: "OpenSpace"} +-- vsync: Whether the rendering speed is locked to the refreshrate [example: vsync=true] {default: false} +-- refreshRate: If vsync is enabled, this is the target framerate [example: refreshRate=30] {default: infinity} +-- stereo: Select the stereo rendering mode as supported by SGCT [example: stereo='anaglyph_red_cyan'] {default: 'none'} +-- msaa: The multisampling anti-aliasing factor [example: msaa=4] {default: 8} +-- eyeSep: The base eye separation in m [example: eyeSep=0.1] {default: 0.065} +-- eyePos: The location of the user [example: eyePos={0.0, 1.0, 0.0}] {default: {0.0, 0.0, 0.0}} +-- scene: Global settings to all scene objects (offset, orientation, scaling; each optional) +-- [example: scene = {offset = {x = 1.0, y = 1.0, z = 2.0}, orientation = { yaw = 120, pitch = 15, roll = 0.0 }, scale = 10.0}] +-- capture: Settings to configure the image capture [example: capture = { path = "./images"] +-- sgctDebug: Determines whether a higher debug level in SGCT is enabled [example: sgctDebug=true] {default: false} +-- fov: The field of view settings [example: fov={ left=20, right=30, up=10, down=50}] {default: { left=30.0, right=30.0, up=16.875, down=16.875}} + +-- Thus this function can be called the following ways: +-- sgct.config.single() -> Leading to a 1280x720 resolution window +-- sgct.config.single(1920, 1080) -> Leading to a 1920x1080 resolution window +-- sgct.config.single(640, 360, res={3840, 2160}) -> 640x360 window with 4K rendering resolution +-- sgct.config.single(msaa=1) -> 1280x720 resolution without multisampling +function sgct.config.single(arg) end + +-- Creates a configuration file similar to the default 'single_fisheye.xml' +-- The parameter is a table and can contain the follow attributes: + +-- first argument: horizontal window size {default: 1280} +-- second argument: vertical window size {default: 720} +-- res: A table containing the horizontal and vertical resolution [example: res={3840, 2160}] +-- windowPos: The position of the window on the screen [example: windowPos={50, 100}] {default: {50, 50}} +-- fullScreen: Whether the application should run in exclusive full screen [example: fullScreen=true] {default: false} +-- border: Whether the application should have window decorations (aka. border) [example: border=false] {default: true} +-- monitor: Determines the monitor on which the application is started [example: monitor=2] {default: 0} + +-- Expert settings: +-- name: The name of the window [example: window="Foobar"] {defualt: "OpenSpace"} +-- vsync: Whether the rendering speed is locked to the refreshrate [example: vsync=true] {default: false} +-- refreshRate: If vsync is enabled, this is the target framerate [example: refreshRate=30] {default: infinity} +-- stereo: Select the stereo rendering mode as supported by SGCT [example: stereo='anaglyph_red_cyan'] {default: 'none'} +-- msaa: The multisampling anti-aliasing factor [example: msaa=4] {default: 8} +-- eyeSep: The base eye separation in m [example: eyeSep=0.1] {default: 0.065} +-- eyePos: The location of the user [example: eyePos={0.0, 1.0, 0.0}] {default: {0.0, 0.0, 0.0}} +-- scene: Global settings to all scene objects (offset, orientation, scaling; each optional) +-- [example: scene = {offset = {x = 1.0, y = 1.0, z = 2.0}, orientation = { yaw = 120, pitch = 15, roll = 0.0 }, scale = 10.0}] +-- capture: Settings to configure the image capture [example: capture = { path = "./images"] +-- sgctDebug: Determines whether a higher debug level in SGCT is enabled [example: sgctDebug=true] {default: false} +-- fov: The field of view for the fisheye [example: fov=360] {default: 180} +-- quality: The quality setting for the cubemap textures [example: quality="4k"] {default: "1k"} +-- tilt: The forwards tilt of the fisheye, relative to the center [example: tilt=90] {default: 0.0} +-- background: The background color used outside of the fisheye rendering [example: backgruound={r=1.0, g=0.25, b=0.25, a=1.0}] {default: {r=0.1, g=0.1, b=0.1, a=1.0}} + +-- Thus this function can be called the following ways: +-- sgct.config.fisheye() -> Leading to a 1280x720 resolution window +-- sgct.config.fisheye(640, 640) -> Leading to a 640x650 resolution window +-- sgct.config.fisheye(640, 360, res={3840, 3840}) -> 640x360 window with 4K rendering resolution +-- sgct.config.fisheye(msaa=1) -> 1280x720 resolution without multisampling +function sgct.config.fisheye(arg) end + +--[[ +########################################################################################## + Internal helper functions +########################################################################################## +]]-- + +function generateSingleViewport(down, up, left, right) + return +[[ + + + + + + + + +]] +end + + + +function generateFisheyeViewport(fov, quality, tilt, background, crop, offset) + local b = [[ + +]] + + local c = "" + if crop then + c = [[ + +]] + end + + local o = "" + if offset then + o = [[ + +]] + end + + return [[ + + + + +]]..b..[[ +]]..c..[[ +]]..o..[[ + + +]] +end + + + +function generateWindow(arg) + local resolution = "" + if arg["res"] then + arg["res"][1] = arg["res"][1] or arg["windowSize"][1] + arg["res"][2] = arg["res"][2] or arg["windowSize"][2] + + resolution = +[[ + +]] + end + + return +[[ + + + + +]]..resolution.. +[[ +]].. +arg["viewport"].. +[[ + +]] +end + + + +function generateUser(arg) + return [[ + + + +]] +end + + + +function generateScene(arg) + local scene = arg["scene"] + + if scene == nil then + return "" + else + local offset = "" + if scene["offset"] then + local o = scene["offset"] + offset = [[]] + end + + local orientation = "" + if scene["orientation"] then + local o = scene["orientation"] + orientation = [[]] + end + + local scale = "" + if scene["scale"] then + scale = [[]] + end + + return [[ + + ]]..offset..[[ + ]]..orientation..[[ + ]]..scale..[[ + + + +]] +end + + + +function generateCapture(arg) + if arg["capture"] == nil then + return "" + else + local path = "" + if arg["capture"]["path"] then + path = 'path="' .. arg["capture"]["path"] .. '" ' + end + + local monoPath = "" + if arg["capture"]["monoPath"] then + path = 'monoPath="' .. arg["capture"]["monoPath"] .. '" ' + end + + local leftPath = "" + if arg["capture"]["leftPath"] then + path = 'leftPath="' .. arg["capture"]["leftPath"] .. '" ' + end + + local rightPath = "" + if arg["capture"]["rightPath"] then + path = 'rightPath="' .. arg["capture"]["rightPath"] .. '" ' + end + + local format = "" + if arg["capture"]["format"] then + path = 'format="' .. arg["capture"]["format"] .. '" ' + end + end +end + + + +function generateCluster(arg) + return [[ + + +]]..arg["settings"]..[[ +]]..arg["scene"]..[[ + +]].. arg["window"] ..[[ + +]] .. arg["user"] .. [[ +]] .. arg["capture"] .. [[ + +]] +end + + + +function generateSingleWindowConfig(arg) + -- First some type checking + assert( + type(arg[1]) == "number" or type(arg[1]) == "nil", + "First argument must be a number or nil" + ) + assert( + type(arg[2]) == "number" or type(arg[2]) == "nil", + "Second argument must be a number or nil" + ) + + assert( + type(arg["res"]) == "table" or type(arg["res"]) == "nil", + "res must be a table or nil" + ) + if (type(arg["res"]) == "table") then + assert(type(arg["res"][1]) == "number", "res[1] must be a number") + assert(type(arg["res"][2]) == "number", "res[2] must be a number") + end + + assert( + type(arg["windowSize"]) == "table" or type(arg["windowSize"]) == "nil", + "windowSize must be a table or nil" + ) + if (type(arg["windowSize"]) == "table") then + assert(type(arg["windowSize"][1]) == "number", "windowPos[1] must be a number") + assert(type(arg["windowSize"][2]) == "number", "windowPos[2] must be a number") + assert( + type(arg[1]) == "nil" and type(arg[2]) == "nil", + "Only windowSize or the first and second arguments can be set. Not both" + ) + end + + assert( + type(arg["windowPos"]) == "table" or type(arg["windowPos"]) == "nil", + "windowPos must be a table or nil" + ) + if (type(arg["windowPos"]) == "table") then + assert(type(arg["windowPos"][1]) == "number", "windowPos[1] must be a number") + assert(type(arg["windowPos"][2]) == "number", "windowPos[2] must be a number") + end + + assert( + type(arg["name"]) == "string" or type(arg["name"]) == "nil", + "name must be a string or nil" + ) + + assert( + type(arg["fullScreen"]) == "boolean" or type(arg["fullScreen"]) == "nil", + "fullScreen must be a boolean or nil" + ) + + assert( + type(arg["monitor"]) == "number" or type(arg["monitor"]) == "nil", + "monitor must be a number or nil" + ) + + assert( + type(arg["border"]) == "boolean" or type(arg["border"]) == "nil", + "border must be a boolean or nil" + ) + + assert( + type(arg["msaa"]) == "number" or type(arg["msaa"]) == "nil", + "msaa must be a number or nil" + ) + + assert( + type(arg["vsync"]) == "boolean" or type(arg["vsync"]) == "nil", + "vsync must be a boolean or nil" + ) + + assert( + type(arg["refreshRate"]) == "number" or type(arg["refreshRate"]) == "nil", + "refreshRate must be a number or nil" + ) + + assert( + type(arg["stereo"]) == "string" or type(arg["stereo"]) == "nil", + "stereo must be a boolean or nil" + ) + + assert( + type(arg["eyeSep"]) == "number" or type(arg["eyeSep"]) == "nil", + "eyeSep must be a number or nil" + ) + + assert( + type(arg["eyePos"]) == "table" or type(arg["eyePos"]) == "nil", + "eyePos must be a table or nil" + ) + if (type(arg["eyePos"]) == "table") then + assert(type(arg["eyePos"][1]) == "number", "eyePos[1] must be a number") + assert(type(arg["eyePos"][2]) == "number", "eyePos[2] must be a number") + assert(type(arg["eyePos"][3]) == "number", "eyePos[3] must be a number") + end + + assert( + type(arg["sgctDebug"]) == "boolean" or type(arg["sgctDebug"]) == "nil", + "sgctDebug must be a boolean or nil" + ) + + assert( + type(arg["scene"]) == "table" or type(arg["scene"]) == "nil", + "scene must be a table or nil" + ) + if type(arg["scene"]) == "table" then + local offset = arg["scene"]["offset"] + assert( + type(offset) == "table" or type(offset) == "nil", + "scene['offset'] must be a table or nil" + ) + if type(offset) == "table" then + assert(type(offset["x"]) == "number", "scene['offset']['x'] must be a number") + assert(type(offset["y"]) == "number", "scene['offset']['y'] must be a number") + assert(type(offset["z"]) == "number", "scene['offset']['z'] must be a number") + end + + local orientation = arg["scene"]["orientation"] + assert( + type(orientation) == "table" or type(orientation) == "nil", + "scene['orientation] must be a table or nil" + ) + if type(orientation) == "table" then + assert(type(orientation["yaw"]) == "number", "orientation['yaw'] must be a number") + assert(type(orientation["pitch"]) == "number", "orientation['pitch'] must be a number") + assert(type(orientation["roll"]) == "number", "orientation['roll'] must be a number") + end + + local scale = arg["scene"]["scale"] + assert( + type(scale) == "number" or type(scale) == "nil", + "scene['scale'] must be a number or nil" + ) + end + + assert( + type(arg["capture"]) == "table" or type(arg["capture"]) == "nil", + "capture must be a table or nil" + ) + if type(arg["capture"]) == "table" then + local c = arg["capture"] + assert( + type(c["path"]) == "string" or type(c["path"]) == "nil", + "capture['path'] must be a string or nil" + ) + assert( + type(c["monoPath"]) == "string" or type(c["monoPath"]) == "nil", + "capture['monoPath'] must be a string or nil" + ) + assert( + type(c["leftPath"]) == "string" or type(c["leftPath"]) == "nil", + "capture['leftPath'] must be a string or nil" + ) + assert( + type(c["rightPath"]) == "string" or type(c["rightPath"]) == "nil", + "capture['rightPath'] must be a string or nil" + ) + assert( + type(c["format"]) == "string" or type(c["format"]) == "nil", + "capture['format'] must be a string or nil" + ) + end + + assert(type(arg["viewport"]) == "string", "viewport must be a string") + + -- Then setting reasonable default values + if arg["vsync"] == nil then + arg["vsync"] = false + end + + if arg["fullScreen"] == nil then + arg["fullScreen"] = false + end + + if arg["monitor"] == nil then + arg["monitor"] = 0 + end + + if arg["msaa"] == nil then + arg["msaa"] = 8 + end + + if arg["border"] == nil then + arg["border"] = true + end + + if arg["name"] == nil then + arg["name"] = "OpenSpace" + end + + if arg["stereo"] == nil then + arg["stereo"] = "none" + end + + if arg["windowPos"] == nil then + arg["windowPos"] = { 50, 50 } + end + + if arg["eyeSep"] == nil then + arg["eyeSep"] = 0.065 + end + + if arg["eyePos"] == nil then + arg["eyePos"] = { 0.0, 0.0, 0.0 } + end + + if arg["sgctDebug"] == nil then + arg["sgctDebug"] = false + end + + if not arg["windowSize"] then + arg["windowSize"] = {} + arg["windowSize"][1] = arg[1] or 1280 + arg["windowSize"][2] = arg[2] or 720 + end + + arg["scene"] = generateScene(arg) + arg["settings"] = generateSettings(arg) + arg["window"] = generateWindow(arg) + arg["user"] = generateUser(arg) + arg["capture"] = generateCapture(arg) + + return generateCluster(arg) +end + + + +function sgct.makeConfig(config) + local configFile = os.tmpname() + + local file = io.open(configFile, "w+") + + file:write(config) + + io.close(file) + return configFile +end + + + +function sgct.config.single(arg) + arg = arg or {} + + assert( + type(arg["fov"]) == "table" or type(arg["fov"]) == "nil", + "fov must be a table or nil" + ) + if (type(arg["fov"]) == "table") then + assert(type(arg["fov"]["left"]) == "number", "fov['left'] must be a number") + assert(type(arg["fov"]["right"]) == "number", "fov['right'] must be a number") + assert(type(arg["fov"]["up"]) == "number", "fov['up'] must be a number") + assert(type(arg["fov"]["down"]) == "number", "fov['down'] must be a number") + end + + arg["fov"] = arg["fov"] or { down = 16.875, up = 16.875, left = 30.0, right = 30.0 } + arg["viewport"] = generateSingleViewport( + arg["fov"]["down"], + arg["fov"]["up"], + arg["fov"]["left"], + arg["fov"]["right"] + ) + + return sgct.makeConfig(generateSingleWindowConfig(arg)) +end + + + +function sgct.config.fisheye(arg) + arg = arg or {} + + assert( + type(arg["fov"]) == "number" or type(arg["fov"]) == "nil", + "fov must be a number or nil" + ) + + assert( + type(arg["quality"]) == "string" or type(arg["quality"]) == "nil", + "quality must be a string or nil" + ) + + assert( + type(arg["tilt"]) == "number" or type(arg["tilt"]) == "nil", + "tilt must be a number or nil" + ) + + assert( + type(arg["background"]) == "table" or type(arg["background"]) == "nil", + "background must be a table or nil" + ) + if type(arg["background"]) == "table" then + assert(type(background["r"]) == "number", "backgroud['r'] must be a number") + assert(type(background["g"]) == "number", "backgroud['g'] must be a number") + assert(type(background["b"]) == "number", "backgroud['b'] must be a number") + assert(type(background["a"]) == "number", "backgroud['a'] must be a number") + end + + assert( + type(arg["crop"]) == "table" or type(arg["crop"]) == "nil", + "crop must be a table or nil" + ) + if type(arg["crop"]) == "table" then + assert( + type(arg["crop"]["left"]) == "number", "crop['left'] must be a number" + ) + assert( + type(arg["crop"]["right"]) == "number", "crop['right'] must be a number" + ) + assert( + type(arg["crop"]["top"]) == "number", "crop['top'] must be a number" + ) + assert( + type(arg["crop"]["bottom"]) == "number", "crop['bottom'] must be a number" + ) + end + + assert( + type(arg["offset"]) == "table" or type(arg["offset"]) == "nil", + "offset must be a table or nil" + ) + if type(arg["offset"]) == "table" then + assert(type(arg["offset"]["x"]) == "number", "offset['x'] must be a number") + assert(type(arg["offset"]["y"]) == "number", "offset['y'] must be a number") + assert(type(arg["offset"]["z"]) == "number", "offset['z'] must be a number") + end + + if arg["fov"] == nil then + arg["fov"] = 180 + end + + if arg["quality"] == nil then + arg["quality"] = "1k" + end + + if arg["tilt"] == nil then + arg["tilt"] = 0 + end + + if arg["background"] == nil then + arg["background"] = { r = 0.1, g = 0.1, b = 0.1, a = 1.0 } + end + + arg["viewport"] = generateFisheyeViewport( + arg["fov"], + arg["quality"], + arg["tilt"], + arg["background"], + arg["crop"], + arg["offset"] + ) + + return sgct.makeConfig(generateSingleWindowConfig(arg)) +end diff --git a/src/engine/configurationmanager.cpp b/src/engine/configurationmanager.cpp index ccd98c0a69..a73f961c23 100644 --- a/src/engine/configurationmanager.cpp +++ b/src/engine/configurationmanager.cpp @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -38,6 +39,7 @@ using std::string; namespace { const string _configurationFile = "openspace.cfg"; const string _keyBasePath = "BASE_PATH"; + const string _initialConfigHelper = "${BASE_PATH}/scripts/configuration_helper.lua"; } namespace openspace { @@ -126,9 +128,15 @@ void ConfigurationManager::loadFromFile(const string& filename) { string absolutePath = FileSys.absolutePath(filename); string basePath = ghoul::filesystem::File(absolutePath).directoryName(); FileSys.registerPathToken(basePathToken, basePath); + + ghoul::lua::LuaState state; + + if (FileSys.fileExists(absPath(_initialConfigHelper))) { + ghoul::lua::runScriptFile(state, absPath(_initialConfigHelper)); + } // Loading the configuration file into ourselves - ghoul::lua::loadDictionaryFromFile(filename, *this); + ghoul::lua::loadDictionaryFromFile(filename, *this, state); // Perform testing against the documentation/specification openspace::documentation::testSpecificationAndThrow( From 8665cbe957f36cc968b409588cacd040c40c02d2 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Wed, 22 Feb 2017 15:53:59 -0500 Subject: [PATCH 33/96] Update the Juno trajectory to the new format --- data/scene/missions/juno/juno/juno.mod | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/data/scene/missions/juno/juno/juno.mod b/data/scene/missions/juno/juno/juno.mod index 12c2d45131..c9e4cc56df 100644 --- a/data/scene/missions/juno/juno/juno.mod +++ b/data/scene/missions/juno/juno/juno.mod @@ -126,19 +126,16 @@ return { Name = "JunoTrail", Parent = "JupiterBarycenter", Renderable = { - Type = "RenderableTrail", - Body = "JUNO", - Frame = "GALACTIC", - Observer = "JUPITER BARYCENTER", - RGB = { 0.70,0.50,0.20 }, - TropicalOrbitPeriod = 394250.0, - EarthOrbitRatio = 4.5, - DayLength = 9.9259, - TimeStamps = false, - Textures = { - Type = "simple", - Color = "textures/glare_blue.png", - }, + Type = "RenderableTrailTrajectory", + Translation = { + Type = "SpiceTranslation", + Body = "JUNO", + Observer = "JUPITER BARYCENTER" + }, + Color = { 0.70, 0.50, 0.20 }, + StartTime = "2016 JUN 28", + EndTime = "2016 APR 01", + SampleInterval = 3600 }, }, } From 5db26ad44b4d1af61bddee0570b26b7140cec64f Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Fri, 24 Feb 2017 17:08:50 +0100 Subject: [PATCH 34/96] Windows compile fix when compiling without WMI support --- src/engine/openspaceengine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index f0f16e7ccf..39bd6de7c4 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -80,7 +80,7 @@ #endif #ifdef WIN32 -#include +#include #endif #include "openspaceengine_lua.inl" From 87f5654bf8c5ceb1d5619183e7dd14e3c45744c4 Mon Sep 17 00:00:00 2001 From: eriksunden Date: Sat, 25 Feb 2017 02:41:40 +0100 Subject: [PATCH 35/96] Feature/openvr (#180) * Updated SGCT to latest commit, to include OpenVR convenience functions. * Made OpenSpace application support OpenVR. Check CMake option "OPENSPACE_OPENVR_SUPPORT" to enable this functionality. * Merged latest SGCT to remove ogl_header dependency in SGCTOpenVR header * Merged latest SGCT with minor Mac gl/glew include fix for including SGCTOpenVR as it relies on inclusion of gl headers. * CMake fix in OpenSpace app for resetting variables after unchecking OPENVR_SUPPORT. * Created separate SGCT config files for Oculus Rift and HTC Vive HMD * Update Ghoul to enable experimental GLM features * Update SGCT repository * Updated to latest SGCT version for latest fixes. --- apps/OpenSpace/CMakeLists.txt | 42 ++++++++++++++++++++++-- apps/OpenSpace/main.cpp | 49 ++++++++++++++++++++++++++++ config/sgct/openvr_htcVive.xml | 23 +++++++++++++ config/sgct/openvr_oculusRiftCv1.xml | 23 +++++++++++++ ext/ghoul | 2 +- ext/sgct | 2 +- openspace.cfg | 5 ++- 7 files changed, 140 insertions(+), 6 deletions(-) create mode 100644 config/sgct/openvr_htcVive.xml create mode 100644 config/sgct/openvr_oculusRiftCv1.xml diff --git a/apps/OpenSpace/CMakeLists.txt b/apps/OpenSpace/CMakeLists.txt index 45f08811fe..f4df34ab38 100644 --- a/apps/OpenSpace/CMakeLists.txt +++ b/apps/OpenSpace/CMakeLists.txt @@ -29,15 +29,51 @@ if (WIN32) set(RESOURCE_FILE ${OPENSPACE_APPS_DIR}/OpenSpace/openspace.rc) endif () +##OpenVR section start#################### +option(OPENSPACE_OPENVR_SUPPORT "Build OpenSpace application with OpenVR support" OFF) + +if(OPENSPACE_OPENVR_SUPPORT) + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${OPENSPACE_EXT_DIR}/sgct/cmake/modules/") + + find_package(OpenVR REQUIRED) + + set(SGCT_OPENVR_DEFINITIONS OPENVR_SUPPORT) + + 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() + 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() + else() + 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#################### + add_executable(${APPLICATION_NAME} + ${SGCT_OPENVR_FILES} ${OPENSPACE_APPS_DIR}/OpenSpace/main.cpp ${RESOURCE_FILE} ) -target_include_directories(${APPLICATION_NAME} PUBLIC ${OPENSPACE_BASE_DIR}/include) -target_link_libraries(${APPLICATION_NAME} libOpenSpace) +target_include_directories(${APPLICATION_NAME} PUBLIC ${OPENSPACE_BASE_DIR}/include ${OPENVR_INCLUDE_DIRS} ${SGCT_OPENVR_INCLUDE_DIRECTORY}) +target_link_libraries(${APPLICATION_NAME} libOpenSpace ${OPENVR_LIBRARY}) +target_compile_definitions(${APPLICATION_NAME} PUBLIC ${SGCT_OPENVR_DEFINITIONS}) if (MSVC) set_target_properties(${APPLICATION_NAME} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:LIBCMTD.lib /NODEFAULTLIB:LIBCMT.lib" ) -endif () +endif() diff --git a/apps/OpenSpace/main.cpp b/apps/OpenSpace/main.cpp index 1b9ea2ad42..162a034de2 100644 --- a/apps/OpenSpace/main.cpp +++ b/apps/OpenSpace/main.cpp @@ -33,6 +33,11 @@ #include #include +#ifdef OPENVR_SUPPORT +#include +sgct::SGCTWindow* FirstOpenVRWindow = nullptr; +#endif + sgct::Engine* _sgctEngine; int main_main(int argc, char** argv); @@ -212,6 +217,11 @@ int main_main(int argc, char** argv) { LDEBUG("Destroying SGCT Engine"); delete _sgctEngine; +#ifdef OPENVR_SUPPORT + // Clean up OpenVR + sgct::SGCTOpenVR::shutdown(); +#endif + // Exit program exit(EXIT_SUCCESS); } @@ -234,6 +244,21 @@ void mainInitFunc() { LogMgr.flushLogs(); exit(EXIT_FAILURE); } + +#ifdef OPENVR_SUPPORT + //Find if we have at least one OpenVR window + //Save reference to first OpenVR window, which is the one we will copy to the HMD. + for (size_t i = 0; i < _sgctEngine->getNumberOfWindows(); i++) { + if (_sgctEngine->getWindowPtr(i)->checkIfTagExists("OpenVR")) { + FirstOpenVRWindow = _sgctEngine->getWindowPtr(i); + break; + } + } + //If we have an OpenVRWindow, initialize OpenVR. + if (FirstOpenVRWindow) { + sgct::SGCTOpenVR::initialize(_sgctEngine->getNearClippingPlane(), _sgctEngine->getFarClippingPlane()); + } +#endif // Set the clear color for all non-linear projection viewports size_t nWindows = _sgctEngine->getNumberOfWindows(); @@ -267,6 +292,14 @@ void mainPostSyncPreDrawFunc() { // } LTRACE("main::postSynchronizationPreDraw(begin)"); OsEng.postSynchronizationPreDraw(); + +#ifdef OPENVR_SUPPORT + if (FirstOpenVRWindow) { + //Update pose matrices for all tracked OpenVR devices once per frame + sgct::SGCTOpenVR::updatePoses(); + } +#endif + LTRACE("main::postSynchronizationPreDraw(end)"); } @@ -285,12 +318,28 @@ void mainRenderFunc() { viewMatrix = viewMatrix * sceneMatrix; mat4 projectionMatrix = _sgctEngine->getCurrentProjectionMatrix(); + +#ifdef OPENVR_SUPPORT + if (sgct::SGCTOpenVR::isHMDActive() && + (FirstOpenVRWindow == _sgctEngine->getCurrentWindowPtr() || _sgctEngine->getCurrentWindowPtr()->checkIfTagExists("OpenVR"))) { + projectionMatrix = sgct::SGCTOpenVR::getHMDCurrentViewProjectionMatrix(_sgctEngine->getCurrentFrustumMode()); + } +#endif + OsEng.render(projectionMatrix, viewMatrix); LTRACE("main::mainRenderFunc(end)"); } void mainPostDrawFunc() { LTRACE("main::mainPostDrawFunc(begin)"); + +#ifdef OPENVR_SUPPORT + if (FirstOpenVRWindow) { + //Copy the first OpenVR window to the HMD + sgct::SGCTOpenVR::copyWindowToHMD(FirstOpenVRWindow); + } +#endif + OsEng.postDraw(); LTRACE("main::mainPostDrawFunc(end)"); diff --git a/config/sgct/openvr_htcVive.xml b/config/sgct/openvr_htcVive.xml new file mode 100644 index 0000000000..e663b11521 --- /dev/null +++ b/config/sgct/openvr_htcVive.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/sgct/openvr_oculusRiftCv1.xml b/config/sgct/openvr_oculusRiftCv1.xml new file mode 100644 index 0000000000..e264dd3788 --- /dev/null +++ b/config/sgct/openvr_oculusRiftCv1.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ext/ghoul b/ext/ghoul index c007df9d95..7d1bac81e1 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit c007df9d955b934624f4374505aa5912ab483dab +Subproject commit 7d1bac81e113f81ddbed6fca864c084f039fde12 diff --git a/ext/sgct b/ext/sgct index 32ca27704f..436a4e2d13 160000 --- a/ext/sgct +++ b/ext/sgct @@ -1 +1 @@ -Subproject commit 32ca27704ff5839ad8d5b2df46c5fdac8ed03749 +Subproject commit 436a4e2d13c563f092d37706b469046ac96ab468 diff --git a/openspace.cfg b/openspace.cfg index 754c5357ff..fcd6c4eead 100644 --- a/openspace.cfg +++ b/openspace.cfg @@ -5,6 +5,7 @@ return { -- Determines which SGCT configuration file is loaded, that is, if there rendering -- occurs in a single window, a fisheye projection, or a dome cluster system + -- A regular 1280x720 window SGCTConfig = sgct.config.single{}, @@ -14,6 +15,8 @@ return { -- A 4k fisheye rendering in a 1024x1024 window -- SGCTConfig = sgct.config.fisheye{1024, 1024, res={4096, 4096}, quality="2k", tilt=27}, + --SGCTConfig = "${SGCT}/openvr_oculusRiftCv1.xml", + --SGCTConfig = "${SGCT}/openvr_htcVive.xml", -- Sets the scene that is to be loaded by OpenSpace. A scene file is a description -- of all entities that will be visible during an instance of OpenSpace @@ -82,4 +85,4 @@ return { DownloadRequestURL = "http://data.openspaceproject.com/request.cgi", RenderingMethod = "Framebuffer" --RenderingMethod = "ABuffer" -- alternative: "Framebuffer" -} \ No newline at end of file +} From 4f64cbb141857748d009baba4f10a1f8e966339d Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Sat, 25 Feb 2017 10:59:59 -0500 Subject: [PATCH 36/96] First step of main.cpp cleanup Updated SGCT repository --- apps/OpenSpace/main.cpp | 677 ++++++++++++++++++++-------------------- ext/sgct | 2 +- openspace.cfg | 3 + 3 files changed, 344 insertions(+), 338 deletions(-) diff --git a/apps/OpenSpace/main.cpp b/apps/OpenSpace/main.cpp index 162a034de2..b5bc7627bf 100644 --- a/apps/OpenSpace/main.cpp +++ b/apps/OpenSpace/main.cpp @@ -25,38 +25,31 @@ #include #include #include -#include + #include #include #include + #include -#include -#include #ifdef OPENVR_SUPPORT #include +#endif // OPENVR_SUPPORT + +namespace { + +const char* _loggerCat = "main"; + +sgct::Engine* SgctEngine; + +#ifdef OPENVR_SUPPORT sgct::SGCTWindow* FirstOpenVRWindow = nullptr; #endif -sgct::Engine* _sgctEngine; - -int main_main(int argc, char** argv); -void mainInitFunc(); -void mainPreSyncFunc(); -void mainPostSyncPreDrawFunc(); -void mainRenderFunc(); -void mainPostDrawFunc(); -void mainKeyboardCallback(int key, int scancode, int action, int mods); -void mainCharCallback(unsigned int codepoint, int mods); -void mainMouseButtonCallback(int key, int action); -void mainMousePosCallback(double x, double y); -void mainMouseScrollCallback(double posX, double posY); -void mainEncodeFun(); -void mainDecodeFun(); -void mainExternalControlCallback(const char * receivedChars, int size); -void mainLogCallback(const char* msg); - std::pair supportedOpenGLVersion() { + // Just create a window in order to retrieve the available OpenGL version before we + // create the real window + glfwInit(); // On OS X we need to explicitly set the version and specify that we are using CORE @@ -71,23 +64,347 @@ std::pair supportedOpenGLVersion() { #endif glfwWindowHint(GLFW_VISIBLE, GL_FALSE); + + // By creating an offscreen window, the user will not know that we created this window GLFWwindow* offscreen = glfwCreateWindow(128, 128, "", nullptr, nullptr); glfwMakeContextCurrent(offscreen); + // Get the OpenGL version int major, minor; glGetIntegerv(GL_MAJOR_VERSION, &major); glGetIntegerv(GL_MINOR_VERSION, &minor); + // And get rid of the window again glfwDestroyWindow(offscreen); glfwWindowHint(GLFW_VISIBLE, GL_TRUE); return { major, minor }; } -namespace { - const std::string _loggerCat = "main"; +void mainInitFunc() { + LTRACE("main::mainInitFunc(begin)"); + + // Is this node the master? + // @CLEANUP: This can be removed and replaced with a call to a windowwrapper ---abock + OsEng.setMaster(SgctEngine->isMaster()); + + LDEBUG("Initializing OpenSpace Engine"); + // @CLEANUP: The return value should be replaced with an exception ---abock + bool success = OsEng.initialize(); + + LDEBUG("Initializing OpenGL in OpenSpace Engine"); + if (success) { + success = OsEng.initializeGL(); + } + + if (!success) { + LFATAL("Initializing OpenSpaceEngine failed"); + LogMgr.flushLogs(); + exit(EXIT_FAILURE); + } + + // Find if we have at least one OpenVR window + // Save reference to first OpenVR window, which is the one we will copy to the HMD. + for (size_t i = 0; i < SgctEngine->getNumberOfWindows(); ++i) { + if (SgctEngine->getWindowPtr(i)->checkIfTagExists("OpenVR")) { +#ifdef OPENVR_SUPPORT + FirstOpenVRWindow = SgctEngine->getWindowPtr(i); + + // If we have an OpenVRWindow, initialize OpenVR. + sgct::SGCTOpenVR::initialize( + SgctEngine->getNearClippingPlane(), _sgctEngine->getFarClippingPlane() + ); +#else + LWARNING( + "OpenVR was requested, but OpenSpace was compiled without VR support." + ); +#endif + + break; + } + } + + // Set the clear color for all non-linear projection viewports + // @CLEANUP: Why is this necessary? We can set the clear color in the configuration + // files --- abock + size_t nWindows = SgctEngine->getNumberOfWindows(); + for (size_t i = 0; i < nWindows; ++i) { + sgct::SGCTWindow* w = SgctEngine->getWindowPtr(i); + size_t nViewports = w->getNumberOfViewports(); + for (size_t j = 0; j < nViewports; ++j) { + sgct_core::Viewport* v = w->getViewport(j); + ghoul_assert(v != nullptr, "Number of reported viewports was incorrect"); + sgct_core::NonLinearProjection* p = v->getNonLinearProjectionPtr(); + if (p) + p->setClearColor(glm::vec4(0.f, 0.f, 0.f, 1.f)); + } + } + LTRACE("main::mainInitFunc(end)"); } +void mainPreSyncFunc() { + LTRACE("main::mainPreSyncFunc(begin)"); + OsEng.setRunTime(sgct::Engine::getTime()); + OsEng.preSynchronization(); + LTRACE("main::mainPreSyncFunc(end)"); +} + +void mainPostSyncPreDrawFunc() { + LTRACE("main::postSynchronizationPreDraw(begin)"); + OsEng.postSynchronizationPreDraw(); + +#ifdef OPENVR_SUPPORT + if (FirstOpenVRWindow) { + // Update pose matrices for all tracked OpenVR devices once per frame + sgct::SGCTOpenVR::updatePoses(); + } +#endif + + LTRACE("main::postSynchronizationPreDraw(end)"); +} + +void mainRenderFunc() { + LTRACE("main::mainRenderFunc(begin)"); + using glm::mat4; + using glm::translate; + //not the most efficient, but for clarity @JK + + mat4 userMatrix = translate(mat4(1.f), SgctEngine->getDefaultUserPtr()->getPos()); + mat4 sceneMatrix = SgctEngine->getModelMatrix(); + mat4 viewMatrix = SgctEngine->getCurrentViewMatrix() * userMatrix; + + //dont shift nav-direction on master, makes it very tricky to navigate @JK + if (!SgctEngine->isMaster()) { + viewMatrix = viewMatrix * sceneMatrix; + } + + mat4 projectionMatrix = SgctEngine->getCurrentProjectionMatrix(); + +#ifdef OPENVR_SUPPORT + bool currentWindowIsHMD = FirstOpenVRWindow == _sgctEngine->getCurrentWindowPtr(); + if (sgct::SGCTOpenVR::isHMDActive() && currentWindowIsHMD) { + projectionMatrix = sgct::SGCTOpenVR::getHMDCurrentViewProjectionMatrix( + _sgctEngine->getCurrentFrustumMode() + ); + } +#endif + + // @CLEANUP: Pass the scene matrix to the render function as well and let the + // OpenSpaceEngine decide whether it wants to apply it or not + OsEng.render(projectionMatrix, viewMatrix); + LTRACE("main::mainRenderFunc(end)"); +} + +void mainPostDrawFunc() { + LTRACE("main::mainPostDrawFunc(begin)"); + +#ifdef OPENVR_SUPPORT + if (FirstOpenVRWindow) { + //Copy the first OpenVR window to the HMD + sgct::SGCTOpenVR::copyWindowToHMD(FirstOpenVRWindow); + } +#endif + + OsEng.postDraw(); + LTRACE("main::mainPostDrawFunc(end)"); +} + +void mainExternalControlCallback(const char* receivedChars, int size) { + LTRACE("main::mainExternalControlCallback(begin)"); + if (OsEng.isMaster()) { + OsEng.externalControlCallback(receivedChars, size, 0); + } + LTRACE("main::mainExternalControlCallback(end)"); +} + +void mainKeyboardCallback(int key, int, int action, int mods) { + LTRACE("main::mainKeyboardCallback(begin)"); + if (OsEng.isMaster()) { + OsEng.keyboardCallback( + openspace::Key(key), + openspace::KeyModifier(mods), + openspace::KeyAction(action) + ); + } + LTRACE("main::mainKeyboardCallback(begin)"); +} + +void mainMouseButtonCallback(int key, int action) { + LTRACE("main::mainMouseButtonCallback(begin)"); + if (OsEng.isMaster()) { + OsEng.mouseButtonCallback( + openspace::MouseButton(key), + openspace::MouseAction(action) + ); + } + LTRACE("main::mainMouseButtonCallback(end)"); +} + +void mainMousePosCallback(double x, double y) { + if (OsEng.isMaster()) { + OsEng.mousePositionCallback(x, y); + } +} + +void mainMouseScrollCallback(double posX, double posY) { + if (OsEng.isMaster()) { + OsEng.mouseScrollWheelCallback(posY); + } +} + +void mainCharCallback(unsigned int codepoint, int mods) { + if (OsEng.isMaster()) { + OsEng.charCallback(codepoint, openspace::KeyModifier(mods)); + } +} + +void mainEncodeFun() { + LTRACE("main::mainEncodeFun(begin)"); + OsEng.encode(); + LTRACE("main::mainEncodeFun(end)"); +} + +void mainDecodeFun() { + LTRACE("main::mainDecodeFun(begin)"); + OsEng.decode(); + LTRACE("main::mainDecodeFun(end)"); +} + +void mainLogCallback(const char* msg) { + std::string message = msg; + if (message.empty() || message == ".") { + // We don't want the empty '.' message that SGCT sends while it is waiting for + // connections from other network nodes + return; + } + // Remove the trailing \n that is passed along + LINFOC("SGCT", message.substr(0, std::max(message.size() - 1, 0))); +} + +int main_main(int argc, char** argv) { + std::pair glVersion = supportedOpenGLVersion(); + + // create the OpenSpace engine and get arguments for the sgct engine + // @CLEANUP: Replace the return valua with throwing an exception --abock + std::vector sgctArguments; + bool success = openspace::OpenSpaceEngine::create( + argc, argv, + std::make_unique(), + sgctArguments + ); + + if (!success) { + return EXIT_FAILURE; + } + + LINFO("Detected OpenGL version: " << glVersion.first << "." << glVersion.second); + + // create sgct engine c arguments + int newArgc = static_cast(sgctArguments.size()); + + char** newArgv = new char*[newArgc]; + for (int i = 0; i < newArgc; ++i) { + newArgv[i] = const_cast(sgctArguments.at(i).c_str()); + } + + // Need to set this before the creation of the sgct::Engine + sgct::MessageHandler::instance()->setLogToConsole(false); + sgct::MessageHandler::instance()->setShowTime(false); + sgct::MessageHandler::instance()->setLogToCallback(true); + sgct::MessageHandler::instance()->setLogCallback(mainLogCallback); + +#ifdef __APPLE__ + glfwWindowHint(GLFW_STENCIL_BITS, 8); +#endif + + LDEBUG("Creating SGCT Engine"); + SgctEngine = new sgct::Engine(newArgc, newArgv); + + // deallocate sgct c arguments + delete[] newArgv; + + // Bind functions + SgctEngine->setInitOGLFunction(mainInitFunc); + SgctEngine->setPreSyncFunction(mainPreSyncFunc); + SgctEngine->setPostSyncPreDrawFunction(mainPostSyncPreDrawFunc); + SgctEngine->setDrawFunction(mainRenderFunc); + SgctEngine->setPostDrawFunction(mainPostDrawFunc); + SgctEngine->setKeyboardCallbackFunction(mainKeyboardCallback); + SgctEngine->setMouseButtonCallbackFunction(mainMouseButtonCallback); + SgctEngine->setMousePosCallbackFunction(mainMousePosCallback); + SgctEngine->setMouseScrollCallbackFunction(mainMouseScrollCallback); + SgctEngine->setExternalControlCallback(mainExternalControlCallback); + SgctEngine->setCharCallbackFunction(mainCharCallback); + + // Disable the immediate exit of the application when the ESC key is pressed + SgctEngine->setExitKey(SGCT_KEY_UNKNOWN); + + sgct::MessageHandler::instance()->setNotifyLevel(sgct::MessageHandler::NOTIFY_ALL); + + // set encode and decode functions + // NOTE: starts synchronizing before init functions + sgct::SharedData::instance()->setEncodeFunction(mainEncodeFun); + sgct::SharedData::instance()->setDecodeFunction(mainDecodeFun); + + // try to open a window + LDEBUG("Initialize SGCT Engine"); + std::map, sgct::Engine::RunMode> versionMapping = { + { { 3, 3 }, sgct::Engine::RunMode::OpenGL_3_3_Core_Profile }, + { { 4, 0 }, sgct::Engine::RunMode::OpenGL_4_0_Core_Profile }, + { { 4, 1 }, sgct::Engine::RunMode::OpenGL_4_1_Core_Profile }, + { { 4, 2 }, sgct::Engine::RunMode::OpenGL_4_2_Core_Profile }, + { { 4, 3 }, sgct::Engine::RunMode::OpenGL_4_3_Core_Profile }, + { { 4, 4 }, sgct::Engine::RunMode::OpenGL_4_4_Core_Profile }, + { { 4, 5 }, sgct::Engine::RunMode::OpenGL_4_5_Core_Profile } + }; + ghoul_assert( + versionMapping.find(glVersion) != versionMapping.end(), + "Unknown OpenGL version. Missing statement in version mapping map" + ); + + auto cleanup = [&](){ + OsEng.deinitialize(); + + // clear function bindings to avoid crash after destroying the OpenSpace Engine + sgct::MessageHandler::instance()->setLogToCallback(false); + sgct::MessageHandler::instance()->setLogCallback(nullptr); + + LDEBUG("Destroying OpenSpaceEngine"); + openspace::OpenSpaceEngine::destroy(); + + // Clean up (deallocate) + LDEBUG("Destroying SGCT Engine"); + delete SgctEngine; + }; + + bool initSuccess = SgctEngine->init(versionMapping[glVersion]); + + if (!initSuccess) { + LFATAL("Initializing failed"); + cleanup(); + return EXIT_FAILURE; + } + + // Main loop + LDEBUG("Starting rendering loop"); + SgctEngine->render(); + LDEBUG("Ending rendering loop"); + + cleanup(); + +#ifdef OPENVR_SUPPORT + // Clean up OpenVR + sgct::SGCTOpenVR::shutdown(); +#endif + + // Exit program + exit(EXIT_SUCCESS); +} + +} // namespace + int main(int argc, char** argv) { + // We wrap the actual main function in a try catch block so that we can get and print + // some additional information in case an exception is raised try { return main_main(argc, argv); } @@ -110,317 +427,3 @@ int main(int argc, char** argv) { throw; } } - -int main_main(int argc, char** argv) { - auto glVersion = supportedOpenGLVersion(); - - // create the OpenSpace engine and get arguments for the sgct engine - std::vector sgctArguments; - const bool success = openspace::OpenSpaceEngine::create( - argc, argv, - std::make_unique(), - sgctArguments - ); - if (!success) { - return EXIT_FAILURE; - } - - LINFO("Detected OpenGL version: " << glVersion.first << "." << glVersion.second); - - // create sgct engine c arguments - int newArgc = static_cast(sgctArguments.size()); - char** newArgv = new char*[newArgc]; - for (int i = 0; i < newArgc; ++i) { - newArgv[i] = const_cast(sgctArguments.at(i).c_str()); - } - - // Need to set this before the creation of the sgct::Engine - sgct::MessageHandler::instance()->setLogToConsole(false); - sgct::MessageHandler::instance()->setShowTime(false); - sgct::MessageHandler::instance()->setLogToCallback(true); - sgct::MessageHandler::instance()->setLogCallback(mainLogCallback); - -#ifdef __APPLE__ - glfwWindowHint(GLFW_STENCIL_BITS, 8); -#endif - - LDEBUG("Creating SGCT Engine"); - _sgctEngine = new sgct::Engine(newArgc, newArgv); - - // deallocate sgct c arguments - delete[] newArgv; - - // Bind functions - _sgctEngine->setInitOGLFunction(mainInitFunc); - _sgctEngine->setPreSyncFunction(mainPreSyncFunc); - _sgctEngine->setPostSyncPreDrawFunction(mainPostSyncPreDrawFunc); - _sgctEngine->setDrawFunction(mainRenderFunc); - _sgctEngine->setPostDrawFunction(mainPostDrawFunc); - _sgctEngine->setKeyboardCallbackFunction(mainKeyboardCallback); - _sgctEngine->setMouseButtonCallbackFunction(mainMouseButtonCallback); - _sgctEngine->setMousePosCallbackFunction(mainMousePosCallback); - _sgctEngine->setMouseScrollCallbackFunction(mainMouseScrollCallback); - _sgctEngine->setExternalControlCallback(mainExternalControlCallback); - _sgctEngine->setCharCallbackFunction(mainCharCallback); - - // Disable the immediate exit of the application when the ESC key is pressed - _sgctEngine->setExitKey(SGCT_KEY_UNKNOWN); - - sgct::MessageHandler::instance()->setNotifyLevel(sgct::MessageHandler::NOTIFY_ALL); - - // set encode and decode functions - // NOTE: starts synchronizing before init functions - sgct::SharedData::instance()->setEncodeFunction(mainEncodeFun); - sgct::SharedData::instance()->setDecodeFunction(mainDecodeFun); - - // try to open a window - LDEBUG("Initialize SGCT Engine"); - std::map, sgct::Engine::RunMode> versionMapping = { - { { 3, 3 }, sgct::Engine::RunMode::OpenGL_3_3_Core_Profile }, - { { 4, 0 }, sgct::Engine::RunMode::OpenGL_4_0_Core_Profile }, - { { 4, 1 }, sgct::Engine::RunMode::OpenGL_4_1_Core_Profile }, - { { 4, 2 }, sgct::Engine::RunMode::OpenGL_4_2_Core_Profile }, - { { 4, 3 }, sgct::Engine::RunMode::OpenGL_4_3_Core_Profile }, - { { 4, 4 }, sgct::Engine::RunMode::OpenGL_4_4_Core_Profile }, - { { 4, 5 }, sgct::Engine::RunMode::OpenGL_4_5_Core_Profile } - }; - ghoul_assert( - versionMapping.find(glVersion) != versionMapping.end(), - "Unknown OpenGL version. Missing statement in version mapping map" - ); - sgct::Engine::RunMode rm = versionMapping[glVersion]; - const bool initSuccess = _sgctEngine->init(rm); - - if (!initSuccess) { - LFATAL("Initializing failed"); - // could not open a window, deallocates and exits - delete _sgctEngine; - openspace::OpenSpaceEngine::destroy(); - return EXIT_FAILURE; - } - - // Main loop - LDEBUG("Starting rendering loop"); - _sgctEngine->render(); - LDEBUG("Ending rendering loop"); - - OsEng.deinitialize(); - - //clear function bindings to avoid crash after destroying the OpenSpace Engine - sgct::MessageHandler::instance()->setLogToCallback(false); - sgct::MessageHandler::instance()->setLogCallback(nullptr); - - LDEBUG("Destroying OpenSpaceEngine"); - openspace::OpenSpaceEngine::destroy(); - - // Clean up (deallocate) - LDEBUG("Destroying SGCT Engine"); - delete _sgctEngine; - -#ifdef OPENVR_SUPPORT - // Clean up OpenVR - sgct::SGCTOpenVR::shutdown(); -#endif - - // Exit program - exit(EXIT_SUCCESS); -} - -void mainInitFunc() { - LTRACE("main::mainInitFunc(begin)"); - //is this node the master? (must be set after call to _sgctEngine->init()) - OsEng.setMaster(_sgctEngine->isMaster()); - - LDEBUG("Initializing OpenSpace Engine"); - bool success = OsEng.initialize(); - - LDEBUG("Initializing OpenGL in OpenSpace Engine"); - if (success) { - success = OsEng.initializeGL(); - } - - if (!success) { - LFATAL("Initializing OpenSpaceEngine failed"); - LogMgr.flushLogs(); - exit(EXIT_FAILURE); - } - -#ifdef OPENVR_SUPPORT - //Find if we have at least one OpenVR window - //Save reference to first OpenVR window, which is the one we will copy to the HMD. - for (size_t i = 0; i < _sgctEngine->getNumberOfWindows(); i++) { - if (_sgctEngine->getWindowPtr(i)->checkIfTagExists("OpenVR")) { - FirstOpenVRWindow = _sgctEngine->getWindowPtr(i); - break; - } - } - //If we have an OpenVRWindow, initialize OpenVR. - if (FirstOpenVRWindow) { - sgct::SGCTOpenVR::initialize(_sgctEngine->getNearClippingPlane(), _sgctEngine->getFarClippingPlane()); - } -#endif - - // Set the clear color for all non-linear projection viewports - size_t nWindows = _sgctEngine->getNumberOfWindows(); - for (size_t i = 0; i < nWindows; ++i) { - sgct::SGCTWindow* w = _sgctEngine->getWindowPtr(i); - size_t nViewports = w->getNumberOfViewports(); - for (size_t j = 0; j < nViewports; ++j) { - sgct_core::Viewport* v = w->getViewport(j); - ghoul_assert(v != nullptr, "Number of reported viewports was incorrect"); - sgct_core::NonLinearProjection* p = v->getNonLinearProjectionPtr(); - if (p) - p->setClearColor(glm::vec4(0.f, 0.f, 0.f, 1.f)); - } - } - LTRACE("main::mainInitFunc(end)"); -} - -void mainPreSyncFunc() { - LTRACE("main::mainPreSyncFunc(begin)"); - OsEng.setRunTime(sgct::Engine::getTime()); - OsEng.preSynchronization(); - LTRACE("main::mainPreSyncFunc(end)"); -} - -volatile bool busyWaitDecode = false; -void mainPostSyncPreDrawFunc() { -// if (OsEng.useBusyWaitForDecode() && !sgct::Engine::instance()->isMaster()) { -// while (minilog.str().size() && minilog.str().back() != DECODE.end) { -// std::this_thread::sleep_for(std::chrono::microseconds(10)); -// } -// } - LTRACE("main::postSynchronizationPreDraw(begin)"); - OsEng.postSynchronizationPreDraw(); - -#ifdef OPENVR_SUPPORT - if (FirstOpenVRWindow) { - //Update pose matrices for all tracked OpenVR devices once per frame - sgct::SGCTOpenVR::updatePoses(); - } -#endif - - LTRACE("main::postSynchronizationPreDraw(end)"); -} - -void mainRenderFunc() { - LTRACE("main::mainRenderFunc(begin)"); - using glm::mat4; - using glm::translate; - //not the most efficient, but for clarity @JK - - mat4 userMatrix = translate(mat4(1.f), _sgctEngine->getDefaultUserPtr()->getPos()); - mat4 sceneMatrix = _sgctEngine->getModelMatrix(); - mat4 viewMatrix = _sgctEngine->getCurrentViewMatrix() * userMatrix; - - //dont shift nav-direction on master, makes it very tricky to navigate @JK - if (!OsEng.ref().isMaster()) - viewMatrix = viewMatrix * sceneMatrix; - - mat4 projectionMatrix = _sgctEngine->getCurrentProjectionMatrix(); - -#ifdef OPENVR_SUPPORT - if (sgct::SGCTOpenVR::isHMDActive() && - (FirstOpenVRWindow == _sgctEngine->getCurrentWindowPtr() || _sgctEngine->getCurrentWindowPtr()->checkIfTagExists("OpenVR"))) { - projectionMatrix = sgct::SGCTOpenVR::getHMDCurrentViewProjectionMatrix(_sgctEngine->getCurrentFrustumMode()); - } -#endif - - OsEng.render(projectionMatrix, viewMatrix); - LTRACE("main::mainRenderFunc(end)"); -} - -void mainPostDrawFunc() { - LTRACE("main::mainPostDrawFunc(begin)"); - -#ifdef OPENVR_SUPPORT - if (FirstOpenVRWindow) { - //Copy the first OpenVR window to the HMD - sgct::SGCTOpenVR::copyWindowToHMD(FirstOpenVRWindow); - } -#endif - - OsEng.postDraw(); - LTRACE("main::mainPostDrawFunc(end)"); - -// if (OsEng.logSGCTOutOfOrderErrors()) { -// if (sgct::Engine::instance()->isMaster()) { -// if (minilog.str() != EXPECTED_MASTER_LOG) { -// LERRORC("Minilog", "Bad combination: " << minilog.str()); -// } -// } -// else { -// if (minilog.str() != EXPECTED_SLAVE_LOG) { -// LERRORC("Minilog", "Bad combination: " << minilog.str()); -// } -// } -// } -} - -void mainExternalControlCallback(const char* receivedChars, int size) { - LTRACE("main::mainExternalControlCallback(begin)"); - if (OsEng.isMaster()) { - OsEng.externalControlCallback(receivedChars, size, 0); - } - LTRACE("main::mainExternalControlCallback(end)"); -} - -void mainKeyboardCallback(int key, int, int action, int mods) { - LTRACE("main::mainKeyboardCallback(begin)"); - if (OsEng.isMaster()) { - OsEng.keyboardCallback( - openspace::Key(key), - openspace::KeyModifier(mods), - openspace::KeyAction(action) - ); - } - LTRACE("main::mainKeyboardCallback(begin)"); -} - -void mainMouseButtonCallback(int key, int action) { - LTRACE("main::mainMouseButtonCallback(begin)"); - if (OsEng.isMaster()) { - OsEng.mouseButtonCallback( - openspace::MouseButton(key), - openspace::MouseAction(action) - ); - } - LTRACE("main::mainMouseButtonCallback(end)"); -} - -void mainMousePosCallback(double x, double y) { - if (OsEng.isMaster()) - OsEng.mousePositionCallback(x, y); -} - -void mainMouseScrollCallback(double posX, double posY) { - if (OsEng.isMaster()) - OsEng.mouseScrollWheelCallback(posY); -} - -void mainCharCallback(unsigned int codepoint, int mods) { - if (OsEng.isMaster()) - OsEng.charCallback(codepoint, openspace::KeyModifier(mods)); -} - -void mainEncodeFun() { - LTRACE("main::mainEncodeFun(begin)"); - OsEng.encode(); - LTRACE("main::mainEncodeFun(end)"); -} - -void mainDecodeFun() { - LTRACE("main::mainDecodeFun(begin)"); - OsEng.decode(); - LTRACE("main::mainDecodeFun(end)"); -} - -void mainLogCallback(const char* msg) { - std::string message = msg; - if (message.empty() || message == ".") - // We don't want the empty '.' message that SGCT sends while it is waiting for - // connections from other network nodes - return; - // Remove the trailing \n that is passed along - LINFOC("SGCT", message.substr(0, std::max(message.size() - 1, 0))); -} diff --git a/ext/sgct b/ext/sgct index 436a4e2d13..0bea7bdb11 160000 --- a/ext/sgct +++ b/ext/sgct @@ -1 +1 @@ -Subproject commit 436a4e2d13c563f092d37706b469046ac96ab468 +Subproject commit 0bea7bdb11fe060b39194801646fb1b8a7ff597d diff --git a/openspace.cfg b/openspace.cfg index fcd6c4eead..b52e8abbc5 100644 --- a/openspace.cfg +++ b/openspace.cfg @@ -12,6 +12,9 @@ return { -- A regular 1920x1080 window -- SGCTConfig = sgct.config.single{1920, 1080}, + -- A 1k fisheye rendering + -- SGCTConfig = sgct.config.fisheye{1024, 1024}, + -- A 4k fisheye rendering in a 1024x1024 window -- SGCTConfig = sgct.config.fisheye{1024, 1024, res={4096, 4096}, quality="2k", tilt=27}, From 6c4efc4eeccd7f292f5bf78bac3cf4f8d020f028 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Sat, 25 Feb 2017 11:29:28 -0500 Subject: [PATCH 37/96] Move OpenSpaceEngine::isMaster method into WindowWrapper class --- apps/OpenSpace/main.cpp | 16 ++- include/openspace/engine/openspaceengine.h | 3 - .../engine/wrapper/sgctwindowwrapper.h | 1 + .../openspace/engine/wrapper/windowwrapper.h | 7 ++ modules/onscreengui/onscreenguimodule.cpp | 4 +- src/engine/openspaceengine.cpp | 102 ++++++++---------- src/engine/wrapper/sgctwindowwrapper.cpp | 4 + src/engine/wrapper/windowwrapper.cpp | 4 + src/network/parallelconnection_lua.inl | 55 +++++----- src/rendering/renderengine.cpp | 11 +- 10 files changed, 99 insertions(+), 108 deletions(-) diff --git a/apps/OpenSpace/main.cpp b/apps/OpenSpace/main.cpp index b5bc7627bf..a800cdfa9c 100644 --- a/apps/OpenSpace/main.cpp +++ b/apps/OpenSpace/main.cpp @@ -83,10 +83,6 @@ std::pair supportedOpenGLVersion() { void mainInitFunc() { LTRACE("main::mainInitFunc(begin)"); - // Is this node the master? - // @CLEANUP: This can be removed and replaced with a call to a windowwrapper ---abock - OsEng.setMaster(SgctEngine->isMaster()); - LDEBUG("Initializing OpenSpace Engine"); // @CLEANUP: The return value should be replaced with an exception ---abock bool success = OsEng.initialize(); @@ -210,7 +206,7 @@ void mainPostDrawFunc() { void mainExternalControlCallback(const char* receivedChars, int size) { LTRACE("main::mainExternalControlCallback(begin)"); - if (OsEng.isMaster()) { + if (SgctEngine->isMaster()) { OsEng.externalControlCallback(receivedChars, size, 0); } LTRACE("main::mainExternalControlCallback(end)"); @@ -218,7 +214,7 @@ void mainExternalControlCallback(const char* receivedChars, int size) { void mainKeyboardCallback(int key, int, int action, int mods) { LTRACE("main::mainKeyboardCallback(begin)"); - if (OsEng.isMaster()) { + if (SgctEngine->isMaster()) { OsEng.keyboardCallback( openspace::Key(key), openspace::KeyModifier(mods), @@ -230,7 +226,7 @@ void mainKeyboardCallback(int key, int, int action, int mods) { void mainMouseButtonCallback(int key, int action) { LTRACE("main::mainMouseButtonCallback(begin)"); - if (OsEng.isMaster()) { + if (SgctEngine->isMaster()) { OsEng.mouseButtonCallback( openspace::MouseButton(key), openspace::MouseAction(action) @@ -240,19 +236,19 @@ void mainMouseButtonCallback(int key, int action) { } void mainMousePosCallback(double x, double y) { - if (OsEng.isMaster()) { + if (SgctEngine->isMaster()) { OsEng.mousePositionCallback(x, y); } } void mainMouseScrollCallback(double posX, double posY) { - if (OsEng.isMaster()) { + if (SgctEngine->isMaster()) { OsEng.mouseScrollWheelCallback(posY); } } void mainCharCallback(unsigned int codepoint, int mods) { - if (OsEng.isMaster()) { + if (SgctEngine->isMaster()) { OsEng.charCallback(codepoint, openspace::KeyModifier(mods)); } } diff --git a/include/openspace/engine/openspaceengine.h b/include/openspace/engine/openspaceengine.h index d515aa46cc..e7b539c195 100644 --- a/include/openspace/engine/openspaceengine.h +++ b/include/openspace/engine/openspaceengine.h @@ -73,8 +73,6 @@ public: static bool isInitialized(); static OpenSpaceEngine& ref(); - bool isMaster(); - void setMaster(bool master); double runTime(); void setRunTime(double t); @@ -249,7 +247,6 @@ private: } _moduleCallbacks; - bool _isMaster; double _runTime; // Whether the application is currently in shutdown mode (i.e. counting down the timer diff --git a/include/openspace/engine/wrapper/sgctwindowwrapper.h b/include/openspace/engine/wrapper/sgctwindowwrapper.h index 3a0fd67131..3469aa8f80 100644 --- a/include/openspace/engine/wrapper/sgctwindowwrapper.h +++ b/include/openspace/engine/wrapper/sgctwindowwrapper.h @@ -55,6 +55,7 @@ public: bool isRegularRendering() const override; bool hasGuiWindow() const override; bool isGuiWindow() const override; + bool isMaster() const override; bool isUsingSwapGroups() const override; bool isSwapGroupMaster() const override; diff --git a/include/openspace/engine/wrapper/windowwrapper.h b/include/openspace/engine/wrapper/windowwrapper.h index b3ed6797fb..848c529bff 100644 --- a/include/openspace/engine/wrapper/windowwrapper.h +++ b/include/openspace/engine/wrapper/windowwrapper.h @@ -175,6 +175,13 @@ public: * \return Whether the current rendering window is GUI-only */ virtual bool isGuiWindow() const; + + /** + * Returns true if this application is the master for a clustered + * environment. + * \return Whether this applicaiton is the master for a clustered environment. + */ + virtual bool isMaster() const; /** * Returns true if the current rendering window is using swap groups. diff --git a/modules/onscreengui/onscreenguimodule.cpp b/modules/onscreengui/onscreenguimodule.cpp index 0a42166833..b1a96a32d3 100644 --- a/modules/onscreengui/onscreenguimodule.cpp +++ b/modules/onscreengui/onscreenguimodule.cpp @@ -105,7 +105,7 @@ OnScreenGUIModule::OnScreenGUIModule() OpenSpaceEngine::CallbackOption::PostSyncPreDraw, [](){ WindowWrapper& wrapper = OsEng.windowWrapper(); - if (OsEng.isMaster() && wrapper.isRegularRendering()) { + if (wrapper.isMaster() && wrapper.isRegularRendering()) { glm::vec2 mousePosition = wrapper.mousePosition(); //glm::ivec2 drawBufferResolution = _windowWrapper->currentDrawBufferResolution(); glm::ivec2 windowSize = wrapper.currentWindowSize(); @@ -130,7 +130,7 @@ OnScreenGUIModule::OnScreenGUIModule() [](){ WindowWrapper& wrapper = OsEng.windowWrapper(); bool showGui = wrapper.hasGuiWindow() ? wrapper.isGuiWindow() : true; - if (OsEng.isMaster() && wrapper.isRegularRendering() && showGui) { + if (wrapper.isMaster() && wrapper.isRegularRendering() && showGui) { gui.endFrame(); } } diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index 39bd6de7c4..49fc73e75e 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -139,7 +139,6 @@ OpenSpaceEngine::OpenSpaceEngine(std::string programName, , _parallelConnection(new ParallelConnection) , _windowWrapper(std::move(windowWrapper)) , _globalPropertyNamespace(new properties::PropertyOwner) - , _isMaster(false) , _runTime(0.0) , _isInShutdownMode(false) , _shutdownCountdown(0.f) @@ -804,14 +803,6 @@ bool OpenSpaceEngine::initializeGL() { return success; } -bool OpenSpaceEngine::isMaster() { - return _isMaster; -} - -void OpenSpaceEngine::setMaster(bool master) { - _isMaster = master; -} - double OpenSpaceEngine::runTime() { return _runTime; } @@ -827,8 +818,10 @@ void OpenSpaceEngine::preSynchronization() { _windowWrapper->setSynchronization(false); } - _syncEngine->presync(_isMaster); - if (_isMaster) { + bool master = _windowWrapper->isMaster(); + + _syncEngine->presync(master); + if (master) { double dt = _windowWrapper->averageDeltaTime(); _timeManager->preSynchronization(dt); @@ -855,7 +848,8 @@ void OpenSpaceEngine::preSynchronization() { } void OpenSpaceEngine::postSynchronizationPreDraw() { - _syncEngine->postsync(_isMaster); + bool master = _windowWrapper->isMaster(); + _syncEngine->postsync(master); if (_isInShutdownMode) { if (_shutdownCountdown <= 0.f) { @@ -870,7 +864,7 @@ void OpenSpaceEngine::postSynchronizationPreDraw() { _renderEngine->updateScreenSpaceRenderables(); _renderEngine->updateShaderPrograms(); - if (!_isMaster) { + if (!master) { _renderEngine->camera()->invalidateCache(); } @@ -938,75 +932,65 @@ void OpenSpaceEngine::postDraw() { } void OpenSpaceEngine::keyboardCallback(Key key, KeyModifier mod, KeyAction action) { - if (_isMaster) { - for (const auto& func : _moduleCallbacks.keyboard) { - bool consumed = func(key, mod, action); - if (consumed) { - return; - } + for (const auto& func : _moduleCallbacks.keyboard) { + bool consumed = func(key, mod, action); + if (consumed) { + return; } - - if (key == _console->commandInputButton()) { - if (action == KeyAction::Press) { - _console->toggleMode(); - } - } else if (!_console->isVisible()) { - _interactionHandler->keyboardCallback(key, mod, action); - } else { - _console->keyboardCallback(key, mod, action); + } + + if (key == _console->commandInputButton()) { + if (action == KeyAction::Press) { + _console->toggleMode(); } + } else if (!_console->isVisible()) { + _interactionHandler->keyboardCallback(key, mod, action); + } else { + _console->keyboardCallback(key, mod, action); } } void OpenSpaceEngine::charCallback(unsigned int codepoint, KeyModifier modifier) { - if (_isMaster) { - for (const auto& func : _moduleCallbacks.character) { - bool consumed = func(codepoint, modifier); - if (consumed) { - return; - } + for (const auto& func : _moduleCallbacks.character) { + bool consumed = func(codepoint, modifier); + if (consumed) { + return; } + } - if (_console->isVisible()) { - _console->charCallback(codepoint, modifier); - } + if (_console->isVisible()) { + _console->charCallback(codepoint, modifier); } } void OpenSpaceEngine::mouseButtonCallback(MouseButton button, MouseAction action) { - if (_isMaster) { - for (const auto& func : _moduleCallbacks.mouseButton) { - bool consumed = func(button, action); - if (consumed) { - return; - } + for (const auto& func : _moduleCallbacks.mouseButton) { + bool consumed = func(button, action); + if (consumed) { + return; } - - _interactionHandler->mouseButtonCallback(button, action); } + + _interactionHandler->mouseButtonCallback(button, action); } void OpenSpaceEngine::mousePositionCallback(double x, double y) { - if (_isMaster) { - for (const auto& func : _moduleCallbacks.mousePosition) { - func(x, y); - } - - _interactionHandler->mousePositionCallback(x, y); + for (const auto& func : _moduleCallbacks.mousePosition) { + func(x, y); } + + _interactionHandler->mousePositionCallback(x, y); } void OpenSpaceEngine::mouseScrollWheelCallback(double pos) { - if (_isMaster) { - for (const auto& func : _moduleCallbacks.mouseScrollWheel) { - bool consumed = func(pos); - if (consumed) { - return; - } + for (const auto& func : _moduleCallbacks.mouseScrollWheel) { + bool consumed = func(pos); + if (consumed) { + return; } - - _interactionHandler->mouseScrollWheelCallback(pos); } + + _interactionHandler->mouseScrollWheelCallback(pos); } void OpenSpaceEngine::encode() { diff --git a/src/engine/wrapper/sgctwindowwrapper.cpp b/src/engine/wrapper/sgctwindowwrapper.cpp index 0693645023..d2ff643aae 100644 --- a/src/engine/wrapper/sgctwindowwrapper.cpp +++ b/src/engine/wrapper/sgctwindowwrapper.cpp @@ -162,6 +162,10 @@ bool SGCTWindowWrapper::hasGuiWindow() const { bool SGCTWindowWrapper::isGuiWindow() const { return sgct::Engine::instance()->getCurrentWindowPtr()->getName() == GuiWindowName; } + +bool SGCTWindowWrapper::isMaster() const { + return sgct::Engine::instance()->isMaster(); +} bool SGCTWindowWrapper::isSwapGroupMaster() const { return sgct::Engine::instance()->getCurrentWindowPtr()->isSwapGroupMaster(); diff --git a/src/engine/wrapper/windowwrapper.cpp b/src/engine/wrapper/windowwrapper.cpp index 12e6875a1c..9783526719 100644 --- a/src/engine/wrapper/windowwrapper.cpp +++ b/src/engine/wrapper/windowwrapper.cpp @@ -129,6 +129,10 @@ bool WindowWrapper::isGuiWindow() const { return false; } +bool WindowWrapper::isMaster() const { + return false; +} + bool WindowWrapper::isSwapGroupMaster() const { return false; } diff --git a/src/network/parallelconnection_lua.inl b/src/network/parallelconnection_lua.inl index 659115103f..2646581aed 100644 --- a/src/network/parallelconnection_lua.inl +++ b/src/network/parallelconnection_lua.inl @@ -32,19 +32,18 @@ namespace luascriptfunctions { * Set the port for parallel connection */ int setPort(lua_State* L) { - - const bool isFunction = (lua_isfunction(L, -1) != 0); + bool isFunction = (lua_isfunction(L, -1) != 0); if (isFunction) { // If the top of the stack is a function, it is ourself const char* msg = lua_pushfstring(L, "method called without argument"); return luaL_error(L, "bad argument (%s)", msg); } - const bool isNumber = (lua_isnumber(L, -1) != 0); + bool isNumber = (lua_isnumber(L, -1) != 0); if (isNumber) { int value = lua_tonumber(L, -1); std::string port = std::to_string(value); - if(OsEng.isMaster()){ + if (OsEng.windowWrapper().isMaster()) { OsEng.parallelConnection().setPort(port); } return 0; @@ -59,18 +58,17 @@ int setPort(lua_State* L) { } int setAddress(lua_State* L) { - - const bool isFunction = (lua_isfunction(L, -1) != 0); + bool isFunction = (lua_isfunction(L, -1) != 0); if (isFunction) { // If the top of the stack is a function, it is ourself const char* msg = lua_pushfstring(L, "method called without argument"); return luaL_error(L, "bad argument (%s)", msg); } - const int type = lua_type(L, -1); + int type = lua_type(L, -1); if (type == LUA_TSTRING) { std::string address = luaL_checkstring(L, -1); - if(OsEng.isMaster()){ + if (OsEng.windowWrapper().isMaster()) { OsEng.parallelConnection().setAddress(address); } return 0; @@ -85,18 +83,17 @@ int setAddress(lua_State* L) { } int setPassword(lua_State* L) { - - const bool isFunction = (lua_isfunction(L, -1) != 0); + bool isFunction = (lua_isfunction(L, -1) != 0); if (isFunction) { // If the top of the stack is a function, it is ourself const char* msg = lua_pushfstring(L, "method called without argument"); return luaL_error(L, "bad argument (%s)", msg); } - const int type = lua_type(L, -1); + int type = lua_type(L, -1); if (type == LUA_TSTRING) { std::string pwd = luaL_checkstring(L, -1); - if(OsEng.isMaster()){ + if (OsEng.windowWrapper().isMaster()) { OsEng.parallelConnection().setPassword(pwd); } return 0; @@ -111,18 +108,17 @@ int setPassword(lua_State* L) { } int setDisplayName(lua_State* L) { - - const bool isFunction = (lua_isfunction(L, -1) != 0); + bool isFunction = (lua_isfunction(L, -1) != 0); if (isFunction) { // If the top of the stack is a function, it is ourself const char* msg = lua_pushfstring(L, "method called without argument"); return luaL_error(L, "bad argument (%s)", msg); } - const int type = lua_type(L, -1); + int type = lua_type(L, -1); if (type == LUA_TSTRING) { std::string name = luaL_checkstring(L, -1); - if(OsEng.isMaster()){ + if (OsEng.windowWrapper().isMaster()) { OsEng.parallelConnection().setName(name); } return 0; @@ -137,40 +133,39 @@ int setDisplayName(lua_State* L) { } int connect(lua_State* L) { - int nArguments = lua_gettop(L); - if (nArguments != 0) + if (nArguments != 0) { return luaL_error(L, "Expected %i arguments, got %i", 0, nArguments); - if(OsEng.isMaster()){ + } + if (OsEng.windowWrapper().isMaster()) { OsEng.parallelConnection().clientConnect(); } return 0; } int disconnect(lua_State* L) { - int nArguments = lua_gettop(L); - if (nArguments != 0) - return luaL_error(L, "Expected %i arguments, got %i", 0, nArguments); - if(OsEng.isMaster()){ + if (nArguments != 0) { + return luaL_error(L, "Expected %i arguments, got %i", 0, nArguments); + } + if (OsEng.windowWrapper().isMaster()) { OsEng.parallelConnection().signalDisconnect(); } return 0; } int requestHostship(lua_State* L) { - - const bool isFunction = (lua_isfunction(L, -1) != 0); + bool isFunction = (lua_isfunction(L, -1) != 0); if (isFunction) { // If the top of the stack is a function, it is ourself const char* msg = lua_pushfstring(L, "method called without argument"); return luaL_error(L, "bad argument (%s)", msg); } - const int type = lua_type(L, -1); + int type = lua_type(L, -1); if (type == LUA_TSTRING) { std::string pwd = luaL_checkstring(L, -1); - if(OsEng.isMaster()){ + if (OsEng.windowWrapper().isMaster()) { OsEng.parallelConnection().requestHostship(pwd); } return 0; @@ -185,11 +180,11 @@ int requestHostship(lua_State* L) { } int resignHostship(lua_State* L) { - int nArguments = lua_gettop(L); - if (nArguments != 0) + if (nArguments != 0) { return luaL_error(L, "Expected %i arguments, got %i", 0, nArguments); - if (OsEng.isMaster()) { + } + if (OsEng.windowWrapper().isMaster()) { OsEng.parallelConnection().resignHostship(); } return 0; diff --git a/src/rendering/renderengine.cpp b/src/rendering/renderengine.cpp index 15cb24dec2..5a9b5082ff 100644 --- a/src/rendering/renderengine.cpp +++ b/src/rendering/renderengine.cpp @@ -472,13 +472,15 @@ void RenderEngine::render(const glm::mat4& projectionMatrix, const glm::mat4& vi LTRACE("RenderEngine::render(begin)"); _mainCamera->sgctInternal.setViewMatrix(viewMatrix); _mainCamera->sgctInternal.setProjectionMatrix(projectionMatrix); + + WindowWrapper& wrapper = OsEng.windowWrapper(); - if (!(OsEng.isMaster() && _disableMasterRendering) && !OsEng.windowWrapper().isGuiWindow()) { + if (!(wrapper.isMaster() && _disableMasterRendering) && !wrapper.isGuiWindow()) { _renderer->render(_globalBlackOutFactor, _performanceManager != nullptr); } // Print some useful information on the master viewport - if (OsEng.isMaster() && OsEng.windowWrapper().isSimpleRendering()) { + if (wrapper.isMaster() && wrapper.isSimpleRendering()) { renderInformation(); } @@ -487,7 +489,7 @@ void RenderEngine::render(const glm::mat4& projectionMatrix, const glm::mat4& vi OsEng.windowWrapper().viewportPixelCoordinates().w / 3 ); - if(_showFrameNumber) { + if (_showFrameNumber) { RenderFontCr(*_fontBig, penPosition, "%i", _frameNumber); } @@ -495,8 +497,9 @@ void RenderEngine::render(const glm::mat4& projectionMatrix, const glm::mat4& vi for (auto screenSpaceRenderable : _screenSpaceRenderables) { - if (screenSpaceRenderable->isEnabled() && screenSpaceRenderable->isReady()) + if (screenSpaceRenderable->isEnabled() && screenSpaceRenderable->isReady()) { screenSpaceRenderable->render(); + } } LTRACE("RenderEngine::render(end)"); } From bc75334eb40baaa5e02342a24a5d03ff19b063c7 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Sat, 25 Feb 2017 11:51:41 -0500 Subject: [PATCH 38/96] Use exceptions instead of success return values for initialize and create methods --- apps/OpenSpace/main.cpp | 92 ++-- include/openspace/engine/openspaceengine.h | 139 +++--- include/openspace/rendering/renderengine.h | 2 +- src/engine/openspaceengine.cpp | 466 +++++++++++---------- src/rendering/renderengine.cpp | 3 +- tests/main.cpp | 3 +- 6 files changed, 370 insertions(+), 335 deletions(-) diff --git a/apps/OpenSpace/main.cpp b/apps/OpenSpace/main.cpp index a800cdfa9c..684cbcc1bc 100644 --- a/apps/OpenSpace/main.cpp +++ b/apps/OpenSpace/main.cpp @@ -49,7 +49,6 @@ sgct::SGCTWindow* FirstOpenVRWindow = nullptr; std::pair supportedOpenGLVersion() { // Just create a window in order to retrieve the available OpenGL version before we // create the real window - glfwInit(); // On OS X we need to explicitly set the version and specify that we are using CORE @@ -77,26 +76,20 @@ std::pair supportedOpenGLVersion() { // And get rid of the window again glfwDestroyWindow(offscreen); glfwWindowHint(GLFW_VISIBLE, GL_TRUE); + return { major, minor }; } void mainInitFunc() { LTRACE("main::mainInitFunc(begin)"); - LDEBUG("Initializing OpenSpace Engine"); - // @CLEANUP: The return value should be replaced with an exception ---abock - bool success = OsEng.initialize(); + LDEBUG("Initializing OpenSpace Engine started"); + OsEng.initialize(); + LDEBUG("Initializing OpenSpace Engine finished"); - LDEBUG("Initializing OpenGL in OpenSpace Engine"); - if (success) { - success = OsEng.initializeGL(); - } - - if (!success) { - LFATAL("Initializing OpenSpaceEngine failed"); - LogMgr.flushLogs(); - exit(EXIT_FAILURE); - } + LDEBUG("Initializing OpenGL in OpenSpace Engine started"); + OsEng.initializeGL(); + LDEBUG("Initializing OpenGL in OpenSpace Engine finished"); // Find if we have at least one OpenVR window // Save reference to first OpenVR window, which is the one we will copy to the HMD. @@ -160,21 +153,17 @@ void mainPostSyncPreDrawFunc() { void mainRenderFunc() { LTRACE("main::mainRenderFunc(begin)"); - using glm::mat4; - using glm::translate; - //not the most efficient, but for clarity @JK - mat4 userMatrix = translate(mat4(1.f), SgctEngine->getDefaultUserPtr()->getPos()); - mat4 sceneMatrix = SgctEngine->getModelMatrix(); - mat4 viewMatrix = SgctEngine->getCurrentViewMatrix() * userMatrix; - - //dont shift nav-direction on master, makes it very tricky to navigate @JK - if (!SgctEngine->isMaster()) { - viewMatrix = viewMatrix * sceneMatrix; - } - - mat4 projectionMatrix = SgctEngine->getCurrentProjectionMatrix(); + glm::mat4 viewMatrix = + SgctEngine->getCurrentViewMatrix() * + // User matrix + glm::translate( + glm::mat4(1.f), + SgctEngine->getDefaultUserPtr()->getPos() + ) + ; + glm::mat4 projectionMatrix = SgctEngine->getCurrentProjectionMatrix(); #ifdef OPENVR_SUPPORT bool currentWindowIsHMD = FirstOpenVRWindow == _sgctEngine->getCurrentWindowPtr(); if (sgct::SGCTOpenVR::isHMDActive() && currentWindowIsHMD) { @@ -184,9 +173,13 @@ void mainRenderFunc() { } #endif - // @CLEANUP: Pass the scene matrix to the render function as well and let the - // OpenSpaceEngine decide whether it wants to apply it or not - OsEng.render(projectionMatrix, viewMatrix); + if (SgctEngine->isMaster()) { + OsEng.render(viewMatrix, projectionMatrix); + } + else { + glm::mat4 sceneMatrix = SgctEngine->getModelMatrix(); + OsEng.render(viewMatrix * sceneMatrix, projectionMatrix); + } LTRACE("main::mainRenderFunc(end)"); } @@ -195,7 +188,7 @@ void mainPostDrawFunc() { #ifdef OPENVR_SUPPORT if (FirstOpenVRWindow) { - //Copy the first OpenVR window to the HMD + // Copy the first OpenVR window to the HMD sgct::SGCTOpenVR::copyWindowToHMD(FirstOpenVRWindow); } #endif @@ -242,9 +235,11 @@ void mainMousePosCallback(double x, double y) { } void mainMouseScrollCallback(double posX, double posY) { + LTRACE("main::mainMouseScrollCallback(begin"); if (SgctEngine->isMaster()) { OsEng.mouseScrollWheelCallback(posY); } + LTRACE("main::mainMouseScrollCallback(end)"); } void mainCharCallback(unsigned int codepoint, int mods) { @@ -273,28 +268,30 @@ void mainLogCallback(const char* msg) { return; } // Remove the trailing \n that is passed along - LINFOC("SGCT", message.substr(0, std::max(message.size() - 1, 0))); + LINFOC("SGCT", message.substr(0, message.size() - 1)); } int main_main(int argc, char** argv) { std::pair glVersion = supportedOpenGLVersion(); - // create the OpenSpace engine and get arguments for the sgct engine + // Create the OpenSpace engine and get arguments for the SGCT engine // @CLEANUP: Replace the return valua with throwing an exception --abock std::vector sgctArguments; - bool success = openspace::OpenSpaceEngine::create( + bool requestQuit = false; + openspace::OpenSpaceEngine::create( argc, argv, std::make_unique(), - sgctArguments + sgctArguments, + requestQuit ); - if (!success) { - return EXIT_FAILURE; + if (requestQuit) { + return EXIT_SUCCESS; } LINFO("Detected OpenGL version: " << glVersion.first << "." << glVersion.second); - // create sgct engine c arguments + // Create sgct engine c arguments int newArgc = static_cast(sgctArguments.size()); char** newArgv = new char*[newArgc]; @@ -315,7 +312,7 @@ int main_main(int argc, char** argv) { LDEBUG("Creating SGCT Engine"); SgctEngine = new sgct::Engine(newArgc, newArgv); - // deallocate sgct c arguments + // Deallocate sgct c arguments delete[] newArgv; // Bind functions @@ -336,12 +333,12 @@ int main_main(int argc, char** argv) { sgct::MessageHandler::instance()->setNotifyLevel(sgct::MessageHandler::NOTIFY_ALL); - // set encode and decode functions + // Set encode and decode functions // NOTE: starts synchronizing before init functions sgct::SharedData::instance()->setEncodeFunction(mainEncodeFun); sgct::SharedData::instance()->setDecodeFunction(mainDecodeFun); - // try to open a window + // Try to open a window LDEBUG("Initialize SGCT Engine"); std::map, sgct::Engine::RunMode> versionMapping = { { { 3, 3 }, sgct::Engine::RunMode::OpenGL_3_3_Core_Profile }, @@ -360,14 +357,13 @@ int main_main(int argc, char** argv) { auto cleanup = [&](){ OsEng.deinitialize(); - // clear function bindings to avoid crash after destroying the OpenSpace Engine + // Clear function bindings to avoid crash after destroying the OpenSpace Engine sgct::MessageHandler::instance()->setLogToCallback(false); sgct::MessageHandler::instance()->setLogCallback(nullptr); LDEBUG("Destroying OpenSpaceEngine"); openspace::OpenSpaceEngine::destroy(); - // Clean up (deallocate) LDEBUG("Destroying SGCT Engine"); delete SgctEngine; }; @@ -405,21 +401,19 @@ int main(int argc, char** argv) { return main_main(argc, argv); } catch (const ghoul::RuntimeError& e) { - // Write out all of the information about the exception, flush the logs, and throw + // Write out all of the information about the exception and flush the logs LFATALC(e.component, e.message); LogMgr.flushLogs(); - throw; + return EXIT_FAILURE; } catch (const std::exception& e) { - // Write out all of the information about the exception, flush the logs, and throw LFATALC("Exception", e.what()); LogMgr.flushLogs(); - throw; + return EXIT_FAILURE; } catch (...) { - // Write out all of the information about the exception, flush the logs, and throw LFATALC("Exception", "Unknown exception"); LogMgr.flushLogs(); - throw; + return EXIT_FAILURE; } } diff --git a/include/openspace/engine/openspaceengine.h b/include/openspace/engine/openspaceengine.h index e7b539c195..12e17d6a03 100644 --- a/include/openspace/engine/openspaceengine.h +++ b/include/openspace/engine/openspaceengine.h @@ -36,39 +36,43 @@ #include namespace ghoul { + class Dictionary; + namespace cmdparser { class CommandlineParser; } namespace fontrendering { class FontManager; } -} + +} // namespace ghoul namespace openspace { class ConfigurationManager; class DownloadManager; -class LuaConsole; -class NetworkEngine; class GUI; -class RenderEngine; +class LuaConsole; class ModuleEngine; -class WindowWrapper; -class SettingsEngine; -class TimeManager; -class SyncEngine; +class NetworkEngine; class ParallelConnection; +class RenderEngine; +class SettingsEngine; +class SyncEngine; +class TimeManager; +class WindowWrapper; namespace interaction { class InteractionHandler; } namespace gui { class GUI; } -//namespace scripting { class ScriptEngine; } namespace properties { class PropertyOwner; } -namespace scripting { struct LuaLibrary; } -namespace scripting { class ScriptScheduler; } -namespace scripting { class ScriptEngine; } - +namespace scripting { + struct LuaLibrary; + class ScriptEngine; + class ScriptScheduler; +} // namespace scripting + class OpenSpaceEngine { public: - static bool create(int argc, char** argv, + static void create(int argc, char** argv, std::unique_ptr windowWrapper, - std::vector& sgctArguments); + std::vector& sgctArguments, bool& requestClose); static void destroy(); static bool isInitialized(); static OpenSpaceEngine& ref(); @@ -76,30 +80,13 @@ public: double runTime(); void setRunTime(double t); - // Guaranteed to return a valid pointer - ConfigurationManager& configurationManager(); - interaction::InteractionHandler& interactionHandler(); - RenderEngine& renderEngine(); - scripting::ScriptEngine& scriptEngine(); - scripting::ScriptScheduler& scriptScheduler(); - NetworkEngine& networkEngine(); - LuaConsole& console(); - ModuleEngine& moduleEngine(); - ParallelConnection& parallelConnection(); - properties::PropertyOwner& globalPropertyOwner(); - WindowWrapper& windowWrapper(); - ghoul::fontrendering::FontManager& fontManager(); - DownloadManager& downloadManager(); - TimeManager& timeManager(); - SettingsEngine& settingsEngine(); - - // SGCT callbacks - bool initialize(); - bool initializeGL(); + // callbacks + void initialize(); + void initializeGL(); void deinitialize(); void preSynchronization(); void postSynchronizationPreDraw(); - void render(const glm::mat4& projectionMatrix, const glm::mat4& viewMatrix); + void render(const glm::mat4& viewMatrix, const glm::mat4& projectionMatrix); void postDraw(); void keyboardCallback(Key key, KeyModifier mod, KeyAction action); void charCallback(unsigned int codepoint, KeyModifier mod); @@ -109,22 +96,35 @@ public: void externalControlCallback(const char* receivedChars, int size, int clientId); void encode(); void decode(); - + void enableBarrier(); void disableBarrier(); - + void writeDocumentation(); void toggleShutdownMode(); - bool useBusyWaitForDecode(); - bool logSGCTOutOfOrderErrors(); - void runPostInitializationScripts(const std::string& sceneDescription); - + + + // Guaranteed to return a valid pointer + ConfigurationManager& configurationManager(); + LuaConsole& console(); + DownloadManager& downloadManager(); + ModuleEngine& moduleEngine(); + NetworkEngine& networkEngine(); + ParallelConnection& parallelConnection(); + RenderEngine& renderEngine(); + SettingsEngine& settingsEngine(); + TimeManager& timeManager(); + WindowWrapper& windowWrapper(); + ghoul::fontrendering::FontManager& fontManager(); + interaction::InteractionHandler& interactionHandler(); + properties::PropertyOwner& globalPropertyOwner(); + scripting::ScriptEngine& scriptEngine(); + scripting::ScriptScheduler& scriptScheduler(); // This method is only to be called from Modules - enum class CallbackOption { Initialize = 0, // Callback for the end of the initialization Deinitialize, // Callback for the end of the deinitialization @@ -186,39 +186,38 @@ public: void registerModuleMouseScrollWheelCallback(std::function function); /** - * Returns the Lua library that contains all Lua functions available to affect the - * application. - */ + * Returns the Lua library that contains all Lua functions available to affect the + * application. + */ static scripting::LuaLibrary luaLibrary(); private: OpenSpaceEngine(std::string programName, std::unique_ptr windowWrapper); - ~OpenSpaceEngine(); + ~OpenSpaceEngine() = default; void clearAllWindows(); void gatherCommandlineArguments(); void loadFonts(); - void runScripts(const ghoul::Dictionary& scripts); void runPreInitializationScripts(const std::string& sceneDescription); void configureLogging(); // Components std::unique_ptr _configurationManager; - std::unique_ptr _interactionHandler; - std::unique_ptr _renderEngine; - std::unique_ptr _scriptEngine; - std::unique_ptr _scriptScheduler; - std::unique_ptr _networkEngine; - std::unique_ptr _syncEngine; - std::unique_ptr _commandlineParser; + std::unique_ptr _downloadManager; std::unique_ptr _console; std::unique_ptr _moduleEngine; - std::unique_ptr _settingsEngine; - std::unique_ptr _timeManager; - std::unique_ptr _downloadManager; + std::unique_ptr _networkEngine; std::unique_ptr _parallelConnection; + std::unique_ptr _renderEngine; + std::unique_ptr _settingsEngine; + std::unique_ptr _syncEngine; + std::unique_ptr _timeManager; std::unique_ptr _windowWrapper; + std::unique_ptr _commandlineParser; std::unique_ptr _fontManager; + std::unique_ptr _interactionHandler; + std::unique_ptr _scriptEngine; + std::unique_ptr _scriptScheduler; // Others std::unique_ptr _globalPropertyNamespace; @@ -241,24 +240,24 @@ private: std::vector> mouseButton; std::vector> mousePosition; std::vector> mouseScrollWheel; - - - - } _moduleCallbacks; double _runTime; - // Whether the application is currently in shutdown mode (i.e. counting down the timer - // and closing it at '0' - bool _isInShutdownMode; - // The total amount of time the application will wait before actually shutting down - float _shutdownWait; - // The current state of the countdown; if it reaches '0', the application will close - float _shutdownCountdown; + // Structure that is responsible for the delayed shutdown of the application + struct { + // Whether the application is currently in shutdown mode (i.e. counting down the + // timer and closing it at '0' + bool inShutdown; + // Total amount of time the application will wait before actually shutting down + float waitTime; + // Current state of the countdown; if it reaches '0', the application will + // close + float timer; + } _shutdown; // The first frame might take some more time in the update loop, so we need to know to - // disable the synchronization; otherwise a hardware sync will kill us after 1 sec + // disable the synchronization; otherwise a hardware sync will kill us after 1 minute bool _isFirstRenderingFirstFrame; static OpenSpaceEngine* _engine; diff --git a/include/openspace/rendering/renderengine.h b/include/openspace/rendering/renderengine.h index a9644fd41c..e67abec3d0 100644 --- a/include/openspace/rendering/renderengine.h +++ b/include/openspace/rendering/renderengine.h @@ -100,7 +100,7 @@ public: void updateFade(); void updateRenderer(); void updateScreenSpaceRenderables(); - void render(const glm::mat4& projectionMatrix, const glm::mat4& viewMatrix); + void render(const glm::mat4& viewMatrix, const glm::mat4& projectionMatrix); void renderScreenLog(); void renderShutdownInformation(float timer, float fullTime); diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index 49fc73e75e..9751553fe8 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -69,6 +69,7 @@ #include #include #include +#include #include #include @@ -91,14 +92,13 @@ using namespace ghoul::logging; using namespace ghoul::cmdparser; namespace { - const std::string _loggerCat = "OpenSpaceEngine"; - const std::string _sgctDefaultConfigFile = "${SGCT}/single.xml"; - const std::string _defaultCacheLocation = "${BASE_PATH}/cache"; + const char* _loggerCat = "OpenSpaceEngine"; + const char* SgctDefaultConfigFile = "${SGCT}/single.xml"; - const std::string _sgctConfigArgumentCommand = "-config"; + const char* SgctConfigArgumentCommand = "-config"; - const std::string PreInitializeFunction = "preInitialization"; - const std::string PostInitializationFunction = "postInitialization"; + const char* PreInitializeFunction = "preInitialization"; + const char* PostInitializationFunction = "postInitialization"; const int CacheVersion = 1; const int DownloadVersion = 1; @@ -140,9 +140,7 @@ OpenSpaceEngine::OpenSpaceEngine(std::string programName, , _windowWrapper(std::move(windowWrapper)) , _globalPropertyNamespace(new properties::PropertyOwner) , _runTime(0.0) - , _isInShutdownMode(false) - , _shutdownCountdown(0.f) - , _shutdownWait(0.f) + , _shutdown({false, 0.f, 0.f}) , _isFirstRenderingFirstFrame(true) { _interactionHandler->setPropertyOwner(_globalPropertyNamespace.get()); @@ -173,34 +171,36 @@ OpenSpaceEngine::OpenSpaceEngine(std::string programName, TransformationManager::initialize(); } -OpenSpaceEngine::~OpenSpaceEngine() { - _globalPropertyNamespace = nullptr; - _windowWrapper = nullptr; - _parallelConnection = nullptr; - _configurationManager = nullptr; - _interactionHandler = nullptr; - _renderEngine = nullptr; - _scriptEngine = nullptr; - _networkEngine = nullptr; - _syncEngine = nullptr; - _commandlineParser = nullptr; - _console = nullptr; - _moduleEngine = nullptr; - _settingsEngine = nullptr; -} +//OpenSpaceEngine::~OpenSpaceEngine() { +// _globalPropertyNamespace = nullptr; +// _windowWrapper = nullptr; +// _parallelConnection = nullptr; +// _configurationManager = nullptr; +// _interactionHandler = nullptr; +// _renderEngine = nullptr; +// _scriptEngine = nullptr; +// _networkEngine = nullptr; +// _syncEngine = nullptr; +// _commandlineParser = nullptr; +// _console = nullptr; +// _moduleEngine = nullptr; +// _settingsEngine = nullptr; +//} OpenSpaceEngine& OpenSpaceEngine::ref() { ghoul_assert(_engine, "OpenSpaceEngine not created"); return *_engine; } -bool OpenSpaceEngine::create(int argc, char** argv, +void OpenSpaceEngine::create(int argc, char** argv, std::unique_ptr windowWrapper, - std::vector& sgctArguments) + std::vector& sgctArguments, bool& requestClose) { ghoul_assert(!_engine, "OpenSpaceEngine was already created"); ghoul_assert(windowWrapper != nullptr, "No Window Wrapper was provided"); + requestClose = false; + ghoul::initialize(); // Initialize the LogManager and add the console log as this will be used every time @@ -225,8 +225,10 @@ bool OpenSpaceEngine::create(int argc, char** argv, // Sanity check of values if (argc < 1 || argv == nullptr) { - LFATAL("No arguments were passed to this function"); - return false; + throw ghoul::RuntimeError( + "No arguments were passed to this function", + "OpenSpaceEngine" + ); } // Create other objects @@ -244,7 +246,8 @@ bool OpenSpaceEngine::create(int argc, char** argv, bool showHelp = _engine->_commandlineParser->execute(); if (showHelp) { _engine->_commandlineParser->displayHelp(); - return false; + requestClose = true; + return; } sgctArguments = *arguments; @@ -252,13 +255,8 @@ bool OpenSpaceEngine::create(int argc, char** argv, std::string configurationFilePath = commandlineArgumentPlaceholders.configurationName; if (configurationFilePath.empty()) { LDEBUG("Finding configuration"); - try { - configurationFilePath = - ConfigurationManager::findConfiguration(configurationFilePath); - } - catch (const ghoul::RuntimeError& e) { - LFATALC(e.component, e.message); - } + configurationFilePath = + ConfigurationManager::findConfiguration(configurationFilePath); } configurationFilePath = absPath(configurationFilePath); LINFO("Configuration Path: '" << configurationFilePath << "'"); @@ -276,22 +274,21 @@ bool OpenSpaceEngine::create(int argc, char** argv, for (const documentation::TestResult::Warning& w : e.result.warnings) { LWARNINGC(w.offender, std::to_string(w.reason)); } - return false; - + throw; } catch (const ghoul::RuntimeError& e) { LFATAL("Loading of configuration file '" << configurationFilePath << "' failed"); - LFATALC(e.component, e.message); - return false; + throw; } - bool hasCacheCommandline = !commandlineArgumentPlaceholders.cacheFolder.empty(); - bool hasCacheConfiguration = _engine->configurationManager().hasKeyAndValue( + const bool hasCacheCommandline = !commandlineArgumentPlaceholders.cacheFolder.empty(); + const bool hasCacheConfiguration = _engine->configurationManager().hasKeyAndValue( ConfigurationManager::KeyPerSceneCache ); std::string cacheFolder = absPath("${CACHE}"); if (hasCacheCommandline) { cacheFolder = commandlineArgumentPlaceholders.cacheFolder; + // @CLEANUP: Why is this commented out? ---abock //FileSys.registerPathToken( // "${CACHE}", // commandlineArgumentPlaceholders.cacheFolder, @@ -321,7 +318,9 @@ bool OpenSpaceEngine::create(int argc, char** argv, LINFOC("OpenSpace Version", OPENSPACE_VERSION_MAJOR << "." << OPENSPACE_VERSION_MINOR << "." << - OPENSPACE_VERSION_PATCH << " (" << OPENSPACE_VERSION_STRING << ")"); + OPENSPACE_VERSION_PATCH << + " (" << OPENSPACE_VERSION_STRING << ")" + ); // Create directories that doesn't exist auto tokens = FileSys.tokens(); @@ -356,7 +355,7 @@ bool OpenSpaceEngine::create(int argc, char** argv, // Determining SGCT configuration file LDEBUG("Determining SGCT configuration file"); - std::string sgctConfigurationPath = _sgctDefaultConfigFile; + std::string sgctConfigurationPath = SgctDefaultConfigFile; _engine->configurationManager().getValue( ConfigurationManager::KeyConfigSgct, sgctConfigurationPath); @@ -369,13 +368,12 @@ bool OpenSpaceEngine::create(int argc, char** argv, // Prepend the outgoing sgctArguments with the program name // as well as the configuration file that sgct is supposed to use sgctArguments.insert(sgctArguments.begin(), argv[0]); - sgctArguments.insert(sgctArguments.begin() + 1, _sgctConfigArgumentCommand); + sgctArguments.insert(sgctArguments.begin() + 1, SgctConfigArgumentCommand); sgctArguments.insert(sgctArguments.begin() + 2, absPath(sgctConfigurationPath)); - - return true; } void OpenSpaceEngine::destroy() { + LTRACE("OpenSpaceEngine::destroy(begin)"); for (const auto& func : _engine->_moduleCallbacks.deinitializeGL) { func(); } @@ -398,9 +396,11 @@ void OpenSpaceEngine::destroy() { LogManager::deinitialize(); ghoul::deinitialize(); + LTRACE("OpenSpaceEngine::destroy(end)"); } -bool OpenSpaceEngine::initialize() { +void OpenSpaceEngine::initialize() { + LTRACE("OpenSpaceEngine::initialize(begin)"); // clear the screen so the user don't have to see old buffer contents from the // graphics card LDEBUG("Clearing all Windows"); @@ -420,19 +420,22 @@ bool OpenSpaceEngine::initialize() { using Verbosity = ghoul::systemcapabilities::SystemCapabilitiesComponent::Verbosity; Verbosity verbosity = Verbosity::Default; - if (configurationManager().hasKeyAndValue( - ConfigurationManager::KeyCapabilitiesVerbosity)) - { - std::map verbosityMap = { + if (configurationManager().hasKey(ConfigurationManager::KeyCapabilitiesVerbosity)) { + static const std::map VerbosityMap = { { "None", Verbosity::None }, { "Minimal", Verbosity::Minimal }, { "Default", Verbosity::Default }, { "Full", Verbosity::Full } }; - std::string v = configurationManager().value(ConfigurationManager::KeyCapabilitiesVerbosity); - if (verbosityMap.find(v) != verbosityMap.end()) - verbosity = verbosityMap[v]; + std::string v = configurationManager().value( + ConfigurationManager::KeyCapabilitiesVerbosity + ); + ghoul_assert( + VerbosityMap.find(v) != VerbosityMap.end(), + "Missing check for syscaps verbosity in openspace.cfg documentation" + ); + verbosity = VerbosityMap.find(v)->second; } SysCap.logCapabilities(verbosity); @@ -442,14 +445,21 @@ bool OpenSpaceEngine::initialize() { LINFO("Required OpenGL version: " << version.toString()); if (OpenGLCap.openGLVersion() < version) { - LFATAL("Module required higher OpenGL version than is supported"); - return false; + throw ghoul::RuntimeError( + "Module required higher OpenGL version than is supported", + "OpenSpaceEngine" + ); } - std::string requestURL = ""; - bool success = configurationManager().getValue(ConfigurationManager::KeyDownloadRequestURL, requestURL); - if (success) { - _downloadManager = std::make_unique(requestURL, DownloadVersion); + if (configurationManager().hasKey(ConfigurationManager::KeyDownloadRequestURL)) { + const std::string requestUrl = configurationManager().value( + ConfigurationManager::KeyDownloadRequestURL + ); + + _downloadManager = std::make_unique( + requestUrl, + DownloadVersion + ); } // Register Lua script functions @@ -465,19 +475,25 @@ bool OpenSpaceEngine::initialize() { writeDocumentation(); - bool disableMasterRendering = false; - configurationManager().getValue( - ConfigurationManager::KeyDisableMasterRendering, disableMasterRendering); - _renderEngine->setDisableRenderingOnMaster(disableMasterRendering); + if (configurationManager().hasKey(ConfigurationManager::KeyDisableMasterRendering)) { + const bool disableMasterRendering = configurationManager().value( + ConfigurationManager::KeyDisableMasterRendering + ); + _renderEngine->setDisableRenderingOnMaster(disableMasterRendering); + } - configurationManager().getValue( - ConfigurationManager::KeyShutdownCountdown, _shutdownWait - ); + if (configurationManager().hasKey(ConfigurationManager::KeyShutdownCountdown)) { + _shutdown.waitTime = configurationManager().value( + ConfigurationManager::KeyShutdownCountdown + ); + } - if (!commandlineArgumentPlaceholders.sceneName.empty()) + if (!commandlineArgumentPlaceholders.sceneName.empty()) { configurationManager().setValue( ConfigurationManager::KeyConfigScene, - commandlineArgumentPlaceholders.sceneName); + commandlineArgumentPlaceholders.sceneName + ); + } // Initialize the SettingsEngine _settingsEngine->initialize(); @@ -490,6 +506,8 @@ bool OpenSpaceEngine::initialize() { loadFonts(); // Initialize the Scene + // @CLEANUP: This should become a unique_ptr that is either created inside the + // renderengine or moved into it ---abock Scene* sceneGraph = new Scene; sceneGraph->initialize(); @@ -508,24 +526,23 @@ bool OpenSpaceEngine::initialize() { } // Run start up scripts - try { - runPreInitializationScripts(scenePath); - } - catch (const ghoul::RuntimeError& e) { - LFATALC(e.component, e.message); - } + runPreInitializationScripts(scenePath); _syncEngine->addSyncables(Time::ref().getSyncables()); _syncEngine->addSyncables(_renderEngine->getSyncables()); _syncEngine->addSyncable(_scriptEngine.get()); LINFO("Finished initializing"); - return true; + LTRACE("OpenSpaceEngine::initialize(end)"); } void OpenSpaceEngine::deinitialize() { + LTRACE("OpenSpaceEngine::deinitialize(begin)"); + _interactionHandler->deinitialize(); _renderEngine->deinitialize(); + + LTRACE("OpenSpaceEngine::deinitialize(end)"); } void OpenSpaceEngine::writeDocumentation() { @@ -538,13 +555,17 @@ void OpenSpaceEngine::writeDocumentation() { const bool hasLuaDocType = configurationManager().hasKey(LuaDocumentationType); const bool hasLuaDocFile = configurationManager().hasKey(LuaDocumentationFile); if (hasLuaDocType && hasLuaDocFile) { - std::string luaDocumentationType; - configurationManager().getValue(LuaDocumentationType, luaDocumentationType); - std::string luaDocumentationFile; - configurationManager().getValue(LuaDocumentationFile, luaDocumentationFile); + std::string luaDocumentationType = configurationManager().value( + LuaDocumentationType + ); + std::string luaDocumentationFile = configurationManager().value( + LuaDocumentationFile + ); - luaDocumentationFile = absPath(luaDocumentationFile); - _scriptEngine->writeDocumentation(luaDocumentationFile, luaDocumentationType); + _scriptEngine->writeDocumentation( + absPath(luaDocumentationFile), + luaDocumentationType + ); } // If a general documentation was specified, generate it now @@ -556,24 +577,40 @@ void OpenSpaceEngine::writeDocumentation() { const bool hasDocumentationType = configurationManager().hasKey(DocumentationType); const bool hasDocumentationFile = configurationManager().hasKey(DocumentationFile); if (hasDocumentationType && hasDocumentationFile) { - std::string documentationType; - configurationManager().getValue(DocumentationType, documentationType); - std::string documentationFile; - configurationManager().getValue(DocumentationFile, documentationFile); - documentationFile = absPath(documentationFile); - DocEng.writeDocumentation(documentationFile, documentationType); + std::string documentationType = configurationManager().value( + DocumentationType + ); + std::string documentationFile = configurationManager().value( + DocumentationFile + ); + + DocEng.writeDocumentation( + absPath(documentationFile), + documentationType + ); } const std::string FactoryDocumentationType = - ConfigurationManager::KeyFactoryDocumentation + '.' + ConfigurationManager::PartType; + ConfigurationManager::KeyFactoryDocumentation + '.' + + ConfigurationManager::PartType; const std::string FactoryDocumentationFile = - ConfigurationManager::KeyFactoryDocumentation + '.' + ConfigurationManager::PartFile; - bool hasFactoryDocumentationType = configurationManager().hasKey(FactoryDocumentationType); - bool hasFactoryDocumentationFile = configurationManager().hasKey(FactoryDocumentationFile); + ConfigurationManager::KeyFactoryDocumentation + '.' + + ConfigurationManager::PartFile; + + bool hasFactoryDocumentationType = configurationManager().hasKey( + FactoryDocumentationType + ); + bool hasFactoryDocumentationFile = configurationManager().hasKey( + FactoryDocumentationFile + ); if (hasFactoryDocumentationType && hasFactoryDocumentationFile) { - std::string type = configurationManager().value(FactoryDocumentationType); - std::string file = configurationManager().value(FactoryDocumentationFile); + std::string type = configurationManager().value( + FactoryDocumentationType + ); + std::string file = configurationManager().value( + FactoryDocumentationFile + ); FactoryManager::ref().writeDocumentation(absPath(file), type); } @@ -615,27 +652,8 @@ void OpenSpaceEngine::gatherCommandlineArguments() { )); } -void OpenSpaceEngine::runScripts(const ghoul::Dictionary& scripts) { - for (size_t i = 1; i <= scripts.size(); ++i) { - std::stringstream stream; - stream << i; - const std::string& key = stream.str(); - const bool hasKey = scripts.hasKeyAndValue(key); - if (!hasKey) { - LERROR("The startup scripts have to be declared in a simple array format." - " Startup scripts did not contain the key '" << key << "'"); - break; - } - - std::string scriptPath; - scripts.getValue(key, scriptPath); - std::string&& absoluteScriptPath = absPath(scriptPath); - _engine->scriptEngine().runScriptFile(absoluteScriptPath); - } -} - - void OpenSpaceEngine::runPreInitializationScripts(const std::string& sceneDescription) { + // @CLEANUP: Move this into the scene loading? ---abock LINFO("Running Initialization scripts"); ghoul::lua::LuaState state; @@ -645,24 +663,29 @@ void OpenSpaceEngine::runPreInitializationScripts(const std::string& sceneDescri ghoul::lua::runScriptFile(state, absPath(sceneDescription)); // Get the preinitialize function - lua_getglobal(state, PreInitializeFunction.c_str()); + lua_getglobal(state, PreInitializeFunction); bool isFunction = lua_isfunction(state, -1); if (!isFunction) { - LERROR("Error executing startup script '" << sceneDescription << "'. Scene '" << - sceneDescription << "' does not have a function '" << - PreInitializeFunction << "'"); + LERROR( + "Error executing startup script '" << sceneDescription << "'. Scene '" << + sceneDescription << "' does not have a function '" << + PreInitializeFunction << "'" + ); return; } // And execute the preinitialize function int success = lua_pcall(state, 0, 0, 0); if (success != 0) { - LERROR("Error executing '" << PreInitializeFunction << "': " << - lua_tostring(state, -1)); + LERROR( + "Error executing '" << PreInitializeFunction << "': " << + lua_tostring(state, -1) + ); } } void OpenSpaceEngine::runPostInitializationScripts(const std::string& sceneDescription) { + // @CLEANUP: Move this into the scene loading? ---abock LINFO("Running Setup scripts"); ghoul::lua::LuaState state; OsEng.scriptEngine().initializeLuaState(state); @@ -671,20 +694,23 @@ void OpenSpaceEngine::runPostInitializationScripts(const std::string& sceneDescr ghoul::lua::runScriptFile(state, absPath(sceneDescription)); // Get the preinitialize function - lua_getglobal(state, PostInitializationFunction.c_str()); + lua_getglobal(state, PostInitializationFunction); bool isFunction = lua_isfunction(state, -1); if (!isFunction) { - LERROR("Error executing startup script '" << sceneDescription << "'. Scene '" << - sceneDescription << "' does not have a function '" << - PostInitializationFunction << "'"); + LERROR( + "Error executing startup script '" << sceneDescription << "'. Scene '" << + sceneDescription << "' does not have a function '" << + PostInitializationFunction << "'" + ); return; } // And execute the preinitialize function int success = lua_pcall(state, 0, 0, 0); if (success != 0) { - LERROR("Error executing '" << PostInitializationFunction << "': " << - lua_tostring(state, -1) + LERROR( + "Error executing '" << PostInitializationFunction << "': " << + lua_tostring(state, -1) ); } } @@ -693,12 +719,11 @@ void OpenSpaceEngine::loadFonts() { ghoul::Dictionary fonts; configurationManager().getValue(ConfigurationManager::KeyFonts, fonts); - const glm::ivec3 fontAtlasSize{1024, 1024, 1}; + glm::ivec3 fontAtlasSize{1024, 1024, 1}; _fontManager = std::make_unique(fontAtlasSize); for (const std::string& key : fonts.keys()) { - std::string font; - fonts.getValue(key, font); + std::string font = fonts.value(key); font = absPath(font); if (!FileSys.fileExists(font)) { @@ -736,7 +761,7 @@ void OpenSpaceEngine::configureLogging() { ConfigurationManager::KeyLogging + '.' + ConfigurationManager::PartLogs; if (configurationManager().hasKeyAndValue(KeyLogLevel)) { - std::string logLevel; + std::string logLevel = "Info"; configurationManager().getValue(KeyLogLevel, logLevel); bool immediateFlush = false; @@ -749,16 +774,15 @@ void OpenSpaceEngine::configureLogging() { level, immediateFlush ? ImmediateFlush::Yes : ImmediateFlush::No ); + LogMgr.addLog(std::make_unique()); } if (configurationManager().hasKeyAndValue(KeyLogs)) { - ghoul::Dictionary logs; - configurationManager().getValue(KeyLogs, logs); + ghoul::Dictionary logs = configurationManager().value(KeyLogs); for (size_t i = 1; i <= logs.size(); ++i) { - ghoul::Dictionary logInfo; - logs.getValue(std::to_string(i), logInfo); + ghoul::Dictionary logInfo = logs.value(std::to_string(i)); try { LogMgr.addLog(createLog(logInfo)); @@ -776,19 +800,24 @@ void OpenSpaceEngine::configureLogging() { #endif // WIN32 #ifndef GHOUL_LOGGING_ENABLE_TRACE - std::string logLevel; + std::string logLevel = "Info"; configurationManager().getValue(KeyLogLevel, logLevel); LogLevel level = ghoul::logging::levelFromString(logLevel); if (level == ghoul::logging::LogLevel::Trace) { - LWARNING("Desired logging level is set to 'Trace' but application was " << - "compiled without Trace support"); + LWARNING( + "Desired logging level is set to 'Trace' but application was " << + "compiled without Trace support" + ); } #endif // GHOUL_LOGGING_ENABLE_TRACE } -bool OpenSpaceEngine::initializeGL() { +void OpenSpaceEngine::initializeGL() { + LTRACE("OpenSpaceEngine::initializeGL(begin)"); + LINFO("Initializing Rendering Engine"); + // @CLEANUP: Remove the return statement and replace with exceptions ---abock bool success = _renderEngine->initializeGL(); for (const auto& func : _moduleCallbacks.initializeGL) { @@ -797,10 +826,12 @@ bool OpenSpaceEngine::initializeGL() { LINFO("Finished initializing OpenGL"); - // If using swapgroups, - LINFO("_windowWrapper->isUsingSwapGroups(): " << _windowWrapper->isUsingSwapGroups()); - LINFO("_windowWrapper->isSwapGroupMaster(): " << _windowWrapper->isSwapGroupMaster()); - return success; + // If using swapgroups, + + LINFO("IsUsingSwapGroups: " << _windowWrapper->isUsingSwapGroups()); + LINFO("IsSwapGroupMaster: " << _windowWrapper->isSwapGroupMaster()); + + LTRACE("OpenSpaceEngine::initializeGL(end)"); } double OpenSpaceEngine::runTime() { @@ -812,6 +843,7 @@ void OpenSpaceEngine::setRunTime(double d) { } void OpenSpaceEngine::preSynchronization() { + LTRACE("OpenSpaceEngine::preSynchronization(begin)"); FileSys.triggerFilesystemEvents(); if (_isFirstRenderingFirstFrame) { @@ -845,17 +877,20 @@ void OpenSpaceEngine::preSynchronization() { for (const auto& func : _moduleCallbacks.preSync) { func(); } + LTRACE("OpenSpaceEngine::preSynchronization(end)"); } void OpenSpaceEngine::postSynchronizationPreDraw() { + LTRACE("OpenSpaceEngine::postSynchronizationPreDraw(begin)"); + bool master = _windowWrapper->isMaster(); _syncEngine->postsync(master); - if (_isInShutdownMode) { - if (_shutdownCountdown <= 0.f) { + if (_shutdown.inShutdown) { + if (_shutdown.timer <= 0.f) { _windowWrapper->terminate(); } - _shutdownCountdown -= _windowWrapper->averageDeltaTime(); + _shutdown.timer -= _windowWrapper->averageDeltaTime(); } _renderEngine->updateSceneGraph(); @@ -893,11 +928,15 @@ void OpenSpaceEngine::postSynchronizationPreDraw() { } LogMgr.resetMessageCounters(); + + LTRACE("OpenSpaceEngine::postSynchronizationPreDraw(end)"); } -void OpenSpaceEngine::render(const glm::mat4& projectionMatrix, const glm::mat4& viewMatrix) { +void OpenSpaceEngine::render(const glm::mat4& viewMatrix, + const glm::mat4& projectionMatrix) +{ LTRACE("OpenSpaceEngine::render(begin)"); - _renderEngine->render(projectionMatrix, viewMatrix); + _renderEngine->render(viewMatrix, projectionMatrix); for (const auto& func : _moduleCallbacks.render) { func(); @@ -907,12 +946,16 @@ void OpenSpaceEngine::render(const glm::mat4& projectionMatrix, const glm::mat4& } void OpenSpaceEngine::postDraw() { + LTRACE("OpenSpaceEngine::postDraw(begin)"); + _renderEngine->postDraw(); for (const auto& func : _moduleCallbacks.postDraw) { func(); } + // @CLEANUP: Replace the two windows by a single call to whether a gui should be + // rendered ---abock bool showGui = _windowWrapper->hasGuiWindow() ? _windowWrapper->isGuiWindow() : true; if (showGui) { _renderEngine->renderScreenLog(); @@ -920,8 +963,8 @@ void OpenSpaceEngine::postDraw() { _console->render(); } - if (_isInShutdownMode) { - _renderEngine->renderShutdownInformation(_shutdownCountdown, _shutdownWait); + if (_shutdown.inShutdown) { + _renderEngine->renderShutdownInformation(_shutdown.timer, _shutdown.waitTime); } if (_isFirstRenderingFirstFrame) { @@ -929,6 +972,7 @@ void OpenSpaceEngine::postDraw() { _isFirstRenderingFirstFrame = false; } + LTRACE("OpenSpaceEngine::postDraw(end)"); } void OpenSpaceEngine::keyboardCallback(Key key, KeyModifier mod, KeyAction action) { @@ -939,11 +983,15 @@ void OpenSpaceEngine::keyboardCallback(Key key, KeyModifier mod, KeyAction actio } } + // @CLEANUP: Remove the commandInputButton and replace with a method just based + // on Lua by binding a key to the Lua script toggling the console ---abock if (key == _console->commandInputButton()) { if (action == KeyAction::Press) { _console->toggleMode(); } } else if (!_console->isVisible()) { + // @CLEANUP: Make the interaction handler return whether a key has been consumed + // and then pass it on to the console ---abock _interactionHandler->keyboardCallback(key, mod, action); } else { _console->keyboardCallback(key, mod, action); @@ -1015,16 +1063,16 @@ void OpenSpaceEngine::externalControlCallback(const char* receivedChars, int siz } void OpenSpaceEngine::toggleShutdownMode() { - if (_isInShutdownMode) { - // If we are already in shutdown mode, we want to disable it instead + if (_shutdown.inShutdown) { + // If we are already in shutdown mode, we want to disable it LINFO("Disabled shutdown mode"); - _isInShutdownMode = false; + _shutdown.inShutdown = false; } else { - // Else, we hav eto enable it + // Else, we have to enable it LINFO("Shutting down OpenSpace"); - _shutdownCountdown = _shutdownWait; - _isInShutdownMode = true; + _shutdown.timer = _shutdown.waitTime; + _shutdown.inShutdown = true; } } @@ -1049,14 +1097,6 @@ scripting::LuaLibrary OpenSpaceEngine::luaLibrary() { }; } -bool OpenSpaceEngine::useBusyWaitForDecode() { - return _settingsEngine->busyWaitForDecode(); -} - -bool OpenSpaceEngine::logSGCTOutOfOrderErrors() { - return _settingsEngine->logSGCTOutOfOrderErrors(); -} - void OpenSpaceEngine::enableBarrier() { _windowWrapper->setBarrier(true); } @@ -1096,6 +1136,21 @@ void OpenSpaceEngine::registerModuleMouseScrollWheelCallback( _moduleCallbacks.mouseScrollWheel.push_back(std::move(function)); } +ConfigurationManager& OpenSpaceEngine::configurationManager() { + ghoul_assert(_configurationManager, "ConfigurationManager must not be nullptr"); + return *_configurationManager; +} + +LuaConsole& OpenSpaceEngine::console() { + ghoul_assert(_console, "LuaConsole must not be nullptr"); + return *_console; +} + +DownloadManager& OpenSpaceEngine::downloadManager() { + ghoul_assert(_downloadManager, "Download Manager must not be nullptr"); + return *_downloadManager; +} + NetworkEngine& OpenSpaceEngine::networkEngine() { ghoul_assert(_networkEngine, "NetworkEngine must not be nullptr"); return *_networkEngine; @@ -1106,9 +1161,34 @@ ModuleEngine& OpenSpaceEngine::moduleEngine() { return *_moduleEngine; } -ConfigurationManager& OpenSpaceEngine::configurationManager() { - ghoul_assert(_configurationManager, "ConfigurationManager must not be nullptr"); - return *_configurationManager; +ParallelConnection& OpenSpaceEngine::parallelConnection() { + ghoul_assert(_parallelConnection, "ParallelConnection must not be nullptr"); + return *_parallelConnection; +} + +RenderEngine& OpenSpaceEngine::renderEngine() { + ghoul_assert(_renderEngine, "RenderEngine must not be nullptr"); + return *_renderEngine; +} + +SettingsEngine& OpenSpaceEngine::settingsEngine() { + ghoul_assert(_settingsEngine, "Settings Engine must not be nullptr"); + return *_settingsEngine; +} + +TimeManager& OpenSpaceEngine::timeManager() { + ghoul_assert(_timeManager, "Download Manager must not be nullptr"); + return *_timeManager; +} + +WindowWrapper& OpenSpaceEngine::windowWrapper() { + ghoul_assert(_windowWrapper, "Window Wrapper must not be nullptr"); + return *_windowWrapper; +} + +ghoul::fontrendering::FontManager& OpenSpaceEngine::fontManager() { + ghoul_assert(_fontManager, "Font Manager must not be nullptr"); + return *_fontManager; } interaction::InteractionHandler& OpenSpaceEngine::interactionHandler() { @@ -1116,31 +1196,6 @@ interaction::InteractionHandler& OpenSpaceEngine::interactionHandler() { return *_interactionHandler; } -RenderEngine& OpenSpaceEngine::renderEngine() { - ghoul_assert(_renderEngine, "RenderEngine must not be nullptr"); - return *_renderEngine; -} - -ScriptEngine& OpenSpaceEngine::scriptEngine() { - ghoul_assert(_scriptEngine, "ScriptEngine must not be nullptr"); - return *_scriptEngine; -} - -ScriptScheduler& OpenSpaceEngine::scriptScheduler(){ - ghoul_assert(_scriptScheduler, "ScriptScheduler must not be nullptr"); - return *_scriptScheduler; -} - -LuaConsole& OpenSpaceEngine::console() { - ghoul_assert(_console, "LuaConsole must not be nullptr"); - return *_console; -} - -ParallelConnection& OpenSpaceEngine::parallelConnection() { - ghoul_assert(_parallelConnection, "ParallelConnection must not be nullptr"); - return *_parallelConnection; -} - properties::PropertyOwner& OpenSpaceEngine::globalPropertyOwner() { ghoul_assert( _globalPropertyNamespace, @@ -1149,29 +1204,14 @@ properties::PropertyOwner& OpenSpaceEngine::globalPropertyOwner() { return *_globalPropertyNamespace; } -WindowWrapper& OpenSpaceEngine::windowWrapper() { - ghoul_assert(_windowWrapper, "Window Wrapper must not be nullptr"); - return *_windowWrapper; -} - -ghoul::fontrendering::FontManager& OpenSpaceEngine::fontManager() { - ghoul_assert(_fontManager, "Font Manager must not be nullptr"); - return *_fontManager; +ScriptEngine& OpenSpaceEngine::scriptEngine() { + ghoul_assert(_scriptEngine, "ScriptEngine must not be nullptr"); + return *_scriptEngine; } -DownloadManager& OpenSpaceEngine::downloadManager() { - ghoul_assert(_downloadManager, "Download Manager must not be nullptr"); - return *_downloadManager; -} - -TimeManager& OpenSpaceEngine::timeManager() { - ghoul_assert(_timeManager, "Download Manager must not be nullptr"); - return *_timeManager; -} - -SettingsEngine& OpenSpaceEngine::settingsEngine() { - ghoul_assert(_settingsEngine, "Settings Engine must not be nullptr"); - return *_settingsEngine; +ScriptScheduler& OpenSpaceEngine::scriptScheduler() { + ghoul_assert(_scriptScheduler, "ScriptScheduler must not be nullptr"); + return *_scriptScheduler; } } // namespace openspace diff --git a/src/rendering/renderengine.cpp b/src/rendering/renderengine.cpp index 5a9b5082ff..b19a2cfcff 100644 --- a/src/rendering/renderengine.cpp +++ b/src/rendering/renderengine.cpp @@ -468,7 +468,8 @@ void RenderEngine::updateFade() { } } -void RenderEngine::render(const glm::mat4& projectionMatrix, const glm::mat4& viewMatrix){ +void RenderEngine::render(const glm::mat4& viewMatrix, const glm::mat4& projectionMatrix) +{ LTRACE("RenderEngine::render(begin)"); _mainCamera->sgctInternal.setViewMatrix(viewMatrix); _mainCamera->sgctInternal.setProjectionMatrix(projectionMatrix); diff --git a/tests/main.cpp b/tests/main.cpp index df340ba31b..354b19dca7 100644 --- a/tests/main.cpp +++ b/tests/main.cpp @@ -83,7 +83,8 @@ namespace { int main(int argc, char** argv) { std::vector args; - openspace::OpenSpaceEngine::create(argc, argv, std::make_unique(), args); + bool close; + openspace::OpenSpaceEngine::create(argc, argv, std::make_unique(), args, close); testing::InitGoogleTest(&argc, argv); From 5bf729dca9f71e54f1e332446f6ee147d67db2c6 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Sat, 25 Feb 2017 18:40:34 -0500 Subject: [PATCH 39/96] Compile fix for Dataconverter --- modules/volume/textureslicevolumereader.inl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/volume/textureslicevolumereader.inl b/modules/volume/textureslicevolumereader.inl index a7d2b09100..6a3513383e 100644 --- a/modules/volume/textureslicevolumereader.inl +++ b/modules/volume/textureslicevolumereader.inl @@ -29,7 +29,7 @@ namespace openspace { template VoxelType TextureSliceVolumeReader::get(const glm::ivec3& coordinates) const { ghoul::opengl::Texture& slice = getSlice(coordinates.z); - return slice.texel(coordinates.xy()); + return slice.texel(glm::ivec2(coordinates)); } template @@ -52,7 +52,7 @@ void TextureSliceVolumeReader::initialize() { std::shared_ptr firstSlice = ghoul::io::TextureReader::ref().loadTexture(_paths[0]); - _sliceDimensions = firstSlice->dimensions().xy(); + _sliceDimensions = firstSlice->dimensions(); _initialized = true; _cache.set(0, firstSlice); } @@ -72,7 +72,7 @@ ghoul::opengl::Texture& TextureSliceVolumeReader::getSlice(int sliceI std::shared_ptr texture = ghoul::io::TextureReader::ref().loadTexture(_paths[sliceIndex]); - glm::ivec2 dims = texture->dimensions().xy(); + glm::ivec2 dims = texture->dimensions(); ghoul_assert(dims == _sliceDimensions, "Slice dimensions do not agree."); _cache.set(sliceIndex, std::move(texture)); } From 3cd5bfe138b7a3e5a14c50597e5f797b3b27b6e2 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Sat, 25 Feb 2017 18:41:20 -0500 Subject: [PATCH 40/96] Update Ghoul repository --- ext/ghoul | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/ghoul b/ext/ghoul index 7d1bac81e1..6881033dc5 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 7d1bac81e113f81ddbed6fca864c084f039fde12 +Subproject commit 6881033dc58549d70ae3d5e1c46d9b8750cf7002 From 6704491fdc263674a58c5c8b3674afc93a41aaaa Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Sat, 25 Feb 2017 19:19:31 -0500 Subject: [PATCH 41/96] More cleanup in OpenSpaceEngine --- include/openspace/engine/openspaceengine.h | 37 ++---------------- src/engine/openspaceengine.cpp | 45 +++++++++++++++++----- 2 files changed, 39 insertions(+), 43 deletions(-) diff --git a/include/openspace/engine/openspaceengine.h b/include/openspace/engine/openspaceengine.h index 12e17d6a03..7a12cc6e2a 100644 --- a/include/openspace/engine/openspaceengine.h +++ b/include/openspace/engine/openspaceengine.h @@ -74,7 +74,6 @@ public: std::unique_ptr windowWrapper, std::vector& sgctArguments, bool& requestClose); static void destroy(); - static bool isInitialized(); static OpenSpaceEngine& ref(); double runTime(); @@ -104,8 +103,7 @@ public: void toggleShutdownMode(); void runPostInitializationScripts(const std::string& sceneDescription); - - + // Guaranteed to return a valid pointer ConfigurationManager& configurationManager(); LuaConsole& console(); @@ -137,34 +135,7 @@ public: }; // Registers a callback for a specific CallbackOption - void registerModuleCallback(CallbackOption option, std::function function) { - switch (option) { - case CallbackOption::Initialize: - _moduleCallbacks.initialize.push_back(std::move(function)); - break; - case CallbackOption::Deinitialize: - _moduleCallbacks.deinitialize.push_back(std::move(function)); - break; - case CallbackOption::InitializeGL: - _moduleCallbacks.initializeGL.push_back(std::move(function)); - break; - case CallbackOption::DeinitializeGL: - _moduleCallbacks.deinitializeGL.push_back(std::move(function)); - break; - case CallbackOption::PreSync: - _moduleCallbacks.preSync.push_back(std::move(function)); - break; - case CallbackOption::PostSyncPreDraw: - _moduleCallbacks.postSyncPreDraw.push_back(std::move(function)); - break; - case CallbackOption::Render: - _moduleCallbacks.render.push_back(std::move(function)); - break; - case CallbackOption::PostDraw: - _moduleCallbacks.postDraw.push_back(std::move(function)); - break; - } - } + void registerModuleCallback(CallbackOption option, std::function function); // Registers a callback that is called when a new keyboard event is received void registerModuleKeyboardCallback( @@ -192,10 +163,10 @@ public: static scripting::LuaLibrary luaLibrary(); private: - OpenSpaceEngine(std::string programName, std::unique_ptr windowWrapper); + OpenSpaceEngine(std::string programName, + std::unique_ptr windowWrapper); ~OpenSpaceEngine() = default; - void clearAllWindows(); void gatherCommandlineArguments(); void loadFonts(); void runPreInitializationScripts(const std::string& sceneDescription); diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index 9751553fe8..0f8b535d35 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -404,7 +404,7 @@ void OpenSpaceEngine::initialize() { // clear the screen so the user don't have to see old buffer contents from the // graphics card LDEBUG("Clearing all Windows"); - clearAllWindows(); + _windowWrapper->clearAllWindows(glm::vec4(0.f, 0.f, 0.f, 1.f)); LDEBUG("Adding system components"); // Detect and log OpenCL and OpenGL versions and available devices @@ -616,14 +616,6 @@ void OpenSpaceEngine::writeDocumentation() { } } -bool OpenSpaceEngine::isInitialized() { - return _engine != nullptr; -} - -void OpenSpaceEngine::clearAllWindows() { - _windowWrapper->clearAllWindows(glm::vec4(0.f, 0.f, 0.f, 1.f)); -} - void OpenSpaceEngine::gatherCommandlineArguments() { commandlineArgumentPlaceholders.configurationName = ""; _commandlineParser->addCommand(std::make_unique>( @@ -1104,7 +1096,40 @@ void OpenSpaceEngine::enableBarrier() { void OpenSpaceEngine::disableBarrier() { _windowWrapper->setBarrier(false); } - + +// Registers a callback for a specific CallbackOption +void OpenSpaceEngine::registerModuleCallback(OpenSpaceEngine::CallbackOption option, + std::function function) +{ + switch (option) { + case CallbackOption::Initialize: + _moduleCallbacks.initialize.push_back(std::move(function)); + break; + case CallbackOption::Deinitialize: + _moduleCallbacks.deinitialize.push_back(std::move(function)); + break; + case CallbackOption::InitializeGL: + _moduleCallbacks.initializeGL.push_back(std::move(function)); + break; + case CallbackOption::DeinitializeGL: + _moduleCallbacks.deinitializeGL.push_back(std::move(function)); + break; + case CallbackOption::PreSync: + _moduleCallbacks.preSync.push_back(std::move(function)); + break; + case CallbackOption::PostSyncPreDraw: + _moduleCallbacks.postSyncPreDraw.push_back(std::move(function)); + break; + case CallbackOption::Render: + _moduleCallbacks.render.push_back(std::move(function)); + break; + case CallbackOption::PostDraw: + _moduleCallbacks.postDraw.push_back(std::move(function)); + break; + default: + ghoul_assert(false, "Missing case label"); + } +} void OpenSpaceEngine::registerModuleKeyboardCallback( std::function function) From 283c83e37c322d8cf7bb62bf5c1a6d2e7111126d Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Sun, 26 Feb 2017 23:45:39 -0500 Subject: [PATCH 42/96] Removing code analysis warnings Start cleaning RenderEngine --- ext/ghoul | 2 +- include/openspace/rendering/renderengine.h | 4 --- modules/base/rendering/renderablemodel.cpp | 2 +- modules/globebrowsing/tile/rawtile.cpp | 2 +- modules/globebrowsing/tile/tiledataset.cpp | 10 +++---- modules/globebrowsing/tile/tiledatatype.cpp | 2 +- .../tile/tileprovider/cachingtileprovider.cpp | 2 +- .../tile/tileprovider/texttileprovider.cpp | 2 -- modules/iswa/util/dataprocessorjson.cpp | 4 +-- modules/iswa/util/dataprocessorkameleon.cpp | 2 +- modules/iswa/util/dataprocessortext.cpp | 4 +-- .../multiresvolume/rendering/brickmanager.cpp | 4 +-- .../rendering/errorhistogrammanager.cpp | 2 +- .../rendering/localtfbrickselector.cpp | 2 +- modules/newhorizons/util/hongkangparser.cpp | 8 ++--- .../newhorizons/util/projectioncomponent.cpp | 2 +- modules/space/translation/tletranslation.cpp | 24 +++++++++++++++ modules/volume/volumeutils.cpp | 10 +++---- src/engine/openspaceengine.cpp | 2 +- src/engine/wrapper/sgctwindowwrapper.cpp | 4 +-- src/rendering/renderengine.cpp | 29 ++++++++----------- src/util/timemanager.cpp | 4 +-- 22 files changed, 68 insertions(+), 59 deletions(-) diff --git a/ext/ghoul b/ext/ghoul index 6881033dc5..6034743e6e 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 6881033dc58549d70ae3d5e1c46d9b8750cf7002 +Subproject commit 6034743e6ef7b066745811e58504a3e3a26f1bf2 diff --git a/include/openspace/rendering/renderengine.h b/include/openspace/rendering/renderengine.h index e67abec3d0..8e9f60f96c 100644 --- a/include/openspace/rendering/renderengine.h +++ b/include/openspace/rendering/renderengine.h @@ -74,10 +74,6 @@ public: FPSAvg }; - static const std::string KeyFontMono; - static const std::string KeyFontLight; - static const std::vector FrametimeTypes; - RenderEngine(); ~RenderEngine(); diff --git a/modules/base/rendering/renderablemodel.cpp b/modules/base/rendering/renderablemodel.cpp index 2b5746f21b..7ce5288317 100644 --- a/modules/base/rendering/renderablemodel.cpp +++ b/modules/base/rendering/renderablemodel.cpp @@ -226,7 +226,7 @@ void RenderableModel::render(const RenderData& data) { void RenderableModel::update(const UpdateData& data) { if (_programObject->isDirty()) _programObject->rebuildFromFile(); - double _time = data.time; +// double _time = data.time; //if (_isGhost){ // futureTime = openspace::ImageSequencer::ref().getNextCaptureTime(); diff --git a/modules/globebrowsing/tile/rawtile.cpp b/modules/globebrowsing/tile/rawtile.cpp index a0a3f4c00c..80471264db 100644 --- a/modules/globebrowsing/tile/rawtile.cpp +++ b/modules/globebrowsing/tile/rawtile.cpp @@ -88,7 +88,7 @@ RawTile RawTile::deserializeMetaData(std::istream& is) { char binaryDataSeparator; is >> binaryDataSeparator; // not used - char* buffer = new char[res.nBytesImageData](); +// char* buffer = new char[res.nBytesImageData](); return std::move(res); } diff --git a/modules/globebrowsing/tile/tiledataset.cpp b/modules/globebrowsing/tile/tiledataset.cpp index 67cb2a5dcd..9934234346 100644 --- a/modules/globebrowsing/tile/tiledataset.cpp +++ b/modules/globebrowsing/tile/tiledataset.cpp @@ -85,7 +85,7 @@ TileDataset::IODescription TileDataset::IODescription::cut(PixelRegion::Side sid ratio.x = write.region.numPixels.x / (double) read.region.numPixels.x; ratio.y = write.region.numPixels.y / (double) read.region.numPixels.y; - double ratioRatio = ratio.x / ratio.y; +// double ratioRatio = ratio.x / ratio.y; //ghoul_assert(glm::abs(ratioRatio - 1.0) < 0.01, "Different read/write aspect ratio!"); @@ -439,7 +439,7 @@ PixelRegion TileDataset::gdalPixelRegion(const GeodeticPatch& geodeticPatch) con GDALRasterBand* TileDataset::gdalRasterBand(int overview, int raster) const { GDALRasterBand* rasterBand = _dataset->GetRasterBand(raster); - int numberOfOverviews = rasterBand->GetOverviewCount(); +// int numberOfOverviews = rasterBand->GetOverviewCount(); rasterBand = gdalHasOverviews() ? rasterBand->GetOverview(overview) : rasterBand; ghoul_assert(rasterBand != nullptr, "Rasterband is null"); return rasterBand; @@ -637,7 +637,7 @@ CPLErr TileDataset::repeatedRasterIO(GDALRasterBand* rasterBand, const IODescrip // +--------------+ if (cutoff.read.region.area() > 0) { - didCutOff = true; +// didCutOff = true; // Wrap by repeating PixelRegion::Side oppositeSide = (PixelRegion::Side) ((i + 2) % 4); @@ -676,7 +676,7 @@ CPLErr TileDataset::repeatedRasterIO(GDALRasterBand* rasterBand, const IODescrip } CPLErr err = rasterIO(rasterBand, io, dataDestination); - worstError = std::max(worstError, err); +// worstError = std::max(worstError, err); // The return error from a repeated rasterIO is ONLY based on the main region, // which in the usual case will cover the main area of the patch anyway @@ -732,7 +732,7 @@ std::shared_ptr TileDataset::getTileMetaData( const PixelRegion& region) const { size_t bytesPerLine = _dataLayout.bytesPerPixel * region.numPixels.x; - size_t totalNumBytes = bytesPerLine * region.numPixels.y; +// size_t totalNumBytes = bytesPerLine * region.numPixels.y; TileMetaData* preprocessData = new TileMetaData(); preprocessData->maxValues.resize(_dataLayout.numRasters); diff --git a/modules/globebrowsing/tile/tiledatatype.cpp b/modules/globebrowsing/tile/tiledatatype.cpp index 675751876c..849e92c6be 100644 --- a/modules/globebrowsing/tile/tiledatatype.cpp +++ b/modules/globebrowsing/tile/tiledatatype.cpp @@ -98,7 +98,7 @@ size_t getMaximumValue(GDALDataType gdalType) { case GDT_Int16: return 1 << 15; case GDT_UInt32: - return 1 << 32; + return size_t(1) << 32; case GDT_Int32: return 1 << 31; default: diff --git a/modules/globebrowsing/tile/tileprovider/cachingtileprovider.cpp b/modules/globebrowsing/tile/tileprovider/cachingtileprovider.cpp index 5cbacec25f..407843dabd 100644 --- a/modules/globebrowsing/tile/tileprovider/cachingtileprovider.cpp +++ b/modules/globebrowsing/tile/tileprovider/cachingtileprovider.cpp @@ -199,7 +199,7 @@ Tile CachingTileProvider::createTile(std::shared_ptr rawTile) { return{ nullptr, nullptr, Tile::Status::IOError }; } - TileIndex::TileHashKey key = rawTile->tileIndex.hashKey(); +// TileIndex::TileHashKey key = rawTile->tileIndex.hashKey(); TileDataLayout dataLayout = _asyncTextureDataProvider->getTextureDataProvider()->getDataLayout(); diff --git a/modules/globebrowsing/tile/tileprovider/texttileprovider.cpp b/modules/globebrowsing/tile/tileprovider/texttileprovider.cpp index 74abeb3f18..917443a41b 100644 --- a/modules/globebrowsing/tile/tileprovider/texttileprovider.cpp +++ b/modules/globebrowsing/tile/tileprovider/texttileprovider.cpp @@ -108,8 +108,6 @@ Tile TextTileProvider::createChunkIndexTile(const TileIndex& tileIndex) { 0 ); - GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); - glViewport( 0, 0, static_cast(tile.texture->width()), diff --git a/modules/iswa/util/dataprocessorjson.cpp b/modules/iswa/util/dataprocessorjson.cpp index 29a45b06ef..ecd6ea1b95 100644 --- a/modules/iswa/util/dataprocessorjson.cpp +++ b/modules/iswa/util/dataprocessorjson.cpp @@ -80,7 +80,7 @@ void DataProcessorJson::addDataValues(std::string data, properties::SelectionPro for(int i=0; i DataProcessorJson::processData(std::string data, properties: json variables = j["variables"]; std::vector selectedOptions = dataOptions.value(); - int numSelected = selectedOptions.size(); +// int numSelected = selectedOptions.size(); auto options = dataOptions.options(); int numOptions = options.size(); diff --git a/modules/iswa/util/dataprocessorkameleon.cpp b/modules/iswa/util/dataprocessorkameleon.cpp index a9270e8089..c36763b66d 100644 --- a/modules/iswa/util/dataprocessorkameleon.cpp +++ b/modules/iswa/util/dataprocessorkameleon.cpp @@ -112,7 +112,7 @@ std::vector DataProcessorKameleon::processData(std::string path, propert initializeKameleonWrapper(path); std::vector selectedOptions = dataOptions.value(); - int numSelected = selectedOptions.size(); +// int numSelected = selectedOptions.size(); auto options = dataOptions.options(); int numOptions = options.size(); diff --git a/modules/iswa/util/dataprocessortext.cpp b/modules/iswa/util/dataprocessortext.cpp index cdb7becdc1..96a6fb27bf 100644 --- a/modules/iswa/util/dataprocessortext.cpp +++ b/modules/iswa/util/dataprocessortext.cpp @@ -150,7 +150,7 @@ std::vector DataProcessorText::processData(std::string data, properties: std::stringstream memorystream(data); std::vector selectedOptions = dataOptions.value(); - int numSelected = selectedOptions.size(); +// int numSelected = selectedOptions.size(); int numOptions = dataOptions.options().size(); std::vector values; @@ -195,7 +195,7 @@ std::vector DataProcessorText::processData(std::string data, properties: // } // ----------- OLD METHODS ------------------------ - first = 0; +// first = 0; last = 0; option = -3; lineSize = line.size(); diff --git a/modules/multiresvolume/rendering/brickmanager.cpp b/modules/multiresvolume/rendering/brickmanager.cpp index 211da49921..56a66f1ccd 100644 --- a/modules/multiresvolume/rendering/brickmanager.cpp +++ b/modules/multiresvolume/rendering/brickmanager.cpp @@ -424,14 +424,12 @@ bool BrickManager::DiskToPBO(BUFFER_INDEX _pboIndex) { } } - - delete[] seqBuffer; - } // if in pbo // Update the brick index brickIndex += sequence; + delete[] seqBuffer; } glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER); diff --git a/modules/multiresvolume/rendering/errorhistogrammanager.cpp b/modules/multiresvolume/rendering/errorhistogrammanager.cpp index f8a2e02250..03e8f78fbf 100644 --- a/modules/multiresvolume/rendering/errorhistogrammanager.cpp +++ b/modules/multiresvolume/rendering/errorhistogrammanager.cpp @@ -94,7 +94,7 @@ bool ErrorHistogramManager::buildFromLeaf(unsigned int bstOffset, unsigned int o int numOtNodes = _tsp->numOTNodes(); unsigned int leafIndex = bstOffset * numOtNodes + octreeOffset; std::vector leafValues = readValues(leafIndex); - int numVoxels = leafValues.size(); +// int numVoxels = leafValues.size(); int bstNode = bstOffset; bool bstRightOnly = true; diff --git a/modules/multiresvolume/rendering/localtfbrickselector.cpp b/modules/multiresvolume/rendering/localtfbrickselector.cpp index b74b8212d4..b20c1c7a48 100644 --- a/modules/multiresvolume/rendering/localtfbrickselector.cpp +++ b/modules/multiresvolume/rendering/localtfbrickselector.cpp @@ -91,7 +91,7 @@ void LocalTfBrickSelector::selectBricks(int timestep, std::vector& bricks) unsigned int brickIndex = bs.brickIndex; priorityQueue.pop_back(); if (bs.splitType == BrickSelection::SplitType::Temporal) { - int timeSpanCenter = bs.centerT(); +// int timeSpanCenter = bs.centerT(); unsigned int childBrickIndex; bool pickRightTimeChild = bs.timestepInRightChild(timestep); diff --git a/modules/newhorizons/util/hongkangparser.cpp b/modules/newhorizons/util/hongkangparser.cpp index c09bf2a594..cd6ef04e84 100644 --- a/modules/newhorizons/util/hongkangparser.cpp +++ b/modules/newhorizons/util/hongkangparser.cpp @@ -273,12 +273,11 @@ bool HongKangParser::augmentWithSpice(Image& image, std::string spacecraft, } for (int i = 0; i < potentialTargets.size(); ++i) { - bool _withinFOV = false; for (int j = 0; j < image.activeInstruments.size(); ++j) { double time = image.timeRange.start; for (int k = 0; k < exposureTime; k++) { time += k; - _withinFOV = SpiceManager::ref().isTargetInFieldOfView( + bool withinFOV = SpiceManager::ref().isTargetInFieldOfView( potentialTargets[i], spacecraft, image.activeInstruments[j], @@ -287,9 +286,8 @@ bool HongKangParser::augmentWithSpice(Image& image, std::string spacecraft, time ); - if (_withinFOV) { + if (withinFOV) { image.target = potentialTargets[i]; - _withinFOV = false; } } } @@ -327,4 +325,4 @@ double HongKangParser::getMetFromET(double et) { } } -} // namespace openspace \ No newline at end of file +} // namespace openspace diff --git a/modules/newhorizons/util/projectioncomponent.cpp b/modules/newhorizons/util/projectioncomponent.cpp index 6ed193e351..1a02f16fa8 100644 --- a/modules/newhorizons/util/projectioncomponent.cpp +++ b/modules/newhorizons/util/projectioncomponent.cpp @@ -242,7 +242,7 @@ void ProjectionComponent::initialize(const ghoul::Dictionary& dictionary) { if (foundSequence) { sequenceSource = absPath(sequenceSource); - foundSequence = dictionary.getValue(keySequenceType, sequenceType); + dictionary.getValue(keySequenceType, sequenceType); //Important: client must define translation-list in mod file IFF playbook if (dictionary.hasKey(keyTranslation)) { ghoul::Dictionary translationDictionary; diff --git a/modules/space/translation/tletranslation.cpp b/modules/space/translation/tletranslation.cpp index 5b3c16633b..ec5e554c4e 100644 --- a/modules/space/translation/tletranslation.cpp +++ b/modules/space/translation/tletranslation.cpp @@ -279,6 +279,15 @@ void TLETranslation::readTLEFile(const std::string& filename) { double meanMotion; double epoch; } keplerElements; + + enum class State { + Initial = 0, + ReadFirstLine, + ReadSecondLine, + Finished = ReadSecondLine + }; + + State state = State::Initial; std::string line; while (std::getline(file, line)) { @@ -301,8 +310,15 @@ void TLETranslation::readTLEFile(const std::string& filename) { // 14 69-69 Checksum (modulo 10) keplerElements.epoch = epochFromSubstring(line.substr(18, 14)); + state = State::ReadFirstLine; } else if (line[0] == '2') { + if (state != State::ReadFirstLine) { + throw ghoul::RuntimeError( + "Malformed TLE file: '" + filename + "'. Line 2 before line 1", + "TLETranslation" + ); + } // Second line //Field Columns Content // 1 01-01 Line number @@ -348,10 +364,18 @@ void TLETranslation::readTLEFile(const std::string& filename) { stream.str(line.substr(52, 11)); stream >> keplerElements.meanMotion; + state = State::ReadSecondLine; break; } } + if (state != State::Finished) { + throw ghoul::RuntimeError( + "Malformed TLE file: Line 1 or 2 missing", + "TLETranslation" + ); + } + // Calculate the semi major axis based on the mean motion using kepler's laws keplerElements.semiMajorAxis = calculateSemiMajorAxis(keplerElements.meanMotion); diff --git a/modules/volume/volumeutils.cpp b/modules/volume/volumeutils.cpp index a8f19fc70e..934a8388f7 100644 --- a/modules/volume/volumeutils.cpp +++ b/modules/volume/volumeutils.cpp @@ -30,11 +30,11 @@ namespace volumeutils { size_t coordsToIndex(const glm::vec3& coords, const glm::ivec3& dims) { size_t w = dims.x; size_t h = dims.y; - size_t d = dims.z; - - size_t x = coords.x; - size_t y = coords.y; - size_t z = coords.z; +// size_t d = dims.z; +// +// size_t x = coords.x; +// size_t y = coords.y; +// size_t z = coords.z; return coords.z * (h * w) + coords.y * w + coords.x; } diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index 0f8b535d35..29c00cc35f 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -810,7 +810,7 @@ void OpenSpaceEngine::initializeGL() { LINFO("Initializing Rendering Engine"); // @CLEANUP: Remove the return statement and replace with exceptions ---abock - bool success = _renderEngine->initializeGL(); + _renderEngine->initializeGL(); for (const auto& func : _moduleCallbacks.initializeGL) { func(); diff --git a/src/engine/wrapper/sgctwindowwrapper.cpp b/src/engine/wrapper/sgctwindowwrapper.cpp index d2ff643aae..9708bbac57 100644 --- a/src/engine/wrapper/sgctwindowwrapper.cpp +++ b/src/engine/wrapper/sgctwindowwrapper.cpp @@ -110,9 +110,9 @@ glm::ivec2 SGCTWindowWrapper::currentWindowSize() const { } glm::ivec2 SGCTWindowWrapper::currentWindowResolution() const { - auto window = sgct::Engine::instance()->getCurrentWindowPtr(); int x, y; - sgct::Engine::instance()->getCurrentWindowPtr()->getFinalFBODimensions(x, y); + auto window = sgct::Engine::instance()->getCurrentWindowPtr(); + window->getFinalFBODimensions(x, y); return glm::ivec2(x, y); } diff --git a/src/rendering/renderengine.cpp b/src/rendering/renderengine.cpp index b19a2cfcff..c6a5aa85b9 100644 --- a/src/rendering/renderengine.cpp +++ b/src/rendering/renderengine.cpp @@ -99,19 +99,14 @@ namespace { std::chrono::seconds ScreenLogTimeToLive(15); const std::string DefaultRenderingMethod = "ABuffer"; const std::string RenderFsPath = "${SHADERS}/render.frag"; + + const std::string KeyFontMono = "Mono"; + const std::string KeyFontLight = "Light"; } namespace openspace { -const std::string RenderEngine::KeyFontMono = "Mono"; -const std::string RenderEngine::KeyFontLight = "Light"; -const std::vector RenderEngine::FrametimeTypes({ - RenderEngine::FrametimeType::DtTimeAvg, - RenderEngine::FrametimeType::FPS, - RenderEngine::FrametimeType::FPSAvg -}); - RenderEngine::RenderEngine() : _mainCamera(nullptr) , _raycasterManager(nullptr) @@ -191,15 +186,15 @@ void RenderEngine::setRendererFromString(const std::string& renderingMethod) { std::unique_ptr newRenderer = nullptr; switch (_rendererImplementation) { - case RendererImplementation::Framebuffer: - newRenderer = std::make_unique(); - break; - case RendererImplementation::ABuffer: - newRenderer = std::make_unique(); - break; - case RendererImplementation::Invalid: - LFATAL("Rendering method '" << renderingMethod << "' not among the available " - << "rendering methods"); + case RendererImplementation::Framebuffer: + newRenderer = std::make_unique(); + break; + case RendererImplementation::ABuffer: + newRenderer = std::make_unique(); + break; + case RendererImplementation::Invalid: + LFATAL("Rendering method '" << renderingMethod << "' not among the available " + << "rendering methods"); } setRenderer(std::move(newRenderer)); diff --git a/src/util/timemanager.cpp b/src/util/timemanager.cpp index c70ca0d934..5780567fd4 100644 --- a/src/util/timemanager.cpp +++ b/src/util/timemanager.cpp @@ -35,7 +35,7 @@ namespace openspace { using datamessagestructures::TimeKeyframe; void TimeManager::preSynchronization(double dt) { - double now = OsEng.runTime(); +// double now = OsEng.runTime(); removeKeyframesBefore(_latestConsumedTimestamp); if (_keyframes.size() == 0) { Time::ref().advanceTime(dt); @@ -150,4 +150,4 @@ bool TimeManager::compareKeyframeTimes(const TimeKeyframe& a, const TimeKeyframe return a._timestamp < b._timestamp; } -} \ No newline at end of file +} From a08e0cea4e547a1ffa294ff7020c1c4b83b7caa5 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Mon, 27 Feb 2017 11:10:50 -0500 Subject: [PATCH 43/96] Update Ghoul repository to update GLM --- ext/ghoul | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/ghoul b/ext/ghoul index 6881033dc5..302fca9367 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 6881033dc58549d70ae3d5e1c46d9b8750cf7002 +Subproject commit 302fca93671f67464393f9b2059717e00a516002 From 57ba41bb101137860c38f9d93c631e3dd81dcac1 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Mon, 27 Feb 2017 16:39:58 -0500 Subject: [PATCH 44/96] Update the leap second kernel --- data/scene/atmosphereearth.scene | 2 +- data/scene/dawn.scene | 2 +- data/scene/default.scene | 2 +- data/scene/fieldlines.scene | 2 +- data/scene/globebrowsing.scene | 2 +- data/scene/juno.scene | 2 +- data/scene/newhorizons.scene | 2 +- data/scene/osirisrex.scene | 2 +- data/scene/rosetta.scene | 2 +- data/scene/volumetricmilkyway.scene | 2 +- data/spice/{naif0011.tls => naif0012.tls} | 6 +++++- 11 files changed, 15 insertions(+), 11 deletions(-) rename data/spice/{naif0011.tls => naif0012.tls} (95%) diff --git a/data/scene/atmosphereearth.scene b/data/scene/atmosphereearth.scene index 914c040ca7..e00b18fc74 100644 --- a/data/scene/atmosphereearth.scene +++ b/data/scene/atmosphereearth.scene @@ -6,7 +6,7 @@ function preInitialization() critical objects. ]]-- - openspace.spice.loadKernel("${SPICE}/naif0011.tls") + openspace.spice.loadKernel("${SPICE}/naif0012.tls") openspace.spice.loadKernel("${SPICE}/pck00010.tpc") openspace.time.setTime(openspace.time.currentWallTime()) diff --git a/data/scene/dawn.scene b/data/scene/dawn.scene index 6ae70e3fb9..78c03cece5 100644 --- a/data/scene/dawn.scene +++ b/data/scene/dawn.scene @@ -6,7 +6,7 @@ function preInitialization() critical objects. ]]-- - openspace.spice.loadKernel("${SPICE}/naif0011.tls") + openspace.spice.loadKernel("${SPICE}/naif0012.tls") openspace.spice.loadKernel("${SPICE}/pck00010.tpc") openspace.time.setTime("2011 AUG 06 00:00:00") diff --git a/data/scene/default.scene b/data/scene/default.scene index d2344f3ab0..b28458aa52 100644 --- a/data/scene/default.scene +++ b/data/scene/default.scene @@ -6,7 +6,7 @@ function preInitialization() critical objects. ]]-- - openspace.spice.loadKernel("${SPICE}/naif0011.tls") + openspace.spice.loadKernel("${SPICE}/naif0012.tls") openspace.spice.loadKernel("${SPICE}/pck00010.tpc") openspace.time.setTime(openspace.time.currentWallTime()) diff --git a/data/scene/fieldlines.scene b/data/scene/fieldlines.scene index 3cee4bf1e3..cf494fe43c 100644 --- a/data/scene/fieldlines.scene +++ b/data/scene/fieldlines.scene @@ -6,7 +6,7 @@ function preInitialization() critical objects. ]]-- - openspace.spice.loadKernel("${SPICE}/naif0011.tls") + openspace.spice.loadKernel("${SPICE}/naif0012.tls") openspace.spice.loadKernel("${SPICE}/pck00010.tpc") openspace.time.setTime("2015 JAN 01 12:00:00.000") diff --git a/data/scene/globebrowsing.scene b/data/scene/globebrowsing.scene index c03c92d1b7..23506f5df1 100644 --- a/data/scene/globebrowsing.scene +++ b/data/scene/globebrowsing.scene @@ -7,7 +7,7 @@ function preInitialization() ]]-- --openspace.time.setTime(openspace.time.currentWallTime()) - openspace.spice.loadKernel("${SPICE}/naif0011.tls") + openspace.spice.loadKernel("${SPICE}/naif0012.tls") openspace.spice.loadKernel("${SPICE}/pck00010.tpc") openspace.time.setTime(openspace.time.currentWallTime()) diff --git a/data/scene/juno.scene b/data/scene/juno.scene index f63276e744..403b508435 100755 --- a/data/scene/juno.scene +++ b/data/scene/juno.scene @@ -5,7 +5,7 @@ function preInitialization() which the scene should start and other settings that might determine initialization critical objects. ]]-- - openspace.spice.loadKernel("${SPICE}/naif0011.tls") + openspace.spice.loadKernel("${SPICE}/naif0012.tls") openspace.spice.loadKernel("${SPICE}/pck00010.tpc") openspace.time.setTime("2016-07-05T10:05:00.00") diff --git a/data/scene/newhorizons.scene b/data/scene/newhorizons.scene index ca5e4106c9..3ce05ababc 100644 --- a/data/scene/newhorizons.scene +++ b/data/scene/newhorizons.scene @@ -11,7 +11,7 @@ function preInitialization() critical objects. ]]-- - openspace.spice.loadKernel("${SPICE}/naif0011.tls") + openspace.spice.loadKernel("${SPICE}/naif0012.tls") openspace.spice.loadKernel("${SPICE}/pck00010.tpc") openspace.time.setTime("2015-07-14T10:05:00.00") diff --git a/data/scene/osirisrex.scene b/data/scene/osirisrex.scene index 71838f2b26..f5fff215a9 100644 --- a/data/scene/osirisrex.scene +++ b/data/scene/osirisrex.scene @@ -9,7 +9,7 @@ function preInitialization() critical objects. ]]-- - openspace.spice.loadKernel("${SPICE}/naif0011.tls") + openspace.spice.loadKernel("${SPICE}/naif0012.tls") openspace.spice.loadKernel("${SPICE}/pck00010.tpc") dofile(openspace.absPath('${SCRIPTS}/bind_keys_osirisrex.lua')) diff --git a/data/scene/rosetta.scene b/data/scene/rosetta.scene index 361397876f..3ba32966e7 100644 --- a/data/scene/rosetta.scene +++ b/data/scene/rosetta.scene @@ -6,7 +6,7 @@ function preInitialization() critical objects. ]]-- - openspace.spice.loadKernel("${SPICE}/naif0011.tls") + openspace.spice.loadKernel("${SPICE}/naif0012.tls") openspace.spice.loadKernel("${SPICE}/pck00010.tpc") -- Usual start diff --git a/data/scene/volumetricmilkyway.scene b/data/scene/volumetricmilkyway.scene index 9d6c9ba91d..3a4f4d71c2 100644 --- a/data/scene/volumetricmilkyway.scene +++ b/data/scene/volumetricmilkyway.scene @@ -6,7 +6,7 @@ function preInitialization() critical objects. ]]-- - openspace.spice.loadKernel("${SPICE}/naif0011.tls") + openspace.spice.loadKernel("${SPICE}/naif0012.tls") openspace.spice.loadKernel("${SPICE}/pck00010.tpc") openspace.time.setTime(openspace.time.currentWallTime()) diff --git a/data/spice/naif0011.tls b/data/spice/naif0012.tls similarity index 95% rename from data/spice/naif0011.tls rename to data/spice/naif0012.tls index 58fcbcbd7f..e1afdee1b6 100644 --- a/data/spice/naif0011.tls +++ b/data/spice/naif0012.tls @@ -7,6 +7,9 @@ LEAPSECONDS KERNEL FILE Modifications: -------------- +2016, Jul. 14 NJB Modified file to account for the leapsecond that + will occur on December 31, 2016. + 2015, Jan. 5 NJB Modified file to account for the leapsecond that will occur on June 30, 2015. @@ -141,7 +144,8 @@ DELTET/DELTA_AT = ( 10, @1972-JAN-1 33, @2006-JAN-1 34, @2009-JAN-1 35, @2012-JUL-1 - 36, @2015-JUL-1 ) + 36, @2015-JUL-1 + 37, @2017-JAN-1 ) \begintext From 78f2f0a35eb03c2ff81db946a2240a6b452c257a Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Mon, 27 Feb 2017 16:40:50 -0500 Subject: [PATCH 45/96] Some more cleanup of RenderEngine --- .../interaction/interactionhandler.h | 1 - include/openspace/rendering/renderengine.h | 11 +- src/interaction/interactionhandler.cpp | 6 - src/rendering/renderengine.cpp | 910 ++++++------------ 4 files changed, 272 insertions(+), 656 deletions(-) diff --git a/include/openspace/interaction/interactionhandler.h b/include/openspace/interaction/interactionhandler.h index aa9e04fc43..6707799eab 100644 --- a/include/openspace/interaction/interactionhandler.h +++ b/include/openspace/interaction/interactionhandler.h @@ -144,7 +144,6 @@ private: // Properties properties::StringProperty _origin; - properties::StringProperty _coordinateSystem; properties::BoolProperty _rotationalFriction; properties::BoolProperty _horizontalFriction; diff --git a/include/openspace/rendering/renderengine.h b/include/openspace/rendering/renderengine.h index 8e9f60f96c..cfb3868664 100644 --- a/include/openspace/rendering/renderengine.h +++ b/include/openspace/rendering/renderengine.h @@ -77,8 +77,9 @@ public: RenderEngine(); ~RenderEngine(); - bool initialize(); - bool deinitialize(); + void initialize(); + void initializeGL(); + void deinitialize(); void setSceneGraph(Scene* sceneGraph); Scene* scene(); @@ -89,7 +90,6 @@ public: RaycasterManager& raycasterManager(); // sgct wrapped functions - bool initializeGL(); void updateSceneGraph(); void updateShaderPrograms(); @@ -170,9 +170,6 @@ public: */ static scripting::LuaLibrary luaLibrary(); - // This is a temporary method to change the origin of the coordinate system ---abock - void changeViewPoint(std::string origin); - // Temporary fade functionality void startFading(int direction, float fadeDuration); @@ -217,7 +214,7 @@ private: float _currentFadeTime; int _fadeDirection; int _nAaSamples; - unsigned int _frameNumber; + uint64_t _frameNumber; std::vector _programs; std::vector> _screenSpaceRenderables; diff --git a/src/interaction/interactionhandler.cpp b/src/interaction/interactionhandler.cpp index c40760645d..e79156e292 100644 --- a/src/interaction/interactionhandler.cpp +++ b/src/interaction/interactionhandler.cpp @@ -72,7 +72,6 @@ namespace interaction { // InteractionHandler InteractionHandler::InteractionHandler() : _origin("origin", "Origin", "") - , _coordinateSystem("coordinateSystem", "Coordinate System", "") , _rotationalFriction("rotationalFriction", "Rotational Friction", true) , _horizontalFriction("horizontalFriction", "Horizontal Friction", true) , _verticalFriction("verticalFriction", "Vertical Friction", true) @@ -91,10 +90,6 @@ InteractionHandler::InteractionHandler() resetCameraDirection(); }); - _coordinateSystem.onChange([this]() { - OsEng.renderEngine().changeViewPoint(_coordinateSystem.value()); - }); - // Create the interactionModes _inputState = std::make_unique(); // Inject the same mouse states to both orbital and global interaction mode @@ -137,7 +132,6 @@ InteractionHandler::InteractionHandler() // Add the properties addProperty(_origin); - addProperty(_coordinateSystem); addProperty(_rotationalFriction); addProperty(_horizontalFriction); diff --git a/src/rendering/renderengine.cpp b/src/rendering/renderengine.cpp index c6a5aa85b9..a12234a876 100644 --- a/src/rendering/renderengine.cpp +++ b/src/rendering/renderengine.cpp @@ -24,66 +24,49 @@ #include -#include - #ifdef OPENSPACE_MODULE_NEWHORIZONS_ENABLED #include #endif -#include -#include +#include +#include +#include +#include +#include +#include #include #include #include - -#include -#include -#include - -#include - -#include -#include -#include -#include +#include +#include #include #include #include #include -//#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include #include -#include +#include +#include +#include + #ifdef GHOUL_USE_DEVIL #include #endif //GHOUL_USE_DEVIL #ifdef GHOUL_USE_FREEIMAGE #include #endif // GHOUL_USE_FREEIMAGE -#include -#include #ifdef GHOUL_USE_SOIL #include +#include #include #endif //GHOUL_USE_SOIL #include -#include #include // ABuffer defines @@ -93,16 +76,16 @@ #include "renderengine_lua.inl" namespace { - const std::string _loggerCat = "RenderEngine"; + const char* _loggerCat = "RenderEngine"; - const std::string KeyRenderingMethod = "RenderingMethod"; - std::chrono::seconds ScreenLogTimeToLive(15); - const std::string DefaultRenderingMethod = "ABuffer"; - const std::string RenderFsPath = "${SHADERS}/render.frag"; + const char* KeyRenderingMethod = "RenderingMethod"; + const std::chrono::seconds ScreenLogTimeToLive(15); + const char* DefaultRenderingMethod = "ABuffer"; + const char* RenderFsPath = "${SHADERS}/render.frag"; - const std::string KeyFontMono = "Mono"; - const std::string KeyFontLight = "Light"; -} + const char* KeyFontMono = "Mono"; + const char* KeyFontLight = "Light"; +} // namespace namespace openspace { @@ -130,7 +113,6 @@ RenderEngine::RenderEngine() , _currentFadeTime(0.f) , _fadeDirection(0) , _frameNumber(0) - //, _frametimeType(FrametimeType::DtTimeAvg) { setName("RenderEngine"); @@ -170,50 +152,20 @@ RenderEngine::~RenderEngine() { delete _raycasterManager; } -bool RenderEngine::deinitialize() { - for (auto screenspacerenderable : _screenSpaceRenderables) { - screenspacerenderable->deinitialize(); - } - - MissionManager::deinitialize(); - - _sceneGraph->clearSceneGraph(); - return true; -} - -void RenderEngine::setRendererFromString(const std::string& renderingMethod) { - _rendererImplementation = rendererFromString(renderingMethod); - - std::unique_ptr newRenderer = nullptr; - switch (_rendererImplementation) { - case RendererImplementation::Framebuffer: - newRenderer = std::make_unique(); - break; - case RendererImplementation::ABuffer: - newRenderer = std::make_unique(); - break; - case RendererImplementation::Invalid: - LFATAL("Rendering method '" << renderingMethod << "' not among the available " - << "rendering methods"); - } - - setRenderer(std::move(newRenderer)); -} - -bool RenderEngine::initialize() { +void RenderEngine::initialize() { _frameNumber = 0; std::string renderingMethod = DefaultRenderingMethod; - - // If the user specified a rendering method that he would like to use, use that - if (OsEng.configurationManager().hasKeyAndValue(KeyRenderingMethod)) { - renderingMethod = OsEng.configurationManager().value(KeyRenderingMethod); + // If the user specified a rendering method that he would like to use, use that + auto& confManager = OsEng.configurationManager(); + if (confManager.hasKeyAndValue(KeyRenderingMethod)) { + renderingMethod = confManager.value(KeyRenderingMethod); } else { using Version = ghoul::systemcapabilities::OpenGLCapabilitiesComponent::Version; // The default rendering method has a requirement of OpenGL 4.3, so if we are // below that, we will fall back to frame buffer operation - if (OpenGLCap.openGLVersion() < Version{4,3,0}) { + if (OpenGLCap.openGLVersion() < Version{ 4,3,0 }) { LINFO("Falling back to framebuffer implementation due to OpenGL limitations"); renderingMethod = "Framebuffer"; } @@ -243,22 +195,20 @@ bool RenderEngine::initialize() { ghoul::io::TextureReader::ref().addReader(std::make_shared()); ghoul::io::TextureWriter::ref().addWriter(std::make_shared()); #endif // GHOUL_USE_SOIL - + ghoul::io::TextureReader::ref().addReader(std::make_shared()); MissionManager::initialize(); - - return true; } -bool RenderEngine::initializeGL() { +void RenderEngine::initializeGL() { // TODO: Fix the power scaled coordinates in such a way that these // values can be set to more realistic values // set the close clip plane and the far clip plane to extreme values while in // development OsEng.windowWrapper().setNearFarClippingPlane(0.001f, 1000.f); - + try { const float fontSizeBig = 50.f; _fontBig = OsEng.fontManager().font(KeyFontMono, fontSizeBig); @@ -268,83 +218,82 @@ bool RenderEngine::initializeGL() { _fontInfo = OsEng.fontManager().font(KeyFontMono, fontSizeMono); const float fontSizeLight = 8.f; _fontLog = OsEng.fontManager().font(KeyFontLight, fontSizeLight); - } - catch (const ghoul::fontrendering::Font::FreeTypeException& e) { + } catch (const ghoul::fontrendering::Font::FreeTypeException& e) { LERROR(e.what()); throw; } - - - + + + // ALL OF THIS HAS TO BE CHECKED // ---abock - - -// sgct::Engine::instance()->setNearAndFarClippingPlanes(0.001f, 1000.0f); + + + // sgct::Engine::instance()->setNearAndFarClippingPlanes(0.001f, 1000.0f); // sgct::Engine::instance()->setNearAndFarClippingPlanes(0.1f, 30.0f); // calculating the maximum field of view for the camera, used to // determine visibility of objects in the scene graph -/* if (sgct::Engine::instance()->getCurrentRenderTarget() == sgct::Engine::NonLinearBuffer) { - // fisheye mode, looking upwards to the "dome" - glm::vec4 upDirection(0, 1, 0, 0); + /* if (sgct::Engine::instance()->getCurrentRenderTarget() == sgct::Engine::NonLinearBuffer) { + // fisheye mode, looking upwards to the "dome" + glm::vec4 upDirection(0, 1, 0, 0); - // get the tilt and rotate the view - const float tilt = wPtr->getFisheyeTilt(); - glm::mat4 tiltMatrix - = glm::rotate(glm::mat4(1.0f), tilt, glm::vec3(1.0f, 0.0f, 0.0f)); - const glm::vec4 viewdir = tiltMatrix * upDirection; + // get the tilt and rotate the view + const float tilt = wPtr->getFisheyeTilt(); + glm::mat4 tiltMatrix + = glm::rotate(glm::mat4(1.0f), tilt, glm::vec3(1.0f, 0.0f, 0.0f)); + const glm::vec4 viewdir = tiltMatrix * upDirection; - // set the tilted view and the FOV - _mainCamera->setCameraDirection(glm::vec3(viewdir[0], viewdir[1], viewdir[2])); - _mainCamera->setMaxFov(wPtr->getFisheyeFOV()); - _mainCamera->setLookUpVector(glm::vec3(0.0, 1.0, 0.0)); + // set the tilted view and the FOV + _mainCamera->setCameraDirection(glm::vec3(viewdir[0], viewdir[1], viewdir[2])); + _mainCamera->setMaxFov(wPtr->getFisheyeFOV()); + _mainCamera->setLookUpVector(glm::vec3(0.0, 1.0, 0.0)); } else {*/ - // get corner positions, calculating the forth to easily calculate center - - // glm::vec3 corners[4]; - // sgct::SGCTWindow* wPtr = sgct::Engine::instance()->getWindowPtr(0); - // sgct_core::BaseViewport* vp = wPtr->getViewport(0); - // sgct_core::SGCTProjectionPlane* projectionPlane = vp->getProjectionPlane(); + // get corner positions, calculating the forth to easily calculate center - // corners[0] = *(projectionPlane->getCoordinatePtr(sgct_core::SGCTProjectionPlane::LowerLeft)); - // corners[1] = *(projectionPlane->getCoordinatePtr(sgct_core::SGCTProjectionPlane::UpperLeft)); - // corners[2] = *(projectionPlane->getCoordinatePtr(sgct_core::SGCTProjectionPlane::UpperRight)); - // corners[3] = glm::vec3(corners[2][0], corners[0][1], corners[2][2]); - // - // const glm::vec3 center = (corners[0] + corners[1] + corners[2] + corners[3]); - //// - //const glm::vec3 eyePosition = sgct_core::ClusterManager::instance()->getDefaultUserPtr()->getPos(); - ////// get viewdirection, stores the direction in the camera, used for culling - //const glm::vec3 viewdir = glm::normalize(eyePosition - center); + // glm::vec3 corners[4]; + // sgct::SGCTWindow* wPtr = sgct::Engine::instance()->getWindowPtr(0); + // sgct_core::BaseViewport* vp = wPtr->getViewport(0); + // sgct_core::SGCTProjectionPlane* projectionPlane = vp->getProjectionPlane(); - //const glm::vec3 upVector = corners[0] - corners[1]; + // corners[0] = *(projectionPlane->getCoordinatePtr(sgct_core::SGCTProjectionPlane::LowerLeft)); + // corners[1] = *(projectionPlane->getCoordinatePtr(sgct_core::SGCTProjectionPlane::UpperLeft)); + // corners[2] = *(projectionPlane->getCoordinatePtr(sgct_core::SGCTProjectionPlane::UpperRight)); + // corners[3] = glm::vec3(corners[2][0], corners[0][1], corners[2][2]); + // + // const glm::vec3 center = (corners[0] + corners[1] + corners[2] + corners[3]); + //// + //const glm::vec3 eyePosition = sgct_core::ClusterManager::instance()->getDefaultUserPtr()->getPos(); + ////// get viewdirection, stores the direction in the camera, used for culling + //const glm::vec3 viewdir = glm::normalize(eyePosition - center); - + //const glm::vec3 upVector = corners[0] - corners[1]; - //_mainCamera->setCameraDirection(glm::normalize(-viewdir)); - //_mainCamera->setCameraDirection(glm::vec3(0.f, 0.f, -1.f)); - //_mainCamera->setLookUpVector(glm::normalize(upVector)); - //_mainCamera->setLookUpVector(glm::vec3(0.f, 1.f, 0.f)); - // set the initial fov to be 0.0 which means everything will be culled - //float maxFov = 0.0f; - float maxFov = std::numeric_limits::max(); - //// for each corner - //for (int i = 0; i < 4; ++i) { - // // calculate radians to corner - // glm::vec3 dir = glm::normalize(eyePosition - corners[i]); - // float radsbetween = acos(glm::dot(viewdir, dir)) - // / (glm::length(viewdir) * glm::length(dir)); + //_mainCamera->setCameraDirection(glm::normalize(-viewdir)); + //_mainCamera->setCameraDirection(glm::vec3(0.f, 0.f, -1.f)); + //_mainCamera->setLookUpVector(glm::normalize(upVector)); + //_mainCamera->setLookUpVector(glm::vec3(0.f, 1.f, 0.f)); - // // the angle to a corner is larger than the current maxima - // if (radsbetween > maxFov) { - // maxFov = radsbetween; - // } - //} - _mainCamera->setMaxFov(maxFov); + // set the initial fov to be 0.0 which means everything will be culled + //float maxFov = 0.0f; + float maxFov = std::numeric_limits::max(); + + //// for each corner + //for (int i = 0; i < 4; ++i) { + // // calculate radians to corner + // glm::vec3 dir = glm::normalize(eyePosition - corners[i]); + // float radsbetween = acos(glm::dot(viewdir, dir)) + // / (glm::length(viewdir) * glm::length(dir)); + + // // the angle to a corner is larger than the current maxima + // if (radsbetween > maxFov) { + // maxFov = radsbetween; + // } + //} + _mainCamera->setMaxFov(maxFov); //} LINFO("Initializing Log"); @@ -353,7 +302,35 @@ bool RenderEngine::initializeGL() { ghoul::logging::LogManager::ref().addLog(std::move(log)); LINFO("Finished initializing GL"); - return true; +} + +void RenderEngine::deinitialize() { + for (auto screenspacerenderable : _screenSpaceRenderables) { + screenspacerenderable->deinitialize(); + } + + MissionManager::deinitialize(); + + _sceneGraph->clearSceneGraph(); +} + +void RenderEngine::setRendererFromString(const std::string& renderingMethod) { + _rendererImplementation = rendererFromString(renderingMethod); + + std::unique_ptr newRenderer = nullptr; + switch (_rendererImplementation) { + case RendererImplementation::Framebuffer: + newRenderer = std::make_unique(); + break; + case RendererImplementation::ABuffer: + newRenderer = std::make_unique(); + break; + case RendererImplementation::Invalid: + LFATAL("Rendering method '" << renderingMethod << "' not among the available " + << "rendering methods"); + } + + setRenderer(std::move(newRenderer)); } void RenderEngine::updateSceneGraph() { @@ -381,7 +358,7 @@ void RenderEngine::updateSceneGraph() { } void RenderEngine::updateShaderPrograms() { - for (auto program : _programs) { + for (ghoul::opengl::ProgramObject* program : _programs) { try { if (program->isDirty()) { program->rebuildFromFile(); @@ -408,7 +385,7 @@ void RenderEngine::updateRenderer() { } void RenderEngine::updateScreenSpaceRenderables() { - for (auto screenspacerenderable : _screenSpaceRenderables) { + for (auto& screenspacerenderable : _screenSpaceRenderables) { screenspacerenderable->update(); } } @@ -439,12 +416,13 @@ glm::ivec2 RenderEngine::fontResolution() const { void RenderEngine::updateFade() { - //temporary fade funtionality - float fadedIn = 1.0; - float fadedOut = 0.0; + // Temporary fade funtionality + const float fadedIn = 1.0; + const float fadedOut = 0.0; // Don't restart the fade if you've already done it in that direction - if ((_fadeDirection > 0 && _globalBlackOutFactor == fadedIn) - || (_fadeDirection < 0 && _globalBlackOutFactor == fadedOut)) { + const bool isFadedIn = (_fadeDirection > 0 && _globalBlackOutFactor == fadedIn); + const bool isFadedOut = (_fadeDirection < 0 && _globalBlackOutFactor == fadedOut); + if (isFadedIn || isFadedOut) { _fadeDirection = 0; } @@ -454,11 +432,23 @@ void RenderEngine::updateFade() { _fadeDirection = 0; } else { - if (_fadeDirection < 0) - _globalBlackOutFactor = glm::smoothstep(1.f, 0.f, _currentFadeTime / _fadeDuration); - else - _globalBlackOutFactor = glm::smoothstep(0.f, 1.f, _currentFadeTime / _fadeDuration); - _currentFadeTime += static_cast(OsEng.windowWrapper().averageDeltaTime()); + if (_fadeDirection < 0) { + _globalBlackOutFactor = glm::smoothstep( + 1.f, + 0.f, + _currentFadeTime / _fadeDuration + ); + } + else { + _globalBlackOutFactor = glm::smoothstep( + 0.f, + 1.f, + _currentFadeTime / _fadeDuration + ); + } + _currentFadeTime += static_cast( + OsEng.windowWrapper().averageDeltaTime() + ); } } } @@ -490,9 +480,8 @@ void RenderEngine::render(const glm::mat4& viewMatrix, const glm::mat4& projecti } _frameNumber++; - - for (auto screenSpaceRenderable : _screenSpaceRenderables) { + for (auto& screenSpaceRenderable : _screenSpaceRenderables) { if (screenSpaceRenderable->isEnabled() && screenSpaceRenderable->isReady()) { screenSpaceRenderable->render(); } @@ -592,10 +581,9 @@ void RenderEngine::startFading(int direction, float fadeDuration) { * Build a program object for rendering with the used renderer */ std::unique_ptr RenderEngine::buildRenderProgram( - std::string name, - std::string vsPath, - std::string fsPath, - const ghoul::Dictionary& data) { + std::string name, std::string vsPath, + std::string fsPath, const ghoul::Dictionary& data) +{ ghoul::Dictionary dict = data; @@ -606,11 +594,13 @@ std::unique_ptr RenderEngine::buildRenderProgram( // instead of a void main() setting glFragColor, glFragDepth, etc. dict.setValue("fragmentPath", fsPath); - std::unique_ptr program = ghoul::opengl::ProgramObject::Build( + using namespace ghoul::opengl; + std::unique_ptr program = ProgramObject::Build( name, vsPath, RenderFsPath, - dict); + dict + ); if (program) { _programs.push_back(program.get()); @@ -622,12 +612,10 @@ std::unique_ptr RenderEngine::buildRenderProgram( * Build a program object for rendering with the used renderer */ std::unique_ptr RenderEngine::buildRenderProgram( - std::string name, - std::string vsPath, - std::string fsPath, - std::string csPath, - const ghoul::Dictionary& data) { - + std::string name, std::string vsPath, + std::string fsPath, std::string csPath, + const ghoul::Dictionary& data) +{ ghoul::Dictionary dict = data; dict.setValue("rendererData", _rendererData); @@ -636,12 +624,14 @@ std::unique_ptr RenderEngine::buildRenderProgram( // instead of a void main() setting glFragColor, glFragDepth, etc. dict.setValue("fragmentPath", fsPath); - std::unique_ptr program = ghoul::opengl::ProgramObject::Build( + using namespace ghoul::opengl; + std::unique_ptr program = ProgramObject::Build( name, vsPath, RenderFsPath, csPath, - dict); + dict + ); if (program) { _programs.push_back(program.get()); @@ -649,16 +639,18 @@ std::unique_ptr RenderEngine::buildRenderProgram( return program; } -void RenderEngine::removeRenderProgram(const std::unique_ptr& program) { - if (!program) +void RenderEngine::removeRenderProgram( + const std::unique_ptr& program) +{ + if (!program) { return; + } - ghoul::opengl::ProgramObject* ptr = program.get(); auto it = std::find( _programs.begin(), _programs.end(), - ptr - ); + program.get() + ); if (it != _programs.end()) { _programs.erase(it); @@ -672,7 +664,7 @@ void RenderEngine::removeRenderProgram(const std::unique_ptrdictionary(); dict.setValue("rendererData", _rendererData); program->setDictionary(dict); @@ -687,7 +679,7 @@ void RenderEngine::setRendererData(const ghoul::Dictionary& data) { */ void RenderEngine::setResolveData(const ghoul::Dictionary& data) { _resolveData = data; - for (auto program : _programs) { + for (ghoul::opengl::ProgramObject* program : _programs) { ghoul::Dictionary dict = program->dictionary(); dict.setValue("resolveData", _resolveData); program->setDictionary(dict); @@ -708,8 +700,6 @@ void RenderEngine::postRaycast(ghoul::opengl::ProgramObject& programObject) { _renderer->postRaycast(programObject); } - - /** * Set renderer */ @@ -807,395 +797,6 @@ performance::PerformanceManager* RenderEngine::performanceManager() { return _performanceManager.get(); } -// This method is temporary and will be removed once the scalegraph is in effect ---abock -void RenderEngine::changeViewPoint(std::string origin) { -// SceneGraphNode* solarSystemBarycenterNode = scene()->sceneGraphNode("SolarSystemBarycenter"); -// SceneGraphNode* plutoBarycenterNode = scene()->sceneGraphNode("PlutoBarycenter"); -// SceneGraphNode* newHorizonsNode = scene()->sceneGraphNode("NewHorizons"); -// SceneGraphNode* newHorizonsPathNodeJ = scene()->sceneGraphNode("NewHorizonsPathJupiter"); -// SceneGraphNode* newHorizonsPathNodeP = scene()->sceneGraphNode("NewHorizonsPathPluto"); -//// SceneGraphNode* cg67pNode = scene()->sceneGraphNode("67P"); -//// SceneGraphNode* rosettaNode = scene()->sceneGraphNode("Rosetta"); -// -// RenderablePath* nhPath; -// -// SceneGraphNode* jupiterBarycenterNode = scene()->sceneGraphNode("JupiterBarycenter"); -// -// //SceneGraphNode* newHorizonsGhostNode = scene()->sceneGraphNode("NewHorizonsGhost"); -// //SceneGraphNode* dawnNode = scene()->sceneGraphNode("Dawn"); -// //SceneGraphNode* vestaNode = scene()->sceneGraphNode("Vesta"); -// -// // if (solarSystemBarycenterNode == nullptr || plutoBarycenterNode == nullptr || -// //jupiterBarycenterNode == nullptr) { -// // LERROR("Necessary nodes does not exist"); -// //return; -// // } -// -// if (origin == "Pluto") { -// if (newHorizonsPathNodeP) { -// Renderable* R = newHorizonsPathNodeP->renderable(); -// newHorizonsPathNodeP->setParent(plutoBarycenterNode); -// nhPath = static_cast(R); -// nhPath->calculatePath("PLUTO BARYCENTER"); -// } -// -// plutoBarycenterNode->setParent(scene()->sceneGraphNode("SolarSystem")); -// plutoBarycenterNode->setEphemeris(new StaticEphemeris); -// -// solarSystemBarycenterNode->setParent(plutoBarycenterNode); -// newHorizonsNode->setParent(plutoBarycenterNode); -// //newHorizonsGhostNode->setParent(plutoBarycenterNode); -// -// //dawnNode->setParent(plutoBarycenterNode); -// //vestaNode->setParent(plutoBarycenterNode); -// -// //newHorizonsTrailNode->setParent(plutoBarycenterNode); -// ghoul::Dictionary solarDictionary = -// { -// { std::string("Type"), std::string("Spice") }, -// { std::string("Body"), std::string("SUN") }, -// { std::string("Reference"), std::string("GALACTIC") }, -// { std::string("Observer"), std::string("PLUTO BARYCENTER") }, -// { std::string("Kernels"), ghoul::Dictionary() } -// }; -// -// ghoul::Dictionary jupiterDictionary = -// { -// { std::string("Type"), std::string("Spice") }, -// { std::string("Body"), std::string("JUPITER BARYCENTER") }, -// { std::string("Reference"), std::string("GALACTIC") }, -// { std::string("Observer"), std::string("PLUTO BARYCENTER") }, -// { std::string("Kernels"), ghoul::Dictionary() } -// }; -// -// ghoul::Dictionary newHorizonsDictionary = -// { -// { std::string("Type"), std::string("Spice") }, -// { std::string("Body"), std::string("NEW HORIZONS") }, -// { std::string("Reference"), std::string("GALACTIC") }, -// { std::string("Observer"), std::string("PLUTO BARYCENTER") }, -// { std::string("Kernels"), ghoul::Dictionary() } -// }; -// -// solarSystemBarycenterNode->setEphemeris(new SpiceEphemeris(solarDictionary)); -// jupiterBarycenterNode->setEphemeris(new SpiceEphemeris(jupiterDictionary)); -// newHorizonsNode->setEphemeris(new SpiceEphemeris(newHorizonsDictionary)); -// //newHorizonsTrailNode->setEphemeris(new SpiceEphemeris(newHorizonsDictionary)); -// -// -// //ghoul::Dictionary dawnDictionary = -// //{ -// // { std::string("Type"), std::string("Spice") }, -// // { std::string("Body"), std::string("DAWN") }, -// // { std::string("Reference"), std::string("GALACTIC") }, -// // { std::string("Observer"), std::string("PLUTO BARYCENTER") }, -// // { std::string("Kernels"), ghoul::Dictionary() } -// //}; -// //dawnNode->setEphemeris(new SpiceEphemeris(dawnDictionary)); -// // -// //ghoul::Dictionary vestaDictionary = -// //{ -// // { std::string("Type"), std::string("Spice") }, -// // { std::string("Body"), std::string("VESTA") }, -// // { std::string("Reference"), std::string("GALACTIC") }, -// // { std::string("Observer"), std::string("PLUTO BARYCENTER") }, -// // { std::string("Kernels"), ghoul::Dictionary() } -// //}; -// //vestaNode->setEphemeris(new SpiceEphemeris(vestaDictionary)); -// -// -// //ghoul::Dictionary newHorizonsGhostDictionary = -// //{ -// // { std::string("Type"), std::string("Spice") }, -// // { std::string("Body"), std::string("NEW HORIZONS") }, -// // { std::string("EphmerisGhosting"), std::string("TRUE") }, -// // { std::string("Reference"), std::string("GALACTIC") }, -// // { std::string("Observer"), std::string("PLUTO BARYCENTER") }, -// // { std::string("Kernels"), ghoul::Dictionary() } -// //}; -// //newHorizonsGhostNode->setEphemeris(new SpiceEphemeris(newHorizonsGhostDictionary)); -// -// return; -// } -// if (origin == "Sun") { -// solarSystemBarycenterNode->setParent(scene()->sceneGraphNode("SolarSystem")); -// -// if (plutoBarycenterNode) -// plutoBarycenterNode->setParent(solarSystemBarycenterNode); -// jupiterBarycenterNode->setParent(solarSystemBarycenterNode); -// if (newHorizonsNode) -// newHorizonsNode->setParent(solarSystemBarycenterNode); -// //newHorizonsGhostNode->setParent(solarSystemBarycenterNode); -// -// //newHorizonsTrailNode->setParent(solarSystemBarycenterNode); -// //dawnNode->setParent(solarSystemBarycenterNode); -// //vestaNode->setParent(solarSystemBarycenterNode); -// -// ghoul::Dictionary plutoDictionary = -// { -// { std::string("Type"), std::string("Spice") }, -// { std::string("Body"), std::string("PLUTO BARYCENTER") }, -// { std::string("Reference"), std::string("GALACTIC") }, -// { std::string("Observer"), std::string("SUN") }, -// { std::string("Kernels"), ghoul::Dictionary() } -// }; -// ghoul::Dictionary jupiterDictionary = -// { -// { std::string("Type"), std::string("Spice") }, -// { std::string("Body"), std::string("JUPITER BARYCENTER") }, -// { std::string("Reference"), std::string("GALACTIC") }, -// { std::string("Observer"), std::string("SUN") }, -// { std::string("Kernels"), ghoul::Dictionary() } -// }; -// -// solarSystemBarycenterNode->setEphemeris(new StaticEphemeris); -// jupiterBarycenterNode->setEphemeris(new SpiceEphemeris(jupiterDictionary)); -// if (plutoBarycenterNode) -// plutoBarycenterNode->setEphemeris(new SpiceEphemeris(plutoDictionary)); -// -// ghoul::Dictionary newHorizonsDictionary = -// { -// { std::string("Type"), std::string("Spice") }, -// { std::string("Body"), std::string("NEW HORIZONS") }, -// { std::string("Reference"), std::string("GALACTIC") }, -// { std::string("Observer"), std::string("SUN") }, -// { std::string("Kernels"), ghoul::Dictionary() } -// }; -// if (newHorizonsNode) -// newHorizonsNode->setEphemeris(new SpiceEphemeris(newHorizonsDictionary)); -// //newHorizonsTrailNode->setEphemeris(new SpiceEphemeris(newHorizonsDictionary)); -// -// -// //ghoul::Dictionary dawnDictionary = -// //{ -// // { std::string("Type"), std::string("Spice") }, -// // { std::string("Body"), std::string("DAWN") }, -// // { std::string("Reference"), std::string("GALACTIC") }, -// // { std::string("Observer"), std::string("SUN") }, -// // { std::string("Kernels"), ghoul::Dictionary() } -// //}; -// //dawnNode->setEphemeris(new SpiceEphemeris(dawnDictionary)); -// // -// //ghoul::Dictionary vestaDictionary = -// //{ -// // { std::string("Type"), std::string("Spice") }, -// // { std::string("Body"), std::string("VESTA") }, -// // { std::string("Reference"), std::string("GALACTIC") }, -// // { std::string("Observer"), std::string("SUN") }, -// // { std::string("Kernels"), ghoul::Dictionary() } -// //}; -// //vestaNode->setEphemeris(new SpiceEphemeris(vestaDictionary)); -// -// -// //ghoul::Dictionary newHorizonsGhostDictionary = -// //{ -// // { std::string("Type"), std::string("Spice") }, -// // { std::string("Body"), std::string("NEW HORIZONS") }, -// // { std::string("EphmerisGhosting"), std::string("TRUE") }, -// // { std::string("Reference"), std::string("GALACTIC") }, -// // { std::string("Observer"), std::string("JUPITER BARYCENTER") }, -// // { std::string("Kernels"), ghoul::Dictionary() } -// //}; -// //newHorizonsGhostNode->setEphemeris(new SpiceEphemeris(newHorizonsGhostDictionary)); -// -// return; -// } -// if (origin == "Jupiter") { -// if (newHorizonsPathNodeJ) { -// Renderable* R = newHorizonsPathNodeJ->renderable(); -// newHorizonsPathNodeJ->setParent(jupiterBarycenterNode); -// nhPath = static_cast(R); -// nhPath->calculatePath("JUPITER BARYCENTER"); -// } -// -// jupiterBarycenterNode->setParent(scene()->sceneGraphNode("SolarSystem")); -// jupiterBarycenterNode->setEphemeris(new StaticEphemeris); -// -// solarSystemBarycenterNode->setParent(jupiterBarycenterNode); -// if (newHorizonsNode) -// newHorizonsNode->setParent(jupiterBarycenterNode); -// //newHorizonsTrailNode->setParent(jupiterBarycenterNode); -// -// //dawnNode->setParent(jupiterBarycenterNode); -// //vestaNode->setParent(jupiterBarycenterNode); -// -// -// ghoul::Dictionary solarDictionary = -// { -// { std::string("Type"), std::string("Spice") }, -// { std::string("Body"), std::string("SUN") }, -// { std::string("Reference"), std::string("GALACTIC") }, -// { std::string("Observer"), std::string("JUPITER BARYCENTER") }, -// { std::string("Kernels"), ghoul::Dictionary() } -// }; -// -// ghoul::Dictionary plutoDictionary = -// { -// { std::string("Type"), std::string("Spice") }, -// { std::string("Body"), std::string("PlUTO BARYCENTER") }, -// { std::string("Reference"), std::string("GALACTIC") }, -// { std::string("Observer"), std::string("JUPITER BARYCENTER") }, -// { std::string("Kernels"), ghoul::Dictionary() } -// }; -// -// ghoul::Dictionary newHorizonsDictionary = -// { -// { std::string("Type"), std::string("Spice") }, -// { std::string("Body"), std::string("NEW HORIZONS") }, -// { std::string("Reference"), std::string("GALACTIC") }, -// { std::string("Observer"), std::string("JUPITER BARYCENTER") }, -// { std::string("Kernels"), ghoul::Dictionary() } -// }; -// solarSystemBarycenterNode->setEphemeris(new SpiceEphemeris(solarDictionary)); -// if (plutoBarycenterNode) -// plutoBarycenterNode->setEphemeris(new SpiceEphemeris(plutoDictionary)); -// if (newHorizonsNode) -// newHorizonsNode->setEphemeris(new SpiceEphemeris(newHorizonsDictionary)); -// //newHorizonsGhostNode->setParent(jupiterBarycenterNode); -// //newHorizonsTrailNode->setEphemeris(new SpiceEphemeris(newHorizonsDictionary)); -// -// -// //ghoul::Dictionary dawnDictionary = -// //{ -// // { std::string("Type"), std::string("Spice") }, -// // { std::string("Body"), std::string("DAWN") }, -// // { std::string("Reference"), std::string("GALACTIC") }, -// // { std::string("Observer"), std::string("JUPITER BARYCENTER") }, -// // { std::string("Kernels"), ghoul::Dictionary() } -// //}; -// //dawnNode->setEphemeris(new SpiceEphemeris(dawnDictionary)); -// // -// //ghoul::Dictionary vestaDictionary = -// //{ -// // { std::string("Type"), std::string("Spice") }, -// // { std::string("Body"), std::string("VESTA") }, -// // { std::string("Reference"), std::string("GALACTIC") }, -// // { std::string("Observer"), std::string("JUPITER BARYCENTER") }, -// // { std::string("Kernels"), ghoul::Dictionary() } -// //}; -// //vestaNode->setEphemeris(new SpiceEphemeris(vestaDictionary)); -// -// -// -// //ghoul::Dictionary newHorizonsGhostDictionary = -// //{ -// // { std::string("Type"), std::string("Spice") }, -// // { std::string("Body"), std::string("NEW HORIZONS") }, -// // { std::string("EphmerisGhosting"), std::string("TRUE") }, -// // { std::string("Reference"), std::string("GALACTIC") }, -// // { std::string("Observer"), std::string("JUPITER BARYCENTER") }, -// // { std::string("Kernels"), ghoul::Dictionary() } -// //}; -// //newHorizonsGhostNode->setEphemeris(new SpiceEphemeris(newHorizonsGhostDictionary)); -// //newHorizonsGhostNode->setParent(jupiterBarycenterNode); -// -// -// return; -// } -// //if (origin == "Vesta") { -// // -// // vestaNode->setParent(scene()->sceneGraphNode("SolarSystem")); -// // vestaNode->setEphemeris(new StaticEphemeris); -// // -// // solarSystemBarycenterNode->setParent(vestaNode); -// // newHorizonsNode->setParent(vestaNode); -// // -// // dawnNode->setParent(vestaNode); -// // plutoBarycenterNode->setParent(vestaNode); -// // -// // -// // ghoul::Dictionary plutoDictionary = -// // { -// // { std::string("Type"), std::string("Spice") }, -// // { std::string("Body"), std::string("PLUTO BARYCENTER") }, -// // { std::string("Reference"), std::string("GALACTIC") }, -// // { std::string("Observer"), std::string("VESTA") }, -// // { std::string("Kernels"), ghoul::Dictionary() } -// // }; -// // ghoul::Dictionary solarDictionary = -// // { -// // { std::string("Type"), std::string("Spice") }, -// // { std::string("Body"), std::string("SUN") }, -// // { std::string("Reference"), std::string("GALACTIC") }, -// // { std::string("Observer"), std::string("VESTA") }, -// // { std::string("Kernels"), ghoul::Dictionary() } -// // }; -// // -// // ghoul::Dictionary jupiterDictionary = -// // { -// // { std::string("Type"), std::string("Spice") }, -// // { std::string("Body"), std::string("JUPITER BARYCENTER") }, -// // { std::string("Reference"), std::string("GALACTIC") }, -// // { std::string("Observer"), std::string("VESTA") }, -// // { std::string("Kernels"), ghoul::Dictionary() } -// // }; -// // -// // solarSystemBarycenterNode->setEphemeris(new SpiceEphemeris(solarDictionary)); -// // plutoBarycenterNode->setEphemeris(new SpiceEphemeris(plutoDictionary)); -// // jupiterBarycenterNode->setEphemeris(new SpiceEphemeris(jupiterDictionary)); -// // -// // ghoul::Dictionary newHorizonsDictionary = -// // { -// // { std::string("Type"), std::string("Spice") }, -// // { std::string("Body"), std::string("NEW HORIZONS") }, -// // { std::string("Reference"), std::string("GALACTIC") }, -// // { std::string("Observer"), std::string("VESTA") }, -// // { std::string("Kernels"), ghoul::Dictionary() } -// // }; -// // newHorizonsNode->setEphemeris(new SpiceEphemeris(newHorizonsDictionary)); -// // -// // ghoul::Dictionary dawnDictionary = -// // { -// // { std::string("Type"), std::string("Spice") }, -// // { std::string("Body"), std::string("DAWN") }, -// // { std::string("Reference"), std::string("GALACTIC") }, -// // { std::string("Observer"), std::string("VESTA") }, -// // { std::string("Kernels"), ghoul::Dictionary() } -// // }; -// // dawnNode->setEphemeris(new SpiceEphemeris(dawnDictionary)); -// // vestaNode->setEphemeris(new StaticEphemeris); -// // -// // return; -// //} -// -// if (origin == "67P") { -// SceneGraphNode* rosettaNode = scene()->sceneGraphNode("Rosetta"); -// SceneGraphNode* cgNode = scene()->sceneGraphNode("67P"); -// //jupiterBarycenterNode->setParent(solarSystemBarycenterNode); -// //plutoBarycenterNode->setParent(solarSystemBarycenterNode); -// solarSystemBarycenterNode->setParent(cgNode); -// rosettaNode->setParent(cgNode); -// -// ghoul::Dictionary solarDictionary = -// { -// { std::string("Type"), std::string("Spice") }, -// { std::string("Body"), std::string("SUN") }, -// { std::string("Reference"), std::string("GALACTIC") }, -// { std::string("Observer"), std::string("CHURYUMOV-GERASIMENKO") }, -// { std::string("Kernels"), ghoul::Dictionary() } -// }; -// solarSystemBarycenterNode->setEphemeris(new SpiceEphemeris(solarDictionary)); -// -// ghoul::Dictionary rosettaDictionary = -// { -// { std::string("Type"), std::string("Spice") }, -// { std::string("Body"), std::string("ROSETTA") }, -// { std::string("Reference"), std::string("GALACTIC") }, -// { std::string("Observer"), std::string("CHURYUMOV-GERASIMENKO") }, -// { std::string("Kernels"), ghoul::Dictionary() } -// }; -// -// cgNode->setParent(scene()->sceneGraphNode("SolarSystem")); -// rosettaNode->setEphemeris(new SpiceEphemeris(rosettaDictionary)); -// cgNode->setEphemeris(new StaticEphemeris); -// -// return; -// -// } -// -// LFATAL("This function is being misused with an argument of '" << origin << "'"); -} - void RenderEngine::setShowFrameNumber(bool enabled){ _showFrameNumber = enabled; } @@ -1210,12 +811,14 @@ void RenderEngine::registerScreenSpaceRenderable(std::shared_ptr s){ +void RenderEngine::unregisterScreenSpaceRenderable( + std::shared_ptr s) +{ auto it = std::find( _screenSpaceRenderables.begin(), _screenSpaceRenderables.end(), s - ); + ); if (it != _screenSpaceRenderables.end()) { s->deinitialize(); @@ -1225,13 +828,16 @@ void RenderEngine::unregisterScreenSpaceRenderable(std::shared_ptr RenderEngine::screenSpaceRenderable(std::string name){ - for(auto s : _screenSpaceRenderables){ - if(s->name() == name){ +std::shared_ptr RenderEngine::screenSpaceRenderable( + std::string name) +{ + for (auto s : _screenSpaceRenderables) { + if (s->name() == name) { return s; } } @@ -1249,27 +855,33 @@ std::vector RenderEngine::screenSpaceRenderables() const return res; } -RenderEngine::RendererImplementation RenderEngine::rendererFromString(const std::string& impl) { +RenderEngine::RendererImplementation RenderEngine::rendererFromString( + const std::string& impl) +{ const std::map RenderingMethods = { { "ABuffer", RendererImplementation::ABuffer }, { "Framebuffer", RendererImplementation::Framebuffer } }; - if (RenderingMethods.find(impl) != RenderingMethods.end()) + if (RenderingMethods.find(impl) != RenderingMethods.end()) { return RenderingMethods.at(impl); - else + } + else { return RendererImplementation::Invalid; + } } std::string RenderEngine::progressToStr(int size, double t) { std::string progress = "|"; int g = static_cast((t * (size - 1)) + 1); g = std::max(g, 0); - for (int i = 0; i < g; i++) + for (int i = 0; i < g; i++) { progress.append("-"); + } progress.append(">"); - for (int i = 0; i < size - g; i++) + for (int i = 0; i < size - g; i++) { progress.append(" "); + } progress.append("|"); return progress; } @@ -1288,47 +900,53 @@ void RenderEngine::renderInformation() { penPosition.y -= _fontDate->height(); if (_showInfo && _fontDate) { - RenderFontCr(*_fontDate, + RenderFontCr( + *_fontDate, penPosition, "Date: %s", Time::ref().UTC().c_str() ); } if (_showInfo && _fontInfo) { - RenderFontCr(*_fontInfo, - penPosition, - "Simulation increment (s): %.0f", - Time::ref().deltaTime() + RenderFontCr( + *_fontInfo, + penPosition, + "Simulation increment (s): %.0f", + Time::ref().deltaTime() ); FrametimeType frametimeType = FrametimeType(_frametimeType.value()); switch (frametimeType) { case FrametimeType::DtTimeAvg: - RenderFontCr(*_fontInfo, - penPosition, - "Avg. Frametime: %.5f", - OsEng.windowWrapper().averageDeltaTime() + RenderFontCr( + *_fontInfo, + penPosition, + "Avg. Frametime: %.5f", + OsEng.windowWrapper().averageDeltaTime() ); break; case FrametimeType::FPS: - RenderFontCr(*_fontInfo, - penPosition, - "FPS: %3.2f", - 1.0 / OsEng.windowWrapper().deltaTime() + RenderFontCr( + *_fontInfo, + penPosition, + "FPS: %3.2f", + 1.0 / OsEng.windowWrapper().deltaTime() ); break; case FrametimeType::FPSAvg: - RenderFontCr(*_fontInfo, - penPosition, - "Avg. FPS: %3.2f", - 1.0 / OsEng.windowWrapper().averageDeltaTime() + RenderFontCr( + *_fontInfo, + penPosition, + "Avg. FPS: %3.2f", + 1.0 / OsEng.windowWrapper().averageDeltaTime() ); break; default: - RenderFontCr(*_fontInfo, - penPosition, - "Avg. Frametime: %.5f", - OsEng.windowWrapper().averageDeltaTime() + RenderFontCr( + *_fontInfo, + penPosition, + "Avg. Frametime: %.5f", + OsEng.windowWrapper().averageDeltaTime() ); break; } @@ -1344,7 +962,8 @@ void RenderEngine::renderInformation() { if (nClients == 1) { connectionInfo = "Hosting session with 1 client"; } else { - connectionInfo = "Hosting session with " + std::to_string(nClients) + " clients"; + connectionInfo = + "Hosting session with " + std::to_string(nClients) + " clients"; } } else if (status == ParallelConnection::Status::ClientWithHost) { nClients--; @@ -1357,16 +976,19 @@ void RenderEngine::renderInformation() { status == ParallelConnection::Status::ClientWithoutHost) { connectionInfo += "\n"; if (nClients > 2) { - connectionInfo += "You and " + std::to_string(nClients - 1) + " more clients are tuned in"; + std::string c = std::to_string(nClients - 1); + connectionInfo += "You and " + c + " more clients are tuned in"; } else if (nClients == 2) { - connectionInfo += "You and " + std::to_string(nClients - 1) + " more client are tuned in"; + std::string c = std::to_string(nClients - 1); + connectionInfo += "You and " + c + " more client are tuned in"; } else if (nClients == 1) { connectionInfo += "You are the only client"; } } if (connectionInfo != "") { - RenderFontCr(*_fontInfo, + RenderFontCr( + *_fontInfo, penPosition, connectionInfo.c_str() ); @@ -1391,7 +1013,6 @@ void RenderEngine::renderInformation() { // const Mission& mission = MissionManager::ref().currentMission(); if (mission.phases().size() > 0) { - static const glm::vec4 nextMissionColor(0.7, 0.3, 0.3, 1); //static const glm::vec4 missionProgressColor(0.4, 1.0, 1.0, 1); static const glm::vec4 currentMissionColor(0.0, 0.5, 0.5, 1); @@ -1648,8 +1269,9 @@ void RenderEngine::renderInformation() { } void RenderEngine::renderScreenLog() { - if (!_showLog) + if (!_showLog) { return; + } _log->removeExpiredEntries(); @@ -1659,25 +1281,11 @@ void RenderEngine::renderScreenLog() { std::chrono::seconds fade(5); auto entries = _log->entries(); - auto lastEntries = entries.size() > max ? std::make_pair(entries.rbegin(), entries.rbegin() + max) : std::make_pair(entries.rbegin(), entries.rend()); + auto lastEntries = + entries.size() > max ? + std::make_pair(entries.rbegin(), entries.rbegin() + max) : + std::make_pair(entries.rbegin(), entries.rend()); - // if (entries.size() > max) - - //ScreenLog::const_range ScreenLog::last(size_t n) { - // if (_entries.size() > n) { - // return std::make_pair(_entries.rbegin(), _entries.rbegin() + n); - // } else { - // return std::make_pair(_entries.rbegin(), _entries.rend()); - // } - //} - - // auto entries = _log->last(max); - - const glm::vec4 white(0.9, 0.9, 0.9, 1); - const glm::vec4 red(1, 0, 0, 1); - const glm::vec4 yellow(1, 1, 0, 1); - const glm::vec4 green(0, 1, 0, 1); - const glm::vec4 blue(0, 0, 1, 1); size_t nr = 1; auto now = std::chrono::steady_clock::now(); @@ -1703,26 +1311,44 @@ void RenderEngine::renderScreenLog() { const std::string& message = e->message.substr(0, msg_length); nr += std::count(message.begin(), message.end(), '\n'); - RenderFont(*_fontLog, - glm::vec2(10.f, _fontLog->pointSize() * nr * 2), - white * alpha, - "%-14s %s%s", // Format - e->timeString.c_str(), // Time string - e->category.substr(0, category_length).c_str(), // Category string (up to category_length) - e->category.length() > 20 ? "..." : ""); // Pad category with "..." if exceeds category_length + const glm::vec4 White(0.9f, 0.9f, 0.9f, 1.0f); - glm::vec4 color = white; - if (e->level == ghoul::logging::LogLevel::Debug) - color = green; - if (e->level == ghoul::logging::LogLevel::Warning) - color = yellow; - if (e->level == ghoul::logging::LogLevel::Error) - color = red; - if (e->level == ghoul::logging::LogLevel::Fatal) - color = blue; + RenderFont( + *_fontLog, + glm::vec2(10.f, _fontLog->pointSize() * nr * 2), + White * alpha, + "%-14s %s%s", // Format + e->timeString.c_str(), // Time string + e->category.substr(0, category_length).c_str(), // Category string + e->category.length() > 20 ? "..." : ""); // Pad category with "..." + + const glm::vec4 Red(1.f, 0.f, 0.f, 1.f); + const glm::vec4 Yellow(1.f, 1.f, 0.f, 1.f); + const glm::vec4 Green(0.f, 1.f, 0.f, 1.f); + const glm::vec4 Blue(0.f, 0.f, 1.f, 1.f); + + glm::vec4 color(glm::uninitialize); + switch (e->level) { + case ghoul::logging::LogLevel::Debug: + color = Green; + break; + case ghoul::logging::LogLevel::Warning: + color = Yellow; + break; + case ghoul::logging::LogLevel::Error: + color = Red; + break; + case ghoul::logging::LogLevel::Fatal: + color = Blue; + break; + default: + color = White; + break; + } // const float font_with_light = 5; - RenderFont(*_fontLog, + RenderFont( + *_fontLog, glm::vec2(static_cast(10 + 39 * _fontLog->pointSize()), _fontLog->pointSize() * nr * 2), color * alpha, "%s", // Format @@ -1730,7 +1356,7 @@ void RenderEngine::renderScreenLog() { RenderFont(*_fontLog, glm::vec2(static_cast(10 + 53 * _fontLog->pointSize()), _fontLog->pointSize() * nr * 2), - white * alpha, + White * alpha, "%s", // Format message.c_str()); // Pad category with "..." if exceeds category_length ++nr; From 6199289e9166d0d4063cdfc289395c78f7dc9ad8 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Mon, 27 Feb 2017 23:03:07 -0500 Subject: [PATCH 46/96] Code cleanup --- CMakeLists.txt | 46 +++++++++--------- ext/ghoul | 2 +- include/openspace/util/histogram.h | 2 +- modules/base/CMakeLists.txt | 46 +++++++++--------- modules/base/shaders/pscstandard_fs.glsl | 2 +- modules/base/shaders/pscstandard_vs.glsl | 4 +- modules/base/shaders/screenspace_fs.glsl | 48 ++++++++++--------- modules/base/shaders/screenspace_vs.glsl | 45 +++++++++-------- modules/debugging/CMakeLists.txt | 46 +++++++++--------- .../debugging/rendering/debugshader_fs.glsl | 4 +- .../debugging/rendering/debugshader_vs.glsl | 4 +- modules/fieldlines/CMakeLists.txt | 46 +++++++++--------- modules/fieldlines/shaders/fieldline_fs.glsl | 4 +- modules/fieldlines/shaders/fieldline_gs.glsl | 4 +- modules/fieldlines/shaders/fieldline_vs.glsl | 4 +- modules/galaxy/CMakeLists.txt | 46 +++++++++--------- modules/globebrowsing/CMakeLists.txt | 46 +++++++++--------- .../globebrowsing/other/statscollector.inl | 1 - modules/globebrowsing/shaders/blending.hglsl | 4 +- modules/globebrowsing/shaders/ellipsoid.hglsl | 4 +- .../shaders/globalchunkedlodpatch_fs.glsl | 2 +- .../shaders/globalchunkedlodpatch_vs.glsl | 4 +- .../shaders/localchunkedlodpatch_fs.glsl | 2 +- .../shaders/localchunkedlodpatch_vs.glsl | 4 +- .../globebrowsing/shaders/pointglobe_fs.glsl | 2 +- .../globebrowsing/shaders/pointglobe_vs.glsl | 4 +- .../shaders/texturetilemapping.hglsl | 4 +- modules/globebrowsing/shaders/tile.hglsl | 4 +- .../globebrowsing/shaders/tilefragcolor.hglsl | 4 +- .../shaders/tilevertexheight.hglsl | 4 +- modules/globebrowsing/tile/tiledatatype.cpp | 46 +++++++++--------- .../tile/tileprovider/tileproviderbyindex.cpp | 44 ++++++++--------- modules/iswa/CMakeLists.txt | 46 +++++++++--------- modules/iswa/rendering/screenspacecygnet.cpp | 46 +++++++++--------- modules/kameleon/CMakeLists.txt | 46 +++++++++--------- modules/multiresvolume/CMakeLists.txt | 46 +++++++++--------- modules/newhorizons/CMakeLists.txt | 46 +++++++++--------- .../rendering/renderableplaneprojection.cpp | 44 ++++++++--------- .../shaders/renderableModel_vs.glsl | 2 +- .../renderablePlanetProjection_fs.glsl | 4 +- .../renderablePlanetProjection_vs.glsl | 2 +- modules/onscreengui/CMakeLists.txt | 46 +++++++++--------- modules/onscreengui/ext/imgui/CMakeLists.txt | 46 +++++++++--------- modules/space/CMakeLists.txt | 46 +++++++++--------- modules/space/shaders/nighttexture_fs.glsl | 2 +- modules/space/shaders/nighttexture_vs.glsl | 4 +- .../space/shaders/renderableplanet_fs.glsl | 2 +- .../space/shaders/renderableplanet_vs.glsl | 4 +- modules/space/shaders/shadow_fs.glsl | 2 +- .../space/shaders/shadow_nighttexture_fs.glsl | 2 +- .../space/shaders/shadow_nighttexture_vs.glsl | 4 +- modules/space/shaders/shadow_vs.glsl | 4 +- modules/toyvolume/CMakeLists.txt | 46 +++++++++--------- modules/volume/CMakeLists.txt | 46 +++++++++--------- src/util/camera.cpp | 44 ++++++++--------- src/util/histogram.cpp | 2 +- src/util/keys.cpp | 44 ++++++++--------- src/util/timemanager.cpp | 44 ++++++++--------- support/coding/check_style_guide.py | 6 +++ 59 files changed, 607 insertions(+), 601 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index eee822a3f8..65f32fa11d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,26 +1,26 @@ -######################################################################################### -# # -# 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-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. # +########################################################################################## cmake_minimum_required (VERSION 3.4 FATAL_ERROR) diff --git a/ext/ghoul b/ext/ghoul index 302fca9367..a9a2c04f99 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 302fca93671f67464393f9b2059717e00a516002 +Subproject commit a9a2c04f99a3a8dbfb94f3d3268d3fbf20351c2c diff --git a/include/openspace/util/histogram.h b/include/openspace/util/histogram.h index 20ee8304cd..f26cd80beb 100644 --- a/include/openspace/util/histogram.h +++ b/include/openspace/util/histogram.h @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2015-2017 * + * 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 * diff --git a/modules/base/CMakeLists.txt b/modules/base/CMakeLists.txt index 87bfff60d8..751cb25587 100644 --- a/modules/base/CMakeLists.txt +++ b/modules/base/CMakeLists.txt @@ -1,26 +1,26 @@ -######################################################################################### -# # -# 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. # +########################################################################################## include(${OPENSPACE_CMAKE_EXT_DIR}/module_definition.cmake) diff --git a/modules/base/shaders/pscstandard_fs.glsl b/modules/base/shaders/pscstandard_fs.glsl index c32305121c..8eb494e4d5 100644 --- a/modules/base/shaders/pscstandard_fs.glsl +++ b/modules/base/shaders/pscstandard_fs.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014 * + * 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 * diff --git a/modules/base/shaders/pscstandard_vs.glsl b/modules/base/shaders/pscstandard_vs.glsl index 030d74cc15..936d7cece4 100644 --- a/modules/base/shaders/pscstandard_vs.glsl +++ b/modules/base/shaders/pscstandard_vs.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014 * + * 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 * @@ -54,4 +54,4 @@ void main() vs_position = tmp; position = ViewProjection * position; gl_Position = z_normalization(position); -} \ No newline at end of file +} diff --git a/modules/base/shaders/screenspace_fs.glsl b/modules/base/shaders/screenspace_fs.glsl index 9ab37b56af..11aae2042f 100644 --- a/modules/base/shaders/screenspace_fs.glsl +++ b/modules/base/shaders/screenspace_fs.glsl @@ -1,27 +1,29 @@ /***************************************************************************************** -* * -* 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. * -****************************************************************************************/ -//#version __CONTEXT__ + * * + * 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. * + ****************************************************************************************/ + +#version __CONTEXT__ + uniform sampler2D texture1; uniform float OcclusionDepth; uniform float Alpha; diff --git a/modules/base/shaders/screenspace_vs.glsl b/modules/base/shaders/screenspace_vs.glsl index 02849b3537..cdeafae745 100644 --- a/modules/base/shaders/screenspace_vs.glsl +++ b/modules/base/shaders/screenspace_vs.glsl @@ -1,27 +1,26 @@ - /***************************************************************************************** -* * -* 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. * + ****************************************************************************************/ #version __CONTEXT__ diff --git a/modules/debugging/CMakeLists.txt b/modules/debugging/CMakeLists.txt index a79423ab84..0b2400b4f9 100644 --- a/modules/debugging/CMakeLists.txt +++ b/modules/debugging/CMakeLists.txt @@ -1,26 +1,26 @@ -######################################################################################### -# # -# 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. # +########################################################################################## include(${OPENSPACE_CMAKE_EXT_DIR}/module_definition.cmake) diff --git a/modules/debugging/rendering/debugshader_fs.glsl b/modules/debugging/rendering/debugshader_fs.glsl index 5a395b10e7..e119339bef 100644 --- a/modules/debugging/rendering/debugshader_fs.glsl +++ b/modules/debugging/rendering/debugshader_fs.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014 * + * 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 * @@ -35,4 +35,4 @@ Fragment getFragment(){ frag.color = color; frag.depth = fs_vertexPosition.w; return frag; -} \ No newline at end of file +} diff --git a/modules/debugging/rendering/debugshader_vs.glsl b/modules/debugging/rendering/debugshader_vs.glsl index b68e20f682..45f4357ad8 100644 --- a/modules/debugging/rendering/debugshader_vs.glsl +++ b/modules/debugging/rendering/debugshader_vs.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014 * + * 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 * @@ -33,4 +33,4 @@ out vec4 fs_vertexPosition; void main(){ fs_vertexPosition = z_normalization(vertexPositionClippingSpace); gl_Position = fs_vertexPosition; -} \ No newline at end of file +} diff --git a/modules/fieldlines/CMakeLists.txt b/modules/fieldlines/CMakeLists.txt index e8c847c274..ca28a3c37e 100644 --- a/modules/fieldlines/CMakeLists.txt +++ b/modules/fieldlines/CMakeLists.txt @@ -1,26 +1,26 @@ -######################################################################################### -# # -# OpenSpace # -# # -# Copyright (c) 2014-2015 # -# # -# 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. # +########################################################################################## include(${OPENSPACE_CMAKE_EXT_DIR}/module_definition.cmake) diff --git a/modules/fieldlines/shaders/fieldline_fs.glsl b/modules/fieldlines/shaders/fieldline_fs.glsl index 1bbaf74cba..879b1cfbc7 100644 --- a/modules/fieldlines/shaders/fieldline_fs.glsl +++ b/modules/fieldlines/shaders/fieldline_fs.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014 * + * 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 * @@ -69,4 +69,4 @@ Fragment getFragment() // float depth = pscDepth(gs_position); // ABufferStruct_t frag = createGeometryFragment(fragColor, gs_position, depth); // addToBuffer(frag); -// } \ No newline at end of file +// } diff --git a/modules/fieldlines/shaders/fieldline_gs.glsl b/modules/fieldlines/shaders/fieldline_gs.glsl index 32be0f108c..35845bcc4e 100644 --- a/modules/fieldlines/shaders/fieldline_gs.glsl +++ b/modules/fieldlines/shaders/fieldline_gs.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014 * + * 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 * @@ -96,4 +96,4 @@ void main() { gs_normal = normals[2]; ABufferEmitVertex(prismoid[2]); EndPrimitive(); -} \ No newline at end of file +} diff --git a/modules/fieldlines/shaders/fieldline_vs.glsl b/modules/fieldlines/shaders/fieldline_vs.glsl index 9fcdcb5bcb..394a48c14b 100644 --- a/modules/fieldlines/shaders/fieldline_vs.glsl +++ b/modules/fieldlines/shaders/fieldline_vs.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014 * + * 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 * @@ -37,4 +37,4 @@ out vec4 vs_color; void main() { vs_color = in_color; gl_Position = vec4(in_position, 0); -} \ No newline at end of file +} diff --git a/modules/galaxy/CMakeLists.txt b/modules/galaxy/CMakeLists.txt index afb55cfbb3..4a873620a4 100644 --- a/modules/galaxy/CMakeLists.txt +++ b/modules/galaxy/CMakeLists.txt @@ -1,26 +1,26 @@ -######################################################################################### -# # -# OpenSpace # -# # -# Copyright (c) 2014-2015 # -# # -# 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. # +########################################################################################## include(${OPENSPACE_CMAKE_EXT_DIR}/module_definition.cmake) diff --git a/modules/globebrowsing/CMakeLists.txt b/modules/globebrowsing/CMakeLists.txt index c91053e164..08ab6695c5 100644 --- a/modules/globebrowsing/CMakeLists.txt +++ b/modules/globebrowsing/CMakeLists.txt @@ -1,26 +1,26 @@ -######################################################################################### -# # -# 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. # +########################################################################################## include(${OPENSPACE_CMAKE_EXT_DIR}/module_definition.cmake) diff --git a/modules/globebrowsing/other/statscollector.inl b/modules/globebrowsing/other/statscollector.inl index bafbc02366..f1ce37ec71 100644 --- a/modules/globebrowsing/other/statscollector.inl +++ b/modules/globebrowsing/other/statscollector.inl @@ -1,4 +1,3 @@ -#include "statscollector.h" /***************************************************************************************** * * * OpenSpace * diff --git a/modules/globebrowsing/shaders/blending.hglsl b/modules/globebrowsing/shaders/blending.hglsl index 595758cfe6..e6b6b64bfd 100644 --- a/modules/globebrowsing/shaders/blending.hglsl +++ b/modules/globebrowsing/shaders/blending.hglsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014 * + * 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 * @@ -145,4 +145,4 @@ vec3 hsv2rgb(vec3 c) return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); } -#endif \ No newline at end of file +#endif diff --git a/modules/globebrowsing/shaders/ellipsoid.hglsl b/modules/globebrowsing/shaders/ellipsoid.hglsl index 779c951de8..19c702e2e2 100644 --- a/modules/globebrowsing/shaders/ellipsoid.hglsl +++ b/modules/globebrowsing/shaders/ellipsoid.hglsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014 * + * 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 * @@ -103,4 +103,4 @@ Intersection rayIntersectEllipsoid( return Intersection(true, min(root1, root2), max(root1, root2)); } -#endif // ELLIPSOID_HGLSL \ No newline at end of file +#endif // ELLIPSOID_HGLSL diff --git a/modules/globebrowsing/shaders/globalchunkedlodpatch_fs.glsl b/modules/globebrowsing/shaders/globalchunkedlodpatch_fs.glsl index 9b1764e690..0bdf633ec6 100644 --- a/modules/globebrowsing/shaders/globalchunkedlodpatch_fs.glsl +++ b/modules/globebrowsing/shaders/globalchunkedlodpatch_fs.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014 * + * 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 * diff --git a/modules/globebrowsing/shaders/globalchunkedlodpatch_vs.glsl b/modules/globebrowsing/shaders/globalchunkedlodpatch_vs.glsl index f9aefe6daf..86904a5db8 100644 --- a/modules/globebrowsing/shaders/globalchunkedlodpatch_vs.glsl +++ b/modules/globebrowsing/shaders/globalchunkedlodpatch_vs.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014 * + * 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 * @@ -85,4 +85,4 @@ void main() { gl_Position = fs_position; ellipsoidNormalCameraSpace = mat3(modelViewTransform) * pair.normal; positionCameraSpace = vec3(modelViewTransform * vec4(pair.position, 1)); -} \ No newline at end of file +} diff --git a/modules/globebrowsing/shaders/localchunkedlodpatch_fs.glsl b/modules/globebrowsing/shaders/localchunkedlodpatch_fs.glsl index 7776e071db..4601915b0c 100644 --- a/modules/globebrowsing/shaders/localchunkedlodpatch_fs.glsl +++ b/modules/globebrowsing/shaders/localchunkedlodpatch_fs.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014 * + * 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 * diff --git a/modules/globebrowsing/shaders/localchunkedlodpatch_vs.glsl b/modules/globebrowsing/shaders/localchunkedlodpatch_vs.glsl index 901c2c3b67..8665e88030 100644 --- a/modules/globebrowsing/shaders/localchunkedlodpatch_vs.glsl +++ b/modules/globebrowsing/shaders/localchunkedlodpatch_vs.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014 * + * 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 * @@ -91,4 +91,4 @@ void main() { gl_Position = fs_position; ellipsoidNormalCameraSpace = patchNormalCameraSpace; positionCameraSpace = p; -} \ No newline at end of file +} diff --git a/modules/globebrowsing/shaders/pointglobe_fs.glsl b/modules/globebrowsing/shaders/pointglobe_fs.glsl index 539f2bacb3..cafeb66d3b 100644 --- a/modules/globebrowsing/shaders/pointglobe_fs.glsl +++ b/modules/globebrowsing/shaders/pointglobe_fs.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014 * + * 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 * diff --git a/modules/globebrowsing/shaders/pointglobe_vs.glsl b/modules/globebrowsing/shaders/pointglobe_vs.glsl index 041d021d01..011e9bdf07 100644 --- a/modules/globebrowsing/shaders/pointglobe_vs.glsl +++ b/modules/globebrowsing/shaders/pointglobe_vs.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014 * + * 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 * @@ -51,4 +51,4 @@ void main() { gl_PointSize = pointSizeNDC.x * 2 * windowWidth; gl_Position = vs_positionClipSpace; -} \ No newline at end of file +} diff --git a/modules/globebrowsing/shaders/texturetilemapping.hglsl b/modules/globebrowsing/shaders/texturetilemapping.hglsl index ffc8e8ebf8..ed1fe063d0 100644 --- a/modules/globebrowsing/shaders/texturetilemapping.hglsl +++ b/modules/globebrowsing/shaders/texturetilemapping.hglsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014 * + * 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 * @@ -386,4 +386,4 @@ vec4 calculateWater( return currentColor + vec4(specularTotal, 1); } -#endif // TEXTURETILEMAPPING_HGLSL \ No newline at end of file +#endif // TEXTURETILEMAPPING_HGLSL diff --git a/modules/globebrowsing/shaders/tile.hglsl b/modules/globebrowsing/shaders/tile.hglsl index 8f390c07ca..b48e79486b 100644 --- a/modules/globebrowsing/shaders/tile.hglsl +++ b/modules/globebrowsing/shaders/tile.hglsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014 * + * 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 * @@ -156,4 +156,4 @@ vec4 getTexVal(const ChunkTilePile chunkTilePile, const LevelWeights w, const ve } -#endif // TEXTURETILE_HGLSL \ No newline at end of file +#endif // TEXTURETILE_HGLSL diff --git a/modules/globebrowsing/shaders/tilefragcolor.hglsl b/modules/globebrowsing/shaders/tilefragcolor.hglsl index 26fa48c32e..2b3252becd 100644 --- a/modules/globebrowsing/shaders/tilefragcolor.hglsl +++ b/modules/globebrowsing/shaders/tilefragcolor.hglsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014 * + * 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 * @@ -232,4 +232,4 @@ vec4 getTileFragColor(){ } -#endif ///TILE_FRAG_COLOR_HGLSL \ No newline at end of file +#endif ///TILE_FRAG_COLOR_HGLSL diff --git a/modules/globebrowsing/shaders/tilevertexheight.hglsl b/modules/globebrowsing/shaders/tilevertexheight.hglsl index ac4e4d4bf1..6733b30c96 100644 --- a/modules/globebrowsing/shaders/tilevertexheight.hglsl +++ b/modules/globebrowsing/shaders/tilevertexheight.hglsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014 * + * 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 * @@ -123,4 +123,4 @@ float getTileVertexSkirtLength(){ return tileVertexIsSkirtVertex() ? skirtLength : 0.0; } -#endif // TILE_VERTEX_HEIGHT_HGLSL \ No newline at end of file +#endif // TILE_VERTEX_HEIGHT_HGLSL diff --git a/modules/globebrowsing/tile/tiledatatype.cpp b/modules/globebrowsing/tile/tiledatatype.cpp index 849e92c6be..8cebef5b31 100644 --- a/modules/globebrowsing/tile/tiledatatype.cpp +++ b/modules/globebrowsing/tile/tiledatatype.cpp @@ -1,26 +1,26 @@ - /***************************************************************************************** -* * -* 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. * + ****************************************************************************************/ #include diff --git a/modules/globebrowsing/tile/tileprovider/tileproviderbyindex.cpp b/modules/globebrowsing/tile/tileprovider/tileproviderbyindex.cpp index 866f01a5d4..edebf63d74 100644 --- a/modules/globebrowsing/tile/tileprovider/tileproviderbyindex.cpp +++ b/modules/globebrowsing/tile/tileprovider/tileproviderbyindex.cpp @@ -1,26 +1,26 @@ /***************************************************************************************** -* * -* 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. * + ****************************************************************************************/ #include diff --git a/modules/iswa/CMakeLists.txt b/modules/iswa/CMakeLists.txt index c97f1dd0c3..2d05f0775a 100644 --- a/modules/iswa/CMakeLists.txt +++ b/modules/iswa/CMakeLists.txt @@ -1,26 +1,26 @@ -######################################################################################### -# # -# 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. # +########################################################################################## include(${OPENSPACE_CMAKE_EXT_DIR}/module_definition.cmake) diff --git a/modules/iswa/rendering/screenspacecygnet.cpp b/modules/iswa/rendering/screenspacecygnet.cpp index 32c2c340a0..997ec14f55 100644 --- a/modules/iswa/rendering/screenspacecygnet.cpp +++ b/modules/iswa/rendering/screenspacecygnet.cpp @@ -1,26 +1,26 @@ /***************************************************************************************** -* * -* 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. * + ****************************************************************************************/ #include #include @@ -87,4 +87,4 @@ void ScreenSpaceCygnet::update(){ loadTexture(); } } -} \ No newline at end of file +} diff --git a/modules/kameleon/CMakeLists.txt b/modules/kameleon/CMakeLists.txt index 2171629667..c362cea5f5 100644 --- a/modules/kameleon/CMakeLists.txt +++ b/modules/kameleon/CMakeLists.txt @@ -1,26 +1,26 @@ -######################################################################################### -# # -# OpenSpace # -# # -# Copyright (c) 2014-2015 # -# # -# 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. # +########################################################################################## include(${OPENSPACE_CMAKE_EXT_DIR}/module_definition.cmake) diff --git a/modules/multiresvolume/CMakeLists.txt b/modules/multiresvolume/CMakeLists.txt index a316db5dc3..da1585653c 100644 --- a/modules/multiresvolume/CMakeLists.txt +++ b/modules/multiresvolume/CMakeLists.txt @@ -1,26 +1,26 @@ -######################################################################################### -# # -# OpenSpace # -# # -# Copyright (c) 2014-2015 # -# # -# 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. # +########################################################################################## include(${OPENSPACE_CMAKE_EXT_DIR}/module_definition.cmake) diff --git a/modules/newhorizons/CMakeLists.txt b/modules/newhorizons/CMakeLists.txt index ee275651ac..5d94356edf 100644 --- a/modules/newhorizons/CMakeLists.txt +++ b/modules/newhorizons/CMakeLists.txt @@ -1,26 +1,26 @@ -######################################################################################### -# # -# 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. # +########################################################################################## include(${OPENSPACE_CMAKE_EXT_DIR}/module_definition.cmake) diff --git a/modules/newhorizons/rendering/renderableplaneprojection.cpp b/modules/newhorizons/rendering/renderableplaneprojection.cpp index 4c405ee4a2..731e0c763a 100644 --- a/modules/newhorizons/rendering/renderableplaneprojection.cpp +++ b/modules/newhorizons/rendering/renderableplaneprojection.cpp @@ -1,26 +1,26 @@ /***************************************************************************************** -* * -* 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. * + ****************************************************************************************/ #include diff --git a/modules/newhorizons/shaders/renderableModel_vs.glsl b/modules/newhorizons/shaders/renderableModel_vs.glsl index 02e5a2831d..1870205549 100644 --- a/modules/newhorizons/shaders/renderableModel_vs.glsl +++ b/modules/newhorizons/shaders/renderableModel_vs.glsl @@ -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 * diff --git a/modules/newhorizons/shaders/renderablePlanetProjection_fs.glsl b/modules/newhorizons/shaders/renderablePlanetProjection_fs.glsl index ff8698c866..d8b11e1297 100644 --- a/modules/newhorizons/shaders/renderablePlanetProjection_fs.glsl +++ b/modules/newhorizons/shaders/renderablePlanetProjection_fs.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014 * + * 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 * @@ -92,4 +92,4 @@ void main() { color = vec4(0.0); stencil = vec4(0.0); } -} \ No newline at end of file +} diff --git a/modules/newhorizons/shaders/renderablePlanetProjection_vs.glsl b/modules/newhorizons/shaders/renderablePlanetProjection_vs.glsl index d709738859..121226ca23 100644 --- a/modules/newhorizons/shaders/renderablePlanetProjection_vs.glsl +++ b/modules/newhorizons/shaders/renderablePlanetProjection_vs.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014 * + * 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 * diff --git a/modules/onscreengui/CMakeLists.txt b/modules/onscreengui/CMakeLists.txt index e0064f6c70..b6a8bfb9ac 100644 --- a/modules/onscreengui/CMakeLists.txt +++ b/modules/onscreengui/CMakeLists.txt @@ -1,26 +1,26 @@ -######################################################################################### -# # -# 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. # +########################################################################################## include(${OPENSPACE_CMAKE_EXT_DIR}/module_definition.cmake) diff --git a/modules/onscreengui/ext/imgui/CMakeLists.txt b/modules/onscreengui/ext/imgui/CMakeLists.txt index 69ee237b3a..38adca106c 100644 --- a/modules/onscreengui/ext/imgui/CMakeLists.txt +++ b/modules/onscreengui/ext/imgui/CMakeLists.txt @@ -1,26 +1,26 @@ -######################################################################################### -# # -# 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. # +########################################################################################## project(Imgui) message(STATUS "Generating Imgui project") diff --git a/modules/space/CMakeLists.txt b/modules/space/CMakeLists.txt index b4fc052ad4..2964adab1d 100644 --- a/modules/space/CMakeLists.txt +++ b/modules/space/CMakeLists.txt @@ -1,26 +1,26 @@ -######################################################################################### -# # -# 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. # +########################################################################################## include(${OPENSPACE_CMAKE_EXT_DIR}/module_definition.cmake) diff --git a/modules/space/shaders/nighttexture_fs.glsl b/modules/space/shaders/nighttexture_fs.glsl index 94175a9f7b..22874edf3e 100644 --- a/modules/space/shaders/nighttexture_fs.glsl +++ b/modules/space/shaders/nighttexture_fs.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014 * + * 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 * diff --git a/modules/space/shaders/nighttexture_vs.glsl b/modules/space/shaders/nighttexture_vs.glsl index 8056fd63ad..d22246fb3f 100644 --- a/modules/space/shaders/nighttexture_vs.glsl +++ b/modules/space/shaders/nighttexture_vs.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014 * + * 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 * @@ -65,4 +65,4 @@ void main() { vs_position = z_normalization(position); gl_Position = vs_position; -} \ No newline at end of file +} diff --git a/modules/space/shaders/renderableplanet_fs.glsl b/modules/space/shaders/renderableplanet_fs.glsl index f275091d76..9240ff32de 100644 --- a/modules/space/shaders/renderableplanet_fs.glsl +++ b/modules/space/shaders/renderableplanet_fs.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014 * + * 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 * diff --git a/modules/space/shaders/renderableplanet_vs.glsl b/modules/space/shaders/renderableplanet_vs.glsl index e726d0149a..b819ebcbd2 100644 --- a/modules/space/shaders/renderableplanet_vs.glsl +++ b/modules/space/shaders/renderableplanet_vs.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014 * + * 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 * @@ -55,4 +55,4 @@ void main() { gl_Position = vs_position; -} \ No newline at end of file +} diff --git a/modules/space/shaders/shadow_fs.glsl b/modules/space/shaders/shadow_fs.glsl index 056d8c6c00..536b6d6718 100644 --- a/modules/space/shaders/shadow_fs.glsl +++ b/modules/space/shaders/shadow_fs.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014 * + * 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 * diff --git a/modules/space/shaders/shadow_nighttexture_fs.glsl b/modules/space/shaders/shadow_nighttexture_fs.glsl index 2400d5a4be..b8d5b32819 100644 --- a/modules/space/shaders/shadow_nighttexture_fs.glsl +++ b/modules/space/shaders/shadow_nighttexture_fs.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014 * + * 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 * diff --git a/modules/space/shaders/shadow_nighttexture_vs.glsl b/modules/space/shaders/shadow_nighttexture_vs.glsl index 82c8f5545c..cb2dc8c1b1 100644 --- a/modules/space/shaders/shadow_nighttexture_vs.glsl +++ b/modules/space/shaders/shadow_nighttexture_vs.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014 * + * 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 * @@ -65,4 +65,4 @@ void main() // coordinates. position = ViewProjection * position; gl_Position = z_normalization(position); -} \ No newline at end of file +} diff --git a/modules/space/shaders/shadow_vs.glsl b/modules/space/shaders/shadow_vs.glsl index 82c8f5545c..cb2dc8c1b1 100644 --- a/modules/space/shaders/shadow_vs.glsl +++ b/modules/space/shaders/shadow_vs.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014 * + * 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 * @@ -65,4 +65,4 @@ void main() // coordinates. position = ViewProjection * position; gl_Position = z_normalization(position); -} \ No newline at end of file +} diff --git a/modules/toyvolume/CMakeLists.txt b/modules/toyvolume/CMakeLists.txt index 56d52a4d2f..7b53b2699f 100644 --- a/modules/toyvolume/CMakeLists.txt +++ b/modules/toyvolume/CMakeLists.txt @@ -1,26 +1,26 @@ -######################################################################################### -# # -# 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. # +########################################################################################## include(${OPENSPACE_CMAKE_EXT_DIR}/module_definition.cmake) diff --git a/modules/volume/CMakeLists.txt b/modules/volume/CMakeLists.txt index 95cb375fb8..09c6d8efde 100644 --- a/modules/volume/CMakeLists.txt +++ b/modules/volume/CMakeLists.txt @@ -1,26 +1,26 @@ -######################################################################################### -# # -# OpenSpace # -# # -# Copyright (c) 2014-2015 # -# # -# 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. # +########################################################################################## include(${OPENSPACE_CMAKE_EXT_DIR}/module_definition.cmake) diff --git a/src/util/camera.cpp b/src/util/camera.cpp index 0dd135f3dc..4ce6062a04 100644 --- a/src/util/camera.cpp +++ b/src/util/camera.cpp @@ -1,26 +1,26 @@ /***************************************************************************************** -* * -* 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. * + ****************************************************************************************/ // open space includes #include diff --git a/src/util/histogram.cpp b/src/util/histogram.cpp index 31600c1b0b..395396c217 100644 --- a/src/util/histogram.cpp +++ b/src/util/histogram.cpp @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 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 * diff --git a/src/util/keys.cpp b/src/util/keys.cpp index ecf3d2b65d..17a57f6693 100644 --- a/src/util/keys.cpp +++ b/src/util/keys.cpp @@ -1,26 +1,26 @@ /***************************************************************************************** -* * -* 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. * + ****************************************************************************************/ #include diff --git a/src/util/timemanager.cpp b/src/util/timemanager.cpp index 5780567fd4..d99aed73f7 100644 --- a/src/util/timemanager.cpp +++ b/src/util/timemanager.cpp @@ -1,26 +1,26 @@ /***************************************************************************************** -* * -* 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. * + ****************************************************************************************/ #include #include diff --git a/support/coding/check_style_guide.py b/support/coding/check_style_guide.py index 06b3b536c6..aed2d9720f 100644 --- a/support/coding/check_style_guide.py +++ b/support/coding/check_style_guide.py @@ -316,6 +316,12 @@ def check_source_file(file, component): if core_dependency: print(file, '\t' 'Wrong core dependency', core_dependency) + copyright = check_copyright(lines) + if copyright: + print(file, '\t', 'Copyright check failed', '\t', copyright) + return + + def check_files(positiveList, negativeList, component, check_function): From 8910aac83429bbddc9bffb2c46b3698369bce975 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Tue, 28 Feb 2017 20:38:58 -0500 Subject: [PATCH 47/96] - Replace window name check with tag check for GUI code (closing #258) - Only show GUI, console, and screenlog on the GUI window --- config/sgct/single_gui.xml | 4 ++-- modules/onscreengui/onscreenguimodule.cpp | 18 ++++++---------- src/engine/openspaceengine.cpp | 26 +++++++++++------------ src/engine/wrapper/sgctwindowwrapper.cpp | 9 +++++--- 4 files changed, 27 insertions(+), 30 deletions(-) diff --git a/config/sgct/single_gui.xml b/config/sgct/single_gui.xml index a3956e40f6..129232a9ea 100644 --- a/config/sgct/single_gui.xml +++ b/config/sgct/single_gui.xml @@ -4,7 +4,7 @@ - + @@ -17,7 +17,7 @@ - + diff --git a/modules/onscreengui/onscreenguimodule.cpp b/modules/onscreengui/onscreenguimodule.cpp index b1a96a32d3..976bd6a4b5 100644 --- a/modules/onscreengui/onscreenguimodule.cpp +++ b/modules/onscreengui/onscreenguimodule.cpp @@ -102,10 +102,11 @@ OnScreenGUIModule::OnScreenGUIModule() ); OsEng.registerModuleCallback( - OpenSpaceEngine::CallbackOption::PostSyncPreDraw, + OpenSpaceEngine::CallbackOption::Render, [](){ WindowWrapper& wrapper = OsEng.windowWrapper(); - if (wrapper.isMaster() && wrapper.isRegularRendering()) { + bool showGui = wrapper.hasGuiWindow() ? wrapper.isGuiWindow() : true; + if (wrapper.isMaster() && wrapper.isRegularRendering() && showGui ) { glm::vec2 mousePosition = wrapper.mousePosition(); //glm::ivec2 drawBufferResolution = _windowWrapper->currentDrawBufferResolution(); glm::ivec2 windowSize = wrapper.currentWindowSize(); @@ -114,6 +115,8 @@ OnScreenGUIModule::OnScreenGUIModule() double dt = std::max(wrapper.averageDeltaTime(), 0.0); + // We don't do any collection of immediate mode user interface, so it is + // fine to open and close a frame immediately gui.startFrame( static_cast(dt), glm::vec2(windowSize), @@ -121,16 +124,7 @@ OnScreenGUIModule::OnScreenGUIModule() mousePosition, mouseButtons ); - } - } - ); - - OsEng.registerModuleCallback( - OpenSpaceEngine::CallbackOption::PostDraw, - [](){ - WindowWrapper& wrapper = OsEng.windowWrapper(); - bool showGui = wrapper.hasGuiWindow() ? wrapper.isGuiWindow() : true; - if (wrapper.isMaster() && wrapper.isRegularRendering() && showGui) { + gui.endFrame(); } } diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index 29c00cc35f..358ac33a79 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -934,6 +934,19 @@ void OpenSpaceEngine::render(const glm::mat4& viewMatrix, func(); } + // @CLEANUP: Replace the two windows by a single call to whether a gui should be + // rendered ---abock + bool showGui = _windowWrapper->hasGuiWindow() ? _windowWrapper->isGuiWindow() : true; + if (showGui && _windowWrapper->isMaster() && _windowWrapper->isRegularRendering()) { + _renderEngine->renderScreenLog(); + if (_console->isVisible()) + _console->render(); + } + + if (_shutdown.inShutdown) { + _renderEngine->renderShutdownInformation(_shutdown.timer, _shutdown.waitTime); + } + LTRACE("OpenSpaceEngine::render(end)"); } @@ -946,19 +959,6 @@ void OpenSpaceEngine::postDraw() { func(); } - // @CLEANUP: Replace the two windows by a single call to whether a gui should be - // rendered ---abock - bool showGui = _windowWrapper->hasGuiWindow() ? _windowWrapper->isGuiWindow() : true; - if (showGui) { - _renderEngine->renderScreenLog(); - if (_console->isVisible()) - _console->render(); - } - - if (_shutdown.inShutdown) { - _renderEngine->renderShutdownInformation(_shutdown.timer, _shutdown.waitTime); - } - if (_isFirstRenderingFirstFrame) { _windowWrapper->setSynchronization(true); _isFirstRenderingFirstFrame = false; diff --git a/src/engine/wrapper/sgctwindowwrapper.cpp b/src/engine/wrapper/sgctwindowwrapper.cpp index 9708bbac57..950145fc11 100644 --- a/src/engine/wrapper/sgctwindowwrapper.cpp +++ b/src/engine/wrapper/sgctwindowwrapper.cpp @@ -31,7 +31,7 @@ #undef far namespace { - const std::string GuiWindowName = "GUI"; + const char* GuiWindowTag = "GUI"; } namespace openspace { @@ -153,14 +153,17 @@ bool SGCTWindowWrapper::isRegularRendering() const { bool SGCTWindowWrapper::hasGuiWindow() const { auto engine = sgct::Engine::instance(); for (size_t i = 0; i < engine->getNumberOfWindows(); ++i) { - if (engine->getWindowPtr(i)->getName() == GuiWindowName) + if (engine->getWindowPtr(i)->checkIfTagExists(GuiWindowTag)) { return true; + } } return false; } bool SGCTWindowWrapper::isGuiWindow() const { - return sgct::Engine::instance()->getCurrentWindowPtr()->getName() == GuiWindowName; + return sgct::Engine::instance()->getCurrentWindowPtr()->checkIfTagExists( + GuiWindowTag + ); } bool SGCTWindowWrapper::isMaster() const { From 59c8ba6700966bdd6a9519cff2d77394c6c6935d Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Tue, 28 Feb 2017 20:39:34 -0500 Subject: [PATCH 48/96] - Replace window name check with tag check for GUI code (closed #258) - Only show GUI, console, and screenlog on the GUI window --- src/engine/openspaceengine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index 358ac33a79..a2b443b5c1 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -958,7 +958,7 @@ void OpenSpaceEngine::postDraw() { for (const auto& func : _moduleCallbacks.postDraw) { func(); } - + if (_isFirstRenderingFirstFrame) { _windowWrapper->setSynchronization(true); _isFirstRenderingFirstFrame = false; From 2500b5f72bf49ffdffc852432402c4bc62e7e711 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Tue, 28 Feb 2017 21:22:42 -0500 Subject: [PATCH 49/96] Add Dictionary constructor to TileIndexTileProvider (closes #248) --- .../globebrowsing/tile/tileprovider/tileindextileprovider.cpp | 2 ++ modules/globebrowsing/tile/tileprovider/tileindextileprovider.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/modules/globebrowsing/tile/tileprovider/tileindextileprovider.cpp b/modules/globebrowsing/tile/tileprovider/tileindextileprovider.cpp index 0398f18541..eda42ee4f1 100644 --- a/modules/globebrowsing/tile/tileprovider/tileindextileprovider.cpp +++ b/modules/globebrowsing/tile/tileprovider/tileindextileprovider.cpp @@ -30,6 +30,8 @@ namespace openspace { namespace globebrowsing { namespace tileprovider { +TileIndexTileProvider::TileIndexTileProvider(const ghoul::Dictionary& dict) {} + void TileIndexTileProvider::renderText(const ghoul::fontrendering::FontRenderer& fontRenderer, const TileIndex& tileIndex) const { diff --git a/modules/globebrowsing/tile/tileprovider/tileindextileprovider.h b/modules/globebrowsing/tile/tileprovider/tileindextileprovider.h index 0e418bb2a9..ef1f8337eb 100644 --- a/modules/globebrowsing/tile/tileprovider/tileindextileprovider.h +++ b/modules/globebrowsing/tile/tileprovider/tileindextileprovider.h @@ -36,6 +36,8 @@ namespace tileprovider { */ class TileIndexTileProvider : public TextTileProvider { public: + TileIndexTileProvider(const ghoul::Dictionary& dict); + virtual void renderText(const ghoul::fontrendering::FontRenderer& fontRenderer, const TileIndex& tileIndex) const; }; From 6694cfd98c5c23c318d38b1701b039d81333bfb8 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Tue, 28 Feb 2017 21:23:10 -0500 Subject: [PATCH 50/96] Remove warning from iSWA manager download --- modules/iswa/util/iswamanager.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/modules/iswa/util/iswamanager.cpp b/modules/iswa/util/iswamanager.cpp index 14ff791eaf..98a0494ac2 100644 --- a/modules/iswa/util/iswamanager.cpp +++ b/modules/iswa/util/iswamanager.cpp @@ -89,9 +89,6 @@ IswaManager::IswaManager() "http://iswa3.ccmc.gsfc.nasa.gov/IswaSystemWebApp/CygnetHealthServlet", [this](const DownloadManager::MemoryFile& file){ fillCygnetInfo(std::string(file.buffer)); - }, - [](const std::string& err){ - LWARNING("Download to memory was aborted: " + err); } ); } From 3e2c56c9407a11a3792d8d6ad5654cae8955a1aa Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Tue, 28 Feb 2017 23:15:11 -0500 Subject: [PATCH 51/96] Steps towards moving dedicated lua functions into properties --- include/openspace/engine/settingsengine.h | 2 - include/openspace/rendering/renderengine.h | 24 ++++--- src/engine/settingsengine.cpp | 9 --- src/rendering/renderengine.cpp | 77 +++++++++------------- src/rendering/renderengine_lua.inl | 59 ----------------- 5 files changed, 41 insertions(+), 130 deletions(-) diff --git a/include/openspace/engine/settingsengine.h b/include/openspace/engine/settingsengine.h index bcce9884f5..0dcc5978aa 100644 --- a/include/openspace/engine/settingsengine.h +++ b/include/openspace/engine/settingsengine.h @@ -52,14 +52,12 @@ public: private: void initEyeSeparation(); void initSceneFiles(); - void initShowFrameNumber(); void initBusyWaitForDecode(); void initLogSGCTOutOfOrderErrors(); void initUseDoubleBuffering(); properties::FloatProperty _eyeSeparation; properties::OptionProperty _scenes; - properties::BoolProperty _showFrameNumber; properties::BoolProperty _busyWaitForDecode; properties::BoolProperty _logSGCTOutOfOrderErrors; properties::BoolProperty _useDoubleBuffering; diff --git a/include/openspace/rendering/renderengine.h b/include/openspace/rendering/renderengine.h index cfb3868664..da40e6b3c8 100644 --- a/include/openspace/rendering/renderengine.h +++ b/include/openspace/rendering/renderengine.h @@ -29,7 +29,9 @@ #include #include +#include #include +#include #include @@ -102,17 +104,12 @@ public: void renderShutdownInformation(float timer, float fullTime); void postDraw(); - void takeScreenshot(bool applyWarping = false); - void toggleInfoText(bool b); - // Performance measurements bool doesPerformanceMeasurements() const; performance::PerformanceManager* performanceManager(); float globalBlackOutFactor(); void setGlobalBlackOutFactor(float factor); - void setNAaSamples(int nAaSamples); - void setShowFrameNumber(bool enabled); void setDisableRenderingOnMaster(bool enabled); @@ -203,17 +200,20 @@ private: //FrametimeType _frametimeType; - bool _showInfo; - bool _showLog; - bool _takeScreenshot; - bool _applyWarping; - bool _showFrameNumber; + properties::BoolProperty _showInfo; + properties::BoolProperty _showLog; + + properties::TriggerProperty _takeScreenshot; + bool _shouldTakeScreenshot; + properties::BoolProperty _applyWarping; + properties::BoolProperty _showFrameNumber; + properties::BoolProperty _disableMasterRendering; float _globalBlackOutFactor; float _fadeDuration; float _currentFadeTime; int _fadeDirection; - int _nAaSamples; + properties::IntProperty _nAaSamples; uint64_t _frameNumber; std::vector _programs; @@ -223,8 +223,6 @@ private: std::shared_ptr _fontInfo = nullptr; std::shared_ptr _fontDate = nullptr; std::shared_ptr _fontLog = nullptr; - - bool _disableMasterRendering = false; }; } // namespace openspace diff --git a/src/engine/settingsengine.cpp b/src/engine/settingsengine.cpp index 4663641de3..a74dbfdde7 100644 --- a/src/engine/settingsengine.cpp +++ b/src/engine/settingsengine.cpp @@ -48,7 +48,6 @@ namespace openspace { SettingsEngine::SettingsEngine() : _eyeSeparation("eyeSeparation", "Eye Separation" , 0.f, 0.f, 10.f) , _scenes("scenes", "Scene", properties::OptionProperty::DisplayType::Dropdown) - , _showFrameNumber("showFrameNumber", "Show frame number", false) , _busyWaitForDecode("busyWaitForDecode", "Busy Wait for decode", false) , _logSGCTOutOfOrderErrors("logSGCTOutOfOrderErrors", "Log SGCT out-of-order", false) , _useDoubleBuffering("useDoubleBuffering", "Use double buffering", false) @@ -70,7 +69,6 @@ SettingsEngine::SettingsEngine() void SettingsEngine::initialize() { initEyeSeparation(); initSceneFiles(); - initShowFrameNumber(); initBusyWaitForDecode(); initLogSGCTOutOfOrderErrors(); initUseDoubleBuffering(); @@ -90,13 +88,6 @@ void SettingsEngine::initEyeSeparation() { [this]() { OsEng.windowWrapper().setEyeSeparationDistance(_eyeSeparation); }); } -void SettingsEngine::initShowFrameNumber() { - addProperty(_showFrameNumber); - - _showFrameNumber.onChange( - [this]() { OsEng.renderEngine().setShowFrameNumber(_showFrameNumber.value()); } ); -} - void SettingsEngine::initBusyWaitForDecode() { addProperty(_busyWaitForDecode); _busyWaitForDecode.onChange( diff --git a/src/rendering/renderengine.cpp b/src/rendering/renderengine.cpp index a12234a876..83e972ea41 100644 --- a/src/rendering/renderengine.cpp +++ b/src/rendering/renderengine.cpp @@ -99,15 +99,19 @@ RenderEngine::RenderEngine() "Type of the frametime display", properties::OptionProperty::DisplayType::Dropdown ) + , _showInfo("showInfo", "Show Render Information", true) + , _showLog("showLog", "Show the OnScreen log", true) + , _nAaSamples("nAaSamples", "Number of Antialiasing samples", 8, 1, 16) + , _applyWarping("applyWarpingScreenshot", "Apply Warping to Screenshots", false) + , _takeScreenshot("takeScreenshot", "Take Screenshot") + , _showFrameNumber("showFrameNumber", "Show Frame Number", false) + , _disableMasterRendering("disableMasterRendering", "Disable Master Rendering", false) + , _shouldTakeScreenshot(false) , _sceneGraph(nullptr) , _renderer(nullptr) , _rendererImplementation(RendererImplementation::Invalid) , _performanceManager(nullptr) , _log(nullptr) - , _showInfo(true) - , _showLog(true) - , _takeScreenshot(false) - , _showFrameNumber(false) , _globalBlackOutFactor(1.f) , _fadeDuration(2.f) , _currentFadeTime(0.f) @@ -142,6 +146,26 @@ RenderEngine::RenderEngine() "Average frames per second" ); addProperty(_frametimeType); + + addProperty(_showInfo); + addProperty(_showLog); + + _nAaSamples.onChange([this](){ + if (_renderer) { + _renderer->setNAaSamples(_nAaSamples); + } + }); + addProperty(_nAaSamples); + addProperty(_applyWarping); + + _takeScreenshot.onChange([this](){ + _shouldTakeScreenshot = true; + }); + addProperty(_takeScreenshot); + + addProperty(_showFrameNumber); + + addProperty(_disableMasterRendering); } RenderEngine::~RenderEngine() { @@ -519,9 +543,9 @@ void RenderEngine::postDraw() { Time::ref().setTimeJumped(false); } - if (_takeScreenshot) { + if (_shouldTakeScreenshot) { OsEng.windowWrapper().takeScreenshot(_applyWarping); - _takeScreenshot = false; + _shouldTakeScreenshot = false; } if (_performanceManager) { @@ -529,15 +553,6 @@ void RenderEngine::postDraw() { } } -void RenderEngine::takeScreenshot(bool applyWarping) { - _takeScreenshot = true; - _applyWarping = applyWarping; -} - -void RenderEngine::toggleInfoText(bool b) { - _showInfo = b; -} - Scene* RenderEngine::scene() { ghoul_assert(_sceneGraph, "Scenegraph not initialized"); return _sceneGraph; @@ -716,44 +731,16 @@ void RenderEngine::setRenderer(std::unique_ptr renderer) { _renderer->setScene(_sceneGraph); } - -void RenderEngine::setNAaSamples(int nAaSamples) { - _nAaSamples = nAaSamples; - if (_renderer) { - _renderer->setNAaSamples(_nAaSamples); - } -} - scripting::LuaLibrary RenderEngine::luaLibrary() { return { "", { - { - "takeScreenshot", - &luascriptfunctions::takeScreenshot, - "(optional bool)", - "Renders the current image to a file on disk. If the boolean parameter " - "is set to 'true', the screenshot will include the blending and the " - "meshes. If it is 'false', the straight FBO will be recorded." - }, { "setRenderer", &luascriptfunctions::setRenderer, "string", "Sets the renderer (ABuffer or FrameBuffer)" }, - { - "setNAaSamples", - &luascriptfunctions::setNAaSamples, - "int", - "Sets the number of anti-aliasing (MSAA) samples" - }, - { - "showRenderInformation", - &luascriptfunctions::showRenderInformation, - "bool", - "Toggles the showing of render information on-screen text" - }, { "toggleFade", &luascriptfunctions::toggleFade, @@ -797,10 +784,6 @@ performance::PerformanceManager* RenderEngine::performanceManager() { return _performanceManager.get(); } -void RenderEngine::setShowFrameNumber(bool enabled){ - _showFrameNumber = enabled; -} - void RenderEngine::setDisableRenderingOnMaster(bool enabled) { _disableMasterRendering = enabled; } diff --git a/src/rendering/renderengine_lua.inl b/src/rendering/renderengine_lua.inl index 117496ef49..2806e8eb36 100644 --- a/src/rendering/renderengine_lua.inl +++ b/src/rendering/renderengine_lua.inl @@ -26,27 +26,6 @@ namespace openspace { namespace luascriptfunctions { -/** - * \ingroup LuaScripts - * takeScreenshot(): - * Save the rendering to an image file - */ -int takeScreenshot(lua_State* L) { - int nArguments = lua_gettop(L); - if (nArguments == 0) { - OsEng.renderEngine().takeScreenshot(); - return 0; - } - else if (nArguments == 1) { - bool b = lua_toboolean(L, -1) != 0; - OsEng.renderEngine().takeScreenshot(b); - return 0; - } - else { - return luaL_error(L, "Expected %i or %i arguments, got %i", 0, 1, nArguments); - } -} - /** * \ingroup LuaScripts * setRenderer(string): @@ -67,44 +46,6 @@ int setRenderer(lua_State* L) { return 0; } -/** -* \ingroup LuaScripts -* setNAaSamples(int): -* set the number of anti-aliasing samples (msaa) -*/ -int setNAaSamples(lua_State* L) { - int nArguments = lua_gettop(L); - if (nArguments != 1) { - return luaL_error(L, "Expected %i arguments, got %i", 1, nArguments); - } - - double t = luaL_checknumber(L, -1); - - OsEng.renderEngine().setNAaSamples(static_cast(t)); - return 0; -} - - -/** -* \ingroup LuaScripts -* visualizeABuffer(bool): -* Toggle heads-up info display on master node -*/ -int showRenderInformation(lua_State* L) { - int nArguments = lua_gettop(L); - if (nArguments != 1) { - return luaL_error(L, "Expected %i arguments, got %i", 1, nArguments); - } - - const int type = lua_type(L, -1); - if (type != LUA_TBOOLEAN) { - return luaL_error(L, "Expected argument of type 'bool'"); - } - bool b = lua_toboolean(L, -1) != 0; - OsEng.renderEngine().toggleInfoText(b); - return 0; -} - /** * \ingroup LuaScripts * toggleFade(float): From 55f002ad6fce141b88329430eb3327713c196cfb Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Wed, 1 Mar 2017 10:39:29 -0500 Subject: [PATCH 52/96] Move the disabling of the rendering on the master into the RenderEngine instead of specifying it in the OpenSpaceEngine --- include/openspace/rendering/renderengine.h | 2 -- openspace.cfg | 1 + src/engine/openspaceengine.cpp | 7 ------- src/rendering/renderengine.cpp | 10 ++++++---- 4 files changed, 7 insertions(+), 13 deletions(-) diff --git a/include/openspace/rendering/renderengine.h b/include/openspace/rendering/renderengine.h index da40e6b3c8..d93b5a000f 100644 --- a/include/openspace/rendering/renderengine.h +++ b/include/openspace/rendering/renderengine.h @@ -111,8 +111,6 @@ public: float globalBlackOutFactor(); void setGlobalBlackOutFactor(float factor); - void setDisableRenderingOnMaster(bool enabled); - void registerScreenSpaceRenderable(std::shared_ptr s); void unregisterScreenSpaceRenderable(std::shared_ptr s); void unregisterScreenSpaceRenderable(std::string name); diff --git a/openspace.cfg b/openspace.cfg index b52e8abbc5..a1de1e185d 100644 --- a/openspace.cfg +++ b/openspace.cfg @@ -85,6 +85,7 @@ return { ShutdownCountdown = 3, -- OnScreenTextScaling = "framebuffer", -- PerSceneCache = true, + -- DisableRenderingOnMaster = true, DownloadRequestURL = "http://data.openspaceproject.com/request.cgi", RenderingMethod = "Framebuffer" --RenderingMethod = "ABuffer" -- alternative: "Framebuffer" diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index a2b443b5c1..bb000a8594 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -475,13 +475,6 @@ void OpenSpaceEngine::initialize() { writeDocumentation(); - if (configurationManager().hasKey(ConfigurationManager::KeyDisableMasterRendering)) { - const bool disableMasterRendering = configurationManager().value( - ConfigurationManager::KeyDisableMasterRendering - ); - _renderEngine->setDisableRenderingOnMaster(disableMasterRendering); - } - if (configurationManager().hasKey(ConfigurationManager::KeyShutdownCountdown)) { _shutdown.waitTime = configurationManager().value( ConfigurationManager::KeyShutdownCountdown diff --git a/src/rendering/renderengine.cpp b/src/rendering/renderengine.cpp index 83e972ea41..4ca1b522b4 100644 --- a/src/rendering/renderengine.cpp +++ b/src/rendering/renderengine.cpp @@ -194,6 +194,12 @@ void RenderEngine::initialize() { renderingMethod = "Framebuffer"; } } + + if (confManager.hasKey(ConfigurationManager::KeyDisableMasterRendering)) { + _disableMasterRendering = confManager.value( + ConfigurationManager::KeyDisableMasterRendering + ); + } _raycasterManager = new RaycasterManager(); _nAaSamples = OsEng.windowWrapper().currentNumberOfAaSamples(); @@ -784,10 +790,6 @@ performance::PerformanceManager* RenderEngine::performanceManager() { return _performanceManager.get(); } -void RenderEngine::setDisableRenderingOnMaster(bool enabled) { - _disableMasterRendering = enabled; -} - void RenderEngine::registerScreenSpaceRenderable(std::shared_ptr s) { s->initialize(); From 674830526724f05c6612cc728ca91ac181360ced Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Wed, 1 Mar 2017 11:30:54 -0500 Subject: [PATCH 53/96] Some cleanup of ConfigurationManager --- .../openspace/engine/configurationmanager.h | 19 +--- src/engine/configurationmanager.cpp | 99 +++++++------------ src/engine/configurationmanager_doc.inl | 15 ++- src/engine/openspaceengine.cpp | 6 ++ 4 files changed, 56 insertions(+), 83 deletions(-) diff --git a/include/openspace/engine/configurationmanager.h b/include/openspace/engine/configurationmanager.h index ed4f0fd6b0..abf98886d0 100644 --- a/include/openspace/engine/configurationmanager.h +++ b/include/openspace/engine/configurationmanager.h @@ -25,11 +25,10 @@ #ifndef __OPENSPACE_CORE___CONFIGURATIONMANAGER___H__ #define __OPENSPACE_CORE___CONFIGURATIONMANAGER___H__ -#include - #include namespace openspace { +namespace documentation { struct Documentation; } /** * The ConfigurationManager takes care of loading the major configuration file @@ -142,27 +141,17 @@ public: * that are specified in the configuration file will automatically be registered in * the ghoul::filesystem::FileSystem. * \param filename The filename to be loaded - * \throw ghoul::FileNotFoundException If the \p filename did not exist - * \throw ghoul::RuntimeError If the configuration file was not complete (i.e., did + * \throw SpecificationError If the configuration file was not complete (i.e., did * not specify the necessary keys KeyPaths, KeyPaths.KeyCache, KeyFonts, and * KeyConfigSgct) * \throw ghoul::lua::LuaRuntimeException If there was Lua-based error loading the * configuration file * \pre \p filename must not be empty + * \pre \p filename must exist */ void loadFromFile(const std::string& filename); - static openspace::Documentation Documentation(); - -private: - /** - * Checks whether the loaded configuration file is complete, that is specifying the - * necessary keys KeyPaths, KeyPaths.KeyCache, KeyFonts, and KeyConfigSgct. The method - * will log fatal errors if a key is missing. - * \return true if the configuration file was complete; - * false otherwise - */ - bool checkCompleteness() const; + static documentation::Documentation Documentation(); }; } // namespace openspace diff --git a/src/engine/configurationmanager.cpp b/src/engine/configurationmanager.cpp index a73f961c23..7e7e396fde 100644 --- a/src/engine/configurationmanager.cpp +++ b/src/engine/configurationmanager.cpp @@ -24,22 +24,22 @@ #include +#include + +#include +#include #include #include #include -#include -#include - -#include using std::string; #include "configurationmanager_doc.inl" namespace { - const string _configurationFile = "openspace.cfg"; - const string _keyBasePath = "BASE_PATH"; - const string _initialConfigHelper = "${BASE_PATH}/scripts/configuration_helper.lua"; + const char* _configurationFile = "openspace.cfg"; + const char* _keyBasePath = "BASE_PATH"; + const char* _initialConfigHelper = "${BASE_PATH}/scripts/configuration_helper.lua"; } namespace openspace { @@ -89,15 +89,20 @@ string ConfigurationManager::findConfiguration(const string& filename) { using ghoul::filesystem::Directory; Directory directory = FileSys.currentDirectory(); - std::string configurationName = _configurationFile; while (true) { - std::string&& fullPath = FileSys.pathByAppendingComponent(directory, - configurationName); - bool exists = FileSys.fileExists(fullPath); - if (exists) + std::string fullPath = FileSys.pathByAppendingComponent( + directory, + _configurationFile + ); + + if (FileSys.fileExists(fullPath)) { + // We have found the configuration file and can bail out return fullPath; + } + // Otherwise, we traverse the directory tree up + Directory nextDirectory = directory.parentDirectory( ghoul::filesystem::Directory::AbsolutePath::Yes ); @@ -116,10 +121,9 @@ string ConfigurationManager::findConfiguration(const string& filename) { void ConfigurationManager::loadFromFile(const string& filename) { using ghoul::filesystem::FileSystem; - if (!FileSys.fileExists(filename)) { - throw ghoul::FileNotFoundError(filename, "ConfigurationManager"); - } - + ghoul_assert(!filename.empty(), "Filename must not be empty"); + ghoul_assert(FileSys.fileExists(filename), "File must exist"); + // ${BASE_PATH} string basePathToken = FileSystem::TokenOpeningBraces + _keyBasePath + FileSystem::TokenClosingBraces; @@ -148,32 +152,22 @@ void ConfigurationManager::loadFromFile(const string& filename) { // Register all the paths ghoul::Dictionary dictionary = value(KeyPaths); - std::vector pathKeys = dictionary.keys(); - for (std::string key : pathKeys) { - std::string p; - if (dictionary.getValue(key, p)) { - std::string fullKey = - FileSystem::TokenOpeningBraces + key + FileSystem::TokenClosingBraces; - LDEBUGC("ConfigurationManager", "Registering path " << fullKey << ": " << p); - - bool override = (basePathToken == fullKey); - if (override) - LINFOC("ConfigurationManager", "Overriding base path with '" << p << "'"); - - using Override = ghoul::filesystem::FileSystem::Override; - FileSys.registerPathToken( - std::move(fullKey), - std::move(p), - override ? Override::Yes : Override::No - ); + for (std::string key : dictionary.keys()) { + std::string p = dictionary.value(key); + std::string fullKey = + FileSystem::TokenOpeningBraces + key + FileSystem::TokenClosingBraces; + LDEBUGC("ConfigurationManager", "Registering path " << fullKey << ": " << p); + + bool override = (basePathToken == fullKey); + if (override) { + LINFOC("ConfigurationManager", "Overriding base path with '" << p << "'"); } - } - bool complete = checkCompleteness(); - if (!complete) { - throw ghoul::RuntimeError( - "Configuration file '" + filename + "' was not complete", - "ConfigurationManager" + using Override = ghoul::filesystem::FileSystem::Override; + FileSys.registerPathToken( + std::move(fullKey), + std::move(p), + override ? Override::Yes : Override::No ); } @@ -182,29 +176,4 @@ void ConfigurationManager::loadFromFile(const string& filename) { removeKey(KeyPaths); } -bool ConfigurationManager::checkCompleteness() const { - std::vector requiredTokens = { - KeyPaths, - KeyPaths + "." + KeyCache, - KeyFonts, - KeyConfigSgct - }; - - bool totalSuccess = true; - for (const std::string& token : requiredTokens) { - bool success = hasKey(token); - - if (!success) { - LFATALC( - "ConfigurationManager", - "Configuration file did not contain required key '" << token << "'" - ); - } - - totalSuccess &= success; - } - - return totalSuccess; -} - } // namespace openspace diff --git a/src/engine/configurationmanager_doc.inl b/src/engine/configurationmanager_doc.inl index 2577033c89..ea57fbd409 100644 --- a/src/engine/configurationmanager_doc.inl +++ b/src/engine/configurationmanager_doc.inl @@ -37,7 +37,8 @@ Documentation ConfigurationManager::Documentation() { ConfigurationManager::KeyConfigSgct, new StringAnnotationVerifier("A valid SGCT configuration file"), "The SGCT configuration file that determines the window and view frustum " - "settings that are being used when OpenSpace is started." + "settings that are being used when OpenSpace is started.", + Optional::No }, { ConfigurationManager::KeyConfigScene, @@ -47,7 +48,8 @@ Documentation ConfigurationManager::Documentation() { "The scene description that is used to populate the application after " "startup. The scene determines which objects are loaded, the startup " "time and other scene-specific settings. More information is provided in " - "the Scene documentation." + "the Scene documentation.", + Optional::No }, { ConfigurationManager::KeyPaths, @@ -55,7 +57,14 @@ Documentation ConfigurationManager::Documentation() { "A list of paths that are automatically registered with the file system. " "If a key X is used in the table, it is then useable by referencing ${X} " "in all other configuration files or scripts.", - Optional::Yes + Optional::No + }, + { + ConfigurationManager::KeyPaths + '.' + ConfigurationManager::KeyCache, + new StringVerifier, + "The path to be used as a cache folder. If per scene caching is enabled, the " + "name of the scene will be appended to this folder", + Optional::No }, { ConfigurationManager::KeyFonts, diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index bb000a8594..66e6f2caf2 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -259,6 +259,12 @@ void OpenSpaceEngine::create(int argc, char** argv, ConfigurationManager::findConfiguration(configurationFilePath); } configurationFilePath = absPath(configurationFilePath); + + if (!FileSys.fileExists(configurationFilePath)) { + throw ghoul::FileNotFoundError( + "Configuration file '" + configurationFilePath + "' not found" + ); + } LINFO("Configuration Path: '" << configurationFilePath << "'"); // Loading configuration from disk From 8fd60ce8e64d914f762934559a58dc93a4195c13 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Wed, 1 Mar 2017 18:13:15 -0500 Subject: [PATCH 54/96] - Remove documentation.h include and replace with forward declaration - Move Documentation struct into documentation namespace --- .../openspace/documentation/documentation.h | 4 --- include/openspace/mission/mission.h | 4 +-- include/openspace/rendering/renderable.h | 7 +++-- .../rendering/screenspacerenderable.h | 6 ++--- include/openspace/scene/rotation.h | 5 ++-- include/openspace/scene/scale.h | 5 ++-- include/openspace/scene/scene.h | 4 +-- include/openspace/scene/scenegraphnode.h | 5 ++-- include/openspace/scene/translation.h | 5 ++-- include/openspace/scripting/scriptscheduler.h | 4 +-- include/openspace/util/openspacemodule.h | 4 +-- include/openspace/util/timerange.h | 6 ++--- modules/base/basemodule.cpp | 3 ++- modules/base/basemodule.h | 2 +- modules/base/rendering/modelgeometry.cpp | 6 ++--- modules/base/rendering/modelgeometry.h | 4 +-- modules/base/rendering/renderabletrail.cpp | 5 ++-- modules/base/rendering/renderabletrail.h | 9 ++++--- .../base/rendering/renderabletrailorbit.cpp | 7 ++--- modules/base/rendering/renderabletrailorbit.h | 5 ++-- .../rendering/renderabletrailtrajectory.cpp | 8 +++--- .../rendering/renderabletrailtrajectory.h | 5 ++-- modules/base/rotation/staticrotation.cpp | 3 ++- modules/base/rotation/staticrotation.h | 5 ++-- modules/base/scale/staticscale.cpp | 3 ++- modules/base/scale/staticscale.h | 5 ++-- .../base/translation/statictranslation.cpp | 5 ++-- modules/base/translation/statictranslation.h | 5 ++-- modules/newhorizons/newhorizonsmodule.cpp | 3 ++- modules/newhorizons/newhorizonsmodule.h | 2 +- .../rendering/renderablemodelprojection.cpp | 5 ++-- .../rendering/renderablemodelprojection.h | 4 +-- .../rendering/renderableplanetprojection.cpp | 3 ++- .../rendering/renderableplanetprojection.h | 3 ++- .../newhorizons/util/projectioncomponent.cpp | 3 ++- .../newhorizons/util/projectioncomponent.h | 5 ++-- modules/space/rendering/planetgeometry.cpp | 4 ++- modules/space/rendering/planetgeometry.h | 6 ++--- modules/space/rendering/renderablerings.cpp | 3 ++- modules/space/rendering/renderablerings.h | 4 +-- modules/space/rendering/renderablestars.cpp | 3 ++- modules/space/rendering/renderablestars.h | 19 ++++++------- modules/space/rotation/spicerotation.cpp | 6 ++--- modules/space/rotation/spicerotation.h | 5 ++-- modules/space/spacemodule.cpp | 3 ++- modules/space/spacemodule.h | 2 +- .../space/translation/keplertranslation.cpp | 2 +- modules/space/translation/keplertranslation.h | 2 +- .../space/translation/spicetranslation.cpp | 5 ++-- modules/space/translation/spicetranslation.h | 3 +-- modules/space/translation/tletranslation.cpp | 2 +- modules/space/translation/tletranslation.h | 2 +- src/engine/configurationmanager.cpp | 2 -- src/engine/configurationmanager_doc.inl | 3 ++- src/mission/mission.cpp | 16 ++++++----- src/rendering/renderable.cpp | 11 ++++---- src/rendering/screenspacerenderable.cpp | 27 ++++++++++--------- src/scene/rotation.cpp | 14 +++++----- src/scene/scale.cpp | 14 +++++----- src/scene/scene_doc.inl | 3 ++- src/scene/scenegraph.cpp | 1 + src/scene/scenegraphnode.cpp | 2 -- src/scene/scenegraphnode_doc.inl | 3 ++- src/scene/translation.cpp | 8 +++--- src/scripting/scriptscheduler.cpp | 3 ++- src/util/openspacemodule.cpp | 8 +++--- src/util/timerange.cpp | 3 ++- 67 files changed, 195 insertions(+), 161 deletions(-) diff --git a/include/openspace/documentation/documentation.h b/include/openspace/documentation/documentation.h index 28f777cbef..bfc64976b4 100644 --- a/include/openspace/documentation/documentation.h +++ b/include/openspace/documentation/documentation.h @@ -304,10 +304,6 @@ void testSpecificationAndThrow(const Documentation& documentation, } // namespace documentation -// We want to make it easier for people to use it, so we pull the Documentation class into -// the openspace namespace -using documentation::Documentation; - } // namespace openspace // Make the overload for std::to_string available for the Offense::Reason for easier diff --git a/include/openspace/mission/mission.h b/include/openspace/mission/mission.h index 24d89829d1..914afb040c 100644 --- a/include/openspace/mission/mission.h +++ b/include/openspace/mission/mission.h @@ -25,7 +25,6 @@ #ifndef __OPENSPACE_CORE___MISSION___H__ #define __OPENSPACE_CORE___MISSION___H__ -#include #include #include @@ -35,6 +34,7 @@ namespace ghoul { class Dictionary; } namespace openspace { +namespace documentation { struct Documentation; } /** * Used to represent a named period of time within a mission. Allows nested phases, i.e. @@ -101,7 +101,7 @@ public: * MissionPhase can be constructed from. * \return The Documentation that describes the required structure for a Dictionary */ - static openspace::Documentation Documentation(); + static documentation::Documentation Documentation(); protected: /** diff --git a/include/openspace/rendering/renderable.h b/include/openspace/rendering/renderable.h index 3c77d09fbe..ba11cec5f0 100644 --- a/include/openspace/rendering/renderable.h +++ b/include/openspace/rendering/renderable.h @@ -33,9 +33,6 @@ #include -#include - - // Forward declare to minimize dependencies namespace ghoul { namespace opengl { @@ -46,6 +43,8 @@ namespace ghoul { namespace openspace { +namespace documentation { struct Documentation; } + // Forward declare to minimize dependencies class Camera; @@ -93,7 +92,7 @@ public: static void setPscUniforms(ghoul::opengl::ProgramObject& program, const Camera& camera, const PowerScaledCoordinate& position); - static openspace::Documentation Documentation(); + static documentation::Documentation Documentation(); protected: properties::BoolProperty _enabled; diff --git a/include/openspace/rendering/screenspacerenderable.h b/include/openspace/rendering/screenspacerenderable.h index ec24a67848..74eff1eaf5 100644 --- a/include/openspace/rendering/screenspacerenderable.h +++ b/include/openspace/rendering/screenspacerenderable.h @@ -36,10 +36,10 @@ #include #include -#include - namespace openspace { +namespace documentation { struct Documentation; } + /** * The base class for screen space images and screen space framebuffers. * This base class handles general functionality specific to planes that are rendered in @@ -66,7 +66,7 @@ public: glm::vec3 sphericalPosition() const; float depth() const; - static openspace::Documentation Documentation(); + static documentation::Documentation Documentation(); protected: void createPlane(); diff --git a/include/openspace/scene/rotation.h b/include/openspace/scene/rotation.h index b09883d2f6..762f5b0c44 100644 --- a/include/openspace/scene/rotation.h +++ b/include/openspace/scene/rotation.h @@ -27,13 +27,14 @@ #include -#include #include #include namespace openspace { +namespace documentation { struct Documentation; } + class Rotation : public properties::PropertyOwner { public: static Rotation* createFromDictionary(const ghoul::Dictionary& dictionary); @@ -44,7 +45,7 @@ public: const glm::dmat3& matrix() const; virtual void update(const UpdateData& data); - static openspace::Documentation Documentation(); + static documentation::Documentation Documentation(); protected: Rotation(); diff --git a/include/openspace/scene/scale.h b/include/openspace/scene/scale.h index 91a2bfcf30..4630247c88 100644 --- a/include/openspace/scene/scale.h +++ b/include/openspace/scene/scale.h @@ -27,13 +27,14 @@ #include -#include #include #include namespace openspace { +namespace documentation { struct Documentation; }; + class Scale : public properties::PropertyOwner { public: static Scale* createFromDictionary(const ghoul::Dictionary& dictionary); @@ -43,7 +44,7 @@ public: virtual double scaleValue() const = 0; virtual void update(const UpdateData& data); - static openspace::Documentation Documentation(); + static documentation::Documentation Documentation(); }; } // namespace openspace diff --git a/include/openspace/scene/scene.h b/include/openspace/scene/scene.h index 7ebc087e0d..b8fd27ae5b 100644 --- a/include/openspace/scene/scene.h +++ b/include/openspace/scene/scene.h @@ -30,8 +30,6 @@ #include #include -#include - #include #include #include @@ -42,6 +40,8 @@ namespace openspace { +namespace documentation { struct Documentation; } + class SceneGraphNode; // Notifications: diff --git a/include/openspace/scene/scenegraphnode.h b/include/openspace/scene/scenegraphnode.h index 9f178aa530..51775415b4 100644 --- a/include/openspace/scene/scenegraphnode.h +++ b/include/openspace/scene/scenegraphnode.h @@ -25,9 +25,6 @@ #ifndef __OPENSPACE_CORE___SCENEGRAPHNODE___H__ #define __OPENSPACE_CORE___SCENEGRAPHNODE___H__ -// open space includes -#include - #include #include #include @@ -46,6 +43,8 @@ namespace openspace { +namespace documentation { struct Documentation; } + class SceneGraphNode : public properties::PropertyOwner { public: struct PerformanceRecord { diff --git a/include/openspace/scene/translation.h b/include/openspace/scene/translation.h index c7abb4ba6c..a1ea8f71e1 100644 --- a/include/openspace/scene/translation.h +++ b/include/openspace/scene/translation.h @@ -27,13 +27,14 @@ #include -#include #include #include namespace openspace { +namespace documentation { struct Documentation; } + class Translation : public properties::PropertyOwner { public: static Translation* createFromDictionary(const ghoul::Dictionary& dictionary); @@ -50,7 +51,7 @@ public: // invalidates potentially stored points, for example in trails void onParameterChange(std::function callback); - static openspace::Documentation Documentation(); + static documentation::Documentation Documentation(); protected: void notifyObservers(); diff --git a/include/openspace/scripting/scriptscheduler.h b/include/openspace/scripting/scriptscheduler.h index cd30739b90..fce3028caf 100644 --- a/include/openspace/scripting/scriptscheduler.h +++ b/include/openspace/scripting/scriptscheduler.h @@ -25,7 +25,6 @@ #ifndef __OPENSPACE_CORE___SCRIPTSCHEDULER___H__ #define __OPENSPACE_CORE___SCRIPTSCHEDULER___H__ -#include #include #include @@ -36,6 +35,7 @@ class Dictionary; } // namespace ghoul namespace openspace { +namespace documentation { struct Documentation; } namespace scripting { /** @@ -111,7 +111,7 @@ public: static LuaLibrary luaLibrary(); - static openspace::Documentation Documentation(); + static documentation::Documentation Documentation(); private: std::vector _timings; diff --git a/include/openspace/util/openspacemodule.h b/include/openspace/util/openspacemodule.h index 992bd8459d..cd7d2bc5bb 100644 --- a/include/openspace/util/openspacemodule.h +++ b/include/openspace/util/openspacemodule.h @@ -27,7 +27,6 @@ #include -#include #include #include @@ -36,6 +35,7 @@ #include namespace openspace { +namespace documentation { struct Documentation; } /** * This class is the base class for an OpenSpace module. A module groups functionality @@ -73,7 +73,7 @@ public: * Returns a list of Documentation classes that are valid for this OpenSpaceModule. * \return A list of Documentation classes that are valid for this OpenSapceModule */ - virtual std::vector documentations() const; + virtual std::vector documentations() const; /** * Returns the Lua library with functions defined by this OpenSpaceModule. The default diff --git a/include/openspace/util/timerange.h b/include/openspace/util/timerange.h index 2bd19e9274..b7739f1322 100644 --- a/include/openspace/util/timerange.h +++ b/include/openspace/util/timerange.h @@ -25,12 +25,12 @@ #ifndef __OPENSPACE_CORE___TIMERANGE___H__ #define __OPENSPACE_CORE___TIMERANGE___H__ -#include - namespace ghoul { class Dictionary; } namespace openspace { +namespace documentation { struct Documentation; } + struct TimeRange { /** @@ -70,7 +70,7 @@ struct TimeRange { bool includes(const TimeRange& o) const; - static openspace::Documentation Documentation(); + static documentation::Documentation Documentation(); double start; double end; diff --git a/modules/base/basemodule.cpp b/modules/base/basemodule.cpp index 3a55a853fb..fc8f383a3d 100644 --- a/modules/base/basemodule.cpp +++ b/modules/base/basemodule.cpp @@ -24,6 +24,7 @@ #include +#include #include #include #include @@ -103,7 +104,7 @@ void BaseModule::internalInitialize() { fModelGeometry->registerClass("MultiModelGeometry"); } -std::vector BaseModule::documentations() const { +std::vector BaseModule::documentations() const { return { StaticScale::Documentation(), StaticTranslation::Documentation(), diff --git a/modules/base/basemodule.h b/modules/base/basemodule.h index a49a4ebf8f..28bc2c3355 100644 --- a/modules/base/basemodule.h +++ b/modules/base/basemodule.h @@ -33,7 +33,7 @@ class BaseModule : public OpenSpaceModule { public: BaseModule(); - std::vector documentations() const override; + std::vector documentations() const override; protected: void internalInitialize() override; diff --git a/modules/base/rendering/modelgeometry.cpp b/modules/base/rendering/modelgeometry.cpp index 3244fe062a..1b385c787d 100644 --- a/modules/base/rendering/modelgeometry.cpp +++ b/modules/base/rendering/modelgeometry.cpp @@ -32,8 +32,8 @@ #include namespace { - const std::string _loggerCat = "ModelGeometry"; - const std::string keyGeomModelFile = "GeometryFile"; + const char* _loggerCat = "ModelGeometry"; + const char* keyGeomModelFile = "GeometryFile"; const int8_t CurrentCacheVersion = 3; const char* keyType = "Type"; const char* keyName = "Name"; @@ -42,7 +42,7 @@ namespace { namespace openspace { namespace modelgeometry { -Documentation ModelGeometry::Documentation() { +documentation:: Documentation ModelGeometry::Documentation() { using namespace documentation; return { "Model Geometry", diff --git a/modules/base/rendering/modelgeometry.h b/modules/base/rendering/modelgeometry.h index 690e7271c3..825556da1d 100644 --- a/modules/base/rendering/modelgeometry.h +++ b/modules/base/rendering/modelgeometry.h @@ -27,11 +27,11 @@ #include -#include #include #include namespace openspace { +namespace documentation { struct Documentation; } namespace modelgeometry { @@ -59,7 +59,7 @@ public: virtual void setUniforms(ghoul::opengl::ProgramObject& program); - static openspace::Documentation Documentation(); + static documentation::Documentation Documentation(); protected: Renderable* _parent; diff --git a/modules/base/rendering/renderabletrail.cpp b/modules/base/rendering/renderabletrail.cpp index 59b16a2ec5..7085abd948 100644 --- a/modules/base/rendering/renderabletrail.cpp +++ b/modules/base/rendering/renderabletrail.cpp @@ -24,6 +24,7 @@ #include +#include #include #include #include @@ -56,8 +57,8 @@ namespace { namespace openspace { -Documentation RenderableTrail::Documentation() { -using namespace documentation; +documentation::Documentation RenderableTrail::Documentation() { + using namespace documentation; return { "RenderableTrail", "base_renderable_renderabletrail", diff --git a/modules/base/rendering/renderabletrail.h b/modules/base/rendering/renderabletrail.h index 661c7524ad..c8a73fdb10 100644 --- a/modules/base/rendering/renderabletrail.h +++ b/modules/base/rendering/renderabletrail.h @@ -27,7 +27,6 @@ #include -#include #include #include #include @@ -41,11 +40,13 @@ namespace ghoul { namespace opengl { class ProgramObject; class Texture; -} -} +} // namespace opengl +} // namespace ghoul namespace openspace { +namespace documentation { struct Documentation; } + class Translation; /** @@ -89,7 +90,7 @@ protected: explicit RenderableTrail(const ghoul::Dictionary& dictionary); /// Returns the documentation entries that the con - static openspace::Documentation Documentation(); + static documentation::Documentation Documentation(); /// The layout of the VBOs struct TrailVBOLayout { diff --git a/modules/base/rendering/renderabletrailorbit.cpp b/modules/base/rendering/renderabletrailorbit.cpp index 422d4eb8ce..9f08db6fcc 100644 --- a/modules/base/rendering/renderabletrailorbit.cpp +++ b/modules/base/rendering/renderabletrailorbit.cpp @@ -24,6 +24,7 @@ #include +#include #include #include @@ -83,9 +84,9 @@ namespace { namespace openspace { -openspace::Documentation RenderableTrailOrbit::Documentation() { +documentation::Documentation RenderableTrailOrbit::Documentation() { using namespace documentation; - openspace::Documentation doc{ + documentation::Documentation doc { "RenderableTrailOrbit", "base_renderable_renderabletrailorbit", { @@ -118,7 +119,7 @@ openspace::Documentation RenderableTrailOrbit::Documentation() { // Insert the parents documentation entries until we have a verifier that can deal // with class hierarchy - openspace::Documentation parentDoc = RenderableTrail::Documentation(); + documentation::Documentation parentDoc = RenderableTrail::Documentation(); doc.entries.insert( doc.entries.end(), parentDoc.entries.begin(), diff --git a/modules/base/rendering/renderabletrailorbit.h b/modules/base/rendering/renderabletrailorbit.h index 66703e1c76..5bcd5b0887 100644 --- a/modules/base/rendering/renderabletrailorbit.h +++ b/modules/base/rendering/renderabletrailorbit.h @@ -27,12 +27,13 @@ #include -#include #include #include namespace openspace { +namespace documentation { struct Documentation; } + /** * This concrete implementation of a RenderableTrail renders an updated trail behind an * object that is likely to have an orbit-like path. However, this is not required and @@ -52,7 +53,7 @@ public: void update(const UpdateData& data) override; - static openspace::Documentation Documentation(); + static documentation::Documentation Documentation(); private: /** diff --git a/modules/base/rendering/renderabletrailtrajectory.cpp b/modules/base/rendering/renderabletrailtrajectory.cpp index 2e987f592a..2fcc079b79 100644 --- a/modules/base/rendering/renderabletrailtrajectory.cpp +++ b/modules/base/rendering/renderabletrailtrajectory.cpp @@ -24,6 +24,7 @@ #include +#include #include #include #include @@ -51,9 +52,10 @@ namespace { namespace openspace { -openspace::Documentation RenderableTrailTrajectory::Documentation() { +documentation::Documentation RenderableTrailTrajectory::Documentation() { using namespace documentation; - openspace::Documentation doc { + + documentation::Documentation doc { "RenderableTrailTrajectory", "base_renderable_renderabletrailtrajectory", { @@ -110,7 +112,7 @@ openspace::Documentation RenderableTrailTrajectory::Documentation() { // Insert the parents documentation entries until we have a verifier that can deal // with class hierarchy - openspace::Documentation parentDoc = RenderableTrail::Documentation(); + documentation::Documentation parentDoc = RenderableTrail::Documentation(); doc.entries.insert( doc.entries.end(), parentDoc.entries.begin(), diff --git a/modules/base/rendering/renderabletrailtrajectory.h b/modules/base/rendering/renderabletrailtrajectory.h index 2d3d8cf12a..2e02ee6f3a 100644 --- a/modules/base/rendering/renderabletrailtrajectory.h +++ b/modules/base/rendering/renderabletrailtrajectory.h @@ -27,7 +27,6 @@ #include -#include #include #include #include @@ -35,6 +34,8 @@ namespace openspace { +namespace documentation { struct Documentation; } + /** * This concrete implementation of a RenderableTrail renders a fixed trail, regardless of * its shape. The trail is sampled equitemporal (with an interval of _sampleInterval in @@ -55,7 +56,7 @@ public: void update(const UpdateData& data) override; - static openspace::Documentation Documentation(); + static documentation::Documentation Documentation(); private: /// The start time of the trail diff --git a/modules/base/rotation/staticrotation.cpp b/modules/base/rotation/staticrotation.cpp index 39d4cd4232..e8aa408dd8 100644 --- a/modules/base/rotation/staticrotation.cpp +++ b/modules/base/rotation/staticrotation.cpp @@ -24,6 +24,7 @@ #include +#include #include namespace { @@ -32,7 +33,7 @@ namespace { namespace openspace { -Documentation StaticRotation::Documentation() { +documentation::Documentation StaticRotation::Documentation() { using namespace openspace::documentation; return { "Static Rotation", diff --git a/modules/base/rotation/staticrotation.h b/modules/base/rotation/staticrotation.h index 7cf5f7af8f..f03fa79681 100644 --- a/modules/base/rotation/staticrotation.h +++ b/modules/base/rotation/staticrotation.h @@ -27,17 +27,18 @@ #include -#include #include namespace openspace { +namespace documentation { struct Documentation; } + class StaticRotation : public Rotation { public: StaticRotation(); StaticRotation(const ghoul::Dictionary& dictionary); - static openspace::Documentation Documentation(); + static documentation::Documentation Documentation(); private: properties::DMat3Property _rotationMatrix; diff --git a/modules/base/scale/staticscale.cpp b/modules/base/scale/staticscale.cpp index b546751f72..ef6a448dba 100644 --- a/modules/base/scale/staticscale.cpp +++ b/modules/base/scale/staticscale.cpp @@ -24,6 +24,7 @@ #include +#include #include namespace { @@ -33,7 +34,7 @@ namespace { namespace openspace { -Documentation StaticScale::Documentation() { +documentation::Documentation StaticScale::Documentation() { using namespace openspace::documentation; return { "Static Scaling", diff --git a/modules/base/scale/staticscale.h b/modules/base/scale/staticscale.h index f7be8ecfeb..d2c14ab760 100644 --- a/modules/base/scale/staticscale.h +++ b/modules/base/scale/staticscale.h @@ -27,18 +27,19 @@ #include -#include #include namespace openspace { +namespace documentation { struct Documentation; } + class StaticScale : public Scale { public: StaticScale(); StaticScale(const ghoul::Dictionary& dictionary); double scaleValue() const; - static openspace::Documentation Documentation(); + static documentation::Documentation Documentation(); private: properties::FloatProperty _scaleValue; diff --git a/modules/base/translation/statictranslation.cpp b/modules/base/translation/statictranslation.cpp index 3cabdbf7b5..ead533d1c8 100644 --- a/modules/base/translation/statictranslation.cpp +++ b/modules/base/translation/statictranslation.cpp @@ -24,6 +24,7 @@ #include +#include #include namespace { @@ -32,8 +33,8 @@ namespace { namespace openspace { -Documentation StaticTranslation::Documentation() { - using namespace openspace::documentation; +documentation::Documentation StaticTranslation::Documentation() { + using namespace documentation; return { "Static Translation", "base_transform_translation_static", diff --git a/modules/base/translation/statictranslation.h b/modules/base/translation/statictranslation.h index d5c1f64a48..665e89f123 100644 --- a/modules/base/translation/statictranslation.h +++ b/modules/base/translation/statictranslation.h @@ -27,10 +27,11 @@ #include -#include #include namespace openspace { + +namespace documentation { struct Documentation; } class StaticTranslation : public Translation { public: @@ -40,7 +41,7 @@ public: virtual glm::dvec3 position() const; virtual void update(const UpdateData& data) override; - static openspace::Documentation Documentation(); + static documentation::Documentation Documentation(); private: properties::DVec3Property _position; diff --git a/modules/newhorizons/newhorizonsmodule.cpp b/modules/newhorizons/newhorizonsmodule.cpp index 79eba633d6..476e948ad1 100644 --- a/modules/newhorizons/newhorizonsmodule.cpp +++ b/modules/newhorizons/newhorizonsmodule.cpp @@ -35,6 +35,7 @@ #include #include +#include #include #include @@ -69,7 +70,7 @@ void NewHorizonsModule::internalInitialize() { fDecoder->registerClass("Target"); } -std::vector NewHorizonsModule::documentations() const { +std::vector NewHorizonsModule::documentations() const { return { RenderableModelProjection::Documentation(), RenderablePlanetProjection::Documentation(), diff --git a/modules/newhorizons/newhorizonsmodule.h b/modules/newhorizons/newhorizonsmodule.h index ac5bbcf5b1..20acee08cb 100644 --- a/modules/newhorizons/newhorizonsmodule.h +++ b/modules/newhorizons/newhorizonsmodule.h @@ -33,7 +33,7 @@ class NewHorizonsModule : public OpenSpaceModule { public: NewHorizonsModule(); - std::vector documentations() const override; + std::vector documentations() const override; protected: void internalInitialize() override; diff --git a/modules/newhorizons/rendering/renderablemodelprojection.cpp b/modules/newhorizons/rendering/renderablemodelprojection.cpp index 2773f9942f..498ad2aea2 100644 --- a/modules/newhorizons/rendering/renderablemodelprojection.cpp +++ b/modules/newhorizons/rendering/renderablemodelprojection.cpp @@ -26,6 +26,7 @@ #include +#include #include #include #include @@ -41,7 +42,7 @@ #include namespace { - const std::string _loggerCat = "RenderableModelProjection"; + const char* _loggerCat = "RenderableModelProjection"; const char* keySource = "Rotation.Source"; const char* keyDestination = "Rotation.Destination"; const char* keyGeometry = "Geometry"; @@ -55,7 +56,7 @@ namespace { namespace openspace { -Documentation RenderableModelProjection::Documentation() { +documentation::Documentation RenderableModelProjection::Documentation() { using namespace documentation; return { diff --git a/modules/newhorizons/rendering/renderablemodelprojection.h b/modules/newhorizons/rendering/renderablemodelprojection.h index 5e9fb2d47e..ac85b7df0d 100644 --- a/modules/newhorizons/rendering/renderablemodelprojection.h +++ b/modules/newhorizons/rendering/renderablemodelprojection.h @@ -29,7 +29,6 @@ #include -#include #include #include @@ -43,6 +42,7 @@ class Texture; } namespace openspace { +namespace documentation { struct Documentation; } struct RenderData; struct UpdateData; @@ -66,7 +66,7 @@ public: ghoul::opengl::Texture& baseTexture() const; - static openspace::Documentation Documentation(); + static documentation::Documentation Documentation(); private: bool loadTextures(); diff --git a/modules/newhorizons/rendering/renderableplanetprojection.cpp b/modules/newhorizons/rendering/renderableplanetprojection.cpp index d5ee50ceae..29d5d6f57e 100644 --- a/modules/newhorizons/rendering/renderableplanetprojection.cpp +++ b/modules/newhorizons/rendering/renderableplanetprojection.cpp @@ -26,6 +26,7 @@ #include +#include #include #include #include @@ -66,7 +67,7 @@ namespace { namespace openspace { -Documentation RenderablePlanetProjection::Documentation() { +documentation::Documentation RenderablePlanetProjection::Documentation() { using namespace openspace::documentation; return { "Renderable Planet Projection", diff --git a/modules/newhorizons/rendering/renderableplanetprojection.h b/modules/newhorizons/rendering/renderableplanetprojection.h index 8c94c4a66b..5fb9963a9a 100644 --- a/modules/newhorizons/rendering/renderableplanetprojection.h +++ b/modules/newhorizons/rendering/renderableplanetprojection.h @@ -32,6 +32,7 @@ #include namespace openspace { +namespace documentation { struct Documentation; } struct Image; @@ -52,7 +53,7 @@ public: void update(const UpdateData& data) override; ghoul::opengl::Texture& baseTexture() const; - static openspace::Documentation Documentation(); + static documentation::Documentation Documentation(); protected: bool loadTextures(); diff --git a/modules/newhorizons/util/projectioncomponent.cpp b/modules/newhorizons/util/projectioncomponent.cpp index 1a02f16fa8..5685558eb9 100644 --- a/modules/newhorizons/util/projectioncomponent.cpp +++ b/modules/newhorizons/util/projectioncomponent.cpp @@ -29,6 +29,7 @@ #include #include +#include #include #include @@ -76,7 +77,7 @@ namespace openspace { using ghoul::Dictionary; using glm::ivec2; -Documentation ProjectionComponent::Documentation() { +documentation::Documentation ProjectionComponent::Documentation() { using namespace documentation; return { "Projection Component", diff --git a/modules/newhorizons/util/projectioncomponent.h b/modules/newhorizons/util/projectioncomponent.h index c9404a36ba..7325a293bf 100644 --- a/modules/newhorizons/util/projectioncomponent.h +++ b/modules/newhorizons/util/projectioncomponent.h @@ -27,7 +27,6 @@ #include -#include #include #include #include @@ -50,6 +49,8 @@ class ProgramObject; namespace openspace { +namespace documentation { struct Documentation; } + class ProjectionComponent : public properties::PropertyOwner { public: ProjectionComponent(); @@ -105,7 +106,7 @@ public: float fieldOfViewY() const; float aspectRatio() const; - static openspace::Documentation Documentation(); + static documentation::Documentation Documentation(); private: bool generateProjectionLayerTexture(const glm::ivec2& size); diff --git a/modules/space/rendering/planetgeometry.cpp b/modules/space/rendering/planetgeometry.cpp index aaf30ac1fe..eb62be82bf 100644 --- a/modules/space/rendering/planetgeometry.cpp +++ b/modules/space/rendering/planetgeometry.cpp @@ -23,8 +23,10 @@ ****************************************************************************************/ #include + #include +#include #include namespace { @@ -35,7 +37,7 @@ namespace { namespace openspace { namespace planetgeometry { -Documentation PlanetGeometry::Documentation() { +documentation::Documentation PlanetGeometry::Documentation() { using namespace documentation; return { "Planet Geometry", diff --git a/modules/space/rendering/planetgeometry.h b/modules/space/rendering/planetgeometry.h index 2d735b79d4..6e495f882b 100644 --- a/modules/space/rendering/planetgeometry.h +++ b/modules/space/rendering/planetgeometry.h @@ -27,10 +27,10 @@ #include -#include - namespace openspace { + class Renderable; +namespace documentation { struct Documentation; } namespace planetgeometry { @@ -44,7 +44,7 @@ public: virtual void deinitialize(); virtual void render() = 0; - static openspace::Documentation Documentation(); + static documentation::Documentation Documentation(); protected: Renderable* _parent; diff --git a/modules/space/rendering/renderablerings.cpp b/modules/space/rendering/renderablerings.cpp index eca4b60018..ffc6e99951 100644 --- a/modules/space/rendering/renderablerings.cpp +++ b/modules/space/rendering/renderablerings.cpp @@ -24,6 +24,7 @@ #include +#include #include #include #include @@ -43,7 +44,7 @@ namespace { namespace openspace { -Documentation RenderableRings::Documentation() { +documentation::Documentation RenderableRings::Documentation() { using namespace documentation; return { "Renderable Rings", diff --git a/modules/space/rendering/renderablerings.h b/modules/space/rendering/renderablerings.h index 6e17d5abc1..c606f44b7f 100644 --- a/modules/space/rendering/renderablerings.h +++ b/modules/space/rendering/renderablerings.h @@ -27,7 +27,6 @@ #include -#include #include #include #include @@ -44,6 +43,7 @@ namespace ghoul { } namespace openspace { +namespace documentation { struct Documentation; } class RenderableRings : public Renderable { public: @@ -57,7 +57,7 @@ public: void render(const RenderData& data) override; void update(const UpdateData& data) override; - static openspace::Documentation Documentation(); + static documentation::Documentation Documentation(); private: void loadTexture(); diff --git a/modules/space/rendering/renderablestars.cpp b/modules/space/rendering/renderablestars.cpp index 3c68df329c..d233addc7b 100644 --- a/modules/space/rendering/renderablestars.cpp +++ b/modules/space/rendering/renderablestars.cpp @@ -24,6 +24,7 @@ #include +#include #include #include #include @@ -82,7 +83,7 @@ namespace { namespace openspace { -openspace::Documentation RenderableStars::Documentation() { +documentation::Documentation RenderableStars::Documentation() { using namespace documentation; return { "RenderableStars", diff --git a/modules/space/rendering/renderablestars.h b/modules/space/rendering/renderablestars.h index 0f79e88924..7a8244f2cd 100644 --- a/modules/space/rendering/renderablestars.h +++ b/modules/space/rendering/renderablestars.h @@ -27,23 +27,20 @@ #include -#include #include #include #include namespace ghoul { -namespace filesystem { -class File; -} -} +namespace filesystem { class File; } +namespace opengl { + class ProgramObject; + class Texture; +} // namespace opengl +} // namespace ghoul namespace openspace { - -namespace opengl { -class ProgramObject; -class Texture; -} +namespace documentation { struct Documentation; } class RenderableStars : public Renderable { public: @@ -58,7 +55,7 @@ public: void render(const RenderData& data) override; void update(const UpdateData& data) override; - static openspace::Documentation Documentation(); + static documentation::Documentation Documentation(); private: enum ColorOption { diff --git a/modules/space/rotation/spicerotation.cpp b/modules/space/rotation/spicerotation.cpp index 0e38feadbc..41b7c7d612 100644 --- a/modules/space/rotation/spicerotation.cpp +++ b/modules/space/rotation/spicerotation.cpp @@ -24,14 +24,14 @@ #include +#include #include #include #include namespace { - const std::string _loggerCat = "SpiceRotation"; - //const std::string keyGhosting = "EphmerisGhosting"; + const char* _loggerCat = "SpiceRotation"; const char* KeySourceFrame = "SourceFrame"; const char* KeyDestinationFrame = "DestinationFrame"; @@ -40,7 +40,7 @@ namespace { namespace openspace { -Documentation SpiceRotation::Documentation() { +documentation::Documentation SpiceRotation::Documentation() { using namespace openspace::documentation; return { "Spice Rotation", diff --git a/modules/space/rotation/spicerotation.h b/modules/space/rotation/spicerotation.h index a8d91e5b3c..b0988f1801 100644 --- a/modules/space/rotation/spicerotation.h +++ b/modules/space/rotation/spicerotation.h @@ -26,18 +26,19 @@ #define __OPENSPACE_MODULE_SPACE___SPICEROTATION___H__ #include -#include #include namespace openspace { +namespace documentation { struct Documentation; } + class SpiceRotation : public Rotation { public: SpiceRotation(const ghoul::Dictionary& dictionary); const glm::dmat3& matrix() const; void update(const UpdateData& data) override; - static openspace::Documentation Documentation(); + static documentation::Documentation Documentation(); private: properties::StringProperty _sourceFrame; diff --git a/modules/space/spacemodule.cpp b/modules/space/spacemodule.cpp index 968be76861..9fe3f5c77a 100644 --- a/modules/space/spacemodule.cpp +++ b/modules/space/spacemodule.cpp @@ -24,6 +24,7 @@ #include +#include #include #include #include @@ -79,7 +80,7 @@ void SpaceModule::internalInitialize() { fPlanetGeometry->registerClass("SimpleSphere"); } -std::vector SpaceModule::documentations() const { +std::vector SpaceModule::documentations() const { return { SpiceRotation::Documentation(), SpiceTranslation::Documentation(), diff --git a/modules/space/spacemodule.h b/modules/space/spacemodule.h index 4ed6a2e951..f1f90d513b 100644 --- a/modules/space/spacemodule.h +++ b/modules/space/spacemodule.h @@ -33,7 +33,7 @@ class SpaceModule : public OpenSpaceModule { public: SpaceModule(); - std::vector documentations() const override; + std::vector documentations() const override; protected: void internalInitialize() override; diff --git a/modules/space/translation/keplertranslation.cpp b/modules/space/translation/keplertranslation.cpp index fd2d09af86..333d24fb70 100644 --- a/modules/space/translation/keplertranslation.cpp +++ b/modules/space/translation/keplertranslation.cpp @@ -64,7 +64,7 @@ KeplerTranslation::RangeError::RangeError(std::string offender) , offender(std::move(offender)) {} -Documentation KeplerTranslation::Documentation() { +documentation::Documentation KeplerTranslation::Documentation() { using namespace openspace::documentation; return{ "Kepler Translation", diff --git a/modules/space/translation/keplertranslation.h b/modules/space/translation/keplertranslation.h index a4d1cdf631..2d2ac0ce47 100644 --- a/modules/space/translation/keplertranslation.h +++ b/modules/space/translation/keplertranslation.h @@ -83,7 +83,7 @@ public: * \return The openspace::Documentation that describes the ghoul::Dicitonary that can * be passed to the constructor */ - static openspace::Documentation Documentation(); + static documentation::Documentation Documentation(); protected: /// Default construct that initializes all the properties and member variables diff --git a/modules/space/translation/spicetranslation.cpp b/modules/space/translation/spicetranslation.cpp index 34a1f4e289..816385ed17 100644 --- a/modules/space/translation/spicetranslation.cpp +++ b/modules/space/translation/spicetranslation.cpp @@ -24,12 +24,13 @@ #include +#include +#include #include #include #include -#include namespace { const char* KeyBody = "Body"; @@ -42,7 +43,7 @@ namespace { namespace openspace { -Documentation SpiceTranslation::Documentation() { +documentation::Documentation SpiceTranslation::Documentation() { using namespace openspace::documentation; return{ diff --git a/modules/space/translation/spicetranslation.h b/modules/space/translation/spicetranslation.h index 87a261021d..539cabe0d4 100644 --- a/modules/space/translation/spicetranslation.h +++ b/modules/space/translation/spicetranslation.h @@ -27,7 +27,6 @@ #include -#include #include namespace openspace { @@ -38,7 +37,7 @@ public: glm::dvec3 position() const; void update(const UpdateData& data) override; - static openspace::Documentation Documentation(); + static documentation::Documentation Documentation(); private: properties::StringProperty _target; diff --git a/modules/space/translation/tletranslation.cpp b/modules/space/translation/tletranslation.cpp index ec5e554c4e..5fa236dc41 100644 --- a/modules/space/translation/tletranslation.cpp +++ b/modules/space/translation/tletranslation.cpp @@ -224,7 +224,7 @@ namespace { namespace openspace { -Documentation TLETranslation::Documentation() { +documentation::Documentation TLETranslation::Documentation() { using namespace openspace::documentation; return { "TLE Translation", diff --git a/modules/space/translation/tletranslation.h b/modules/space/translation/tletranslation.h index cdf6d6c7a4..730fbbe677 100644 --- a/modules/space/translation/tletranslation.h +++ b/modules/space/translation/tletranslation.h @@ -52,7 +52,7 @@ public: * \return The openspace::Documentation that describes the ghoul::Dicitonary that can * be passed to the constructor */ - static openspace::Documentation Documentation(); + static documentation::Documentation Documentation(); private: /** diff --git a/src/engine/configurationmanager.cpp b/src/engine/configurationmanager.cpp index 7e7e396fde..0032aaebbd 100644 --- a/src/engine/configurationmanager.cpp +++ b/src/engine/configurationmanager.cpp @@ -24,8 +24,6 @@ #include -#include - #include #include #include diff --git a/src/engine/configurationmanager_doc.inl b/src/engine/configurationmanager_doc.inl index ea57fbd409..68f699ccfc 100644 --- a/src/engine/configurationmanager_doc.inl +++ b/src/engine/configurationmanager_doc.inl @@ -22,11 +22,12 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ +#include #include namespace openspace { -Documentation ConfigurationManager::Documentation() { +documentation::Documentation ConfigurationManager::Documentation() { using namespace documentation; return { diff --git a/src/mission/mission.cpp b/src/mission/mission.cpp index 8f95e2f52b..714db21982 100644 --- a/src/mission/mission.cpp +++ b/src/mission/mission.cpp @@ -30,15 +30,15 @@ #include namespace { - const std::string KeyName = "Name"; - const std::string KeyDescription = "Description"; - const std::string KeyPhases = "Phases"; - const std::string KeyTimeRange = "TimeRange"; + const char* KeyName = "Name"; + const char* KeyDescription = "Description"; + const char* KeyPhases = "Phases"; + const char* KeyTimeRange = "TimeRange"; } namespace openspace { -Documentation MissionPhase::Documentation() { +documentation::Documentation MissionPhase::Documentation() { using namespace documentation; return { @@ -188,7 +188,11 @@ Mission missionFromFile(std::string filename) { ghoul::Dictionary missionDict; ghoul::lua::loadDictionaryFromFile(filename, missionDict); - documentation::testSpecificationAndThrow(Documentation(), missionDict, "Mission"); + documentation::testSpecificationAndThrow( + MissionPhase::Documentation(), + missionDict, + "Mission" + ); return MissionPhase(missionDict); } diff --git a/src/rendering/renderable.cpp b/src/rendering/renderable.cpp index 0d85a020c1..cf9fb6ac42 100644 --- a/src/rendering/renderable.cpp +++ b/src/rendering/renderable.cpp @@ -28,6 +28,7 @@ #include #include +#include #include #include @@ -36,15 +37,15 @@ #include namespace { - const std::string _loggerCat = "Renderable"; - const std::string keyStart = "StartTime"; - const std::string keyEnd = "EndTime"; - const std::string KeyType = "Type"; + const char* _loggerCat = "Renderable"; + const char* keyStart = "StartTime"; + const char* keyEnd = "EndTime"; + const char* KeyType = "Type"; } namespace openspace { -Documentation Renderable::Documentation() { +documentation::Documentation Renderable::Documentation() { using namespace openspace::documentation; return { diff --git a/src/rendering/screenspacerenderable.cpp b/src/rendering/screenspacerenderable.cpp index 7d3c6f21d1..1acaf704d6 100644 --- a/src/rendering/screenspacerenderable.cpp +++ b/src/rendering/screenspacerenderable.cpp @@ -24,35 +24,36 @@ #include +#include +#include #include #include #include #include #include -#include - #ifdef WIN32 - #define _USE_MATH_DEFINES - #include - #endif +#ifdef WIN32 +#define _USE_MATH_DEFINES +#include +#endif namespace { - const std::string _loggerCat = "ScreenSpaceRenderable"; + const char* _loggerCat = "ScreenSpaceRenderable"; - const std::string KeyType = "Type"; - const std::string KeyFlatScreen = "FlatScreen"; - const std::string KeyPosition = "Position"; - const std::string KeyScale = "Scale"; - const std::string KeyDepth = "Depth"; - const std::string KeyAlpha = "Alpha"; + const char* KeyType = "Type"; + const char* KeyFlatScreen = "FlatScreen"; + const char* KeyPosition = "Position"; + const char* KeyScale = "Scale"; + const char* KeyDepth = "Depth"; + const char* KeyAlpha = "Alpha"; const float PlaneDepth = -2.f; } namespace openspace { -Documentation ScreenSpaceRenderable::Documentation() { +documentation::Documentation ScreenSpaceRenderable::Documentation() { using namespace openspace::documentation; return { diff --git a/src/scene/rotation.cpp b/src/scene/rotation.cpp index 34333b6a78..4cecd2533d 100644 --- a/src/scene/rotation.cpp +++ b/src/scene/rotation.cpp @@ -23,19 +23,21 @@ ****************************************************************************************/ #include + +#include +#include #include + #include -#include - namespace { - const std::string _loggerCat = "Rotation"; - const std::string KeyType = "Type"; + const char* _loggerCat = "Rotation"; + const char* KeyType = "Type"; } namespace openspace { -Documentation Rotation::Documentation() { +documentation::Documentation Rotation::Documentation() { using namespace openspace::documentation; return { @@ -87,4 +89,4 @@ const glm::dmat3& Rotation::matrix() const { void Rotation::update(const UpdateData& data) {} -} // namespace openspace \ No newline at end of file +} // namespace openspace diff --git a/src/scene/scale.cpp b/src/scene/scale.cpp index d5fe9b542b..f71348e0ec 100644 --- a/src/scene/scale.cpp +++ b/src/scene/scale.cpp @@ -23,19 +23,21 @@ ****************************************************************************************/ #include + +#include +#include #include + #include -#include - namespace { - const std::string _loggerCat = "Scale"; - const std::string KeyType = "Type"; + const char* _loggerCat = "Scale"; + const char* KeyType = "Type"; } namespace openspace { -Documentation Scale::Documentation() { +documentation::Documentation Scale::Documentation() { using namespace openspace::documentation; return { @@ -81,4 +83,4 @@ bool Scale::initialize() { void Scale::update(const UpdateData& data) {} -} // namespace openspace \ No newline at end of file +} // namespace openspace diff --git a/src/scene/scene_doc.inl b/src/scene/scene_doc.inl index dc9de91c1e..c6be2cc5a2 100644 --- a/src/scene/scene_doc.inl +++ b/src/scene/scene_doc.inl @@ -22,11 +22,12 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ +#include #include namespace openspace { -Documentation Scene::Documentation() { +documentation::Documentation Scene::Documentation() { using namespace documentation; return { diff --git a/src/scene/scenegraph.cpp b/src/scene/scenegraph.cpp index 898328ee69..d075b86b85 100644 --- a/src/scene/scenegraph.cpp +++ b/src/scene/scenegraph.cpp @@ -24,6 +24,7 @@ #include +#include #include #include #include diff --git a/src/scene/scenegraphnode.cpp b/src/scene/scenegraphnode.cpp index 7f48351423..b9cfaa7ca2 100644 --- a/src/scene/scenegraphnode.cpp +++ b/src/scene/scenegraphnode.cpp @@ -24,8 +24,6 @@ #include -#include - #include #include #include diff --git a/src/scene/scenegraphnode_doc.inl b/src/scene/scenegraphnode_doc.inl index 719c7a0275..2766c91ee4 100644 --- a/src/scene/scenegraphnode_doc.inl +++ b/src/scene/scenegraphnode_doc.inl @@ -22,11 +22,12 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ +#include #include namespace openspace { -Documentation SceneGraphNode::Documentation() { +documentation::Documentation SceneGraphNode::Documentation() { using namespace documentation; return { diff --git a/src/scene/translation.cpp b/src/scene/translation.cpp index 33cee491cc..02c2124473 100644 --- a/src/scene/translation.cpp +++ b/src/scene/translation.cpp @@ -30,14 +30,14 @@ #include namespace { - const std::string _loggerCat = "Translation"; - const std::string KeyType = "Type"; + const char* _loggerCat = "Translation"; + const char* KeyType = "Type"; } namespace openspace { -Documentation Translation::Documentation() { - using namespace openspace::documentation; +documentation::Documentation Translation::Documentation() { + using namespace documentation; return { "Transformation Translation", diff --git a/src/scripting/scriptscheduler.cpp b/src/scripting/scriptscheduler.cpp index e3126aa8ce..974db87af5 100644 --- a/src/scripting/scriptscheduler.cpp +++ b/src/scripting/scriptscheduler.cpp @@ -31,6 +31,7 @@ #include #include +#include #include namespace { @@ -46,7 +47,7 @@ namespace openspace { namespace scripting { -openspace::Documentation ScriptScheduler::Documentation() { +documentation::Documentation ScriptScheduler::Documentation() { using namespace openspace::documentation; using TimeVerifier = StringVerifier; diff --git a/src/util/openspacemodule.cpp b/src/util/openspacemodule.cpp index fd64783648..cfb330ac96 100644 --- a/src/util/openspacemodule.cpp +++ b/src/util/openspacemodule.cpp @@ -24,14 +24,16 @@ #include +#include + #include #include #include namespace { - const std::string _loggerCat = "OpenSpaceModule"; - const std::string ModuleBaseToken = "MODULE_"; + const char* _loggerCat = "OpenSpaceModule"; + const char* ModuleBaseToken = "MODULE_"; } namespace openspace { @@ -63,7 +65,7 @@ void OpenSpaceModule::deinitialize() { internalDeinitialize(); } -std::vector OpenSpaceModule::documentations() const { +std::vector OpenSpaceModule::documentations() const { return {}; } diff --git a/src/util/timerange.cpp b/src/util/timerange.cpp index 33bd6c66ee..5569cfab75 100644 --- a/src/util/timerange.cpp +++ b/src/util/timerange.cpp @@ -24,6 +24,7 @@ #include +#include #include #include @@ -36,7 +37,7 @@ namespace { namespace openspace { -openspace::Documentation TimeRange::Documentation() { +documentation::Documentation TimeRange::Documentation() { using namespace documentation; return { "Time Range", From 4e52f27f9e2a0b46c1590f33aacac2206c8859de Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Wed, 1 Mar 2017 19:20:00 -0500 Subject: [PATCH 55/96] Remove Dictionary include with forward declarations --- ext/ghoul | 2 +- .../openspace/documentation/documentation.h | 3 +- include/openspace/documentation/verifier.h | 2 + include/openspace/documentation/verifier.inl | 2 + include/openspace/scene/rotation.h | 2 +- include/openspace/scene/scale.h | 3 +- include/openspace/scene/scene.h | 3 +- include/openspace/scene/scenegraphnode.h | 4 +- include/openspace/scene/translation.h | 2 +- include/openspace/scripting/lualibrary.h | 3 ++ include/openspace/scripting/scriptengine.h | 1 + modules/base/rendering/modelgeometry.cpp | 1 + modules/base/rendering/modelgeometry.h | 3 +- .../tile/tileprovider/temporaltileprovider.h | 2 + modules/newhorizons/util/labelparser.cpp | 3 +- src/documentation/documentation.cpp | 2 + src/scene/rotation.cpp | 1 + src/scene/scale.cpp | 1 + src/scene/scene.cpp | 37 ++++++++++--------- src/scene/scenegraphnode.cpp | 1 + src/scene/translation.cpp | 1 + 21 files changed, 51 insertions(+), 28 deletions(-) diff --git a/ext/ghoul b/ext/ghoul index a9a2c04f99..9a28e8b4a9 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit a9a2c04f99a3a8dbfb94f3d3268d3fbf20351c2c +Subproject commit 9a28e8b4a9135af6104a4c62950f47c364fc3411 diff --git a/include/openspace/documentation/documentation.h b/include/openspace/documentation/documentation.h index bfc64976b4..5e64e3b4bc 100644 --- a/include/openspace/documentation/documentation.h +++ b/include/openspace/documentation/documentation.h @@ -26,13 +26,14 @@ #define __OPENSPACE_CORE___DOCUMENTATION___H__ #include -#include #include #include #include #include +namespace ghoul { class Dictionary; } + namespace openspace { namespace documentation { diff --git a/include/openspace/documentation/verifier.h b/include/openspace/documentation/verifier.h index 07579a747d..61a7cb5b47 100644 --- a/include/openspace/documentation/verifier.h +++ b/include/openspace/documentation/verifier.h @@ -27,6 +27,8 @@ #include +#include + #include #include diff --git a/include/openspace/documentation/verifier.inl b/include/openspace/documentation/verifier.inl index d03a05a2b9..06228a7622 100644 --- a/include/openspace/documentation/verifier.inl +++ b/include/openspace/documentation/verifier.inl @@ -22,6 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ +#include + #include namespace std { diff --git a/include/openspace/scene/rotation.h b/include/openspace/scene/rotation.h index 762f5b0c44..be0dcdfca0 100644 --- a/include/openspace/scene/rotation.h +++ b/include/openspace/scene/rotation.h @@ -29,7 +29,7 @@ #include -#include +namespace ghoul { class Dictionary; } namespace openspace { diff --git a/include/openspace/scene/scale.h b/include/openspace/scene/scale.h index 4630247c88..c272f3c3a9 100644 --- a/include/openspace/scene/scale.h +++ b/include/openspace/scene/scale.h @@ -29,8 +29,7 @@ #include -#include - +namespace ghoul { class Dictionary; } namespace openspace { namespace documentation { struct Documentation; }; diff --git a/include/openspace/scene/scene.h b/include/openspace/scene/scene.h index b8fd27ae5b..2e441092f9 100644 --- a/include/openspace/scene/scene.h +++ b/include/openspace/scene/scene.h @@ -36,7 +36,8 @@ #include #include -#include + +namespace ghoul { class Dictionary; } namespace openspace { diff --git a/include/openspace/scene/scenegraphnode.h b/include/openspace/scene/scenegraphnode.h index 51775415b4..092b04955c 100644 --- a/include/openspace/scene/scenegraphnode.h +++ b/include/openspace/scene/scenegraphnode.h @@ -32,15 +32,15 @@ #include #include -#include #include -// std includes #include #include #include #include +namespace ghoul { class Dictionary; } + namespace openspace { namespace documentation { struct Documentation; } diff --git a/include/openspace/scene/translation.h b/include/openspace/scene/translation.h index a1ea8f71e1..4337f12035 100644 --- a/include/openspace/scene/translation.h +++ b/include/openspace/scene/translation.h @@ -29,7 +29,7 @@ #include -#include +namespace ghoul { class Dictionary; } namespace openspace { diff --git a/include/openspace/scripting/lualibrary.h b/include/openspace/scripting/lualibrary.h index 07e0b54794..4f881f21ad 100644 --- a/include/openspace/scripting/lualibrary.h +++ b/include/openspace/scripting/lualibrary.h @@ -27,6 +27,9 @@ #include +#include +#include + namespace openspace { namespace scripting { diff --git a/include/openspace/scripting/scriptengine.h b/include/openspace/scripting/scriptengine.h index cc272e577f..b28a8fb2ba 100644 --- a/include/openspace/scripting/scriptengine.h +++ b/include/openspace/scripting/scriptengine.h @@ -30,6 +30,7 @@ #include #include +#include #include #include diff --git a/modules/base/rendering/modelgeometry.cpp b/modules/base/rendering/modelgeometry.cpp index 1b385c787d..55463821d0 100644 --- a/modules/base/rendering/modelgeometry.cpp +++ b/modules/base/rendering/modelgeometry.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include diff --git a/modules/base/rendering/modelgeometry.h b/modules/base/rendering/modelgeometry.h index 825556da1d..e878eecf77 100644 --- a/modules/base/rendering/modelgeometry.h +++ b/modules/base/rendering/modelgeometry.h @@ -28,7 +28,8 @@ #include #include -#include + +namespace ghoul { class Dictionary; } namespace openspace { namespace documentation { struct Documentation; } diff --git a/modules/globebrowsing/tile/tileprovider/temporaltileprovider.h b/modules/globebrowsing/tile/tileprovider/temporaltileprovider.h index 70344997e5..f6be2ee126 100644 --- a/modules/globebrowsing/tile/tileprovider/temporaltileprovider.h +++ b/modules/globebrowsing/tile/tileprovider/temporaltileprovider.h @@ -30,6 +30,8 @@ #include #include +#include + #include #include #include diff --git a/modules/newhorizons/util/labelparser.cpp b/modules/newhorizons/util/labelparser.cpp index 8607848158..a6e734be12 100644 --- a/modules/newhorizons/util/labelparser.cpp +++ b/modules/newhorizons/util/labelparser.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -331,4 +332,4 @@ void LabelParser::createImage(Image& image, double startTime, double stopTime, s image.projected = false; } -} \ No newline at end of file +} diff --git a/src/documentation/documentation.cpp b/src/documentation/documentation.cpp index ee1ee34ee8..f33368b971 100644 --- a/src/documentation/documentation.cpp +++ b/src/documentation/documentation.cpp @@ -25,6 +25,8 @@ #include #include +#include + #include namespace { diff --git a/src/scene/rotation.cpp b/src/scene/rotation.cpp index 4cecd2533d..c064cd96c4 100644 --- a/src/scene/rotation.cpp +++ b/src/scene/rotation.cpp @@ -28,6 +28,7 @@ #include #include +#include #include namespace { diff --git a/src/scene/scale.cpp b/src/scene/scale.cpp index f71348e0ec..9da2f23d4e 100644 --- a/src/scene/scale.cpp +++ b/src/scene/scale.cpp @@ -29,6 +29,7 @@ #include #include +#include namespace { const char* _loggerCat = "Scale"; diff --git a/src/scene/scene.cpp b/src/scene/scene.cpp index abaa4e18eb..bd44f78b65 100644 --- a/src/scene/scene.cpp +++ b/src/scene/scene.cpp @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -58,27 +59,29 @@ #include "scene_lua.inl" namespace { - const std::string _loggerCat = "Scene"; - const std::string _moduleExtension = ".mod"; - const std::string _commonModuleToken = "${COMMON_MODULE}"; + const char* _loggerCat = "Scene"; + const char* _moduleExtension = ".mod"; + const char* _commonModuleToken = "${COMMON_MODULE}"; - const std::string KeyCamera = "Camera"; - const std::string KeyFocusObject = "Focus"; - const std::string KeyPositionObject = "Position"; - const std::string KeyViewOffset = "Offset"; + const char* KeyCamera = "Camera"; + const char* KeyFocusObject = "Focus"; + const char* KeyPositionObject = "Position"; + const char* KeyViewOffset = "Offset"; - const std::string MainTemplateFilename = "${OPENSPACE_DATA}/web/properties/main.hbs"; - const std::string PropertyOwnerTemplateFilename = "${OPENSPACE_DATA}/web/properties/propertyowner.hbs"; - const std::string PropertyTemplateFilename = "${OPENSPACE_DATA}/web/properties/property.hbs"; - const std::string HandlebarsFilename = "${OPENSPACE_DATA}/web/common/handlebars-v4.0.5.js"; - const std::string JsFilename = "${OPENSPACE_DATA}/web/properties/script.js"; - const std::string BootstrapFilename = "${OPENSPACE_DATA}/web/common/bootstrap.min.css"; - const std::string CssFilename = "${OPENSPACE_DATA}/web/common/style.css"; -} + const char* MainTemplateFilename = "${OPENSPACE_DATA}/web/properties/main.hbs"; + const char* PropertyOwnerTemplateFilename = "${OPENSPACE_DATA}/web/properties/propertyowner.hbs"; + const char* PropertyTemplateFilename = "${OPENSPACE_DATA}/web/properties/property.hbs"; + const char* HandlebarsFilename = "${OPENSPACE_DATA}/web/common/handlebars-v4.0.5.js"; + const char* JsFilename = "${OPENSPACE_DATA}/web/properties/script.js"; + const char* BootstrapFilename = "${OPENSPACE_DATA}/web/common/bootstrap.min.css"; + const char* CssFilename = "${OPENSPACE_DATA}/web/common/style.css"; +} // namespace namespace openspace { -Scene::Scene() : _focus(SceneGraphNode::RootNodeName) {} +Scene::Scene() + : _focus(SceneGraphNode::RootNodeName) +{} Scene::~Scene() { deinitialize(); @@ -226,7 +229,7 @@ bool Scene::loadSceneInternal(const std::string& sceneDescriptionFilePath) { LWARNING(node->name() << " not initialized."); } catch (const ghoul::RuntimeError& e) { - LERRORC(_loggerCat + "(" + e.component + ")", e.what()); + LERRORC(std::string(_loggerCat) + "(" + e.component + ")", e.what()); } } diff --git a/src/scene/scenegraphnode.cpp b/src/scene/scenegraphnode.cpp index b9cfaa7ca2..8aaa29e3bd 100644 --- a/src/scene/scenegraphnode.cpp +++ b/src/scene/scenegraphnode.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include diff --git a/src/scene/translation.cpp b/src/scene/translation.cpp index 02c2124473..4452d566da 100644 --- a/src/scene/translation.cpp +++ b/src/scene/translation.cpp @@ -26,6 +26,7 @@ #include #include +#include #include From fbea8389c87a4eaf82998aafb949280a720821c4 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Wed, 1 Mar 2017 21:02:33 -0500 Subject: [PATCH 56/96] =?UTF-8?q?-=20Add=20check=20in=20style=20guide=20th?= =?UTF-8?q?at=20prevents=20=E2=80=98using=20namespace=E2=80=99=20in=20head?= =?UTF-8?q?er=20files=20-=20Remove=20using=20namespace=20ghoul::opengl=20f?= =?UTF-8?q?rom=20Globebrowsing=20and=20adjust?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scripting/systemcapabilitiesbinding.h | 6 ++--- include/openspace/util/gpudata.h | 13 ++++------ .../globebrowsing/rendering/chunkrenderer.cpp | 6 ++--- .../rendering/gpu/gpuchunktile.cpp | 8 ++++-- .../rendering/gpu/gpuchunktile.h | 5 ++-- .../rendering/gpu/gpuchunktilepile.cpp | 22 ++++++++-------- .../rendering/gpu/gpuchunktilepile.h | 9 ++++--- .../rendering/gpu/gpuheightlayer.cpp | 11 ++++---- .../rendering/gpu/gpuheightlayer.h | 10 ++++---- .../globebrowsing/rendering/gpu/gpulayer.cpp | 4 +-- .../globebrowsing/rendering/gpu/gpulayer.h | 8 +++--- .../rendering/gpu/gpulayergroup.cpp | 25 ++++++++++--------- .../rendering/gpu/gpulayergroup.h | 10 ++++---- .../rendering/gpu/gpulayermanager.cpp | 19 +++++++------- .../rendering/gpu/gpulayermanager.h | 9 ++++--- .../rendering/gpu/gpulayerrendersettings.cpp | 4 +-- .../rendering/gpu/gpulayerrendersettings.h | 5 ++-- .../rendering/gpu/gputiledepthtransform.cpp | 12 ++++----- .../rendering/gpu/gputiledepthtransform.h | 10 +++++--- .../rendering/gpu/gputileuvtransform.cpp | 14 ++++++----- .../rendering/gpu/gputileuvtransform.h | 10 +++++--- .../tile/tileprovider/singleimageprovider.cpp | 4 ++- .../tile/tileprovider/singleimageprovider.h | 2 -- src/util/gpudata.cpp | 3 ++- support/coding/check_style_guide.py | 14 ++++++++++- 25 files changed, 135 insertions(+), 108 deletions(-) diff --git a/include/openspace/scripting/systemcapabilitiesbinding.h b/include/openspace/scripting/systemcapabilitiesbinding.h index c470140a86..107b97b5c3 100644 --- a/include/openspace/scripting/systemcapabilitiesbinding.h +++ b/include/openspace/scripting/systemcapabilitiesbinding.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_CORE___SYSTEMCAPABLITIESBINDING___H__ -#define __OPENSPACE_CORE___SYSTEMCAPABLITIESBINDING___H__ +#ifndef __OPENSPACE_CORE___SYSTEMCAPABILITIESBINDING___H__ +#define __OPENSPACE_CORE___SYSTEMCAPABILITIESBINDING___H__ #include @@ -36,4 +36,4 @@ LuaLibrary openglSystemCapabilities(); } // namespace scripting } // namespace openspace -#endif // __OPENSPACE_CORE___SYSTEMCAPABLITIESBINDING___H__ +#endif // __OPENSPACE_CORE___SYSTEMCAPABILITIESBINDING___H__ diff --git a/include/openspace/util/gpudata.h b/include/openspace/util/gpudata.h index 2a3af70d21..31b7ff8e03 100644 --- a/include/openspace/util/gpudata.h +++ b/include/openspace/util/gpudata.h @@ -34,9 +34,6 @@ namespace openspace { -using namespace ghoul::opengl; - - /** * Very simple class maintaining a uniform location. */ @@ -47,7 +44,7 @@ public: * Updates the uniform location of the uniform variable named * in the provided shader program. */ - void bind(ProgramObject* program, const std::string& name); + void bind(ghoul::opengl::ProgramObject* program, const std::string& name); protected: GLint _uniformLocation = -1; @@ -67,7 +64,7 @@ public: * Sets the value of T to its corresponding GPU value. * OBS! Users must ensure bind has been called before using this method */ - void setValue(ProgramObject* program, T val){ + void setValue(ghoul::opengl::ProgramObject* program, T val){ program->setUniform(_uniformLocation, val); } @@ -86,8 +83,8 @@ public: * program. * OBS! Users must ensure bind has been called before using this method. */ - void setValue(ProgramObject* program, std::shared_ptr texture){ - _texUnit = std::make_unique(); + void setValue(ghoul::opengl::ProgramObject* program, std::shared_ptr texture){ + _texUnit = std::make_unique(); _texUnit->activate(); texture->bind(); program->setUniform(_uniformLocation, *_texUnit); @@ -99,7 +96,7 @@ public: private: - std::unique_ptr _texUnit; + std::unique_ptr _texUnit; }; diff --git a/modules/globebrowsing/rendering/chunkrenderer.cpp b/modules/globebrowsing/rendering/chunkrenderer.cpp index 05af587eec..d7296db626 100644 --- a/modules/globebrowsing/rendering/chunkrenderer.cpp +++ b/modules/globebrowsing/rendering/chunkrenderer.cpp @@ -112,7 +112,7 @@ ghoul::opengl::ProgramObject* ChunkRenderer::getActivatedProgramWithTileData( std::to_string(Chunk::DEFAULT_HEIGHT))); // Now the shader program can be accessed - ProgramObject* programObject = + ghoul::opengl::ProgramObject* programObject = layeredShaderManager->programObject( layeredTexturePreprocessingData); @@ -143,7 +143,7 @@ ghoul::opengl::ProgramObject* ChunkRenderer::getActivatedProgramWithTileData( void ChunkRenderer::renderChunkGlobally(const Chunk& chunk, const RenderData& data){ - ProgramObject* programObject = getActivatedProgramWithTileData( + ghoul::opengl::ProgramObject* programObject = getActivatedProgramWithTileData( _globalLayerShaderManager, _globalGpuLayerManager, chunk); @@ -217,7 +217,7 @@ void ChunkRenderer::renderChunkGlobally(const Chunk& chunk, const RenderData& da void ChunkRenderer::renderChunkLocally(const Chunk& chunk, const RenderData& data) { - ProgramObject* programObject = getActivatedProgramWithTileData( + ghoul::opengl::ProgramObject* programObject = getActivatedProgramWithTileData( _localLayerShaderManager, _localGpuLayerManager, chunk); diff --git a/modules/globebrowsing/rendering/gpu/gpuchunktile.cpp b/modules/globebrowsing/rendering/gpu/gpuchunktile.cpp index 4467241bfa..b5a92339b7 100644 --- a/modules/globebrowsing/rendering/gpu/gpuchunktile.cpp +++ b/modules/globebrowsing/rendering/gpu/gpuchunktile.cpp @@ -30,12 +30,16 @@ namespace openspace { namespace globebrowsing { -void GPUChunkTile::setValue(ProgramObject* programObject, const ChunkTile& chunkTile) { +void GPUChunkTile::setValue(ghoul::opengl::ProgramObject* programObject, + const ChunkTile& chunkTile) +{ gpuTexture.setValue(programObject, chunkTile.tile.texture); gpuTileUvTransform.setValue(programObject, chunkTile.uvTransform); } -void GPUChunkTile::bind(ProgramObject* programObject, const std::string& nameBase) { +void GPUChunkTile::bind(ghoul::opengl::ProgramObject* programObject, + const std::string& nameBase) +{ gpuTexture.bind(programObject, nameBase + "textureSampler"); gpuTileUvTransform.bind(programObject, nameBase + "uvTransform."); } diff --git a/modules/globebrowsing/rendering/gpu/gpuchunktile.h b/modules/globebrowsing/rendering/gpu/gpuchunktile.h index 4a85ab13ad..490c7a81bd 100644 --- a/modules/globebrowsing/rendering/gpu/gpuchunktile.h +++ b/modules/globebrowsing/rendering/gpu/gpuchunktile.h @@ -51,14 +51,15 @@ public: * GPU struct. OBS! Users must ensure bind has been * called before setting using this method. */ - void setValue(ProgramObject* programObject, const ChunkTile& chunkTile); + void setValue(ghoul::opengl::ProgramObject* programObject, + const ChunkTile& chunkTile); /** * Binds GLSL variables with identifiers starting with * nameBase within the provided shader program with this object. * After this method has been called, users may invoke setValue. */ - void bind(ProgramObject* programObject, const std::string& nameBase); + void bind(ghoul::opengl::ProgramObject* programObject, const std::string& nameBase); /** * Deactivates any TextureUnits assigned by this object. diff --git a/modules/globebrowsing/rendering/gpu/gpuchunktilepile.cpp b/modules/globebrowsing/rendering/gpu/gpuchunktilepile.cpp index 52562ac90a..a07cd46857 100644 --- a/modules/globebrowsing/rendering/gpu/gpuchunktilepile.cpp +++ b/modules/globebrowsing/rendering/gpu/gpuchunktilepile.cpp @@ -28,31 +28,31 @@ namespace openspace { namespace globebrowsing { -void GPUChunkTilePile::setValue(ProgramObject* programObject, +void GPUChunkTilePile::setValue(ghoul::opengl::ProgramObject* programObject, const ChunkTilePile& chunkTilePile) { ghoul_assert( - gpuChunkTiles.size() == chunkTilePile.size(), + _gpuChunkTiles.size() == chunkTilePile.size(), "GPU and CPU ChunkTilePile must have same size!" ); - for (size_t i = 0; i < gpuChunkTiles.size(); ++i) { - gpuChunkTiles[i].setValue(programObject, chunkTilePile[i]); + for (size_t i = 0; i < _gpuChunkTiles.size(); ++i) { + _gpuChunkTiles[i].setValue(programObject, chunkTilePile[i]); } } -void GPUChunkTilePile::bind(ProgramObject* programObject, const std::string& nameBase, - int pileSize) +void GPUChunkTilePile::bind(ghoul::opengl::ProgramObject* programObject, + const std::string& nameBase, int pileSize) { - gpuChunkTiles.resize(pileSize); - for (size_t i = 0; i < gpuChunkTiles.size(); ++i) { + _gpuChunkTiles.resize(pileSize); + for (size_t i = 0; i < _gpuChunkTiles.size(); ++i) { std::string nameExtension = "chunkTile" + std::to_string(i) + "."; - gpuChunkTiles[i].bind(programObject, nameBase + nameExtension); + _gpuChunkTiles[i].bind(programObject, nameBase + nameExtension); } } void GPUChunkTilePile::deactivate() { - for (auto& gpuChunkTile : gpuChunkTiles) { - gpuChunkTile.deactivate(); + for (auto& t : _gpuChunkTiles) { + t.deactivate(); } } diff --git a/modules/globebrowsing/rendering/gpu/gpuchunktilepile.h b/modules/globebrowsing/rendering/gpu/gpuchunktilepile.h index 76d34ac1b9..e09b516370 100644 --- a/modules/globebrowsing/rendering/gpu/gpuchunktilepile.h +++ b/modules/globebrowsing/rendering/gpu/gpuchunktilepile.h @@ -51,15 +51,16 @@ public: * GPU struct. OBS! Users must ensure bind has been * called before setting using this method. */ - void setValue(ProgramObject* programObject, const ChunkTilePile& chunkTilePile); + void setValue(ghoul::opengl::ProgramObject* programObject, + const ChunkTilePile& chunkTilePile); /** * Binds this object with GLSL variables with identifiers starting * with nameBase within the provided shader program. * After this method has been called, users may invoke setValue. */ - void bind(ProgramObject* programObject, const std::string& nameBase, - int pileSize); + void bind(ghoul::opengl::ProgramObject* programObject, const std::string& nameBase, + int pileSize); /** * Deactivates any TextureUnits assigned by this object. * This method should be called after the OpenGL draw call. @@ -67,7 +68,7 @@ public: void deactivate(); private: - std::vector gpuChunkTiles; + std::vector _gpuChunkTiles; }; } // namespace globebrowsing diff --git a/modules/globebrowsing/rendering/gpu/gpuheightlayer.cpp b/modules/globebrowsing/rendering/gpu/gpuheightlayer.cpp index 2db24d540f..5b77c34f9b 100644 --- a/modules/globebrowsing/rendering/gpu/gpuheightlayer.cpp +++ b/modules/globebrowsing/rendering/gpu/gpuheightlayer.cpp @@ -33,18 +33,19 @@ namespace openspace { namespace globebrowsing { -void GPUHeightLayer::setValue(ProgramObject* programObject, const Layer& layer, - const TileIndex& tileIndex, int pileSize) +void GPUHeightLayer::setValue(ghoul::opengl::ProgramObject* programObject, + const Layer& layer, const TileIndex& tileIndex, + int pileSize) { GPULayer::setValue(programObject, layer, tileIndex, pileSize); - gpuDepthTransform.setValue(programObject, layer.tileProvider()->depthTransform()); + _gpuDepthTransform.setValue(programObject, layer.tileProvider()->depthTransform()); } -void GPUHeightLayer::bind(ProgramObject* programObject, const Layer& layer, +void GPUHeightLayer::bind(ghoul::opengl::ProgramObject* programObject, const Layer& layer, const std::string& nameBase, int pileSize) { GPULayer::bind(programObject, layer, nameBase, pileSize); - gpuDepthTransform.bind(programObject, nameBase + "depthTransform."); + _gpuDepthTransform.bind(programObject, nameBase + "depthTransform."); } diff --git a/modules/globebrowsing/rendering/gpu/gpuheightlayer.h b/modules/globebrowsing/rendering/gpu/gpuheightlayer.h index 466fb0909f..d2fca786cf 100644 --- a/modules/globebrowsing/rendering/gpu/gpuheightlayer.h +++ b/modules/globebrowsing/rendering/gpu/gpuheightlayer.h @@ -53,19 +53,19 @@ public: * GPU struct. OBS! Users must ensure bind has been * called before setting using this method. */ - virtual void setValue(ProgramObject* programObject, const Layer& layer, - const TileIndex& tileIndex, int pileSize); + virtual void setValue(ghoul::opengl::ProgramObject* programObject, const Layer& layer, + const TileIndex& tileIndex, int pileSize); /** * Binds this object with GLSL variables with identifiers starting * with nameBase within the provided shader program. * After this method has been called, users may invoke setValue. */ - virtual void bind(ProgramObject* programObject, const Layer& layer, - const std::string& nameBase, int pileSize); + virtual void bind(ghoul::opengl::ProgramObject* programObject, const Layer& layer, + const std::string& nameBase, int pileSize); private: - GPUTileDepthTransform gpuDepthTransform; + GPUTileDepthTransform _gpuDepthTransform; }; } // namespace globebrowsing diff --git a/modules/globebrowsing/rendering/gpu/gpulayer.cpp b/modules/globebrowsing/rendering/gpu/gpulayer.cpp index b54d9586f8..99fb35e915 100644 --- a/modules/globebrowsing/rendering/gpu/gpulayer.cpp +++ b/modules/globebrowsing/rendering/gpu/gpulayer.cpp @@ -29,7 +29,7 @@ namespace openspace { namespace globebrowsing { -void GPULayer::setValue(ProgramObject* programObject, const Layer& layer, +void GPULayer::setValue(ghoul::opengl::ProgramObject* programObject, const Layer& layer, const TileIndex& tileIndex, int pileSize) { ChunkTilePile chunkTilePile = layer.getChunkTilePile(tileIndex, pileSize); @@ -37,7 +37,7 @@ void GPULayer::setValue(ProgramObject* programObject, const Layer& layer, gpuRenderSettings.setValue(programObject, layer.renderSettings()); } -void GPULayer::bind(ProgramObject* programObject, const Layer& layer, +void GPULayer::bind(ghoul::opengl::ProgramObject* programObject, const Layer& layer, const std::string& nameBase, int pileSize) { gpuChunkTilePile.bind(programObject, nameBase + "pile.", pileSize); diff --git a/modules/globebrowsing/rendering/gpu/gpulayer.h b/modules/globebrowsing/rendering/gpu/gpulayer.h index bd07af9d6b..7fb7f2914c 100644 --- a/modules/globebrowsing/rendering/gpu/gpulayer.h +++ b/modules/globebrowsing/rendering/gpu/gpulayer.h @@ -51,16 +51,16 @@ public: * GPU struct. OBS! Users must ensure bind has been * called before setting using this method. */ - virtual void setValue(ProgramObject* programObject, const Layer& layer, - const TileIndex& tileIndex, int pileSize); + virtual void setValue(ghoul::opengl::ProgramObject* programObject, const Layer& layer, + const TileIndex& tileIndex, int pileSize); /** * Binds this object with GLSL variables with identifiers starting * with nameBase within the provided shader program. * After this method has been called, users may invoke setValue. */ - virtual void bind(ProgramObject* programObject, const Layer& layer, - const std::string& nameBase, int pileSize); + virtual void bind(ghoul::opengl::ProgramObject* programObject, const Layer& layer, + const std::string& nameBase, int pileSize); /** * Deactivates any TextureUnits assigned by this object. diff --git a/modules/globebrowsing/rendering/gpu/gpulayergroup.cpp b/modules/globebrowsing/rendering/gpu/gpulayergroup.cpp index 0a14a317b5..f18d21e52c 100644 --- a/modules/globebrowsing/rendering/gpu/gpulayergroup.cpp +++ b/modules/globebrowsing/rendering/gpu/gpulayergroup.cpp @@ -31,16 +31,16 @@ namespace openspace { namespace globebrowsing { -void GPULayerGroup::setValue(ProgramObject* programObject, const LayerGroup& layerGroup, - const TileIndex& tileIndex) +void GPULayerGroup::setValue(ghoul::opengl::ProgramObject* programObject, + const LayerGroup& layerGroup, const TileIndex& tileIndex) { auto& activeLayers = layerGroup.activeLayers(); ghoul_assert( - activeLayers.size() == gpuActiveLayers.size(), + activeLayers.size() == _gpuActiveLayers.size(), "GPU and CPU active layers must have same size!" ); for (int i = 0; i < activeLayers.size(); ++i) { - gpuActiveLayers[i]->setValue( + _gpuActiveLayers[i]->setValue( programObject, *activeLayers[i], tileIndex, @@ -49,19 +49,20 @@ void GPULayerGroup::setValue(ProgramObject* programObject, const LayerGroup& lay } } -void GPULayerGroup::bind(ProgramObject* programObject, const LayerGroup& layerGroup, - const std::string& nameBase, int category) +void GPULayerGroup::bind(ghoul::opengl::ProgramObject* programObject, + const LayerGroup& layerGroup, const std::string& nameBase, + int category) { auto activeLayers = layerGroup.activeLayers(); - gpuActiveLayers.resize(activeLayers.size()); + _gpuActiveLayers.resize(activeLayers.size()); int pileSize = layerGroup.pileSize(); - for (size_t i = 0; i < gpuActiveLayers.size(); ++i) { + for (size_t i = 0; i < _gpuActiveLayers.size(); ++i) { // should maybe a proper GPULayer factory - gpuActiveLayers[i] = (category == LayerManager::HeightLayers) ? + _gpuActiveLayers[i] = (category == LayerManager::HeightLayers) ? std::make_unique() : std::make_unique(); std::string nameExtension = "[" + std::to_string(i) + "]."; - gpuActiveLayers[i]->bind( + _gpuActiveLayers[i]->bind( programObject, *activeLayers[i], nameBase + nameExtension, @@ -71,8 +72,8 @@ void GPULayerGroup::bind(ProgramObject* programObject, const LayerGroup& layerGr } void GPULayerGroup::deactivate() { - for (size_t i = 0; i < gpuActiveLayers.size(); ++i) { - gpuActiveLayers[i]->deactivate(); + for (std::unique_ptr& l : _gpuActiveLayers) { + l->deactivate(); } } diff --git a/modules/globebrowsing/rendering/gpu/gpulayergroup.h b/modules/globebrowsing/rendering/gpu/gpulayergroup.h index 8d93755b3f..753cd6a6e5 100644 --- a/modules/globebrowsing/rendering/gpu/gpulayergroup.h +++ b/modules/globebrowsing/rendering/gpu/gpulayergroup.h @@ -59,16 +59,16 @@ public: * GPU struct. OBS! Users must ensure bind has been * called before setting using this method. */ - virtual void setValue(ProgramObject* programObject, const LayerGroup& layerGroup, - const TileIndex& tileIndex); + virtual void setValue(ghoul::opengl::ProgramObject* programObject, + const LayerGroup& layerGroup, const TileIndex& tileIndex); /** * Binds this object with GLSL variables with identifiers starting * with nameBase within the provided shader program. * After this method has been called, users may invoke setValue. */ - virtual void bind(ProgramObject* programObject, const LayerGroup& layerGroup, - const std::string& nameBase, int category); + virtual void bind(ghoul::opengl::ProgramObject* programObject, + const LayerGroup& layerGroup, const std::string& nameBase, int category); /** * Deactivates any TextureUnits assigned by this object. @@ -77,7 +77,7 @@ public: virtual void deactivate(); private: - std::vector> gpuActiveLayers; + std::vector> _gpuActiveLayers; }; } // namespace globebrowsing diff --git a/modules/globebrowsing/rendering/gpu/gpulayermanager.cpp b/modules/globebrowsing/rendering/gpu/gpulayermanager.cpp index ab68ae2bec..0f908031a6 100644 --- a/modules/globebrowsing/rendering/gpu/gpulayermanager.cpp +++ b/modules/globebrowsing/rendering/gpu/gpulayermanager.cpp @@ -29,35 +29,36 @@ namespace openspace { namespace globebrowsing { -void GPULayerManager::setValue(ProgramObject* programObject, +void GPULayerManager::setValue(ghoul::opengl::ProgramObject* programObject, const LayerManager& layerManager, const TileIndex& tileIndex) { auto layerGroups = layerManager.layerGroups(); for (size_t i = 0; i < layerGroups.size(); ++i) { - gpuLayerGroups[i]->setValue(programObject, *layerGroups[i], tileIndex); + _gpuLayerGroups[i]->setValue(programObject, *layerGroups[i], tileIndex); } } -void GPULayerManager::bind(ProgramObject* programObject, const LayerManager& layerManager) +void GPULayerManager::bind(ghoul::opengl::ProgramObject* programObject, + const LayerManager& layerManager) { auto layerGroups = layerManager.layerGroups(); - if (gpuLayerGroups.size() != layerGroups.size()) { - gpuLayerGroups.resize(layerGroups.size()); - for (auto& gpuLayerGroup : gpuLayerGroups){ + if (_gpuLayerGroups.size() != layerGroups.size()) { + _gpuLayerGroups.resize(layerGroups.size()); + for (auto& gpuLayerGroup : _gpuLayerGroups){ gpuLayerGroup = std::make_unique(); } } for (size_t i = 0; i < layerGroups.size(); ++i) { std::string nameBase = LayerManager::LAYER_GROUP_NAMES[i]; - gpuLayerGroups[i]->bind(programObject, *layerGroups[i], nameBase, i); + _gpuLayerGroups[i]->bind(programObject, *layerGroups[i], nameBase, i); } } void GPULayerManager::deactivate() { - for (size_t i = 0; i < gpuLayerGroups.size(); ++i) { - gpuLayerGroups[i]->deactivate(); + for (std::unique_ptr& l : _gpuLayerGroups) { + l->deactivate(); } } diff --git a/modules/globebrowsing/rendering/gpu/gpulayermanager.h b/modules/globebrowsing/rendering/gpu/gpulayermanager.h index 6da1c15160..ee065e8f2f 100644 --- a/modules/globebrowsing/rendering/gpu/gpulayermanager.h +++ b/modules/globebrowsing/rendering/gpu/gpulayermanager.h @@ -49,15 +49,16 @@ public: * GPU struct. OBS! Users must ensure bind has been * called before setting using this method. */ - virtual void setValue(ProgramObject* programObject, const LayerManager& layerManager, - const TileIndex& tileIndex); + virtual void setValue(ghoul::opengl::ProgramObject* programObject, + const LayerManager& layerManager, const TileIndex& tileIndex); /** * Binds this object with GLSL variables with identifiers starting * with nameBase within the provided shader program. * After this method has been called, users may invoke setValue. */ - virtual void bind(ProgramObject* programObject, const LayerManager& layerManager); + virtual void bind(ghoul::opengl::ProgramObject* programObject, + const LayerManager& layerManager); /** * Deactivates any TextureUnits assigned by this object. @@ -66,7 +67,7 @@ public: virtual void deactivate(); private: - std::vector> gpuLayerGroups; + std::vector> _gpuLayerGroups; }; } // namespace globebrowsing diff --git a/modules/globebrowsing/rendering/gpu/gpulayerrendersettings.cpp b/modules/globebrowsing/rendering/gpu/gpulayerrendersettings.cpp index 6edbabb209..f849df1c20 100644 --- a/modules/globebrowsing/rendering/gpu/gpulayerrendersettings.cpp +++ b/modules/globebrowsing/rendering/gpu/gpulayerrendersettings.cpp @@ -29,7 +29,7 @@ namespace openspace { namespace globebrowsing { -void GPULayerRenderSettings::setValue(ProgramObject* programObject, +void GPULayerRenderSettings::setValue(ghoul::opengl::ProgramObject* programObject, const LayerRenderSettings& layerSettings) { gpuOpacity.setValue(programObject, layerSettings.opacity.value()); @@ -37,7 +37,7 @@ void GPULayerRenderSettings::setValue(ProgramObject* programObject, gpuMultiplier.setValue(programObject, layerSettings.multiplier.value()); } -void GPULayerRenderSettings::bind(ProgramObject* programObject, +void GPULayerRenderSettings::bind(ghoul::opengl::ProgramObject* programObject, const std::string& nameBase) { gpuOpacity.bind(programObject, nameBase + "opacity"); diff --git a/modules/globebrowsing/rendering/gpu/gpulayerrendersettings.h b/modules/globebrowsing/rendering/gpu/gpulayerrendersettings.h index deee12bbc6..53ba536b42 100644 --- a/modules/globebrowsing/rendering/gpu/gpulayerrendersettings.h +++ b/modules/globebrowsing/rendering/gpu/gpulayerrendersettings.h @@ -48,14 +48,15 @@ public: * GPU struct. OBS! Users must ensure bind has been * called before setting using this method. */ - void setValue(ProgramObject* programObject, const LayerRenderSettings& layerSettings); + void setValue(ghoul::opengl::ProgramObject* programObject, + const LayerRenderSettings& layerSettings); /** * Binds this object with GLSL variables with identifiers starting * with nameBase within the provided shader program. * After this method has been called, users may invoke setValue. */ - void bind(ProgramObject* programObject, const std::string& nameBase); + void bind(ghoul::opengl::ProgramObject* programObject, const std::string& nameBase); private: GPUData gpuOpacity; diff --git a/modules/globebrowsing/rendering/gpu/gputiledepthtransform.cpp b/modules/globebrowsing/rendering/gpu/gputiledepthtransform.cpp index 9ae18d0191..deb14fabc7 100644 --- a/modules/globebrowsing/rendering/gpu/gputiledepthtransform.cpp +++ b/modules/globebrowsing/rendering/gpu/gputiledepthtransform.cpp @@ -29,18 +29,18 @@ namespace openspace { namespace globebrowsing { -void GPUTileDepthTransform::setValue(ProgramObject* programObject, +void GPUTileDepthTransform::setValue(ghoul::opengl::ProgramObject* programObject, const TileDepthTransform& depthTransform) { - gpuDepthOffset.setValue(programObject, depthTransform.depthOffset); - gpuDepthScale.setValue(programObject, depthTransform.depthScale); + _gpuDepthOffset.setValue(programObject, depthTransform.depthOffset); + _gpuDepthScale.setValue(programObject, depthTransform.depthScale); } -void GPUTileDepthTransform::bind(ProgramObject* programObject, +void GPUTileDepthTransform::bind(ghoul::opengl::ProgramObject* programObject, const std::string& nameBase) { - gpuDepthOffset.bind(programObject, nameBase + "depthOffset"); - gpuDepthScale.bind(programObject, nameBase + "depthScale"); + _gpuDepthOffset.bind(programObject, nameBase + "depthOffset"); + _gpuDepthScale.bind(programObject, nameBase + "depthScale"); } } // namespace globebrowsing diff --git a/modules/globebrowsing/rendering/gpu/gputiledepthtransform.h b/modules/globebrowsing/rendering/gpu/gputiledepthtransform.h index 8f1c943cc1..4e16940280 100644 --- a/modules/globebrowsing/rendering/gpu/gputiledepthtransform.h +++ b/modules/globebrowsing/rendering/gpu/gputiledepthtransform.h @@ -48,18 +48,20 @@ public: * GPU struct. OBS! Users must ensure bind has been * called before setting using this method. */ - void setValue(ProgramObject* programObject, const TileDepthTransform& depthTransform); + void setValue(ghoul::opengl::ProgramObject* programObject, + const TileDepthTransform& depthTransform); /** * Binds GLSL variables with identifiers starting with * nameBase within the provided shader program with this object. * After this method has been called, users may invoke setValue. */ - void bind(ProgramObject* programObject, const std::string& nameBase); + void bind(ghoul::opengl::ProgramObject* programObject, + const std::string& nameBase); private: - GPUData gpuDepthOffset; - GPUData gpuDepthScale; + GPUData _gpuDepthOffset; + GPUData _gpuDepthScale; }; } // namespace globebrowsing diff --git a/modules/globebrowsing/rendering/gpu/gputileuvtransform.cpp b/modules/globebrowsing/rendering/gpu/gputileuvtransform.cpp index ab9e3cd51d..477b02b75b 100644 --- a/modules/globebrowsing/rendering/gpu/gputileuvtransform.cpp +++ b/modules/globebrowsing/rendering/gpu/gputileuvtransform.cpp @@ -33,16 +33,18 @@ namespace openspace { namespace globebrowsing { -void GPUTileUvTransform::setValue(ProgramObject* programObject, +void GPUTileUvTransform::setValue(ghoul::opengl::ProgramObject* programObject, const TileUvTransform& tileUvTransform) { - gpuUvOffset.setValue(programObject, tileUvTransform.uvOffset); - gpuUvScale.setValue(programObject, tileUvTransform.uvScale); + _gpuUvOffset.setValue(programObject, tileUvTransform.uvOffset); + _gpuUvScale.setValue(programObject, tileUvTransform.uvScale); } -void GPUTileUvTransform::bind(ProgramObject* programObject, const std::string& nameBase) { - gpuUvOffset.bind(programObject, nameBase + "uvOffset"); - gpuUvScale.bind(programObject, nameBase + "uvScale"); +void GPUTileUvTransform::bind(ghoul::opengl::ProgramObject* programObject, + const std::string& nameBase) +{ + _gpuUvOffset.bind(programObject, nameBase + "uvOffset"); + _gpuUvScale.bind(programObject, nameBase + "uvScale"); } } // namespace globebrowsing diff --git a/modules/globebrowsing/rendering/gpu/gputileuvtransform.h b/modules/globebrowsing/rendering/gpu/gputileuvtransform.h index df7b838e17..066eebfc47 100644 --- a/modules/globebrowsing/rendering/gpu/gputileuvtransform.h +++ b/modules/globebrowsing/rendering/gpu/gputileuvtransform.h @@ -48,18 +48,20 @@ public: * GPU struct. OBS! Users must ensure bind has been * called before setting using this method. */ - void setValue(ProgramObject* programObject, const TileUvTransform& uvTransform); + void setValue(ghoul::opengl::ProgramObject* programObject, + const TileUvTransform& uvTransform); /** * Binds GLSL variables with identifiers starting with * nameBase within the provided shader program with this object. * After this method has been called, users may invoke setValue. */ - void bind(ProgramObject* programObject, const std::string& nameBase); + void bind(ghoul::opengl::ProgramObject* programObject, + const std::string& nameBase); private: - GPUData gpuUvOffset; - GPUData gpuUvScale; + GPUData _gpuUvOffset; + GPUData _gpuUvScale; }; } // namespace globebrowsing diff --git a/modules/globebrowsing/tile/tileprovider/singleimageprovider.cpp b/modules/globebrowsing/tile/tileprovider/singleimageprovider.cpp index 5157f60072..a2beeb5fe9 100644 --- a/modules/globebrowsing/tile/tileprovider/singleimageprovider.cpp +++ b/modules/globebrowsing/tile/tileprovider/singleimageprovider.cpp @@ -76,7 +76,9 @@ void SingleImageProvider::update() { void SingleImageProvider::reset() { _tile = Tile(); - _tile.texture = std::shared_ptr(ghoul::io::TextureReader::ref().loadTexture(_imagePath).release()); + _tile.texture = std::shared_ptr( + std::move(ghoul::io::TextureReader::ref().loadTexture(_imagePath)) + ); _tile.status = _tile.texture != nullptr ? Tile::Status::OK : Tile::Status::IOError; _tile.metaData = nullptr; diff --git a/modules/globebrowsing/tile/tileprovider/singleimageprovider.h b/modules/globebrowsing/tile/tileprovider/singleimageprovider.h index 0f79d4ace9..eacf9d63d8 100644 --- a/modules/globebrowsing/tile/tileprovider/singleimageprovider.h +++ b/modules/globebrowsing/tile/tileprovider/singleimageprovider.h @@ -31,8 +31,6 @@ namespace openspace { namespace globebrowsing { namespace tileprovider { -using namespace ghoul::opengl; - class SingleImageProvider : public TileProvider { public: SingleImageProvider(const ghoul::Dictionary& dictionary); diff --git a/src/util/gpudata.cpp b/src/util/gpudata.cpp index be4d438942..b362bb2dc6 100644 --- a/src/util/gpudata.cpp +++ b/src/util/gpudata.cpp @@ -28,7 +28,8 @@ namespace openspace { -void UniformLocation::bind(ProgramObject* program, const std::string& name){ +void UniformLocation::bind(ghoul::opengl::ProgramObject* program, const std::string& name) +{ _uniformLocation = program->uniformLocation(name); } diff --git a/support/coding/check_style_guide.py b/support/coding/check_style_guide.py index aed2d9720f..ead3bb69dc 100644 --- a/support/coding/check_style_guide.py +++ b/support/coding/check_style_guide.py @@ -240,6 +240,14 @@ def check_core_dependency(lines, component): else: return '' +def check_using_namespace(lines): + index = [i for i,s in enumerate(lines) if "using namespace" in s.strip()] + + if len(index) > 0: + return lines[index[0]] + else: + return '' + previousSymbols = {} def check_header_file(file, component): @@ -300,7 +308,11 @@ def check_header_file(file, component): core_dependency = check_core_dependency(lines, component) if core_dependency: - print(file, '\t' 'Wrong core dependency', core_dependency) + print(file, '\t', 'Wrong dependency (core depends on module)', core_dependency) + + using_namespaces = check_using_namespace(lines) + if using_namespaces: + print(file, '\t', 'Using namespace found in header file') def check_source_file(file, component): From 3274882ec2de312ebf0c23230ad23a8a1219f724 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Wed, 1 Mar 2017 21:17:12 -0500 Subject: [PATCH 57/96] Add checks for inline files in style checker --- ext/ghoul | 2 +- include/openspace/documentation/verifier.inl | 48 +++++--------------- include/openspace/util/factorymanager.inl | 2 +- support/coding/check_style_guide.py | 42 ++++++++++++++++- 4 files changed, 55 insertions(+), 39 deletions(-) diff --git a/ext/ghoul b/ext/ghoul index 9a28e8b4a9..7279b3eb92 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 9a28e8b4a9135af6104a4c62950f47c364fc3411 +Subproject commit 7279b3eb924d1d90bf4dfa46e2f44a9a6f3a90a5 diff --git a/include/openspace/documentation/verifier.inl b/include/openspace/documentation/verifier.inl index 06228a7622..7256f9473a 100644 --- a/include/openspace/documentation/verifier.inl +++ b/include/openspace/documentation/verifier.inl @@ -57,86 +57,62 @@ std::string TemplateVerifier::documentation() const { template std::string Vector2Verifier::type() const { - using namespace std::string_literals; - - return "Vector2<"s + typeid(T).name() + ">"; + return std::string("Vector2<") + typeid(T).name() + ">"; } template std::string Vector3Verifier::type() const { - using namespace std::string_literals; - - return "Vector3<"s + typeid(T).name() + ">"; + return std::string("Vector3<") + typeid(T).name() + ">"; } template std::string Vector4Verifier::type() const { - using namespace std::string_literals; - - return "Vector4<"s + typeid(T).name() + ">"; + return std::string("Vector4<") + typeid(T).name() + ">"; } template std::string Matrix2x2Verifier::type() const { - using namespace std::string_literals; - - return "Matrix2x2<"s + typeid(T).name() + ">"; + return std::string("Matrix2x2<") + typeid(T).name() + ">"; } template std::string Matrix2x3Verifier::type() const { - using namespace std::string_literals; - - return "Matrix2x3<"s + typeid(T).name() + ">"; + return std::string("Matrix2x3<") + typeid(T).name() + ">"; } template std::string Matrix2x4Verifier::type() const { - using namespace std::string_literals; - - return "Matrix2x4<"s + typeid(T).name() + ">"; + return std::string("Matrix2x4<") + typeid(T).name() + ">"; } template std::string Matrix3x2Verifier::type() const { - using namespace std::string_literals; - - return "Matrix3x2<"s + typeid(T).name() + ">"; + return std::string("Matrix3x2<") + typeid(T).name() + ">"; } template std::string Matrix3x3Verifier::type() const { - using namespace std::string_literals; - - return "Matrix3x3<"s + typeid(T).name() + ">"; + return std::string("Matrix3x3<") + typeid(T).name() + ">"; } template std::string Matrix3x4Verifier::type() const { - using namespace std::string_literals; - - return "Matrix3x4<"s + typeid(T).name() + ">"; + return std::string("Matrix3x4<") + typeid(T).name() + ">"; } template std::string Matrix4x2Verifier::type() const { - using namespace std::string_literals; - - return "Matrix4x2<"s + typeid(T).name() + ">"; + return std::string("Matrix4x2<") + typeid(T).name() + ">"; } template std::string Matrix4x3Verifier::type() const { - using namespace std::string_literals; - - return "Matrix4x3<"s + typeid(T).name() + ">"; + return std::string("Matrix4x3<") + typeid(T).name() + ">"; } template std::string Matrix4x4Verifier::type() const { - using namespace std::string_literals; - - return "Matrix4x4<"s + typeid(T).name() + ">"; + return std::string("Matrix4x4<") + typeid(T).name() + ">"; } template diff --git a/include/openspace/util/factorymanager.inl b/include/openspace/util/factorymanager.inl index dde01bcef5..56034150b8 100644 --- a/include/openspace/util/factorymanager.inl +++ b/include/openspace/util/factorymanager.inl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014 * + * 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 * diff --git a/support/coding/check_style_guide.py b/support/coding/check_style_guide.py index ead3bb69dc..a64ba1b200 100644 --- a/support/coding/check_style_guide.py +++ b/support/coding/check_style_guide.py @@ -314,6 +314,31 @@ def check_header_file(file, component): if using_namespaces: print(file, '\t', 'Using namespace found in header file') +def check_inline_file(file, component): + with open(file, 'r+') as f: + lines = f.readlines() + + copyright = check_copyright(lines) + if copyright: + print(file, '\t', 'Copyright check failed', '\t', copyright) + return + + header = check_glm_header(lines, file) + if header: + print(file, '\t', 'Illegal glm header include', header) + return + + core_dependency = check_core_dependency(lines, component) + if core_dependency: + print(file, '\t', 'Wrong dependency (core depends on module)', core_dependency) + + if (not '_doc.inl' in file): + # The _doc.inl files are allowed to use using namespace as they are inclued + # from the cpp files and thus don't leak it + using_namespaces = check_using_namespace(lines) + if using_namespaces: + print(file, '\t', 'Using namespace found in inline file') + def check_source_file(file, component): with open(file, 'r+') as f: @@ -352,12 +377,27 @@ basePath = './' if len(sys.argv) > 1: basePath = sys.argv[1] + '/' +# Check header files +print("Checking header files") +print("=====================") check_files(basePath + 'include/**/*.h', '', 'openspace_core', check_header_file) check_files(basePath + 'apps/**/*.h', basePath + 'apps/**/ext/**/*.h', 'openspace_app', check_header_file) check_files(basePath + 'modules/**/*.h', basePath + 'modules/**/ext/**/*.h', 'openspace_module', check_header_file) check_files(basePath + 'ext/ghoul/include/**/*.h', '', 'ghoul', check_header_file) +print("") +print("Checking inline files") +print("=====================") +check_files(basePath + 'include/**/*.inl', '', 'openspace_core', check_inline_file) +check_files(basePath + 'src/**/*.inl', '', 'openspace_core', check_inline_file) +check_files(basePath + 'apps/**/*.inl', basePath + 'apps/**/ext/**/*.h', 'openspace_app', check_inline_file) +check_files(basePath + 'modules/**/*.inl', basePath + 'modules/**/ext/**/*.h', 'openspace_module', check_inline_file) +check_files(basePath + 'ext/ghoul/include/**/*.inl', '', 'ghoul', check_inline_file) +print("") + +print("Checking source files") +print("=====================") check_files(basePath + 'src/**/*.cpp', '', 'openspace_core', check_source_file) check_files(basePath + 'apps/**/*.cpp', basePath + 'apps/**/ext/**/*.cpp', 'openspace_app', check_source_file) check_files(basePath + 'modules/**/*.cpp', basePath + 'modules/**/ext/**/*.cpp', 'openspace_module', check_source_file) -check_files(basePath + 'ext/ghoul/include/**/*.cpp', '', 'ghoul', check_source_file) +check_files(basePath + 'ext/ghoul/src/**/*.cpp', '', 'ghoul', check_source_file) From 2b07cf8c05a027e8d27b539b7a38a48cdb60e94a Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Wed, 1 Mar 2017 21:19:27 -0500 Subject: [PATCH 58/96] Add check for correct indenting of copyright header --- support/coding/check_style_guide.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/support/coding/check_style_guide.py b/support/coding/check_style_guide.py index a64ba1b200..c8b6bb2604 100644 --- a/support/coding/check_style_guide.py +++ b/support/coding/check_style_guide.py @@ -166,8 +166,11 @@ def check_copyright(lines): if year != current_year: return 'Out of date copyright notice ' + year + ' || ' + current_year - else: - return '' + + if lines[index[0] + 1][0] != ' ': + return 'Copyright header is not correctly indented' + + return '' From 2f2fa3b03124e2b26edad59ae03f85386629487d Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Wed, 1 Mar 2017 22:03:48 -0500 Subject: [PATCH 59/96] Update Ghoul repository to have the factory return unique_ptrs Adjust accordingly --- ext/ghoul | 2 +- include/openspace/rendering/renderable.h | 2 +- include/openspace/rendering/screenspacerenderable.h | 4 +++- include/openspace/scene/rotation.h | 4 +++- include/openspace/scene/scale.h | 2 +- include/openspace/scene/scenegraphnode.h | 4 ++-- include/openspace/scene/translation.h | 4 +++- modules/base/rendering/modelgeometry.cpp | 6 ++++-- modules/base/rendering/modelgeometry.h | 4 +++- modules/base/rendering/renderablemodel.cpp | 3 +-- modules/base/rendering/renderablemodel.h | 4 +++- .../globebrowsing/tile/tileprovider/tileprovider.cpp | 4 ++-- .../globebrowsing/tile/tileprovider/tileprovider.h | 2 +- .../tile/tileprovider/tileproviderbyindex.cpp | 10 +++++----- .../tile/tileprovider/tileproviderbylevel.cpp | 7 ++++--- modules/newhorizons/util/decoder.cpp | 4 ++-- modules/space/rendering/planetgeometry.cpp | 4 ++-- modules/space/rendering/planetgeometry.h | 4 +++- modules/space/rendering/renderableplanet.cpp | 4 ++-- modules/space/rendering/renderableplanet.h | 5 +++-- src/rendering/renderable.cpp | 6 ++++-- src/rendering/screenspacerenderable.cpp | 7 +++---- src/scene/rotation.cpp | 4 ++-- src/scene/scale.cpp | 4 ++-- src/scene/scenegraphnode.cpp | 11 +++++------ src/scene/translation.cpp | 6 ++++-- 26 files changed, 69 insertions(+), 52 deletions(-) diff --git a/ext/ghoul b/ext/ghoul index 7279b3eb92..abf36fd08d 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 7279b3eb924d1d90bf4dfa46e2f44a9a6f3a90a5 +Subproject commit abf36fd08d2405ccede17ff1c90d0a0c21b0a162 diff --git a/include/openspace/rendering/renderable.h b/include/openspace/rendering/renderable.h index ba11cec5f0..c4b1e731c2 100644 --- a/include/openspace/rendering/renderable.h +++ b/include/openspace/rendering/renderable.h @@ -59,7 +59,7 @@ public: Overlay = 8 }; - static Renderable* createFromDictionary(const ghoul::Dictionary& dictionary); + static std::unique_ptr createFromDictionary(const ghoul::Dictionary& dictionary); // constructors & destructor Renderable(); diff --git a/include/openspace/rendering/screenspacerenderable.h b/include/openspace/rendering/screenspacerenderable.h index 74eff1eaf5..bd9b4ebafc 100644 --- a/include/openspace/rendering/screenspacerenderable.h +++ b/include/openspace/rendering/screenspacerenderable.h @@ -36,6 +36,8 @@ #include #include +#include + namespace openspace { namespace documentation { struct Documentation; } @@ -49,7 +51,7 @@ namespace documentation { struct Documentation; } */ class ScreenSpaceRenderable : public properties::PropertyOwner { public: - static ScreenSpaceRenderable* createFromDictionary( + static std::unique_ptr createFromDictionary( const ghoul::Dictionary& dictionary); ScreenSpaceRenderable(const ghoul::Dictionary& dictionary); diff --git a/include/openspace/scene/rotation.h b/include/openspace/scene/rotation.h index be0dcdfca0..140f95d9df 100644 --- a/include/openspace/scene/rotation.h +++ b/include/openspace/scene/rotation.h @@ -29,6 +29,8 @@ #include +#include + namespace ghoul { class Dictionary; } namespace openspace { @@ -37,7 +39,7 @@ namespace documentation { struct Documentation; } class Rotation : public properties::PropertyOwner { public: - static Rotation* createFromDictionary(const ghoul::Dictionary& dictionary); + static std::unique_ptr createFromDictionary(const ghoul::Dictionary& dictionary); Rotation(const ghoul::Dictionary& dictionary); virtual ~Rotation(); diff --git a/include/openspace/scene/scale.h b/include/openspace/scene/scale.h index c272f3c3a9..8b80ed18f2 100644 --- a/include/openspace/scene/scale.h +++ b/include/openspace/scene/scale.h @@ -36,7 +36,7 @@ namespace documentation { struct Documentation; }; class Scale : public properties::PropertyOwner { public: - static Scale* createFromDictionary(const ghoul::Dictionary& dictionary); + static std::unique_ptr createFromDictionary(const ghoul::Dictionary& dictionary); virtual ~Scale(); virtual bool initialize(); diff --git a/include/openspace/scene/scenegraphnode.h b/include/openspace/scene/scenegraphnode.h index 092b04955c..1acce2442e 100644 --- a/include/openspace/scene/scenegraphnode.h +++ b/include/openspace/scene/scenegraphnode.h @@ -97,7 +97,7 @@ public: const PerformanceRecord& performanceRecord() const { return _performanceRecord; } - void setRenderable(Renderable* renderable); + void setRenderable(std::unique_ptr renderable); const Renderable* renderable() const; Renderable* renderable(); @@ -115,7 +115,7 @@ private: PerformanceRecord _performanceRecord; - Renderable* _renderable; + std::unique_ptr _renderable; bool _renderableVisible; bool _boundingSphereVisible; diff --git a/include/openspace/scene/translation.h b/include/openspace/scene/translation.h index 4337f12035..4e3a631f7c 100644 --- a/include/openspace/scene/translation.h +++ b/include/openspace/scene/translation.h @@ -29,6 +29,8 @@ #include +#include + namespace ghoul { class Dictionary; } namespace openspace { @@ -37,7 +39,7 @@ namespace documentation { struct Documentation; } class Translation : public properties::PropertyOwner { public: - static Translation* createFromDictionary(const ghoul::Dictionary& dictionary); + static std::unique_ptr createFromDictionary(const ghoul::Dictionary& dictionary); virtual ~Translation(); virtual bool initialize(); diff --git a/modules/base/rendering/modelgeometry.cpp b/modules/base/rendering/modelgeometry.cpp index 55463821d0..8ca084be67 100644 --- a/modules/base/rendering/modelgeometry.cpp +++ b/modules/base/rendering/modelgeometry.cpp @@ -68,7 +68,9 @@ documentation:: Documentation ModelGeometry::Documentation() { } -ModelGeometry* ModelGeometry::createFromDictionary(const ghoul::Dictionary& dictionary) { +std::unique_ptr ModelGeometry::createFromDictionary( + const ghoul::Dictionary& dictionary) +{ if (!dictionary.hasKeyAndValue(keyType)) { throw ghoul::RuntimeError("Dictionary did not contain a key 'Type'"); } @@ -76,7 +78,7 @@ ModelGeometry* ModelGeometry::createFromDictionary(const ghoul::Dictionary& dict std::string geometryType = dictionary.value(keyType); auto factory = FactoryManager::ref().factory(); - ModelGeometry* result = factory->create(geometryType, dictionary); + std::unique_ptr result = factory->create(geometryType, dictionary); if (result == nullptr) { throw ghoul::RuntimeError( "Failed to create a ModelGeometry object of type '" + geometryType + "'" diff --git a/modules/base/rendering/modelgeometry.h b/modules/base/rendering/modelgeometry.h index e878eecf77..508b523101 100644 --- a/modules/base/rendering/modelgeometry.h +++ b/modules/base/rendering/modelgeometry.h @@ -38,7 +38,9 @@ namespace modelgeometry { class ModelGeometry : public properties::PropertyOwner { public: - static ModelGeometry* createFromDictionary(const ghoul::Dictionary& dictionary); + static std::unique_ptr createFromDictionary( + const ghoul::Dictionary& dictionary + ); struct Vertex { GLfloat location[4]; diff --git a/modules/base/rendering/renderablemodel.cpp b/modules/base/rendering/renderablemodel.cpp index 7ce5288317..1adca3f960 100644 --- a/modules/base/rendering/renderablemodel.cpp +++ b/modules/base/rendering/renderablemodel.cpp @@ -85,7 +85,7 @@ RenderableModel::RenderableModel(const ghoul::Dictionary& dictionary) if (success) _colorTexturePath = absPath(texturePath); - addPropertySubOwner(_geometry); + addPropertySubOwner(_geometry.get()); addProperty(_colorTexturePath); _colorTexturePath.onChange(std::bind(&RenderableModel::loadTexture, this)); @@ -153,7 +153,6 @@ bool RenderableModel::initialize() { bool RenderableModel::deinitialize() { if (_geometry) { _geometry->deinitialize(); - delete _geometry; _geometry = nullptr; } _texture = nullptr; diff --git a/modules/base/rendering/renderablemodel.h b/modules/base/rendering/renderablemodel.h index c885b8dd84..153964d60a 100644 --- a/modules/base/rendering/renderablemodel.h +++ b/modules/base/rendering/renderablemodel.h @@ -36,6 +36,8 @@ #include #include +#include + namespace openspace { namespace modelgeometry { @@ -65,7 +67,7 @@ private: std::unique_ptr _programObject; std::unique_ptr _texture; - modelgeometry::ModelGeometry* _geometry; + std::unique_ptr _geometry; glm::dmat3 _modelTransform; diff --git a/modules/globebrowsing/tile/tileprovider/tileprovider.cpp b/modules/globebrowsing/tile/tileprovider/tileprovider.cpp index f1a3ee74d5..bf44816fe3 100644 --- a/modules/globebrowsing/tile/tileprovider/tileprovider.cpp +++ b/modules/globebrowsing/tile/tileprovider/tileprovider.cpp @@ -41,11 +41,11 @@ namespace openspace { namespace globebrowsing { namespace tileprovider { -TileProvider* TileProvider::createFromDictionary(const ghoul::Dictionary& dictionary) { +std::unique_ptr TileProvider::createFromDictionary(const ghoul::Dictionary& dictionary) { std::string type = "LRUCaching"; dictionary.getValue(KeyType, type); auto factory = FactoryManager::ref().factory(); - TileProvider* result = factory->create(type, dictionary); + std::unique_ptr result = factory->create(type, dictionary); if (result == nullptr) { LERROR("Failed creating TileProvider of type '" << type << "'"); diff --git a/modules/globebrowsing/tile/tileprovider/tileprovider.h b/modules/globebrowsing/tile/tileprovider/tileprovider.h index 9d26165b4d..2efc34b9bb 100644 --- a/modules/globebrowsing/tile/tileprovider/tileprovider.h +++ b/modules/globebrowsing/tile/tileprovider/tileprovider.h @@ -47,7 +47,7 @@ public: * define a key specifying what implementation of TileProvider * to be instantiated. */ - static TileProvider* createFromDictionary(const ghoul::Dictionary& dictionary); + static std::unique_ptr createFromDictionary(const ghoul::Dictionary& dictionary); /** * Empty default constructor diff --git a/modules/globebrowsing/tile/tileprovider/tileproviderbyindex.cpp b/modules/globebrowsing/tile/tileprovider/tileproviderbyindex.cpp index edebf63d74..b785d1c12f 100644 --- a/modules/globebrowsing/tile/tileprovider/tileproviderbyindex.cpp +++ b/modules/globebrowsing/tile/tileprovider/tileproviderbyindex.cpp @@ -43,11 +43,10 @@ TileProviderByIndex::TileProviderByIndex(const ghoul::Dictionary& dictionary) { ghoul::Dictionary defaultProviderDict = dictionary.value( KeyDefaultProvider ); - TileProvider* defaultProvider = TileProvider::createFromDictionary( + _defaultTileProvider = TileProvider::createFromDictionary( defaultProviderDict ); - _defaultTileProvider = std::shared_ptr(defaultProvider); - + ghoul::Dictionary indexProvidersDict = dictionary.value( KeyProviders ); @@ -64,8 +63,9 @@ TileProviderByIndex::TileProviderByIndex(const ghoul::Dictionary& dictionary) { ); TileIndex tileIndex(tileIndexDict); - TileProvider* tileProvider = TileProvider::createFromDictionary(providerDict); - std::shared_ptr stp = std::shared_ptr(tileProvider); + std::shared_ptr stp = TileProvider::createFromDictionary( + providerDict + ); TileIndex::TileHashKey key = tileIndex.hashKey(); _tileProviderMap.insert(std::make_pair(key, stp)); } diff --git a/modules/globebrowsing/tile/tileprovider/tileproviderbylevel.cpp b/modules/globebrowsing/tile/tileprovider/tileproviderbylevel.cpp index 37a56007f8..50553e8caa 100644 --- a/modules/globebrowsing/tile/tileprovider/tileproviderbylevel.cpp +++ b/modules/globebrowsing/tile/tileprovider/tileproviderbylevel.cpp @@ -61,9 +61,10 @@ TileProviderByLevel::TileProviderByLevel(const ghoul::Dictionary& dictionary) { ); } - TileProvider* tileProvider = TileProvider::createFromDictionary(providerDict); - _levelTileProviders.push_back(std::shared_ptr(tileProvider)); - + _levelTileProviders.push_back( + std::shared_ptr(TileProvider::createFromDictionary(providerDict)) + ); + // Ensure we can represent the max level if(_providerIndices.size() < maxLevel){ _providerIndices.resize(maxLevel+1, -1); diff --git a/modules/newhorizons/util/decoder.cpp b/modules/newhorizons/util/decoder.cpp index 58c23dc138..e820da47ba 100644 --- a/modules/newhorizons/util/decoder.cpp +++ b/modules/newhorizons/util/decoder.cpp @@ -35,7 +35,7 @@ std::unique_ptr Decoder::createFromDictionary( const ghoul::Dictionary& dictionary, const std::string& type) { ghoul::TemplateFactory* factory = FactoryManager::ref().factory(); - Decoder* result = factory->create(type, dictionary); + std::unique_ptr result = factory->create(type, dictionary); if (result == nullptr) { throw ghoul::RuntimeError( @@ -43,7 +43,7 @@ std::unique_ptr Decoder::createFromDictionary( "Decoder" ); } - return std::unique_ptr(result); + return result; } Decoder::~Decoder() {} diff --git a/modules/space/rendering/planetgeometry.cpp b/modules/space/rendering/planetgeometry.cpp index eb62be82bf..f847dc561c 100644 --- a/modules/space/rendering/planetgeometry.cpp +++ b/modules/space/rendering/planetgeometry.cpp @@ -53,7 +53,7 @@ documentation::Documentation PlanetGeometry::Documentation() { }; } -PlanetGeometry* PlanetGeometry::createFromDictionary(const ghoul::Dictionary& dictionary) +std::unique_ptr PlanetGeometry::createFromDictionary(const ghoul::Dictionary& dictionary) { documentation::testSpecificationAndThrow( Documentation(), @@ -64,7 +64,7 @@ PlanetGeometry* PlanetGeometry::createFromDictionary(const ghoul::Dictionary& di std::string geometryType = dictionary.value(KeyType); auto factory = FactoryManager::ref().factory(); - PlanetGeometry* result = factory->create(geometryType, dictionary); + std::unique_ptr result = factory->create(geometryType, dictionary); if (result == nullptr) { throw ghoul::RuntimeError( "Failed to create a PlanetGeometry object of type '" + geometryType + "'" diff --git a/modules/space/rendering/planetgeometry.h b/modules/space/rendering/planetgeometry.h index 6e495f882b..eae02b77d1 100644 --- a/modules/space/rendering/planetgeometry.h +++ b/modules/space/rendering/planetgeometry.h @@ -36,7 +36,9 @@ namespace planetgeometry { class PlanetGeometry : public properties::PropertyOwner { public: - static PlanetGeometry* createFromDictionary(const ghoul::Dictionary& dictionary); + static std::unique_ptr createFromDictionary( + const ghoul::Dictionary& dictionary + ); PlanetGeometry(); virtual ~PlanetGeometry(); diff --git a/modules/space/rendering/renderableplanet.cpp b/modules/space/rendering/renderableplanet.cpp index 2b860fb361..cceedf0122 100644 --- a/modules/space/rendering/renderableplanet.cpp +++ b/modules/space/rendering/renderableplanet.cpp @@ -125,7 +125,7 @@ RenderablePlanet::RenderablePlanet(const ghoul::Dictionary& dictionary) _heightMapTexturePath = absPath(heightMapTexturePath); } - addPropertySubOwner(_geometry); + addPropertySubOwner(_geometry.get()); addProperty(_colorTexturePath); _colorTexturePath.onChange(std::bind(&RenderablePlanet::loadTexture, this)); @@ -309,7 +309,7 @@ bool RenderablePlanet::initialize() { bool RenderablePlanet::deinitialize() { if(_geometry) { _geometry->deinitialize(); - delete _geometry; + _geometry = nullptr; } RenderEngine& renderEngine = OsEng.renderEngine(); diff --git a/modules/space/rendering/renderableplanet.h b/modules/space/rendering/renderableplanet.h index 9c2bd4d08a..88fd81b7ad 100644 --- a/modules/space/rendering/renderableplanet.h +++ b/modules/space/rendering/renderableplanet.h @@ -35,8 +35,9 @@ #include -#include +#include #include +#include namespace ghoul { namespace opengl { @@ -93,7 +94,7 @@ private: properties::FloatProperty _heightExaggeration; - planetgeometry::PlanetGeometry* _geometry; + std::unique_ptr _geometry; properties::BoolProperty _performShading; properties::IntProperty _rotation; float _alpha; diff --git a/src/rendering/renderable.cpp b/src/rendering/renderable.cpp index cf9fb6ac42..6795842a01 100644 --- a/src/rendering/renderable.cpp +++ b/src/rendering/renderable.cpp @@ -65,7 +65,9 @@ documentation::Documentation Renderable::Documentation() { }; } -Renderable* Renderable::createFromDictionary(const ghoul::Dictionary& dictionary) { +std::unique_ptr Renderable::createFromDictionary( + const ghoul::Dictionary& dictionary) +{ // The name is passed down from the SceneGraphNode std::string name; bool success = dictionary.getValue(SceneGraphNode::KeyName, name); @@ -76,7 +78,7 @@ Renderable* Renderable::createFromDictionary(const ghoul::Dictionary& dictionary std::string renderableType = dictionary.value(KeyType); auto factory = FactoryManager::ref().factory(); - Renderable* result = factory->create(renderableType, dictionary); + std::unique_ptr result = factory->create(renderableType, dictionary); if (result == nullptr) { LERROR("Failed to create a Renderable object of type '" << renderableType << "'"); return nullptr; diff --git a/src/rendering/screenspacerenderable.cpp b/src/rendering/screenspacerenderable.cpp index 1acaf704d6..23b0885dd9 100644 --- a/src/rendering/screenspacerenderable.cpp +++ b/src/rendering/screenspacerenderable.cpp @@ -73,8 +73,8 @@ documentation::Documentation ScreenSpaceRenderable::Documentation() { }; } -ScreenSpaceRenderable* ScreenSpaceRenderable::createFromDictionary( - const ghoul::Dictionary& dictionary) +std::unique_ptr ScreenSpaceRenderable::createFromDictionary( + const ghoul::Dictionary& dictionary) { documentation::testSpecificationAndThrow( Documentation(), @@ -85,7 +85,7 @@ ScreenSpaceRenderable* ScreenSpaceRenderable::createFromDictionary( std::string renderableType = dictionary.value(KeyType); auto factory = FactoryManager::ref().factory(); - ScreenSpaceRenderable* result = factory->create(renderableType, dictionary); + std::unique_ptr result = factory->create(renderableType, dictionary); if (result == nullptr) { LERROR("Failed to create a ScreenSpaceRenderable object of type '" << renderableType << "'" @@ -96,7 +96,6 @@ ScreenSpaceRenderable* ScreenSpaceRenderable::createFromDictionary( return result; } - ScreenSpaceRenderable::ScreenSpaceRenderable(const ghoul::Dictionary& dictionary) : _enabled("enabled", "Is Enabled", true) , _useFlatScreen("flatScreen", "Flat Screen", true) diff --git a/src/scene/rotation.cpp b/src/scene/rotation.cpp index c064cd96c4..2db6ee1068 100644 --- a/src/scene/rotation.cpp +++ b/src/scene/rotation.cpp @@ -58,12 +58,12 @@ documentation::Documentation Rotation::Documentation() { }; } -Rotation* Rotation::createFromDictionary(const ghoul::Dictionary& dictionary) { +std::unique_ptr Rotation::createFromDictionary(const ghoul::Dictionary& dictionary) { documentation::testSpecificationAndThrow(Documentation(), dictionary, "Rotation"); std::string rotationType = dictionary.value(KeyType); auto factory = FactoryManager::ref().factory(); - Rotation* result = factory->create(rotationType, dictionary); + std::unique_ptr result = factory->create(rotationType, dictionary); if (result == nullptr) { LERROR("Failed creating Rotation object of type '" << rotationType << "'"); return nullptr; diff --git a/src/scene/scale.cpp b/src/scene/scale.cpp index 9da2f23d4e..5f2e7dfccc 100644 --- a/src/scene/scale.cpp +++ b/src/scene/scale.cpp @@ -60,13 +60,13 @@ documentation::Documentation Scale::Documentation() { } -Scale* Scale::createFromDictionary(const ghoul::Dictionary& dictionary) { +std::unique_ptr Scale::createFromDictionary(const ghoul::Dictionary& dictionary) { documentation::testSpecificationAndThrow(Documentation(), dictionary, "Scale"); std::string scaleType = dictionary.value(KeyType); auto factory = FactoryManager::ref().factory(); - Scale* result = factory->create(scaleType, dictionary); + std::unique_ptr result = factory->create(scaleType, dictionary); result->setName("Scale"); if (result == nullptr) { LERROR("Failed creating Scale object of type '" << scaleType << "'"); diff --git a/src/scene/scenegraphnode.cpp b/src/scene/scenegraphnode.cpp index 8aaa29e3bd..d27c0164f9 100644 --- a/src/scene/scenegraphnode.cpp +++ b/src/scene/scenegraphnode.cpp @@ -90,7 +90,7 @@ SceneGraphNode* SceneGraphNode::createFromDictionary(const ghoul::Dictionary& di delete result; return nullptr; } - result->addPropertySubOwner(result->_renderable); + result->addPropertySubOwner(result->_renderable.get()); LDEBUG("Successfully created renderable for '" << result->name() << "'"); } @@ -186,7 +186,6 @@ bool SceneGraphNode::deinitialize() { if (_renderable) { _renderable->deinitialize(); - delete _renderable; _renderable = nullptr; } _children.clear(); @@ -499,17 +498,17 @@ PowerScaledScalar SceneGraphNode::boundingSphere() const{ } // renderable -void SceneGraphNode::setRenderable(Renderable* renderable) { - _renderable = renderable; +void SceneGraphNode::setRenderable(std::unique_ptr renderable) { + _renderable = std::move(renderable); } const Renderable* SceneGraphNode::renderable() const { - return _renderable; + return _renderable.get(); } Renderable* SceneGraphNode::renderable() { - return _renderable; + return _renderable.get(); } // private helper methods diff --git a/src/scene/translation.cpp b/src/scene/translation.cpp index 4452d566da..fd54a65e93 100644 --- a/src/scene/translation.cpp +++ b/src/scene/translation.cpp @@ -58,7 +58,9 @@ documentation::Documentation Translation::Documentation() { }; } -Translation* Translation::createFromDictionary(const ghoul::Dictionary& dictionary) { +std::unique_ptr Translation::createFromDictionary( + const ghoul::Dictionary& dictionary) +{ if (!dictionary.hasValue(KeyType)) { LERROR("Translation did not have key '" << KeyType << "'"); return nullptr; @@ -68,7 +70,7 @@ Translation* Translation::createFromDictionary(const ghoul::Dictionary& dictiona dictionary.getValue(KeyType, translationType); ghoul::TemplateFactory* factory = FactoryManager::ref().factory(); - Translation* result = factory->create(translationType, dictionary); + std::unique_ptr result = factory->create(translationType, dictionary); result->setName("Translation"); if (result == nullptr) { LERROR("Failed creating Translation object of type '" << translationType << "'"); From 6877fc41705095fbd3c1e882a122a857272eca02 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Wed, 1 Mar 2017 22:24:08 -0500 Subject: [PATCH 60/96] Add missing include in ImageSequencer --- modules/newhorizons/util/imagesequencer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/newhorizons/util/imagesequencer.cpp b/modules/newhorizons/util/imagesequencer.cpp index bf0b21dd0b..55c5b75245 100644 --- a/modules/newhorizons/util/imagesequencer.cpp +++ b/modules/newhorizons/util/imagesequencer.cpp @@ -33,9 +33,10 @@ #include #include -#include +#include #include #include +#include #include #include From 1225119a7df2ddfe937fe27f7a4a6e8189339074 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Wed, 1 Mar 2017 22:27:17 -0500 Subject: [PATCH 61/96] Add missing include in SequenceParser --- modules/newhorizons/util/sequenceparser.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/newhorizons/util/sequenceparser.cpp b/modules/newhorizons/util/sequenceparser.cpp index d147fed0fe..5254643707 100644 --- a/modules/newhorizons/util/sequenceparser.cpp +++ b/modules/newhorizons/util/sequenceparser.cpp @@ -29,6 +29,8 @@ #include +#include + namespace { const std::string _loggerCat = "SequenceParser"; const char* keyTranslation = "DataInputTranslation"; @@ -170,4 +172,4 @@ void SequenceParser::sendPlaybookInformation(const std::string& name) { OsEng.networkEngine().setInitialConnectionMessage(_messageIdentifier, buffer); } -} \ No newline at end of file +} From 99f265c1ed6126ba3d9df8b6b41a971dc9831950 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Wed, 1 Mar 2017 22:38:49 -0500 Subject: [PATCH 62/96] Update Ghoul repository --- ext/ghoul | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/ghoul b/ext/ghoul index abf36fd08d..636868af5e 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit abf36fd08d2405ccede17ff1c90d0a0c21b0a162 +Subproject commit 636868af5eb05b7b047dd1caf8dd850e794d44a9 From cb7e81cf3dd41e1175d1d31adfb355367dc9f957 Mon Sep 17 00:00:00 2001 From: Emil Axelsson Date: Mon, 24 Oct 2016 10:26:00 +0200 Subject: [PATCH 63/96] Add support for converting and rendering volumetric data in the cdf format. Replace DataConverter by a more general purpose TaskRunner. Conflicts: modules/volume/CMakeLists.txt modules/volume/linearlrucache.h src/engine/openspaceengine.cpp --- .../CMakeLists.txt | 12 +- apps/{DataConverter => TaskRunner}/main.cpp | 96 +++-- data/tasks/default.task | 3 + data/web/kameleondocumentation/main.hbs | 59 +++ data/web/kameleondocumentation/script.js | 23 ++ .../openspace/engine/configurationmanager.h | 2 + include/openspace/util/distanceconstants.h | 34 ++ include/openspace/util/task.h | 23 ++ include/openspace/util/taskloader.h | 17 + modules/galaxy/CMakeLists.txt | 3 + modules/galaxy/galaxymodule.cpp | 7 + .../galaxy/tasks}/milkywayconversiontask.cpp | 2 +- .../galaxy/tasks}/milkywayconversiontask.h | 4 +- .../tasks}/milkywaypointsconversiontask.cpp | 2 +- .../tasks}/milkywaypointsconversiontask.h | 4 +- modules/kameleonvolume/CMakeLists.txt | 49 +++ modules/kameleonvolume/include.cmake | 6 + .../kameleonvolume/kameleonvolumemodule.cpp | 58 +++ .../kameleonvolume/kameleonvolumemodule.h | 18 +- .../kameleonvolume/kameleonvolumereader.cpp | 188 ++++++++++ modules/kameleonvolume/kameleonvolumereader.h | 77 ++++ .../kameleonvolume/kameleonvolumereader.inl | 52 +++ .../rendering/kameleonvolumeraycaster.cpp | 142 ++++++++ .../rendering/kameleonvolumeraycaster.h | 89 +++++ .../rendering/renderablekameleonvolume.cpp | 344 ++++++++++++++++++ .../rendering/renderablekameleonvolume.h | 95 +++++ modules/kameleonvolume/shaders/boundsfs.glsl | 40 ++ modules/kameleonvolume/shaders/boundsvs.glsl | 46 +++ modules/kameleonvolume/shaders/helper.glsl | 19 + modules/kameleonvolume/shaders/raycast.glsl | 62 ++++ .../tasks/kameleondocumentationtask.cpp | 162 +++++++++ .../tasks/kameleondocumentationtask.h | 46 +++ .../tasks/kameleonmetadatatojsontask.cpp | 94 +++++ .../tasks/kameleonmetadatatojsontask.h | 46 +++ .../rendering/multiresvolumeraycaster.cpp | 8 +- modules/volume/CMakeLists.txt | 3 + modules/volume/rawvolume.h | 24 +- modules/volume/rawvolume.inl | 44 ++- modules/volume/rawvolumereader.h | 12 +- modules/volume/rawvolumereader.inl | 12 +- modules/volume/rawvolumewriter.h | 8 +- modules/volume/rawvolumewriter.inl | 21 +- modules/volume/volumegridtype.h | 33 ++ modules/volume/volumeutils.cpp | 6 +- modules/volume/volumeutils.h | 4 +- openspace.cfg | 5 +- src/CMakeLists.txt | 4 + src/engine/configurationmanager.cpp | 1 + src/engine/configurationmanager_doc.inl | 8 + src/engine/openspaceengine.cpp | 5 + src/util/progressbar.cpp | 2 +- src/util/task.cpp | 70 ++++ src/util/taskloader.cpp | 89 +++++ 53 files changed, 2161 insertions(+), 122 deletions(-) rename apps/{DataConverter => TaskRunner}/CMakeLists.txt (85%) rename apps/{DataConverter => TaskRunner}/main.cpp (57%) create mode 100644 data/tasks/default.task create mode 100644 data/web/kameleondocumentation/main.hbs create mode 100644 data/web/kameleondocumentation/script.js create mode 100644 include/openspace/util/distanceconstants.h create mode 100644 include/openspace/util/task.h create mode 100644 include/openspace/util/taskloader.h rename {apps/DataConverter => modules/galaxy/tasks}/milkywayconversiontask.cpp (98%) rename {apps/DataConverter => modules/galaxy/tasks}/milkywayconversiontask.h (97%) rename {apps/DataConverter => modules/galaxy/tasks}/milkywaypointsconversiontask.cpp (98%) rename {apps/DataConverter => modules/galaxy/tasks}/milkywaypointsconversiontask.h (96%) create mode 100644 modules/kameleonvolume/CMakeLists.txt create mode 100644 modules/kameleonvolume/include.cmake create mode 100644 modules/kameleonvolume/kameleonvolumemodule.cpp rename apps/DataConverter/conversiontask.h => modules/kameleonvolume/kameleonvolumemodule.h (83%) create mode 100644 modules/kameleonvolume/kameleonvolumereader.cpp create mode 100644 modules/kameleonvolume/kameleonvolumereader.h create mode 100644 modules/kameleonvolume/kameleonvolumereader.inl create mode 100644 modules/kameleonvolume/rendering/kameleonvolumeraycaster.cpp create mode 100644 modules/kameleonvolume/rendering/kameleonvolumeraycaster.h create mode 100644 modules/kameleonvolume/rendering/renderablekameleonvolume.cpp create mode 100644 modules/kameleonvolume/rendering/renderablekameleonvolume.h create mode 100644 modules/kameleonvolume/shaders/boundsfs.glsl create mode 100644 modules/kameleonvolume/shaders/boundsvs.glsl create mode 100644 modules/kameleonvolume/shaders/helper.glsl create mode 100644 modules/kameleonvolume/shaders/raycast.glsl create mode 100644 modules/kameleonvolume/tasks/kameleondocumentationtask.cpp create mode 100644 modules/kameleonvolume/tasks/kameleondocumentationtask.h create mode 100644 modules/kameleonvolume/tasks/kameleonmetadatatojsontask.cpp create mode 100644 modules/kameleonvolume/tasks/kameleonmetadatatojsontask.h create mode 100644 modules/volume/volumegridtype.h create mode 100644 src/util/task.cpp create mode 100644 src/util/taskloader.cpp diff --git a/apps/DataConverter/CMakeLists.txt b/apps/TaskRunner/CMakeLists.txt similarity index 85% rename from apps/DataConverter/CMakeLists.txt rename to apps/TaskRunner/CMakeLists.txt index 24bfdc7968..69f23771d3 100644 --- a/apps/DataConverter/CMakeLists.txt +++ b/apps/TaskRunner/CMakeLists.txt @@ -22,26 +22,18 @@ # OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # ######################################################################################### -set(APPLICATION_NAME DataConverter) +set(APPLICATION_NAME TaskRunner) set(APPLICATION_LINK_TO_OPENSPACE ON) include (${GHOUL_BASE_DIR}/support/cmake/handle_external_library.cmake) -set(application_path ${OPENSPACE_APPS_DIR}/DataConverter) +set(application_path ${OPENSPACE_APPS_DIR}/TaskRunner) set(SOURCE_FILES ${application_path}/main.cpp - ${application_path}/milkywayconversiontask.cpp - ${application_path}/milkywaypointsconversiontask.cpp -) -set(HEADER_FILES - ${application_path}/conversiontask.h - ${application_path}/milkywayconversiontask.h - ${application_path}/milkywaypointsconversiontask.h ) add_executable(${APPLICATION_NAME} MACOSX_BUNDLE ${SOURCE_FILES} - ${HEADER_FILES} ) diff --git a/apps/DataConverter/main.cpp b/apps/TaskRunner/main.cpp similarity index 57% rename from apps/DataConverter/main.cpp rename to apps/TaskRunner/main.cpp index eb147ec43d..de8315bd31 100644 --- a/apps/DataConverter/main.cpp +++ b/apps/TaskRunner/main.cpp @@ -33,50 +33,86 @@ #include #include +#include + +#include + #include +#include +#include +#include +#include +#include +#include +#include -#include -#include - -int main(int argc, char** argv) { - using namespace openspace; - using namespace dataconverter; - - ghoul::initialize(); +namespace { + const std::string ConfigurationFile = "openspace.cfg"; + const std::string _loggerCat = "TaskRunner Main"; +} +void initTextureReaders() { #ifdef GHOUL_USE_DEVIL ghoul::io::TextureReader::ref().addReader(std::make_shared()); #endif // GHOUL_USE_DEVIL #ifdef GHOUL_USE_FREEIMAGE ghoul::io::TextureReader::ref().addReader(std::make_shared()); #endif // GHOUL_USE_FREEIMAGE +} - openspace::ProgressBar pb(100); - std::function onProgress = [&](float progress) { - pb.print(progress * 100); - }; +int main(int argc, char** argv) { + using namespace openspace; - // TODO: Make the converter configurable using either - // config files (json, lua dictionaries), - // lua scripts, - // or at the very least: a command line interface. - - MilkyWayConversionTask mwConversionTask( - "F:/mw_june2016/volumeslices/img/comp/v003/frames/primary/0100/cam2_main.", - ".exr", - 1385, - 512, - "F:/mw_june2016/mw_512_512_64_june.rawvolume", - glm::vec3(512, 512, 64)); + ghoul::initialize(); + initTextureReaders(); + + FactoryManager::initialize(); + FactoryManager::ref().addFactory( + std::make_unique>(), + "Renderable" + ); + FactoryManager::ref().addFactory( + std::make_unique>(), + "Task" + ); + FactoryManager::ref().addFactory( + std::make_unique>(), + "Translation" + ); + + openspace::ConfigurationManager configuration; + std::string configurationFile = configuration.findConfiguration(ConfigurationFile); + configuration.loadFromFile(configurationFile); + + ModuleEngine moduleEngine; + moduleEngine.initialize(); + + std::string tasksPath; + configuration.getValue(ConfigurationManager::KeyConfigTask, tasksPath); + + LINFO("Initialization done."); + + TaskLoader taskLoader; + std::vector> tasks = taskLoader.tasksFromFile(tasksPath); - //MilkyWayPointsConversionTask mwpConversionTask("F:/mw_june2016/points.off", "F:/mw_june2016/points.off.binary"); + size_t nTasks = tasks.size(); + if (nTasks == 1) { + LINFO("Task queue has 1 item"); + } else { + LINFO("Task queue has " << tasks.size() << " items"); + } + for (size_t i = 0; i < tasks.size(); i++) { + Task& task = *tasks[i].get(); + LINFO("Performing task " << (i+1) << " out of " << tasks.size() << ": " << task.description()); + ProgressBar progressBar(100); + auto onProgress = [&progressBar](float progress) { + progressBar.print(progress * 100); + }; + task.perform(onProgress); + } - mwConversionTask.perform(onProgress); - //mwpConversionTask.perform(onProgress); - - - std::cout << "Done." << std::endl; + std::cout << "Done performing tasks." << std::endl; std::cin.get(); return 0; diff --git a/data/tasks/default.task b/data/tasks/default.task new file mode 100644 index 0000000000..9f64865d8e --- /dev/null +++ b/data/tasks/default.task @@ -0,0 +1,3 @@ +return { + "kameleonmetadatatojson" +} \ No newline at end of file diff --git a/data/web/kameleondocumentation/main.hbs b/data/web/kameleondocumentation/main.hbs new file mode 100644 index 0000000000..a12a1a9931 --- /dev/null +++ b/data/web/kameleondocumentation/main.hbs @@ -0,0 +1,59 @@ +
+ +
+
+

OpenSpace Kameleon Documentation

+

Version: {{version}}

+

CDF File: {{input}}

+

Global Attributes

+ {{#each kameleon.globalAttributes}} +
+
+
+

+ + {{@key}} + +

{{this}}

+

+
+
+
+ {{/each}} +

Variable Attributes

+ {{#each kameleon.variableAttributes}} +

{{@key}}

+ {{#each this}} +
+
+
+

+ + {{@key}} + +

{{this}}

+

+
+
+
+ {{/each}} + {{/each}} +
+
+
\ No newline at end of file diff --git a/data/web/kameleondocumentation/script.js b/data/web/kameleondocumentation/script.js new file mode 100644 index 0000000000..84f9665e59 --- /dev/null +++ b/data/web/kameleondocumentation/script.js @@ -0,0 +1,23 @@ +window.onload = function () { + var mainTemplateElement = document.getElementById('mainTemplate'); + var mainTemplate = Handlebars.compile(mainTemplateElement.innerHTML); + + Handlebars.registerHelper('urlify', function(options, context) { + var data = context.data; + var identifier = options.replace(" ", "-").toLowerCase(); + + while (data = data._parent) { + if (data.key !== undefined) { + identifier = data.key + "-" + identifier; + } + } + + return identifier; + }); + + var dataElement = document.getElementById('data'); + var data = JSON.parse(dataElement.innerHTML); + + var contents = mainTemplate(data); + document.body.innerHTML = contents; +} \ No newline at end of file diff --git a/include/openspace/engine/configurationmanager.h b/include/openspace/engine/configurationmanager.h index abf98886d0..f67b55bc6e 100644 --- a/include/openspace/engine/configurationmanager.h +++ b/include/openspace/engine/configurationmanager.h @@ -68,6 +68,8 @@ public: static const std::string KeyFactoryDocumentation; /// The key that stores the location of the scene file that is initially loaded static const std::string KeyConfigScene; + /// The key that stores the location of the tasks file that is initially loaded + static const std::string KeyConfigTask; /// The key that stores the subdirectory containing a list of all startup scripts to /// be executed on application start before the scene file is loaded static const std::string KeyStartupScript; diff --git a/include/openspace/util/distanceconstants.h b/include/openspace/util/distanceconstants.h new file mode 100644 index 0000000000..e9bf243f2d --- /dev/null +++ b/include/openspace/util/distanceconstants.h @@ -0,0 +1,34 @@ +/***************************************************************************************** +* * +* 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. * +****************************************************************************************/ + +namespace openspace { + +namespace distanceconstants { + const float EarthRadius = 6371; + const float LightYear = 9.4607304725808E15; + const float AstronomicalUnit = 1.495978707E11; + const float Parsec = 3.0856776E16; +} + +} \ No newline at end of file diff --git a/include/openspace/util/task.h b/include/openspace/util/task.h new file mode 100644 index 0000000000..20fd7e51be --- /dev/null +++ b/include/openspace/util/task.h @@ -0,0 +1,23 @@ +#ifndef __CONVERSIONTASK_H__ +#define __CONVERSIONTASK_H__ + +#include +#include +#include + +namespace openspace { + +class Task { +public: + using ProgressCallback = std::function; + + virtual ~Task() = default; + virtual void perform(const ProgressCallback& onProgress) = 0; + virtual std::string description() = 0; + static std::unique_ptr createFromDictionary(const ghoul::Dictionary& dictionary); + static openspace::Documentation documentation(); +}; + +} + +#endif diff --git a/include/openspace/util/taskloader.h b/include/openspace/util/taskloader.h new file mode 100644 index 0000000000..7982ed667e --- /dev/null +++ b/include/openspace/util/taskloader.h @@ -0,0 +1,17 @@ +#ifndef __TASKRUNNER_H__ +#define __TASKRUNNER_H__ + +#include +#include +#include + +namespace openspace { +class TaskLoader { +public: + std::vector> tasksFromDictionary(const ghoul::Dictionary& dictionary); + std::vector> tasksFromFile(const std::string& path); +}; + +} + +#endif diff --git a/modules/galaxy/CMakeLists.txt b/modules/galaxy/CMakeLists.txt index 4a873620a4..e77c3e699f 100644 --- a/modules/galaxy/CMakeLists.txt +++ b/modules/galaxy/CMakeLists.txt @@ -28,6 +28,8 @@ set(HEADER_FILES ${CMAKE_CURRENT_SOURCE_DIR}/galaxymodule.h ${CMAKE_CURRENT_SOURCE_DIR}/rendering/galaxyraycaster.h ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablegalaxy.h + ${CMAKE_CURRENT_SOURCE_DIR}/tasks/milkywayconversiontask.h + ${CMAKE_CURRENT_SOURCE_DIR}/tasks/milkywaypointsconversiontask.h ) source_group("Header Files" FILES ${HEADER_FILES}) @@ -35,6 +37,7 @@ set(SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/galaxymodule.cpp ${CMAKE_CURRENT_SOURCE_DIR}/rendering/galaxyraycaster.cpp ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablegalaxy.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/tasks/milkywaypointsconversiontask.cpp ) source_group("Source Files" FILES ${SOURCE_FILES}) diff --git a/modules/galaxy/galaxymodule.cpp b/modules/galaxy/galaxymodule.cpp index 1555ddc184..1a20cbce44 100644 --- a/modules/galaxy/galaxymodule.cpp +++ b/modules/galaxy/galaxymodule.cpp @@ -27,6 +27,8 @@ #include #include #include +#include +#include namespace openspace { @@ -36,6 +38,11 @@ void GalaxyModule::internalInitialize() { auto fRenderable = FactoryManager::ref().factory(); ghoul_assert(fRenderable, "No renderable factory existed"); fRenderable->registerClass("RenderableGalaxy"); + + auto fTask = FactoryManager::ref().factory(); + ghoul_assert(fRenderable, "No task factory existed"); + fTask->registerClass("MilkywayPointsConversionTask"); + fTask->registerClass("MilkywayPointsConversionTask"); } } // namespace openspace diff --git a/apps/DataConverter/milkywayconversiontask.cpp b/modules/galaxy/tasks/milkywayconversiontask.cpp similarity index 98% rename from apps/DataConverter/milkywayconversiontask.cpp rename to modules/galaxy/tasks/milkywayconversiontask.cpp index 72482738a6..907684bbcc 100644 --- a/apps/DataConverter/milkywayconversiontask.cpp +++ b/modules/galaxy/tasks/milkywayconversiontask.cpp @@ -22,7 +22,7 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#include +#include #include #include #include diff --git a/apps/DataConverter/milkywayconversiontask.h b/modules/galaxy/tasks/milkywayconversiontask.h similarity index 97% rename from apps/DataConverter/milkywayconversiontask.h rename to modules/galaxy/tasks/milkywayconversiontask.h index 6eb7233c75..d9a32e5cb1 100644 --- a/apps/DataConverter/milkywayconversiontask.h +++ b/modules/galaxy/tasks/milkywayconversiontask.h @@ -25,7 +25,7 @@ #ifndef __OPENSPACE_APP_DATACONVERTER___MILKYWAYCONVERSIONTASK___H__ #define __OPENSPACE_APP_DATACONVERTER___MILKYWAYCONVERSIONTASK___H__ -#include +#include #include #include #include @@ -40,7 +40,7 @@ namespace dataconverter { * Converts a set of exr image slices to a raw volume * with floating point RGBA data (32 bit per channel). */ -class MilkyWayConversionTask : public ConversionTask { +class MilkyWayConversionTask : public Task { public: MilkyWayConversionTask(const std::string& inFilenamePrefix, const std::string& inFilenameSuffix, diff --git a/apps/DataConverter/milkywaypointsconversiontask.cpp b/modules/galaxy/tasks/milkywaypointsconversiontask.cpp similarity index 98% rename from apps/DataConverter/milkywaypointsconversiontask.cpp rename to modules/galaxy/tasks/milkywaypointsconversiontask.cpp index 790d2be279..1a25b36c14 100644 --- a/apps/DataConverter/milkywaypointsconversiontask.cpp +++ b/modules/galaxy/tasks/milkywaypointsconversiontask.cpp @@ -22,7 +22,7 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#include +#include #include #include #include diff --git a/apps/DataConverter/milkywaypointsconversiontask.h b/modules/galaxy/tasks/milkywaypointsconversiontask.h similarity index 96% rename from apps/DataConverter/milkywaypointsconversiontask.h rename to modules/galaxy/tasks/milkywaypointsconversiontask.h index a11bc64230..6da5a42cd4 100644 --- a/apps/DataConverter/milkywaypointsconversiontask.h +++ b/modules/galaxy/tasks/milkywaypointsconversiontask.h @@ -25,7 +25,7 @@ #ifndef __OPENSPACE_APP_DATACONVERTER___MILKYWAYPOINTSCONVERSIONTASK___H__ #define __OPENSPACE_APP_DATACONVERTER___MILKYWAYPOINTSCONVERSIONTASK___H__ -#include +#include #include #include #include @@ -42,7 +42,7 @@ namespace dataconverter { * (float x, float y, float z, float r, float g, float b) * n * to a binary (floating point) representation with the same layout. */ -class MilkyWayPointsConversionTask : public ConversionTask { +class MilkyWayPointsConversionTask : public Task { public: MilkyWayPointsConversionTask(const std::string& inFilename, const std::string& outFilename); diff --git a/modules/kameleonvolume/CMakeLists.txt b/modules/kameleonvolume/CMakeLists.txt new file mode 100644 index 0000000000..9e574540f4 --- /dev/null +++ b/modules/kameleonvolume/CMakeLists.txt @@ -0,0 +1,49 @@ +######################################################################################### +# # +# 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. # +######################################################################################### + +include(${OPENSPACE_CMAKE_EXT_DIR}/module_definition.cmake) + +set(HEADER_FILES + ${CMAKE_CURRENT_SOURCE_DIR}/kameleonvolumereader.h + ${CMAKE_CURRENT_SOURCE_DIR}/kameleonvolumereader.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablekameleonvolume.h + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/kameleonvolumeraycaster.h + ${CMAKE_CURRENT_SOURCE_DIR}/tasks/kameleondocumentationtask.h + ${CMAKE_CURRENT_SOURCE_DIR}/tasks/kameleonmetadatatojsontask.h +) +source_group("Header Files" FILES ${HEADER_FILES}) + +set(SOURCE_FILES + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablekameleonvolume.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/kameleonvolumeraycaster.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/tasks/kameleondocumentationtask.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/tasks/kameleonmetadatatojsontask.cpp +) +source_group("Source Files" FILES ${SOURCE_FILES}) + +create_new_module( + "KameleonVolume" + kameleonvolume_module + ${HEADER_FILES} ${SOURCE_FILES} +) diff --git a/modules/kameleonvolume/include.cmake b/modules/kameleonvolume/include.cmake new file mode 100644 index 0000000000..e01e83854b --- /dev/null +++ b/modules/kameleonvolume/include.cmake @@ -0,0 +1,6 @@ +set (DEFAULT_MODULE ON) + +set (OPENSPACE_DEPENDENCIES + kameleon + volume +) \ No newline at end of file diff --git a/modules/kameleonvolume/kameleonvolumemodule.cpp b/modules/kameleonvolume/kameleonvolumemodule.cpp new file mode 100644 index 0000000000..15a0508b6d --- /dev/null +++ b/modules/kameleonvolume/kameleonvolumemodule.cpp @@ -0,0 +1,58 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#include + +#include + +#include +#include + +#include +#include +#include + +namespace openspace { + +KameleonVolumeModule::KameleonVolumeModule() : OpenSpaceModule("KameleonVolume") {} + +void KameleonVolumeModule::internalInitialize() { + auto fRenderable = FactoryManager::ref().factory(); + ghoul_assert(fRenderable, "No renderable factory existed"); + fRenderable->registerClass("RenderableKameleonVolume"); + + auto fTask = FactoryManager::ref().factory(); + ghoul_assert(fTask, "No task factory existed"); + fTask->registerClass("KameleonMetadataToJsonTask"); + fTask->registerClass("KameleonDocumentationTask"); + + +} + +std::vector KameleonVolumeModule::documentations() const +{ + return std::vector{KameleonMetadataToJsonTask::documentation()}; +} + +} // namespace openspace diff --git a/apps/DataConverter/conversiontask.h b/modules/kameleonvolume/kameleonvolumemodule.h similarity index 83% rename from apps/DataConverter/conversiontask.h rename to modules/kameleonvolume/kameleonvolumemodule.h index 388088977f..46f8404eea 100644 --- a/apps/DataConverter/conversiontask.h +++ b/modules/kameleonvolume/kameleonvolumemodule.h @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2014-2017 * + * 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 * @@ -22,20 +22,20 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_APP_DATACONVERTER___CONVERSIONTASK___H__ -#define __OPENSPACE_APP_DATACONVERTER___CONVERSIONTASK___H__ +#ifndef __KAMELEONVOLUMEMODULE_H__ +#define __KAMELEONVOLUMEMODULE_H__ -#include +#include namespace openspace { -namespace dataconverter { -class ConversionTask { +class KameleonVolumeModule : public OpenSpaceModule { public: - virtual void perform(const std::function& onProgress) = 0; + KameleonVolumeModule(); + void internalInitialize() override; + std::vector KameleonVolumeModule::documentations() const override; }; -} // namespace dataconverter } // namespace openspace -#endif // __OPENSPACE_APP_DATACONVERTER___CONVERSIONTASK___H__ +#endif // __KAMELEONVOLUMEMODULE_H__ diff --git a/modules/kameleonvolume/kameleonvolumereader.cpp b/modules/kameleonvolume/kameleonvolumereader.cpp new file mode 100644 index 0000000000..f9803a8fdf --- /dev/null +++ b/modules/kameleonvolume/kameleonvolumereader.cpp @@ -0,0 +1,188 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#include +#include +#include + +//#include + + + +namespace { + const std::string _loggerCat = "KameleonVolumeReader"; +} + +namespace openspace { + +KameleonVolumeReader::KameleonVolumeReader(const std::string& path) + : _path(path) +{ + if (!FileSys.fileExists(path)) { + LERROR(_path << "does not exist"); + return; + } + + long status = _kameleon.open(_path); + if (status != ccmc::FileReader::OK) { + LERROR("Failed to open file " << _path << " with kameleon"); + return; + } + + _model = _kameleon.model; + _interpolator = std::unique_ptr(_model->createNewInterpolator()); +} + +std::unique_ptr> KameleonVolumeReader::readFloatVolume( + const glm::uvec3 & dimensions, + const std::string & variable, + const glm::vec3 & lowerBound, + const glm::vec3 & upperBound) const +{ + auto volume = std::make_unique>(dimensions); + glm::vec3 dims = volume->dimensions(); + glm::vec3 diff = upperBound - lowerBound; + + _model->loadVariable(variable); + + float* data = volume->data(); + for (size_t index = 0; index < volume->nCells(); index++) { + glm::vec3 coords = volume->indexToCoords(index); + glm::vec3 coordsZeroToOne = coords / dims; + glm::vec3 volumeCoords = lowerBound + diff * coordsZeroToOne; + + data[index] = _interpolator->interpolate( + variable, + static_cast(volumeCoords[0]), + static_cast(volumeCoords[1]), + static_cast(volumeCoords[2])); + } + + return volume; +} + +std::vector KameleonVolumeReader::gridVariableNames() const { + // get the grid system string + std::string gridSystem = _model->getGlobalAttribute("grid_system_1").getAttributeString(); + + // remove leading and trailing brackets + gridSystem = gridSystem.substr(1, gridSystem.length() - 2); + + // remove all whitespaces + gridSystem.erase(remove_if(gridSystem.begin(), gridSystem.end(), isspace), gridSystem.end()); + + // replace all comma signs with whitespaces + std::replace(gridSystem.begin(), gridSystem.end(), ',', ' '); + + // tokenize + std::istringstream iss(gridSystem); + std::vector tokens{ std::istream_iterator{iss},std::istream_iterator{} }; + + // validate + if (tokens.size() != 3) { + return std::vector(); + } + + std::string x = tokens.at(0); + std::string y = tokens.at(1); + std::string z = tokens.at(2); + + std::transform(x.begin(), x.end(), x.begin(), ::tolower); + std::transform(y.begin(), y.end(), y.begin(), ::tolower); + std::transform(z.begin(), z.end(), z.begin(), ::tolower); + + return std::vector{x, y, z}; +} + +std::vector KameleonVolumeReader::variableNames() const { + std::vector variableNames; + int nVariables = _model->getNumberOfVariables(); + for (int i = 0; i < nVariables; i++) { + variableNames.push_back(_model->getVariableName(i)); + } + return variableNames; +} + +std::vector KameleonVolumeReader::variableAttributeNames() const { + return _model->getVariableAttributeNames(); +} + +std::vector KameleonVolumeReader::globalAttributeNames() const { + std::vector attributeNames; + int nAttributes = _model->getNumberOfGlobalAttributes(); + for (int i = 0; i < nAttributes; i++) { + attributeNames.push_back(_model->getGlobalAttributeName(i)); + } + return attributeNames; +} + +void KameleonVolumeReader::addAttributeToDictionary(ghoul::Dictionary& dictionary, const std::string& key, ccmc::Attribute& attr) { + ccmc::Attribute::AttributeType type = attr.getAttributeType(); + if (type == ccmc::Attribute::AttributeType::FLOAT) { + dictionary.setValue(key, attr.getAttributeFloat()); + } + else if (type == ccmc::Attribute::AttributeType::INT) { + dictionary.setValue(key, attr.getAttributeInt()); + } + else if (type == ccmc::Attribute::AttributeType::STRING) { + dictionary.setValue(key, attr.getAttributeString()); + } +} + +ghoul::Dictionary KameleonVolumeReader::readMetaData() const { + ghoul::Dictionary globalAttributesDictionary; + for (const std::string& attributeName : globalAttributeNames()) { + ccmc::Attribute attribute = _model->getGlobalAttribute(attributeName); + addAttributeToDictionary(globalAttributesDictionary, attributeName, attribute); + } + + ghoul::Dictionary variableDictionary; + std::vector varAttrNames = variableAttributeNames(); + for (const std::string& variableName : variableNames()) { + ghoul::Dictionary variableAttributesDictionary; + for (const std::string& attributeName : varAttrNames) { + ccmc::Attribute attribute = _model->getVariableAttribute(variableName, attributeName); + addAttributeToDictionary(variableAttributesDictionary, attributeName, attribute); + } + variableDictionary.setValue(variableName, variableAttributesDictionary); + } + + ghoul::Dictionary metaData; + metaData.setValue("globalAttributes", globalAttributesDictionary); + metaData.setValue("variableAttributes", variableDictionary); + return metaData; +} + +float KameleonVolumeReader::minValue(const std::string & variable) const { + return _model->getVariableAttribute(variable, "actual_min").getAttributeFloat(); +} + +float KameleonVolumeReader::maxValue(const std::string & variable) const { + return _model->getVariableAttribute(variable, "actual_max").getAttributeFloat(); +} + + + + +} \ No newline at end of file diff --git a/modules/kameleonvolume/kameleonvolumereader.h b/modules/kameleonvolume/kameleonvolumereader.h new file mode 100644 index 0000000000..785d7b5dca --- /dev/null +++ b/modules/kameleonvolume/kameleonvolumereader.h @@ -0,0 +1,77 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#ifndef __KAMELEONVOLUMEREADER_H__ +#define __KAMELEONVOLUMEREADER_H__ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + + +namespace openspace { + +class KameleonVolumeReader { +public: + KameleonVolumeReader(const std::string& path); + //KameleonMetaData readMetaData(); + + std::unique_ptr> readFloatVolume( + const glm::uvec3& dimensions, + const std::string& variable, + const glm::vec3& lowerBound, + const glm::vec3& upperBound) const; + ghoul::Dictionary readMetaData() const; + float minValue(const std::string& variable) const; + float maxValue(const std::string& variable) const; + + std::vector gridVariableNames() const; + std::vector gridUnits() const; + std::vector variableNames() const; + std::vector variableAttributeNames() const; + std::vector globalAttributeNames() const; + +private: + static void addAttributeToDictionary(ghoul::Dictionary& dictionary, const std::string& key, ccmc::Attribute& attr); + std::string _path; + ccmc::Kameleon _kameleon; + ccmc::Model* _model; + std::unique_ptr _interpolator; + +}; + +} + +#include + +#endif diff --git a/modules/kameleonvolume/kameleonvolumereader.inl b/modules/kameleonvolume/kameleonvolumereader.inl new file mode 100644 index 0000000000..3e6e4b3d9d --- /dev/null +++ b/modules/kameleonvolume/kameleonvolumereader.inl @@ -0,0 +1,52 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + + + +namespace openspace { + + //KameleonMetaData KameleonVolumeReader::getMetaData() { + /* + using GridUnits = std::tuple; + GridUnits units = _kameleonWrapper.getGridUnits(); + std::string unit0 = std::get<0>(units); + std::string unit1 = std::get<1>(units); + std::string unit2 = std::get<2>(units); + + glm::vec3 scaling; + if (unit0 == 'R' && unit1 == 'R' && unit2 == 'R') { + scaling.x = scaling.y = scaling.z = openspace::distanceconstants::EarthRadius; + } + if (unit0 == '') + + VolumeMetaData metaData(VolumeMetaData::GridType::Cartesian, scaling ); + */ + + + //} + + + + +} \ No newline at end of file diff --git a/modules/kameleonvolume/rendering/kameleonvolumeraycaster.cpp b/modules/kameleonvolume/rendering/kameleonvolumeraycaster.cpp new file mode 100644 index 0000000000..c514626243 --- /dev/null +++ b/modules/kameleonvolume/rendering/kameleonvolumeraycaster.cpp @@ -0,0 +1,142 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace { + const std::string GlslRaycastPath = "${MODULES}/kameleonvolume/shaders/raycast.glsl"; + const std::string GlslHelperPath = "${MODULES}/kameleonvolume/shaders/helper.glsl"; + const std::string GlslBoundsVsPath = "${MODULES}/kameleonvolume/shaders/boundsvs.glsl"; + const std::string GlslBoundsFsPath = "${MODULES}/kameleonvolume/shaders/boundsfs.glsl"; +} + +namespace openspace { + +KameleonVolumeRaycaster::KameleonVolumeRaycaster( + std::shared_ptr texture, + std::shared_ptr transferFunction) + : _volumeTexture(texture) + , _transferFunction(transferFunction) + , _boundingBox(glm::vec3(1.0)) {} + +KameleonVolumeRaycaster::~KameleonVolumeRaycaster() {} + +void KameleonVolumeRaycaster::initialize() { + _boundingBox.initialize(); +} + +void KameleonVolumeRaycaster::deinitialize() { +} + +void KameleonVolumeRaycaster::renderEntryPoints(const RenderData& data, ghoul::opengl::ProgramObject& program) { + //program.setUniform("modelTransform", _modelTransform); + program.setUniform("viewProjection", data.camera.viewProjectionMatrix()); + Renderable::setPscUniforms(program, data.camera, data.position); + + // Cull back face + glEnable(GL_CULL_FACE); + glCullFace(GL_BACK); + + // Render bounding geometry + _boundingBox.render(); +} + +void KameleonVolumeRaycaster::renderExitPoints(const RenderData& data, ghoul::opengl::ProgramObject& program) { + // Uniforms + //program.setUniform("modelTransform", _modelTransform); + program.setUniform("viewProjection", data.camera.viewProjectionMatrix()); + Renderable::setPscUniforms(program, data.camera, data.position); + + // Cull front face + glEnable(GL_CULL_FACE); + glCullFace(GL_FRONT); + + // Render bounding geometry + _boundingBox.render(); + + // Restore defaults + glCullFace(GL_BACK); +} + +void KameleonVolumeRaycaster::preRaycast(const RaycastData& data, ghoul::opengl::ProgramObject& program) { + std::string stepSizeUniformName = "maxStepSize" + std::to_string(data.id); + program.setUniform(stepSizeUniformName, _stepSize); + + std::string id = std::to_string(data.id); + + _tfUnit = std::make_unique(); + _tfUnit->activate(); + _transferFunction->getTexture().bind(); + program.setUniform("transferFunction_" + id, _tfUnit->unitNumber()); + + _textureUnit = std::make_unique(); + _textureUnit->activate(); + _volumeTexture->bind(); + program.setUniform("volumeTexture_" + id, _textureUnit->unitNumber()); + + program.setUniform("gridType_" + id, static_cast(_gridType)); +} + +void KameleonVolumeRaycaster::postRaycast(const RaycastData& data, ghoul::opengl::ProgramObject& program) { + // For example: release texture units + _textureUnit = nullptr; + _tfUnit = nullptr; +} + +std::string KameleonVolumeRaycaster::getBoundsVsPath() const { + return GlslBoundsVsPath; +} + +std::string KameleonVolumeRaycaster::getBoundsFsPath() const { + return GlslBoundsFsPath; +} + +std::string KameleonVolumeRaycaster::getRaycastPath() const { + return GlslRaycastPath; +} + +std::string KameleonVolumeRaycaster::getHelperPath() const { + return GlslHelperPath; // no helper file +} + +void KameleonVolumeRaycaster::setStepSize(float stepSize) { + _stepSize = stepSize; +} + +void KameleonVolumeRaycaster::setGridType(VolumeGridType gridType) +{ + _gridType = gridType; +} + +} diff --git a/modules/kameleonvolume/rendering/kameleonvolumeraycaster.h b/modules/kameleonvolume/rendering/kameleonvolumeraycaster.h new file mode 100644 index 0000000000..89d83aca49 --- /dev/null +++ b/modules/kameleonvolume/rendering/kameleonvolumeraycaster.h @@ -0,0 +1,89 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#ifndef __KAMELEONVOLUMERAYCASTER_H__ +#define __KAMELEONVOLUMERAYCASTER_H__ + + +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include + +namespace ghoul { + namespace opengl { + class Texture; + class ProgramObject; + } +} + +namespace openspace { + +class RenderData; +class RaycastData; + +class KameleonVolumeRaycaster : public VolumeRaycaster { +public: + + KameleonVolumeRaycaster( + std::shared_ptr texture, + std::shared_ptr transferFunction); + + virtual ~KameleonVolumeRaycaster(); + void initialize(); + void deinitialize(); + void renderEntryPoints(const RenderData& data, ghoul::opengl::ProgramObject& program) override; + void renderExitPoints(const RenderData& data, ghoul::opengl::ProgramObject& program) override; + void preRaycast(const RaycastData& data, ghoul::opengl::ProgramObject& program) override; + void postRaycast(const RaycastData& data, ghoul::opengl::ProgramObject& program) override; + + std::string getBoundsVsPath() const override; + std::string getBoundsFsPath() const override; + std::string getRaycastPath() const override; + std::string getHelperPath() const override; + + void setStepSize(float stepSize); + void setGridType(VolumeGridType gridType); +private: + std::shared_ptr _volumeTexture; + std::shared_ptr _transferFunction; + BoxGeometry _boundingBox; + VolumeGridType _gridType; + + std::unique_ptr _tfUnit; + std::unique_ptr _textureUnit; + float _stepSize; +}; + +} // openspace + +#endif // __KAMELEONVOLUMERAYCASTER_H__ diff --git a/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp b/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp new file mode 100644 index 0000000000..a5912cc27f --- /dev/null +++ b/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp @@ -0,0 +1,344 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +namespace { + const std::string _loggerCat = "RenderableKameleonVolume"; +} + +namespace openspace { + +RenderableKameleonVolume::RenderableKameleonVolume(const ghoul::Dictionary& dictionary) + : Renderable(dictionary) + , _dimensions("dimensions", "Dimensions") + , _variable("variable", "Variable") + , _lowerDomainBound("lowerDomainBound", "Lower Domain Bound") + , _upperDomainBound("upperDomainBound", "Upper Domain Bound") + , _autoDomainBounds(false) + , _lowerValueBound("lowerValueBound", "Lower Value Bound", 0.0, 0.0, 1) + , _upperValueBound("upperValueBound", "Upper Value Bound", 1, 0.01, 1) + , _autoValueBounds(false) + , _gridType("gridType", "Grid Type", properties::OptionProperty::DisplayType::DROPDOWN) + , _autoGridType(false) + , _stepSize("stepSize", "Step Size", 0.02, 0.01, 1) + , _sourcePath("sourcePath", "Source Path") + , _transferFunctionPath("transferFunctionPath", "Transfer Function Path") + , _raycaster(nullptr) + , _transferFunction(nullptr) + , _cache("cache", "Cache") { + + glm::vec3 dimensions; + if (dictionary.getValue("Dimensions", dimensions)) { + _dimensions = dimensions; + } else { + LWARNING("No dimensions specified for volumetric data, falling back to 32^3"); + _dimensions = glm::uvec3(32, 32, 32); + } + + float stepSize; + if (dictionary.getValue("StepSize", stepSize)) { + _stepSize = stepSize; + } + + std::string transferFunctionPath; + if (dictionary.getValue("TransferFunction", transferFunctionPath)) { + _transferFunctionPath = transferFunctionPath; + _transferFunction = std::make_shared(absPath(transferFunctionPath)); + } + + std::string sourcePath; + if (dictionary.getValue("Source", sourcePath)) { + _sourcePath = absPath(sourcePath); + } + + std::string variable; + if (dictionary.getValue("Variable", variable)) { + _variable = variable; + } + + glm::vec3 lowerDomainBound; + if (dictionary.getValue("LowerDomainBound", lowerDomainBound)) { + _lowerDomainBound = lowerDomainBound; + } + else { + _autoDomainBounds = true; + } + + glm::vec3 upperDomainBound; + if (dictionary.getValue("UpperDomainBound", upperDomainBound)) { + _upperDomainBound = upperDomainBound; + } + else { + _autoDomainBounds = true; + } + + float lowerValueBound; + if (dictionary.getValue("LowerValueBound", lowerValueBound)) { + _lowerValueBound = lowerValueBound; + } + else { + _autoValueBounds = true; + } + + float upperValueBound; + if (dictionary.getValue("UpperValueBound", upperValueBound)) { + _upperValueBound = upperValueBound; + } + else { + _autoValueBounds = true; + } + + + bool cache; + if (dictionary.getValue("Cache", cache)) { + _cache = cache; + } + + _gridType.addOption(static_cast(VolumeGridType::Cartesian), "Cartesian grid"); + _gridType.addOption(static_cast(VolumeGridType::Spherical), "Spherical grid"); + _gridType.setValue(static_cast(VolumeGridType::Cartesian)); + + std::string gridType; + if (dictionary.getValue("GridType", gridType)) { + if (gridType == "Spherical") { + _gridType.setValue(static_cast(VolumeGridType::Spherical)); + } else { + _autoGridType = true; + } + } + + // TODO: read transformation: position/rotation/scale from dictionary. +} + +RenderableKameleonVolume::~RenderableKameleonVolume() {} + +bool RenderableKameleonVolume::initialize() { + load(); + + _volumeTexture->uploadTexture(); + _transferFunction->update(); + + _raycaster = std::make_unique(_volumeTexture, _transferFunction); + + _raycaster->setStepSize(_stepSize); + _gridType.onChange([this] { + _raycaster->setStepSize(_stepSize); + }); + _raycaster->setGridType(static_cast(_gridType.value())); + _gridType.onChange([this] { + _raycaster->setGridType(static_cast(_gridType.value())); + }); + + + + _raycaster->initialize(); + + + OsEng.renderEngine().raycasterManager().attachRaycaster(*_raycaster.get()); + + std::function onChange = [&](bool enabled) { + if (enabled) { + OsEng.renderEngine().raycasterManager().attachRaycaster(*_raycaster.get()); + } + else { + OsEng.renderEngine().raycasterManager().detachRaycaster(*_raycaster.get()); + } + }; + + onEnabledChange(onChange); + + addProperty(_dimensions); + addProperty(_stepSize); + addProperty(_transferFunctionPath); + addProperty(_sourcePath); + addProperty(_variable); + addProperty(_lowerDomainBound); + addProperty(_upperDomainBound); + addProperty(_lowerValueBound); + addProperty(_upperValueBound); + addProperty(_gridType); + addProperty(_cache); + + + return true; +} + +bool RenderableKameleonVolume::cachingEnabled() { + return _cache; +} + +void RenderableKameleonVolume::load() { + if (!FileSys.fileExists(_sourcePath)) { + LERROR("File " << _sourcePath << " does not exist."); + return; + } + if (!cachingEnabled()) { + loadFromPath(_sourcePath); + return; + } + ghoul::filesystem::File sourceFile(_sourcePath); + std::string cachePath = FileSys.cacheManager()->cachedFilename( + sourceFile.baseName(), + cacheSuffix(), + ghoul::filesystem::CacheManager::Persistent::Yes + ); + if (FileSys.fileExists(cachePath)) { + loadRaw(cachePath); + } else { + loadFromPath(_sourcePath); + storeRaw(cachePath); + } +} + +std::string RenderableKameleonVolume::cacheSuffix() { + glm::vec3 dims = _dimensions.value(); + return "." + _variable.value() + + "." + std::to_string(dims[0]) + + "x" + std::to_string(dims[1]) + + "x" + std::to_string(dims[2]); +} + +void RenderableKameleonVolume::loadFromPath(const std::string& path) { + ghoul::filesystem::File file(path); + std::string extension = file.fileExtension(); + std::transform(extension.begin(), extension.end(), extension.begin(), ::tolower); + if (extension == "cdf") { + loadCdf(path); + } else { + loadRaw(path); + } +} + +void RenderableKameleonVolume::loadRaw(const std::string& path) { + RawVolumeReader reader(path, _dimensions); + _rawVolume = reader.read(); + updateTextureFromVolume(); +} + +void RenderableKameleonVolume::loadCdf(const std::string& path) { + KameleonVolumeReader reader(path); + + if (_autoValueBounds) { + _lowerValueBound = reader.minValue(_variable); + _upperValueBound = reader.maxValue(_variable); + } + + std::vector variables = reader.gridVariableNames(); + + if (variables.size() == 3 && _autoDomainBounds) { + _lowerDomainBound = glm::vec3( + reader.minValue(variables[0]), + reader.minValue(variables[1]), + reader.minValue(variables[2])); + + _upperDomainBound = glm::vec3( + reader.maxValue(variables[0]), + reader.maxValue(variables[1]), + reader.maxValue(variables[2])); + } + + if (variables.size() == 3 && _autoGridType) { + if (variables[0] == "r" && variables[0] == "theta" && variables[0] == "phi") { + _gridType.setValue(static_cast(VolumeGridType::Spherical)); + } + else { + _gridType.setValue(static_cast(VolumeGridType::Cartesian)); + } + } + + ghoul::Dictionary dict = reader.readMetaData(); + _rawVolume = reader.readFloatVolume(_dimensions, _variable, _lowerDomainBound, _upperDomainBound); + updateTextureFromVolume(); +} + +void RenderableKameleonVolume::updateTextureFromVolume() { + _normalizedVolume = std::make_unique>(_dimensions); + float* in = _rawVolume->data(); + GLfloat* out = _normalizedVolume->data(); + float min = _lowerValueBound; + float diff = _upperValueBound - _lowerValueBound; + + for (size_t i = 0; i < _normalizedVolume->nCells(); i++) { + out[i] = glm::clamp((in[i] - min) / diff, 0.0f, 1.0f); + } + + _volumeTexture = std::make_shared( + _dimensions, + ghoul::opengl::Texture::Format::Red, + GL_RED, + GL_FLOAT, + ghoul::opengl::Texture::FilterMode::Linear, + ghoul::opengl::Texture::WrappingMode::Repeat); + + void* data = reinterpret_cast(_normalizedVolume->data()); + _volumeTexture->setPixelData(data, ghoul::opengl::Texture::TakeOwnership::No); +} + +void RenderableKameleonVolume::storeRaw(const std::string& path) { + RawVolumeWriter writer(path); + writer.write(*_rawVolume); +} + +bool RenderableKameleonVolume::deinitialize() { + if (_raycaster) { + OsEng.renderEngine().raycasterManager().detachRaycaster(*_raycaster.get()); + _raycaster = nullptr; + } + return true; +} + +bool RenderableKameleonVolume::isReady() const { + return true; +} + +void RenderableKameleonVolume::update(const UpdateData& data) { + if (_raycaster) { + _raycaster->setStepSize(_stepSize); + } +} + +void RenderableKameleonVolume::render(const RenderData& data, RendererTasks& tasks) { + RaycasterTask task{ _raycaster.get(), data }; + tasks.raycasterTasks.push_back(task); +} + +} diff --git a/modules/kameleonvolume/rendering/renderablekameleonvolume.h b/modules/kameleonvolume/rendering/renderablekameleonvolume.h new file mode 100644 index 0000000000..96b7febd7d --- /dev/null +++ b/modules/kameleonvolume/rendering/renderablekameleonvolume.h @@ -0,0 +1,95 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#ifndef __RENDERABLEKAMELEONVOLUME_H__ +#define __RENDERABLEKAMELEONVOLUME_H__ + +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + + +namespace openspace { + +struct RenderData; + +class RenderableKameleonVolume : public Renderable { +public: + RenderableKameleonVolume(const ghoul::Dictionary& dictionary); + ~RenderableKameleonVolume(); + + bool initialize() override; + bool deinitialize() override; + bool isReady() const override; + void render(const RenderData& data, RendererTasks& tasks) override; + void update(const UpdateData& data) override; + bool cachingEnabled(); + +private: + void load(); + void loadFromPath(const std::string& path); + void loadRaw(const std::string& path); + void loadCdf(const std::string& path); + void storeRaw(const std::string& path); + + std::string cacheSuffix(); + void updateTextureFromVolume(); + + properties::UVec3Property _dimensions; + properties::StringProperty _variable; + properties::Vec3Property _lowerDomainBound; + properties::Vec3Property _upperDomainBound; + bool _autoDomainBounds; + + properties::FloatProperty _lowerValueBound; + properties::FloatProperty _upperValueBound; + bool _autoValueBounds; + + properties::OptionProperty _gridType; + bool _autoGridType; + + properties::FloatProperty _stepSize; + properties::StringProperty _sourcePath; + properties::StringProperty _transferFunctionPath; + properties::BoolProperty _cache; + + + std::unique_ptr> _rawVolume; + std::unique_ptr> _normalizedVolume; + std::unique_ptr _raycaster; + + std::shared_ptr _volumeTexture; + std::shared_ptr _transferFunction; +}; +} + +#endif // __RENDERABLETOYVOLUME_H__ diff --git a/modules/kameleonvolume/shaders/boundsfs.glsl b/modules/kameleonvolume/shaders/boundsfs.glsl new file mode 100644 index 0000000000..bb4f9c8cd3 --- /dev/null +++ b/modules/kameleonvolume/shaders/boundsfs.glsl @@ -0,0 +1,40 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +in vec3 vPosition; +in vec4 worldPosition; + +#include "PowerScaling/powerScaling_fs.hglsl" +#include "fragment.glsl" + +Fragment getFragment() { + vec4 fragColor = vec4(vPosition+0.5, 1.0); + vec4 position = worldPosition; + float depth = pscDepth(position); + + Fragment frag; + frag.color = fragColor; + frag.depth = depth; + return frag; +} diff --git a/modules/kameleonvolume/shaders/boundsvs.glsl b/modules/kameleonvolume/shaders/boundsvs.glsl new file mode 100644 index 0000000000..8bde15f7f9 --- /dev/null +++ b/modules/kameleonvolume/shaders/boundsvs.glsl @@ -0,0 +1,46 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 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. * + ****************************************************************************************/ + +#version __CONTEXT__ + +layout(location = 0) in vec4 vertPosition; + +uniform mat4 viewProjection; + +out vec3 vPosition; +out vec4 worldPosition; + +#include "PowerScaling/powerScaling_vs.hglsl" + +void main() { + vPosition = vertPosition.xyz; + worldPosition = vertPosition; + + vec4 position = pscTransform(worldPosition, mat4(1.0)); + + // project the position to view space + gl_Position = viewProjection * position; + + gl_Position.z = 1.0; +} diff --git a/modules/kameleonvolume/shaders/helper.glsl b/modules/kameleonvolume/shaders/helper.glsl new file mode 100644 index 0000000000..a144abecdb --- /dev/null +++ b/modules/kameleonvolume/shaders/helper.glsl @@ -0,0 +1,19 @@ +#define KAMELEON_PI 3.14159265358979323846 /* pi */ +#define KAMELEON_SQRT1_3 0.57735026919 /* 1/sqrt(3) */ + +vec3 kameleon_cartesianToSpherical(vec3 _cartesian) { + // Put cartesian in [-1..1] range first + vec3 cartesian = vec3(-1.0,-1.0,-1.0) + _cartesian * 2.0f; + + float r = length(cartesian); + float theta, phi; + + if (r == 0.0) { + theta = phi = 0.0; + } else { + theta = acos(cartesian.z/r) / KAMELEON_PI; + phi = (KAMELEON_PI + atan(cartesian.y, cartesian.x)) / (2.0*KAMELEON_PI ); + } + r *= KAMELEON_SQRT1_3; + return vec3(r, theta, phi); +} \ No newline at end of file diff --git a/modules/kameleonvolume/shaders/raycast.glsl b/modules/kameleonvolume/shaders/raycast.glsl new file mode 100644 index 0000000000..7de501504b --- /dev/null +++ b/modules/kameleonvolume/shaders/raycast.glsl @@ -0,0 +1,62 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 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. * + ****************************************************************************************/ + +uniform float maxStepSize#{id} = 0.02; +uniform sampler3D volumeTexture_#{id}; +uniform sampler1D transferFunction_#{id}; +uniform int gridType_#{id} = 0; + + +void sample#{id}(vec3 samplePos, + vec3 dir, + inout vec3 accumulatedColor, + inout vec3 accumulatedAlpha, + inout float stepSize) { + + vec3 transformedPos = samplePos; + if (gridType_#{id} == 1) { + transformedPos = kameleon_cartesianToSpherical(samplePos); + } + + float val = texture(volumeTexture_#{id}, transformedPos).r; + vec4 color = texture(transferFunction_#{id}, val); + vec3 backColor = color.rgb; + vec3 backAlpha = color.aaa; + + backColor *= stepSize; + backAlpha *= stepSize; + + backColor = clamp(backColor, 0.0, 1.0); + backAlpha = clamp(backAlpha, 0.0, 1.0); + + vec3 oneMinusFrontAlpha = vec3(1.0) - accumulatedAlpha; + accumulatedColor += oneMinusFrontAlpha * backColor; + accumulatedAlpha += oneMinusFrontAlpha * backAlpha; + + stepSize = maxStepSize#{id}; +} + +float stepSize#{id}(vec3 samplePos, vec3 dir) { + return maxStepSize#{id}; +} diff --git a/modules/kameleonvolume/tasks/kameleondocumentationtask.cpp b/modules/kameleonvolume/tasks/kameleondocumentationtask.cpp new file mode 100644 index 0000000000..3ce8d2c249 --- /dev/null +++ b/modules/kameleonvolume/tasks/kameleondocumentationtask.cpp @@ -0,0 +1,162 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#include +#include + +#include +#include + +#include +#include + +#include +#include + +namespace { + const std::string KeyInput = "Input"; + const std::string KeyOutput = "Output"; + const std::string MainTemplateFilename = "${OPENSPACE_DATA}/web/kameleondocumentation/main.hbs"; + const std::string HandlebarsFilename = "${OPENSPACE_DATA}/web/common/handlebars-v4.0.5.js"; + const std::string JsFilename = "${OPENSPACE_DATA}/web/kameleondocumentation/script.js"; + const std::string BootstrapFilename = "${OPENSPACE_DATA}/web/common/bootstrap.min.css"; + const std::string CssFilename = "${OPENSPACE_DATA}/web/common/style.css"; +} + +namespace openspace { + +KameleonDocumentationTask::KameleonDocumentationTask(const ghoul::Dictionary& dictionary) { + openspace::documentation::testSpecificationAndThrow( + documentation(), + dictionary, + "KameleonDocumentationTask" + ); + + _inputPath = absPath(dictionary.value(KeyInput)); + _outputPath = absPath(dictionary.value(KeyOutput)); +} + +std::string KameleonDocumentationTask::description() { + return "Extract metadata from cdf-file " + _inputPath + " and output html documentation to " + _outputPath; +} + +void KameleonDocumentationTask::perform(const Task::ProgressCallback & progressCallback) { + KameleonVolumeReader reader(_inputPath); + ghoul::Dictionary kameleonDictionary = reader.readMetaData(); + progressCallback(0.33f); + ghoul::DictionaryJsonFormatter formatter; + + + ghoul::Dictionary dictionary; + dictionary.setValue("kameleon", kameleonDictionary); + dictionary.setValue("version", std::to_string(OPENSPACE_VERSION_MAJOR) + "." + + std::to_string(OPENSPACE_VERSION_MINOR) + "." + + std::to_string(OPENSPACE_VERSION_PATCH)); + dictionary.setValue("input", _inputPath); + + std::string json = formatter.format(dictionary); + progressCallback(0.66f); + + std::ifstream handlebarsInput(absPath(HandlebarsFilename)); + std::ifstream jsInput(absPath(JsFilename)); + + std::string jsContent; + std::back_insert_iterator jsInserter(jsContent); + + std::copy(std::istreambuf_iterator{handlebarsInput}, std::istreambuf_iterator(), jsInserter); + std::copy(std::istreambuf_iterator{jsInput}, std::istreambuf_iterator(), jsInserter); + + std::ifstream bootstrapInput(absPath(BootstrapFilename)); + std::ifstream cssInput(absPath(CssFilename)); + + std::string cssContent; + std::back_insert_iterator cssInserter(cssContent); + + std::copy(std::istreambuf_iterator{bootstrapInput}, std::istreambuf_iterator(), cssInserter); + std::copy(std::istreambuf_iterator{cssInput}, std::istreambuf_iterator(), cssInserter); + + std::ifstream mainTemplateInput(absPath(MainTemplateFilename)); + std::string mainTemplateContent{ std::istreambuf_iterator{mainTemplateInput}, + std::istreambuf_iterator{}}; + + std::ofstream file; + file.exceptions(~std::ofstream::goodbit); + file.open(_outputPath); + + std::stringstream html; + html << "\n" + << "\n" + << "\t\n" + << "\t\t\n" + << "\t\t\n" + << "\t\n" + << "\t\n" + << "\t\tDocumentation\n" + << "\t\n" + << "\t\n" + << "\t\n" + << "\n"; + + file << html.str(); + + progressCallback(1.0f); +} + +Documentation KameleonDocumentationTask::documentation() +{ + using namespace documentation; + return { + "KameleonDocumentationTask", + "kameleon_documentation_task", + { + { + "Type", + new StringEqualVerifier("KameleonDocumentationTask"), + "The type of this task" + }, + { + KeyInput, + new StringAnnotationVerifier("A file path to a cdf file"), + "The cdf file to extract data from" + }, + { + KeyOutput, + new StringAnnotationVerifier("A valid filepath"), + "The html file to write documentation to" + } + } + }; +} + + + +} // namespace openspace diff --git a/modules/kameleonvolume/tasks/kameleondocumentationtask.h b/modules/kameleonvolume/tasks/kameleondocumentationtask.h new file mode 100644 index 0000000000..d86e7ed5d5 --- /dev/null +++ b/modules/kameleonvolume/tasks/kameleondocumentationtask.h @@ -0,0 +1,46 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#ifndef __KAMELEONDOCUMENTAIONTASK_H__ +#define __KAMELEONDOCUMENTAIONTASK_H__ + +#include + +namespace openspace { + +class KameleonDocumentationTask : public Task { +public: + KameleonDocumentationTask(const ghoul::Dictionary& dictionary); + std::string description() override; + void perform(const Task::ProgressCallback& progressCallback) override; + static Documentation documentation(); +private: + std::string _inputPath; + std::string _outputPath; +}; + +} + + +#endif __KAMELEONDOCUMENTAIONTASK_H__ \ No newline at end of file diff --git a/modules/kameleonvolume/tasks/kameleonmetadatatojsontask.cpp b/modules/kameleonvolume/tasks/kameleonmetadatatojsontask.cpp new file mode 100644 index 0000000000..df1e748c2a --- /dev/null +++ b/modules/kameleonvolume/tasks/kameleonmetadatatojsontask.cpp @@ -0,0 +1,94 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include + +namespace { + const std::string KeyInput = "Input"; + const std::string KeyOutput = "Output"; +} + +namespace openspace { + +KameleonMetadataToJsonTask::KameleonMetadataToJsonTask(const ghoul::Dictionary& dictionary) { + openspace::documentation::testSpecificationAndThrow( + documentation(), + dictionary, + "KameleonMetadataToJsonTask" + ); + + _inputPath = absPath(dictionary.value(KeyInput)); + _outputPath = absPath(dictionary.value(KeyOutput)); +} + +std::string KameleonMetadataToJsonTask::description() { + return "Extract metadata from cdf-file " + _inputPath + " and write as json to " + _outputPath; +} + +void KameleonMetadataToJsonTask::perform(const Task::ProgressCallback & progressCallback) { + KameleonVolumeReader reader(_inputPath); + ghoul::Dictionary dictionary = reader.readMetaData(); + progressCallback(0.5f); + ghoul::DictionaryJsonFormatter formatter; + std::string json = formatter.format(dictionary); + std::ofstream output(_outputPath); + output << json; + progressCallback(1.0f); +} + +Documentation KameleonMetadataToJsonTask::documentation() +{ + using namespace documentation; + return { + "KameleonMetadataToJsonTask", + "kameleon_metadata_to_json_task", + { + { + "Type", + new StringEqualVerifier("KameleonMetadataToJsonTask"), + "The type of this task" + }, + { + KeyInput, + new StringAnnotationVerifier("A file path to a cdf file"), + "The cdf file to extract data from" + }, + { + KeyOutput, + new StringAnnotationVerifier("A valid filepath"), + "The json file to export data into" + } + } + }; +} + + + +} // namespace openspace diff --git a/modules/kameleonvolume/tasks/kameleonmetadatatojsontask.h b/modules/kameleonvolume/tasks/kameleonmetadatatojsontask.h new file mode 100644 index 0000000000..3a1a732034 --- /dev/null +++ b/modules/kameleonvolume/tasks/kameleonmetadatatojsontask.h @@ -0,0 +1,46 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#ifndef __KAMELEONMETADATATOJSONTASK_H__ +#define __KAMELEONMETADATATOJSONTASK_H__ + +#include + +namespace openspace { + +class KameleonMetadataToJsonTask : public Task { +public: + KameleonMetadataToJsonTask(const ghoul::Dictionary& dictionary); + std::string description() override; + void perform(const Task::ProgressCallback& progressCallback) override; + static Documentation documentation(); +private: + std::string _inputPath; + std::string _outputPath; +}; + +} + + +#endif __KAMELEONMETADATATOJSONTASK_H__ \ No newline at end of file diff --git a/modules/multiresvolume/rendering/multiresvolumeraycaster.cpp b/modules/multiresvolume/rendering/multiresvolumeraycaster.cpp index 5d9c2ed3ba..5406ce7b85 100644 --- a/modules/multiresvolume/rendering/multiresvolumeraycaster.cpp +++ b/modules/multiresvolume/rendering/multiresvolumeraycaster.cpp @@ -47,7 +47,8 @@ namespace { namespace openspace { -MultiresVolumeRaycaster::MultiresVolumeRaycaster(std::shared_ptr tsp, +MultiresVolumeRaycaster::MultiresVolumeRaycaster( + std::shared_ptr tsp, std::shared_ptr atlasManager, std::shared_ptr transferFunction) : _tsp(tsp) @@ -112,11 +113,9 @@ void MultiresVolumeRaycaster::preRaycast(const RaycastData& data, ghoul::opengl: _atlasManager->textureAtlas().bind(); program.setUniform("textureAtlas_" + id, _atlasUnit->unitNumber()); - _atlasMapBinding = std::make_unique>(); glBindBufferBase(GL_SHADER_STORAGE_BUFFER, _atlasMapBinding->bindingNumber(), _atlasManager->atlasMapBuffer()); program.setSsboBinding("atlasMapBlock_" + id, _atlasMapBinding->bindingNumber()); - program.setUniform("gridType_" + id, static_cast(_tsp->header().gridType_)); program.setUniform("maxNumBricksPerAxis_" + id, static_cast(_tsp->header().xNumBricks_)); @@ -155,7 +154,8 @@ bool MultiresVolumeRaycaster::cameraIsInside(const RenderData& data, glm::vec3& } void MultiresVolumeRaycaster::postRaycast(const RaycastData& data, ghoul::opengl::ProgramObject& program) { - // For example: release texture units + _textureUnit = nullptr; + _tfUnit = nullptr; } std::string MultiresVolumeRaycaster::getBoundsVsPath() const { diff --git a/modules/volume/CMakeLists.txt b/modules/volume/CMakeLists.txt index 09c6d8efde..8373907875 100644 --- a/modules/volume/CMakeLists.txt +++ b/modules/volume/CMakeLists.txt @@ -26,7 +26,10 @@ include(${OPENSPACE_CMAKE_EXT_DIR}/module_definition.cmake) set(HEADER_FILES ${CMAKE_CURRENT_SOURCE_DIR}/rawvolume.h +<<<<<<< HEAD ${CMAKE_CURRENT_SOURCE_DIR}/rawvolume.inl +======= +>>>>>>> 4bf7b71... Add support for converting and rendering volumetric data in the cdf format. Replace DataConverter by a more general purpose TaskRunner. ${CMAKE_CURRENT_SOURCE_DIR}/rawvolumereader.h ${CMAKE_CURRENT_SOURCE_DIR}/rawvolumereader.inl ${CMAKE_CURRENT_SOURCE_DIR}/rawvolumewriter.h diff --git a/modules/volume/rawvolume.h b/modules/volume/rawvolume.h index 065ff16faa..30be87bcd6 100644 --- a/modules/volume/rawvolume.h +++ b/modules/volume/rawvolume.h @@ -25,25 +25,31 @@ #ifndef __OPENSPACE_MODULE_VOLUME___RAWVOLUME___H__ #define __OPENSPACE_MODULE_VOLUME___RAWVOLUME___H__ +#include +#include +#include + namespace openspace { template class RawVolume { public: typedef Voxel VoxelType; - RawVolume(const glm::ivec3& dimensions); - glm::ivec3 dimensions() const; - void setDimensions(const glm::ivec3& dimensions); - VoxelType get(const glm::ivec3& coordinates) const; + RawVolume(const glm::uvec3& dimensions); + glm::uvec3 dimensions() const; + void setDimensions(const glm::uvec3& dimensions); + size_t nCells() const; + VoxelType get(const glm::uvec3& coordinates) const; VoxelType get(const size_t index) const; - void set(const glm::ivec3& coordinates, const VoxelType& value); + void set(const glm::uvec3& coordinates, const VoxelType& value); void set(size_t index, const VoxelType& value); - void forEachVoxel(const std::function& fn); + void forEachVoxel(const std::function& fn); + const VoxelType* data() const; + size_t coordsToIndex(const glm::uvec3& cartesian) const; + glm::uvec3 indexToCoords(size_t linear) const; VoxelType* data(); private: - size_t coordsToIndex(const glm::ivec3& cartesian) const; - glm::ivec3 indexToCoords(size_t linear) const; - glm::ivec3 _dimensions; + glm::uvec3 _dimensions; std::vector _data; }; diff --git a/modules/volume/rawvolume.inl b/modules/volume/rawvolume.inl index 66cfb70b37..3606e2cd0f 100644 --- a/modules/volume/rawvolume.inl +++ b/modules/volume/rawvolume.inl @@ -23,31 +23,39 @@ ****************************************************************************************/ #include +#include "rawvolume.h" namespace openspace { template -RawVolume::RawVolume(const glm::ivec3& dimensions) +RawVolume::RawVolume(const glm::uvec3& dimensions) : _dimensions(dimensions) , _data(static_cast(dimensions.x) * static_cast(dimensions.y) * static_cast(dimensions.z)) {} template -glm::ivec3 RawVolume::dimensions() const { +glm::uvec3 RawVolume::dimensions() const { return _dimensions; } template -void RawVolume::setDimensions(const glm::ivec3& dimensions) { +void RawVolume::setDimensions(const glm::uvec3& dimensions) { _dimensions = dimensions; - _data.resize(static_cast(dimensions.x) * - static_cast(dimensions.y) * - static_cast(dimensions.z)); + _data.resize(nCells()); +} + +template +size_t RawVolume::nCells() const +{ + return static_cast( + static_cast(_dimensions.x) * + static_cast(_dimensions.y) * + static_cast(_dimensions.z)); } template -VoxelType RawVolume::get(const glm::ivec3& coordinates) const { +VoxelType RawVolume::get(const glm::uvec3& coordinates) const { return get(coordsToIndex(coordinates, dimensions())); } @@ -57,7 +65,7 @@ VoxelType RawVolume::get(size_t index) const { } template -void RawVolume::set(const glm::ivec3& coordinates, const VoxelType& value) { +void RawVolume::set(const glm::uvec3& coordinates, const VoxelType& value) { return set(coordsToIndex(coordinates, dimensions()), value); } @@ -68,27 +76,21 @@ void RawVolume::set(size_t index, const VoxelType& value) { template void RawVolume::forEachVoxel( - const std::function& fn) + const std::function& fn) { - - glm::ivec3 dims = dimensions(); - size_t nVals = static_cast(dims.x) * - static_cast(dims.y) * - static_cast(dims.z); - - for (size_t i = 0; i < nVals; i++) { + for (size_t i = 0; i < nCells(); i++) { glm::ivec3 coords = indexToCoords(i); fn(coords, _data[i]); } } template -size_t RawVolume::coordsToIndex(const glm::ivec3& cartesian) const { +size_t RawVolume::coordsToIndex(const glm::uvec3& cartesian) const { return volumeutils::coordsToIndex(cartesian, dimensions()); } template -glm::ivec3 RawVolume::indexToCoords(size_t linear) const { +glm::uvec3 RawVolume::indexToCoords(size_t linear) const { return volumeutils::indexToCoords(linear, dimensions()); } @@ -96,5 +98,11 @@ template VoxelType* RawVolume::data() { return _data.data(); } + +template +const VoxelType* RawVolume::data() const { + return _data.data(); +} + } diff --git a/modules/volume/rawvolumereader.h b/modules/volume/rawvolumereader.h index 8e915477e4..d696ca763d 100644 --- a/modules/volume/rawvolumereader.h +++ b/modules/volume/rawvolumereader.h @@ -34,18 +34,18 @@ template class RawVolumeReader { public: typedef Voxel VoxelType; - RawVolumeReader(const std::string& path, const glm::ivec3& dimensions); - glm::ivec3 dimensions() const; + RawVolumeReader(const std::string& path, const glm::uvec3& dimensions); + glm::uvec3 dimensions() const; std::string path() const; void setPath(const std::string& path); - void setDimensions(const glm::ivec3& dimensions); + void setDimensions(const glm::uvec3& dimensions); //VoxelType get(const glm::ivec3& coordinates) const; // TODO: Implement this //VoxelType get(const size_t index) const; // TODO: Implement this std::unique_ptr> read(); private: - size_t coordsToIndex(const glm::ivec3& cartesian) const; - glm::ivec3 indexToCoords(size_t linear) const; - glm::ivec3 _dimensions; + size_t coordsToIndex(const glm::uvec3& cartesian) const; + glm::uvec3 indexToCoords(size_t linear) const; + glm::uvec3 _dimensions; std::string _path; }; diff --git a/modules/volume/rawvolumereader.inl b/modules/volume/rawvolumereader.inl index 601968ee95..a00a464503 100644 --- a/modules/volume/rawvolumereader.inl +++ b/modules/volume/rawvolumereader.inl @@ -28,18 +28,18 @@ namespace openspace { template RawVolumeReader::RawVolumeReader(const std::string& path, - const glm::ivec3& dimensions) + const glm::uvec3& dimensions) : _path(path) , _dimensions(dimensions) {} template -glm::ivec3 RawVolumeReader::dimensions() const { +glm::uvec3 RawVolumeReader::dimensions() const { return _dimensions; } template -void RawVolumeReader::setDimensions(const glm::ivec3& dimensions) { +void RawVolumeReader::setDimensions(const glm::uvec3& dimensions) { _dimensions = dimensions; } @@ -68,19 +68,19 @@ VoxelType RawVolumeReader::get(size_t index) const { }*/ template -size_t RawVolumeReader::coordsToIndex(const glm::ivec3& cartesian) const { +size_t RawVolumeReader::coordsToIndex(const glm::uvec3& cartesian) const { return volumeutils::coordsToIndex(cartesian, dimensions()); } template -glm::ivec3 RawVolumeReader::indexToCoords(size_t linear) const { +glm::uvec3 RawVolumeReader::indexToCoords(size_t linear) const { return volumeutils::indexToCoords(linear, dimensions()); } template std::unique_ptr> RawVolumeReader::read() { - glm::ivec3 dims = dimensions(); + glm::uvec3 dims = dimensions(); std::unique_ptr> volume = std::make_unique>(dims); diff --git a/modules/volume/rawvolumewriter.h b/modules/volume/rawvolumewriter.h index 39988edcbb..ec0cdf28f1 100644 --- a/modules/volume/rawvolumewriter.h +++ b/modules/volume/rawvolumewriter.h @@ -36,13 +36,13 @@ class RawVolumeWriter { public: RawVolumeWriter(std::string path, size_t bufferSize = 1024); void setPath(const std::string& path); - glm::ivec3 dimensions() const; - void setDimensions(const glm::ivec3& dimensions); - void write(const std::function& fn, + glm::uvec3 dimensions() const; + void setDimensions(const glm::uvec3& dimensions); + void write(const std::function& fn, const std::function& onProgress = [](float t) {}); void write(const RawVolume& volume); - size_t coordsToIndex(const glm::ivec3& coords) const; + size_t coordsToIndex(const glm::uvec3& coords) const; glm::ivec3 indexToCoords(size_t linear) const; private: glm::ivec3 _dimensions; diff --git a/modules/volume/rawvolumewriter.inl b/modules/volume/rawvolumewriter.inl index b45ff93dcc..3709368361 100644 --- a/modules/volume/rawvolumewriter.inl +++ b/modules/volume/rawvolumewriter.inl @@ -33,7 +33,7 @@ template , _bufferSize(bufferSize) {} template -size_t RawVolumeWriter::coordsToIndex(const glm::ivec3& cartesian) const { +size_t RawVolumeWriter::coordsToIndex(const glm::uvec3& cartesian) const { return volumeutils::coordsToIndex(cartesian, dimensions()); } @@ -43,21 +43,21 @@ glm::ivec3 RawVolumeWriter::indexToCoords(size_t linear) const { } template - void RawVolumeWriter::setDimensions(const glm::ivec3& dimensions) { +void RawVolumeWriter::setDimensions(const glm::uvec3& dimensions) { _dimensions = dimensions; } template - glm::ivec3 RawVolumeWriter::dimensions() const { +glm::uvec3 RawVolumeWriter::dimensions() const { return _dimensions; } template -void RawVolumeWriter::write(const std::function& fn, +void RawVolumeWriter::write(const std::function& fn, const std::function& onProgress) { - glm::ivec3 dims = dimensions(); + glm::uvec3 dims = dimensions(); size_t size = static_cast(dims.x) * static_cast(dims.y) * @@ -86,14 +86,11 @@ void RawVolumeWriter::write(const std::function void RawVolumeWriter::write(const RawVolume& volume) { - glm::ivec3 dims = dimensions(); - ghoul_assert(dims == volume.dims(), "Dimensions of input and output volume must agree"); + setDimensions(volume.dimensions()); + reinterpret_cast(volume.data()); - const char* buffer = reinterpret_cast(volume.data()); - size_t length = static_cast(dims.x) * - static_cast(dims.y) * - static_cast(dims.z) * - sizeof(VoxelType); + const char* const buffer = reinterpret_cast(volume.data()); + size_t length = volume.nCells() * sizeof(VoxelType); std::ofstream file(_path, std::ios::binary); file.write(buffer, length); diff --git a/modules/volume/volumegridtype.h b/modules/volume/volumegridtype.h new file mode 100644 index 0000000000..6ff5027861 --- /dev/null +++ b/modules/volume/volumegridtype.h @@ -0,0 +1,33 @@ +/***************************************************************************************** +* * +* 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. * +****************************************************************************************/ + +#ifndef __VOLUMEGRIDTYPE_H__ +#define __VOLUMEGRIDTYPE_H__ + +enum class VolumeGridType : int { + Cartesian = 0, + Spherical = 1 +}; + +#endif \ No newline at end of file diff --git a/modules/volume/volumeutils.cpp b/modules/volume/volumeutils.cpp index 934a8388f7..0e4b4c60ac 100644 --- a/modules/volume/volumeutils.cpp +++ b/modules/volume/volumeutils.cpp @@ -27,7 +27,7 @@ namespace openspace { namespace volumeutils { -size_t coordsToIndex(const glm::vec3& coords, const glm::ivec3& dims) { +size_t coordsToIndex(const glm::uvec3& coords, const glm::uvec3& dims) { size_t w = dims.x; size_t h = dims.y; // size_t d = dims.z; @@ -39,7 +39,7 @@ size_t coordsToIndex(const glm::vec3& coords, const glm::ivec3& dims) { return coords.z * (h * w) + coords.y * w + coords.x; } -glm::vec3 indexToCoords(size_t index, const glm::ivec3& dims) { +glm::uvec3 indexToCoords(size_t index, const glm::uvec3& dims) { size_t w = dims.x; size_t h = dims.y; size_t d = dims.z; @@ -48,7 +48,7 @@ glm::vec3 indexToCoords(size_t index, const glm::ivec3& dims) { size_t y = (index / w) % h; size_t z = index / w / h; - return glm::ivec3(x, y, z); + return glm::uvec3(x, y, z); } } // namespace volumeutils diff --git a/modules/volume/volumeutils.h b/modules/volume/volumeutils.h index cf7aeaef13..a8cab23b72 100644 --- a/modules/volume/volumeutils.h +++ b/modules/volume/volumeutils.h @@ -30,8 +30,8 @@ namespace openspace { namespace volumeutils { -size_t coordsToIndex(const glm::vec3& coords, const glm::ivec3& dimensions); -glm::vec3 indexToCoords(size_t index, const glm::ivec3& dimensions); +size_t coordsToIndex(const glm::uvec3& coords, const glm::uvec3& dimensions); +glm::uvec3 indexToCoords(size_t index, const glm::uvec3& dimensions); } // namespace volumeutils diff --git a/openspace.cfg b/openspace.cfg index a1de1e185d..6848a95040 100644 --- a/openspace.cfg +++ b/openspace.cfg @@ -23,8 +23,8 @@ return { -- Sets the scene that is to be loaded by OpenSpace. A scene file is a description -- of all entities that will be visible during an instance of OpenSpace - Scene = "${SCENE}/default.scene", - + Scene = "${SCENE}/volumes.scene", + Task = "${TASKS}/default.task", -- Scene = "${SCENE}/globebrowsing.scene", -- Scene = "${SCENE}/rosetta.scene", -- Scene = "${SCENE}/dawn.scene", @@ -37,6 +37,7 @@ return { SHADERS = "${BASE_PATH}/shaders", OPENSPACE_DATA = "${BASE_PATH}/data", SCENE = "${OPENSPACE_DATA}/scene", + TASKS = "${OPENSPACE_DATA}/tasks", SPICE = "${OPENSPACE_DATA}/spice", MODULES = "${BASE_PATH}/modules", TESTDIR = "${BASE_PATH}/tests", diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9727ee0ca3..5e962ddabf 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -152,6 +152,8 @@ set(OPENSPACE_SOURCE ${OPENSPACE_BASE_DIR}/src/util/syncbuffer.cpp ${OPENSPACE_BASE_DIR}/src/util/syncdata.cpp ${OPENSPACE_BASE_DIR}/src/util/histogram.cpp + ${OPENSPACE_BASE_DIR}/src/util/task.cpp + ${OPENSPACE_BASE_DIR}/src/util/taskloader.cpp ${OPENSPACE_BASE_DIR}/src/util/time.cpp ${OPENSPACE_BASE_DIR}/src/util/timemanager.cpp ${OPENSPACE_BASE_DIR}/src/util/time_lua.inl @@ -293,6 +295,8 @@ set(OPENSPACE_HEADER ${OPENSPACE_BASE_DIR}/include/openspace/util/spicemanager.h ${OPENSPACE_BASE_DIR}/include/openspace/util/syncbuffer.h ${OPENSPACE_BASE_DIR}/include/openspace/util/syncdata.h + ${OPENSPACE_BASE_DIR}/include/openspace/util/task.h + ${OPENSPACE_BASE_DIR}/include/openspace/util/taskloader.h ${OPENSPACE_BASE_DIR}/include/openspace/util/time.h ${OPENSPACE_BASE_DIR}/include/openspace/util/timemanager.h ${OPENSPACE_BASE_DIR}/include/openspace/util/timerange.h diff --git a/src/engine/configurationmanager.cpp b/src/engine/configurationmanager.cpp index 0032aaebbd..54a1c0c73d 100644 --- a/src/engine/configurationmanager.cpp +++ b/src/engine/configurationmanager.cpp @@ -57,6 +57,7 @@ const string ConfigurationManager::KeyKeyboardShortcuts = "KeyboardShortcuts"; const string ConfigurationManager::KeyDocumentation = "Documentation"; const string ConfigurationManager::KeyFactoryDocumentation = "FactoryDocumentation"; const string ConfigurationManager::KeyConfigScene = "Scene"; +const string ConfigurationManager::KeyConfigTask = "Task"; const string ConfigurationManager::KeyLogging = "Logging"; const string ConfigurationManager::PartLogLevel = "LogLevel"; diff --git a/src/engine/configurationmanager_doc.inl b/src/engine/configurationmanager_doc.inl index 68f699ccfc..57589f5d02 100644 --- a/src/engine/configurationmanager_doc.inl +++ b/src/engine/configurationmanager_doc.inl @@ -52,6 +52,14 @@ documentation::Documentation ConfigurationManager::Documentation() { "the Scene documentation.", Optional::No }, + { + ConfigurationManager::KeyConfigTask, + new StringAnnotationVerifier( + "A valid task file as described in the Task documentation"), + "The root task to be performed when launching the task runner " + "applicaition.", + Optional::Yes + }, { ConfigurationManager::KeyPaths, new StringListVerifier, diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index 66e6f2caf2..efff2e5f31 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -50,6 +50,7 @@ #include #include #include +#include #include #include #include @@ -165,6 +166,10 @@ OpenSpaceEngine::OpenSpaceEngine(std::string programName, std::make_unique>(), "Scale" ); + FactoryManager::ref().addFactory( + std::make_unique>(), + "Task" + ); SpiceManager::initialize(); Time::initialize(); diff --git a/src/util/progressbar.cpp b/src/util/progressbar.cpp index 9f650e782b..3d9b78d76b 100644 --- a/src/util/progressbar.cpp +++ b/src/util/progressbar.cpp @@ -42,7 +42,7 @@ ProgressBar::~ProgressBar() { } void ProgressBar::print(int current) { - float progress = static_cast(current) / static_cast(_end - 1); + float progress = static_cast(current) / static_cast(_end); int iprogress = static_cast(progress*100.0f); if (iprogress != _previous) { int pos = static_cast(static_cast(_width)* progress); diff --git a/src/util/task.cpp b/src/util/task.cpp new file mode 100644 index 0000000000..40eaf06866 --- /dev/null +++ b/src/util/task.cpp @@ -0,0 +1,70 @@ +/***************************************************************************************** +* * +* 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. * +****************************************************************************************/ + +#include +#include +#include +#include +#include + +namespace { + const std::string _loggerCat = "Task"; +} + +namespace openspace { + +Documentation Task::documentation() { + using namespace openspace::documentation; + return{ + "Renderable", + "renderable", + { + { + "Type", + new StringAnnotationVerifier("A valid Task created by a factory"), + "This key specifies the type of Task that gets created. It has to be one" + "of the valid Tasks that are available for creation (see the " + "FactoryDocumentation for a list of possible Tasks), which depends on " + "the configration of the application", + Optional::No + } + } + }; +} + +std::unique_ptr Task::createFromDictionary(const ghoul::Dictionary& dictionary) { + openspace::documentation::testSpecificationAndThrow(Documentation(), dictionary, "Task"); + std::string taskType = dictionary.value("Type"); + auto factory = FactoryManager::ref().factory(); + Task *task = factory->create(taskType, dictionary); + + if (task == nullptr) { + LERROR("Failed to create a Task object of type '" << taskType << "'"); + return nullptr; + } + + return std::unique_ptr(task); +} + +} \ No newline at end of file diff --git a/src/util/taskloader.cpp b/src/util/taskloader.cpp new file mode 100644 index 0000000000..c4a800cb7b --- /dev/null +++ b/src/util/taskloader.cpp @@ -0,0 +1,89 @@ +/***************************************************************************************** +* * +* 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. * +****************************************************************************************/ + +#include + +#include +#include +#include +#include + +#include +#include +#include + +namespace { + const std::string _loggerCat = "TaskRunner"; +} + +namespace openspace { + + +std::vector> TaskLoader::tasksFromDictionary(const ghoul::Dictionary& tasksDictionary) { + std::vector> tasks; + std::vector keys = tasksDictionary.keys(); + for (const std::string key : keys) { + std::string taskName; + ghoul::Dictionary subTask; + if (tasksDictionary.getValue(key, taskName)) { + std::string path = "${TASKS}/" + taskName + ".task"; + std::vector> subTasks = tasksFromFile(path); + std::move(subTasks.begin(), subTasks.end(), std::back_inserter(tasks)); + } else if (tasksDictionary.getValue(key, subTask)) { + std::string taskType = subTask.value("Type"); + std::unique_ptr task = Task::createFromDictionary(subTask); + if (task == nullptr) { + LERROR("Failed to create a Task object of type '" << taskType << "'"); + } + tasks.push_back(std::move(task)); + } + } + return tasks; +} + +std::vector> TaskLoader::tasksFromFile(const std::string& path) { + std::string absTasksFile = absPath(path); + using RawPath = ghoul::filesystem::FileSystem::RawPath; + if (!FileSys.fileExists(absTasksFile, RawPath::Yes)) { + LERROR("Could not load tasks file '" << absTasksFile << "'. " << + "File not found"); + return std::vector>(); + } + + ghoul::Dictionary tasksDictionary; + try { + ghoul::lua::loadDictionaryFromFile( + absTasksFile, + tasksDictionary + ); + } catch (...) { + LERROR("Could not load tasks file '" << absTasksFile << "'. " << + "Lua parse error"); + return std::vector>(); + } + return tasksFromDictionary(tasksDictionary); +} + + +} \ No newline at end of file From 686fec4f9df97460539c532d82cc52b75153c1ef Mon Sep 17 00:00:00 2001 From: Emil Axelsson Date: Wed, 26 Oct 2016 14:43:37 +0200 Subject: [PATCH 64/96] Add Spice kernels for Mercury and Saturn magnetosphere rendering, implement inside volume rendering for kameleon volumes Conflicts: data/scene/mercury/mercury.mod data/scene/saturn/saturn/saturn.mod --- data/scene/mercury/mercury.mod | 4 +- data/scene/saturn/saturn/saturn.mod | 5 +- data/spice/iSWAKernels/openspace_SE.ti | 76 +++++++++++++++++++ include/openspace/rendering/abufferrenderer.h | 7 +- modules/kameleon/include/kameleonwrapper.h | 1 - modules/kameleon/src/kameleonwrapper.cpp | 20 ----- .../rendering/kameleonvolumeraycaster.cpp | 43 +++++++++-- .../rendering/kameleonvolumeraycaster.h | 3 + .../rendering/renderablekameleonvolume.cpp | 30 ++++++++ .../rendering/renderablekameleonvolume.h | 2 + modules/kameleonvolume/shaders/boundsfs.glsl | 8 +- modules/kameleonvolume/shaders/boundsvs.glsl | 26 ++++--- src/rendering/abufferrenderer.cpp | 55 +++++++------- 13 files changed, 202 insertions(+), 78 deletions(-) create mode 100644 data/spice/iSWAKernels/openspace_SE.ti diff --git a/data/scene/mercury/mercury.mod b/data/scene/mercury/mercury.mod index 75bf33560e..aa4be9675d 100644 --- a/data/scene/mercury/mercury.mod +++ b/data/scene/mercury/mercury.mod @@ -1,3 +1,5 @@ +MercuryRadius = 2.4397E6; + return { -- Mercury barycenter module { @@ -22,7 +24,7 @@ return { Body = "MERCURY", Geometry = { Type = "SimpleSphere", - Radius = { 2.440, 6 }, + Radius = {MercuryRadius, 1.0}, Segments = 100 }, Textures = { diff --git a/data/scene/saturn/saturn/saturn.mod b/data/scene/saturn/saturn/saturn.mod index aea907718b..4dc0a215c6 100644 --- a/data/scene/saturn/saturn/saturn.mod +++ b/data/scene/saturn/saturn/saturn.mod @@ -1,3 +1,6 @@ +SaturnRadius = 5.8232E7; + + return { -- Saturn barycenter module { @@ -23,7 +26,7 @@ return { Body = "SATURN BARYCENTER", Geometry = { Type = "SimpleSphere", - Radius = { 5.8232, 7 }, + Radius = {SaturnRadius, 0}, Segments = 100 }, Textures = { diff --git a/data/spice/iSWAKernels/openspace_SE.ti b/data/spice/iSWAKernels/openspace_SE.ti new file mode 100644 index 0000000000..684145b2ba --- /dev/null +++ b/data/spice/iSWAKernels/openspace_SE.ti @@ -0,0 +1,76 @@ +OpenSpace ecliptic frames: +Mercury-centric Solar Ecliptic (MERCURYSE) frame +Saturn-centric Solar Ecliptic (SATURNSE) frame + +These frames are only defined as helper frames for OpenSpace. + + +X is parallel to the geometric planet-sun position vector. + + +Y axis is the normalized component of the geometric planet-sun velocity + vector orthogonal to the frame's +X axis. + + +Z axis is parallel to the cross product of the frame's +X axis + and the frame's +Y axis. + +\begindata + + FRAME_MERCURYSE = 4600199 + FRAME_4600199_NAME = 'MERCURYSE' + FRAME_4600199_CLASS = 5 + FRAME_4600199_CLASS_ID = 4600199 + FRAME_4600199_CENTER = 199 + FRAME_4600199_RELATIVE = 'J2000' + FRAME_4600199_DEF_STYLE = 'PARAMETERIZED' + FRAME_4600199_FAMILY = 'TWO-VECTOR' + FRAME_4600199_PRI_AXIS = 'X' + FRAME_4600199_PRI_VECTOR_DEF = 'OBSERVER_TARGET_POSITION' + FRAME_4600199_PRI_OBSERVER = 'MERCURY' + FRAME_4600199_PRI_TARGET = 'SUN' + FRAME_4600199_PRI_ABCORR = 'NONE' + FRAME_4600199_SEC_AXIS = 'Y' + FRAME_4600199_SEC_VECTOR_DEF = 'OBSERVER_TARGET_VELOCITY' + FRAME_4600199_SEC_OBSERVER = 'MERCURY' + FRAME_4600199_SEC_TARGET = 'SUN' + FRAME_4600199_SEC_ABCORR = 'NONE' + FRAME_4600199_SEC_FRAME = 'J2000' + + FRAME_SATURNSE = 4600699 + FRAME_4600699_NAME = 'SATURNSE' + FRAME_4600699_CLASS = 5 + FRAME_4600699_CLASS_ID = 4600699 + FRAME_4600699_CENTER = 699 + FRAME_4600699_RELATIVE = 'J2000' + FRAME_4600699_DEF_STYLE = 'PARAMETERIZED' + FRAME_4600699_FAMILY = 'TWO-VECTOR' + FRAME_4600699_PRI_AXIS = 'X' + FRAME_4600699_PRI_VECTOR_DEF = 'OBSERVER_TARGET_POSITION' + FRAME_4600699_PRI_OBSERVER = 'SATURN BARYCENTER' + FRAME_4600699_PRI_TARGET = 'SUN' + FRAME_4600699_PRI_ABCORR = 'NONE' + FRAME_4600699_SEC_AXIS = 'Y' + FRAME_4600699_SEC_VECTOR_DEF = 'OBSERVER_TARGET_VELOCITY' + FRAME_4600699_SEC_OBSERVER = 'SATURN BARYCENTER' + FRAME_4600699_SEC_TARGET = 'SUN' + FRAME_4600699_SEC_ABCORR = 'NONE' + FRAME_4600699_SEC_FRAME = 'J2000' + + + FRAME_SATURNSEINV = 4600698 + FRAME_4600698_NAME = 'SATURNSEINV' + FRAME_4600698_CLASS = 5 + FRAME_4600698_CLASS_ID = 4600699 + FRAME_4600698_CENTER = 699 + FRAME_4600698_RELATIVE = 'J2000' + FRAME_4600698_DEF_STYLE = 'PARAMETERIZED' + FRAME_4600698_FAMILY = 'TWO-VECTOR' + FRAME_4600698_PRI_AXIS = 'X' + FRAME_4600698_PRI_VECTOR_DEF = 'OBSERVER_TARGET_POSITION' + FRAME_4600698_PRI_OBSERVER = 'SATURN BARYCENTER' + FRAME_4600698_PRI_TARGET = 'SUN' + FRAME_4600698_PRI_ABCORR = 'NONE' + FRAME_4600698_SEC_AXIS = 'Y' + FRAME_4600698_SEC_VECTOR_DEF = 'OBSERVER_TARGET_VELOCITY' + FRAME_4600698_SEC_OBSERVER = 'SUN' + FRAME_4600698_SEC_TARGET = 'SATURN BARYCENTER' + FRAME_4600698_SEC_ABCORR = 'NONE' + FRAME_4600698_SEC_FRAME = 'J2000' \ No newline at end of file diff --git a/include/openspace/rendering/abufferrenderer.h b/include/openspace/rendering/abufferrenderer.h index 042c0380dd..493c3fd2ea 100644 --- a/include/openspace/rendering/abufferrenderer.h +++ b/include/openspace/rendering/abufferrenderer.h @@ -71,8 +71,8 @@ public: void setResolution(glm::ivec2 res) override; void setNAaSamples(int nAaSamples) override; - void preRaycast(ghoul::opengl::ProgramObject& programObject); - void postRaycast(ghoul::opengl::ProgramObject& programObject); + void preRaycast(const RaycasterTask& raycasterTask); + void postRaycast(const RaycasterTask& raycasterTask); void update(); void render(float blackoutFactor, bool doPerformanceMeasurements) override; @@ -130,9 +130,6 @@ private: GLuint _vertexPositionBuffer; int _nAaSamples; - - std::unique_ptr _rendererTasks; - std::unique_ptr _renderData; float _blackoutFactor; ghoul::Dictionary _rendererData; diff --git a/modules/kameleon/include/kameleonwrapper.h b/modules/kameleon/include/kameleonwrapper.h index 1b4149e95f..76f6e0c5a3 100644 --- a/modules/kameleon/include/kameleonwrapper.h +++ b/modules/kameleon/include/kameleonwrapper.h @@ -136,7 +136,6 @@ public: Model model(); GridType gridType(); - std::string getParent(); std::string getFrame(); std::vector getVariables(); std::vector getLoadedVariables(); diff --git a/modules/kameleon/src/kameleonwrapper.cpp b/modules/kameleon/src/kameleonwrapper.cpp index 2d96133ac7..7da9e23cc6 100644 --- a/modules/kameleon/src/kameleonwrapper.cpp +++ b/modules/kameleon/src/kameleonwrapper.cpp @@ -1008,24 +1008,6 @@ glm::vec4 KameleonWrapper::classifyFieldline(FieldlineEnd fEnd, FieldlineEnd bEn return color; } -std::string KameleonWrapper::getParent(){ - if( _type == KameleonWrapper::Model::BATSRUS || - _type == KameleonWrapper::Model::OpenGGCM || - _type == KameleonWrapper::Model::LFM) - { - return "Earth"; - }else if( - _type == KameleonWrapper::Model::ENLIL || - _type == KameleonWrapper::Model::MAS || - _type == KameleonWrapper::Model::Adapt3D || - _type == KameleonWrapper::Model::SWMF) - { - return "Sun"; - }else{ - return ""; - } -} - std::string KameleonWrapper::getFrame(){ if( _type == KameleonWrapper::Model::BATSRUS || _type == KameleonWrapper::Model::OpenGGCM || @@ -1050,8 +1032,6 @@ std::vector KameleonWrapper::getVariables(){ int numVariables = _model->getNumberOfVariables(); for(int i=0; igetVariableName(i) << " "; - // std::cout << _model->getVariableName(i) << std::endl; variableNames.push_back(_model->getVariableName(i));; } return variableNames; diff --git a/modules/kameleonvolume/rendering/kameleonvolumeraycaster.cpp b/modules/kameleonvolume/rendering/kameleonvolumeraycaster.cpp index c514626243..3fd6a1d3ab 100644 --- a/modules/kameleonvolume/rendering/kameleonvolumeraycaster.cpp +++ b/modules/kameleonvolume/rendering/kameleonvolumeraycaster.cpp @@ -60,9 +60,14 @@ void KameleonVolumeRaycaster::deinitialize() { } void KameleonVolumeRaycaster::renderEntryPoints(const RenderData& data, ghoul::opengl::ProgramObject& program) { - //program.setUniform("modelTransform", _modelTransform); - program.setUniform("viewProjection", data.camera.viewProjectionMatrix()); - Renderable::setPscUniforms(program, data.camera, data.position); + 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), glm::dvec3(data.modelTransform.scale))); + glm::dmat4 modelViewTransform = data.camera.combinedViewMatrix() * modelTransform; + + program.setUniform("modelViewTransform", glm::mat4(modelViewTransform)); + program.setUniform("projectionTransform", data.camera.projectionMatrix()); // Cull back face glEnable(GL_CULL_FACE); @@ -72,11 +77,15 @@ void KameleonVolumeRaycaster::renderEntryPoints(const RenderData& data, ghoul::o _boundingBox.render(); } -void KameleonVolumeRaycaster::renderExitPoints(const RenderData& data, ghoul::opengl::ProgramObject& program) { - // Uniforms - //program.setUniform("modelTransform", _modelTransform); - program.setUniform("viewProjection", data.camera.viewProjectionMatrix()); - Renderable::setPscUniforms(program, data.camera, data.position); +void KameleonVolumeRaycaster::renderExitPoints(const RenderData& data, ghoul::opengl::ProgramObject& program) { + glm::dmat4 modelTransform = + glm::translate(glm::dmat4(1.0), data.modelTransform.translation) * + glm::dmat4(data.modelTransform.rotation) * + glm::dmat4(glm::scale(glm::dmat4(_modelTransform), glm::dvec3(data.modelTransform.scale))); + glm::dmat4 modelViewTransform = data.camera.combinedViewMatrix() * modelTransform; + + program.setUniform("modelViewTransform", glm::mat4(modelViewTransform)); + program.setUniform("projectionTransform", data.camera.projectionMatrix()); // Cull front face glEnable(GL_CULL_FACE); @@ -113,6 +122,20 @@ void KameleonVolumeRaycaster::postRaycast(const RaycastData& data, ghoul::opengl _textureUnit = nullptr; _tfUnit = nullptr; } + +bool KameleonVolumeRaycaster::cameraIsInside(const RenderData & data, glm::vec3 & localPosition) +{ + glm::dmat4 modelTransform = + glm::translate(glm::dmat4(1.0), data.modelTransform.translation) * + glm::dmat4(data.modelTransform.rotation) * + glm::dmat4(glm::scale(glm::dmat4(_modelTransform), glm::dvec3(data.modelTransform.scale))); + glm::dmat4 modelViewTransform = data.camera.combinedViewMatrix() * modelTransform; + + glm::vec4 modelPos = glm::inverse(modelViewTransform) * glm::vec4(0.0, 0.0, 0.0, 1.0); + + localPosition = (glm::vec3(modelPos) + glm::vec3(0.5)); + return (localPosition.x > 0 && localPosition.y > 0 && localPosition.z > 0 && localPosition.x < 1 && localPosition.y < 1 && localPosition.z < 1); +} std::string KameleonVolumeRaycaster::getBoundsVsPath() const { return GlslBoundsVsPath; @@ -138,5 +161,9 @@ void KameleonVolumeRaycaster::setGridType(VolumeGridType gridType) { _gridType = gridType; } + +void KameleonVolumeRaycaster::setModelTransform(const glm::mat4 & transform) { + _modelTransform = transform; +} } diff --git a/modules/kameleonvolume/rendering/kameleonvolumeraycaster.h b/modules/kameleonvolume/rendering/kameleonvolumeraycaster.h index 89d83aca49..4524a288e0 100644 --- a/modules/kameleonvolume/rendering/kameleonvolumeraycaster.h +++ b/modules/kameleonvolume/rendering/kameleonvolumeraycaster.h @@ -65,6 +65,7 @@ public: void renderExitPoints(const RenderData& data, ghoul::opengl::ProgramObject& program) override; void preRaycast(const RaycastData& data, ghoul::opengl::ProgramObject& program) override; void postRaycast(const RaycastData& data, ghoul::opengl::ProgramObject& program) override; + bool cameraIsInside(const RenderData& data, glm::vec3& localPosition) override; std::string getBoundsVsPath() const override; std::string getBoundsFsPath() const override; @@ -73,11 +74,13 @@ public: void setStepSize(float stepSize); void setGridType(VolumeGridType gridType); + void setModelTransform(const glm::mat4& transform); private: std::shared_ptr _volumeTexture; std::shared_ptr _transferFunction; BoxGeometry _boundingBox; VolumeGridType _gridType; + glm::mat4 _modelTransform; std::unique_ptr _tfUnit; std::unique_ptr _textureUnit; diff --git a/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp b/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp index a5912cc27f..65f6150c55 100644 --- a/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp +++ b/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp @@ -53,6 +53,7 @@ RenderableKameleonVolume::RenderableKameleonVolume(const ghoul::Dictionary& dict , _variable("variable", "Variable") , _lowerDomainBound("lowerDomainBound", "Lower Domain Bound") , _upperDomainBound("upperDomainBound", "Upper Domain Bound") + , _domainScale("domainScale", "Domain scale") , _autoDomainBounds(false) , _lowerValueBound("lowerValueBound", "Lower Value Bound", 0.0, 0.0, 1) , _upperValueBound("upperValueBound", "Upper Value Bound", 1, 0.01, 1) @@ -111,6 +112,13 @@ RenderableKameleonVolume::RenderableKameleonVolume(const ghoul::Dictionary& dict _autoDomainBounds = true; } + glm::vec3 domainScale; + if (dictionary.getValue("DomainScale", domainScale)) { + _domainScale = domainScale; + } else { + _domainScale = glm::vec3(1, 1, 1); // Assume meters if nothing else is specified. + } + float lowerValueBound; if (dictionary.getValue("LowerValueBound", lowerValueBound)) { _lowerValueBound = lowerValueBound; @@ -168,6 +176,13 @@ bool RenderableKameleonVolume::initialize() { _raycaster->setGridType(static_cast(_gridType.value())); }); + updateRaycasterModelTransform(); + _lowerDomainBound.onChange([this] { + updateRaycasterModelTransform(); + }); + _upperDomainBound.onChange([this] { + updateRaycasterModelTransform(); + }); _raycaster->initialize(); @@ -193,6 +208,7 @@ bool RenderableKameleonVolume::initialize() { addProperty(_variable); addProperty(_lowerDomainBound); addProperty(_upperDomainBound); + addProperty(_domainScale); addProperty(_lowerValueBound); addProperty(_upperValueBound); addProperty(_gridType); @@ -202,6 +218,19 @@ bool RenderableKameleonVolume::initialize() { return true; } +void RenderableKameleonVolume::updateRaycasterModelTransform() { + glm::vec3 lowerBoundingBoxBound = _domainScale.value() * _lowerDomainBound.value(); + glm::vec3 upperBoundingBoxBound = _domainScale.value() * _upperDomainBound.value(); + + glm::vec3 scale = upperBoundingBoxBound - lowerBoundingBoxBound; + glm::vec3 translation = (lowerBoundingBoxBound + upperBoundingBoxBound) * 0.5f; + + glm::mat4 modelTransform = glm::translate(glm::mat4(1.0), translation); + modelTransform = glm::scale(modelTransform, scale); + _raycaster->setModelTransform(modelTransform); +} + + bool RenderableKameleonVolume::cachingEnabled() { return _cache; } @@ -331,6 +360,7 @@ bool RenderableKameleonVolume::isReady() const { } void RenderableKameleonVolume::update(const UpdateData& data) { + // forward this transformation! if (_raycaster) { _raycaster->setStepSize(_stepSize); } diff --git a/modules/kameleonvolume/rendering/renderablekameleonvolume.h b/modules/kameleonvolume/rendering/renderablekameleonvolume.h index 96b7febd7d..2004df8d20 100644 --- a/modules/kameleonvolume/rendering/renderablekameleonvolume.h +++ b/modules/kameleonvolume/rendering/renderablekameleonvolume.h @@ -63,11 +63,13 @@ private: std::string cacheSuffix(); void updateTextureFromVolume(); + void updateRaycasterModelTransform(); properties::UVec3Property _dimensions; properties::StringProperty _variable; properties::Vec3Property _lowerDomainBound; properties::Vec3Property _upperDomainBound; + properties::Vec3Property _domainScale; bool _autoDomainBounds; properties::FloatProperty _lowerValueBound; diff --git a/modules/kameleonvolume/shaders/boundsfs.glsl b/modules/kameleonvolume/shaders/boundsfs.glsl index bb4f9c8cd3..2d3e6acc19 100644 --- a/modules/kameleonvolume/shaders/boundsfs.glsl +++ b/modules/kameleonvolume/shaders/boundsfs.glsl @@ -22,15 +22,15 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -in vec3 vPosition; -in vec4 worldPosition; +in vec4 positionLocalSpace; +in vec4 positionCameraSpace; #include "PowerScaling/powerScaling_fs.hglsl" #include "fragment.glsl" Fragment getFragment() { - vec4 fragColor = vec4(vPosition+0.5, 1.0); - vec4 position = worldPosition; + vec4 fragColor = vec4(positionLocalSpace.xyz+0.5, 1.0); + vec4 position = positionCameraSpace; float depth = pscDepth(position); Fragment frag; diff --git a/modules/kameleonvolume/shaders/boundsvs.glsl b/modules/kameleonvolume/shaders/boundsvs.glsl index 8bde15f7f9..5f46702609 100644 --- a/modules/kameleonvolume/shaders/boundsvs.glsl +++ b/modules/kameleonvolume/shaders/boundsvs.glsl @@ -24,23 +24,25 @@ #version __CONTEXT__ -layout(location = 0) in vec4 vertPosition; +layout(location = 0) in vec3 vertPosition; -uniform mat4 viewProjection; +uniform mat4 modelViewTransform; +uniform mat4 projectionTransform; -out vec3 vPosition; -out vec4 worldPosition; +out vec4 positionLocalSpace; +out vec4 positionCameraSpace; #include "PowerScaling/powerScaling_vs.hglsl" void main() { - vPosition = vertPosition.xyz; - worldPosition = vertPosition; - - vec4 position = pscTransform(worldPosition, mat4(1.0)); - - // project the position to view space - gl_Position = viewProjection * position; - gl_Position.z = 1.0; + positionLocalSpace = vec4(vertPosition, 1.0); + positionCameraSpace = modelViewTransform * positionLocalSpace; + + vec4 positionClipSpace = projectionTransform * positionCameraSpace; + vec4 positionScreenSpace = z_normalization(positionClipSpace); + + //positionScreenSpace.z = 1.0; + // project the position to view space + gl_Position = positionScreenSpace; } diff --git a/src/rendering/abufferrenderer.cpp b/src/rendering/abufferrenderer.cpp index 39d7e66ce7..a29a4fd69f 100644 --- a/src/rendering/abufferrenderer.cpp +++ b/src/rendering/abufferrenderer.cpp @@ -268,9 +268,6 @@ void ABufferRenderer::render(float blackoutFactor, bool doPerformanceMeasurement RenderData data{ *_camera, psc(), doPerformanceMeasurements, renderBinMask }; RendererTasks tasks; _scene->render(data, tasks); - - _rendererTasks = std::make_unique(tasks); - _renderData = std::make_unique(data); _blackoutFactor = blackoutFactor; glBindFramebuffer(GL_FRAMEBUFFER, defaultFbo); @@ -314,10 +311,21 @@ void ABufferRenderer::render(float blackoutFactor, bool doPerformanceMeasurement // END TEMPORARY GAMMA CORRECTION. - preRaycast(*_resolveProgram); + _resolveProgram->setUniform("mainColorTexture", _mainColorTextureUnit->unitNumber()); + _resolveProgram->setUniform("mainDepthTexture", _mainDepthTextureUnit->unitNumber()); + _resolveProgram->setUniform("blackoutFactor", _blackoutFactor); + _resolveProgram->setUniform("nAaSamples", _nAaSamples); + + for (const RaycasterTask& raycasterTask : tasks.raycasterTasks) { + preRaycast(raycasterTask); + } + glBindVertexArray(_screenQuad); glDrawArrays(GL_TRIANGLES, 0, 6); - postRaycast(*_resolveProgram); + + for (const RaycasterTask& raycasterTask : tasks.raycasterTasks) { + postRaycast(raycasterTask); + } _resolveProgram->deactivate(); @@ -326,32 +334,27 @@ void ABufferRenderer::render(float blackoutFactor, bool doPerformanceMeasurement } -void ABufferRenderer::preRaycast(ghoul::opengl::ProgramObject& program) { +void ABufferRenderer::preRaycast(const RaycasterTask& raycasterTask) { + VolumeRaycaster& raycaster = *raycasterTask.raycaster; + const RaycastData& raycastData = _raycastData[&raycaster]; + const RenderData& renderData = raycasterTask.renderData; - program.setUniform("mainColorTexture", _mainColorTextureUnit->unitNumber()); - program.setUniform("mainDepthTexture", _mainDepthTextureUnit->unitNumber()); - - for (const auto& raycastData : _raycastData) { - raycastData.first->preRaycast(raycastData.second, program); + raycaster.preRaycast(raycastData, *_resolveProgram); - glm::vec3 localCameraPosition; - bool cameraIsInside = raycastData.first->cameraIsInside(*_renderData, localCameraPosition); - int uniformIndex = raycastData.second.id + 1; // uniforms are indexed from 1 (not from 0) - program.setUniform("insideRaycaster" + std::to_string(uniformIndex), cameraIsInside); - if (cameraIsInside) { - program.setUniform("cameraPosInRaycaster" + std::to_string(uniformIndex), localCameraPosition); - } + glm::vec3 localCameraPosition; + bool cameraIsInside = raycaster.cameraIsInside(renderData, localCameraPosition); + int uniformIndex = raycastData.id + 1; // uniforms are indexed from 1 (not from 0) + _resolveProgram->setUniform("insideRaycaster" + std::to_string(uniformIndex), cameraIsInside); + if (cameraIsInside) { + _resolveProgram->setUniform("cameraPosInRaycaster" + std::to_string(uniformIndex), localCameraPosition); } - - // 3b: Set "global" uniforms, and start the resolve pass. - program.setUniform("blackoutFactor", _blackoutFactor); - program.setUniform("nAaSamples", _nAaSamples); } -void ABufferRenderer::postRaycast(ghoul::opengl::ProgramObject& program) { - for (const auto& raycastData : _raycastData) { - raycastData.first->postRaycast(raycastData.second, program); - } +void ABufferRenderer::postRaycast(const RaycasterTask& raycasterTask) { + VolumeRaycaster& raycaster = *raycasterTask.raycaster; + const RaycastData& raycastData = _raycastData[&raycaster]; + + raycaster.postRaycast(raycastData, *_resolveProgram); } void ABufferRenderer::setScene(Scene* scene) { From 81d135823696df090445de18d4219b6301e55d6b Mon Sep 17 00:00:00 2001 From: Emil Axelsson Date: Wed, 26 Oct 2016 16:14:40 +0200 Subject: [PATCH 65/96] Update spice frames --- data/spice/iSWAKernels/openspace_SE.ti | 76 --------------------- data/spice/iSWAKernels/openspace_mercury.ti | 35 ++++++++++ data/spice/iSWAKernels/openspace_saturn.ti | 35 ++++++++++ 3 files changed, 70 insertions(+), 76 deletions(-) delete mode 100644 data/spice/iSWAKernels/openspace_SE.ti create mode 100644 data/spice/iSWAKernels/openspace_mercury.ti create mode 100644 data/spice/iSWAKernels/openspace_saturn.ti diff --git a/data/spice/iSWAKernels/openspace_SE.ti b/data/spice/iSWAKernels/openspace_SE.ti deleted file mode 100644 index 684145b2ba..0000000000 --- a/data/spice/iSWAKernels/openspace_SE.ti +++ /dev/null @@ -1,76 +0,0 @@ -OpenSpace ecliptic frames: -Mercury-centric Solar Ecliptic (MERCURYSE) frame -Saturn-centric Solar Ecliptic (SATURNSE) frame - -These frames are only defined as helper frames for OpenSpace. - - +X is parallel to the geometric planet-sun position vector. - - +Y axis is the normalized component of the geometric planet-sun velocity - vector orthogonal to the frame's +X axis. - - +Z axis is parallel to the cross product of the frame's +X axis - and the frame's +Y axis. - -\begindata - - FRAME_MERCURYSE = 4600199 - FRAME_4600199_NAME = 'MERCURYSE' - FRAME_4600199_CLASS = 5 - FRAME_4600199_CLASS_ID = 4600199 - FRAME_4600199_CENTER = 199 - FRAME_4600199_RELATIVE = 'J2000' - FRAME_4600199_DEF_STYLE = 'PARAMETERIZED' - FRAME_4600199_FAMILY = 'TWO-VECTOR' - FRAME_4600199_PRI_AXIS = 'X' - FRAME_4600199_PRI_VECTOR_DEF = 'OBSERVER_TARGET_POSITION' - FRAME_4600199_PRI_OBSERVER = 'MERCURY' - FRAME_4600199_PRI_TARGET = 'SUN' - FRAME_4600199_PRI_ABCORR = 'NONE' - FRAME_4600199_SEC_AXIS = 'Y' - FRAME_4600199_SEC_VECTOR_DEF = 'OBSERVER_TARGET_VELOCITY' - FRAME_4600199_SEC_OBSERVER = 'MERCURY' - FRAME_4600199_SEC_TARGET = 'SUN' - FRAME_4600199_SEC_ABCORR = 'NONE' - FRAME_4600199_SEC_FRAME = 'J2000' - - FRAME_SATURNSE = 4600699 - FRAME_4600699_NAME = 'SATURNSE' - FRAME_4600699_CLASS = 5 - FRAME_4600699_CLASS_ID = 4600699 - FRAME_4600699_CENTER = 699 - FRAME_4600699_RELATIVE = 'J2000' - FRAME_4600699_DEF_STYLE = 'PARAMETERIZED' - FRAME_4600699_FAMILY = 'TWO-VECTOR' - FRAME_4600699_PRI_AXIS = 'X' - FRAME_4600699_PRI_VECTOR_DEF = 'OBSERVER_TARGET_POSITION' - FRAME_4600699_PRI_OBSERVER = 'SATURN BARYCENTER' - FRAME_4600699_PRI_TARGET = 'SUN' - FRAME_4600699_PRI_ABCORR = 'NONE' - FRAME_4600699_SEC_AXIS = 'Y' - FRAME_4600699_SEC_VECTOR_DEF = 'OBSERVER_TARGET_VELOCITY' - FRAME_4600699_SEC_OBSERVER = 'SATURN BARYCENTER' - FRAME_4600699_SEC_TARGET = 'SUN' - FRAME_4600699_SEC_ABCORR = 'NONE' - FRAME_4600699_SEC_FRAME = 'J2000' - - - FRAME_SATURNSEINV = 4600698 - FRAME_4600698_NAME = 'SATURNSEINV' - FRAME_4600698_CLASS = 5 - FRAME_4600698_CLASS_ID = 4600699 - FRAME_4600698_CENTER = 699 - FRAME_4600698_RELATIVE = 'J2000' - FRAME_4600698_DEF_STYLE = 'PARAMETERIZED' - FRAME_4600698_FAMILY = 'TWO-VECTOR' - FRAME_4600698_PRI_AXIS = 'X' - FRAME_4600698_PRI_VECTOR_DEF = 'OBSERVER_TARGET_POSITION' - FRAME_4600698_PRI_OBSERVER = 'SATURN BARYCENTER' - FRAME_4600698_PRI_TARGET = 'SUN' - FRAME_4600698_PRI_ABCORR = 'NONE' - FRAME_4600698_SEC_AXIS = 'Y' - FRAME_4600698_SEC_VECTOR_DEF = 'OBSERVER_TARGET_VELOCITY' - FRAME_4600698_SEC_OBSERVER = 'SUN' - FRAME_4600698_SEC_TARGET = 'SATURN BARYCENTER' - FRAME_4600698_SEC_ABCORR = 'NONE' - FRAME_4600698_SEC_FRAME = 'J2000' \ No newline at end of file diff --git a/data/spice/iSWAKernels/openspace_mercury.ti b/data/spice/iSWAKernels/openspace_mercury.ti new file mode 100644 index 0000000000..79009d0832 --- /dev/null +++ b/data/spice/iSWAKernels/openspace_mercury.ti @@ -0,0 +1,35 @@ +OpenSpace ecliptic frames: +Mercury-centric Solar Ecliptic (MERCURYSE) frame +Saturn-centric Solar Ecliptic (SATURNSE) frame + +These frames are only defined as helper frames for OpenSpace. + + +X is parallel to the geometric planet-sun position vector. + + +Y axis is the normalized component of the geometric planet-sun velocity + vector orthogonal to the frame's +X axis. + + +Z axis is parallel to the cross product of the frame's +X axis + and the frame's +Y axis. + +\begindata + + FRAME_MERCURYSE = 4600199 + FRAME_4600199_NAME = 'MERCURYSE' + FRAME_4600199_CLASS = 5 + FRAME_4600199_CLASS_ID = 4600199 + FRAME_4600199_CENTER = 199 + FRAME_4600199_RELATIVE = 'J2000' + FRAME_4600199_DEF_STYLE = 'PARAMETERIZED' + FRAME_4600199_FAMILY = 'TWO-VECTOR' + FRAME_4600199_PRI_AXIS = 'X' + FRAME_4600199_PRI_VECTOR_DEF = 'OBSERVER_TARGET_POSITION' + FRAME_4600199_PRI_OBSERVER = 'MERCURY' + FRAME_4600199_PRI_TARGET = 'SUN' + FRAME_4600199_PRI_ABCORR = 'NONE' + FRAME_4600199_SEC_AXIS = 'Y' + FRAME_4600199_SEC_VECTOR_DEF = 'OBSERVER_TARGET_VELOCITY' + FRAME_4600199_SEC_OBSERVER = 'MERCURY' + FRAME_4600199_SEC_TARGET = 'SUN' + FRAME_4600199_SEC_ABCORR = 'NONE' + FRAME_4600199_SEC_FRAME = 'J2000' diff --git a/data/spice/iSWAKernels/openspace_saturn.ti b/data/spice/iSWAKernels/openspace_saturn.ti new file mode 100644 index 0000000000..10a988ab1b --- /dev/null +++ b/data/spice/iSWAKernels/openspace_saturn.ti @@ -0,0 +1,35 @@ +OpenSpace ecliptic frames: +Mercury-centric Solar Ecliptic (MERCURYSE) frame +Saturn-centric Solar Ecliptic (SATURNSE) frame + +These frames are only defined as helper frames for OpenSpace. + + +X is parallel to the geometric planet-sun position vector. + + +Y axis is the normalized component of the geometric planet-sun velocity + vector orthogonal to the frame's +X axis. + + +Z axis is parallel to the cross product of the frame's +X axis + and the frame's +Y axis. + +\begindata + + FRAME_SATURNSE = 4500699 + FRAME_4500699_NAME = 'SATURNSE' + FRAME_4500699_CLASS = 5 + FRAME_4500699_CLASS_ID = 4500699 + FRAME_4500699_CENTER = 6 + FRAME_4500699_RELATIVE = 'J2000' + FRAME_4500699_DEF_STYLE = 'PARAMETERIZED' + FRAME_4500699_FAMILY = 'TWO-VECTOR' + FRAME_4500699_PRI_AXIS = 'X' + FRAME_4500699_PRI_VECTOR_DEF = 'OBSERVER_TARGET_POSITION' + FRAME_4500699_PRI_OBSERVER = 'SATURN BARYCENTER' + FRAME_4500699_PRI_TARGET = 'SUN' + FRAME_4500699_PRI_ABCORR = 'NONE' + FRAME_4500699_SEC_AXIS = 'Y' + FRAME_4500699_SEC_VECTOR_DEF = 'OBSERVER_TARGET_VELOCITY' + FRAME_4500699_SEC_OBSERVER = 'SATURN BARYCENTER' + FRAME_4500699_SEC_TARGET = 'SUN' + FRAME_4500699_SEC_ABCORR = 'NONE' + FRAME_4500699_SEC_FRAME = 'J2000' From dbe8857e4257c0ca783077fda23a0c7a3f6e9e8e Mon Sep 17 00:00:00 2001 From: Emil Axelsson Date: Fri, 28 Oct 2016 11:17:28 +0200 Subject: [PATCH 66/96] Clarify spice comments --- data/spice/iSWAKernels/openspace_mercury.ti | 4 +--- data/spice/iSWAKernels/openspace_saturn.ti | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/data/spice/iSWAKernels/openspace_mercury.ti b/data/spice/iSWAKernels/openspace_mercury.ti index 79009d0832..218f8c3ec2 100644 --- a/data/spice/iSWAKernels/openspace_mercury.ti +++ b/data/spice/iSWAKernels/openspace_mercury.ti @@ -1,13 +1,11 @@ OpenSpace ecliptic frames: Mercury-centric Solar Ecliptic (MERCURYSE) frame -Saturn-centric Solar Ecliptic (SATURNSE) frame These frames are only defined as helper frames for OpenSpace. +X is parallel to the geometric planet-sun position vector. - +Y axis is the normalized component of the geometric planet-sun velocity - vector orthogonal to the frame's +X axis. + -Y axis is the normalized component of the planet's orbital vector +Z axis is parallel to the cross product of the frame's +X axis and the frame's +Y axis. diff --git a/data/spice/iSWAKernels/openspace_saturn.ti b/data/spice/iSWAKernels/openspace_saturn.ti index 10a988ab1b..46a81299ef 100644 --- a/data/spice/iSWAKernels/openspace_saturn.ti +++ b/data/spice/iSWAKernels/openspace_saturn.ti @@ -1,13 +1,11 @@ OpenSpace ecliptic frames: -Mercury-centric Solar Ecliptic (MERCURYSE) frame Saturn-centric Solar Ecliptic (SATURNSE) frame These frames are only defined as helper frames for OpenSpace. +X is parallel to the geometric planet-sun position vector. - +Y axis is the normalized component of the geometric planet-sun velocity - vector orthogonal to the frame's +X axis. + -Y axis is the normalized component of the planet's orbital vector +Z axis is parallel to the cross product of the frame's +X axis and the frame's +Y axis. From 2a234befe8eb1d2b1f096100b2aa185d3e053dff Mon Sep 17 00:00:00 2001 From: Emil Axelsson Date: Sat, 29 Oct 2016 11:52:25 +0200 Subject: [PATCH 67/96] Begin implementing clip plane support for kameleon volumes Conflicts: modules/volume/CMakeLists.txt --- .../rendering/kameleonvolumeraycaster.cpp | 12 +- .../rendering/kameleonvolumeraycaster.h | 6 +- .../rendering/renderablekameleonvolume.cpp | 11 +- .../rendering/renderablekameleonvolume.h | 4 + modules/kameleonvolume/shaders/helper.glsl | 4 +- modules/kameleonvolume/shaders/raycast.glsl | 42 +- modules/volume/CMakeLists.txt | 7 +- modules/volume/rendering/renderablevolume.cpp | 461 ------------------ .../volume/rendering/renderablevolumegl.cpp | 323 ------------ modules/volume/rendering/volumeclipplane.cpp | 61 +++ ...renderablevolumegl.h => volumeclipplane.h} | 57 +-- modules/volume/rendering/volumeclipplanes.cpp | 76 +++ ...{renderablevolume.h => volumeclipplanes.h} | 39 +- modules/volume/volumemodule.cpp | 5 +- 14 files changed, 233 insertions(+), 875 deletions(-) delete mode 100644 modules/volume/rendering/renderablevolume.cpp delete mode 100644 modules/volume/rendering/renderablevolumegl.cpp create mode 100644 modules/volume/rendering/volumeclipplane.cpp rename modules/volume/rendering/{renderablevolumegl.h => volumeclipplane.h} (66%) create mode 100644 modules/volume/rendering/volumeclipplanes.cpp rename modules/volume/rendering/{renderablevolume.h => volumeclipplanes.h} (74%) diff --git a/modules/kameleonvolume/rendering/kameleonvolumeraycaster.cpp b/modules/kameleonvolume/rendering/kameleonvolumeraycaster.cpp index 3fd6a1d3ab..aaa7c86539 100644 --- a/modules/kameleonvolume/rendering/kameleonvolumeraycaster.cpp +++ b/modules/kameleonvolume/rendering/kameleonvolumeraycaster.cpp @@ -45,9 +45,11 @@ namespace openspace { KameleonVolumeRaycaster::KameleonVolumeRaycaster( std::shared_ptr texture, - std::shared_ptr transferFunction) + std::shared_ptr transferFunction, + std::shared_ptr clipPlanes) : _volumeTexture(texture) , _transferFunction(transferFunction) + , _clipPlanes(clipPlanes) , _boundingBox(glm::vec3(1.0)) {} KameleonVolumeRaycaster::~KameleonVolumeRaycaster() {} @@ -115,6 +117,14 @@ void KameleonVolumeRaycaster::preRaycast(const RaycastData& data, ghoul::opengl: program.setUniform("volumeTexture_" + id, _textureUnit->unitNumber()); program.setUniform("gridType_" + id, static_cast(_gridType)); + + std::vector clipNormals = _clipPlanes->normals(); + std::vector clipOffsets = _clipPlanes->offsets(); + int nClips = clipNormals.size(); + + program.setUniform("nClips_" + id, nClips); + program.setUniform("clipNormals_" + id, clipNormals.data(), nClips); + program.setUniform("clipOffsets_" + id, clipOffsets.data(), nClips); } void KameleonVolumeRaycaster::postRaycast(const RaycastData& data, ghoul::opengl::ProgramObject& program) { diff --git a/modules/kameleonvolume/rendering/kameleonvolumeraycaster.h b/modules/kameleonvolume/rendering/kameleonvolumeraycaster.h index 4524a288e0..e007676a35 100644 --- a/modules/kameleonvolume/rendering/kameleonvolumeraycaster.h +++ b/modules/kameleonvolume/rendering/kameleonvolumeraycaster.h @@ -28,6 +28,7 @@ #include #include +#include #include #include @@ -36,6 +37,7 @@ #include #include #include +#include #include @@ -56,7 +58,8 @@ public: KameleonVolumeRaycaster( std::shared_ptr texture, - std::shared_ptr transferFunction); + std::shared_ptr transferFunction, + std::shared_ptr clipPlanes); virtual ~KameleonVolumeRaycaster(); void initialize(); @@ -76,6 +79,7 @@ public: void setGridType(VolumeGridType gridType); void setModelTransform(const glm::mat4& transform); private: + std::shared_ptr _clipPlanes; std::shared_ptr _volumeTexture; std::shared_ptr _transferFunction; BoxGeometry _boundingBox; diff --git a/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp b/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp index 65f6150c55..cfeb9ac169 100644 --- a/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp +++ b/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp @@ -60,6 +60,7 @@ RenderableKameleonVolume::RenderableKameleonVolume(const ghoul::Dictionary& dict , _autoValueBounds(false) , _gridType("gridType", "Grid Type", properties::OptionProperty::DisplayType::DROPDOWN) , _autoGridType(false) + , _clipPlanes(nullptr) , _stepSize("stepSize", "Step Size", 0.02, 0.01, 1) , _sourcePath("sourcePath", "Source Path") , _transferFunctionPath("transferFunctionPath", "Transfer Function Path") @@ -135,6 +136,10 @@ RenderableKameleonVolume::RenderableKameleonVolume(const ghoul::Dictionary& dict _autoValueBounds = true; } + ghoul::Dictionary clipPlanesDictionary; + dictionary.getValue("ClipPlanes", clipPlanesDictionary); + _clipPlanes = std::make_shared(clipPlanesDictionary); + _clipPlanes->setName("clipPlanes"); bool cache; if (dictionary.getValue("Cache", cache)) { @@ -165,7 +170,7 @@ bool RenderableKameleonVolume::initialize() { _volumeTexture->uploadTexture(); _transferFunction->update(); - _raycaster = std::make_unique(_volumeTexture, _transferFunction); + _raycaster = std::make_unique(_volumeTexture, _transferFunction, _clipPlanes); _raycaster->setStepSize(_stepSize); _gridType.onChange([this] { @@ -201,6 +206,8 @@ bool RenderableKameleonVolume::initialize() { onEnabledChange(onChange); + _clipPlanes->initialize(); + addProperty(_dimensions); addProperty(_stepSize); addProperty(_transferFunctionPath); @@ -213,6 +220,8 @@ bool RenderableKameleonVolume::initialize() { addProperty(_upperValueBound); addProperty(_gridType); addProperty(_cache); + addPropertySubOwner(_clipPlanes.get()); + return true; diff --git a/modules/kameleonvolume/rendering/renderablekameleonvolume.h b/modules/kameleonvolume/rendering/renderablekameleonvolume.h index 2004df8d20..d5f2cba378 100644 --- a/modules/kameleonvolume/rendering/renderablekameleonvolume.h +++ b/modules/kameleonvolume/rendering/renderablekameleonvolume.h @@ -37,6 +37,8 @@ #include #include +#include + namespace openspace { @@ -79,6 +81,8 @@ private: properties::OptionProperty _gridType; bool _autoGridType; + std::shared_ptr _clipPlanes; + properties::FloatProperty _stepSize; properties::StringProperty _sourcePath; properties::StringProperty _transferFunctionPath; diff --git a/modules/kameleonvolume/shaders/helper.glsl b/modules/kameleonvolume/shaders/helper.glsl index a144abecdb..d357202293 100644 --- a/modules/kameleonvolume/shaders/helper.glsl +++ b/modules/kameleonvolume/shaders/helper.glsl @@ -1,9 +1,9 @@ #define KAMELEON_PI 3.14159265358979323846 /* pi */ #define KAMELEON_SQRT1_3 0.57735026919 /* 1/sqrt(3) */ -vec3 kameleon_cartesianToSpherical(vec3 _cartesian) { +vec3 kameleon_cartesianToSpherical(vec3 zeroToOneCoords) { // Put cartesian in [-1..1] range first - vec3 cartesian = vec3(-1.0,-1.0,-1.0) + _cartesian * 2.0f; + vec3 cartesian = vec3(-1.0,-1.0,-1.0) + zeroToOneCoords * 2.0f; float r = length(cartesian); float theta, phi; diff --git a/modules/kameleonvolume/shaders/raycast.glsl b/modules/kameleonvolume/shaders/raycast.glsl index 7de501504b..0ff1cb3a1e 100644 --- a/modules/kameleonvolume/shaders/raycast.glsl +++ b/modules/kameleonvolume/shaders/raycast.glsl @@ -27,6 +27,10 @@ uniform sampler3D volumeTexture_#{id}; uniform sampler1D transferFunction_#{id}; uniform int gridType_#{id} = 0; +uniform int nClips_#{id}; +uniform vec3 clipNormals_#{id}[8]; +uniform vec2 clipOffsets_#{id}[8]; + void sample#{id}(vec3 samplePos, vec3 dir, @@ -39,20 +43,34 @@ void sample#{id}(vec3 samplePos, transformedPos = kameleon_cartesianToSpherical(samplePos); } - float val = texture(volumeTexture_#{id}, transformedPos).r; - vec4 color = texture(transferFunction_#{id}, val); - vec3 backColor = color.rgb; - vec3 backAlpha = color.aaa; - backColor *= stepSize; - backAlpha *= stepSize; + float clipAlpha = 1.0; + vec3 centerToPos = transformedPos - vec3(0.5); - backColor = clamp(backColor, 0.0, 1.0); - backAlpha = clamp(backAlpha, 0.0, 1.0); - - vec3 oneMinusFrontAlpha = vec3(1.0) - accumulatedAlpha; - accumulatedColor += oneMinusFrontAlpha * backColor; - accumulatedAlpha += oneMinusFrontAlpha * backAlpha; + + for (int i = 0; i < nClips_#{id} && i < 8; i++) { + vec3 clipNormal = clipNormals_#{id}[i]; + float clipBegin = clipOffsets_#{id}[i].x; + float clipEnd = clipBegin + clipOffsets_#{id}[i].y; + clipAlpha *= smoothstep(clipBegin, clipEnd, dot(centerToPos, clipNormal)); + } + + if (clipAlpha > 0) { + float val = texture(volumeTexture_#{id}, transformedPos).r; + vec4 color = texture(transferFunction_#{id}, val); + vec3 backColor = color.rgb; + vec3 backAlpha = color.aaa; + + backColor *= stepSize * clipAlpha; + backAlpha *= stepSize * clipAlpha; + + backColor = clamp(backColor, 0.0, 1.0); + backAlpha = clamp(backAlpha, 0.0, 1.0); + + vec3 oneMinusFrontAlpha = vec3(1.0) - accumulatedAlpha; + accumulatedColor += oneMinusFrontAlpha * backColor; + accumulatedAlpha += oneMinusFrontAlpha * backAlpha; + } stepSize = maxStepSize#{id}; } diff --git a/modules/volume/CMakeLists.txt b/modules/volume/CMakeLists.txt index 8373907875..83dff7d4ea 100644 --- a/modules/volume/CMakeLists.txt +++ b/modules/volume/CMakeLists.txt @@ -26,10 +26,7 @@ include(${OPENSPACE_CMAKE_EXT_DIR}/module_definition.cmake) set(HEADER_FILES ${CMAKE_CURRENT_SOURCE_DIR}/rawvolume.h -<<<<<<< HEAD ${CMAKE_CURRENT_SOURCE_DIR}/rawvolume.inl -======= ->>>>>>> 4bf7b71... Add support for converting and rendering volumetric data in the cdf format. Replace DataConverter by a more general purpose TaskRunner. ${CMAKE_CURRENT_SOURCE_DIR}/rawvolumereader.h ${CMAKE_CURRENT_SOURCE_DIR}/rawvolumereader.inl ${CMAKE_CURRENT_SOURCE_DIR}/rawvolumewriter.h @@ -41,6 +38,8 @@ set(HEADER_FILES ${CMAKE_CURRENT_SOURCE_DIR}/volumesampler.h ${CMAKE_CURRENT_SOURCE_DIR}/volumesampler.inl ${CMAKE_CURRENT_SOURCE_DIR}/volumeutils.h + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/volumeclipplane.h + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/volumeclipplanes.h ) source_group("Header Files" FILES ${HEADER_FILES}) @@ -51,6 +50,8 @@ set(SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/textureslicevolumereader.inl ${CMAKE_CURRENT_SOURCE_DIR}/volumesampler.inl ${CMAKE_CURRENT_SOURCE_DIR}/volumeutils.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/volumeclipplane.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/volumeclipplanes.cpp ) source_group("Source Files" FILES ${SOURCE_FILES}) diff --git a/modules/volume/rendering/renderablevolume.cpp b/modules/volume/rendering/renderablevolume.cpp deleted file mode 100644 index 558bed474f..0000000000 --- a/modules/volume/rendering/renderablevolume.cpp +++ /dev/null @@ -1,461 +0,0 @@ -/***************************************************************************************** - * * - * 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. * - ****************************************************************************************/ - -// open space includes -#include -#include -#include -#include - -// ghoul includes -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -namespace { - const std::string _loggerCat = "RenderableVolume"; - - bool hasExtension (std::string const &filepath, std::string const &extension) - { - std::string ending = "." + extension; - if (filepath.length() > ending.length()) { - return (0 == filepath.compare (filepath.length() - ending.length(), ending.length(), ending)); - } else { - return false; - } - } - - template - T stringToNumber(const std::string& number, std::function f = nullptr) { - static_assert(std::is_integral::value || std::is_floating_point::value, - "Must be integral or floating point"); - std::stringstream ss; - T templateNumber = {0}; - ss << number; - ss >> templateNumber; - if( ! f) - return templateNumber; - - return f(templateNumber); - - } -} - -namespace openspace { - -RenderableVolume::RenderableVolume(const ghoul::Dictionary& dictionary) : Renderable(dictionary) { -} - -RenderableVolume::~RenderableVolume() { -} - -ghoul::opengl::Texture* RenderableVolume::loadVolume( - const std::string& filepath, - const ghoul::Dictionary& hintsDictionary) { - - if( ! FileSys.fileExists(filepath)) { - LWARNING("Could not load volume, could not find '" << filepath << "'"); - return nullptr; - } - - if(hasExtension(filepath, "raw")) { - ghoul::RawVolumeReader::ReadHints hints = readHints(hintsDictionary); - ghoul::RawVolumeReader rawReader(hints); - return rawReader.read(filepath); - } else if(hasExtension(filepath, "cdf")) { - - ghoul::opengl::Texture::FilterMode filtermode = ghoul::opengl::Texture::FilterMode::Linear; - ghoul::opengl::Texture::WrappingMode wrappingmode = ghoul::opengl::Texture::WrappingMode::ClampToEdge; - - glm::size3_t dimensions(1,1,1); - double tempValue; - if (hintsDictionary.hasKey("Dimensions.1") && - hintsDictionary.getValue("Dimensions.1", tempValue)) { - int intVal = static_cast(tempValue); - if(intVal > 0) - dimensions[0] = intVal; - } - if (hintsDictionary.hasKey("Dimensions.2") && - hintsDictionary.getValue("Dimensions.2", tempValue)) { - int intVal = static_cast(tempValue); - if(intVal > 0) - dimensions[1] = intVal; - } - if (hintsDictionary.hasKey("Dimensions.3") && - hintsDictionary.getValue("Dimensions.3", tempValue)) { - int intVal = static_cast(tempValue); - if(intVal > 0) - dimensions[2] = intVal; - } - - std::string variableCacheString = ""; - if (hintsDictionary.hasKey("Variable")) { - hintsDictionary.getValue("Variable", variableCacheString); - } else if(hintsDictionary.hasKey("Variables")) { - std::string xVariable, yVariable, zVariable; - bool xVar, yVar, zVar; - xVar = hintsDictionary.getValue("Variables.1", xVariable); - yVar = hintsDictionary.getValue("Variables.2", yVariable); - zVar = hintsDictionary.getValue("Variables.3", zVariable); - if (xVar && yVar && zVar) { - variableCacheString = xVariable + "." + yVariable + "." + zVariable; - } - } - - bool cache = false; - hintsDictionary.hasKey("Cache"); - if (hintsDictionary.hasKey("Cache")) - hintsDictionary.getValue("Cache", cache); - - std::stringstream ss; - ss << "." << dimensions[0] << "x" << dimensions[1] << "x" << dimensions[2] << "." << "." << variableCacheString << ".cache"; - - // = filepath + ss.str(); - ghoul::filesystem::File ghlFile(filepath); - std::string cachepath = FileSys.cacheManager()->cachedFilename(ghlFile.baseName(), - ss.str(), true); - if (cache && FileSys.fileExists(cachepath)) { - -#define VOLUME_LOAD_PROGRESSBAR - std::ifstream file(cachepath, std::ios::binary | std::ios::in); - if (file.is_open()) { - size_t length = dimensions[0] * dimensions[1] * dimensions[2]; - float* data = new float[length]; -#ifdef VOLUME_LOAD_PROGRESSBAR - LINFO("Loading cache: " << cachepath); - ProgressBar pb(static_cast(dimensions[2])); - for (size_t i = 0; i < dimensions[2]; ++i) { - size_t offset = length / dimensions[2]; - std::streamsize offsetsize = sizeof(float)*offset; - file.read(reinterpret_cast(data + offset * i), offsetsize); - pb.print(static_cast(i)); - } -#else - file.read(reinterpret_cast(data), sizeof(float)*length); -#endif - file.close(); - return new ghoul::opengl::Texture(data, dimensions, ghoul::opengl::Texture::Format::Red, GL_RED, GL_FLOAT, filtermode, wrappingmode); - } else { - return nullptr; - } - } - - KameleonWrapper kw(filepath); - std::string variableString; - if (hintsDictionary.hasKey("Variable") && hintsDictionary.getValue("Variable", variableString)) { - float* data = kw.getUniformSampledValues(variableString, dimensions); - if(cache) { - std::ofstream file(cachepath, std::ios::binary | std::ios::out); - if (file.is_open()) { - size_t length = dimensions[0] * dimensions[1] * dimensions[2]; - file.write(reinterpret_cast(data), sizeof(float)*length); - file.close(); - } - } - return new ghoul::opengl::Texture(data, dimensions, ghoul::opengl::Texture::Format::Red, GL_RED, GL_FLOAT, filtermode, wrappingmode); - } else if (hintsDictionary.hasKey("Variables")) { - std::string xVariable, yVariable, zVariable; - bool xVar, yVar, zVar; - xVar = hintsDictionary.getValue("Variables.1", xVariable); - yVar = hintsDictionary.getValue("Variables.2", yVariable); - zVar = hintsDictionary.getValue("Variables.3", zVariable); - - if (!xVar || !yVar || !zVar) { - LERROR("Error reading variables! Must be 3 and must exist in CDF data"); - } else { - - float* data = kw.getUniformSampledVectorValues(xVariable, yVariable, zVariable, dimensions); - if(cache) { - //FILE* file = fopen (cachepath.c_str(), "wb"); - std::ofstream file(cachepath, std::ios::in | std::ios::binary); - size_t length = dimensions[0] * dimensions[1] * dimensions[2]; - file.write(reinterpret_cast(data), sizeof(float)*length); - file.close(); - } - - return new ghoul::opengl::Texture(data, dimensions, ghoul::opengl::Texture::Format::RGBA, GL_RGBA, GL_FLOAT, filtermode, wrappingmode); - } - - } else { - LWARNING("Hints does not specify a 'Variable' or 'Variables'"); - } - } else { - LWARNING("No valid file extension."); - } - return nullptr; -} - -glm::vec3 RenderableVolume::getVolumeOffset( - const std::string& filepath, - const ghoul::Dictionary& hintsDictionary) { - - KameleonWrapper kw(filepath); - return kw.getModelBarycenterOffset(); -} - -ghoul::RawVolumeReader::ReadHints RenderableVolume::readHints(const ghoul::Dictionary& dictionary) { - ghoul::RawVolumeReader::ReadHints hints; - hints._dimensions = glm::ivec3(1, 1, 1); - hints._format = ghoul::opengl::Texture::Format::Red; - hints._internalFormat = GL_R8; - - // parse hints - double tempValue; - if (dictionary.hasKey("Dimensions.1") && dictionary.getValue("Dimensions.1", tempValue)) { - int intVal = static_cast(tempValue); - if(intVal > 0) - hints._dimensions[0] = intVal; - } - if (dictionary.hasKey("Dimensions.2") && dictionary.getValue("Dimensions.2", tempValue)) { - int intVal = static_cast(tempValue); - if(intVal > 0) - hints._dimensions[1] = intVal; - } - if (dictionary.hasKey("Dimensions.3") && dictionary.getValue("Dimensions.3", tempValue)) { - int intVal = static_cast(tempValue); - if(intVal > 0) - hints._dimensions[2] = intVal; - } - - std::string format; - if (dictionary.hasKey("Format") && dictionary.getValue("Format", format)) { - if(format == "RED") { - hints._format = ghoul::opengl::Texture::Format::Red; - } else if(format == "RG") { - hints._format = ghoul::opengl::Texture::Format::RG; - } else if(format == "RGB") { - hints._format = ghoul::opengl::Texture::Format::RGB; - } else if(format == "RGBA") { - hints._format = ghoul::opengl::Texture::Format::RGBA; - } - } - - format = ""; - if (dictionary.hasKey("InternalFormat") && dictionary.getValue("InternalFormat", format)) { - if(format == "R8") { - hints._internalFormat = GL_R8; - } else if(format == "RG8") { - hints._internalFormat = GL_RG8; - } else if(format == "RGB8") { - hints._internalFormat = GL_RGB8; - } else if(format == "RGBA8") { - hints._internalFormat = GL_RGB8; - } else if(format == "R32F") { - hints._internalFormat = GL_R32F; - } else if(format == "RG32F") { - hints._internalFormat = GL_RG32F; - } else if(format == "RGB32F") { - hints._internalFormat = GL_RGB32F; - } else if(format == "RGBA32F") { - hints._internalFormat = GL_RGB32F; - } - } - return hints; -} - -ghoul::opengl::Texture* RenderableVolume::loadTransferFunction(const std::string& filepath) { - - std::string f = absPath(filepath); - - if ( ! FileSys.fileExists(f)) { - return nullptr; - } - ghoul::opengl::Texture::FilterMode filtermode = ghoul::opengl::Texture::FilterMode::Linear; - ghoul::opengl::Texture::WrappingMode wrappingmode = ghoul::opengl::Texture::WrappingMode::ClampToEdge; - - - // check if not a txt based texture - if ( ! hasExtension(filepath, "txt")) { - ghoul::opengl::Texture* t = ghoul::io::TextureReader::ref().loadTexture(f).get(); - t->setWrapping(wrappingmode); - return t; - } - - // it is a txt based texture - std::ifstream in; - in.open(filepath.c_str()); - if (!in.is_open()) { - LERROR("Could not open file " << f); - return nullptr; - } - - int width = 512; - float lower = 0.0f; - float upper = 1.0f; - - struct mappingKey { - float position{0.0f}; - glm::vec4 color{0.0f,0.0f,0.0f,0.0f}; - - mappingKey(float p, const glm::vec4& c): position(p), color(c){}; - mappingKey(float p): position(p), color(glm::vec4(0.0f)){}; - bool operator<(const mappingKey& rhs) {return position < rhs.position;}; - }; - - std::vector mappingKeys; - - auto widthValidator = [](size_t in) { if(in > 0) return in; return static_cast(1); }; - auto upperLowerValidator = [](float in) { return glm::clamp(in, 0.0f, 1.0f); }; - auto intensityValidator = [](float in) { return glm::clamp(in, 0.0f, 1.0f); }; - - std::string line; - while (std::getline(in, line)) { - - glm::vec4 rgba = glm::vec4(0.0f); - // tokenize the line - std::istringstream iss(line); - std::vector tokens{std::istream_iterator{iss},std::istream_iterator{}}; - - size_t tokenSize =tokens.size(); - if (tokenSize > 0) { - std::string key = tokens.at(0); - if(key == "width" && tokenSize == 2) { - width = static_cast(stringToNumber(tokens.at(1), widthValidator)); - } else if(key == "lower" && tokenSize == 2) { - lower = stringToNumber(tokens.at(1), upperLowerValidator); - } else if(key == "upper" && tokenSize == 2) { - upper = stringToNumber(tokens.at(1),upperLowerValidator); - } else if(key == "mappingkey" && tokenSize == 6) { - float intensity = stringToNumber(tokens.at(1), intensityValidator); - for(int i = 0; i < 4; ++i) - rgba[i] = stringToNumber(tokens.at(i+2)); - - mappingKeys.push_back({intensity, rgba}); - } - } - } - in.close(); - - - if (mappingKeys.size() < 1) { - return nullptr; - } - - // for(auto key: mappingKeys) { - // glm::vec4 rgba = key.color; - // LDEBUG("i: " << key.position << ", rgba: (" << rgba[0] << ", " << rgba[1] << ", " << rgba[2] << ", " << rgba[3] << ")"); - // } - // LDEBUG("insert...."); - - if (mappingKeys.front().position > lower){ - mappingKeys.insert(mappingKeys.begin(), {lower,mappingKeys.front().color}); - } - - if (mappingKeys.back().position < upper){ - mappingKeys.push_back({upper,mappingKeys.back().color}); - } - - - // for(auto key: mappingKeys) { - // glm::vec4 rgba = key.color; - // LDEBUG("i: " << key.position << ", rgba: (" << rgba[0] << ", " << rgba[1] << ", " << rgba[2] << ", " << rgba[3] << ")"); - // } - - // allocate new float array with zeros - float* transferFunction = new float[width*4](); - for (int i = 0; i < 4*width; ++i) { - transferFunction[i] = 0.0f; - } - - size_t lowerIndex = static_cast(floorf(lower*static_cast(width-1))); - size_t upperIndex = static_cast(floorf(upper*static_cast(width-1))); - -// LDEBUG("width: " << width); -// LDEBUG("lower: " << lower); -// LDEBUG("upper: " << upper); -// LDEBUG("lowerIndex: " << lowerIndex); -// LDEBUG("upperIndex: " << upperIndex); - - - auto prevKey = mappingKeys.begin(); - auto currentKey = prevKey + 1; - auto lastKey = mappingKeys.end() -1; - - for (size_t i=lowerIndex; i<=upperIndex; i++) { - - float fpos = static_cast(i)/static_cast(width-1); - - if (fpos > (*currentKey).position) { - prevKey = currentKey; - currentKey++; - if (currentKey == mappingKeys.end()) { - currentKey = lastKey; - } - } - - float dist = fpos-(*prevKey).position; - float weight = dist/((*currentKey).position-(*prevKey).position); - - //LDEBUG("fpos: " << fpos); - //LDEBUG("(*prevKey).position: " << (*prevKey).position); - //LDEBUG("(*currentKey).position: " << (*currentKey).position); - //LDEBUG("weight: " << weight); - - for (size_t channel=0; channel<4; ++channel) { - size_t position = 4*i + channel; - // Interpolate linearly between prev and next mapping key - - //LDEBUG("i: " << i); - //LDEBUG("position: " << position); - //LDEBUG("(*prevKey).first " << (*prevKey).first); - //LDEBUG("(*currentKey).first " << (*currentKey).first); - //LDEBUG("dist: " << dist); - //LDEBUG("weight: " << weight); - float value = - ((*prevKey).color[channel]*(1.f-weight) + (*currentKey).color[channel]*weight)/255.f; - transferFunction[position] = value; - - //LDEBUG("["<< position <<"] " << value); - - } - // LDEBUG(std::fixed << std::setw(10) << std::left << std::setprecision(8) << weight << ", (" << - // std::setw(10) << std::left << std::setprecision(8) << transferFunction[4*i+0] << ", " << - // std::setw(10) << std::left << std::setprecision(8) << transferFunction[4*i+1] << ", " << - // std::setw(10) << std::left << std::setprecision(8) << transferFunction[4*i+2] << ", " << - // std::setw(10) << std::left << std::setprecision(8) << transferFunction[4*i+3] << ")"); - } - - // for (int i = 0; i <= width; ++i) { - - // LDEBUG(std::fixed << "(" << - // std::setw(10) << std::left << std::setprecision(8) << transferFunction[4*i+0] << ", " << - // std::setw(10) << std::left << std::setprecision(8) << transferFunction[4*i+1] << ", " << - // std::setw(10) << std::left << std::setprecision(8) << transferFunction[4*i+2] << ", " << - // std::setw(10) << std::left << std::setprecision(8) << transferFunction[4*i+3] << ")"); - // } - - return new ghoul::opengl::Texture(transferFunction, - glm::size3_t(width,1,1),ghoul::opengl::Texture::Format::RGBA, - GL_RGBA, GL_FLOAT,filtermode, wrappingmode); -} - -} // namespace openspace diff --git a/modules/volume/rendering/renderablevolumegl.cpp b/modules/volume/rendering/renderablevolumegl.cpp deleted file mode 100644 index 8c85e21353..0000000000 --- a/modules/volume/rendering/renderablevolumegl.cpp +++ /dev/null @@ -1,323 +0,0 @@ -/***************************************************************************************** - * * - * 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. * - ****************************************************************************************/ - -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include - -namespace { - const std::string _loggerCat = "RenderableVolumeGL"; - const std::string KeyVolume = "Volume"; - const std::string KeyHints = "Hints"; - const std::string KeyTransferFunction = "TransferFunction"; - const std::string KeySampler = "Sampler"; - const std::string KeyBoxScaling = "BoxScaling"; - const std::string KeyVolumeName = "VolumeName"; - const std::string KeyTransferFunctionName = "TransferFunctionName"; -} - -namespace openspace { - -RenderableVolumeGL::RenderableVolumeGL(const ghoul::Dictionary& dictionary) - : RenderableVolume(dictionary) - , _transferFunctionName("") - , _volumeName("") - , _volume(nullptr) - , _transferFunction(nullptr) - , _boxArray(0) - , _vertexPositionBuffer(0) - , _boxProgram(nullptr) - , _boxScaling(1.0, 1.0, 1.0) - , _w(0.f) - , _updateTransferfunction(false) - , _id(-1) -{ - std::string name; - bool success = dictionary.getValue(SceneGraphNode::KeyName, name); - assert(success); - - _filename = ""; - success = dictionary.getValue(KeyVolume, _filename); - if (!success) { - LERROR("Node '" << name << "' did not contain a valid '" << KeyVolume << "'"); - return; - } - _filename = absPath(_filename); - if (_filename == "") { - return; - } - - LDEBUG("Volume Filename: " << _filename); - - dictionary.getValue(KeyHints, _hintsDictionary); - - _transferFunction = nullptr; - _transferFunctionFile = nullptr; - _transferFunctionPath = ""; - success = dictionary.getValue(KeyTransferFunction, _transferFunctionPath); - if (!success) { - LERROR("Node '" << name << "' did not contain a valid '" << - KeyTransferFunction << "'"); - return; - } - _transferFunctionPath = absPath(_transferFunctionPath); - _transferFunctionFile = new ghoul::filesystem::File(_transferFunctionPath, true); - - _samplerFilename = ""; - success = dictionary.getValue(KeySampler, _samplerFilename); - if (!success) { - LERROR("Node '" << name << "' did not contain a valid '" << KeySampler << "'"); - return; - } - _samplerFilename = absPath(_samplerFilename); - - KameleonWrapper kw(_filename); - auto t = kw.getGridUnits(); - if (dictionary.hasKey(KeyBoxScaling)) { - glm::vec4 scalingVec4(_boxScaling, _w); - success = dictionary.getValue(KeyBoxScaling, scalingVec4); - if (success) { - _boxScaling = scalingVec4.xyz(); - _w = scalingVec4.w; - } - else { - success = dictionary.getValue(KeyBoxScaling, _boxScaling); - if (!success) { - LERROR("Node '" << name << "' did not contain a valid '" << - KeyBoxScaling << "'"); - return; - } - } - } - else { - // Automatic scale detection from model - _boxScaling = kw.getModelScale(); - if (std::get<0>(t) == "R" && std::get<1>(t) == "R" && std::get<2>(t) == "R") { - // Earth radius - _boxScaling.x *= 6.371f; - _boxScaling.y *= 6.371f; - _boxScaling.z *= 6.371f; - _w = 6; - } - else if (std::get<0>(t) == "m" && std::get<1>(t) == "radian" && std::get<2>(t) == "radian") { - // For spherical coordinate systems the radius is in meter - _w = -log10(1.0f/kw.getGridMax().x); - } - else { - LWARNING("Unsupported units for automatic scale detection"); - } - } - - _pscOffset = kw.getModelBarycenterOffset(); - if (std::get<0>(t) == "R" && std::get<1>(t) == "R" && std::get<2>(t) == "R") { - // Earth radius - _pscOffset[0] *= 6.371f; - _pscOffset[1] *= 6.371f; - _pscOffset[2] *= 6.371f; - _pscOffset[3] = 6; - } - else { - // Current spherical models no need for offset - } - - dictionary.getValue(KeyVolumeName, _volumeName); - dictionary.getValue(KeyTransferFunctionName, _transferFunctionName); - - setBoundingSphere(PowerScaledScalar::CreatePSS(glm::length(_boxScaling)*pow(10,_w))); -} - -RenderableVolumeGL::~RenderableVolumeGL() { -} - -bool RenderableVolumeGL::isReady() const { - bool ready = true; - ready &= (_boxProgram != nullptr); - ready &= (_volume != nullptr); - ready &= (_transferFunction != nullptr); - return ready; -} - -bool RenderableVolumeGL::initialize() { - // @TODO fix volume and transferfunction names --jonasstrandstedt - if(_filename != "") { - _volume = loadVolume(_filename, _hintsDictionary); - _volume->uploadTexture(); - OsEng.renderEngine().aBuffer()->addVolume(_volumeName, _volume); - } - - if(_transferFunctionPath != "") { - _transferFunction = loadTransferFunction(_transferFunctionPath); - _transferFunction->uploadTexture(); - OsEng.renderEngine().aBuffer()->addTransferFunction(_transferFunctionName, _transferFunction); - - auto textureCallback = [this](const ghoul::filesystem::File& file) { - _updateTransferfunction = true; - }; - _transferFunctionFile->setCallback(textureCallback); - } - - // add the sampler and get the ID - _id = OsEng.renderEngine().aBuffer()->addSamplerfile(_samplerFilename); - - OsEng.configurationManager().getValue("RaycastProgram", _boxProgram); - - // ============================ - // GEOMETRY (box) - // ============================ - const GLfloat size = 0.5f; - const GLfloat vertex_data[] = { - // x, y, z, s, - -size, -size, size, _w, - size, size, size, _w, - -size, size, size, _w, - -size, -size, size, _w, - size, -size, size, _w, - size, size, size, _w, - - -size, -size, -size, _w, - size, size, -size, _w, - -size, size, -size, _w, - -size, -size, -size, _w, - size, -size, -size, _w, - size, size, -size, _w, - - size, -size, -size, _w, - size, size, size, _w, - size, -size, size, _w, - size, -size, -size, _w, - size, size, -size, _w, - size, size, size, _w, - - -size, -size, -size, _w, - -size, size, size, _w, - -size, -size, size, _w, - -size, -size, -size, _w, - -size, size, -size, _w, - -size, size, size, _w, - - -size, size, -size, _w, - size, size, size, _w, - -size, size, size, _w, - -size, size, -size, _w, - size, size, -size, _w, - size, size, size, _w, - - -size, -size, -size, _w, - size, -size, size, _w, - -size, -size, size, _w, - -size, -size, -size, _w, - size, -size, -size, _w, - size, -size, size, _w, - }; - - glGenVertexArrays(1, &_boxArray); // generate array - glBindVertexArray(_boxArray); // bind array - glGenBuffers(1, &_vertexPositionBuffer); // generate buffer - glBindBuffer(GL_ARRAY_BUFFER, _vertexPositionBuffer); // bind buffer - glBufferData(GL_ARRAY_BUFFER, sizeof(vertex_data), vertex_data, GL_STATIC_DRAW); - glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, sizeof(GLfloat)*4, reinterpret_cast(0)); - glEnableVertexAttribArray(0); - - return isReady(); -} - -bool RenderableVolumeGL::deinitialize() { - if (_volume) - delete _volume; - if (_transferFunctionFile) - delete _transferFunctionFile; - if (_transferFunction) - delete _transferFunction; - _volume = nullptr; - _transferFunctionFile = nullptr; - _transferFunction = nullptr; - - glDeleteVertexArrays(1, &_boxArray); - glGenBuffers(1, &_vertexPositionBuffer); - - return true; -} - -void RenderableVolumeGL::render(const RenderData& data) { - if(_updateTransferfunction) { - _updateTransferfunction = false; - ghoul::opengl::Texture* transferFunction = loadTransferFunction(_transferFunctionPath); - if(transferFunction) { - const void* data = transferFunction->pixelData(); - glBindBuffer(GL_COPY_READ_BUFFER, *transferFunction); - _transferFunction->bind(); - glTexImage1D( GL_TEXTURE_1D, 0, _transferFunction->internalFormat(), - static_cast(_transferFunction->width()),0, _transferFunction->format(), - _transferFunction->dataType(), data); - delete transferFunction; - LDEBUG("Updated transferfunction!"); - } - } - - glm::mat4 transform = glm::mat4(1.0); - transform = glm::scale(transform, _boxScaling); - - // fetch data - psc currentPosition = data.position; - currentPosition += _pscOffset; // Move box to model barycenter - - _boxProgram->activate(); - _boxProgram->setUniform("volumeType", _id); - _boxProgram->setUniform("modelViewProjection", data.camera.viewProjectionMatrix()); - _boxProgram->setUniform("modelTransform", transform); - setPscUniforms(_boxProgram, &data.camera, currentPosition); - - // make sure GL_CULL_FACE is enabled (it should be) - glEnable(GL_CULL_FACE); - - // Draw backface - glCullFace(GL_FRONT); - glBindVertexArray(_boxArray); - glDrawArrays(GL_TRIANGLES, 0, 6*6); - - // Draw frontface (now the normal cull face is is set) - glCullFace(GL_BACK); - glDrawArrays(GL_TRIANGLES, 0, 6*6); - - _boxProgram->deactivate(); -} - -void RenderableVolumeGL::update(const UpdateData& data) { -} - -} // namespace openspace diff --git a/modules/volume/rendering/volumeclipplane.cpp b/modules/volume/rendering/volumeclipplane.cpp new file mode 100644 index 0000000000..83e72b52e0 --- /dev/null +++ b/modules/volume/rendering/volumeclipplane.cpp @@ -0,0 +1,61 @@ + +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#include +#include + + +namespace openspace { + +VolumeClipPlane::VolumeClipPlane(const ghoul::Dictionary& dictionary) + : _normal("normal", "Normal", glm::vec3(1.0, 0.0, 0.0), glm::vec3(-1.0), glm::vec3(1.0)) + , _offsets("offsets", "Offsets", glm::vec2(-2.0, 0.0), glm::vec2(-2.0, 0.0), glm::vec2(2.0, 1.0)) +{ + glm::vec3 normal; + glm::vec2 offsets; + dictionary.getValue("Normal", normal); + dictionary.getValue("Offsets", offsets); + + _normal = normal; + _offsets = offsets; +} + +void VolumeClipPlane::initialize() +{ + addProperty(_normal); + addProperty(_offsets); +} + +glm::vec3 VolumeClipPlane::normal() +{ + return glm::normalize(_normal.value()); +} + +glm::vec2 VolumeClipPlane::offsets() +{ + return _offsets; +} + +} \ No newline at end of file diff --git a/modules/volume/rendering/renderablevolumegl.h b/modules/volume/rendering/volumeclipplane.h similarity index 66% rename from modules/volume/rendering/renderablevolumegl.h rename to modules/volume/rendering/volumeclipplane.h index 8e7153ce73..7cec5978dc 100644 --- a/modules/volume/rendering/renderablevolumegl.h +++ b/modules/volume/rendering/volumeclipplane.h @@ -25,62 +25,29 @@ #ifndef __OPENSPACE_MODULE_VOLUME___RENDERABLEVOLUMEGL___H__ #define __OPENSPACE_MODULE_VOLUME___RENDERABLEVOLUMEGL___H__ -#include -#include +#include +#include // Forward declare to minimize dependencies namespace ghoul { - namespace filesystem { - class File; - } - namespace opengl { - class ProgramObject; - class Texture; - } + class Dictionary; } namespace openspace { -class RenderableVolumeGL: public RenderableVolume { +class VolumeClipPlane : public properties::PropertyOwner { public: - RenderableVolumeGL(const ghoul::Dictionary& dictionary); - ~RenderableVolumeGL(); - - bool initialize() override; - bool deinitialize() override; - - bool isReady() const override; - - virtual void render(const RenderData& data) override; - virtual void update(const UpdateData& data) override; - + VolumeClipPlane(const ghoul::Dictionary& dictionary); + virtual ~VolumeClipPlane() = default; + virtual void initialize(); + glm::vec3 normal(); + glm::vec2 offsets(); private: - ghoul::Dictionary _hintsDictionary; + properties::Vec3Property _normal; + properties::Vec2Property _offsets; - std::string _filename; - - std::string _transferFunctionName; - std::string _volumeName; - - std::string _transferFunctionPath; - std::string _samplerFilename; - - ghoul::filesystem::File* _transferFunctionFile; - - ghoul::opengl::Texture* _volume; - ghoul::opengl::Texture* _transferFunction; - - GLuint _boxArray; - GLuint _vertexPositionBuffer; - ghoul::opengl::ProgramObject* _boxProgram; - glm::vec3 _boxScaling; - psc _pscOffset; - float _w; - - bool _updateTransferfunction; - int _id; }; -} // namespace openspace +} // namespace openspace #endif // __OPENSPACE_MODULE_VOLUME___RENDERABLEVOLUMEGL___H__ diff --git a/modules/volume/rendering/volumeclipplanes.cpp b/modules/volume/rendering/volumeclipplanes.cpp new file mode 100644 index 0000000000..711a0f4550 --- /dev/null +++ b/modules/volume/rendering/volumeclipplanes.cpp @@ -0,0 +1,76 @@ + +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#include +#include + + +namespace openspace { + +VolumeClipPlanes::VolumeClipPlanes(const ghoul::Dictionary& dictionary) + : _nClipPlanes("nClipPlanes", "Number of clip planes", 0, 0, 10) +{ + std::vector keys = dictionary.keys(); + for (const std::string& key : keys) { + ghoul::Dictionary cutPlaneDictionary; + dictionary.getValue(key, cutPlaneDictionary); + std::shared_ptr clipPlane = std::make_shared(cutPlaneDictionary); + clipPlane->setName(key); + _clipPlanes.push_back(clipPlane); + } + _nClipPlanes = keys.size(); +} + +void VolumeClipPlanes::initialize() { + addProperty(_nClipPlanes); + for (const auto& clipPlane : _clipPlanes) { + addPropertySubOwner(clipPlane.get()); + clipPlane->initialize(); + } +} + +void VolumeClipPlanes::deinitialize() { + +} + +std::vector VolumeClipPlanes::normals() +{ + std::vector normals; + for (const auto& clipPlane : _clipPlanes) { + normals.push_back(clipPlane->normal()); + } + return normals; +} + +std::vector VolumeClipPlanes::offsets() +{ + std::vector offsets; + for (const auto& clipPlane : _clipPlanes) { + offsets.push_back(clipPlane->offsets()); + } + return offsets; +} + +} \ No newline at end of file diff --git a/modules/volume/rendering/renderablevolume.h b/modules/volume/rendering/volumeclipplanes.h similarity index 74% rename from modules/volume/rendering/renderablevolume.h rename to modules/volume/rendering/volumeclipplanes.h index 8912155460..ea888a6751 100644 --- a/modules/volume/rendering/renderablevolume.h +++ b/modules/volume/rendering/volumeclipplanes.h @@ -25,39 +25,34 @@ #ifndef __OPENSPACE_MODULE_VOLUME___RENDERABLEVOLUME___H__ #define __OPENSPACE_MODULE_VOLUME___RENDERABLEVOLUME___H__ -// open space includes -#include +#include +#include -// ghoul includes -#include +#include + +#include +#include // Forward declare to minimize dependencies namespace ghoul { - namespace filesystem { - class File; - } - namespace opengl { - class Texture; - } + class Dictionary; } namespace openspace { -class RenderableVolume: public Renderable { +class VolumeClipPlanes : public properties::PropertyOwner { public: - // constructors & destructor - RenderableVolume(const ghoul::Dictionary& dictionary); - ~RenderableVolume(); - -protected: - ghoul::opengl::Texture* loadVolume(const std::string& filepath, const ghoul::Dictionary& hintsDictionary); - glm::vec3 getVolumeOffset(const std::string& filepath, const ghoul::Dictionary& hintsDictionary); - ghoul::RawVolumeReader::ReadHints readHints(const ghoul::Dictionary& dictionary); - ghoul::opengl::Texture* loadTransferFunction(const std::string& filepath); - + VolumeClipPlanes(const ghoul::Dictionary& dictionary); + virtual ~VolumeClipPlanes() = default; + void initialize(); + void deinitialize(); + std::vector normals(); + std::vector offsets(); private: + properties::IntProperty _nClipPlanes; + std::vector> _clipPlanes; }; -} // namespace openspace +} // namespace openspace #endif // __OPENSPACE_MODULE_VOLUME___RENDERABLEVOLUME___H__ diff --git a/modules/volume/volumemodule.cpp b/modules/volume/volumemodule.cpp index 5513daff5a..1a2a7b9115 100644 --- a/modules/volume/volumemodule.cpp +++ b/modules/volume/volumemodule.cpp @@ -29,8 +29,6 @@ #include -#include - namespace openspace { VolumeModule::VolumeModule() @@ -38,8 +36,7 @@ VolumeModule::VolumeModule() {} void VolumeModule::internalInitialize() { - auto fRenderable = FactoryManager::ref().factory(); - ghoul_assert(fRenderable, "No renderable factory existed"); + } } // namespace openspace From e665bca1286acaec011fbfa4ad81fee3ccc8cb81 Mon Sep 17 00:00:00 2001 From: Emil Axelsson Date: Tue, 24 Jan 2017 09:35:55 +0100 Subject: [PATCH 68/96] Compile fixes --- modules/kameleonvolume/rendering/kameleonvolumeraycaster.cpp | 1 + modules/kameleonvolume/rendering/kameleonvolumeraycaster.h | 1 + modules/kameleonvolume/rendering/renderablekameleonvolume.cpp | 2 +- modules/kameleonvolume/rendering/renderablekameleonvolume.h | 1 + modules/volume/CMakeLists.txt | 1 + modules/volume/volumegridtype.h | 4 ++-- 6 files changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/kameleonvolume/rendering/kameleonvolumeraycaster.cpp b/modules/kameleonvolume/rendering/kameleonvolumeraycaster.cpp index aaa7c86539..5667f73ac9 100644 --- a/modules/kameleonvolume/rendering/kameleonvolumeraycaster.cpp +++ b/modules/kameleonvolume/rendering/kameleonvolumeraycaster.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include diff --git a/modules/kameleonvolume/rendering/kameleonvolumeraycaster.h b/modules/kameleonvolume/rendering/kameleonvolumeraycaster.h index e007676a35..1892736d01 100644 --- a/modules/kameleonvolume/rendering/kameleonvolumeraycaster.h +++ b/modules/kameleonvolume/rendering/kameleonvolumeraycaster.h @@ -45,6 +45,7 @@ namespace ghoul { namespace opengl { class Texture; class ProgramObject; + class TextureUnit; } } diff --git a/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp b/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp index cfeb9ac169..3ec80484d6 100644 --- a/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp +++ b/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp @@ -58,7 +58,7 @@ RenderableKameleonVolume::RenderableKameleonVolume(const ghoul::Dictionary& dict , _lowerValueBound("lowerValueBound", "Lower Value Bound", 0.0, 0.0, 1) , _upperValueBound("upperValueBound", "Upper Value Bound", 1, 0.01, 1) , _autoValueBounds(false) - , _gridType("gridType", "Grid Type", properties::OptionProperty::DisplayType::DROPDOWN) + , _gridType("gridType", "Grid Type", properties::OptionProperty::DisplayType::Dropdown) , _autoGridType(false) , _clipPlanes(nullptr) , _stepSize("stepSize", "Step Size", 0.02, 0.01, 1) diff --git a/modules/kameleonvolume/rendering/renderablekameleonvolume.h b/modules/kameleonvolume/rendering/renderablekameleonvolume.h index d5f2cba378..cddb542942 100644 --- a/modules/kameleonvolume/rendering/renderablekameleonvolume.h +++ b/modules/kameleonvolume/rendering/renderablekameleonvolume.h @@ -27,6 +27,7 @@ #include #include +#include #include #include diff --git a/modules/volume/CMakeLists.txt b/modules/volume/CMakeLists.txt index 83dff7d4ea..11da446b0e 100644 --- a/modules/volume/CMakeLists.txt +++ b/modules/volume/CMakeLists.txt @@ -35,6 +35,7 @@ set(HEADER_FILES ${CMAKE_CURRENT_SOURCE_DIR}/textureslicevolumereader.inl ${CMAKE_CURRENT_SOURCE_DIR}/lrucache.h ${CMAKE_CURRENT_SOURCE_DIR}/linearlrucache.h + ${CMAKE_CURRENT_SOURCE_DIR}/volumegridtype.h ${CMAKE_CURRENT_SOURCE_DIR}/volumesampler.h ${CMAKE_CURRENT_SOURCE_DIR}/volumesampler.inl ${CMAKE_CURRENT_SOURCE_DIR}/volumeutils.h diff --git a/modules/volume/volumegridtype.h b/modules/volume/volumegridtype.h index 6ff5027861..b7768cec6e 100644 --- a/modules/volume/volumegridtype.h +++ b/modules/volume/volumegridtype.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __VOLUMEGRIDTYPE_H__ -#define __VOLUMEGRIDTYPE_H__ +#ifndef __OPENSPACE_MODULE_VOLUME___VOLUMEGRIDTYPE_H__ +#define __OPENSPACE_MODULE_VOLUME___VOLUMEGRIDTYPE_H__ enum class VolumeGridType : int { Cartesian = 0, From bf0d5528d03d5b9e4c79d36c0527a584f6c1fed2 Mon Sep 17 00:00:00 2001 From: Emil Axelsson Date: Tue, 24 Jan 2017 11:13:30 +0100 Subject: [PATCH 69/96] Resolve some A-buffer related shader issues --- shaders/PowerScaling/powerScalingMath.hglsl | 64 -------------- shaders/PowerScaling/powerScaling_fs.hglsl | 2 + shaders/abuffer/abufferresources.glsl | 3 - shaders/abuffer/renderabuffer.frag | 1 + shaders/abuffer/resolveabuffer.frag | 2 +- shaders/floatoperations.glsl | 93 +++++++++++++++++++++ shaders/framebuffer/exitframebuffer.frag | 2 +- shaders/framebuffer/raycastframebuffer.frag | 2 +- shaders/framebuffer/renderframebuffer.frag | 2 +- shaders/framebuffer/resolveframebuffer.frag | 2 - 10 files changed, 100 insertions(+), 73 deletions(-) create mode 100644 shaders/floatoperations.glsl diff --git a/shaders/PowerScaling/powerScalingMath.hglsl b/shaders/PowerScaling/powerScalingMath.hglsl index 58ffd0d978..b275aaf989 100644 --- a/shaders/PowerScaling/powerScalingMath.hglsl +++ b/shaders/PowerScaling/powerScalingMath.hglsl @@ -80,47 +80,6 @@ vec4 z_normalization(vec4 v_in) { return v_out; } -/** - * Compute the length of a vector. - * Supporting huge vectors, where the square of any of the components is too large to represent as a float. - */ -float safeLength(vec4 v) { - float m = max(max(max(abs(v.x), abs(v.y)), abs(v.z)), abs(v.w)); - if (m > 0.0) { - return length(v / m) * m; - } else { - return 0; - } -} - -float safeLength(vec3 v) { - float m = max(max(abs(v.x), abs(v.y)), abs(v.z)); - if (m > 0.0) { - return length(v / m) * m; - } else { - return 0; - } -} - -float safeLength(vec2 v) { - float m = max(abs(v.x), abs(v.y)); - if (m > 0.0) { - return length(v / m) * m; - } else { - return 0; - } -} - -/** - * Normalize a vector - * Supporting huge vectors, where the square of any of the components is too large to represent as a float. - */ -vec3 safeNormalize(vec3 v) { - float m = max(max(abs(v.x), abs(v.y)), abs(v.z)); - return normalize(v / m); -} - - /** * Convert a psc vector to a float */ @@ -135,27 +94,4 @@ float pscToLinear(vec2 position) { return pow(k, position.y) * position.x; } -/** - * Convert a positive floating point distance [0, 10^27] - * (size of observable universe) - * to a float in the range [-1, 1], suitable for depth buffer storage. - * Note: This needs to be a monotonic function, so that the value can - * still be used for depth comparison. - */ -float normalizeFloat(float inpt) { - if (inpt > 1.0) { - return inpt / pow(10, 27); - } else { - return inpt - 1.0; - } -} - -float denormalizeFloat(float inpt) { - if (inpt < 0.0) { - return inpt + 1.0; - } else { - return inpt * pow(10, 27); - } -} - #endif diff --git a/shaders/PowerScaling/powerScaling_fs.hglsl b/shaders/PowerScaling/powerScaling_fs.hglsl index 855c98707a..98a648eb56 100644 --- a/shaders/PowerScaling/powerScaling_fs.hglsl +++ b/shaders/PowerScaling/powerScaling_fs.hglsl @@ -25,6 +25,8 @@ #ifndef POWERSCALING_FS_H_HGLSL #define POWERSCALING_FS_H_HGLSL +#include "floatoperations.glsl" + // Observable universe is 10^27m, setting the far value to extremely high, aka 30!! ERMAHGERD! #include "powerScalingMath.hglsl" diff --git a/shaders/abuffer/abufferresources.glsl b/shaders/abuffer/abufferresources.glsl index 4241885318..efa0401c73 100644 --- a/shaders/abuffer/abufferresources.glsl +++ b/shaders/abuffer/abufferresources.glsl @@ -80,7 +80,4 @@ void storeFragments(uint nFrags) { } - - - #endif diff --git a/shaders/abuffer/renderabuffer.frag b/shaders/abuffer/renderabuffer.frag index 0dfd046983..1e94efe35f 100644 --- a/shaders/abuffer/renderabuffer.frag +++ b/shaders/abuffer/renderabuffer.frag @@ -26,6 +26,7 @@ #include <#{fragmentPath}> #include "abufferfragment.glsl" #include "abufferresources.glsl" +#include "floatoperations.glsl" out vec4 _out_color_; diff --git a/shaders/abuffer/resolveabuffer.frag b/shaders/abuffer/resolveabuffer.frag index a722c4f02d..453e656c9b 100644 --- a/shaders/abuffer/resolveabuffer.frag +++ b/shaders/abuffer/resolveabuffer.frag @@ -29,7 +29,7 @@ #include "abufferfragment.glsl" #include "abufferresources.glsl" #include "fragment.glsl" -#include "PowerScaling/powerScalingMath.hglsl" +#include "floatoperations.glsl" #include "blending.glsl" #include "rand.glsl" diff --git a/shaders/floatoperations.glsl b/shaders/floatoperations.glsl new file mode 100644 index 0000000000..c3d52a5300 --- /dev/null +++ b/shaders/floatoperations.glsl @@ -0,0 +1,93 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 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. * + ****************************************************************************************/ + +#ifndef _FLOATOPERATIONS_GLSL_ +#define _FLOATOPERATIONS_GLSL_ + + +/** + * Convert a positive floating point distance [0, 10^27] + * (size of observable universe) + * to a float in the range [-1, 1], suitable for depth buffer storage. + * Note: This needs to be a monotonic function, so that the value can + * still be used for depth comparison. + */ +float normalizeFloat(float inpt) { + if (inpt > 1.0) { + return inpt / pow(10, 27); + } else { + return inpt - 1.0; + } +} + +float denormalizeFloat(float inpt) { + if (inpt < 0.0) { + return inpt + 1.0; + } else { + return inpt * pow(10, 27); + } +} + +/** + * Compute the length of a vector. + * Supporting huge vectors, where the square of any of the components is too large to represent as a float. + */ +float safeLength(vec4 v) { + float m = max(max(max(abs(v.x), abs(v.y)), abs(v.z)), abs(v.w)); + if (m > 0.0) { + return length(v / m) * m; + } else { + return 0; + } +} + +float safeLength(vec3 v) { + float m = max(max(abs(v.x), abs(v.y)), abs(v.z)); + if (m > 0.0) { + return length(v / m) * m; + } else { + return 0; + } +} + +float safeLength(vec2 v) { + float m = max(abs(v.x), abs(v.y)); + if (m > 0.0) { + return length(v / m) * m; + } else { + return 0; + } +} + +/** + * Normalize a vector + * Supporting huge vectors, where the square of any of the components is too large to represent as a float. + */ +vec3 safeNormalize(vec3 v) { + float m = max(max(abs(v.x), abs(v.y)), abs(v.z)); + return normalize(v / m); +} + + +#endif diff --git a/shaders/framebuffer/exitframebuffer.frag b/shaders/framebuffer/exitframebuffer.frag index 19b44c39b6..19956df740 100644 --- a/shaders/framebuffer/exitframebuffer.frag +++ b/shaders/framebuffer/exitframebuffer.frag @@ -25,7 +25,7 @@ #version __CONTEXT__ -#include "PowerScaling/powerScalingMath.hglsl" +#include "floatoperations.glsl" #include <#{fragmentPath}> out vec4 _out_color_; diff --git a/shaders/framebuffer/raycastframebuffer.frag b/shaders/framebuffer/raycastframebuffer.frag index 375bed06b7..915a080d8e 100644 --- a/shaders/framebuffer/raycastframebuffer.frag +++ b/shaders/framebuffer/raycastframebuffer.frag @@ -34,7 +34,7 @@ uniform vec2 windowSize; #include "blending.glsl" #include "rand.glsl" -#include "PowerScaling/powerScalingMath.hglsl" +#include "floatoperations.glsl" #include <#{fragmentPath}> diff --git a/shaders/framebuffer/renderframebuffer.frag b/shaders/framebuffer/renderframebuffer.frag index 2faeda1b26..0f671765ea 100644 --- a/shaders/framebuffer/renderframebuffer.frag +++ b/shaders/framebuffer/renderframebuffer.frag @@ -22,7 +22,7 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#include "PowerScaling/powerScalingMath.hglsl" +#include "floatoperations.glsl" #include <#{fragmentPath}> out vec4 _out_color_; diff --git a/shaders/framebuffer/resolveframebuffer.frag b/shaders/framebuffer/resolveframebuffer.frag index df8b872298..7f32534df1 100644 --- a/shaders/framebuffer/resolveframebuffer.frag +++ b/shaders/framebuffer/resolveframebuffer.frag @@ -24,8 +24,6 @@ #version __CONTEXT__ -#include "PowerScaling/powerScalingMath.hglsl" - layout (location = 0) out vec4 finalColor; uniform float blackoutFactor; uniform int nAaSamples; From 17cc48621a6d7a90190e9c856186236be1cae954 Mon Sep 17 00:00:00 2001 From: Emil Axelsson Date: Tue, 24 Jan 2017 15:59:05 +0100 Subject: [PATCH 70/96] Fix inside volume rendering crash on certain platforms --- modules/kameleonvolume/kameleonvolumemodule.h | 2 +- shaders/framebuffer/inside.glsl | 29 +++++++++++++ shaders/framebuffer/outside.glsl | 32 ++++++++++++++ shaders/framebuffer/raycastframebuffer.frag | 19 +-------- src/rendering/framebufferrenderer.cpp | 42 +++++++++++-------- 5 files changed, 89 insertions(+), 35 deletions(-) create mode 100644 shaders/framebuffer/inside.glsl create mode 100644 shaders/framebuffer/outside.glsl diff --git a/modules/kameleonvolume/kameleonvolumemodule.h b/modules/kameleonvolume/kameleonvolumemodule.h index 46f8404eea..fd83620e7d 100644 --- a/modules/kameleonvolume/kameleonvolumemodule.h +++ b/modules/kameleonvolume/kameleonvolumemodule.h @@ -33,7 +33,7 @@ class KameleonVolumeModule : public OpenSpaceModule { public: KameleonVolumeModule(); void internalInitialize() override; - std::vector KameleonVolumeModule::documentations() const override; + std::vector documentations() const override; }; } // namespace openspace diff --git a/shaders/framebuffer/inside.glsl b/shaders/framebuffer/inside.glsl new file mode 100644 index 0000000000..7e052e6185 --- /dev/null +++ b/shaders/framebuffer/inside.glsl @@ -0,0 +1,29 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 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. * + ****************************************************************************************/ + + +void getEntry(inout vec3 entryPos, inout float entryDepth) { + entryPos = cameraPosInRaycaster; + entryDepth = 0; +} \ No newline at end of file diff --git a/shaders/framebuffer/outside.glsl b/shaders/framebuffer/outside.glsl new file mode 100644 index 0000000000..d1ebf5d7e9 --- /dev/null +++ b/shaders/framebuffer/outside.glsl @@ -0,0 +1,32 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 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. * + ****************************************************************************************/ + +#include <#{fragmentPath}> + +void getEntry(inout vec3 entryPos, inout float entryDepth) { + // fetch entry point from rendered fragment + Fragment f = getFragment(); + entryPos = f.color.xyz; + entryDepth = f.depth; +} diff --git a/shaders/framebuffer/raycastframebuffer.frag b/shaders/framebuffer/raycastframebuffer.frag index 915a080d8e..eecd97baa0 100644 --- a/shaders/framebuffer/raycastframebuffer.frag +++ b/shaders/framebuffer/raycastframebuffer.frag @@ -35,8 +35,6 @@ uniform vec2 windowSize; #include "blending.glsl" #include "rand.glsl" #include "floatoperations.glsl" -#include <#{fragmentPath}> - #for id, helperPath in helperPaths #include <#{helperPath}> @@ -46,19 +44,17 @@ uniform vec2 windowSize; out vec4 finalColor; - #define ALPHA_LIMIT 0.99 #define RAYCAST_MAX_STEPS 1000 #define MAX_AA_SAMPLES 8 uniform int nAaSamples; +#include <#{getEntryPath}> void main() { - vec2 texCoord = vec2(gl_FragCoord.xy / windowSize); - vec4 exitColorTexture = texture(exitColorTexture, texCoord); if (exitColorTexture.a < 1.0) { discard; @@ -68,22 +64,11 @@ void main() { vec3 exitPos = exitColorTexture.rgb; float exitDepth = denormalizeFloat(texture(exitDepthTexture, texCoord).x); - - float jitterFactor = 0.5 + 0.5 * rand(gl_FragCoord.xy); // should be between 0.5 and 1.0 vec3 entryPos; float entryDepth; - - if (insideRaycaster) { - entryPos = cameraPosInRaycaster; - entryDepth = 0; - } else { - // fetch entry point from rendered fragment - Fragment f = getFragment(); - entryPos = f.color.xyz; - entryDepth = f.depth; - } + getEntry(entryPos, entryDepth); vec3 position = entryPos; vec3 diff = exitPos - entryPos; diff --git a/src/rendering/framebufferrenderer.cpp b/src/rendering/framebufferrenderer.cpp index c6b283556b..7496d4b750 100644 --- a/src/rendering/framebufferrenderer.cpp +++ b/src/rendering/framebufferrenderer.cpp @@ -46,6 +46,8 @@ namespace { const std::string _loggerCat = "FramebufferRenderer"; const std::string ExitFragmentShaderPath = "${SHADERS}/framebuffer/exitframebuffer.frag"; const std::string RaycastFragmentShaderPath = "${SHADERS}/framebuffer/raycastframebuffer.frag"; + const std::string GetEntryInsidePath = "${SHADERS}/framebuffer/inside.glsl"; + const std::string GetEntryOutsidePath = "${SHADERS}/framebuffer/outside.glsl"; const std::string RenderFragmentShaderPath = "${SHADERS}/framebuffer/renderframebuffer.frag"; } @@ -286,20 +288,28 @@ void FramebufferRenderer::updateRaycastData() { try { _exitPrograms[raycaster] = ghoul::opengl::ProgramObject::Build("Volume " + std::to_string(data.id) + " exit", vsPath, ExitFragmentShaderPath, dict); - } - catch (ghoul::RuntimeError e) { - LERROR(e.message); - } - try { - _raycastPrograms[raycaster] = ghoul::opengl::ProgramObject::Build("Volume " + std::to_string(data.id) + " raycast", vsPath, RaycastFragmentShaderPath, dict); } catch (ghoul::RuntimeError e) { LERROR(e.message); } try { + ghoul::Dictionary outsideDict = dict; + outsideDict.setValue("getEntryPath", GetEntryOutsidePath); + _raycastPrograms[raycaster] = ghoul::opengl::ProgramObject::Build( + "Volume " + std::to_string(data.id) + " raycast", + vsPath, + RaycastFragmentShaderPath, + outsideDict); + } catch (ghoul::RuntimeError e) { + LERROR(e.message); + } + try { + ghoul::Dictionary insideDict = dict; + insideDict.setValue("getEntryPath", GetEntryInsidePath); _insideRaycastPrograms[raycaster] = ghoul::opengl::ProgramObject::Build( "Volume " + std::to_string(data.id) + " inside raycast", "${SHADERS}/framebuffer/resolveframebuffer.vert", - RaycastFragmentShaderPath, dict); + RaycastFragmentShaderPath, + insideDict); } catch (ghoul::RuntimeError e) { LERROR(e.message); @@ -359,26 +369,24 @@ void FramebufferRenderer::render(float blackoutFactor, bool doPerformanceMeasure } glBindFramebuffer(GL_FRAMEBUFFER, _mainFramebuffer); - - - ghoul::opengl::ProgramObject* insideRaycastProgram = _raycastPrograms[raycaster].get(); - glm::vec3 cameraPosition; bool cameraIsInside = raycaster->cameraIsInside(raycasterTask.renderData, cameraPosition); ghoul::opengl::ProgramObject* raycastProgram = nullptr; if (cameraIsInside) { - raycastProgram = _insideRaycastPrograms[raycaster].get(); + if (raycastProgram = _insideRaycastPrograms[raycaster].get()) { + raycastProgram->activate(); + raycastProgram->setUniform("cameraPosInRaycaster", cameraPosition); + } } else { - raycastProgram = _raycastPrograms[raycaster].get(); + if (raycastProgram = _raycastPrograms[raycaster].get()) { + raycastProgram->activate(); + } } if (raycastProgram) { - raycastProgram->activate(); - - raycastProgram->setUniform("insideRaycaster", cameraIsInside); - raycastProgram->setUniform("cameraPosInRaycaster", cameraPosition); + //raycastProgram->setUniform("insideRaycaster", cameraIsInside); raycaster->preRaycast(_raycastData[raycaster], *raycastProgram); ghoul::opengl::TextureUnit exitColorTextureUnit; From 6cd91ef44c5a4f128405e78ac414e55561cf5208 Mon Sep 17 00:00:00 2001 From: Emil Axelsson Date: Tue, 24 Jan 2017 16:25:19 +0100 Subject: [PATCH 71/96] Clean up volume rendering code --- modules/kameleonvolume/kameleonvolumereader.h | 2 - .../kameleonvolume/kameleonvolumereader.inl | 52 ------------------- .../rendering/kameleonvolumeraycaster.cpp | 2 +- .../rendering/kameleonvolumeraycaster.h | 4 +- .../rendering/renderablekameleonvolume.cpp | 8 --- .../rendering/renderablekameleonvolume.h | 6 +-- 6 files changed, 6 insertions(+), 68 deletions(-) delete mode 100644 modules/kameleonvolume/kameleonvolumereader.inl diff --git a/modules/kameleonvolume/kameleonvolumereader.h b/modules/kameleonvolume/kameleonvolumereader.h index 785d7b5dca..4a03ac223e 100644 --- a/modules/kameleonvolume/kameleonvolumereader.h +++ b/modules/kameleonvolume/kameleonvolumereader.h @@ -72,6 +72,4 @@ private: } -#include - #endif diff --git a/modules/kameleonvolume/kameleonvolumereader.inl b/modules/kameleonvolume/kameleonvolumereader.inl deleted file mode 100644 index 3e6e4b3d9d..0000000000 --- a/modules/kameleonvolume/kameleonvolumereader.inl +++ /dev/null @@ -1,52 +0,0 @@ -/***************************************************************************************** - * * - * 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. * - ****************************************************************************************/ - - - -namespace openspace { - - //KameleonMetaData KameleonVolumeReader::getMetaData() { - /* - using GridUnits = std::tuple; - GridUnits units = _kameleonWrapper.getGridUnits(); - std::string unit0 = std::get<0>(units); - std::string unit1 = std::get<1>(units); - std::string unit2 = std::get<2>(units); - - glm::vec3 scaling; - if (unit0 == 'R' && unit1 == 'R' && unit2 == 'R') { - scaling.x = scaling.y = scaling.z = openspace::distanceconstants::EarthRadius; - } - if (unit0 == '') - - VolumeMetaData metaData(VolumeMetaData::GridType::Cartesian, scaling ); - */ - - - //} - - - - -} \ No newline at end of file diff --git a/modules/kameleonvolume/rendering/kameleonvolumeraycaster.cpp b/modules/kameleonvolume/rendering/kameleonvolumeraycaster.cpp index 5667f73ac9..f221214ccb 100644 --- a/modules/kameleonvolume/rendering/kameleonvolumeraycaster.cpp +++ b/modules/kameleonvolume/rendering/kameleonvolumeraycaster.cpp @@ -161,7 +161,7 @@ std::string KameleonVolumeRaycaster::getRaycastPath() const { } std::string KameleonVolumeRaycaster::getHelperPath() const { - return GlslHelperPath; // no helper file + return GlslHelperPath; } void KameleonVolumeRaycaster::setStepSize(float stepSize) { diff --git a/modules/kameleonvolume/rendering/kameleonvolumeraycaster.h b/modules/kameleonvolume/rendering/kameleonvolumeraycaster.h index 1892736d01..7d1e9c8fa0 100644 --- a/modules/kameleonvolume/rendering/kameleonvolumeraycaster.h +++ b/modules/kameleonvolume/rendering/kameleonvolumeraycaster.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __KAMELEONVOLUMERAYCASTER_H__ -#define __KAMELEONVOLUMERAYCASTER_H__ +#ifndef __OPENSPACE_MODULE_KAMELEONVOLUME___KAMELEONVOLUMERAYCASTER_H__ +#define __OPENSPACE_MODULE_KAMELEONVOLUME___KAMELEONVOLUMERAYCASTER_H__ #include diff --git a/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp b/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp index 3ec80484d6..4f421f433f 100644 --- a/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp +++ b/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp @@ -158,8 +158,6 @@ RenderableKameleonVolume::RenderableKameleonVolume(const ghoul::Dictionary& dict _autoGridType = true; } } - - // TODO: read transformation: position/rotation/scale from dictionary. } RenderableKameleonVolume::~RenderableKameleonVolume() {} @@ -189,10 +187,8 @@ bool RenderableKameleonVolume::initialize() { updateRaycasterModelTransform(); }); - _raycaster->initialize(); - OsEng.renderEngine().raycasterManager().attachRaycaster(*_raycaster.get()); std::function onChange = [&](bool enabled) { @@ -221,9 +217,6 @@ bool RenderableKameleonVolume::initialize() { addProperty(_gridType); addProperty(_cache); addPropertySubOwner(_clipPlanes.get()); - - - return true; } @@ -369,7 +362,6 @@ bool RenderableKameleonVolume::isReady() const { } void RenderableKameleonVolume::update(const UpdateData& data) { - // forward this transformation! if (_raycaster) { _raycaster->setStepSize(_stepSize); } diff --git a/modules/kameleonvolume/rendering/renderablekameleonvolume.h b/modules/kameleonvolume/rendering/renderablekameleonvolume.h index cddb542942..95224fa2b5 100644 --- a/modules/kameleonvolume/rendering/renderablekameleonvolume.h +++ b/modules/kameleonvolume/rendering/renderablekameleonvolume.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __RENDERABLEKAMELEONVOLUME_H__ -#define __RENDERABLEKAMELEONVOLUME_H__ +#ifndef __OPENSPACE_MODULE_KAMELEONVOLUME___RENDERABLEKAMELEONVOLUME_H__ +#define __OPENSPACE_MODULE_KAMELEONVOLUME___RENDERABLEKAMELEONVOLUME_H__ #include #include @@ -99,4 +99,4 @@ private: }; } -#endif // __RENDERABLETOYVOLUME_H__ +#endif // __RENDERABLEKAMELEONVOLUME_H__ From 442969f2b1460d56d90f6d4e67811e764afdd529 Mon Sep 17 00:00:00 2001 From: Emil Axelsson Date: Tue, 24 Jan 2017 17:06:46 +0100 Subject: [PATCH 72/96] Jenkins compilation fix --- Jenkinsfile | 74 +++++++++++++++++++ include/openspace/util/task.h | 28 ++++++- modules/base/basemodule.h | 2 +- modules/galaxy/CMakeLists.txt | 5 +- modules/galaxy/galaxymodule.cpp | 2 +- .../galaxy/tasks/milkywayconversiontask.cpp | 27 +++++-- modules/galaxy/tasks/milkywayconversiontask.h | 25 +++---- .../tasks/milkywaypointsconversiontask.cpp | 34 +++++---- .../tasks/milkywaypointsconversiontask.h | 23 +++--- modules/kameleon/include/kameleonwrapper.h | 1 + modules/kameleon/src/kameleonwrapper.cpp | 38 +++++++--- modules/kameleonvolume/kameleonvolumemodule.h | 5 +- .../rendering/kameleonvolumeraycaster.h | 1 - .../rendering/multiresvolumeraycaster.cpp | 2 +- modules/space/spacemodule.h | 8 +- modules/volume/textureslicevolumereader.inl | 8 +- 16 files changed, 206 insertions(+), 77 deletions(-) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000000..0328f80400 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,74 @@ +def modules = [ + "base", + "debugging", + "fieldlines", + "galaxy", + "globebrowsing", + "iswa", + "kameleon", + "kameleonvolume", + "multiresvolume", + "newhorizons", + "onscreengui", + "space", + "toyvolume", + "volume" +]; + +def flags = "-DGHOUL_USE_DEVIL=OFF " + +for (module in modules) { + flags += "-DOPENSPACE_OPENSPACE_MODULE_" + module.toUpperCase() + "=ON " +} + +echo flags + +stage('Build') { + parallel linux: { + node('linux') { + checkout scm + sh 'git submodule update --init --recursive' + sh ''' + mkdir -p build + cd build + cmake ''' + + flags + ''' .. + make + ''' + } + }, + windows: { + node('windows') { + checkout scm + bat ''' + git submodule update --init --recursive + if not exist "build" mkdir "build" + cd build + cmake -G "Visual Studio 14 2015 Win64" ''' + + flags + ''' .. + msbuild.exe OpenSpace.sln /m:8 /p:Configuration=Debug + ''' + } + }, + osx: { + node('osx') { + checkout scm + sh 'git submodule update --init --recursive' + sh ''' + export PATH=${PATH}:/usr/local/bin:/Applications/CMake.app/Contents/bin + export CMAKE_BUILD_TOOL=/Applications/CMake.app/Contents/bin/CMake + srcDir=$PWD + if [ ! -d ${srcDir} ]; then + mkdir ${srcDir} + fi + if [ ! -d ${srcDir}/build ]; then + mkdir ${srcDir}/build + fi + cd ${srcDir}/build + /Applications/CMake.app/Contents/bin/cmake -G Xcode -D NASM=/usr/local/Cellar/nasm/2.11.08/bin/nasm ${srcDir} ''' + + flags + ''' + xcodebuild + ''' + } + } +} \ No newline at end of file diff --git a/include/openspace/util/task.h b/include/openspace/util/task.h index 20fd7e51be..c218ceff54 100644 --- a/include/openspace/util/task.h +++ b/include/openspace/util/task.h @@ -1,5 +1,29 @@ -#ifndef __CONVERSIONTASK_H__ -#define __CONVERSIONTASK_H__ +/***************************************************************************************** +* * +* 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. * +****************************************************************************************/ + +#ifndef __OPENSPACE_CORE___TASK___H__ +#define __OPENSPACE_CORE___TASK___H__ #include #include diff --git a/modules/base/basemodule.h b/modules/base/basemodule.h index 28bc2c3355..257cdec7ce 100644 --- a/modules/base/basemodule.h +++ b/modules/base/basemodule.h @@ -32,7 +32,7 @@ namespace openspace { class BaseModule : public OpenSpaceModule { public: BaseModule(); - + virtual ~BaseModule() = default; std::vector documentations() const override; protected: diff --git a/modules/galaxy/CMakeLists.txt b/modules/galaxy/CMakeLists.txt index e77c3e699f..a70b4b03d6 100644 --- a/modules/galaxy/CMakeLists.txt +++ b/modules/galaxy/CMakeLists.txt @@ -27,7 +27,7 @@ include(${OPENSPACE_CMAKE_EXT_DIR}/module_definition.cmake) set(HEADER_FILES ${CMAKE_CURRENT_SOURCE_DIR}/galaxymodule.h ${CMAKE_CURRENT_SOURCE_DIR}/rendering/galaxyraycaster.h - ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablegalaxy.h + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablegalaxy.h ${CMAKE_CURRENT_SOURCE_DIR}/tasks/milkywayconversiontask.h ${CMAKE_CURRENT_SOURCE_DIR}/tasks/milkywaypointsconversiontask.h ) @@ -36,7 +36,8 @@ source_group("Header Files" FILES ${HEADER_FILES}) set(SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/galaxymodule.cpp ${CMAKE_CURRENT_SOURCE_DIR}/rendering/galaxyraycaster.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablegalaxy.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablegalaxy.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/tasks/milkywayconversiontask.cpp ${CMAKE_CURRENT_SOURCE_DIR}/tasks/milkywaypointsconversiontask.cpp ) source_group("Source Files" FILES ${SOURCE_FILES}) diff --git a/modules/galaxy/galaxymodule.cpp b/modules/galaxy/galaxymodule.cpp index 1a20cbce44..636055634c 100644 --- a/modules/galaxy/galaxymodule.cpp +++ b/modules/galaxy/galaxymodule.cpp @@ -41,7 +41,7 @@ void GalaxyModule::internalInitialize() { auto fTask = FactoryManager::ref().factory(); ghoul_assert(fRenderable, "No task factory existed"); - fTask->registerClass("MilkywayPointsConversionTask"); + fTask->registerClass("MilkywayConversionTask"); fTask->registerClass("MilkywayPointsConversionTask"); } diff --git a/modules/galaxy/tasks/milkywayconversiontask.cpp b/modules/galaxy/tasks/milkywayconversiontask.cpp index 907684bbcc..dca36ca0de 100644 --- a/modules/galaxy/tasks/milkywayconversiontask.cpp +++ b/modules/galaxy/tasks/milkywayconversiontask.cpp @@ -22,15 +22,14 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#include +#include #include #include #include namespace openspace { -namespace dataconverter { -MilkyWayConversionTask::MilkyWayConversionTask( +/*MilkywayConversionTask::MilkywayConversionTask( const std::string& inFilenamePrefix, const std::string& inFilenameSuffix, size_t inFirstIndex, @@ -42,10 +41,20 @@ MilkyWayConversionTask::MilkyWayConversionTask( , _inFirstIndex(inFirstIndex) , _inNSlices(inNSlices) , _outFilename(outFilename) - , _outDimensions(outDimensions) {} + , _outDimensions(outDimensions) {}*/ -void MilkyWayConversionTask::perform(const std::function& onProgress) { +MilkywayConversionTask::MilkywayConversionTask(const ghoul::Dictionary& dictionary) { +} + +MilkywayConversionTask::~MilkywayConversionTask() {} + +std::string MilkywayConversionTask::description() +{ + return std::string(); +} + +void MilkywayConversionTask::perform(const Task::ProgressCallback& progressCallback) { std::vector filenames; for (int i = 0; i < _inNSlices; i++) { filenames.push_back(_inFilenamePrefix + std::to_string(i + _inFirstIndex) + _inFilenameSuffix); @@ -67,8 +76,12 @@ void MilkyWayConversionTask::perform(const std::function& onProgres return value; }; - rawWriter.write(sampleFunction, onProgress); + rawWriter.write(sampleFunction, progressCallback); +} + +Documentation MilkywayConversionTask::documentation() +{ + return Documentation(); } } -} diff --git a/modules/galaxy/tasks/milkywayconversiontask.h b/modules/galaxy/tasks/milkywayconversiontask.h index d9a32e5cb1..1a37fb5950 100644 --- a/modules/galaxy/tasks/milkywayconversiontask.h +++ b/modules/galaxy/tasks/milkywayconversiontask.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_APP_DATACONVERTER___MILKYWAYCONVERSIONTASK___H__ -#define __OPENSPACE_APP_DATACONVERTER___MILKYWAYCONVERSIONTASK___H__ +#ifndef __OPENSPACE_MODULE_GALAXY___MILKYWAYCONVERSIONTASK___H__ +#define __OPENSPACE_MODULE_GALAXY___MILKYWAYCONVERSIONTASK___H__ #include #include @@ -34,22 +34,18 @@ namespace openspace { -namespace dataconverter { /** * Converts a set of exr image slices to a raw volume * with floating point RGBA data (32 bit per channel). */ -class MilkyWayConversionTask : public Task { +class MilkywayConversionTask : public Task { public: - MilkyWayConversionTask(const std::string& inFilenamePrefix, - const std::string& inFilenameSuffix, - size_t inFirstIndex, - size_t inNSlices, - const std::string& outFilename, - const glm::ivec3& outDimensions); - - void perform(const std::function& onProgress) override; + MilkywayConversionTask(const ghoul::Dictionary& dictionary); + virtual ~MilkywayConversionTask(); + std::string description() override; + void perform(const Task::ProgressCallback& onProgress) override; + static Documentation documentation(); private: std::string _inFilenamePrefix; std::string _inFilenameSuffix; @@ -59,7 +55,6 @@ private: glm::ivec3 _outDimensions; }; -} // namespace dataconverter -} // namespace openspace +} -#endif // __OPENSPACE_APP_DATACONVERTER___MILKYWAYCONVERSIONTASK___H__ +#endif // __OPENSPACE_MODULE_GALAXY___MILKYWAYCONVERSIONTASK___H__ diff --git a/modules/galaxy/tasks/milkywaypointsconversiontask.cpp b/modules/galaxy/tasks/milkywaypointsconversiontask.cpp index 1a25b36c14..d06c8a0f56 100644 --- a/modules/galaxy/tasks/milkywaypointsconversiontask.cpp +++ b/modules/galaxy/tasks/milkywaypointsconversiontask.cpp @@ -22,7 +22,7 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#include +#include #include #include #include @@ -30,27 +30,30 @@ #include namespace openspace { -namespace dataconverter { - - -MilkyWayPointsConversionTask::MilkyWayPointsConversionTask( +/*MilkywayPointsConversionTask::MilkywayPointsConversionTask( const std::string& inFilename, const std::string& outFilename) : _inFilename(inFilename) - , _outFilename(outFilename) {} + , _outFilename(outFilename) {}*/ +MilkywayPointsConversionTask::MilkywayPointsConversionTask(const ghoul::Dictionary & dictionary) {} -void MilkyWayPointsConversionTask::perform(const std::function& onProgress) { +MilkywayPointsConversionTask::~MilkywayPointsConversionTask() {} + +std::string MilkywayPointsConversionTask::description() +{ + return std::string(); +} + +void MilkywayPointsConversionTask::perform(const Task::ProgressCallback & progressCallback) { std::ifstream in(_inFilename, std::ios::in); std::ofstream out(_outFilename, std::ios::out | std::ios::binary); - + std::string format; int64_t nPoints; in >> format >> nPoints; - - size_t nFloats = nPoints * 7; float* pointData = new float[nFloats]; @@ -66,8 +69,9 @@ void MilkyWayPointsConversionTask::perform(const std::function& onP pointData[i * 7 + 4] = g; pointData[i * 7 + 5] = b; pointData[i * 7 + 6] = a; - onProgress(static_cast(i + 1) / nPoints); - } else { + progressCallback(static_cast(i + 1) / nPoints); + } + else { std::cout << "Failed to convert point data."; return; } @@ -80,7 +84,9 @@ void MilkyWayPointsConversionTask::perform(const std::function& onP out.close(); } - +Documentation MilkywayPointsConversionTask::documentation() +{ + return Documentation(); +} -} } diff --git a/modules/galaxy/tasks/milkywaypointsconversiontask.h b/modules/galaxy/tasks/milkywaypointsconversiontask.h index 6da5a42cd4..ffc1582957 100644 --- a/modules/galaxy/tasks/milkywaypointsconversiontask.h +++ b/modules/galaxy/tasks/milkywaypointsconversiontask.h @@ -22,10 +22,10 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_APP_DATACONVERTER___MILKYWAYPOINTSCONVERSIONTASK___H__ -#define __OPENSPACE_APP_DATACONVERTER___MILKYWAYPOINTSCONVERSIONTASK___H__ +#ifndef __OPENSPACE_MODULE_GALAXY___MILKYWAYPOINTSCONVERSIONTASK_H__ +#define __OPENSPACE_MODULE_GALAXY___MILKYWAYPOINTSCONVERSIONTASK_H__ -#include +#include #include #include #include @@ -34,7 +34,6 @@ namespace openspace { -namespace dataconverter { /** * Converts ascii based point data @@ -42,18 +41,18 @@ namespace dataconverter { * (float x, float y, float z, float r, float g, float b) * n * to a binary (floating point) representation with the same layout. */ -class MilkyWayPointsConversionTask : public Task { +class MilkywayPointsConversionTask : public Task { public: - MilkyWayPointsConversionTask(const std::string& inFilename, - const std::string& outFilename); - - void perform(const std::function& onProgress) override; + MilkywayPointsConversionTask(const ghoul::Dictionary& dictionary); + virtual ~MilkywayPointsConversionTask(); + std::string description() override; + void perform(const Task::ProgressCallback& progressCallback) override; + static Documentation documentation(); private: std::string _inFilename; std::string _outFilename; }; -} // namespace dataconverter -} // namespace openspace +} -#endif // __OPENSPACE_APP_DATACONVERTER___MILKYWAYPOINTSCONVERSIONTASK___H__ +#endif // __OPENSPACE_MODULE_GALAXY___MILKYWAYPOINTSCONVERSIONTASK_H__ diff --git a/modules/kameleon/include/kameleonwrapper.h b/modules/kameleon/include/kameleonwrapper.h index 76f6e0c5a3..1b4149e95f 100644 --- a/modules/kameleon/include/kameleonwrapper.h +++ b/modules/kameleon/include/kameleonwrapper.h @@ -136,6 +136,7 @@ public: Model model(); GridType gridType(); + std::string getParent(); std::string getFrame(); std::vector getVariables(); std::vector getLoadedVariables(); diff --git a/modules/kameleon/src/kameleonwrapper.cpp b/modules/kameleon/src/kameleonwrapper.cpp index 7da9e23cc6..e835c8b758 100644 --- a/modules/kameleon/src/kameleonwrapper.cpp +++ b/modules/kameleon/src/kameleonwrapper.cpp @@ -1008,20 +1008,34 @@ glm::vec4 KameleonWrapper::classifyFieldline(FieldlineEnd fEnd, FieldlineEnd bEn return color; } -std::string KameleonWrapper::getFrame(){ - if( _type == KameleonWrapper::Model::BATSRUS || - _type == KameleonWrapper::Model::OpenGGCM || - _type == KameleonWrapper::Model::LFM) - { +std::string KameleonWrapper::getParent() { + switch (_type) { + case KameleonWrapper::Model::BATSRUS: + case KameleonWrapper::Model::OpenGGCM: + case KameleonWrapper::Model::LFM: + return "Earth"; + case KameleonWrapper::Model::ENLIL: + case KameleonWrapper::Model::MAS: + case KameleonWrapper::Model::Adapt3D: + case KameleonWrapper::Model::SWMF: + return "Sun"; + default: + return ""; + } +} + +std::string KameleonWrapper::getFrame() { + switch (_type) { + case KameleonWrapper::Model::BATSRUS: + case KameleonWrapper::Model::OpenGGCM: + case KameleonWrapper::Model::LFM: return "GSM"; - }else if( - _type == KameleonWrapper::Model::ENLIL || - _type == KameleonWrapper::Model::MAS || - _type == KameleonWrapper::Model::Adapt3D || - _type == KameleonWrapper::Model::SWMF) - { + case KameleonWrapper::Model::ENLIL: + case KameleonWrapper::Model::MAS: + case KameleonWrapper::Model::Adapt3D: + case KameleonWrapper::Model::SWMF: return "HEEQ"; - }else{ + default: return ""; } } diff --git a/modules/kameleonvolume/kameleonvolumemodule.h b/modules/kameleonvolume/kameleonvolumemodule.h index fd83620e7d..ceccb8de98 100644 --- a/modules/kameleonvolume/kameleonvolumemodule.h +++ b/modules/kameleonvolume/kameleonvolumemodule.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __KAMELEONVOLUMEMODULE_H__ -#define __KAMELEONVOLUMEMODULE_H__ +#ifndef __OPENSPACE_MODULE_KAMELEONVOLUME___BASEMODULE___H__ +#define __OPENSPACE_MODULE_KAMELEONVOLUME___BASEMODULE___H__ #include @@ -32,6 +32,7 @@ namespace openspace { class KameleonVolumeModule : public OpenSpaceModule { public: KameleonVolumeModule(); + virtual ~KameleonVolumeModule() = default; void internalInitialize() override; std::vector documentations() const override; }; diff --git a/modules/kameleonvolume/rendering/kameleonvolumeraycaster.h b/modules/kameleonvolume/rendering/kameleonvolumeraycaster.h index 7d1e9c8fa0..10c1df2084 100644 --- a/modules/kameleonvolume/rendering/kameleonvolumeraycaster.h +++ b/modules/kameleonvolume/rendering/kameleonvolumeraycaster.h @@ -25,7 +25,6 @@ #ifndef __OPENSPACE_MODULE_KAMELEONVOLUME___KAMELEONVOLUMERAYCASTER_H__ #define __OPENSPACE_MODULE_KAMELEONVOLUME___KAMELEONVOLUMERAYCASTER_H__ - #include #include #include diff --git a/modules/multiresvolume/rendering/multiresvolumeraycaster.cpp b/modules/multiresvolume/rendering/multiresvolumeraycaster.cpp index 5406ce7b85..73b694918d 100644 --- a/modules/multiresvolume/rendering/multiresvolumeraycaster.cpp +++ b/modules/multiresvolume/rendering/multiresvolumeraycaster.cpp @@ -154,7 +154,7 @@ bool MultiresVolumeRaycaster::cameraIsInside(const RenderData& data, glm::vec3& } void MultiresVolumeRaycaster::postRaycast(const RaycastData& data, ghoul::opengl::ProgramObject& program) { - _textureUnit = nullptr; + _atlasUnit = nullptr; _tfUnit = nullptr; } diff --git a/modules/space/spacemodule.h b/modules/space/spacemodule.h index f1f90d513b..3d954c30a9 100644 --- a/modules/space/spacemodule.h +++ b/modules/space/spacemodule.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_SPACE___BASEMODULE___H__ -#define __OPENSPACE_MODULE_SPACE___BASEMODULE___H__ +#ifndef __OPENSPACE_MODULE_SPACE___SPACEMODULE___H__ +#define __OPENSPACE_MODULE_SPACE___SPACEMODULE___H__ #include @@ -32,7 +32,7 @@ namespace openspace { class SpaceModule : public OpenSpaceModule { public: SpaceModule(); - + virtual ~SpaceModule() = default; std::vector documentations() const override; protected: @@ -41,4 +41,4 @@ protected: } // namespace openspace -#endif // __OPENSPACE_MODULE_SPACE___BASEMODULE___H__ +#endif // __OPENSPACE_MODULE_SPACE___SPACEMODULE___H__ diff --git a/modules/volume/textureslicevolumereader.inl b/modules/volume/textureslicevolumereader.inl index 6a3513383e..0366096d1e 100644 --- a/modules/volume/textureslicevolumereader.inl +++ b/modules/volume/textureslicevolumereader.inl @@ -29,7 +29,7 @@ namespace openspace { template VoxelType TextureSliceVolumeReader::get(const glm::ivec3& coordinates) const { ghoul::opengl::Texture& slice = getSlice(coordinates.z); - return slice.texel(glm::ivec2(coordinates)); + return slice.texel(glm::uvec2(coordinates.x, coordinates.y)); } template @@ -52,7 +52,8 @@ void TextureSliceVolumeReader::initialize() { std::shared_ptr firstSlice = ghoul::io::TextureReader::ref().loadTexture(_paths[0]); - _sliceDimensions = firstSlice->dimensions(); + glm::uvec3 dimensions = firstSlice->dimensions(); + _sliceDimensions = glm::uvec2(dimensions.x, dimensions.y); _initialized = true; _cache.set(0, firstSlice); } @@ -72,7 +73,8 @@ ghoul::opengl::Texture& TextureSliceVolumeReader::getSlice(int sliceI std::shared_ptr texture = ghoul::io::TextureReader::ref().loadTexture(_paths[sliceIndex]); - glm::ivec2 dims = texture->dimensions(); + glm::uvec3 dimensions = texture->dimensions(); + glm::ivec2 dims = glm::uvec2(dimensions.x, dimensions.y); ghoul_assert(dims == _sliceDimensions, "Slice dimensions do not agree."); _cache.set(sliceIndex, std::move(texture)); } From dd0d5d86afd26e988ff8546710a3ba422c787792 Mon Sep 17 00:00:00 2001 From: Emil Axelsson Date: Tue, 28 Feb 2017 11:50:38 +0100 Subject: [PATCH 73/96] Update branch to work with changes in develop --- apps/TaskRunner/main.cpp | 12 +++++ .../galaxy/tasks/milkywayconversiontask.cpp | 44 ++++++++++++------- 2 files changed, 41 insertions(+), 15 deletions(-) diff --git a/apps/TaskRunner/main.cpp b/apps/TaskRunner/main.cpp index de8315bd31..5edbd82b41 100644 --- a/apps/TaskRunner/main.cpp +++ b/apps/TaskRunner/main.cpp @@ -44,6 +44,8 @@ #include #include #include +#include +#include #include namespace { @@ -80,6 +82,16 @@ int main(int argc, char** argv) { "Translation" ); + FactoryManager::ref().addFactory( + std::make_unique>(), + "Rotation" + ); + + FactoryManager::ref().addFactory( + std::make_unique>(), + "Scale" + ); + openspace::ConfigurationManager configuration; std::string configurationFile = configuration.findConfiguration(ConfigurationFile); configuration.loadFromFile(configurationFile); diff --git a/modules/galaxy/tasks/milkywayconversiontask.cpp b/modules/galaxy/tasks/milkywayconversiontask.cpp index dca36ca0de..3224a25a27 100644 --- a/modules/galaxy/tasks/milkywayconversiontask.cpp +++ b/modules/galaxy/tasks/milkywayconversiontask.cpp @@ -29,22 +29,36 @@ namespace openspace { -/*MilkywayConversionTask::MilkywayConversionTask( - const std::string& inFilenamePrefix, - const std::string& inFilenameSuffix, - size_t inFirstIndex, - size_t inNSlices, - const std::string& outFilename, - const glm::ivec3& outDimensions) - : _inFilenamePrefix(inFilenamePrefix) - , _inFilenameSuffix(inFilenameSuffix) - , _inFirstIndex(inFirstIndex) - , _inNSlices(inNSlices) - , _outFilename(outFilename) - , _outDimensions(outDimensions) {}*/ - - MilkywayConversionTask::MilkywayConversionTask(const ghoul::Dictionary& dictionary) { + std::string inFilenamePrefix; + if (dictionary.getValue("InFilenamePrefix", inFilenamePrefix)) { + _inFilenamePrefix = inFilenamePrefix; + } + + std::string inFilenamePrefix; + if (dictionary.getValue("InFilenameSuffix", inFilenameSuffix)) { + _inFilenameSuffix = inFilenameSuffix; + } + + size_t inFirstIndex; + if (dictionary.getValue("InFirstIndex", inFirstIndex)) { + _inFirstIndex = inFirstIndex; + } + + size_t inNSlices; + if (dictionary.getValue("InNSlices", inNSlices)) { + _inNSlices = inNSlices; + } + + std::string outFilename; + if (dictionary.getValue("OutFilename", outFilename)) { + _outFilename = outFilename; + } + + glm::ivec3 outDimensions; + if (dictionary.getValue("OutDimensions", outDimensions)) { + _outDimensions = outDimensions; + } } MilkywayConversionTask::~MilkywayConversionTask() {} From a61209f945a1d8bf826492705d34809c0e4b818b Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Wed, 1 Mar 2017 11:30:54 -0500 Subject: [PATCH 74/96] Some cleanup of ConfigurationManager --- src/engine/configurationmanager.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/engine/configurationmanager.cpp b/src/engine/configurationmanager.cpp index 54a1c0c73d..d182437275 100644 --- a/src/engine/configurationmanager.cpp +++ b/src/engine/configurationmanager.cpp @@ -24,6 +24,7 @@ #include +#include #include #include #include From a9cc253a93e48cbb4fb17baac122942f7e3aa35f Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Wed, 1 Mar 2017 18:13:15 -0500 Subject: [PATCH 75/96] - Remove documentation.h include and replace with forward declaration - Move Documentation struct into documentation namespace --- src/engine/configurationmanager.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/engine/configurationmanager.cpp b/src/engine/configurationmanager.cpp index d182437275..dc532650d7 100644 --- a/src/engine/configurationmanager.cpp +++ b/src/engine/configurationmanager.cpp @@ -25,6 +25,7 @@ #include #include + #include #include #include From c2fa08716b0bac6aca613d047791444ce6fd0b85 Mon Sep 17 00:00:00 2001 From: Emil Axelsson Date: Thu, 2 Mar 2017 17:13:35 +0100 Subject: [PATCH 76/96] Cleanup --- modules/volume/rendering/volumeclipplanes.h | 1 - src/rendering/framebufferrenderer.cpp | 2 -- 2 files changed, 3 deletions(-) diff --git a/modules/volume/rendering/volumeclipplanes.h b/modules/volume/rendering/volumeclipplanes.h index ea888a6751..5f1c280311 100644 --- a/modules/volume/rendering/volumeclipplanes.h +++ b/modules/volume/rendering/volumeclipplanes.h @@ -33,7 +33,6 @@ #include #include -// Forward declare to minimize dependencies namespace ghoul { class Dictionary; } diff --git a/src/rendering/framebufferrenderer.cpp b/src/rendering/framebufferrenderer.cpp index 7496d4b750..d5769de82f 100644 --- a/src/rendering/framebufferrenderer.cpp +++ b/src/rendering/framebufferrenderer.cpp @@ -385,8 +385,6 @@ void FramebufferRenderer::render(float blackoutFactor, bool doPerformanceMeasure } if (raycastProgram) { - - //raycastProgram->setUniform("insideRaycaster", cameraIsInside); raycaster->preRaycast(_raycastData[raycaster], *raycastProgram); ghoul::opengl::TextureUnit exitColorTextureUnit; From 03777378431bc35d972161b6b193c6e071d9a137 Mon Sep 17 00:00:00 2001 From: Emil Axelsson Date: Thu, 2 Mar 2017 17:31:04 +0100 Subject: [PATCH 77/96] Adapt to new interfaces --- include/openspace/util/task.h | 2 +- modules/kameleonvolume/kameleonvolumemodule.cpp | 4 ++-- modules/kameleonvolume/kameleonvolumemodule.h | 3 ++- .../kameleonvolume/tasks/kameleondocumentationtask.cpp | 3 +-- modules/kameleonvolume/tasks/kameleondocumentationtask.h | 2 +- .../kameleonvolume/tasks/kameleonmetadatatojsontask.cpp | 2 +- modules/kameleonvolume/tasks/kameleonmetadatatojsontask.h | 2 +- src/util/task.cpp | 8 ++++---- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/include/openspace/util/task.h b/include/openspace/util/task.h index c218ceff54..50c36df171 100644 --- a/include/openspace/util/task.h +++ b/include/openspace/util/task.h @@ -39,7 +39,7 @@ public: virtual void perform(const ProgressCallback& onProgress) = 0; virtual std::string description() = 0; static std::unique_ptr createFromDictionary(const ghoul::Dictionary& dictionary); - static openspace::Documentation documentation(); + static documentation::Documentation documentation(); }; } diff --git a/modules/kameleonvolume/kameleonvolumemodule.cpp b/modules/kameleonvolume/kameleonvolumemodule.cpp index 15a0508b6d..e1cb163aad 100644 --- a/modules/kameleonvolume/kameleonvolumemodule.cpp +++ b/modules/kameleonvolume/kameleonvolumemodule.cpp @@ -50,9 +50,9 @@ void KameleonVolumeModule::internalInitialize() { } -std::vector KameleonVolumeModule::documentations() const +std::vector KameleonVolumeModule::documentations() const { - return std::vector{KameleonMetadataToJsonTask::documentation()}; + return std::vector{KameleonMetadataToJsonTask::documentation()}; } } // namespace openspace diff --git a/modules/kameleonvolume/kameleonvolumemodule.h b/modules/kameleonvolume/kameleonvolumemodule.h index ceccb8de98..dfed7b9138 100644 --- a/modules/kameleonvolume/kameleonvolumemodule.h +++ b/modules/kameleonvolume/kameleonvolumemodule.h @@ -26,6 +26,7 @@ #define __OPENSPACE_MODULE_KAMELEONVOLUME___BASEMODULE___H__ #include +#include namespace openspace { @@ -34,7 +35,7 @@ public: KameleonVolumeModule(); virtual ~KameleonVolumeModule() = default; void internalInitialize() override; - std::vector documentations() const override; + std::vector documentations() const override; }; } // namespace openspace diff --git a/modules/kameleonvolume/tasks/kameleondocumentationtask.cpp b/modules/kameleonvolume/tasks/kameleondocumentationtask.cpp index 3ce8d2c249..0ce9320386 100644 --- a/modules/kameleonvolume/tasks/kameleondocumentationtask.cpp +++ b/modules/kameleonvolume/tasks/kameleondocumentationtask.cpp @@ -131,8 +131,7 @@ void KameleonDocumentationTask::perform(const Task::ProgressCallback & progressC progressCallback(1.0f); } -Documentation KameleonDocumentationTask::documentation() -{ +documentation::Documentation KameleonDocumentationTask::documentation() { using namespace documentation; return { "KameleonDocumentationTask", diff --git a/modules/kameleonvolume/tasks/kameleondocumentationtask.h b/modules/kameleonvolume/tasks/kameleondocumentationtask.h index d86e7ed5d5..a5f07cadf9 100644 --- a/modules/kameleonvolume/tasks/kameleondocumentationtask.h +++ b/modules/kameleonvolume/tasks/kameleondocumentationtask.h @@ -34,7 +34,7 @@ public: KameleonDocumentationTask(const ghoul::Dictionary& dictionary); std::string description() override; void perform(const Task::ProgressCallback& progressCallback) override; - static Documentation documentation(); + static documentation::Documentation documentation(); private: std::string _inputPath; std::string _outputPath; diff --git a/modules/kameleonvolume/tasks/kameleonmetadatatojsontask.cpp b/modules/kameleonvolume/tasks/kameleonmetadatatojsontask.cpp index df1e748c2a..4b3231aad8 100644 --- a/modules/kameleonvolume/tasks/kameleonmetadatatojsontask.cpp +++ b/modules/kameleonvolume/tasks/kameleonmetadatatojsontask.cpp @@ -63,7 +63,7 @@ void KameleonMetadataToJsonTask::perform(const Task::ProgressCallback & progress progressCallback(1.0f); } -Documentation KameleonMetadataToJsonTask::documentation() +documentation::Documentation KameleonMetadataToJsonTask::documentation() { using namespace documentation; return { diff --git a/modules/kameleonvolume/tasks/kameleonmetadatatojsontask.h b/modules/kameleonvolume/tasks/kameleonmetadatatojsontask.h index 3a1a732034..f6c82d6462 100644 --- a/modules/kameleonvolume/tasks/kameleonmetadatatojsontask.h +++ b/modules/kameleonvolume/tasks/kameleonmetadatatojsontask.h @@ -34,7 +34,7 @@ public: KameleonMetadataToJsonTask(const ghoul::Dictionary& dictionary); std::string description() override; void perform(const Task::ProgressCallback& progressCallback) override; - static Documentation documentation(); + static documentation::Documentation documentation(); private: std::string _inputPath; std::string _outputPath; diff --git a/src/util/task.cpp b/src/util/task.cpp index 40eaf06866..f7f9c4a8b9 100644 --- a/src/util/task.cpp +++ b/src/util/task.cpp @@ -34,7 +34,7 @@ namespace { namespace openspace { -Documentation Task::documentation() { +documentation::Documentation Task::documentation() { using namespace openspace::documentation; return{ "Renderable", @@ -54,17 +54,17 @@ Documentation Task::documentation() { } std::unique_ptr Task::createFromDictionary(const ghoul::Dictionary& dictionary) { - openspace::documentation::testSpecificationAndThrow(Documentation(), dictionary, "Task"); + openspace::documentation::testSpecificationAndThrow(documentation::Documentation(), dictionary, "Task"); std::string taskType = dictionary.value("Type"); auto factory = FactoryManager::ref().factory(); - Task *task = factory->create(taskType, dictionary); + std::unique_ptr task = factory->create(taskType, dictionary); if (task == nullptr) { LERROR("Failed to create a Task object of type '" << taskType << "'"); return nullptr; } - return std::unique_ptr(task); + return std::move(task); } } \ No newline at end of file From 5faff1d3bfdd572ece74b8d64ac5363085c5ba53 Mon Sep 17 00:00:00 2001 From: Emil Axelsson Date: Thu, 2 Mar 2017 18:19:17 +0100 Subject: [PATCH 78/96] Change to correct include guard name --- modules/volume/rendering/volumeclipplane.h | 6 +++--- modules/volume/rendering/volumeclipplanes.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/volume/rendering/volumeclipplane.h b/modules/volume/rendering/volumeclipplane.h index 7cec5978dc..1c8721a099 100644 --- a/modules/volume/rendering/volumeclipplane.h +++ b/modules/volume/rendering/volumeclipplane.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_VOLUME___RENDERABLEVOLUMEGL___H__ -#define __OPENSPACE_MODULE_VOLUME___RENDERABLEVOLUMEGL___H__ +#ifndef __OPENSPACE_MODULE_VOLUME___VOLUMECLIPPLANE___H__ +#define __OPENSPACE_MODULE_VOLUME___VOLUMECLIPPLANE___H__ #include #include @@ -50,4 +50,4 @@ private: } // namespace openspace -#endif // __OPENSPACE_MODULE_VOLUME___RENDERABLEVOLUMEGL___H__ +#endif // __OPENSPACE_MODULE_VOLUME___VOLUMECLIPPLANE___H__ diff --git a/modules/volume/rendering/volumeclipplanes.h b/modules/volume/rendering/volumeclipplanes.h index 5f1c280311..e398cac429 100644 --- a/modules/volume/rendering/volumeclipplanes.h +++ b/modules/volume/rendering/volumeclipplanes.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_VOLUME___RENDERABLEVOLUME___H__ -#define __OPENSPACE_MODULE_VOLUME___RENDERABLEVOLUME___H__ +#ifndef __OPENSPACE_MODULE_VOLUME___VOLUMECLIPPLANES___H__ +#define __OPENSPACE_MODULE_VOLUME___VOLUMECLIPPLANES___H__ #include #include @@ -54,4 +54,4 @@ private: } // namespace openspace -#endif // __OPENSPACE_MODULE_VOLUME___RENDERABLEVOLUME___H__ +#endif // __OPENSPACE_MODULE_VOLUME___VOLUMECLIPPLANES___H__ From d6b5bb753b0b481d35899800ca448b8d9fcb68ce Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Thu, 2 Mar 2017 11:07:17 -0500 Subject: [PATCH 79/96] - Some cleanup of LuaConsole - Moved dedicated Lua commands into a visible property - Disallow non-ASCII characters - Remove unused KeyboardController - Remove unused DeviceIdentifier - Some cleanup of LogFactory - Move and use documentation into the class --- apps/OpenSpace/main.cpp | 44 +- include/openspace/engine/logfactory.h | 25 +- .../openspace/interaction/deviceidentifier.h | 79 --- .../interaction/interactionhandler.h | 1 - .../openspace/interaction/interactionmode.h | 1 - .../interaction/keyboardcontroller.h | 57 -- include/openspace/interaction/luaconsole.h | 30 +- include/openspace/util/keys.h | 1 - modules/onscreengui/onscreenguimodule.cpp | 2 + modules/space/rotation/spicerotation.cpp | 2 +- src/CMakeLists.txt | 5 - src/documentation/core_registration.cpp | 4 +- src/documentation/verifier.cpp | 32 +- src/engine/configurationmanager_doc.inl | 27 +- src/engine/logfactory.cpp | 123 +++- src/engine/openspaceengine.cpp | 36 +- src/interaction/deviceidentifier.cpp | 163 ----- src/interaction/interactionhandler.cpp | 23 +- src/interaction/interactionmode.cpp | 1 + src/interaction/keyboardcontroller.cpp | 329 --------- src/interaction/luaconsole.cpp | 638 +++++++++--------- src/interaction/luaconsole_lua.inl | 73 -- src/rendering/renderengine.cpp | 3 + src/scene/scenegraph.cpp | 1 + src/util/keys.cpp | 29 +- 25 files changed, 553 insertions(+), 1176 deletions(-) delete mode 100644 include/openspace/interaction/deviceidentifier.h delete mode 100644 include/openspace/interaction/keyboardcontroller.h delete mode 100644 src/interaction/deviceidentifier.cpp delete mode 100644 src/interaction/keyboardcontroller.cpp delete mode 100644 src/interaction/luaconsole_lua.inl diff --git a/apps/OpenSpace/main.cpp b/apps/OpenSpace/main.cpp index 684cbcc1bc..16b05b6ed4 100644 --- a/apps/OpenSpace/main.cpp +++ b/apps/OpenSpace/main.cpp @@ -90,13 +90,13 @@ void mainInitFunc() { LDEBUG("Initializing OpenGL in OpenSpace Engine started"); OsEng.initializeGL(); LDEBUG("Initializing OpenGL in OpenSpace Engine finished"); - - // Find if we have at least one OpenVR window - // Save reference to first OpenVR window, which is the one we will copy to the HMD. - for (size_t i = 0; i < SgctEngine->getNumberOfWindows(); ++i) { - if (SgctEngine->getWindowPtr(i)->checkIfTagExists("OpenVR")) { + + // Find if we have at least one OpenVR window + // Save reference to first OpenVR window, which is the one we will copy to the HMD. + for (size_t i = 0; i < SgctEngine->getNumberOfWindows(); ++i) { + if (SgctEngine->getWindowPtr(i)->checkIfTagExists("OpenVR")) { #ifdef OPENVR_SUPPORT - FirstOpenVRWindow = SgctEngine->getWindowPtr(i); + FirstOpenVRWindow = SgctEngine->getWindowPtr(i); // If we have an OpenVRWindow, initialize OpenVR. sgct::SGCTOpenVR::initialize( @@ -109,8 +109,8 @@ void mainInitFunc() { #endif break; - } - } + } + } // Set the clear color for all non-linear projection viewports // @CLEANUP: Why is this necessary? We can set the clear color in the configuration @@ -142,10 +142,10 @@ void mainPostSyncPreDrawFunc() { OsEng.postSynchronizationPreDraw(); #ifdef OPENVR_SUPPORT - if (FirstOpenVRWindow) { - // Update pose matrices for all tracked OpenVR devices once per frame - sgct::SGCTOpenVR::updatePoses(); - } + if (FirstOpenVRWindow) { + // Update pose matrices for all tracked OpenVR devices once per frame + sgct::SGCTOpenVR::updatePoses(); + } #endif LTRACE("main::postSynchronizationPreDraw(end)"); @@ -167,10 +167,10 @@ void mainRenderFunc() { #ifdef OPENVR_SUPPORT bool currentWindowIsHMD = FirstOpenVRWindow == _sgctEngine->getCurrentWindowPtr(); if (sgct::SGCTOpenVR::isHMDActive() && currentWindowIsHMD) { - projectionMatrix = sgct::SGCTOpenVR::getHMDCurrentViewProjectionMatrix( + projectionMatrix = sgct::SGCTOpenVR::getHMDCurrentViewProjectionMatrix( _sgctEngine->getCurrentFrustumMode() ); - } + } #endif if (SgctEngine->isMaster()) { @@ -187,10 +187,10 @@ void mainPostDrawFunc() { LTRACE("main::mainPostDrawFunc(begin)"); #ifdef OPENVR_SUPPORT - if (FirstOpenVRWindow) { - // Copy the first OpenVR window to the HMD - sgct::SGCTOpenVR::copyWindowToHMD(FirstOpenVRWindow); - } + if (FirstOpenVRWindow) { + // Copy the first OpenVR window to the HMD + sgct::SGCTOpenVR::copyWindowToHMD(FirstOpenVRWindow); + } #endif OsEng.postDraw(); @@ -395,6 +395,7 @@ int main_main(int argc, char** argv) { } // namespace int main(int argc, char** argv) { + return main_main(argc, argv); // We wrap the actual main function in a try catch block so that we can get and print // some additional information in case an exception is raised try { @@ -406,7 +407,12 @@ int main(int argc, char** argv) { LogMgr.flushLogs(); return EXIT_FAILURE; } - catch (const std::exception& e) { + catch (const ghoul::AssertionException& e) { + // We don't want to catch the assertion exception as we won't be able to add a + // breakpoint for debugging + LFATALC("Assertion failed", e.what()); + throw; + } catch (const std::exception& e) { LFATALC("Exception", e.what()); LogMgr.flushLogs(); return EXIT_FAILURE; diff --git a/include/openspace/engine/logfactory.h b/include/openspace/engine/logfactory.h index b32d3c6380..026208f33d 100644 --- a/include/openspace/engine/logfactory.h +++ b/include/openspace/engine/logfactory.h @@ -28,12 +28,16 @@ #include namespace ghoul { + class Dictionary; namespace logging { class Log; } -} + +} // namespace ghoul namespace openspace { +namespace documentation { struct Documentation; } + /** * This function provides the capabilities to create a new ghoul::logging::Log from the * provided ghoul::Dictionary%. The Dictionary must at least contain a Type @@ -44,15 +48,24 @@ namespace openspace { * created . Both logs can be customized using the Append, * TimeStamping, DateStamping, CategoryStamping, * and LogLevelStamping values. - * \param dictionary The dictionary from which the ghoul::logging::Log should be created + * + * \param dictionary The dictionary from which the ghoul::logging::Log should be created * \return The created ghoul::logging::Log - * \post The return value will not be nullptr - * \throw ghoul::RuntimeError If there was an error creating the ghoul::logging::Log - * \sa ghoul::logging::TextLeg - * \sa ghoul::logging::HTMLLog + * \post The return value will not be nullptr + * \throw ghoul::RuntimeError If there was an error creating the ghoul::logging::Log + * \sa ghoul::logging::TextLog + * \sa ghoul::logging::HTMLLog */ std::unique_ptr createLog(const ghoul::Dictionary& dictionary); +/** + * Returns the Documentation that describes a Dictionary used to create a log by using the + * function createLog. + * \return The Documentation that describes an acceptable Dictionary for the method + * createLog + */ +documentation::Documentation LogFactoryDocumentation(); + } // namespace openspace #endif // __OPENSPACE_CORE___LOGFACTORY___H__ diff --git a/include/openspace/interaction/deviceidentifier.h b/include/openspace/interaction/deviceidentifier.h deleted file mode 100644 index 6f714d9de0..0000000000 --- a/include/openspace/interaction/deviceidentifier.h +++ /dev/null @@ -1,79 +0,0 @@ -/***************************************************************************************** - * * - * 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. * - ****************************************************************************************/ - -#ifndef __OPENSPACE_CORE___DEVICEIDENTIFIER___H__ -#define __OPENSPACE_CORE___DEVICEIDENTIFIER___H__ - -// std includes -#include -#include -#include - -namespace openspace { - -#define MAXDEVICES 16 - -enum class InputDevice {NONE, UNKNOWN, SPACENAVIGATOR, XBOX}; - -class DeviceIdentifier { -public: - static DeviceIdentifier& ref(); - virtual ~DeviceIdentifier(); - - static void init(); - static void deinit(); - static bool isInitialized(); - - void scanDevices(); - const int numberOfDevices() const; - const InputDevice type(const int device) const; - - void update(); - void update(const int device); - - const int getButtons(const int device, unsigned char **buttons = nullptr) const; - const int getAxes(const int device, float **axespos = nullptr) const; - void get(const int device, unsigned char **buttons, float **axespos) const; - -private: - // singleton - static DeviceIdentifier* this_; - DeviceIdentifier(void); - DeviceIdentifier(const DeviceIdentifier& src); - DeviceIdentifier& operator=(const DeviceIdentifier& rhs); - - - // member variables - int devices_; - std::array inputDevice_; - std::array numberOfAxes_; - std::array numberOfButtons_; - std::array axesPos_; - std::array buttons_; - -}; - -} // namespace openspace - -#endif // __OPENSPACE_CORE___DEVICEIDENTIFIER___H__ diff --git a/include/openspace/interaction/interactionhandler.h b/include/openspace/interaction/interactionhandler.h index 6707799eab..34c398186c 100644 --- a/include/openspace/interaction/interactionhandler.h +++ b/include/openspace/interaction/interactionhandler.h @@ -25,7 +25,6 @@ #ifndef __OPENSPACE_CORE___INTERACTIONHANDLER___H__ #define __OPENSPACE_CORE___INTERACTIONHANDLER___H__ -#include #include #include #include diff --git a/include/openspace/interaction/interactionmode.h b/include/openspace/interaction/interactionmode.h index f383866c73..6a0b383403 100644 --- a/include/openspace/interaction/interactionmode.h +++ b/include/openspace/interaction/interactionmode.h @@ -25,7 +25,6 @@ #ifndef __OPENSPACE_CORE___INTERACTIONMODE___H__ #define __OPENSPACE_CORE___INTERACTIONMODE___H__ -#include #include #include #include diff --git a/include/openspace/interaction/keyboardcontroller.h b/include/openspace/interaction/keyboardcontroller.h deleted file mode 100644 index b222f9058d..0000000000 --- a/include/openspace/interaction/keyboardcontroller.h +++ /dev/null @@ -1,57 +0,0 @@ -/***************************************************************************************** - * * - * 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. * - ****************************************************************************************/ - -#ifndef __OPENSPACE_CORE___KEYBOARDCONTROLLER___H__ -#define __OPENSPACE_CORE___KEYBOARDCONTROLLER___H__ - -#include - -#include - -namespace openspace { -namespace interaction { - -class KeyboardController : public Controller { -public: - virtual ~KeyboardController() {}; - virtual void keyPressed(KeyAction action, Key key, KeyModifier modifier) = 0; -}; - -class KeyboardControllerFixed : public KeyboardController { -public: - void keyPressed(KeyAction action, Key key, KeyModifier modifier); -}; - -class KeyboardControllerLua : public KeyboardController { -public: - void keyPressed(KeyAction action, Key key, KeyModifier modifier); - -protected: - std::string keyToString(Key key, KeyModifier mod) const; -}; - -} // namespace interaction -} // namespace openspace - -#endif // __OPENSPACE_CORE___KEYBOARDCONTROLLER___H__ diff --git a/include/openspace/interaction/luaconsole.h b/include/openspace/interaction/luaconsole.h index 00890d18fb..119134e7e3 100644 --- a/include/openspace/interaction/luaconsole.h +++ b/include/openspace/interaction/luaconsole.h @@ -25,9 +25,10 @@ #ifndef __OPENSPACE_CORE___LUACONSOLE___H__ #define __OPENSPACE_CORE___LUACONSOLE___H__ -#include #include - +#include +#include +#include #include #include @@ -35,50 +36,35 @@ namespace openspace { -class LuaConsole { +class LuaConsole : public properties::PropertyOwner { public: LuaConsole(); void initialize(); void deinitialize(); - void keyboardCallback(Key key, KeyModifier modifier, KeyAction action); + bool keyboardCallback(Key key, KeyModifier modifier, KeyAction action); void charCallback(unsigned int codepoint, KeyModifier modifier); void render(); - Key commandInputButton(); - - bool isVisible() const; - void setVisible(bool visible); - bool isRemoteScripting() const; - void setRemoteScripting(bool remoteScripting); - - void toggleMode(); - - static scripting::LuaLibrary luaLibrary(); - - private: void parallelConnectionChanged(const ParallelConnection::Status& status); void addToCommand(std::string c); - std::string UnicodeToUTF8(unsigned int codepoint); + + properties::BoolProperty _isVisible; + bool _remoteScripting; size_t _inputPosition; std::vector _commandsHistory; size_t _activeCommand; std::vector _commands; - std::string _filename; - struct { int lastIndex; bool hasInitialValue; std::string initialValue; } _autoCompleteInfo; - - bool _isVisible; - bool _remoteScripting; }; } // namespace openspace diff --git a/include/openspace/util/keys.h b/include/openspace/util/keys.h index 8294cad88f..3f53df38bf 100644 --- a/include/openspace/util/keys.h +++ b/include/openspace/util/keys.h @@ -218,7 +218,6 @@ struct KeyWithModifier { KeyWithModifier stringToKey(std::string str); bool operator<(const KeyWithModifier& lhs, const KeyWithModifier& rhs); - static const std::map KeyModifierMapping = { { "SHIFT", KeyModifier::Shift }, { "ALT", KeyModifier::Alt }, diff --git a/modules/onscreengui/onscreenguimodule.cpp b/modules/onscreengui/onscreenguimodule.cpp index 976bd6a4b5..a0625d71d9 100644 --- a/modules/onscreengui/onscreenguimodule.cpp +++ b/modules/onscreengui/onscreenguimodule.cpp @@ -32,6 +32,8 @@ #include #include #include +#include +#include #include diff --git a/modules/space/rotation/spicerotation.cpp b/modules/space/rotation/spicerotation.cpp index 41b7c7d612..24d2af5c12 100644 --- a/modules/space/rotation/spicerotation.cpp +++ b/modules/space/rotation/spicerotation.cpp @@ -123,7 +123,7 @@ void SpiceRotation::update(const UpdateData& data) { data.time ); } - catch (...) { + catch (const SpiceManager::SpiceException&) { _matrix = glm::dmat3(1.0); } } diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9727ee0ca3..2086e77d36 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -40,13 +40,10 @@ set(OPENSPACE_SOURCE ${OPENSPACE_BASE_DIR}/src/engine/wrapper/sgctwindowwrapper.cpp ${OPENSPACE_BASE_DIR}/src/engine/wrapper/windowwrapper.cpp ${OPENSPACE_BASE_DIR}/src/interaction/controller.cpp - ${OPENSPACE_BASE_DIR}/src/interaction/deviceidentifier.cpp ${OPENSPACE_BASE_DIR}/src/interaction/interactionhandler.cpp ${OPENSPACE_BASE_DIR}/src/interaction/interactionmode.cpp ${OPENSPACE_BASE_DIR}/src/interaction/interactionhandler_lua.inl - ${OPENSPACE_BASE_DIR}/src/interaction/keyboardcontroller.cpp ${OPENSPACE_BASE_DIR}/src/interaction/luaconsole.cpp - ${OPENSPACE_BASE_DIR}/src/interaction/luaconsole_lua.inl ${OPENSPACE_BASE_DIR}/src/mission/mission.cpp ${OPENSPACE_BASE_DIR}/src/mission/missionmanager.cpp ${OPENSPACE_BASE_DIR}/src/mission/missionmanager_lua.inl @@ -177,10 +174,8 @@ set(OPENSPACE_HEADER ${OPENSPACE_BASE_DIR}/include/openspace/engine/wrapper/sgctwindowwrapper.h ${OPENSPACE_BASE_DIR}/include/openspace/engine/wrapper/windowwrapper.h ${OPENSPACE_BASE_DIR}/include/openspace/interaction/controller.h - ${OPENSPACE_BASE_DIR}/include/openspace/interaction/deviceidentifier.h ${OPENSPACE_BASE_DIR}/include/openspace/interaction/interactionhandler.h ${OPENSPACE_BASE_DIR}/include/openspace/interaction/interactionmode.h - ${OPENSPACE_BASE_DIR}/include/openspace/interaction/keyboardcontroller.h ${OPENSPACE_BASE_DIR}/include/openspace/interaction/luaconsole.h ${OPENSPACE_BASE_DIR}/include/openspace/mission/mission.h ${OPENSPACE_BASE_DIR}/include/openspace/mission/missionmanager.h diff --git a/src/documentation/core_registration.cpp b/src/documentation/core_registration.cpp index 5d4ff2436f..a7b40181c2 100644 --- a/src/documentation/core_registration.cpp +++ b/src/documentation/core_registration.cpp @@ -26,11 +26,11 @@ #include #include +#include #include #include #include #include -#include #include #include #include @@ -51,6 +51,7 @@ namespace openspace { void registerCoreClasses(documentation::DocumentationEngine& engine) { engine.addDocumentation(ConfigurationManager::Documentation()); + engine.addDocumentation(LogFactoryDocumentation()); engine.addDocumentation(Mission::Documentation()); engine.addDocumentation(Renderable::Documentation()); engine.addDocumentation(Rotation::Documentation()); @@ -69,7 +70,6 @@ void registerCoreClasses(scripting::ScriptEngine& engine) { engine.addLibrary(Scene::luaLibrary()); engine.addLibrary(Time::luaLibrary()); engine.addLibrary(interaction::InteractionHandler::luaLibrary()); - engine.addLibrary(LuaConsole::luaLibrary()); engine.addLibrary(ParallelConnection::luaLibrary()); engine.addLibrary(ModuleEngine::luaLibrary()); engine.addLibrary(scripting::ScriptScheduler::luaLibrary()); diff --git a/src/documentation/verifier.cpp b/src/documentation/verifier.cpp index 6103db744f..85db8531ff 100644 --- a/src/documentation/verifier.cpp +++ b/src/documentation/verifier.cpp @@ -225,25 +225,25 @@ TestResult ReferencingVerifier::operator()(const ghoul::Dictionary& dictionary, [this](const Documentation& doc) { return doc.id == identifier; } ); - if (it == documentations.end()) { - return { false, { { key, TestResult::Offense::Reason::UnknownIdentifier } } }; + ghoul_assert( + it != documentations.end(), + "Did not find referencing identifier '" + identifier + "'" + ); + + ghoul::Dictionary d = dictionary.value(key); + TestResult res = testSpecification(*it, d); + + // Add the 'key' as a prefix to make the offender a fully qualified identifer + for (TestResult::Offense& s : res.offenses) { + s.offender = key + "." + s.offender; } - else { - ghoul::Dictionary d = dictionary.value(key); - TestResult res = testSpecification(*it, d); - // Add the 'key' as a prefix to make the offender a fully qualified identifer - for (TestResult::Offense& s : res.offenses) { - s.offender = key + "." + s.offender; - } - - // Add the 'key' as a prefix to make the warning a fully qualified identifer - for (TestResult::Warning& w : res.warnings) { - w.offender = key + "." + w.offender; - } - - return res; + // Add the 'key' as a prefix to make the warning a fully qualified identifer + for (TestResult::Warning& w : res.warnings) { + w.offender = key + "." + w.offender; } + + return res; } else { return res; diff --git a/src/engine/configurationmanager_doc.inl b/src/engine/configurationmanager_doc.inl index 68f699ccfc..4136171bda 100644 --- a/src/engine/configurationmanager_doc.inl +++ b/src/engine/configurationmanager_doc.inl @@ -105,31 +105,8 @@ documentation::Documentation ConfigurationManager::Documentation() { new TableVerifier({ { "*", - new TableVerifier({ - { - ConfigurationManager::PartType, - new StringInListVerifier({ - // List from logfactory.cpp::createLog - "text", "html" - }), - "The type of the new log to be generated." - }, - { - ConfigurationManager::PartFile, - new StringVerifier, - "The filename to which the log will be written." - }, - { - ConfigurationManager::PartAppend, - new BoolVerifier, - "Determines whether the file will be cleared at " - "startup or if the contents will be appended to " - "previous runs.", - Optional::Yes - } - }), - "Additional log files", - Optional::Yes + new ReferencingVerifier("core_logfactory"), + "Additional log files" } }), "Per default, log messages are written to the console, the " diff --git a/src/engine/logfactory.cpp b/src/engine/logfactory.cpp index 02268dd6fe..bdc7d0498a 100644 --- a/src/engine/logfactory.cpp +++ b/src/engine/logfactory.cpp @@ -24,6 +24,9 @@ #include +#include +#include + #include #include #include @@ -51,37 +54,105 @@ namespace { namespace openspace { +documentation::Documentation LogFactoryDocumentation() { + using namespace documentation; + + return { + "LogFactory", + "core_logfactory", + { + { + keyType, + new StringInListVerifier({ + // List from createLog + valueTextLog, valueHtmlLog + }), + "The type of the new log to be generated." + }, + { + keyFilename, + new StringVerifier, + "The filename to which the log will be written." + }, + { + keyAppend, + new BoolVerifier, + "Determines whether the file will be cleared at startup or if the " + "contents will be appended to previous runs.", + Optional::Yes + }, + { + keyTimeStamping, + new BoolVerifier, + "Determines whether the log entires should be stamped with the time at " + "which the message was logged.", + Optional::Yes + }, + { + keyDateStamping, + new BoolVerifier, + "Determines whether the log entries should be stamped with the date at " + "which the message was logged.", + Optional::Yes + }, + { + keyCategoryStamping, + new BoolVerifier, + "Determines whether the log entries should be stamped with the " + "category that creates the log message.", + Optional::Yes + }, + { + keyLogLevelStamping, + new BoolVerifier, + "Determines whether the log entries should be stamped with the log level " + "that was used to create the log message.", + Optional::Yes + } + }, + Exhaustive::Yes + }; +} + std::unique_ptr createLog(const ghoul::Dictionary& dictionary) { using namespace std::string_literals; - std::string type; - bool typeSuccess = dictionary.getValue(keyType, type); - if (!typeSuccess) { - throw ghoul::RuntimeError( - "Requested log did not contain key '"s + keyType + "'", "LogFactory" - ); - } - std::string filename; - bool filenameSuccess = dictionary.getValue(keyFilename, filename); - if (!filenameSuccess) { - throw ghoul::RuntimeError( - "Requested log did not contain key '"s + keyFilename + "'", "LogFactory" - ); - } - filename = absPath(filename); + documentation::testSpecificationAndThrow( + LogFactoryDocumentation(), + dictionary, + "LogFactory" + ); + // 'type' and 'filename' are required keys + std::string type = dictionary.value(keyType); + std::string filename = absPath(dictionary.value(keyFilename)); + + // the rest are optional bool append = true; - dictionary.getValue(keyAppend, append); + if (dictionary.hasKeyAndValue(keyAppend)) { + dictionary.value(keyAppend); + } bool timeStamp = true; - dictionary.getValue(keyTimeStamping, timeStamp); + if (dictionary.hasKeyAndValue(keyTimeStamping)) { + dictionary.value(keyTimeStamping); + } bool dateStamp = true; - dictionary.getValue(keyDateStamping, dateStamp); + if (dictionary.hasKeyAndValue(keyDateStamping)) { + dictionary.value(keyDateStamping); + } bool categoryStamp = true; - dictionary.getValue(keyCategoryStamping, categoryStamp); + if (dictionary.hasKeyAndValue(keyCategoryStamping)) { + dictionary.value(keyCategoryStamping); + } bool logLevelStamp = true; - dictionary.getValue(keyLogLevelStamping, logLevelStamp); + if (dictionary.hasKeyAndValue(keyLogLevelStamping)) { + dictionary.value(keyLogLevelStamping); + } std::string logLevel; - dictionary.getValue(keyLogLevel, logLevel); + if (dictionary.hasKeyAndValue(keyLogLevel)) { + dictionary.value(keyLogLevel); + } + using Append = ghoul::logging::TextLog::Append; using TimeStamping = ghoul::logging::Log::TimeStamping; @@ -90,7 +161,6 @@ std::unique_ptr createLog(const ghoul::Dictionary& dictiona using LogLevelStamping = ghoul::logging::Log::LogLevelStamping; if (type == valueHtmlLog) { - std::vector cssFiles{absPath(BootstrapPath), absPath(CssPath)}; std::vector jsFiles{absPath(JsPath)}; @@ -102,7 +172,8 @@ std::unique_ptr createLog(const ghoul::Dictionary& dictiona dateStamp ? DateStamping::Yes : DateStamping::No, categoryStamp ? CategoryStamping::Yes : CategoryStamping::No, logLevelStamp ? LogLevelStamping::Yes : LogLevelStamping::No, - cssFiles, jsFiles + cssFiles, + jsFiles ); } else { @@ -141,11 +212,7 @@ std::unique_ptr createLog(const ghoul::Dictionary& dictiona ); } } - else { - throw ghoul::RuntimeError( - "Log with type '" + type + "' did not name a valid log", "LogFactory" - ); - } + ghoul_assert(false, "Missing case in the documentation for LogFactory"); } } // namespace openspace diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index 66e6f2caf2..f31d7aa4dd 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -37,7 +37,6 @@ #include #include #include -#include #include #include #include @@ -47,8 +46,10 @@ #include #include #include -#include +#include +#include #include +#include #include #include #include @@ -235,6 +236,8 @@ void OpenSpaceEngine::create(int argc, char** argv, LDEBUG("Creating OpenSpaceEngine"); _engine = new OpenSpaceEngine(std::string(argv[0]), std::move(windowWrapper)); + registerCoreClasses(DocEng); + // Query modules for commandline arguments _engine->gatherCommandlineArguments(); @@ -341,7 +344,6 @@ void OpenSpaceEngine::create(int argc, char** argv, // Register modules _engine->_moduleEngine->initialize(); - registerCoreClasses(DocEng); // After registering the modules, the documentations for the available classes // can be added as well for (OpenSpaceModule* m : _engine->_moduleEngine->modules()) { @@ -938,8 +940,7 @@ void OpenSpaceEngine::render(const glm::mat4& viewMatrix, bool showGui = _windowWrapper->hasGuiWindow() ? _windowWrapper->isGuiWindow() : true; if (showGui && _windowWrapper->isMaster() && _windowWrapper->isRegularRendering()) { _renderEngine->renderScreenLog(); - if (_console->isVisible()) - _console->render(); + _console->render(); } if (_shutdown.inShutdown) { @@ -968,25 +969,18 @@ void OpenSpaceEngine::postDraw() { void OpenSpaceEngine::keyboardCallback(Key key, KeyModifier mod, KeyAction action) { for (const auto& func : _moduleCallbacks.keyboard) { - bool consumed = func(key, mod, action); + const bool consumed = func(key, mod, action); if (consumed) { return; } } - - // @CLEANUP: Remove the commandInputButton and replace with a method just based - // on Lua by binding a key to the Lua script toggling the console ---abock - if (key == _console->commandInputButton()) { - if (action == KeyAction::Press) { - _console->toggleMode(); - } - } else if (!_console->isVisible()) { - // @CLEANUP: Make the interaction handler return whether a key has been consumed - // and then pass it on to the console ---abock - _interactionHandler->keyboardCallback(key, mod, action); - } else { - _console->keyboardCallback(key, mod, action); + + const bool consoleConsumed = _console->keyboardCallback(key, mod, action); + if (consoleConsumed) { + return; } + + _interactionHandler->keyboardCallback(key, mod, action); } void OpenSpaceEngine::charCallback(unsigned int codepoint, KeyModifier modifier) { @@ -997,9 +991,7 @@ void OpenSpaceEngine::charCallback(unsigned int codepoint, KeyModifier modifier) } } - if (_console->isVisible()) { - _console->charCallback(codepoint, modifier); - } + _console->charCallback(codepoint, modifier); } void OpenSpaceEngine::mouseButtonCallback(MouseButton button, MouseAction action) { diff --git a/src/interaction/deviceidentifier.cpp b/src/interaction/deviceidentifier.cpp deleted file mode 100644 index 992777c17f..0000000000 --- a/src/interaction/deviceidentifier.cpp +++ /dev/null @@ -1,163 +0,0 @@ -/***************************************************************************************** - * * - * 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. * - ****************************************************************************************/ - -// open space includes -#include - -#include - -namespace openspace { - - -DeviceIdentifier* DeviceIdentifier::this_ = nullptr; - -DeviceIdentifier::DeviceIdentifier() { - - // scan for devices on init - devices_ = 0; - for(int i = 0; i < MAXDEVICES; ++i) { - inputDevice_[i] = InputDevice::NONE; - } -} - -DeviceIdentifier::~DeviceIdentifier() { - - // deallocates memory on exit - for(int i = 0; i < MAXDEVICES; ++i) { - if(inputDevice_[i] != InputDevice::NONE) { - delete axesPos_[i]; - delete buttons_[i]; - } - } -} - -void DeviceIdentifier::init() { - assert( ! this_); - this_ = new DeviceIdentifier(); -} - -void DeviceIdentifier::deinit() { - assert(this_); - delete this_; - this_ = nullptr; -} - -DeviceIdentifier& DeviceIdentifier::ref() { - assert(this_); - return *this_; -} - -bool DeviceIdentifier::isInitialized() { - return this_ != nullptr; -} - -void DeviceIdentifier::scanDevices() { - assert(this_); - - // sgct/glfw supports 16 joysticks, scans all of them - for (int i = 0; i < MAXDEVICES; ++i) - { - void* joystickName = NULL; - if( joystickName != NULL ) { - - // allocate - axesPos_[i] = new float[numberOfAxes_[i]]; - buttons_[i] = new unsigned char[numberOfButtons_[i]]; - - // increment the device count - ++devices_; - - // identify what device it is - if(numberOfAxes_[i] == 6 && numberOfButtons_[i] == 10) { - printf("XBOX controller "); - inputDevice_[i] = InputDevice::XBOX; - } else if(numberOfAxes_[i] == 6 && numberOfButtons_[i] == 4) { - printf("SPACENAVIGATOR "); - inputDevice_[i] = InputDevice::SPACENAVIGATOR; - } else { - printf("UNKNOWN device "); - inputDevice_[i] = InputDevice::UNKNOWN; - } - printf("found at position %i, b=%i, a=%i\n", i, numberOfButtons_[i], numberOfAxes_[i]); - - - } else { - inputDevice_[i] = InputDevice::NONE; - } - - } -} - -const int DeviceIdentifier::numberOfDevices() const { - assert(this_); - return devices_; -} - -const InputDevice DeviceIdentifier::type(const int device) const { - assert(this_); - return inputDevice_[device]; -} - -void DeviceIdentifier::update() { - assert(this_); - for(int i = 0; i < devices_; ++i) { - update(i); - } -} - -void DeviceIdentifier::update(const int device) { - assert(this_); - if(inputDevice_[device] != InputDevice::NONE) { - } -} - -const int DeviceIdentifier::getButtons(const int device, unsigned char **buttons) const { - assert(this_); - if(inputDevice_[device] != InputDevice::NONE) { - if(buttons) - *buttons = buttons_[device]; - return numberOfButtons_[device]; - } - return 0; -} - -const int DeviceIdentifier::getAxes(const int device, float **axespos) const { - assert(this_); - if(inputDevice_[device] != InputDevice::NONE) { - if(axespos) - *axespos = axesPos_[device]; - return numberOfAxes_[device]; - } - return 0; -} - -void DeviceIdentifier::get(const int device, unsigned char **buttons, float **axespos) const { - assert(this_); - if(inputDevice_[device] != InputDevice::NONE) { - *axespos = axesPos_[device]; - *buttons = buttons_[device]; - } -} - -} // namespace openspace diff --git a/src/interaction/interactionhandler.cpp b/src/interaction/interactionhandler.cpp index e79156e292..d347354629 100644 --- a/src/interaction/interactionhandler.cpp +++ b/src/interaction/interactionhandler.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -50,19 +51,19 @@ #include namespace { - const std::string _loggerCat = "InteractionHandler"; + const char* _loggerCat = "InteractionHandler"; - const std::string KeyFocus = "Focus"; - const std::string KeyPosition = "Position"; - const std::string KeyRotation = "Rotation"; + const char* KeyFocus = "Focus"; + const char* KeyPosition = "Position"; + const char* KeyRotation = "Rotation"; - const std::string MainTemplateFilename = "${OPENSPACE_DATA}/web/keybindings/main.hbs"; - const std::string KeybindingTemplateFilename = "${OPENSPACE_DATA}/web/keybindings/keybinding.hbs"; - const std::string HandlebarsFilename = "${OPENSPACE_DATA}/web/common/handlebars-v4.0.5.js"; - const std::string JsFilename = "${OPENSPACE_DATA}/web/keybindings/script.js"; - const std::string BootstrapFilename = "${OPENSPACE_DATA}/web/common/bootstrap.min.css"; - const std::string CssFilename = "${OPENSPACE_DATA}/web/common/style.css"; -} + const char* MainTemplateFilename = "${OPENSPACE_DATA}/web/keybindings/main.hbs"; + const char* KeybindingTemplateFilename = "${OPENSPACE_DATA}/web/keybindings/keybinding.hbs"; + const char* HandlebarsFilename = "${OPENSPACE_DATA}/web/common/handlebars-v4.0.5.js"; + const char* JsFilename = "${OPENSPACE_DATA}/web/keybindings/script.js"; + const char* BootstrapFilename = "${OPENSPACE_DATA}/web/common/bootstrap.min.css"; + const char* CssFilename = "${OPENSPACE_DATA}/web/common/style.css"; +} // namespace #include "interactionhandler_lua.inl" diff --git a/src/interaction/interactionmode.cpp b/src/interaction/interactionmode.cpp index d6d18bed88..a04d6303de 100644 --- a/src/interaction/interactionmode.cpp +++ b/src/interaction/interactionmode.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include diff --git a/src/interaction/keyboardcontroller.cpp b/src/interaction/keyboardcontroller.cpp deleted file mode 100644 index 1424da3169..0000000000 --- a/src/interaction/keyboardcontroller.cpp +++ /dev/null @@ -1,329 +0,0 @@ -/***************************************************************************************** - * * - * 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. * - ****************************************************************************************/ - -#include - -#include -#include -#include -#include - -#include -#include -#include - -#include - -namespace { - const std::string _loggerCat = "KeyboardController"; -} - -namespace openspace { -namespace interaction { - -void KeyboardControllerFixed::keyPressed(KeyAction action, Key key, KeyModifier modifier) { - // TODO package in script - /* - const float dt = static_cast( _handler->deltaTime()); - if(action == KeyAction::Press|| action == KeyAction::Repeat) { - const float speed = 2.75; - if (key == Key::S) { - glm::vec3 euler(speed * dt, 0.0, 0.0); - glm::quat rot = glm::quat(euler); - _handler->orbitDelta(rot); - } - if (key == Key::W) { - glm::vec3 euler(-speed * dt, 0.0, 0.0); - glm::quat rot = glm::quat(euler); - _handler->orbitDelta(rot); - } - if (key == Key::A) { - glm::vec3 euler(0.0, -speed * dt, 0.0); - glm::quat rot = glm::quat(euler); - _handler->orbitDelta(rot); - } - if (key == Key::D) { - glm::vec3 euler(0.0, speed * dt, 0.0); - glm::quat rot = glm::quat(euler); - _handler->orbitDelta(rot); - } - if (key == Key::Q) { - Time::ref().advanceTime(dt); - } - if (key == Key::Right) { - glm::vec3 euler(0.0, speed * dt, 0.0); - glm::quat rot = glm::quat(euler); - _handler->rotateDelta(rot); - } - if (key == Key::Left) { - glm::vec3 euler(0.0, -speed * dt, 0.0); - glm::quat rot = glm::quat(euler); - _handler->rotateDelta(rot); - } - if (key == Key::Down) { - glm::vec3 euler(speed * dt, 0.0, 0.0); - glm::quat rot = glm::quat(euler); - _handler->rotateDelta(rot); - } - if (key == Key::Up) { - glm::vec3 euler(-speed * dt, 0.0, 0.0); - glm::quat rot = glm::quat(euler); - _handler->rotateDelta(rot); - } - if (key == Key::R) { - PowerScaledScalar dist(-speed * dt, 0.0); - _handler->distanceDelta(dist); - } - if (key == Key::F) { - PowerScaledScalar dist(speed * dt, 0.0); - _handler->distanceDelta(dist); - } - if (key == Key::T) { - PowerScaledScalar dist(-speed * pow(10.0f, 11.0f) * dt, 0.0f); - _handler->distanceDelta(dist); - } - //if (key == Keys::G) { - // acc += 0.001; - // PowerScaledScalar dist(speed * pow(10, 8 * acc) * dt, 0.0); - // distanceDelta(dist); - //} - if (key == Key::Y) { - PowerScaledScalar dist(-speed * 100.0f * dt, 6.0f); - _handler->distanceDelta(dist); - } - if (key == Key::H) { - PowerScaledScalar dist(speed * 100.0f * dt, 6.0f); - _handler->distanceDelta(dist); - } - - if (key == Key::KeypadSubtract) { - glm::vec2 s = OsEng.renderEngine().camera()->scaling(); - s[1] -= 0.5; - OsEng.renderEngine().camera()->setScaling(s); - } - if (key == Key::KeypadAdd) { - glm::vec2 s = OsEng.renderEngine().camera()->scaling(); - s[1] += 0.5; - OsEng.renderEngine().camera()->setScaling(s); - } - } - */ - /* - if (key == '1') { - SceneGraphNode* node = getSceneGraphNode("sun"); - - setFocusNode(node); - getCamera()->setPosition(node->getWorldPosition() + psc(0.0, 0.0, 0.5, 10.0)); - getCamera()->setCameraDirection(glm::vec3(0.0, 0.0, -1.0)); - } - - if (key == '2') { - SceneGraphNode* node = getSceneGraphNode("earth"); - - setFocusNode(node); - getCamera()->setPosition(node->getWorldPosition() + psc(0.0, 0.0, 1.0, 8.0)); - getCamera()->setCameraDirection(glm::vec3(0.0, 0.0, -1.0)); - } - - - if (key == '3') { - SceneGraphNode* node = getSceneGraphNode("moon"); - - setFocusNode(node); - getCamera()->setPosition(node->getWorldPosition() + psc(0.0, 0.0, 0.5, 8.0)); - getCamera()->setCameraDirection(glm::vec3(0.0, 0.0, -1.0)); - } - */ -} - -void KeyboardControllerLua::keyPressed(KeyAction action, Key key, KeyModifier modifier) { - lua_State* s = luaL_newstate(); - luaL_openlibs(s); - - int status = luaL_loadfile(s, absPath("${SCRIPTS}/default_keybinding.lua").c_str()); - if (status != LUA_OK) { - LERROR("Error loading script: '" << lua_tostring(s, -1) << "'"); - return; - } - - if (lua_pcall(s, 0, LUA_MULTRET, 0)) { - LERROR("Error executing script: " << lua_tostring(s, -1)); - return; - } - - auto start = std::chrono::high_resolution_clock::now(); - - lua_getfield(s, -1, keyToString(key, modifier).c_str()); - if (!lua_isnil(s, -1)) - lua_pcall(s, 0, 0, 0); - else - LINFO("Key not found"); - - auto end = std::chrono::high_resolution_clock::now(); - LINFO("Keyboard timing: " << std::chrono::duration_cast(end - start).count() << "ns"); - - -} - -std::string KeyboardControllerLua::keyToString(Key key, KeyModifier mod) const { - std::string result = ""; - int intMod = static_cast(mod); - if (intMod & static_cast(KeyModifier::Control)) - result += "CTRL + "; - if (intMod & static_cast(KeyModifier::Super)) - result += "SUPER + "; - if (intMod & static_cast(KeyModifier::Alt)) - result += "ALT + "; - if (intMod & static_cast(KeyModifier::Shift)) - result += "SHIFT + "; - - switch (key) { - case Key::Unknown: result += "Unknown"; break; - case Key::Space: result += "Space"; break; - case Key::Apostrophe: result += "Apostrophe"; break; - case Key::Comma: result += "Comma"; break; - case Key::Minus: result += "Minus"; break; - case Key::Period: result += "Period"; break; - case Key::Slash: result += "Slash"; break; - case Key::Num0: result += "0"; break; - case Key::Num1: result += "1"; break; - case Key::Num2: result += "2"; break; - case Key::Num3: result += "3"; break; - case Key::Num4: result += "4"; break; - case Key::Num5: result += "5"; break; - case Key::Num6: result += "6"; break; - case Key::Num7: result += "7"; break; - case Key::Num8: result += "8"; break; - case Key::Num9: result += "9"; break; - case Key::SemiColon: result += "SemiColon"; break; - case Key::Equal: result += "Equal"; break; - case Key::A: result += "A"; break; - case Key::B: result += "B"; break; - case Key::C: result += "C"; break; - case Key::D: result += "D"; break; - case Key::E: result += "E"; break; - case Key::F: result += "F"; break; - case Key::G: result += "G"; break; - case Key::H: result += "H"; break; - case Key::I: result += "I"; break; - case Key::J: result += "J"; break; - case Key::K: result += "K"; break; - case Key::L: result += "L"; break; - case Key::M: result += "M"; break; - case Key::N: result += "N"; break; - case Key::O: result += "O"; break; - case Key::P: result += "P"; break; - case Key::Q: result += "Q"; break; - case Key::R: result += "R"; break; - case Key::S: result += "S"; break; - case Key::T: result += "T"; break; - case Key::U: result += "U"; break; - case Key::V: result += "V"; break; - case Key::W: result += "W"; break; - case Key::X: result += "X"; break; - case Key::Y: result += "Y"; break; - case Key::Z: result += "Z"; break; - case Key::LeftBracket: result += "LeftBracket"; break; - case Key::BackSlash: result += "BackSlash"; break; - case Key::RightBracket: result += "RightBracket"; break; - case Key::GraveAccent: result += "GraveAccent"; break; - case Key::World1: result += "World1"; break; - case Key::World2: result += "World2"; break; - case Key::Escape: result += "Escape"; break; - case Key::Enter: result += "Enter"; break; - case Key::Tab: result += "Tab"; break; - case Key::BackSpace: result += "BackSpace"; break; - case Key::Insert: result += "Insert"; break; - case Key::Delete: result += "Delete"; break; - case Key::Right: result += "Right"; break; - case Key::Left: result += "Left"; break; - case Key::Down: result += "Down"; break; - case Key::Up: result += "Up"; break; - case Key::PageUp: result += "PageUp"; break; - case Key::PageDown: result += "PageDown"; break; - case Key::Home: result += "Home"; break; - case Key::End: result += "End"; break; - case Key::CapsLock: result += "CapsLock"; break; - case Key::ScrollLock: result += "ScrollLock"; break; - case Key::NumLock: result += "NumLock"; break; - case Key::PrintScreen: result += "PrintScreen"; break; - case Key::Pause: result += "Pause"; break; - case Key::F1: result += "F1"; break; - case Key::F2: result += "F2"; break; - case Key::F3: result += "F3"; break; - case Key::F4: result += "F4"; break; - case Key::F5: result += "F5"; break; - case Key::F6: result += "F6"; break; - case Key::F7: result += "F7"; break; - case Key::F8: result += "F8"; break; - case Key::F9: result += "F9"; break; - case Key::F10: result += "F10"; break; - case Key::F11: result += "F11"; break; - case Key::F12: result += "F12"; break; - case Key::F13: result += "F13"; break; - case Key::F14: result += "F14"; break; - case Key::F15: result += "F15"; break; - case Key::F16: result += "F16"; break; - case Key::F17: result += "F17"; break; - case Key::F18: result += "F18"; break; - case Key::F19: result += "F19"; break; - case Key::F20: result += "F20"; break; - case Key::F21: result += "F21"; break; - case Key::F22: result += "F22"; break; - case Key::F23: result += "F23"; break; - case Key::F24: result += "F24"; break; - case Key::F25: result += "F25"; break; - case Key::Keypad0: result += "Keypad0"; break; - case Key::Keypad1: result += "Keypad1"; break; - case Key::Keypad2: result += "Keypad2"; break; - case Key::Keypad3: result += "Keypad3"; break; - case Key::Keypad4: result += "Keypad4"; break; - case Key::Keypad5: result += "Keypad5"; break; - case Key::Keypad6: result += "Keypad6"; break; - case Key::Keypad7: result += "Keypad7"; break; - case Key::Keypad8: result += "Keypad8"; break; - case Key::Keypad9: result += "Keypad9"; break; - case Key::KeypadDecimal: result += "KeypadDecimal"; break; - case Key::KeypadDivide: result += "KeypadDivide"; break; - case Key::KeypadMultiply: result += "KeypadMultiply"; break; - case Key::KeypadSubtract: result += "KeypadSubtract"; break; - case Key::KeypadAdd: result += "KeypadAdd"; break; - case Key::KeypadEnter: result += "KeypadEnter"; break; - case Key::LeftShift: result += "LeftShift"; break; - case Key::LeftControl: result += "LeftControl"; break; - case Key::LeftAlt: result += "LeftAlt"; break; - case Key::LeftSuper: result += "LeftSuper"; break; - case Key::RightShift: result += "RightShift"; break; - case Key::RightControl: result += "RightControl"; break; - case Key::RightAlt: result += "RightAlt"; break; - case Key::RightSuper: result += "RightSuper"; break; - case Key::Menu: result += "Menu"; break; - default: - assert(false); - } - return result; -} - -} // namespace interaction -} // namespace openspace \ No newline at end of file diff --git a/src/interaction/luaconsole.cpp b/src/interaction/luaconsole.cpp index c7be4369a4..9139a24a95 100644 --- a/src/interaction/luaconsole.cpp +++ b/src/interaction/luaconsole.cpp @@ -24,280 +24,351 @@ #include -#include #include -#include -#include #include -#include -#include -#include +#include #include #include #include +#include +#include -#include -#include -#include #include +#include namespace { - const std::string _loggerCat = "LuaConsole"; - const std::string historyFile = "ConsoleHistory"; + const char* HistoryFile = "ConsoleHistory"; const int NoAutoComplete = -1; -} -#include "luaconsole_lua.inl" + const openspace::Key CommandInputButton = openspace::Key::GraveAccent; +} // namespace namespace openspace { -LuaConsole::LuaConsole() - : _inputPosition(0) - , _activeCommand(0) - , _filename("") - , _autoCompleteInfo({NoAutoComplete, false, ""}) - , _isVisible(false) +LuaConsole::LuaConsole() + : _isVisible("isVisible", "Is Visible", false) , _remoteScripting(true) + , _inputPosition(0) + , _activeCommand(0) + , _autoCompleteInfo({NoAutoComplete, false, ""}) { -// _commands.push_back(""); -// _activeCommand = _commands.size() - 1; + setName("LuaConsole"); + + _isVisible.onChange([this](){ + if (_isVisible) { + _remoteScripting = false; + } else { + _remoteScripting = OsEng.parallelConnection().isHost(); + } + }); + addProperty(_isVisible); } void LuaConsole::initialize() { - _filename = FileSys.cacheManager()->cachedFilename( - historyFile, + std::string filename = FileSys.cacheManager()->cachedFilename( + HistoryFile, "", ghoul::filesystem::CacheManager::Persistent::Yes ); - std::ifstream file(_filename, std::ios::binary | std::ios::in); - if (file.good()) { - int64_t nCommands; - file.read(reinterpret_cast(&nCommands), sizeof(int64_t)); + std::ifstream file; + file.exceptions(~std::ofstream::goodbit); + file.open(filename, std::ios::binary | std::ios::in); - std::vector tmp; - for (int64_t i = 0; i < nCommands; ++i) { - int64_t length; - file.read(reinterpret_cast(&length), sizeof(int64_t)); - tmp.resize(length + 1); - file.read(tmp.data(), length); - tmp[length] = '\0'; - _commandsHistory.emplace_back(std::string(tmp.begin(), tmp.end())); - } - file.close(); - _commands = _commandsHistory; + // Read the number of commands from the history + int64_t nCommands; + file.read(reinterpret_cast(&nCommands), sizeof(int64_t)); + + for (int64_t i = 0; i < nCommands; ++i) { + int64_t length; + file.read(reinterpret_cast(&length), sizeof(int64_t)); + + std::vector tmp(length + 1); + file.read(tmp.data(), length); + tmp[length] = '\0'; + _commandsHistory.emplace_back(std::string(tmp.begin(), tmp.end())); } + + file.close(); + + _commands = _commandsHistory; _commands.push_back(""); _activeCommand = _commands.size() - 1; - OsEng.parallelConnection().connectionEvent()->subscribe("luaConsole", - "statusChanged", [this]() { - ParallelConnection::Status status = OsEng.parallelConnection().status(); - parallelConnectionChanged(status); - }); - + OsEng.parallelConnection().connectionEvent()->subscribe( + "luaConsole", + "statusChanged", + [this]() { + ParallelConnection::Status status = OsEng.parallelConnection().status(); + parallelConnectionChanged(status); + } + ); } void LuaConsole::deinitialize() { - std::ofstream file(_filename, std::ios::binary | std::ios::out); - if (file.good()) { - int64_t nCommands = _commandsHistory.size(); - file.write(reinterpret_cast(&nCommands), sizeof(int64_t)); - for (const std::string& s : _commandsHistory) { - int64_t length = s.length(); - file.write(reinterpret_cast(&length), sizeof(int64_t)); - file.write(s.c_str(), length); - } + std::string filename = FileSys.cacheManager()->cachedFilename( + HistoryFile, + "", + ghoul::filesystem::CacheManager::Persistent::Yes + ); + + std::ofstream file; + file.exceptions(~std::ofstream::goodbit); + file.open(filename, std::ios::binary | std::ios::in); + + int64_t nCommands = _commandsHistory.size(); + file.write(reinterpret_cast(&nCommands), sizeof(int64_t)); + + for (const std::string& s : _commandsHistory) { + int64_t length = s.length(); + file.write(reinterpret_cast(&length), sizeof(int64_t)); + // We don't write the \0 at the end on purpose + file.write(s.c_str(), length); } OsEng.parallelConnection().connectionEvent()->unsubscribe("luaConsole"); } -void LuaConsole::keyboardCallback(Key key, KeyModifier modifier, KeyAction action) { - if (action == KeyAction::Press || action == KeyAction::Repeat) { - const bool modifierControl = (modifier == KeyModifier::Control); - const bool modifierShift = (modifier == KeyModifier::Shift); +bool LuaConsole::keyboardCallback(Key key, KeyModifier modifier, KeyAction action) { + if (action != KeyAction::Press && action != KeyAction::Repeat) { + return false; + } - // Paste from clipboard - if (modifierControl && (key == Key::V)) - addToCommand(ghoul::clipboardText()); + if (key == CommandInputButton) { + // Button left of 1 and above TAB + // How to deal with different keyboard languages? ---abock + _isVisible = !_isVisible; + return true; + } - // Copy to clipboard - if (modifierControl && (key == Key::C)) - ghoul::setClipboardText(_commands.at(_activeCommand)); + if (!_isVisible) { + return false; + } - // Go to the previous character - if ((key == Key::Left) && (_inputPosition > 0)) + const bool modifierControl = (modifier == KeyModifier::Control); + const bool modifierShift = (modifier == KeyModifier::Shift); + + // Paste from clipboard + if (modifierControl && (key == Key::V)) { + addToCommand(ghoul::clipboardText()); + return true; + } + + // Copy to clipboard + if (modifierControl && (key == Key::C)) { + ghoul::setClipboardText(_commands.at(_activeCommand)); + return true; + } + + // Go to the previous character + if ((key == Key::Left) && (_inputPosition > 0)) { + --_inputPosition; + return true; + } + + // Go to the next character + if (key == Key::Right) { + //&& _inputPosition < _commands.at(_activeCommand).length()) + //++_inputPosition; + _inputPosition = std::min( + _inputPosition + 1, + _commands.at(_activeCommand).length() + ); + return true; + } + + // Go to previous command + if (key == Key::Up) { + if (_activeCommand > 0) { + --_activeCommand; + } + _inputPosition = _commands.at(_activeCommand).length(); + return true; + } + + // Go to next command (the last is empty) + if (key == Key::Down) { + if (_activeCommand < _commands.size() - 1) { + ++_activeCommand; + } + _inputPosition = _commands.at(_activeCommand).length(); + return true; + } + + // Remove character before _inputPosition + if (key == Key::BackSpace) { + if (_inputPosition > 0) { + _commands.at(_activeCommand).erase(_inputPosition - 1, 1); --_inputPosition; - - // Go to the next character - if ((key == Key::Right) && _inputPosition < _commands.at(_activeCommand).length()) - ++_inputPosition; - - // Go to previous command - if (key == Key::Up) { - if (_activeCommand > 0) - --_activeCommand; - _inputPosition = _commands.at(_activeCommand).length(); } + return true; + } - // Go to next command (the last is empty) - if (key == Key::Down) { - if (_activeCommand < _commands.size() - 1) - ++_activeCommand; - _inputPosition = _commands.at(_activeCommand).length(); - } - - // Remove character before _inputPosition - if (key == Key::BackSpace) { - if (_inputPosition > 0) { - _commands.at(_activeCommand).erase(_inputPosition - 1, 1); - --_inputPosition; - } - } - - // Remove character after _inputPosition - if (key == Key::Delete) { - if (_inputPosition <= _commands.at(_activeCommand).size()) - _commands.at(_activeCommand).erase(_inputPosition, 1); + // Remove character after _inputPosition + if (key == Key::Delete) { + if (_inputPosition <= _commands.at(_activeCommand).size()) { + _commands.at(_activeCommand).erase(_inputPosition, 1); } + return true; + } - // Go to the beginning of command string - if (key == Key::Home) - _inputPosition = 0; + // Go to the beginning of command string + if (key == Key::Home) { + _inputPosition = 0; + return true; + } - // Go to the end of command string - if (key == Key::End) - _inputPosition = _commands.at(_activeCommand).size(); + // Go to the end of command string + if (key == Key::End) { + _inputPosition = _commands.at(_activeCommand).size(); + return true; + } - if (key == Key::Enter) { - // SHIFT+ENTER == new line - if (modifierShift) - addToCommand("\n"); - // ENTER == run lua script - else { - std::string cmd = _commands.at(_activeCommand); - if (cmd != "") { - OsEng.scriptEngine().queueScript(cmd, - _remoteScripting ? scripting::ScriptEngine::RemoteScripting::Yes : scripting::ScriptEngine::RemoteScripting::No); + if (key == Key::Enter) { + // SHIFT+ENTER == new line + if (modifierShift) { + addToCommand("\n"); + } + // ENTER == run lua script + else { + std::string cmd = _commands.at(_activeCommand); + if (cmd != "") { + using RemoteScripting = scripting::ScriptEngine::RemoteScripting; + OsEng.scriptEngine().queueScript( + cmd, + _remoteScripting ? RemoteScripting::Yes : RemoteScripting::No + ); - // Only add the current command to the history if it hasn't been - // executed before. We don't want two of the same commands in a row - if (_commandsHistory.empty() || (cmd != _commandsHistory.back())) - _commandsHistory.push_back(_commands.at(_activeCommand)); + // Only add the current command to the history if it hasn't been + // executed before. We don't want two of the same commands in a row + if (_commandsHistory.empty() || (cmd != _commandsHistory.back())) { + _commandsHistory.push_back(_commands.at(_activeCommand)); } - - // Some clean up after the execution of the command - _commands = _commandsHistory; - _commands.push_back(""); - _activeCommand = _commands.size() - 1; - _inputPosition = 0; - setVisible(false); } + + // Some clean up after the execution of the command + _commands = _commandsHistory; + _commands.push_back(""); + _activeCommand = _commands.size() - 1; + _inputPosition = 0; + _isVisible = false; + } + return true; + } + + if (key == Key::Tab) { + // We get a list of all the available commands and initially find the first + // command that starts with how much we typed sofar. We store the index so + // that in subsequent "tab" presses, we will discard previous commands. This + // implements the 'hop-over' behavior. As soon as another key is pressed, + // everything is set back to normal + + // If the shift key is pressed, we decrement the current index so that we will + // find the value before the one that was previously found + if (_autoCompleteInfo.lastIndex != NoAutoComplete && modifierShift) { + _autoCompleteInfo.lastIndex -= 2; + } + std::vector allCommands = OsEng.scriptEngine().allLuaFunctions(); + std::sort(allCommands.begin(), allCommands.end()); + + std::string currentCommand = _commands.at(_activeCommand); + + // Check if it is the first time the tab has been pressed. If so, we need to + // store the already entered command so that we can later start the search + // from there. We will overwrite the 'currentCommand' thus making the storage + // necessary + if (!_autoCompleteInfo.hasInitialValue) { + _autoCompleteInfo.initialValue = currentCommand; + _autoCompleteInfo.hasInitialValue = true; } - if (key == Key::Tab) { - // We get a list of all the available commands and initially find the first - // command that starts with how much we typed sofar. We store the index so - // that in subsequent "tab" presses, we will discard previous commands. This - // implements the 'hop-over' behavior. As soon as another key is pressed, - // everything is set back to normal + for (int i = 0; i < static_cast(allCommands.size()); ++i) { + const std::string& command = allCommands[i]; - // If the shift key is pressed, we decrement the current index so that we will - // find the value before the one that was previously found - if (_autoCompleteInfo.lastIndex != NoAutoComplete && modifierShift) - _autoCompleteInfo.lastIndex -= 2; - std::vector allCommands = OsEng.scriptEngine().allLuaFunctions(); - std::sort(allCommands.begin(), allCommands.end()); + // Check if the command has enough length (we don't want crashes here) + // Then check if the iterator-command's start is equal to what we want + // then check if we need to skip the first found values as the user has + // pressed TAB repeatedly + size_t fullLength = _autoCompleteInfo.initialValue.length(); + bool correctLength = command.length() >= fullLength; - std::string currentCommand = _commands.at(_activeCommand); - - // Check if it is the first time the tab has been pressed. If so, we need to - // store the already entered command so that we can later start the search - // from there. We will overwrite the 'currentCommand' thus making the storage - // necessary - if (!_autoCompleteInfo.hasInitialValue) { - _autoCompleteInfo.initialValue = currentCommand; - _autoCompleteInfo.hasInitialValue = true; - } - - for (int i = 0; i < static_cast(allCommands.size()); ++i) { - const std::string& command = allCommands[i]; - - // Check if the command has enough length (we don't want crashes here) - // Then check if the iterator-command's start is equal to what we want - // then check if we need to skip the first found values as the user has - // pressed TAB repeatedly - size_t fullLength = _autoCompleteInfo.initialValue.length(); - bool correctLength = command.length() >= fullLength; - - std::string commandLowerCase; - std::transform( - command.begin(), command.end(), - std::back_inserter(commandLowerCase), - ::tolower - ); + std::string commandLowerCase; + std::transform( + command.begin(), command.end(), + std::back_inserter(commandLowerCase), + ::tolower + ); - std::string initialValueLowerCase; - std::transform( - _autoCompleteInfo.initialValue.begin(), - _autoCompleteInfo.initialValue.end(), - std::back_inserter(initialValueLowerCase), - ::tolower - ); + std::string initialValueLowerCase; + std::transform( + _autoCompleteInfo.initialValue.begin(), + _autoCompleteInfo.initialValue.end(), + std::back_inserter(initialValueLowerCase), + ::tolower + ); - bool correctCommand = - commandLowerCase.substr(0, fullLength) == initialValueLowerCase; + bool correctCommand = + commandLowerCase.substr(0, fullLength) == initialValueLowerCase; - if (correctLength && correctCommand && (i > _autoCompleteInfo.lastIndex)){ - // We found our index, so store it - _autoCompleteInfo.lastIndex = i; + if (correctLength && correctCommand && (i > _autoCompleteInfo.lastIndex)){ + // We found our index, so store it + _autoCompleteInfo.lastIndex = i; - // We only want to auto-complete until the next separator "." - size_t pos = command.find('.', fullLength); - if (pos == std::string::npos) { - // If we don't find a separator, we autocomplete until the end - // Set the found command as active command - _commands.at(_activeCommand) = command + "();"; - // Set the cursor position to be between the brackets - _inputPosition = _commands.at(_activeCommand).size() - 2; + // We only want to auto-complete until the next separator "." + size_t pos = command.find('.', fullLength); + if (pos == std::string::npos) { + // If we don't find a separator, we autocomplete until the end + // Set the found command as active command + _commands.at(_activeCommand) = command + "();"; + // Set the cursor position to be between the brackets + _inputPosition = _commands.at(_activeCommand).size() - 2; + } + else { + // If we find a separator, we autocomplete until and including the + // separator unless the autocompletion would be the same that we + // already have (the case if there are multiple commands in the + // same group + std::string subCommand = command.substr(0, pos + 1); + if (subCommand == _commands.at(_activeCommand)) { + continue; } else { - // If we find a separator, we autocomplete until and including the - // separator unless the autocompletion would be the same that we - // already have (the case if there are multiple commands in the - // same group - std::string subCommand = command.substr(0, pos + 1); - if (subCommand == _commands.at(_activeCommand)) - continue; - else { - _commands.at(_activeCommand) = command.substr(0, pos + 1); - _inputPosition = _commands.at(_activeCommand).length(); - // We only want to remove the autocomplete info if we just - // entered the 'default' openspace namespace - if (command.substr(0, pos + 1) == "openspace.") - _autoCompleteInfo = { NoAutoComplete, false, "" }; + _commands.at(_activeCommand) = command.substr(0, pos + 1); + _inputPosition = _commands.at(_activeCommand).length(); + // We only want to remove the autocomplete info if we just + // entered the 'default' openspace namespace + if (command.substr(0, pos + 1) == "openspace.") { + _autoCompleteInfo = { NoAutoComplete, false, "" }; } } - - break; } + + break; } } - else { - // If any other key is pressed, we want to remove our previous findings - // The special case for Shift is necessary as we want to allow Shift+TAB - if (!modifierShift) - _autoCompleteInfo = { NoAutoComplete, false, ""}; + return true; + } + else { + // If any other key is pressed, we want to remove our previous findings + // The special case for Shift is necessary as we want to allow Shift+TAB + if (!modifierShift) { + _autoCompleteInfo = { NoAutoComplete, false, "" }; } } + + return true; } void LuaConsole::charCallback(unsigned int codepoint, KeyModifier modifier) { - if (codepoint == static_cast(commandInputButton())) + if (!_isVisible) { return; + } + + if (codepoint == static_cast(CommandInputButton)) { + return; + } #ifndef WIN32 const bool modifierControl = (modifier == KeyModifier::Control); @@ -308,50 +379,84 @@ void LuaConsole::charCallback(unsigned int codepoint, KeyModifier modifier) { return; } #endif - addToCommand(UnicodeToUTF8(codepoint)); + // Disallow all non ASCII characters for now + if (codepoint > 0x7f) { + return; + } + + addToCommand(std::string(1, codepoint)); } void LuaConsole::render() { - const float font_size = 10.0f; - - int ySize = OsEng.renderEngine().fontResolution().y; - //int ySize = OsEng.windowWrapper().currentWindowSize().y; - //int ySize = OsEng.windowWrapper().viewportPixelCoordinates().w; + const float FontSize = 10.0f; - float startY = static_cast(ySize) - 2.0f * font_size; - startY = startY - font_size * 15.0f * 2.0f; + if (!_isVisible) { + return; + } + + const int ySize = OsEng.renderEngine().fontResolution().y; + + const float startY = + static_cast(ySize) - 2.0f * FontSize - FontSize * 15.0f * 2.0f;; const glm::vec4 red(1, 0, 0, 1); const glm::vec4 lightBlue(0.4, 0.4, 1, 1); const glm::vec4 green(0, 1, 0, 1); const glm::vec4 white(1, 1, 1, 1); - std::shared_ptr font = OsEng.fontManager().font("Mono", font_size); + std::shared_ptr font = OsEng.fontManager().font( + "Mono", FontSize + ); using ghoul::fontrendering::RenderFont; if (_remoteScripting) { int nClients = OsEng.parallelConnection().nConnections() - 1; if (nClients == 1) { - RenderFont(*font, glm::vec2(15.f, startY + 20.0f), red, "Broadcasting script to 1 client"); + RenderFont( + *font, + glm::vec2(15.f, startY + 20.0f), + red, + "Broadcasting script to 1 client" + ); } else { - RenderFont(*font, glm::vec2(15.f, startY + 20.0f), red, ("Broadcasting script to " + std::to_string(nClients) + " clients").c_str()); + RenderFont( + *font, + glm::vec2(15.f, startY + 20.0f), + red, + ("Broadcasting script to " + std::to_string(nClients) + " clients").c_str() + ); } RenderFont(*font, glm::vec2(15.f, startY), red, "$"); } else { if (OsEng.parallelConnection().isHost()) { - RenderFont(*font, glm::vec2(15.f, startY + 20.0f), lightBlue, "Local script execution"); + RenderFont( + *font, + glm::vec2(15.f, startY + 20.0f), + lightBlue, + "Local script execution" + ); } RenderFont(*font, glm::vec2(15.f, startY), lightBlue, "$"); } - RenderFont(*font, glm::vec2(15.f + font_size, startY), white, "%s", _commands.at(_activeCommand).c_str()); + RenderFont( + *font, + glm::vec2(15.f + FontSize, startY), + white, + "%s", + _commands.at(_activeCommand).c_str() + ); - size_t n = std::count(_commands.at(_activeCommand).begin(), _commands.at(_activeCommand).begin() + _inputPosition, '\n'); + const size_t n = std::count( + _commands.at(_activeCommand).begin(), + _commands.at(_activeCommand).begin() + _inputPosition, + '\n' + ); size_t p = _commands.at(_activeCommand).find_last_of('\n', _inputPosition); size_t linepos = _inputPosition; - if (n>0) { + if (n > 0) { if (p == _inputPosition) { p = _commands.at(_activeCommand).find_last_of('\n', _inputPosition - 1); if (p != std::string::npos) { @@ -361,107 +466,30 @@ void LuaConsole::render() { linepos = _inputPosition - 1; } } - else{ + else { linepos -= p + 1; } } std::stringstream ss; ss << "%" << linepos + 1 << "s"; - RenderFont(*font, glm::vec2(15.f + font_size * 0.5f, startY - (font_size)*(n + 1)*3.0f / 2.0f), green, ss.str().c_str(), "^"); - -// sgct_text::print(font, 15.0f + font_size*0.5f, startY - (font_size)*(n + 1)*3.0f / 2.0f, green, ss.str().c_str(), "^"); -} - -Key LuaConsole::commandInputButton() { - // Button left of 1 and above TAB - // How to deal with different keyboard languages? ---abock - return Key::GraveAccent; + RenderFont( + *font, + glm::vec2(15.f + FontSize * 0.5f, startY - (FontSize) * (n + 1) * 3.0f / 2.0f), + green, + ss.str().c_str(), + "^" + ); } void LuaConsole::addToCommand(std::string c) { - size_t length = c.length(); - _commands.at(_activeCommand).insert(_inputPosition, c); + const size_t length = c.length(); + _commands.at(_activeCommand).insert(_inputPosition, std::move(c)); _inputPosition += length; } -std::string LuaConsole::UnicodeToUTF8(unsigned int codepoint) { - std::string out; - - if (codepoint <= 0x7f) - out.append(1, static_cast(codepoint)); - else if (codepoint <= 0x7ff) - { - out.append(1, static_cast(0xc0 | ((codepoint >> 6) & 0x1f))); - out.append(1, static_cast(0x80 | (codepoint & 0x3f))); - } - else if (codepoint <= 0xffff) - { - out.append(1, static_cast(0xe0 | ((codepoint >> 12) & 0x0f))); - out.append(1, static_cast(0x80 | ((codepoint >> 6) & 0x3f))); - out.append(1, static_cast(0x80 | (codepoint & 0x3f))); - } - else - { - out.append(1, static_cast(0xf0 | ((codepoint >> 18) & 0x07))); - out.append(1, static_cast(0x80 | ((codepoint >> 12) & 0x3f))); - out.append(1, static_cast(0x80 | ((codepoint >> 6) & 0x3f))); - out.append(1, static_cast(0x80 | (codepoint & 0x3f))); - } - return out; -} - -bool LuaConsole::isVisible() const { - return _isVisible; -} - -void LuaConsole::setVisible(bool visible) { - _isVisible = visible; -} - -void LuaConsole::toggleMode() { - if (_isVisible) { - if (_remoteScripting) { - _remoteScripting = false; - } else { - _isVisible = false; - } - } else { - _remoteScripting = OsEng.parallelConnection().isHost(); - _isVisible = true; - } -} - void LuaConsole::parallelConnectionChanged(const ParallelConnection::Status& status) { - _remoteScripting = status == ParallelConnection::Status::Host; + _remoteScripting = (status == ParallelConnection::Status::Host); } - -scripting::LuaLibrary LuaConsole::luaLibrary() { - return { - "console", - { - { - "show", - &luascriptfunctions::show, - "", - "Shows the console" - }, - { - "hide", - &luascriptfunctions::hide, - "", - "Hides the console" - }, - { - "toggle", - &luascriptfunctions::toggle, - "", - "Toggles the console" - } - } - }; -} - - } // namespace openspace diff --git a/src/interaction/luaconsole_lua.inl b/src/interaction/luaconsole_lua.inl deleted file mode 100644 index 0a2a606262..0000000000 --- a/src/interaction/luaconsole_lua.inl +++ /dev/null @@ -1,73 +0,0 @@ -/***************************************************************************************** - * * - * 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. * - ****************************************************************************************/ - -namespace openspace { - -namespace luascriptfunctions { - -/** - * \ingroup LuaScripts - * show(): - * Shows the console - */ -int show(lua_State* L) { - int nArguments = lua_gettop(L); - if (nArguments != 0) - return luaL_error(L, "Expected %i arguments, got %i", 0, nArguments); - - OsEng.console().setVisible(true); - return 0; -} - -/** - * \ingroup LuaScripts - * hide(): - * Hides the console - */ -int hide(lua_State* L) { - int nArguments = lua_gettop(L); - if (nArguments != 0) - return luaL_error(L, "Expected %i arguments, got %i", 0, nArguments); - - OsEng.console().setVisible(false); - return 0; -} - -/** - * \ingroup LuaScripts - * toggle(): - * Toggles the console - */ -int toggle(lua_State* L) { - int nArguments = lua_gettop(L); - if (nArguments != 0) - return luaL_error(L, "Expected %i arguments, got %i", 0, nArguments); - - OsEng.console().toggleMode(); - return 0; -} - -} // namespace luascriptfunctions - -} // namespace openspace diff --git a/src/rendering/renderengine.cpp b/src/rendering/renderengine.cpp index 4ca1b522b4..a718af8486 100644 --- a/src/rendering/renderengine.cpp +++ b/src/rendering/renderengine.cpp @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -1098,6 +1099,8 @@ void RenderEngine::renderInformation() { penPosition.y -= _fontInfo->height(); } catch (...) { + // @CLEANUP: This is bad as it will discard all exceptions + // without telling us about it! ---abock } } diff --git a/src/scene/scenegraph.cpp b/src/scene/scenegraph.cpp index d075b86b85..d4e2a34a72 100644 --- a/src/scene/scenegraph.cpp +++ b/src/scene/scenegraph.cpp @@ -113,6 +113,7 @@ bool SceneGraph::loadFromFile(const std::string& sceneDescription) { ); } catch (...) { + // @CLEANUP: This is bad to just catch all exceptions! ---abock return false; } diff --git a/src/util/keys.cpp b/src/util/keys.cpp index 17a57f6693..108f64fff8 100644 --- a/src/util/keys.cpp +++ b/src/util/keys.cpp @@ -65,7 +65,7 @@ KeyModifier operator|(KeyModifier lhs, KeyModifier rhs) { return static_cast( static_cast>(lhs) | static_cast>(rhs) - ); + ); } KeyModifier operator|=(KeyModifier& lhs, KeyModifier rhs) { @@ -82,8 +82,9 @@ KeyWithModifier stringToKey(std::string str) { // default is unknown Key k = Key::Unknown; auto it = KeyMapping.find(tokens.back()); - if (it != KeyMapping.end()) + if (it != KeyMapping.end()) { k = it->second; + } KeyModifier m = KeyModifier::NoModifier; @@ -92,10 +93,12 @@ KeyWithModifier stringToKey(std::string str) { tokens.end() - 1, [&m](const std::string& s) { auto it = KeyModifierMapping.find(s); - if (it != KeyModifierMapping.end()) + if (it != KeyModifierMapping.end()) { m |= it->second; - else + } + else { LERROR("Unknown modifier key '" << s << "'"); + } } ); @@ -103,10 +106,12 @@ KeyWithModifier stringToKey(std::string str) { } bool operator<(const KeyWithModifier& lhs, const KeyWithModifier& rhs) { - if (lhs.modifier == rhs.modifier) + if (lhs.modifier == rhs.modifier) { return lhs.key < rhs.key; - else + } + else { return lhs.modifier < rhs.modifier; + } } } // namespace openspace @@ -115,8 +120,9 @@ namespace std { std::string to_string(openspace::Key key) { for (const auto& p : openspace::KeyMapping) { - if (p.second == key) + if (p.second == key) { return p.first; + } } ghoul_assert(false, "Missing key in KeyMapping"); } @@ -124,8 +130,9 @@ std::string to_string(openspace::Key key) { std::string to_string(openspace::KeyModifier mod) { using namespace openspace; - if (mod == KeyModifier::NoModifier) + if (mod == KeyModifier::NoModifier) { return ""; + } std::string result; for (const auto& p : KeyModifierMapping) { @@ -139,10 +146,12 @@ std::string to_string(openspace::KeyModifier mod) { } std::string to_string(openspace::KeyWithModifier key) { - if (key.modifier == openspace::KeyModifier::NoModifier) + if (key.modifier == openspace::KeyModifier::NoModifier) { return to_string(key.key); - else + } + else { return to_string(key.modifier) + "+" + to_string(key.key); + } } } // namespace std From c12bd7182b389eeb1bf6b298e4010a3ea050ffb3 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Thu, 2 Mar 2017 15:43:54 -0500 Subject: [PATCH 80/96] Some cleanup of ModuleEngine Some cleanup of SettingsEngine Some cleanup of SyncEngine --- ext/ghoul | 2 +- include/openspace/engine/moduleengine.h | 18 ++- include/openspace/engine/settingsengine.h | 9 +- include/openspace/engine/syncengine.h | 72 ++++++------ include/openspace/util/openspacemodule.h | 5 +- src/engine/moduleengine.cpp | 13 +-- src/engine/openspaceengine.cpp | 11 +- src/engine/settingsengine.cpp | 105 ++++++----------- src/engine/syncengine.cpp | 120 ++++++++++---------- src/rendering/renderengine.cpp | 6 +- src/scripting/systemcapabilitiesbinding.cpp | 4 +- src/util/openspacemodule.cpp | 4 +- 12 files changed, 165 insertions(+), 204 deletions(-) diff --git a/ext/ghoul b/ext/ghoul index 636868af5e..f7fcee5973 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 636868af5eb05b7b047dd1caf8dd850e794d44a9 +Subproject commit f7fcee5973052efc94d499496d472316f56e225a diff --git a/include/openspace/engine/moduleengine.h b/include/openspace/engine/moduleengine.h index cb6d6357c0..1cba4abc48 100644 --- a/include/openspace/engine/moduleengine.h +++ b/include/openspace/engine/moduleengine.h @@ -25,14 +25,23 @@ #ifndef __OPENSPACE_CORE___MODULEENGINE___H__ #define __OPENSPACE_CORE___MODULEENGINE___H__ -#include -#include - #include #include +namespace ghoul { +namespace systemcapabilities { + +struct Version; + +} // namespace systemcapabilities +} // namespace ghoul + namespace openspace { +namespace scripting { struct LuaLibrary; } + +class OpenSpaceModule; + /** * The ModuleEngine is the central repository for registering and accessing * OpenSpaceModule for the current application run. By initializing (#initialize) the @@ -80,8 +89,7 @@ public: * version of all registered modules' OpenGL versions. * \return The combined minimum OpenGL version */ - ghoul::systemcapabilities::OpenGLCapabilitiesComponent::Version - requiredOpenGLVersion() const; + ghoul::systemcapabilities::Version requiredOpenGLVersion() const; /** * Returns the Lua library that contains all Lua functions available to affect the diff --git a/include/openspace/engine/settingsengine.h b/include/openspace/engine/settingsengine.h index 0dcc5978aa..7052fc4846 100644 --- a/include/openspace/engine/settingsengine.h +++ b/include/openspace/engine/settingsengine.h @@ -43,26 +43,19 @@ public: void initialize(); - void setModules(std::vector modules); + void setModules(const std::vector& modules); bool busyWaitForDecode(); bool logSGCTOutOfOrderErrors(); bool useDoubleBuffering(); private: - void initEyeSeparation(); - void initSceneFiles(); - void initBusyWaitForDecode(); - void initLogSGCTOutOfOrderErrors(); - void initUseDoubleBuffering(); - properties::FloatProperty _eyeSeparation; properties::OptionProperty _scenes; properties::BoolProperty _busyWaitForDecode; properties::BoolProperty _logSGCTOutOfOrderErrors; properties::BoolProperty _useDoubleBuffering; properties::BoolProperty _spiceUseExceptions; - }; } // namespace openspace diff --git a/include/openspace/engine/syncengine.h b/include/openspace/engine/syncengine.h index 77f8a7c51b..80d6d6d937 100644 --- a/include/openspace/engine/syncengine.h +++ b/include/openspace/engine/syncengine.h @@ -25,80 +25,82 @@ #ifndef __OPENSPACE_CORE___SYNCENGINE___H__ #define __OPENSPACE_CORE___SYNCENGINE___H__ +#include + +#include + #include #include namespace openspace { class Syncable; -class SyncBuffer; /** -* Manages a collection of Syncables and ensures they are synchronized -* over SGCT nodes. Encoding/Decoding order is handles internally. -*/ + * Manages a collection of Syncables and ensures they are synchronized + * over SGCT nodes. Encoding/Decoding order is handles internally. + */ class SyncEngine { public: + using IsMaster = ghoul::Boolean; /** - * Dependency injection: a SyncEngine relies on a SyncBuffer to encode the sync data. - */ - SyncEngine(SyncBuffer* syncBuffer); - + * Creates a new SyncEngine which a buffer size of \p syncBufferSize + * \pre syncBufferSize must be bigger than 0 + */ + SyncEngine(unsigned int syncBufferSize); /** - * Encodes all added Syncables in the injected SyncBuffer. - * This method is only called on the SGCT master node - */ + * Encodes all added Syncables in the injected SyncBuffer. + * This method is only called on the SGCT master node + */ void encodeSyncables(); /** - * Decodes the SyncBuffer into the added Syncables. - * This method is only called on the SGCT slave nodes - */ + * Decodes the SyncBuffer into the added Syncables. + * This method is only called on the SGCT slave nodes + */ void decodeSyncables(); /** - * Invokes the presync method of all added Syncables - */ - void presync(bool isMaster); + * Invokes the presync method of all added Syncables + */ + void preSynchronization(IsMaster isMaster); /** - * Invokes the postsync method of all added Syncables - */ - void postsync(bool isMaster); + * Invokes the postsync method of all added Syncables + */ + void postSynchronization(IsMaster isMaster); - - /** - * Add a Syncable to be synchronized over the SGCT cluster - */ + * Add a Syncable to be synchronized over the SGCT cluster. + * \pre syncable must not be nullptr + */ void addSyncable(Syncable* syncable); /** - * Add multiple Syncables to be synchronized over the SGCT cluster - */ + * Add multiple Syncables to be synchronized over the SGCT cluster + * \pre syncables must not contain any nullptr + */ void addSyncables(const std::vector& syncables); /** - * Remove a Syncable from being synchronized over the SGCT cluster - */ + * Remove a Syncable from being synchronized over the SGCT cluster + */ void removeSyncable(Syncable* syncable); private: - /** - * Vector of Syncables. The vectors ensures consistent encode/decode order - */ + * Vector of Syncables. The vectors ensures consistent encode/decode order + */ std::vector _syncables; /** - * Databuffer used in encoding/decoding - */ - std::unique_ptr _syncBuffer; + * Databuffer used in encoding/decoding + */ + SyncBuffer _syncBuffer; }; - } // namespace openspace #endif // __OPENSPACE_CORE___SYNCENGINE___H__ diff --git a/include/openspace/util/openspacemodule.h b/include/openspace/util/openspacemodule.h index cd7d2bc5bb..ee8ff15e83 100644 --- a/include/openspace/util/openspacemodule.h +++ b/include/openspace/util/openspacemodule.h @@ -29,7 +29,7 @@ #include -#include +#include #include #include @@ -87,8 +87,7 @@ public: * overwritten, it returns an OpenGL version of 3.3. * \return The minimum required OpenGL version of this OpenSpaceModule */ - virtual ghoul::systemcapabilities::OpenGLCapabilitiesComponent::Version - requiredOpenGLVersion() const; + virtual ghoul::systemcapabilities::Version requiredOpenGLVersion() const; protected: /** diff --git a/src/engine/moduleengine.cpp b/src/engine/moduleengine.cpp index 5aa8886d51..8abb756e1b 100644 --- a/src/engine/moduleengine.cpp +++ b/src/engine/moduleengine.cpp @@ -25,6 +25,7 @@ #include #include +#include #include #include @@ -34,7 +35,7 @@ #include "moduleengine_lua.inl" namespace { - const std::string _loggerCat = "ModuleEngine"; + const char* _loggerCat = "ModuleEngine"; } namespace openspace { @@ -67,7 +68,8 @@ void ModuleEngine::registerModule(std::unique_ptr module) { ); if (it != _modules.end()) { throw ghoul::RuntimeError( - "Module name '" + module->name() + "' was registered before", "ModuleEngine" + "Module name '" + module->name() + "' was registered before", + "ModuleEngine" ); } @@ -85,11 +87,8 @@ std::vector ModuleEngine::modules() const { return result; } -ghoul::systemcapabilities::OpenGLCapabilitiesComponent::Version -ModuleEngine::requiredOpenGLVersion() const -{ - using Version = ghoul::systemcapabilities::OpenGLCapabilitiesComponent::Version; - Version version = { 0,0 }; +ghoul::systemcapabilities::Version ModuleEngine::requiredOpenGLVersion() const { + ghoul::systemcapabilities::Version version = { 0, 0 }; for (const auto& m : _modules) { version = std::max(version, m->requiredOpenGLVersion()); diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index f31d7aa4dd..dc08eda341 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -51,6 +51,7 @@ #include #include #include +#include #include #include #include @@ -128,7 +129,7 @@ OpenSpaceEngine::OpenSpaceEngine(std::string programName, , _scriptEngine(new scripting::ScriptEngine) , _scriptScheduler(new scripting::ScriptScheduler) , _networkEngine(new NetworkEngine) - , _syncEngine(std::make_unique(new SyncBuffer(4096))) + , _syncEngine(std::make_unique(4096)) , _commandlineParser(new ghoul::cmdparser::CommandlineParser( programName, ghoul::cmdparser::CommandlineParser::AllowUnknownCommands::Yes )) @@ -448,9 +449,9 @@ void OpenSpaceEngine::initialize() { SysCap.logCapabilities(verbosity); // Check the required OpenGL versions of the registered modules - ghoul::systemcapabilities::OpenGLCapabilitiesComponent::Version version = + ghoul::systemcapabilities::Version version = _engine->_moduleEngine->requiredOpenGLVersion(); - LINFO("Required OpenGL version: " << version.toString()); + LINFO("Required OpenGL version: " << std::to_string(version)); if (OpenGLCap.openGLVersion() < version) { throw ghoul::RuntimeError( @@ -845,7 +846,7 @@ void OpenSpaceEngine::preSynchronization() { bool master = _windowWrapper->isMaster(); - _syncEngine->presync(master); + _syncEngine->preSynchronization(SyncEngine::IsMaster(master)); if (master) { double dt = _windowWrapper->averageDeltaTime(); _timeManager->preSynchronization(dt); @@ -877,7 +878,7 @@ void OpenSpaceEngine::postSynchronizationPreDraw() { LTRACE("OpenSpaceEngine::postSynchronizationPreDraw(begin)"); bool master = _windowWrapper->isMaster(); - _syncEngine->postsync(master); + _syncEngine->postSynchronization(SyncEngine::IsMaster(master)); if (_shutdown.inShutdown) { if (_shutdown.timer <= 0.f) { diff --git a/src/engine/settingsengine.cpp b/src/engine/settingsengine.cpp index a74dbfdde7..870b0d72db 100644 --- a/src/engine/settingsengine.cpp +++ b/src/engine/settingsengine.cpp @@ -40,13 +40,13 @@ namespace { - const std::string _loggerCat = "SettingsEngine"; + const char* _loggerCat = "SettingsEngine"; } namespace openspace { SettingsEngine::SettingsEngine() - : _eyeSeparation("eyeSeparation", "Eye Separation" , 0.f, 0.f, 10.f) + : _eyeSeparation("eyeSeparation", "Eye Separation", 0.f, 0.f, 10.f) , _scenes("scenes", "Scene", properties::OptionProperty::DisplayType::Dropdown) , _busyWaitForDecode("busyWaitForDecode", "Busy Wait for decode", false) , _logSGCTOutOfOrderErrors("logSGCTOutOfOrderErrors", "Log SGCT out-of-order", false) @@ -55,79 +55,26 @@ SettingsEngine::SettingsEngine() { setName("Global Properties"); - _spiceUseExceptions.onChange([this]{ + _spiceUseExceptions.onChange([this] { if (_spiceUseExceptions) { SpiceManager::ref().setExceptionHandling(SpiceManager::UseException::Yes); - } - else { + } else { SpiceManager::ref().setExceptionHandling(SpiceManager::UseException::No); } }); addProperty(_spiceUseExceptions); + addProperty(_eyeSeparation); + addProperty(_busyWaitForDecode); + addProperty(_logSGCTOutOfOrderErrors); + addProperty(_useDoubleBuffering); + addProperty(_scenes); } void SettingsEngine::initialize() { - initEyeSeparation(); - initSceneFiles(); - initBusyWaitForDecode(); - initLogSGCTOutOfOrderErrors(); - initUseDoubleBuffering(); -} - -void SettingsEngine::setModules(std::vector modules) { - for (OpenSpaceModule* m : modules) { - addPropertySubOwner(m); - } -} - -void SettingsEngine::initEyeSeparation() { - addProperty(_eyeSeparation); - // Set interaction to change the window's (SGCT's) eye separation _eyeSeparation.onChange( - [this]() { OsEng.windowWrapper().setEyeSeparationDistance(_eyeSeparation); }); -} - -void SettingsEngine::initBusyWaitForDecode() { - addProperty(_busyWaitForDecode); - _busyWaitForDecode.onChange( - [this]() { - LINFO((_busyWaitForDecode.value() ? "Busy wait for decode" : "Async decode")); - }); -} - -bool SettingsEngine::busyWaitForDecode() { - return _busyWaitForDecode.value(); -} - -void SettingsEngine::initLogSGCTOutOfOrderErrors() { - addProperty(_logSGCTOutOfOrderErrors); - _logSGCTOutOfOrderErrors.onChange( - [this]() { - LINFO("Turn " << (_logSGCTOutOfOrderErrors.value() ? "on" : "off") << " SGCT out of order logging"); - }); -} - -bool SettingsEngine::logSGCTOutOfOrderErrors() { - return _logSGCTOutOfOrderErrors.value(); -} - - -void SettingsEngine::initUseDoubleBuffering() { - addProperty(_useDoubleBuffering); - _useDoubleBuffering.onChange( - [this]() { - LINFO("Turn " << (_useDoubleBuffering.value() ? "on" : "off") << " double buffering"); - }); -} - - -bool SettingsEngine::useDoubleBuffering() { - return _useDoubleBuffering.value(); -} - -void SettingsEngine::initSceneFiles() { - addProperty(_scenes); + [this]() { OsEng.windowWrapper().setEyeSeparationDistance(_eyeSeparation); } + ); // Load all matching files in the Scene // TODO: match regex with either with new ghoul readFiles or local code @@ -135,18 +82,36 @@ void SettingsEngine::initSceneFiles() { std::vector scenes = ghoul::filesystem::Directory(sceneDir).readFiles(); for (std::size_t i = 0; i < scenes.size(); ++i) { std::size_t found = scenes[i].find_last_of("/\\"); - _scenes.addOption(i, scenes[i].substr(found+1)); + _scenes.addOption(i, scenes[i].substr(found + 1)); } // Set interaction to change ConfigurationManager and schedule the load _scenes.onChange( [this]() { - std::string sceneFile = _scenes.getDescriptionByValue(_scenes); - OsEng.configurationManager().setValue( - ConfigurationManager::KeyConfigScene, sceneFile); - OsEng.renderEngine().scene()->scheduleLoadSceneFile(sceneFile); - } + std::string sceneFile = _scenes.getDescriptionByValue(_scenes); + OsEng.configurationManager().setValue( + ConfigurationManager::KeyConfigScene, sceneFile); + OsEng.renderEngine().scene()->scheduleLoadSceneFile(sceneFile); + } ); } +void SettingsEngine::setModules(const std::vector& modules) { + for (OpenSpaceModule* m : modules) { + addPropertySubOwner(m); + } } + +bool SettingsEngine::busyWaitForDecode() { + return _busyWaitForDecode.value(); +} + +bool SettingsEngine::logSGCTOutOfOrderErrors() { + return _logSGCTOutOfOrderErrors.value(); +} + +bool SettingsEngine::useDoubleBuffering() { + return _useDoubleBuffering.value(); +} + +} // namespace openspace \ No newline at end of file diff --git a/src/engine/syncengine.cpp b/src/engine/syncengine.cpp index 9cee862af9..398e5c9c1e 100644 --- a/src/engine/syncengine.cpp +++ b/src/engine/syncengine.cpp @@ -23,73 +23,67 @@ ****************************************************************************************/ #include + #include -#include -#include + +#include #include -#include - - -namespace { - const std::string _loggerCat = "SyncEngine"; -} - namespace openspace { - SyncEngine::SyncEngine(SyncBuffer* syncBuffer) - : _syncBuffer(syncBuffer) - { - - } - - - void SyncEngine::presync(bool isMaster) { - for (const auto& syncable : _syncables) { - syncable->presync(isMaster); - } - } - - // should be called on sgct master - void SyncEngine::encodeSyncables() { - for (const auto& syncable : _syncables) { - syncable->encode(_syncBuffer.get()); - } - _syncBuffer->write(); - } - - //should be called on sgct slaves - void SyncEngine::decodeSyncables() { - _syncBuffer->read(); - for (const auto& syncable : _syncables) { - syncable->decode(_syncBuffer.get()); - } - } - - void SyncEngine::postsync(bool isMaster) { - for (const auto& syncable : _syncables) { - syncable->postsync(isMaster); - } - } - - - - void SyncEngine::addSyncable(Syncable* syncable) { - _syncables.push_back(syncable); - } - - void SyncEngine::addSyncables(const std::vector& syncables) { - for (const auto& syncable : syncables) { - addSyncable(syncable); - } - } - - void SyncEngine::removeSyncable(Syncable* syncable) { - _syncables.erase( - std::remove(_syncables.begin(), _syncables.end(), syncable), - _syncables.end() - ); - } - +SyncEngine::SyncEngine(unsigned int syncBufferSize) + : _syncBuffer(syncBufferSize) +{ + ghoul_assert(syncBufferSize > 0, "syncBufferSize must be bigger than 0"); } + +// should be called on sgct master +void SyncEngine::encodeSyncables() { + for (Syncable* syncable : _syncables) { + syncable->encode(&_syncBuffer); + } + _syncBuffer.write(); +} + +//should be called on sgct slaves +void SyncEngine::decodeSyncables() { + _syncBuffer.read(); + for (Syncable* syncable : _syncables) { + syncable->decode(&_syncBuffer); + } +} + +void SyncEngine::preSynchronization(IsMaster isMaster) { + for (Syncable* syncable : _syncables) { + syncable->presync(isMaster); + } +} + +void SyncEngine::postSynchronization(IsMaster isMaster) { + for (Syncable* syncable : _syncables) { + syncable->postsync(isMaster); + } +} + +void SyncEngine::addSyncable(Syncable* syncable) { + ghoul_assert(syncable, "synable must not be nullptr"); + + _syncables.push_back(syncable); +} + +void SyncEngine::addSyncables(const std::vector& syncables) { + for (Syncable* syncable : syncables) { + ghoul_assert(syncable, "syncables must not contain any nullptr"); + addSyncable(syncable); + } +} + +void SyncEngine::removeSyncable(Syncable* syncable) { + _syncables.erase( + std::remove(_syncables.begin(), _syncables.end(), syncable), + _syncables.end() + ); +} + +} // namespace openspace diff --git a/src/rendering/renderengine.cpp b/src/rendering/renderengine.cpp index a718af8486..06a23bb9ff 100644 --- a/src/rendering/renderengine.cpp +++ b/src/rendering/renderengine.cpp @@ -186,7 +186,7 @@ void RenderEngine::initialize() { if (confManager.hasKeyAndValue(KeyRenderingMethod)) { renderingMethod = confManager.value(KeyRenderingMethod); } else { - using Version = ghoul::systemcapabilities::OpenGLCapabilitiesComponent::Version; + using Version = ghoul::systemcapabilities::Version; // The default rendering method has a requirement of OpenGL 4.3, so if we are // below that, we will fall back to frame buffer operation @@ -556,7 +556,9 @@ void RenderEngine::postDraw() { } if (_performanceManager) { - _performanceManager->storeScenePerformanceMeasurements(scene()->allSceneGraphNodes()); + _performanceManager->storeScenePerformanceMeasurements( + scene()->allSceneGraphNodes() + ); } } diff --git a/src/scripting/systemcapabilitiesbinding.cpp b/src/scripting/systemcapabilitiesbinding.cpp index 1c8bdb3595..6f7b3b7cd7 100644 --- a/src/scripting/systemcapabilitiesbinding.cpp +++ b/src/scripting/systemcapabilitiesbinding.cpp @@ -111,7 +111,7 @@ int hasOpenGLVersion(lua_State* L) { int major = std::stoi(v[0]); int minor = std::stoi(v[1]); int release = v.size() == 3 ? std::stoi(v[2]) : 0; - OpenGLCapabilitiesComponent::Version version = { major, minor, release }; + Version version = { major, minor, release }; bool supported = OpenGLCap.openGLVersion() >= version; @@ -121,7 +121,7 @@ int hasOpenGLVersion(lua_State* L) { } int openGLVersion(lua_State* L) { - lua_pushstring(L, OpenGLCap.openGLVersion().toString().c_str()); + lua_pushstring(L, std::to_string(OpenGLCap.openGLVersion()).c_str()); return 1; } diff --git a/src/util/openspacemodule.cpp b/src/util/openspacemodule.cpp index cfb330ac96..ef9a56d386 100644 --- a/src/util/openspacemodule.cpp +++ b/src/util/openspacemodule.cpp @@ -73,9 +73,7 @@ scripting::LuaLibrary OpenSpaceModule::luaLibrary() const { return {}; } -ghoul::systemcapabilities::OpenGLCapabilitiesComponent::Version -OpenSpaceModule::requiredOpenGLVersion() const -{ +ghoul::systemcapabilities::Version OpenSpaceModule::requiredOpenGLVersion() const { return { 3, 3 }; } From aba3536caa33e7c4194ec0bd9e5a4762cec6d259 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Thu, 2 Mar 2017 17:32:20 -0500 Subject: [PATCH 81/96] Don't assert if the focus node is not found if there are no nodes at all --- modules/onscreengui/src/guiorigincomponent.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/onscreengui/src/guiorigincomponent.cpp b/modules/onscreengui/src/guiorigincomponent.cpp index f22588dbf2..80032549bc 100644 --- a/modules/onscreengui/src/guiorigincomponent.cpp +++ b/modules/onscreengui/src/guiorigincomponent.cpp @@ -59,7 +59,11 @@ void GuiOriginComponent::render() { } auto iCurrentFocus = std::find(nodes.begin(), nodes.end(), currentFocus); - ghoul_assert(iCurrentFocus != nodes.end(), "Focus node not found"); + if (!nodes.empty()) { + // Only check if we found the current focus node if we have any nodes at all + // only then it would be a real error + ghoul_assert(iCurrentFocus != nodes.end(), "Focus node not found"); + } int currentPosition = static_cast(std::distance(iCurrentFocus, nodes.begin())); bool hasChanged = ImGui::Combo("Origin", ¤tPosition, nodeNames.c_str()); From 1689dc4047e19949e3d870c23bc94ed5f057f2ee Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Thu, 2 Mar 2017 18:23:39 -0500 Subject: [PATCH 82/96] Move the PropertyOwner name specification into the constructor and adjust accordingly --- include/openspace/properties/propertyowner.h | 2 +- include/openspace/scene/scale.h | 1 + include/openspace/scene/translation.h | 1 + modules/base/rendering/modelgeometry.cpp | 5 +- .../globebrowsing/globes/renderableglobe.cpp | 5 +- .../globebrowsing/rendering/layer/layer.cpp | 7 +- .../rendering/layer/layergroup.cpp | 4 +- .../rendering/layer/layermanager.cpp | 6 +- .../rendering/layer/layerrendersettings.cpp | 5 +- modules/iswa/rendering/iswabasegroup.cpp | 18 +- modules/iswa/util/iswamanager.cpp | 15 +- .../newhorizons/util/projectioncomponent.cpp | 4 +- modules/onscreengui/src/guicomponent.cpp | 5 +- modules/space/rendering/planetgeometry.cpp | 7 +- src/engine/openspaceengine.cpp | 2 +- src/engine/settingsengine.cpp | 5 +- src/interaction/interactionhandler.cpp | 5 +- src/interaction/luaconsole.cpp | 5 +- src/properties/propertyowner.cpp | 174 +++++++++++------- src/rendering/renderable.cpp | 8 +- src/rendering/renderengine.cpp | 5 +- src/rendering/screenspacerenderable.cpp | 10 +- src/scene/rotation.cpp | 10 +- src/scene/scale.cpp | 4 + src/scene/scenegraphnode.cpp | 3 +- src/scene/translation.cpp | 4 + src/util/openspacemodule.cpp | 8 +- 27 files changed, 180 insertions(+), 148 deletions(-) diff --git a/include/openspace/properties/propertyowner.h b/include/openspace/properties/propertyowner.h index 09f6f0cc0b..56a69783bb 100644 --- a/include/openspace/properties/propertyowner.h +++ b/include/openspace/properties/propertyowner.h @@ -53,7 +53,7 @@ public: static const char URISeparator = '.'; /// The constructor initializing the PropertyOwner's name to "" - PropertyOwner(); + PropertyOwner(std::string name = ""); /** * The destructor will remove all Propertys and PropertyOwners it owns along with diff --git a/include/openspace/scene/scale.h b/include/openspace/scene/scale.h index 8b80ed18f2..b6c0f27a1a 100644 --- a/include/openspace/scene/scale.h +++ b/include/openspace/scene/scale.h @@ -38,6 +38,7 @@ class Scale : public properties::PropertyOwner { public: static std::unique_ptr createFromDictionary(const ghoul::Dictionary& dictionary); + Scale(); virtual ~Scale(); virtual bool initialize(); virtual double scaleValue() const = 0; diff --git a/include/openspace/scene/translation.h b/include/openspace/scene/translation.h index 4e3a631f7c..3cc355be03 100644 --- a/include/openspace/scene/translation.h +++ b/include/openspace/scene/translation.h @@ -41,6 +41,7 @@ class Translation : public properties::PropertyOwner { public: static std::unique_ptr createFromDictionary(const ghoul::Dictionary& dictionary); + Translation(); virtual ~Translation(); virtual bool initialize(); diff --git a/modules/base/rendering/modelgeometry.cpp b/modules/base/rendering/modelgeometry.cpp index 8ca084be67..82e3ee0074 100644 --- a/modules/base/rendering/modelgeometry.cpp +++ b/modules/base/rendering/modelgeometry.cpp @@ -88,7 +88,8 @@ std::unique_ptr ModelGeometry::createFromDictionary( } ModelGeometry::ModelGeometry(const ghoul::Dictionary& dictionary) - : _parent(nullptr) + : properties::PropertyOwner("ModelGeometry") + , _parent(nullptr) , _mode(GL_TRIANGLES) { documentation::testSpecificationAndThrow( @@ -97,8 +98,6 @@ ModelGeometry::ModelGeometry(const ghoul::Dictionary& dictionary) "ModelGeometry" ); - setName("ModelGeometry"); - std::string name; bool success = dictionary.getValue(keyName, name); ghoul_assert(success, "Name tag was not present"); diff --git a/modules/globebrowsing/globes/renderableglobe.cpp b/modules/globebrowsing/globes/renderableglobe.cpp index 6c050a57aa..40de2649eb 100644 --- a/modules/globebrowsing/globes/renderableglobe.cpp +++ b/modules/globebrowsing/globes/renderableglobe.cpp @@ -51,6 +51,7 @@ RenderableGlobe::RenderableGlobe(const ghoul::Dictionary& dictionary) FloatProperty("lodScaleFactor", "lodScaleFactor",10.0f, 1.0f, 50.0f), FloatProperty("cameraMinHeight", "cameraMinHeight", 100.0f, 0.0f, 1000.0f) }) + , _debugPropertyOwner("Debug") , _debugProperties({ BoolProperty("saveOrThrowCamera", "save or throw camera", false), BoolProperty("showChunkEdges", "show chunk edges", false), @@ -66,6 +67,7 @@ RenderableGlobe::RenderableGlobe(const ghoul::Dictionary& dictionary) BoolProperty("collectStats", "collect stats", false), BoolProperty("onlyModelSpaceRendering", "Only Model Space Rendering", false) }) + , _texturePropertyOwner("Textures") { setName("RenderableGlobe"); @@ -105,9 +107,6 @@ RenderableGlobe::RenderableGlobe(const ghoul::Dictionary& dictionary) double distance = res * _ellipsoid.maximumRadius() / tan(fov / 2); _distanceSwitch.addSwitchValue(_chunkedLodGlobe, distance); - _debugPropertyOwner.setName("Debug"); - _texturePropertyOwner.setName("Textures"); - addProperty(_generalProperties.isEnabled); addProperty(_generalProperties.atmosphereEnabled); addProperty(_generalProperties.performShading); diff --git a/modules/globebrowsing/rendering/layer/layer.cpp b/modules/globebrowsing/rendering/layer/layer.cpp index e4f0aab166..ba8eb7a39f 100644 --- a/modules/globebrowsing/rendering/layer/layer.cpp +++ b/modules/globebrowsing/rendering/layer/layer.cpp @@ -30,12 +30,9 @@ namespace openspace { namespace globebrowsing { Layer::Layer(const ghoul::Dictionary& layerDict) - : _enabled(properties::BoolProperty("enabled", "enabled", false)) + : properties::PropertyOwner(layerDict.value("Name")) + , _enabled(properties::BoolProperty("enabled", "enabled", false)) { - std::string layerName = "error!"; - layerDict.getValue("Name", layerName); - setName(layerName); - _tileProvider = std::shared_ptr( tileprovider::TileProvider::createFromDictionary(layerDict)); diff --git a/modules/globebrowsing/rendering/layer/layergroup.cpp b/modules/globebrowsing/rendering/layer/layergroup.cpp index f6ab83687b..a5ff471a98 100644 --- a/modules/globebrowsing/rendering/layer/layergroup.cpp +++ b/modules/globebrowsing/rendering/layer/layergroup.cpp @@ -30,9 +30,9 @@ namespace openspace { namespace globebrowsing { LayerGroup::LayerGroup(std::string name) - : _levelBlendingEnabled("blendTileLevels", "blend tile levels", true) + : properties::PropertyOwner(std::move(name)) + , _levelBlendingEnabled("blendTileLevels", "blend tile levels", true) { - setName(std::move(name)); addProperty(_levelBlendingEnabled); } diff --git a/modules/globebrowsing/rendering/layer/layermanager.cpp b/modules/globebrowsing/rendering/layer/layermanager.cpp index d8ea7b4a3b..3dce21ede6 100644 --- a/modules/globebrowsing/rendering/layer/layermanager.cpp +++ b/modules/globebrowsing/rendering/layer/layermanager.cpp @@ -40,9 +40,9 @@ const char* LayerManager::LAYER_GROUP_NAMES[NUM_LAYER_GROUPS] = { "WaterMasks" }; -LayerManager::LayerManager(const ghoul::Dictionary& layerGroupsDict) { - setName("Layers"); - +LayerManager::LayerManager(const ghoul::Dictionary& layerGroupsDict) + : properties::PropertyOwner("Layers") +{ if (NUM_LAYER_GROUPS != layerGroupsDict.size()) { throw ghoul::RuntimeError( "Number of Layer Groups must be equal to " + NUM_LAYER_GROUPS); diff --git a/modules/globebrowsing/rendering/layer/layerrendersettings.cpp b/modules/globebrowsing/rendering/layer/layerrendersettings.cpp index 3a8427da8f..17c0784d6f 100644 --- a/modules/globebrowsing/rendering/layer/layerrendersettings.cpp +++ b/modules/globebrowsing/rendering/layer/layerrendersettings.cpp @@ -28,12 +28,11 @@ namespace openspace { namespace globebrowsing { LayerRenderSettings::LayerRenderSettings() - : opacity(properties::FloatProperty("opacity", "opacity", 1.f, 0.f, 1.f)) + : properties::PropertyOwner("Settings") + , opacity(properties::FloatProperty("opacity", "opacity", 1.f, 0.f, 1.f)) , gamma(properties::FloatProperty("gamma", "gamma", 1, 0, 5)) , multiplier(properties::FloatProperty("multiplier", "multiplier", 1.f, 0.f, 20.f)) { - setName("settings"); - addProperty(opacity); addProperty(gamma); addProperty(multiplier); diff --git a/modules/iswa/rendering/iswabasegroup.cpp b/modules/iswa/rendering/iswabasegroup.cpp index cc2ab43c5e..64fe7532c8 100644 --- a/modules/iswa/rendering/iswabasegroup.cpp +++ b/modules/iswa/rendering/iswabasegroup.cpp @@ -41,16 +41,16 @@ namespace { } namespace openspace { -IswaBaseGroup::IswaBaseGroup(std::string name, std::string type) - :_enabled("enabled", "Enabled", true) - ,_alpha("alpha", "Alpha", 0.9f, 0.0f, 1.0f) - ,_delete("delete", "Delete") - ,_registered(false) - ,_type(type) - ,_dataProcessor(nullptr) -{ - setName(name); +IswaBaseGroup::IswaBaseGroup(std::string name, std::string type) + : properties::PropertyOwner(std::move(name)) + , _enabled("enabled", "Enabled", true) + , _alpha("alpha", "Alpha", 0.9f, 0.0f, 1.0f) + , _delete("delete", "Delete") + , _registered(false) + , _type(type) + , _dataProcessor(nullptr) +{ addProperty(_enabled); addProperty(_alpha); addProperty(_delete); diff --git a/modules/iswa/util/iswamanager.cpp b/modules/iswa/util/iswamanager.cpp index 98a0494ac2..d8db3c4c62 100644 --- a/modules/iswa/util/iswamanager.cpp +++ b/modules/iswa/util/iswamanager.cpp @@ -59,8 +59,10 @@ namespace { namespace openspace{ IswaManager::IswaManager() - : _iswaEvent() + : properties::PropertyOwner("IswaManager") + , _iswaEvent() { + // @CLEANUP: Make this staticly allocated ---abock _month["JAN"] = "01"; _month["FEB"] = "02"; _month["MAR"] = "03"; @@ -99,19 +101,16 @@ IswaManager::~IswaManager(){ } void IswaManager::addIswaCygnet(int id, std::string type, std::string group){ - if(id > 0){ - + if (id > 0) { createScreenSpace(id); - - }else if(id < 0){ - + } else if(id < 0) { // create metadata object and assign group and id std::shared_ptr metaFuture = std::make_shared(); metaFuture->id = id; metaFuture->group = group; // Assign type of cygnet Texture/Data - if(type == _type[CygnetType::Texture]){ + if (type == _type[CygnetType::Texture]) { metaFuture->type = CygnetType::Texture; } else if (type == _type[CygnetType::Data]) { metaFuture->type = CygnetType::Data; @@ -122,7 +121,7 @@ void IswaManager::addIswaCygnet(int id, std::string type, std::string group){ // This callback determines what geometry should be used and creates the right cygbet auto metadataCallback = - [this, metaFuture](const DownloadManager::MemoryFile& file){ + [this, metaFuture](const DownloadManager::MemoryFile& file) { //Create a string from downloaded file std::string res; res.append(file.buffer, file.size); diff --git a/modules/newhorizons/util/projectioncomponent.cpp b/modules/newhorizons/util/projectioncomponent.cpp index 5685558eb9..e76ce80ff0 100644 --- a/modules/newhorizons/util/projectioncomponent.cpp +++ b/modules/newhorizons/util/projectioncomponent.cpp @@ -166,7 +166,7 @@ documentation::Documentation ProjectionComponent::Documentation() { } ProjectionComponent::ProjectionComponent() - : properties::PropertyOwner() + : properties::PropertyOwner("ProjectionComponent") , _performProjection("performProjection", "Perform Projections", true) , _clearAllProjections("clearAllProjections", "Clear Projections", false) , _projectionFading("projectionFading", "Projection Fading", 1.f, 0.f, 1.f) @@ -175,8 +175,6 @@ ProjectionComponent::ProjectionComponent() , _textureSizeDirty(false) , _projectionTexture(nullptr) { - setName("ProjectionComponent"); - _shadowing.isEnabled = false; _dilation.isEnabled = false; diff --git a/modules/onscreengui/src/guicomponent.cpp b/modules/onscreengui/src/guicomponent.cpp index 806755440d..3c26242c6d 100644 --- a/modules/onscreengui/src/guicomponent.cpp +++ b/modules/onscreengui/src/guicomponent.cpp @@ -28,10 +28,9 @@ namespace openspace { namespace gui { GuiComponent::GuiComponent(std::string name) - : _isEnabled("enabled", "Is Enabled", false) + : properties::PropertyOwner(std::move(name)) + , _isEnabled("enabled", "Is Enabled", false) { - setName(std::move(name)); - addProperty(_isEnabled); } diff --git a/modules/space/rendering/planetgeometry.cpp b/modules/space/rendering/planetgeometry.cpp index f847dc561c..4b2ed0653b 100644 --- a/modules/space/rendering/planetgeometry.cpp +++ b/modules/space/rendering/planetgeometry.cpp @@ -74,10 +74,9 @@ std::unique_ptr PlanetGeometry::createFromDictionary(const ghoul } PlanetGeometry::PlanetGeometry() - : _parent(nullptr) -{ - setName("PlanetGeometry"); -} + : properties::PropertyOwner("PlanetGeometry") + , _parent(nullptr) +{} PlanetGeometry::~PlanetGeometry() {} diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index dc08eda341..bc4da65ab8 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -140,7 +140,7 @@ OpenSpaceEngine::OpenSpaceEngine(std::string programName, , _downloadManager(nullptr) , _parallelConnection(new ParallelConnection) , _windowWrapper(std::move(windowWrapper)) - , _globalPropertyNamespace(new properties::PropertyOwner) + , _globalPropertyNamespace(new properties::PropertyOwner("")) , _runTime(0.0) , _shutdown({false, 0.f, 0.f}) , _isFirstRenderingFirstFrame(true) diff --git a/src/engine/settingsengine.cpp b/src/engine/settingsengine.cpp index 870b0d72db..cb25fa2d0f 100644 --- a/src/engine/settingsengine.cpp +++ b/src/engine/settingsengine.cpp @@ -46,15 +46,14 @@ namespace { namespace openspace { SettingsEngine::SettingsEngine() - : _eyeSeparation("eyeSeparation", "Eye Separation", 0.f, 0.f, 10.f) + : properties::PropertyOwner("Global Properties") + , _eyeSeparation("eyeSeparation", "Eye Separation", 0.f, 0.f, 10.f) , _scenes("scenes", "Scene", properties::OptionProperty::DisplayType::Dropdown) , _busyWaitForDecode("busyWaitForDecode", "Busy Wait for decode", false) , _logSGCTOutOfOrderErrors("logSGCTOutOfOrderErrors", "Log SGCT out-of-order", false) , _useDoubleBuffering("useDoubleBuffering", "Use double buffering", false) , _spiceUseExceptions("enableSpiceExceptions", "Enable Spice Exceptions", false) { - setName("Global Properties"); - _spiceUseExceptions.onChange([this] { if (_spiceUseExceptions) { SpiceManager::ref().setExceptionHandling(SpiceManager::UseException::Yes); diff --git a/src/interaction/interactionhandler.cpp b/src/interaction/interactionhandler.cpp index d347354629..0a76bf2f4b 100644 --- a/src/interaction/interactionhandler.cpp +++ b/src/interaction/interactionhandler.cpp @@ -72,15 +72,14 @@ namespace interaction { // InteractionHandler InteractionHandler::InteractionHandler() - : _origin("origin", "Origin", "") + : properties::PropertyOwner("Interaction") + , _origin("origin", "Origin", "") , _rotationalFriction("rotationalFriction", "Rotational Friction", true) , _horizontalFriction("horizontalFriction", "Horizontal Friction", true) , _verticalFriction("verticalFriction", "Vertical Friction", true) , _sensitivity("sensitivity", "Sensitivity", 0.5, 0.001, 1) , _rapidness("rapidness", "Rapidness", 1, 0.1, 60) { - setName("Interaction"); - _origin.onChange([this]() { SceneGraphNode* node = sceneGraphNode(_origin.value()); if (!node) { diff --git a/src/interaction/luaconsole.cpp b/src/interaction/luaconsole.cpp index 9139a24a95..ec77923ce7 100644 --- a/src/interaction/luaconsole.cpp +++ b/src/interaction/luaconsole.cpp @@ -48,14 +48,13 @@ namespace { namespace openspace { LuaConsole::LuaConsole() - : _isVisible("isVisible", "Is Visible", false) + : properties::PropertyOwner("LuaConsole") + , _isVisible("isVisible", "Is Visible", false) , _remoteScripting(true) , _inputPosition(0) , _activeCommand(0) , _autoCompleteInfo({NoAutoComplete, false, ""}) { - setName("LuaConsole"); - _isVisible.onChange([this](){ if (_isVisible) { _remoteScripting = false; diff --git a/src/properties/propertyowner.cpp b/src/properties/propertyowner.cpp index 09c9abc648..43f271a627 100644 --- a/src/properties/propertyowner.cpp +++ b/src/properties/propertyowner.cpp @@ -25,15 +25,16 @@ #include #include +#include #include -#include namespace openspace { namespace properties { namespace { -const std::string _loggerCat = "PropertyOwner"; + +const char* _loggerCat = "PropertyOwner"; bool propertyLess(Property* lhs, Property* rhs) { @@ -44,13 +45,12 @@ bool subOwnerLess(PropertyOwner* lhs, PropertyOwner* rhs) { return lhs->name() < rhs->name(); } -} +} // namespace -PropertyOwner::PropertyOwner() - : _name("") +PropertyOwner::PropertyOwner(std::string name) + : _name(std::move(name)) , _owner(nullptr) -{ -} +{} PropertyOwner::~PropertyOwner() { _properties.clear(); @@ -73,14 +73,20 @@ std::vector PropertyOwner::propertiesRecursive() const { } Property* PropertyOwner::property(const std::string& id) const { - assert(std::is_sorted(_properties.begin(), _properties.end(), propertyLess)); + ghoul_assert( + std::is_sorted(_properties.begin(), _properties.end(), propertyLess), + "Property list must be sorted" + ); // As the _properties list is sorted, just finding the lower bound is sufficient - std::vector::const_iterator it - = std::lower_bound(_properties.begin(), _properties.end(), id, - [](Property* prop, const std::string& str) { - return prop->identifier() < str; - }); + std::vector::const_iterator it = std::lower_bound( + _properties.begin(), + _properties.end(), + id, + [](Property* prop, const std::string& str) { + return prop->identifier() < str; + } + ); if (it == _properties.end() || (*it)->identifier() != id) { // if we do not own the searched property, it must consist of a concatenated @@ -118,19 +124,27 @@ std::vector PropertyOwner::propertySubOwners() const { } PropertyOwner* PropertyOwner::propertySubOwner(const std::string& name) const { - assert(std::is_sorted(_subOwners.begin(), _subOwners.end(), subOwnerLess)); + ghoul_assert( + std::is_sorted(_subOwners.begin(), _subOwners.end(), subOwnerLess), + "List of subowners must be sorted" + ); // As the _subOwners list is sorted, getting the lower bound is sufficient - std::vector::const_iterator it - = std::lower_bound(_subOwners.begin(), _subOwners.end(), name, - [](PropertyOwner* owner, const std::string& str) { - return owner->name() < str; - }); + std::vector::const_iterator it = std::lower_bound( + _subOwners.begin(), + _subOwners.end(), + name, + [](PropertyOwner* owner, const std::string& str) { + return owner->name() < str; + } + ); - if (it == _subOwners.end() || (*it)->name() != name) + if (it == _subOwners.end() || (*it)->name() != name) { return nullptr; - else + } + else { return *it; + } } bool PropertyOwner::hasPropertySubOwner(const std::string& name) const { @@ -143,17 +157,24 @@ void PropertyOwner::setPropertyGroupName(std::string groupID, std::string name) std::string PropertyOwner::propertyGroupName(const std::string& groupID) const { auto it = _groupNames.find(groupID); - if (it == _groupNames.end()) + if (it == _groupNames.end()) { return groupID; - else + } + else { return it->second; + } } -void PropertyOwner::addProperty(Property* prop) -{ - assert(prop != nullptr); - assert(std::is_sorted(_properties.begin(), _properties.end(), propertyLess)); - assert(std::is_sorted(_subOwners.begin(), _subOwners.end(), subOwnerLess)); +void PropertyOwner::addProperty(Property* prop) { + ghoul_assert(prop != nullptr, "prop must not be nullptr"); + ghoul_assert( + std::is_sorted(_properties.begin(), _properties.end(), propertyLess), + "Property list must be sorted" + ); + ghoul_assert( + std::is_sorted(_subOwners.begin(), _subOwners.end(), subOwnerLess), + "Subowner list must be sorted" + ); if (prop->identifier().empty()) { LERROR("No property identifier specified"); @@ -162,23 +183,25 @@ void PropertyOwner::addProperty(Property* prop) // See if we can find the identifier of the property to add in the properties list // The _properties list is sorted, so getting the lower bound is sufficient - std::vector::iterator it - = std::lower_bound(_properties.begin(), _properties.end(), prop->identifier(), - [](Property* prop, const std::string& str) { - return prop->identifier() < str; - }); + std::vector::iterator it = std::lower_bound( + _properties.begin(), + _properties.end(), + prop->identifier(), + [](Property* prop, const std::string& str) { + return prop->identifier() < str; + } + ); // If we found the property identifier, we need to bail out if (it != _properties.end() && (*it)->identifier() == prop->identifier()) { - LERROR("Property identifier '" << prop->identifier() - << "' already present in PropertyOwner '" - << name() << "'"); + LERROR("Property identifier '" << prop->identifier() << + "' already present in PropertyOwner '" << name() << "'"); return; } else { // Otherwise we still have to look if there is a PropertyOwner with the same name const bool hasOwner = hasPropertySubOwner(prop->identifier()); if (hasOwner) { - LERROR("Property identifier '" << prop->identifier() << "' already names a" + LERROR("Property identifier '" << prop->identifier() << "' already names a " << "registed PropertyOwner"); return; } @@ -195,26 +218,30 @@ void PropertyOwner::addProperty(Property& prop) { } void PropertyOwner::addPropertySubOwner(openspace::properties::PropertyOwner* owner) { - assert(owner != nullptr); - assert(std::is_sorted(_properties.begin(), _properties.end(), propertyLess)); - assert(std::is_sorted(_subOwners.begin(), _subOwners.end(), subOwnerLess)); + ghoul_assert(owner != nullptr, "owner must not be nullptr"); + ghoul_assert( + std::is_sorted(_properties.begin(), _properties.end(), propertyLess), + "Property list must be sorted" + ); + ghoul_assert( + std::is_sorted(_subOwners.begin(), _subOwners.end(), subOwnerLess), + "Subowner list must be sorted" + ); - if (owner->name().empty()) { - LERROR("PropertyOwner did not have a name"); - return; - } + ghoul_assert(!owner->name().empty(), "PropertyOwner must have a name"); // See if we can find the name of the propertyowner to add using the lower bound - std::vector::iterator it - = std::lower_bound(_subOwners.begin(), _subOwners.end(), owner->name(), - [](PropertyOwner* owner, const std::string& str) { - return owner->name() < str; - }); + std::vector::iterator it = std::lower_bound( + _subOwners.begin(), _subOwners.end(), owner->name(), + [](PropertyOwner* owner, const std::string& str) { + return owner->name() < str; + } + ); // If we found the propertyowner's name, we need to bail out if (it != _subOwners.end() && (*it)->name() == owner->name()) { - LERROR("PropertyOwner '" << owner->name() - << "' already present in PropertyOwner '" << name() << "'"); + LERROR("PropertyOwner '" << owner->name() << + "' already present in PropertyOwner '" << name() << "'"); return; } else { // We still need to check if the PropertyOwners name is used in a Property @@ -230,7 +257,6 @@ void PropertyOwner::addPropertySubOwner(openspace::properties::PropertyOwner* ow owner->setPropertyOwner(this); } } - } void PropertyOwner::addPropertySubOwner(openspace::properties::PropertyOwner& owner) { @@ -238,22 +264,26 @@ void PropertyOwner::addPropertySubOwner(openspace::properties::PropertyOwner& ow } void PropertyOwner::removeProperty(Property* prop) { - assert(prop != nullptr); + ghoul_assert(prop != nullptr, "prop must not be nullptr"); // See if we can find the identifier of the property to add in the properties list - std::vector::iterator it - = std::lower_bound(_properties.begin(), _properties.end(), prop->identifier(), - [](Property* prop, const std::string& str) { - return prop->identifier() < str; - }); + std::vector::iterator it = std::lower_bound( + _properties.begin(), + _properties.end(), + prop->identifier(), + [](Property* prop, const std::string& str) { + return prop->identifier() < str; + } + ); // If we found the property identifier, we can delete it if (it != _properties.end() && (*it)->identifier() == prop->identifier()) { (*it)->setPropertyOwner(nullptr); _properties.erase(it); - } else - LERROR("Property with identifier '" << prop->identifier() - << "' not found for removal."); + } else { + LERROR("Property with identifier '" << prop->identifier() << + "' not found for removal."); + } } void PropertyOwner::removeProperty(Property& prop) { @@ -261,21 +291,25 @@ void PropertyOwner::removeProperty(Property& prop) { } void PropertyOwner::removePropertySubOwner(openspace::properties::PropertyOwner* owner) { - assert(owner != nullptr); + ghoul_assert(owner != nullptr, "owner must not be nullptr"); // See if we can find the name of the propertyowner to add - std::vector::iterator it - = std::lower_bound(_subOwners.begin(), _subOwners.end(), owner->name(), - [](PropertyOwner* owner, const std::string& str) { - return owner->name() < str; - }); + std::vector::iterator it = std::lower_bound( + _subOwners.begin(), + _subOwners.end(), + owner->name(), + [](PropertyOwner* owner, const std::string& str) { + return owner->name() < str; + } + ); // If we found the propertyowner, we can delete it if (it != _subOwners.end() && (*it)->name() == owner->name()) { _subOwners.erase(it); - } else - LERROR("PropertyOwner with name '" << owner->name() - << "' not found for removal."); + } else { + LERROR("PropertyOwner with name '" << owner->name() << + "' not found for removal."); + } } void PropertyOwner::removePropertySubOwner(openspace::properties::PropertyOwner& owner) { diff --git a/src/rendering/renderable.cpp b/src/rendering/renderable.cpp index 6795842a01..4725e220c9 100644 --- a/src/rendering/renderable.cpp +++ b/src/rendering/renderable.cpp @@ -88,7 +88,8 @@ std::unique_ptr Renderable::createFromDictionary( } Renderable::Renderable() - : _enabled("enabled", "Is Enabled", true) + : properties::PropertyOwner("renderable") + , _enabled("enabled", "Is Enabled", true) , _renderBin(RenderBin::Opaque) , _startTime("") , _endTime("") @@ -96,14 +97,13 @@ Renderable::Renderable() {} Renderable::Renderable(const ghoul::Dictionary& dictionary) - : _enabled("enabled", "Is Enabled", true) + : properties::PropertyOwner("renderable") + , _enabled("enabled", "Is Enabled", true) , _renderBin(RenderBin::Opaque) , _startTime("") , _endTime("") , _hasTimeInterval(false) { - setName("renderable"); - ghoul_assert( dictionary.hasKeyAndValue(SceneGraphNode::KeyName), "SceneGraphNode must specify '" << SceneGraphNode::KeyName << "'" diff --git a/src/rendering/renderengine.cpp b/src/rendering/renderengine.cpp index 06a23bb9ff..d0c368d936 100644 --- a/src/rendering/renderengine.cpp +++ b/src/rendering/renderengine.cpp @@ -92,7 +92,8 @@ namespace { namespace openspace { RenderEngine::RenderEngine() - : _mainCamera(nullptr) + : properties::PropertyOwner("RenderEngine") + , _mainCamera(nullptr) , _raycasterManager(nullptr) , _performanceMeasurements("performanceMeasurements", "Performance Measurements") , _frametimeType( @@ -119,8 +120,6 @@ RenderEngine::RenderEngine() , _fadeDirection(0) , _frameNumber(0) { - setName("RenderEngine"); - _performanceMeasurements.onChange([this](){ if (_performanceMeasurements) { if (!_performanceManager) { diff --git a/src/rendering/screenspacerenderable.cpp b/src/rendering/screenspacerenderable.cpp index 23b0885dd9..cc89ab046d 100644 --- a/src/rendering/screenspacerenderable.cpp +++ b/src/rendering/screenspacerenderable.cpp @@ -97,7 +97,8 @@ std::unique_ptr ScreenSpaceRenderable::createFromDictiona } ScreenSpaceRenderable::ScreenSpaceRenderable(const ghoul::Dictionary& dictionary) - : _enabled("enabled", "Is Enabled", true) + : properties::PropertyOwner("") + , _enabled("enabled", "Is Enabled", true) , _useFlatScreen("flatScreen", "Flat Screen", true) , _euclideanPosition( "euclideanPosition", @@ -130,14 +131,15 @@ ScreenSpaceRenderable::ScreenSpaceRenderable(const ghoul::Dictionary& dictionary addProperty(_alpha); addProperty(_delete); - dictionary.getValue(KeyFlatScreen, _useFlatScreen); useEuclideanCoordinates(_useFlatScreen); - if (_useFlatScreen) + if (_useFlatScreen) { dictionary.getValue(KeyPosition, _euclideanPosition); - else + } + else { dictionary.getValue(KeyPosition, _sphericalPosition); + } dictionary.getValue(KeyScale, _scale); diff --git a/src/scene/rotation.cpp b/src/scene/rotation.cpp index 2db6ee1068..413a41354e 100644 --- a/src/scene/rotation.cpp +++ b/src/scene/rotation.cpp @@ -72,11 +72,13 @@ std::unique_ptr Rotation::createFromDictionary(const ghoul::Dictionary return result; } -Rotation::Rotation() { - setName("Rotation"); -} +Rotation::Rotation() + : properties::PropertyOwner("Rotation") +{} -Rotation::Rotation(const ghoul::Dictionary& dictionary) {} +Rotation::Rotation(const ghoul::Dictionary& dictionary) + : properties::PropertyOwner("Rotation") +{} Rotation::~Rotation() {} diff --git a/src/scene/scale.cpp b/src/scene/scale.cpp index 5f2e7dfccc..868499f3b8 100644 --- a/src/scene/scale.cpp +++ b/src/scene/scale.cpp @@ -76,6 +76,10 @@ std::unique_ptr Scale::createFromDictionary(const ghoul::Dictionary& dict return result; } +Scale::Scale() + : properties::PropertyOwner("Scale") +{} + Scale::~Scale() {} bool Scale::initialize() { diff --git a/src/scene/scenegraphnode.cpp b/src/scene/scenegraphnode.cpp index d27c0164f9..d19effd97b 100644 --- a/src/scene/scenegraphnode.cpp +++ b/src/scene/scenegraphnode.cpp @@ -145,7 +145,8 @@ SceneGraphNode* SceneGraphNode::createFromDictionary(const ghoul::Dictionary& di } SceneGraphNode::SceneGraphNode() - : _parent(nullptr) + : properties::PropertyOwner("") + , _parent(nullptr) , _transform { std::make_unique(), std::make_unique(), diff --git a/src/scene/translation.cpp b/src/scene/translation.cpp index fd54a65e93..2272f5bb40 100644 --- a/src/scene/translation.cpp +++ b/src/scene/translation.cpp @@ -80,6 +80,10 @@ std::unique_ptr Translation::createFromDictionary( return result; } +Translation::Translation() + : properties::PropertyOwner("Translation") +{} + Translation::~Translation() {} bool Translation::initialize() { diff --git a/src/util/openspacemodule.cpp b/src/util/openspacemodule.cpp index ef9a56d386..b4ef33b833 100644 --- a/src/util/openspacemodule.cpp +++ b/src/util/openspacemodule.cpp @@ -38,11 +38,9 @@ namespace { namespace openspace { -OpenSpaceModule::OpenSpaceModule(std::string name) { - ghoul_assert(!name.empty(), "Name must not be empty"); - - setName(std::move(name)); -} +OpenSpaceModule::OpenSpaceModule(std::string name) + : properties::PropertyOwner(std::move(name)) +{} void OpenSpaceModule::initialize() { std::string upperName = name(); From fb67e805ac5656b8ba2b8a4196e053ca116e2203 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Thu, 2 Mar 2017 19:50:05 -0500 Subject: [PATCH 83/96] Various cleanup Add script that counts the number of includes --- include/openspace/properties/property.h | 16 ++--- include/openspace/properties/propertyowner.h | 3 +- include/openspace/rendering/abufferrenderer.h | 16 ++--- modules/space/rendering/planetgeometry.h | 4 ++ src/engine/openspaceengine.cpp | 16 ----- src/properties/property.cpp | 32 ++++----- src/properties/propertyowner.cpp | 18 ++--- support/coding/count_includes.py | 65 +++++++++++++++++++ 8 files changed, 112 insertions(+), 58 deletions(-) create mode 100644 support/coding/count_includes.py diff --git a/include/openspace/properties/property.h b/include/openspace/properties/property.h index 80b224bf76..4f40070f44 100644 --- a/include/openspace/properties/property.h +++ b/include/openspace/properties/property.h @@ -314,10 +314,10 @@ public: * Property::ViewOptions::PowerScaledCoordinate = powerScaledCoordinate. */ struct ViewOptions { - static const std::string Color; - static const std::string LightPosition; - static const std::string PowerScaledScalar; - static const std::string PowerScaledCoordinate; + static const char* Color; + static const char* LightPosition; + static const char* PowerScaledScalar; + static const char* PowerScaledCoordinate; }; /** @@ -329,10 +329,10 @@ public: const ghoul::Dictionary& metaData() const; protected: - static const std::string IdentifierKey; - static const std::string NameKey; - static const std::string TypeKey; - static const std::string MetaDataKey; + static const char* IdentifierKey; + static const char* NameKey; + static const char* TypeKey; + static const char* MetaDataKey; /** * Creates the information that is general to every Property and adds the diff --git a/include/openspace/properties/propertyowner.h b/include/openspace/properties/propertyowner.h index 56a69783bb..e26af2db6f 100644 --- a/include/openspace/properties/propertyowner.h +++ b/include/openspace/properties/propertyowner.h @@ -25,7 +25,6 @@ #ifndef __OPENSPACE_CORE___PROPERTYOWNER___H__ #define __OPENSPACE_CORE___PROPERTYOWNER___H__ -#include #include #include #include @@ -33,6 +32,8 @@ namespace openspace { namespace properties { +class Property; + /** * A PropertyOwner can own Propertys or other PropertyOwner and provide access to both in * a unified way. The identifiers and names of Propertys and diff --git a/include/openspace/rendering/abufferrenderer.h b/include/openspace/rendering/abufferrenderer.h index 042c0380dd..798a1373a8 100644 --- a/include/openspace/rendering/abufferrenderer.h +++ b/include/openspace/rendering/abufferrenderer.h @@ -43,14 +43,14 @@ namespace ghoul { - namespace filesystem { - class File; - } - namespace opengl { - class ProgramObject; - class Texture; - } -} +namespace filesystem { class File; } + +namespace opengl { + class ProgramObject; + class Texture; +} // namepsace opengl + +} // namespace ghoul namespace openspace { diff --git a/modules/space/rendering/planetgeometry.h b/modules/space/rendering/planetgeometry.h index eae02b77d1..98b93841c9 100644 --- a/modules/space/rendering/planetgeometry.h +++ b/modules/space/rendering/planetgeometry.h @@ -27,6 +27,10 @@ #include +#include + +namespace ghoul { class Dictionary; } + namespace openspace { class Renderable; diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index bc4da65ab8..6ec3200fe1 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -27,7 +27,6 @@ #include #include -#include #include #include #include @@ -38,13 +37,8 @@ #include #include #include -#include #include -#include #include -#include -#include -#include #include #include #include @@ -55,28 +49,18 @@ #include #include #include -#include #include #include #include #include #include -#include #include #include #include #include -#include -#include -#include -#include -#include -#include #include -#include -#include #if defined(_MSC_VER) && defined(OPENSPACE_ENABLE_VLD) #include diff --git a/src/properties/property.cpp b/src/properties/property.cpp index 6b495248aa..a70540dea4 100644 --- a/src/properties/property.cpp +++ b/src/properties/property.cpp @@ -32,24 +32,24 @@ namespace openspace { namespace properties { namespace { - const std::string _loggerCat = "Property"; - const std::string MetaDataKeyGuiName = "guiName"; - const std::string MetaDataKeyGroup = "Group"; - const std::string MetaDataKeyVisibility = "Visibility"; - const std::string MetaDataKeyReadOnly = "isReadOnly"; + const char* _loggerCat = "Property"; + const char* MetaDataKeyGuiName = "guiName"; + const char* MetaDataKeyGroup = "Group"; + const char* MetaDataKeyVisibility = "Visibility"; + const char* MetaDataKeyReadOnly = "isReadOnly"; - const std::string _metaDataKeyViewPrefix = "view."; + const char* _metaDataKeyViewPrefix = "view."; } -const std::string Property::ViewOptions::Color = "color"; -const std::string Property::ViewOptions::LightPosition = "lightPosition"; -const std::string Property::ViewOptions::PowerScaledCoordinate = "powerScaledCoordinate"; -const std::string Property::ViewOptions::PowerScaledScalar = "powerScaledScalar"; +const char* Property::ViewOptions::Color = "color"; +const char* Property::ViewOptions::LightPosition = "lightPosition"; +const char* Property::ViewOptions::PowerScaledCoordinate = "powerScaledCoordinate"; +const char* Property::ViewOptions::PowerScaledScalar = "powerScaledScalar"; -const std::string Property::IdentifierKey = "Identifier"; -const std::string Property::NameKey = "Name"; -const std::string Property::TypeKey = "Type"; -const std::string Property::MetaDataKey = "MetaData"; +const char* Property::IdentifierKey = "Identifier"; +const char* Property::NameKey = "Name"; +const char* Property::TypeKey = "Type"; +const char* Property::MetaDataKey = "MetaData"; Property::Property(std::string identifier, std::string guiName, Visibility visibility) : _owner(nullptr) @@ -181,7 +181,7 @@ void Property::notifyListener() { std::string Property::generateBaseDescription() const { return - TypeKey + " = \"" + className() + "\", " + + std::string(TypeKey) + " = \"" + className() + "\", " + IdentifierKey + " = \"" + fullyQualifiedIdentifier() + "\", " + NameKey + " = \"" + guiName() + "\", " + generateMetaDataDescription() + ", " + @@ -201,7 +201,7 @@ std::string Property::generateMetaDataDescription() const { std::string vis = VisibilityConverter.at(visibility); return - MetaDataKey + " = {" + + std::string(MetaDataKey) + " = {" + MetaDataKeyGroup + " = '" + groupIdentifier() + "'," + MetaDataKeyVisibility + " = " + vis + "," + MetaDataKeyReadOnly +" = " + (isReadOnly ? "true" : "false") + "}"; diff --git a/src/properties/propertyowner.cpp b/src/properties/propertyowner.cpp index 43f271a627..e45cd9279f 100644 --- a/src/properties/propertyowner.cpp +++ b/src/properties/propertyowner.cpp @@ -24,6 +24,7 @@ #include +#include #include #include @@ -33,17 +34,16 @@ namespace openspace { namespace properties { namespace { + const char* _loggerCat = "PropertyOwner"; -const char* _loggerCat = "PropertyOwner"; - -bool propertyLess(Property* lhs, Property* rhs) -{ - return lhs->identifier() < rhs->identifier(); -} + bool propertyLess(Property* lhs, Property* rhs) + { + return lhs->identifier() < rhs->identifier(); + } -bool subOwnerLess(PropertyOwner* lhs, PropertyOwner* rhs) { - return lhs->name() < rhs->name(); -} + bool subOwnerLess(PropertyOwner* lhs, PropertyOwner* rhs) { + return lhs->name() < rhs->name(); + } } // namespace diff --git a/support/coding/count_includes.py b/support/coding/count_includes.py new file mode 100644 index 0000000000..98465a57f3 --- /dev/null +++ b/support/coding/count_includes.py @@ -0,0 +1,65 @@ +""" +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. + +This file takes the output of compiling in Visual Studio with /showIncludes enabled and +counts the number of times that each header file is included (excluding system headers). +This gives an indicator as to which header files can be made more efficient the most +efficiently + +The script requires one argument, which is the text file of one or many runs of the +Visual Studio compiler +""" + +import sys + +if len(sys.argv) != 2: + print("Usage: count_includes.py Date: Thu, 2 Mar 2017 19:53:55 -0500 Subject: [PATCH 84/96] Update include finding script --- support/coding/count_includes.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/support/coding/count_includes.py b/support/coding/count_includes.py index 98465a57f3..5fc22f883e 100644 --- a/support/coding/count_includes.py +++ b/support/coding/count_includes.py @@ -44,12 +44,13 @@ with open(file) as f: lines = [l for l in lines if "Note: including file" in l] # Prefix to remove from each line an - prefix = "X> Note: including file:" - lines = [l[len(prefix):-1].strip() for l in lines] + prefix = "> Note: including file:" + lines = [l[l.find(prefix) + len(prefix):-1].strip() for l in lines] # Remove system header lines = [l for l in lines if "windows kits" not in l.lower()] lines = [l for l in lines if "microsoft visual studio " not in l.lower()] + lines = [l for l in lines if "boost\\include\\boost-" not in l.lower()] # Remove external headers lines = [l for l in lines if "ghoul\\ext\\" not in l.lower()] From 9d30d3323b50f320d098f31a82d7d6dfd541cdf0 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Fri, 3 Mar 2017 10:55:20 -0500 Subject: [PATCH 85/96] Update Ghoul repository Adapt to changed signature of ghoul_assert macro --- ext/ghoul | 2 +- include/openspace/documentation/verifier.inl | 1 + modules/globebrowsing/meshes/basicgrid.cpp | 7 +++++-- modules/globebrowsing/tile/tileindex.cpp | 2 ++ .../tile/tileprovider/temporaltileprovider.cpp | 2 +- modules/space/rendering/renderableplanet.cpp | 7 +++++-- src/documentation/documentationengine.cpp | 1 + src/engine/downloadmanager.cpp | 5 ++++- src/rendering/renderable.cpp | 2 +- src/util/factorymanager.cpp | 15 ++++++++------- 10 files changed, 29 insertions(+), 15 deletions(-) diff --git a/ext/ghoul b/ext/ghoul index f7fcee5973..e0cbca16ad 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit f7fcee5973052efc94d499496d472316f56e225a +Subproject commit e0cbca16ad71700cf82d0d24bcf4fc14bded10ea diff --git a/include/openspace/documentation/verifier.inl b/include/openspace/documentation/verifier.inl index 7256f9473a..70751ac380 100644 --- a/include/openspace/documentation/verifier.inl +++ b/include/openspace/documentation/verifier.inl @@ -25,6 +25,7 @@ #include #include +#include namespace std { std::string to_string(std::string value); diff --git a/modules/globebrowsing/meshes/basicgrid.cpp b/modules/globebrowsing/meshes/basicgrid.cpp index 88d33512d6..7bd91dea3d 100644 --- a/modules/globebrowsing/meshes/basicgrid.cpp +++ b/modules/globebrowsing/meshes/basicgrid.cpp @@ -64,8 +64,11 @@ int BasicGrid::ySegments() const { } void BasicGrid::validate(int xSegments, int ySegments) { - ghoul_assert(xSegments > 0 && ySegments > 0, - "Resolution must be at least 1x1. (" << xSegments << ", " << ySegments << ")"); + ghoul_assert( + xSegments > 0 && ySegments > 0, + std::string("Resolution must be at least 1x1. (") + + std::to_string(xSegments) + ", " + std::to_string(ySegments) + ")" + ); } inline size_t BasicGrid::numElements(int xSegments, int ySegments) { diff --git a/modules/globebrowsing/tile/tileindex.cpp b/modules/globebrowsing/tile/tileindex.cpp index 44d0ef8b44..f5ca66ab3a 100644 --- a/modules/globebrowsing/tile/tileindex.cpp +++ b/modules/globebrowsing/tile/tileindex.cpp @@ -28,6 +28,8 @@ #include +#include + namespace { const char* KeyLevel = "Level"; const char* KeyX = "X"; diff --git a/modules/globebrowsing/tile/tileprovider/temporaltileprovider.cpp b/modules/globebrowsing/tile/tileprovider/temporaltileprovider.cpp index 7e5e213611..8e8024872d 100644 --- a/modules/globebrowsing/tile/tileprovider/temporaltileprovider.cpp +++ b/modules/globebrowsing/tile/tileprovider/temporaltileprovider.cpp @@ -287,7 +287,7 @@ TimeFormat* TimeIdProviderFactory::getProvider(const std::string& format) { } ghoul_assert( _timeIdProviderMap.find(format) != _timeIdProviderMap.end(), - "Unsupported Time format: " << format + "Unsupported Time format: " + format ); return _timeIdProviderMap[format].get(); } diff --git a/modules/space/rendering/renderableplanet.cpp b/modules/space/rendering/renderableplanet.cpp index cceedf0122..a5a9e7a691 100644 --- a/modules/space/rendering/renderableplanet.cpp +++ b/modules/space/rendering/renderableplanet.cpp @@ -83,8 +83,11 @@ RenderablePlanet::RenderablePlanet(const ghoul::Dictionary& dictionary) { std::string name; bool success = dictionary.getValue(SceneGraphNode::KeyName, name); - ghoul_assert(success, - "RenderablePlanet need the '" << SceneGraphNode::KeyName<<"' be specified"); + ghoul_assert( + success, + std::string("RenderablePlanet need the '") + SceneGraphNode::KeyName + + "' be specified" + ); ghoul::Dictionary geometryDictionary; success = dictionary.getValue(keyGeometry, geometryDictionary); diff --git a/src/documentation/documentationengine.cpp b/src/documentation/documentationengine.cpp index 5ce0311aea..2f90737a73 100644 --- a/src/documentation/documentationengine.cpp +++ b/src/documentation/documentationengine.cpp @@ -31,6 +31,7 @@ #include #include +#include #include #include diff --git a/src/engine/downloadmanager.cpp b/src/engine/downloadmanager.cpp index 8c57588f6b..42d6c7afac 100644 --- a/src/engine/downloadmanager.cpp +++ b/src/engine/downloadmanager.cpp @@ -162,7 +162,10 @@ std::shared_ptr DownloadManager::downloadFile( std::shared_ptr future = std::make_shared(file.filename()); errno = 0; FILE* fp = fopen(file.path().c_str(), "wb"); // write binary - ghoul_assert(fp != nullptr, "Could not open/create file:\n" << file.path().c_str() << " \nerrno: " << errno); + ghoul_assert( + fp != nullptr, + "Could not open/create file:\n" + file.path() + " \nerrno: " + std::to_string(errno) + ); //LDEBUG("Start downloading file: '" << url << "' into file '" << file.path() << "'"); diff --git a/src/rendering/renderable.cpp b/src/rendering/renderable.cpp index 4725e220c9..ab22ebe710 100644 --- a/src/rendering/renderable.cpp +++ b/src/rendering/renderable.cpp @@ -106,7 +106,7 @@ Renderable::Renderable(const ghoul::Dictionary& dictionary) { ghoul_assert( dictionary.hasKeyAndValue(SceneGraphNode::KeyName), - "SceneGraphNode must specify '" << SceneGraphNode::KeyName << "'" + std::string("SceneGraphNode must specify '") + SceneGraphNode::KeyName + "'" ); dictionary.getValue(keyStart, _startTime); diff --git a/src/util/factorymanager.cpp b/src/util/factorymanager.cpp index 404d80a4f8..3c13b6fcc8 100644 --- a/src/util/factorymanager.cpp +++ b/src/util/factorymanager.cpp @@ -30,15 +30,16 @@ #include #include +#include namespace { - const std::string MainTemplateFilename = "${OPENSPACE_DATA}/web/factories/main.hbs"; - const std::string FactoryTemplateFilename = "${OPENSPACE_DATA}/web/factories/factory.hbs"; - const std::string HandlebarsFilename = "${OPENSPACE_DATA}/web/common/handlebars-v4.0.5.js"; - const std::string JsFilename = "${OPENSPACE_DATA}/web/factories/script.js"; - const std::string BootstrapFilename = "${OPENSPACE_DATA}/web/common/bootstrap.min.css"; - const std::string CssFilename = "${OPENSPACE_DATA}/web/common/style.css"; -} + const char* MainTemplateFilename = "${OPENSPACE_DATA}/web/factories/main.hbs"; + const char* FactoryTemplateFilename = "${OPENSPACE_DATA}/web/factories/factory.hbs"; + const char* HandlebarsFilename = "${OPENSPACE_DATA}/web/common/handlebars-v4.0.5.js"; + const char* JsFilename = "${OPENSPACE_DATA}/web/factories/script.js"; + const char* BootstrapFilename = "${OPENSPACE_DATA}/web/common/bootstrap.min.css"; + const char* CssFilename = "${OPENSPACE_DATA}/web/common/style.css"; +} // namespace namespace openspace { From b32c416615653fe1787a95c551389ca953766327 Mon Sep 17 00:00:00 2001 From: Emil Axelsson Date: Fri, 3 Mar 2017 17:39:23 +0100 Subject: [PATCH 86/96] Improvements from code review --- Jenkinsfile | 6 +- include/openspace/util/distanceconstants.h | 51 +++++++++------- include/openspace/util/task.h | 48 +++++++-------- include/openspace/util/taskloader.h | 30 ++++++++- .../galaxy/tasks/milkywayconversiontask.cpp | 22 +++++-- .../tasks/milkywaypointsconversiontask.cpp | 3 +- modules/kameleonvolume/CMakeLists.txt | 2 +- .../kameleonvolume/kameleonvolumemodule.cpp | 2 +- modules/kameleonvolume/kameleonvolumemodule.h | 8 +-- .../kameleonvolume/kameleonvolumereader.cpp | 53 +++++++++------- modules/kameleonvolume/kameleonvolumereader.h | 20 +++--- .../rendering/kameleonvolumeraycaster.cpp | 15 +++-- .../rendering/kameleonvolumeraycaster.h | 11 ++-- .../rendering/renderablekameleonvolume.cpp | 61 ++++++++++++------- .../rendering/renderablekameleonvolume.h | 11 ++-- modules/kameleonvolume/shaders/boundsfs.glsl | 2 +- modules/kameleonvolume/shaders/boundsvs.glsl | 10 +-- modules/kameleonvolume/shaders/helper.glsl | 31 ++++++++-- modules/kameleonvolume/shaders/raycast.glsl | 2 +- .../tasks/kameleondocumentationtask.cpp | 33 +++++----- .../tasks/kameleondocumentationtask.h | 11 ++-- .../tasks/kameleonmetadatatojsontask.cpp | 6 +- .../tasks/kameleonmetadatatojsontask.h | 11 ++-- modules/volume/rendering/volumeclipplane.cpp | 10 ++- modules/volume/rendering/volumeclipplanes.cpp | 16 ++--- modules/volume/volumegridtype.h | 46 +++++++------- shaders/framebuffer/inside.glsl | 4 +- src/util/task.cpp | 44 ++++++------- src/util/taskloader.cpp | 50 ++++++++------- src/util/transformationmanager.cpp | 1 + 30 files changed, 348 insertions(+), 272 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0328f80400..57ff97f0f2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -31,7 +31,7 @@ stage('Build') { sh ''' mkdir -p build cd build - cmake ''' + + cmake .. ''' + flags + ''' .. make ''' @@ -44,7 +44,7 @@ stage('Build') { git submodule update --init --recursive if not exist "build" mkdir "build" cd build - cmake -G "Visual Studio 14 2015 Win64" ''' + + cmake -G "Visual Studio 14 2015 Win64" .. ''' + flags + ''' .. msbuild.exe OpenSpace.sln /m:8 /p:Configuration=Debug ''' @@ -65,7 +65,7 @@ stage('Build') { mkdir ${srcDir}/build fi cd ${srcDir}/build - /Applications/CMake.app/Contents/bin/cmake -G Xcode -D NASM=/usr/local/Cellar/nasm/2.11.08/bin/nasm ${srcDir} ''' + + /Applications/CMake.app/Contents/bin/cmake -G Xcode -D NASM=/usr/local/Cellar/nasm/2.11.08/bin/nasm ${srcDir} .. ''' + flags + ''' xcodebuild ''' diff --git a/include/openspace/util/distanceconstants.h b/include/openspace/util/distanceconstants.h index e9bf243f2d..a7a368f7ba 100644 --- a/include/openspace/util/distanceconstants.h +++ b/include/openspace/util/distanceconstants.h @@ -1,26 +1,29 @@ /***************************************************************************************** -* * -* 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. * + ****************************************************************************************/ + +#ifndef __OPENSPACE_CORE___DISTANCECONSTANTS___H__ +#define __OPENSPACE_CORE___DISTANCECONSTANTS___H__ namespace openspace { @@ -31,4 +34,6 @@ namespace distanceconstants { const float Parsec = 3.0856776E16; } -} \ No newline at end of file +} + +#endif // __OPENSPACE_CORE___DISTANCECONSTANTS___H__ diff --git a/include/openspace/util/task.h b/include/openspace/util/task.h index 50c36df171..23844f8dfe 100644 --- a/include/openspace/util/task.h +++ b/include/openspace/util/task.h @@ -1,26 +1,26 @@ /***************************************************************************************** -* * -* 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. * + ****************************************************************************************/ #ifndef __OPENSPACE_CORE___TASK___H__ #define __OPENSPACE_CORE___TASK___H__ @@ -42,6 +42,6 @@ public: static documentation::Documentation documentation(); }; -} +} // namespace openspace -#endif +#endif // __OPENSPACE_CORE___TASK___H__ diff --git a/include/openspace/util/taskloader.h b/include/openspace/util/taskloader.h index 7982ed667e..4b4bf18c6a 100644 --- a/include/openspace/util/taskloader.h +++ b/include/openspace/util/taskloader.h @@ -1,5 +1,29 @@ -#ifndef __TASKRUNNER_H__ -#define __TASKRUNNER_H__ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +#ifndef __OPENSPACE_CORE___TASKLOADER___H__ +#define __OPENSPACE_CORE___TASKLOADER___H__ #include #include @@ -14,4 +38,4 @@ public: } -#endif +#endif // __OPENSPACE_CORE___TASKLOADER___H__ diff --git a/modules/galaxy/tasks/milkywayconversiontask.cpp b/modules/galaxy/tasks/milkywayconversiontask.cpp index 3224a25a27..9dfd7fef38 100644 --- a/modules/galaxy/tasks/milkywayconversiontask.cpp +++ b/modules/galaxy/tasks/milkywayconversiontask.cpp @@ -27,36 +27,46 @@ #include #include +namespace { + char* KeyInFilenamePrefix = "InFilenamePrefix"; + char* KeyInFilenameSuffix = "InFilenameSuffix"; + char* KeyInFirstIndex = "InFirstIndex"; + char* KeyInNSlices = "InNSlices"; + char* KeyOutFilename = "OutFilename"; + char* KeyOutDimensions = "OutDimensions"; +} + + namespace openspace { MilkywayConversionTask::MilkywayConversionTask(const ghoul::Dictionary& dictionary) { std::string inFilenamePrefix; - if (dictionary.getValue("InFilenamePrefix", inFilenamePrefix)) { + if (dictionary.getValue(KeyInFilenamePrefix, inFilenamePrefix)) { _inFilenamePrefix = inFilenamePrefix; } std::string inFilenamePrefix; - if (dictionary.getValue("InFilenameSuffix", inFilenameSuffix)) { + if (dictionary.getValue(KeyInFilenameSuffix, inFilenameSuffix)) { _inFilenameSuffix = inFilenameSuffix; } size_t inFirstIndex; - if (dictionary.getValue("InFirstIndex", inFirstIndex)) { + if (dictionary.getValue(KeyInFirstIndex, inFirstIndex)) { _inFirstIndex = inFirstIndex; } size_t inNSlices; - if (dictionary.getValue("InNSlices", inNSlices)) { + if (dictionary.getValue(KeyInNSlices, inNSlices)) { _inNSlices = inNSlices; } std::string outFilename; - if (dictionary.getValue("OutFilename", outFilename)) { + if (dictionary.getValue(KeyOutFilename, outFilename)) { _outFilename = outFilename; } glm::ivec3 outDimensions; - if (dictionary.getValue("OutDimensions", outDimensions)) { + if (dictionary.getValue(KeyOutDimensions, outDimensions)) { _outDimensions = outDimensions; } } diff --git a/modules/galaxy/tasks/milkywaypointsconversiontask.cpp b/modules/galaxy/tasks/milkywaypointsconversiontask.cpp index d06c8a0f56..ae9891d68f 100644 --- a/modules/galaxy/tasks/milkywaypointsconversiontask.cpp +++ b/modules/galaxy/tasks/milkywaypointsconversiontask.cpp @@ -28,6 +28,7 @@ #include #include #include +#include namespace openspace { @@ -56,7 +57,7 @@ void MilkywayPointsConversionTask::perform(const Task::ProgressCallback & progre size_t nFloats = nPoints * 7; - float* pointData = new float[nFloats]; + std::vector pointData(nFloats); float x, y, z, r, g, b, a; for (size_t i = 0; i < nPoints; ++i) { diff --git a/modules/kameleonvolume/CMakeLists.txt b/modules/kameleonvolume/CMakeLists.txt index 9e574540f4..b2321582fe 100644 --- a/modules/kameleonvolume/CMakeLists.txt +++ b/modules/kameleonvolume/CMakeLists.txt @@ -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 # diff --git a/modules/kameleonvolume/kameleonvolumemodule.cpp b/modules/kameleonvolume/kameleonvolumemodule.cpp index e1cb163aad..c521538492 100644 --- a/modules/kameleonvolume/kameleonvolumemodule.cpp +++ b/modules/kameleonvolume/kameleonvolumemodule.cpp @@ -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 * diff --git a/modules/kameleonvolume/kameleonvolumemodule.h b/modules/kameleonvolume/kameleonvolumemodule.h index dfed7b9138..adae6f1320 100644 --- a/modules/kameleonvolume/kameleonvolumemodule.h +++ b/modules/kameleonvolume/kameleonvolumemodule.h @@ -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,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_KAMELEONVOLUME___BASEMODULE___H__ -#define __OPENSPACE_MODULE_KAMELEONVOLUME___BASEMODULE___H__ +#ifndef __OPENSPACE_MODULE_KAMELEONVOLUME___KAMELEONVOLUMEMODULE___H__ +#define __OPENSPACE_MODULE_KAMELEONVOLUME___KAMELEONVOLUMEMODULE___H__ #include #include @@ -40,4 +40,4 @@ public: } // namespace openspace -#endif // __KAMELEONVOLUMEMODULE_H__ +#endif // __OPENSPACE_MODULE_KAMELEONVOLUME___KAMELEONVOLUMEMODULE___H__ diff --git a/modules/kameleonvolume/kameleonvolumereader.cpp b/modules/kameleonvolume/kameleonvolumereader.cpp index f9803a8fdf..8b3a13bc82 100644 --- a/modules/kameleonvolume/kameleonvolumereader.cpp +++ b/modules/kameleonvolume/kameleonvolumereader.cpp @@ -2,12 +2,12 @@ * * * OpenSpace * * * - * Copyright (c) 2014 - 2016 * + * Copyright (c) 2014-2017 * * * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * 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 * + * 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: * * * @@ -26,12 +26,14 @@ #include #include -//#include - - +#include +#include +#include +#include +#include namespace { - const std::string _loggerCat = "KameleonVolumeReader"; + const char* _loggerCat = "KameleonVolumeReader"; } namespace openspace { @@ -61,8 +63,8 @@ std::unique_ptr> KameleonVolumeReader::readFloatVolume( const glm::vec3 & upperBound) const { auto volume = std::make_unique>(dimensions); - glm::vec3 dims = volume->dimensions(); - glm::vec3 diff = upperBound - lowerBound; + const glm::vec3 dims = volume->dimensions(); + const glm::vec3 diff = upperBound - lowerBound; _model->loadVariable(variable); @@ -101,7 +103,10 @@ std::vector KameleonVolumeReader::gridVariableNames() const { // validate if (tokens.size() != 3) { - return std::vector(); + throw ghoul::RuntimeError( + "Expected three dimensional grid system. Got " + + std::to_string(tokens.size()) + + "dimensions"); } std::string x = tokens.at(0); @@ -117,8 +122,8 @@ std::vector KameleonVolumeReader::gridVariableNames() const { std::vector KameleonVolumeReader::variableNames() const { std::vector variableNames; - int nVariables = _model->getNumberOfVariables(); - for (int i = 0; i < nVariables; i++) { + const int nVariables = _model->getNumberOfVariables(); + for (int i = 0; i < nVariables; ++i) { variableNames.push_back(_model->getVariableName(i)); } return variableNames; @@ -130,8 +135,8 @@ std::vector KameleonVolumeReader::variableAttributeNames() const { std::vector KameleonVolumeReader::globalAttributeNames() const { std::vector attributeNames; - int nAttributes = _model->getNumberOfGlobalAttributes(); - for (int i = 0; i < nAttributes; i++) { + const int nAttributes = _model->getNumberOfGlobalAttributes(); + for (int i = 0; i < nAttributes; ++i) { attributeNames.push_back(_model->getGlobalAttributeName(i)); } return attributeNames; @@ -139,14 +144,16 @@ std::vector KameleonVolumeReader::globalAttributeNames() const { void KameleonVolumeReader::addAttributeToDictionary(ghoul::Dictionary& dictionary, const std::string& key, ccmc::Attribute& attr) { ccmc::Attribute::AttributeType type = attr.getAttributeType(); - if (type == ccmc::Attribute::AttributeType::FLOAT) { + switch (type) { + case ccmc::Attribute::AttributeType::FLOAT: dictionary.setValue(key, attr.getAttributeFloat()); - } - else if (type == ccmc::Attribute::AttributeType::INT) { + return; + case ccmc::Attribute::AttributeType::INT: dictionary.setValue(key, attr.getAttributeInt()); - } - else if (type == ccmc::Attribute::AttributeType::STRING) { + return; + case ccmc::Attribute::AttributeType::STRING: dictionary.setValue(key, attr.getAttributeString()); + return; } } @@ -168,10 +175,10 @@ ghoul::Dictionary KameleonVolumeReader::readMetaData() const { variableDictionary.setValue(variableName, variableAttributesDictionary); } - ghoul::Dictionary metaData; - metaData.setValue("globalAttributes", globalAttributesDictionary); - metaData.setValue("variableAttributes", variableDictionary); - return metaData; + return { + {"globalAttributes", std::move(globalAttributesDictionary) }, + {"variableAttributes", std::move(variableDictionary) } + }; } float KameleonVolumeReader::minValue(const std::string & variable) const { diff --git a/modules/kameleonvolume/kameleonvolumereader.h b/modules/kameleonvolume/kameleonvolumereader.h index 4a03ac223e..9666e5de80 100644 --- a/modules/kameleonvolume/kameleonvolumereader.h +++ b/modules/kameleonvolume/kameleonvolumereader.h @@ -2,9 +2,9 @@ * * * OpenSpace * * * - * Copyright (c) 2014 - 2016 * + * Copyright (c) 2014-2017 * * * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * 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 * @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __KAMELEONVOLUMEREADER_H__ -#define __KAMELEONVOLUMEREADER_H__ +#ifndef __OPENSPACE_MODULE_KAMELEONVOLUME___KAMELEONVOLUMEREADER___H__ +#define __OPENSPACE_MODULE_KAMELEONVOLUME___KAMELEONVOLUMEREADER___H__ #include #include @@ -31,13 +31,11 @@ #include #include -#include #include -#include -#include -#include -#include +namespace ccmc { + class Model; +} namespace openspace { @@ -70,6 +68,6 @@ private: }; -} +} // namespace openspace -#endif +#endif // __OPENSPACE_MODULE_KAMELEONVOLUME___KAMELEONVOLUMEREADER___H__ diff --git a/modules/kameleonvolume/rendering/kameleonvolumeraycaster.cpp b/modules/kameleonvolume/rendering/kameleonvolumeraycaster.cpp index f221214ccb..10957bcb67 100644 --- a/modules/kameleonvolume/rendering/kameleonvolumeraycaster.cpp +++ b/modules/kameleonvolume/rendering/kameleonvolumeraycaster.cpp @@ -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 * @@ -24,7 +24,7 @@ #include -#include +#include #include #include #include @@ -36,10 +36,10 @@ namespace { - const std::string GlslRaycastPath = "${MODULES}/kameleonvolume/shaders/raycast.glsl"; - const std::string GlslHelperPath = "${MODULES}/kameleonvolume/shaders/helper.glsl"; - const std::string GlslBoundsVsPath = "${MODULES}/kameleonvolume/shaders/boundsvs.glsl"; - const std::string GlslBoundsFsPath = "${MODULES}/kameleonvolume/shaders/boundsfs.glsl"; + const char* GlslRaycastPath = "${MODULES}/kameleonvolume/shaders/raycast.glsl"; + const char* GlslHelperPath = "${MODULES}/kameleonvolume/shaders/helper.glsl"; + const char* GlslBoundsVsPath = "${MODULES}/kameleonvolume/shaders/boundsvs.glsl"; + const char* GlslBoundsFsPath = "${MODULES}/kameleonvolume/shaders/boundsfs.glsl"; } namespace openspace { @@ -168,8 +168,7 @@ void KameleonVolumeRaycaster::setStepSize(float stepSize) { _stepSize = stepSize; } -void KameleonVolumeRaycaster::setGridType(VolumeGridType gridType) -{ +void KameleonVolumeRaycaster::setGridType(VolumeGridType gridType) { _gridType = gridType; } diff --git a/modules/kameleonvolume/rendering/kameleonvolumeraycaster.h b/modules/kameleonvolume/rendering/kameleonvolumeraycaster.h index 10c1df2084..95f4ecb656 100644 --- a/modules/kameleonvolume/rendering/kameleonvolumeraycaster.h +++ b/modules/kameleonvolume/rendering/kameleonvolumeraycaster.h @@ -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,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_KAMELEONVOLUME___KAMELEONVOLUMERAYCASTER_H__ -#define __OPENSPACE_MODULE_KAMELEONVOLUME___KAMELEONVOLUMERAYCASTER_H__ +#ifndef __OPENSPACE_MODULE_KAMELEONVOLUME___KAMELEONVOLUMERAYCASTER___H__ +#define __OPENSPACE_MODULE_KAMELEONVOLUME___KAMELEONVOLUMERAYCASTER___H__ #include #include @@ -34,7 +34,6 @@ #include #include -#include #include #include @@ -91,6 +90,6 @@ private: float _stepSize; }; -} // openspace +} // namespace openspace -#endif // __KAMELEONVOLUMERAYCASTER_H__ +#endif // __OPENSPACE_MODULE_KAMELEONVOLUME___KAMELEONVOLUMERAYCASTER___H__ diff --git a/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp b/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp index 4f421f433f..45e6e8d75a 100644 --- a/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp +++ b/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp @@ -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 * @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include @@ -42,7 +42,24 @@ #include namespace { - const std::string _loggerCat = "RenderableKameleonVolume"; + const char* _loggerCat = "RenderableKameleonVolume"; +} + +namespace { + const char* KeyDimensions = "Dimensions"; + const char* KeyStepSize = "StepSize"; + const char* KeyTransferFunction = "TransferFunction"; + const char* KeySource = "Source"; + const char* KeyVariable = "Variable"; + const char* KeyLowerDomainBound = "LowerDomainBound"; + const char* KeyUpperDomainBound = "UpperDomainBound"; + const char* KeyDomainScale = "DomainScale"; + const char* KeyLowerValueBound = "LowerValueBound"; + const char* KeyUpperValueBound = "UpperValueBound"; + const char* KeyClipPlanes = "ClipPlanes"; + const char* KeyCache = "Cache"; + const char* KeyGridType = "GridType"; + const char* ValueSphericalGridType = "Spherical"; } namespace openspace { @@ -69,7 +86,7 @@ RenderableKameleonVolume::RenderableKameleonVolume(const ghoul::Dictionary& dict , _cache("cache", "Cache") { glm::vec3 dimensions; - if (dictionary.getValue("Dimensions", dimensions)) { + if (dictionary.getValue(KeyDimensions, dimensions)) { _dimensions = dimensions; } else { LWARNING("No dimensions specified for volumetric data, falling back to 32^3"); @@ -77,28 +94,28 @@ RenderableKameleonVolume::RenderableKameleonVolume(const ghoul::Dictionary& dict } float stepSize; - if (dictionary.getValue("StepSize", stepSize)) { + if (dictionary.getValue(KeyStepSize, stepSize)) { _stepSize = stepSize; } std::string transferFunctionPath; - if (dictionary.getValue("TransferFunction", transferFunctionPath)) { + if (dictionary.getValue(KeyTransferFunction, transferFunctionPath)) { _transferFunctionPath = transferFunctionPath; _transferFunction = std::make_shared(absPath(transferFunctionPath)); } std::string sourcePath; - if (dictionary.getValue("Source", sourcePath)) { + if (dictionary.getValue(KeySource, sourcePath)) { _sourcePath = absPath(sourcePath); } std::string variable; - if (dictionary.getValue("Variable", variable)) { + if (dictionary.getValue(KeyVariable, variable)) { _variable = variable; } glm::vec3 lowerDomainBound; - if (dictionary.getValue("LowerDomainBound", lowerDomainBound)) { + if (dictionary.getValue(KeyLowerDomainBound, lowerDomainBound)) { _lowerDomainBound = lowerDomainBound; } else { @@ -106,7 +123,7 @@ RenderableKameleonVolume::RenderableKameleonVolume(const ghoul::Dictionary& dict } glm::vec3 upperDomainBound; - if (dictionary.getValue("UpperDomainBound", upperDomainBound)) { + if (dictionary.getValue(KeyUpperDomainBound, upperDomainBound)) { _upperDomainBound = upperDomainBound; } else { @@ -114,14 +131,14 @@ RenderableKameleonVolume::RenderableKameleonVolume(const ghoul::Dictionary& dict } glm::vec3 domainScale; - if (dictionary.getValue("DomainScale", domainScale)) { + if (dictionary.getValue(KeyDomainScale, domainScale)) { _domainScale = domainScale; } else { _domainScale = glm::vec3(1, 1, 1); // Assume meters if nothing else is specified. } float lowerValueBound; - if (dictionary.getValue("LowerValueBound", lowerValueBound)) { + if (dictionary.getValue(KeyLowerValueBound, lowerValueBound)) { _lowerValueBound = lowerValueBound; } else { @@ -129,7 +146,7 @@ RenderableKameleonVolume::RenderableKameleonVolume(const ghoul::Dictionary& dict } float upperValueBound; - if (dictionary.getValue("UpperValueBound", upperValueBound)) { + if (dictionary.getValue(KeyUpperValueBound, upperValueBound)) { _upperValueBound = upperValueBound; } else { @@ -137,12 +154,12 @@ RenderableKameleonVolume::RenderableKameleonVolume(const ghoul::Dictionary& dict } ghoul::Dictionary clipPlanesDictionary; - dictionary.getValue("ClipPlanes", clipPlanesDictionary); + dictionary.getValue(KeyClipPlanes, clipPlanesDictionary); _clipPlanes = std::make_shared(clipPlanesDictionary); _clipPlanes->setName("clipPlanes"); bool cache; - if (dictionary.getValue("Cache", cache)) { + if (dictionary.getValue(KeyCache, cache)) { _cache = cache; } @@ -151,8 +168,8 @@ RenderableKameleonVolume::RenderableKameleonVolume(const ghoul::Dictionary& dict _gridType.setValue(static_cast(VolumeGridType::Cartesian)); std::string gridType; - if (dictionary.getValue("GridType", gridType)) { - if (gridType == "Spherical") { + if (dictionary.getValue(KeyGridType, gridType)) { + if (gridType == ValueSphericalGridType) { _gridType.setValue(static_cast(VolumeGridType::Spherical)); } else { _autoGridType = true; @@ -191,7 +208,7 @@ bool RenderableKameleonVolume::initialize() { OsEng.renderEngine().raycasterManager().attachRaycaster(*_raycaster.get()); - std::function onChange = [&](bool enabled) { + auto onChange = [&](bool enabled) { if (enabled) { OsEng.renderEngine().raycasterManager().attachRaycaster(*_raycaster.get()); } @@ -328,7 +345,7 @@ void RenderableKameleonVolume::updateTextureFromVolume() { float min = _lowerValueBound; float diff = _upperValueBound - _lowerValueBound; - for (size_t i = 0; i < _normalizedVolume->nCells(); i++) { + for (size_t i = 0; i < _normalizedVolume->nCells(); ++i) { out[i] = glm::clamp((in[i] - min) / diff, 0.0f, 1.0f); } @@ -338,7 +355,8 @@ void RenderableKameleonVolume::updateTextureFromVolume() { GL_RED, GL_FLOAT, ghoul::opengl::Texture::FilterMode::Linear, - ghoul::opengl::Texture::WrappingMode::Repeat); + ghoul::opengl::Texture::WrappingMode::Repeat + ); void* data = reinterpret_cast(_normalizedVolume->data()); _volumeTexture->setPixelData(data, ghoul::opengl::Texture::TakeOwnership::No); @@ -368,8 +386,7 @@ void RenderableKameleonVolume::update(const UpdateData& data) { } void RenderableKameleonVolume::render(const RenderData& data, RendererTasks& tasks) { - RaycasterTask task{ _raycaster.get(), data }; - tasks.raycasterTasks.push_back(task); + tasks.raycasterTasks.push_back({ _raycaster.get(), data }); } } diff --git a/modules/kameleonvolume/rendering/renderablekameleonvolume.h b/modules/kameleonvolume/rendering/renderablekameleonvolume.h index 95224fa2b5..e96a9e2a14 100644 --- a/modules/kameleonvolume/rendering/renderablekameleonvolume.h +++ b/modules/kameleonvolume/rendering/renderablekameleonvolume.h @@ -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,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_KAMELEONVOLUME___RENDERABLEKAMELEONVOLUME_H__ -#define __OPENSPACE_MODULE_KAMELEONVOLUME___RENDERABLEKAMELEONVOLUME_H__ +#ifndef __OPENSPACE_MODULE_KAMELEONVOLUME___RENDERABLEKAMELEONVOLUME___H__ +#define __OPENSPACE_MODULE_KAMELEONVOLUME___RENDERABLEKAMELEONVOLUME___H__ #include #include @@ -97,6 +97,7 @@ private: std::shared_ptr _volumeTexture; std::shared_ptr _transferFunction; }; -} -#endif // __RENDERABLEKAMELEONVOLUME_H__ +} // namespace openspace + +#endif // __OPENSPACE_MODULE_KAMELEONVOLUME___RENDERABLEKAMELEONVOLUME___H__ diff --git a/modules/kameleonvolume/shaders/boundsfs.glsl b/modules/kameleonvolume/shaders/boundsfs.glsl index 2d3e6acc19..f56b7319a7 100644 --- a/modules/kameleonvolume/shaders/boundsfs.glsl +++ b/modules/kameleonvolume/shaders/boundsfs.glsl @@ -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 * diff --git a/modules/kameleonvolume/shaders/boundsvs.glsl b/modules/kameleonvolume/shaders/boundsvs.glsl index 5f46702609..4d10ec054a 100644 --- a/modules/kameleonvolume/shaders/boundsvs.glsl +++ b/modules/kameleonvolume/shaders/boundsvs.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 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 * @@ -36,11 +36,11 @@ out vec4 positionCameraSpace; void main() { - positionLocalSpace = vec4(vertPosition, 1.0); - positionCameraSpace = modelViewTransform * positionLocalSpace; + positionLocalSpace = vec4(vertPosition, 1.0); + positionCameraSpace = modelViewTransform * positionLocalSpace; - vec4 positionClipSpace = projectionTransform * positionCameraSpace; - vec4 positionScreenSpace = z_normalization(positionClipSpace); + vec4 positionClipSpace = projectionTransform * positionCameraSpace; + vec4 positionScreenSpace = z_normalization(positionClipSpace); //positionScreenSpace.z = 1.0; // project the position to view space diff --git a/modules/kameleonvolume/shaders/helper.glsl b/modules/kameleonvolume/shaders/helper.glsl index d357202293..53b011a31d 100644 --- a/modules/kameleonvolume/shaders/helper.glsl +++ b/modules/kameleonvolume/shaders/helper.glsl @@ -1,11 +1,35 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + #define KAMELEON_PI 3.14159265358979323846 /* pi */ #define KAMELEON_SQRT1_3 0.57735026919 /* 1/sqrt(3) */ vec3 kameleon_cartesianToSpherical(vec3 zeroToOneCoords) { // Put cartesian in [-1..1] range first - vec3 cartesian = vec3(-1.0,-1.0,-1.0) + zeroToOneCoords * 2.0f; + const vec3 cartesian = vec3(-1.0,-1.0,-1.0) + zeroToOneCoords * 2.0f; - float r = length(cartesian); + const float r = length(cartesian); float theta, phi; if (r == 0.0) { @@ -14,6 +38,5 @@ vec3 kameleon_cartesianToSpherical(vec3 zeroToOneCoords) { theta = acos(cartesian.z/r) / KAMELEON_PI; phi = (KAMELEON_PI + atan(cartesian.y, cartesian.x)) / (2.0*KAMELEON_PI ); } - r *= KAMELEON_SQRT1_3; - return vec3(r, theta, phi); + return vec3(r * KAMELEON_SQRT1_3, theta, phi); } \ No newline at end of file diff --git a/modules/kameleonvolume/shaders/raycast.glsl b/modules/kameleonvolume/shaders/raycast.glsl index 0ff1cb3a1e..0d21ab261b 100644 --- a/modules/kameleonvolume/shaders/raycast.glsl +++ b/modules/kameleonvolume/shaders/raycast.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 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 * diff --git a/modules/kameleonvolume/tasks/kameleondocumentationtask.cpp b/modules/kameleonvolume/tasks/kameleondocumentationtask.cpp index 0ce9320386..a8c2a275fb 100644 --- a/modules/kameleonvolume/tasks/kameleondocumentationtask.cpp +++ b/modules/kameleonvolume/tasks/kameleondocumentationtask.cpp @@ -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 * @@ -35,13 +35,13 @@ #include namespace { - const std::string KeyInput = "Input"; - const std::string KeyOutput = "Output"; - const std::string MainTemplateFilename = "${OPENSPACE_DATA}/web/kameleondocumentation/main.hbs"; - const std::string HandlebarsFilename = "${OPENSPACE_DATA}/web/common/handlebars-v4.0.5.js"; - const std::string JsFilename = "${OPENSPACE_DATA}/web/kameleondocumentation/script.js"; - const std::string BootstrapFilename = "${OPENSPACE_DATA}/web/common/bootstrap.min.css"; - const std::string CssFilename = "${OPENSPACE_DATA}/web/common/style.css"; + const char* KeyInput = "Input"; + const char* KeyOutput = "Output"; + const char* MainTemplateFilename = "${OPENSPACE_DATA}/web/kameleondocumentation/main.hbs"; + const char* HandlebarsFilename = "${OPENSPACE_DATA}/web/common/handlebars-v4.0.5.js"; + const char* JsFilename = "${OPENSPACE_DATA}/web/kameleondocumentation/script.js"; + const char* BootstrapFilename = "${OPENSPACE_DATA}/web/common/bootstrap.min.css"; + const char* CssFilename = "${OPENSPACE_DATA}/web/common/style.css"; } namespace openspace { @@ -68,12 +68,15 @@ void KameleonDocumentationTask::perform(const Task::ProgressCallback & progressC ghoul::DictionaryJsonFormatter formatter; - ghoul::Dictionary dictionary; - dictionary.setValue("kameleon", kameleonDictionary); - dictionary.setValue("version", std::to_string(OPENSPACE_VERSION_MAJOR) + "." + - std::to_string(OPENSPACE_VERSION_MINOR) + "." + - std::to_string(OPENSPACE_VERSION_PATCH)); - dictionary.setValue("input", _inputPath); + ghoul::Dictionary dictionary = { + {"kameleon", std::move(kameleonDictionary)}, + {"version", + std::to_string(OPENSPACE_VERSION_MAJOR) + "." + + std::to_string(OPENSPACE_VERSION_MINOR) + "." + + std::to_string(OPENSPACE_VERSION_PATCH) + }, + {"input", _inputPath} + }; std::string json = formatter.format(dictionary); progressCallback(0.66f); @@ -156,6 +159,4 @@ documentation::Documentation KameleonDocumentationTask::documentation() { }; } - - } // namespace openspace diff --git a/modules/kameleonvolume/tasks/kameleondocumentationtask.h b/modules/kameleonvolume/tasks/kameleondocumentationtask.h index a5f07cadf9..90c133a07f 100644 --- a/modules/kameleonvolume/tasks/kameleondocumentationtask.h +++ b/modules/kameleonvolume/tasks/kameleondocumentationtask.h @@ -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,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __KAMELEONDOCUMENTAIONTASK_H__ -#define __KAMELEONDOCUMENTAIONTASK_H__ +#ifndef __OPENSPACE_MODULE_KAMELEONVOLUME___KAMELEONDOCUMENTATIONTASK___H__ +#define __OPENSPACE_MODULE_KAMELEONVOLUME___KAMELEONDOCUMENTATIONTASK___H__ #include @@ -40,7 +40,6 @@ private: std::string _outputPath; }; -} +} // namespace openspace - -#endif __KAMELEONDOCUMENTAIONTASK_H__ \ No newline at end of file +#endif // __OPENSPACE_MODULE_KAMELEONVOLUME___KAMELEONDOCUMENTATIONTASK___H__ diff --git a/modules/kameleonvolume/tasks/kameleonmetadatatojsontask.cpp b/modules/kameleonvolume/tasks/kameleonmetadatatojsontask.cpp index 4b3231aad8..50e1775df8 100644 --- a/modules/kameleonvolume/tasks/kameleonmetadatatojsontask.cpp +++ b/modules/kameleonvolume/tasks/kameleonmetadatatojsontask.cpp @@ -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 * @@ -31,8 +31,8 @@ #include namespace { - const std::string KeyInput = "Input"; - const std::string KeyOutput = "Output"; + const char* KeyInput = "Input"; + const char* KeyOutput = "Output"; } namespace openspace { diff --git a/modules/kameleonvolume/tasks/kameleonmetadatatojsontask.h b/modules/kameleonvolume/tasks/kameleonmetadatatojsontask.h index f6c82d6462..144b9a9330 100644 --- a/modules/kameleonvolume/tasks/kameleonmetadatatojsontask.h +++ b/modules/kameleonvolume/tasks/kameleonmetadatatojsontask.h @@ -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,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __KAMELEONMETADATATOJSONTASK_H__ -#define __KAMELEONMETADATATOJSONTASK_H__ +#ifndef __OPENSPACE_MODULE_KAMELEONVOLUME___KAMELEONMETADATATOJSONTASK___H__ +#define __OPENSPACE_MODULE_KAMELEONVOLUME___KAMELEONMETADATATOJSONTASK___H__ #include @@ -40,7 +40,6 @@ private: std::string _outputPath; }; -} +} // namespace openspace - -#endif __KAMELEONMETADATATOJSONTASK_H__ \ No newline at end of file +#endif // __OPENSPACE_MODULE_KAMELEONVOLUME___KAMELEONMETADATATOJSONTASK___H__ diff --git a/modules/volume/rendering/volumeclipplane.cpp b/modules/volume/rendering/volumeclipplane.cpp index 83e72b52e0..e3ae029752 100644 --- a/modules/volume/rendering/volumeclipplane.cpp +++ b/modules/volume/rendering/volumeclipplane.cpp @@ -3,7 +3,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 * @@ -48,14 +48,12 @@ void VolumeClipPlane::initialize() addProperty(_offsets); } -glm::vec3 VolumeClipPlane::normal() -{ +glm::vec3 VolumeClipPlane::normal() { return glm::normalize(_normal.value()); } -glm::vec2 VolumeClipPlane::offsets() -{ +glm::vec2 VolumeClipPlane::offsets() { return _offsets; } -} \ No newline at end of file +} // namespace openspace \ No newline at end of file diff --git a/modules/volume/rendering/volumeclipplanes.cpp b/modules/volume/rendering/volumeclipplanes.cpp index 711a0f4550..3a2f14d285 100644 --- a/modules/volume/rendering/volumeclipplanes.cpp +++ b/modules/volume/rendering/volumeclipplanes.cpp @@ -3,7 +3,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 * @@ -36,7 +36,7 @@ VolumeClipPlanes::VolumeClipPlanes(const ghoul::Dictionary& dictionary) for (const std::string& key : keys) { ghoul::Dictionary cutPlaneDictionary; dictionary.getValue(key, cutPlaneDictionary); - std::shared_ptr clipPlane = std::make_shared(cutPlaneDictionary); + auto clipPlane = std::make_shared(cutPlaneDictionary); clipPlane->setName(key); _clipPlanes.push_back(clipPlane); } @@ -51,12 +51,9 @@ void VolumeClipPlanes::initialize() { } } -void VolumeClipPlanes::deinitialize() { - -} +void VolumeClipPlanes::deinitialize() {} -std::vector VolumeClipPlanes::normals() -{ +std::vector VolumeClipPlanes::normals() { std::vector normals; for (const auto& clipPlane : _clipPlanes) { normals.push_back(clipPlane->normal()); @@ -64,8 +61,7 @@ std::vector VolumeClipPlanes::normals() return normals; } -std::vector VolumeClipPlanes::offsets() -{ +std::vector VolumeClipPlanes::offsets() { std::vector offsets; for (const auto& clipPlane : _clipPlanes) { offsets.push_back(clipPlane->offsets()); @@ -73,4 +69,4 @@ std::vector VolumeClipPlanes::offsets() return offsets; } -} \ No newline at end of file +} // namespace openspace diff --git a/modules/volume/volumegridtype.h b/modules/volume/volumegridtype.h index b7768cec6e..33e39261fc 100644 --- a/modules/volume/volumegridtype.h +++ b/modules/volume/volumegridtype.h @@ -1,26 +1,26 @@ /***************************************************************************************** -* * -* 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. * + ****************************************************************************************/ #ifndef __OPENSPACE_MODULE_VOLUME___VOLUMEGRIDTYPE_H__ #define __OPENSPACE_MODULE_VOLUME___VOLUMEGRIDTYPE_H__ @@ -30,4 +30,4 @@ enum class VolumeGridType : int { Spherical = 1 }; -#endif \ No newline at end of file +#endif // __OPENSPACE_MODULE_VOLUME___VOLUMEGRIDTYPE_H__ diff --git a/shaders/framebuffer/inside.glsl b/shaders/framebuffer/inside.glsl index 7e052e6185..9c5587c325 100644 --- a/shaders/framebuffer/inside.glsl +++ b/shaders/framebuffer/inside.glsl @@ -2,7 +2,7 @@ * * * OpenSpace * * * - * Copyright (c) 2017 * + * 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 * @@ -26,4 +26,4 @@ void getEntry(inout vec3 entryPos, inout float entryDepth) { entryPos = cameraPosInRaycaster; entryDepth = 0; -} \ No newline at end of file +} diff --git a/src/util/task.cpp b/src/util/task.cpp index f7f9c4a8b9..044e8c44fd 100644 --- a/src/util/task.cpp +++ b/src/util/task.cpp @@ -1,26 +1,26 @@ /***************************************************************************************** -* * -* 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. * + ****************************************************************************************/ #include #include diff --git a/src/util/taskloader.cpp b/src/util/taskloader.cpp index c4a800cb7b..b2867d27eb 100644 --- a/src/util/taskloader.cpp +++ b/src/util/taskloader.cpp @@ -1,26 +1,26 @@ /***************************************************************************************** -* * -* 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. * + ****************************************************************************************/ #include @@ -34,12 +34,11 @@ #include namespace { - const std::string _loggerCat = "TaskRunner"; + const char* _loggerCat = "TaskRunner"; } namespace openspace { - std::vector> TaskLoader::tasksFromDictionary(const ghoul::Dictionary& tasksDictionary) { std::vector> tasks; std::vector keys = tasksDictionary.keys(); @@ -85,5 +84,4 @@ std::vector> TaskLoader::tasksFromFile(const std::string& return tasksFromDictionary(tasksDictionary); } - -} \ No newline at end of file +} // namespace openspace diff --git a/src/util/transformationmanager.cpp b/src/util/transformationmanager.cpp index 2aef61c482..53a975f09b 100644 --- a/src/util/transformationmanager.cpp +++ b/src/util/transformationmanager.cpp @@ -21,6 +21,7 @@ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ + #include #include #include From 4307c06d92bf11bc12fbaf86869e61cc89e6e3cd Mon Sep 17 00:00:00 2001 From: Emil Axelsson Date: Fri, 3 Mar 2017 18:19:10 +0100 Subject: [PATCH 87/96] Compile fix --- ext/ghoul | 2 +- include/openspace/engine/moduleengine.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/ghoul b/ext/ghoul index e0cbca16ad..445ed6353f 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit e0cbca16ad71700cf82d0d24bcf4fc14bded10ea +Subproject commit 445ed6353fe53ffc2f799de29328ca44de9e3ffb diff --git a/include/openspace/engine/moduleengine.h b/include/openspace/engine/moduleengine.h index 1cba4abc48..ab3a118ecc 100644 --- a/include/openspace/engine/moduleengine.h +++ b/include/openspace/engine/moduleengine.h @@ -28,6 +28,8 @@ #include #include +#include + namespace ghoul { namespace systemcapabilities { @@ -40,8 +42,6 @@ namespace openspace { namespace scripting { struct LuaLibrary; } -class OpenSpaceModule; - /** * The ModuleEngine is the central repository for registering and accessing * OpenSpaceModule for the current application run. By initializing (#initialize) the From 8e0a37fb7afc236515ecee6f871525fa237c8a30 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Fri, 3 Mar 2017 17:51:39 -0500 Subject: [PATCH 88/96] Compile fixes related to change in documentation namespace Configuration fix, making the default scene default again --- .../galaxy/tasks/milkywayconversiontask.cpp | 24 ++++++++++--------- modules/galaxy/tasks/milkywayconversiontask.h | 5 +++- .../tasks/milkywaypointsconversiontask.cpp | 10 +++++--- .../tasks/milkywaypointsconversiontask.h | 5 +++- openspace.cfg | 7 +++--- 5 files changed, 32 insertions(+), 19 deletions(-) diff --git a/modules/galaxy/tasks/milkywayconversiontask.cpp b/modules/galaxy/tasks/milkywayconversiontask.cpp index 9dfd7fef38..189a6ea23d 100644 --- a/modules/galaxy/tasks/milkywayconversiontask.cpp +++ b/modules/galaxy/tasks/milkywayconversiontask.cpp @@ -23,19 +23,21 @@ ****************************************************************************************/ #include + #include #include #include -namespace { - char* KeyInFilenamePrefix = "InFilenamePrefix"; - char* KeyInFilenameSuffix = "InFilenameSuffix"; - char* KeyInFirstIndex = "InFirstIndex"; - char* KeyInNSlices = "InNSlices"; - char* KeyOutFilename = "OutFilename"; - char* KeyOutDimensions = "OutDimensions"; -} +#include +namespace { + const char* KeyInFilenamePrefix = "InFilenamePrefix"; + const char* KeyInFilenameSuffix = "InFilenameSuffix"; + const char* KeyInFirstIndex = "InFirstIndex"; + const char* KeyInNSlices = "InNSlices"; + const char* KeyOutFilename = "OutFilename"; + const char* KeyOutDimensions = "OutDimensions"; +} // namespace namespace openspace { @@ -45,7 +47,7 @@ MilkywayConversionTask::MilkywayConversionTask(const ghoul::Dictionary& dictiona _inFilenamePrefix = inFilenamePrefix; } - std::string inFilenamePrefix; + std::string inFilenameSuffix; if (dictionary.getValue(KeyInFilenameSuffix, inFilenameSuffix)) { _inFilenameSuffix = inFilenameSuffix; } @@ -103,9 +105,9 @@ void MilkywayConversionTask::perform(const Task::ProgressCallback& progressCallb rawWriter.write(sampleFunction, progressCallback); } -Documentation MilkywayConversionTask::documentation() +documentation::Documentation MilkywayConversionTask::documentation() { - return Documentation(); + return documentation::Documentation(); } } diff --git a/modules/galaxy/tasks/milkywayconversiontask.h b/modules/galaxy/tasks/milkywayconversiontask.h index 1a37fb5950..4e00b9c975 100644 --- a/modules/galaxy/tasks/milkywayconversiontask.h +++ b/modules/galaxy/tasks/milkywayconversiontask.h @@ -35,6 +35,8 @@ namespace openspace { +namespace documentation { struct Documentation; } + /** * Converts a set of exr image slices to a raw volume * with floating point RGBA data (32 bit per channel). @@ -45,7 +47,8 @@ public: virtual ~MilkywayConversionTask(); std::string description() override; void perform(const Task::ProgressCallback& onProgress) override; - static Documentation documentation(); + static documentation::Documentation documentation(); + private: std::string _inFilenamePrefix; std::string _inFilenameSuffix; diff --git a/modules/galaxy/tasks/milkywaypointsconversiontask.cpp b/modules/galaxy/tasks/milkywaypointsconversiontask.cpp index ae9891d68f..0df1bcdb1f 100644 --- a/modules/galaxy/tasks/milkywaypointsconversiontask.cpp +++ b/modules/galaxy/tasks/milkywaypointsconversiontask.cpp @@ -23,9 +23,13 @@ ****************************************************************************************/ #include + #include #include #include + +#include + #include #include #include @@ -79,15 +83,15 @@ void MilkywayPointsConversionTask::perform(const Task::ProgressCallback & progre } out.write(reinterpret_cast(&nPoints), sizeof(int64_t)); - out.write(reinterpret_cast(pointData), nFloats * sizeof(float)); + out.write(reinterpret_cast(pointData.data()), nFloats * sizeof(float)); in.close(); out.close(); } -Documentation MilkywayPointsConversionTask::documentation() +documentation::Documentation MilkywayPointsConversionTask::documentation() { - return Documentation(); + return documentation::Documentation(); } } diff --git a/modules/galaxy/tasks/milkywaypointsconversiontask.h b/modules/galaxy/tasks/milkywaypointsconversiontask.h index ffc1582957..d20eb4bcef 100644 --- a/modules/galaxy/tasks/milkywaypointsconversiontask.h +++ b/modules/galaxy/tasks/milkywaypointsconversiontask.h @@ -35,6 +35,8 @@ namespace openspace { +namespace documentation { struct Documentation; } + /** * Converts ascii based point data * int64_t n @@ -47,7 +49,8 @@ public: virtual ~MilkywayPointsConversionTask(); std::string description() override; void perform(const Task::ProgressCallback& progressCallback) override; - static Documentation documentation(); + static documentation::Documentation documentation(); + private: std::string _inFilename; std::string _outFilename; diff --git a/openspace.cfg b/openspace.cfg index 6848a95040..43e33fac12 100644 --- a/openspace.cfg +++ b/openspace.cfg @@ -23,19 +23,20 @@ return { -- Sets the scene that is to be loaded by OpenSpace. A scene file is a description -- of all entities that will be visible during an instance of OpenSpace - Scene = "${SCENE}/volumes.scene", - Task = "${TASKS}/default.task", + Scene = "${SCENE}/default.scene", -- Scene = "${SCENE}/globebrowsing.scene", -- Scene = "${SCENE}/rosetta.scene", -- Scene = "${SCENE}/dawn.scene", -- Scene = "${SCENE}/newhorizons.scene", -- Scene = "${SCENE}/osirisrex.scene", + Task = "${TASKS}/default.task", + Paths = { SGCT = "${BASE_PATH}/config/sgct", SCRIPTS = "${BASE_PATH}/scripts", SHADERS = "${BASE_PATH}/shaders", - OPENSPACE_DATA = "${BASE_PATH}/data", + OPENSPACE_DATA = "${BASE_PATH}/data-minimal", SCENE = "${OPENSPACE_DATA}/scene", TASKS = "${OPENSPACE_DATA}/tasks", SPICE = "${OPENSPACE_DATA}/spice", From 63af7e67f9d62015b06368570652955777fe64a0 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Fri, 3 Mar 2017 18:39:35 -0500 Subject: [PATCH 89/96] Make the WindowWrapper a PropertyOwner and add SGCT properties to the subclass (closes #260) --- include/openspace/engine/settingsengine.h | 1 - .../openspace/engine/wrapper/sgctwindowwrapper.h | 9 +++++++++ include/openspace/engine/wrapper/windowwrapper.h | 7 ++++++- modules/onscreengui/onscreenguimodule.cpp | 1 + src/engine/openspaceengine.cpp | 3 +++ src/engine/settingsengine.cpp | 7 ------- src/engine/wrapper/sgctwindowwrapper.cpp | 15 +++++++++++++++ src/engine/wrapper/windowwrapper.cpp | 4 ++++ 8 files changed, 38 insertions(+), 9 deletions(-) diff --git a/include/openspace/engine/settingsengine.h b/include/openspace/engine/settingsengine.h index 7052fc4846..e040192928 100644 --- a/include/openspace/engine/settingsengine.h +++ b/include/openspace/engine/settingsengine.h @@ -50,7 +50,6 @@ public: bool useDoubleBuffering(); private: - properties::FloatProperty _eyeSeparation; properties::OptionProperty _scenes; properties::BoolProperty _busyWaitForDecode; properties::BoolProperty _logSGCTOutOfOrderErrors; diff --git a/include/openspace/engine/wrapper/sgctwindowwrapper.h b/include/openspace/engine/wrapper/sgctwindowwrapper.h index 3469aa8f80..7dc3db262b 100644 --- a/include/openspace/engine/wrapper/sgctwindowwrapper.h +++ b/include/openspace/engine/wrapper/sgctwindowwrapper.h @@ -27,6 +27,9 @@ #include +#include +#include + namespace openspace { /** @@ -36,6 +39,8 @@ namespace openspace { */ class SGCTWindowWrapper : public WindowWrapper { public: + SGCTWindowWrapper(); + void terminate() override; void setBarrier(bool enabled) override; void setSynchronization(bool enabled) override; @@ -72,6 +77,10 @@ public: bool isSimpleRendering() const override; void takeScreenshot(bool applyWarping = false) const override; + +private: + properties::FloatProperty _eyeSeparation; + properties::BoolProperty _showStatsGraph; }; } // namespace openspace diff --git a/include/openspace/engine/wrapper/windowwrapper.h b/include/openspace/engine/wrapper/windowwrapper.h index 848c529bff..252eb4258a 100644 --- a/include/openspace/engine/wrapper/windowwrapper.h +++ b/include/openspace/engine/wrapper/windowwrapper.h @@ -25,6 +25,8 @@ #ifndef __OPENSPACE_CORE___WINDOWWRAPPER___H__ #define __OPENSPACE_CORE___WINDOWWRAPPER___H__ +#include + #include #include @@ -42,8 +44,11 @@ namespace scripting { struct LuaLibrary; } * Every new windowing framework needs to have its own WindowWrapper subclass exposing the * required features. */ -class WindowWrapper { +class WindowWrapper : public properties::PropertyOwner { public: + /// Default constructor + WindowWrapper(); + /** * Returns the Lua library that contains all Lua functions available to affect the * windowing system. diff --git a/modules/onscreengui/onscreenguimodule.cpp b/modules/onscreengui/onscreenguimodule.cpp index a0625d71d9..324d084c45 100644 --- a/modules/onscreengui/onscreenguimodule.cpp +++ b/modules/onscreengui/onscreenguimodule.cpp @@ -55,6 +55,7 @@ OnScreenGUIModule::OnScreenGUIModule() gui._globalProperty.setSource( []() { std::vector res = { + &(OsEng.windowWrapper()), &(OsEng.settingsEngine()), &(OsEng.interactionHandler()), &(OsEng.renderEngine()) diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index 71318c29b3..e911816cec 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -131,9 +131,12 @@ OpenSpaceEngine::OpenSpaceEngine(std::string programName, , _isFirstRenderingFirstFrame(true) { _interactionHandler->setPropertyOwner(_globalPropertyNamespace.get()); + + // New property subowners also have to be added to the OnScreenGuiModule callback! _globalPropertyNamespace->addPropertySubOwner(_interactionHandler.get()); _globalPropertyNamespace->addPropertySubOwner(_settingsEngine.get()); _globalPropertyNamespace->addPropertySubOwner(_renderEngine.get()); + _globalPropertyNamespace->addPropertySubOwner(_windowWrapper.get()); FactoryManager::initialize(); FactoryManager::ref().addFactory( diff --git a/src/engine/settingsengine.cpp b/src/engine/settingsengine.cpp index cb25fa2d0f..506c073b16 100644 --- a/src/engine/settingsengine.cpp +++ b/src/engine/settingsengine.cpp @@ -47,7 +47,6 @@ namespace openspace { SettingsEngine::SettingsEngine() : properties::PropertyOwner("Global Properties") - , _eyeSeparation("eyeSeparation", "Eye Separation", 0.f, 0.f, 10.f) , _scenes("scenes", "Scene", properties::OptionProperty::DisplayType::Dropdown) , _busyWaitForDecode("busyWaitForDecode", "Busy Wait for decode", false) , _logSGCTOutOfOrderErrors("logSGCTOutOfOrderErrors", "Log SGCT out-of-order", false) @@ -62,7 +61,6 @@ SettingsEngine::SettingsEngine() } }); addProperty(_spiceUseExceptions); - addProperty(_eyeSeparation); addProperty(_busyWaitForDecode); addProperty(_logSGCTOutOfOrderErrors); addProperty(_useDoubleBuffering); @@ -70,11 +68,6 @@ SettingsEngine::SettingsEngine() } void SettingsEngine::initialize() { - // Set interaction to change the window's (SGCT's) eye separation - _eyeSeparation.onChange( - [this]() { OsEng.windowWrapper().setEyeSeparationDistance(_eyeSeparation); } - ); - // Load all matching files in the Scene // TODO: match regex with either with new ghoul readFiles or local code std::string sceneDir = "${SCENE}"; diff --git a/src/engine/wrapper/sgctwindowwrapper.cpp b/src/engine/wrapper/sgctwindowwrapper.cpp index 950145fc11..b9c9fbdd2e 100644 --- a/src/engine/wrapper/sgctwindowwrapper.cpp +++ b/src/engine/wrapper/sgctwindowwrapper.cpp @@ -35,6 +35,21 @@ namespace { } namespace openspace { + +SGCTWindowWrapper::SGCTWindowWrapper() + : _showStatsGraph("showStatsGraph", "Show Stats Graph", false) + , _eyeSeparation("eyeSeparation", "Eye Separation", 0.f, 0.f, 10.f) +{ + _showStatsGraph.onChange([this](){ + sgct::Engine::instance()->setStatsGraphVisibility(_showStatsGraph); + }); + addProperty(_showStatsGraph); + + addProperty(_eyeSeparation); + _eyeSeparation.onChange([this](){ + setEyeSeparationDistance(_eyeSeparation); + }); +} void SGCTWindowWrapper::terminate() { sgct::Engine::instance()->terminate(); diff --git a/src/engine/wrapper/windowwrapper.cpp b/src/engine/wrapper/windowwrapper.cpp index 9783526719..8f2164b16a 100644 --- a/src/engine/wrapper/windowwrapper.cpp +++ b/src/engine/wrapper/windowwrapper.cpp @@ -52,6 +52,10 @@ WindowWrapper::WindowWrapperException::WindowWrapperException(const std::string& : ghoul::RuntimeError(msg, "WindowWrapper") {} +WindowWrapper::WindowWrapper() + : properties::PropertyOwner("WindowWrapper") +{} + scripting::LuaLibrary WindowWrapper::luaLibrary() { return { "cluster", From b6ddf2a879455ae83c5b1726f0312b76a3bac5cf Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Sat, 4 Mar 2017 20:53:13 -0500 Subject: [PATCH 90/96] Fix clang compile error regarding std::abs --- modules/globebrowsing/tile/pixelregion.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/globebrowsing/tile/pixelregion.cpp b/modules/globebrowsing/tile/pixelregion.cpp index 7130b5d318..63b62f5312 100644 --- a/modules/globebrowsing/tile/pixelregion.cpp +++ b/modules/globebrowsing/tile/pixelregion.cpp @@ -165,12 +165,12 @@ void PixelRegion::clampTo(const PixelRegion& boundingRegion) { void PixelRegion::forceNumPixelToDifferByNearestMultipleOf(unsigned int multiple) { ghoul_assert(multiple > 0, "multiple must be 1 or larger"); int sizeDiff = numPixels.x - numPixels.y; - if (std::abs(sizeDiff) > 0) { + if (static_cast(std::abs(static_cast(sizeDiff))) > 0) { if (sizeDiff > 0) { numPixels.y += sizeDiff % multiple; } else { - numPixels.x += std::abs(sizeDiff) % multiple; + numPixels.x += static_cast(std::abs(static_cast(sizeDiff))) % multiple; } } } From 34f1b55c3ccd7bc9bf5bf7fb925dfcd1d4e8540a Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Sun, 5 Mar 2017 17:26:22 -0500 Subject: [PATCH 91/96] Enable shifting the meridian of a RenderablePlanetProjection by 180 for Pluto --- .../rendering/renderableplanetprojection.cpp | 24 ++++++++++++++++--- .../rendering/renderableplanetprojection.h | 2 ++ .../renderablePlanetProjection_fs.glsl | 2 -- .../shaders/renderablePlanet_fs.glsl | 9 +++++-- .../shaders/renderablePlanet_vs.glsl | 9 ++++++- 5 files changed, 38 insertions(+), 8 deletions(-) diff --git a/modules/newhorizons/rendering/renderableplanetprojection.cpp b/modules/newhorizons/rendering/renderableplanetprojection.cpp index 29d5d6f57e..f8036785c0 100644 --- a/modules/newhorizons/rendering/renderableplanetprojection.cpp +++ b/modules/newhorizons/rendering/renderableplanetprojection.cpp @@ -57,6 +57,7 @@ namespace { const char* keyGeometry = "Geometry"; const char* keyProjection = "Projection"; + const char* keyMeridianShift = "Textures.MeridianShift"; const char* keyColorTexture = "Textures.Color"; const char* keyHeightTexture = "Textures.Height"; @@ -91,6 +92,13 @@ documentation::Documentation RenderablePlanetProjection::Documentation() { "Contains information about projecting onto this planet.", Optional::No }, + { + keyMeridianShift, + new BoolVerifier, + "Determines whether the meridian of the planet should be shifted by 180 " + "degrees. The default value is 'false'", + Optional::Yes + }, { keyColorTexture, new StringVerifier, @@ -118,6 +126,7 @@ RenderablePlanetProjection::RenderablePlanetProjection(const ghoul::Dictionary& , _heightMapTexturePath("heightMap", "Heightmap Texture") , _rotation("rotation", "Rotation", 0, 0, 360) , _heightExaggeration("heightExaggeration", "Height Exaggeration", 1.f, 0.f, 100.f) + , _shiftMeridianBy180("shiftMeiridian", "Shift Meridian by 180 deg", false) , _debugProjectionTextureRotation("debug.projectionTextureRotation", "Projection Texture Rotation", 0.f, 0.f, 360.f) , _programObject(nullptr) , _fboProgramObject(nullptr) @@ -152,14 +161,19 @@ RenderablePlanetProjection::RenderablePlanetProjection(const ghoul::Dictionary& // as the requirements are fixed (ab) std::string texturePath = ""; success = dictionary.getValue("Textures.Color", texturePath); - if (success){ + if (success) { _colorTexturePath = absPath(texturePath); } std::string heightMapPath = ""; success = dictionary.getValue("Textures.Height", heightMapPath); - if (success) + if (success) { _heightMapTexturePath = absPath(heightMapPath); + } + + if (dictionary.hasKeyAndValue(keyMeridianShift)) { + _shiftMeridianBy180 = dictionary.value(keyMeridianShift); + } glm::vec2 radius = glm::vec2(1.0, 9.0); dictionary.getValue(keyRadius, radius); @@ -176,6 +190,8 @@ RenderablePlanetProjection::RenderablePlanetProjection(const ghoul::Dictionary& addProperty(_heightExaggeration); addProperty(_debugProjectionTextureRotation); + + addProperty(_shiftMeridianBy180); } RenderablePlanetProjection::~RenderablePlanetProjection() {} @@ -416,7 +432,9 @@ void RenderablePlanetProjection::render(const RenderData& data) { //_programObject->setUniform("debug_projectionTextureRotation", glm::radians(_debugProjectionTextureRotation.value())); //setPscUniforms(*_programObject.get(), data.camera, data.position); - + + _programObject->setUniform("shiftMeridian", _shiftMeridianBy180); + ghoul::opengl::TextureUnit unit[3]; unit[0].activate(); _baseTexture->bind(); diff --git a/modules/newhorizons/rendering/renderableplanetprojection.h b/modules/newhorizons/rendering/renderableplanetprojection.h index 5fb9963a9a..8c09ba32bd 100644 --- a/modules/newhorizons/rendering/renderableplanetprojection.h +++ b/modules/newhorizons/rendering/renderableplanetprojection.h @@ -76,6 +76,8 @@ private: std::unique_ptr _baseTexture; std::unique_ptr _heightMapTexture; + properties::BoolProperty _shiftMeridianBy180; + properties::FloatProperty _heightExaggeration; properties::FloatProperty _debugProjectionTextureRotation; diff --git a/modules/newhorizons/shaders/renderablePlanetProjection_fs.glsl b/modules/newhorizons/shaders/renderablePlanetProjection_fs.glsl index d8b11e1297..34020b7eef 100644 --- a/modules/newhorizons/shaders/renderablePlanetProjection_fs.glsl +++ b/modules/newhorizons/shaders/renderablePlanetProjection_fs.glsl @@ -83,8 +83,6 @@ void main() { inRange(projected.y, 0, 1)) && dot(v_b, normal) < 0 ) { - // The 1-x is in this texture call because of flipped textures - // to be fixed soon ---abock color = texture(projectionTexture, vec2(projected.x, projected.y)); stencil = vec4(1.0); } diff --git a/modules/newhorizons/shaders/renderablePlanet_fs.glsl b/modules/newhorizons/shaders/renderablePlanet_fs.glsl index 85eb2e1d8e..01952d4030 100644 --- a/modules/newhorizons/shaders/renderablePlanet_fs.glsl +++ b/modules/newhorizons/shaders/renderablePlanet_fs.glsl @@ -32,6 +32,7 @@ in vec2 vs_st; uniform sampler2D baseTexture; uniform sampler2D projectionTexture; +uniform bool shiftMeridian; uniform float _projectionFading; @@ -39,6 +40,11 @@ uniform vec4 objpos; uniform vec3 sun_pos; Fragment getFragment() { + vec2 st = vs_st; + if (shiftMeridian) { + st.s += 0.5; + } + // directional lighting vec3 origin = vec3(0.0); vec4 spec = vec4(0.0); @@ -49,13 +55,12 @@ Fragment getFragment() { vec3 l_dir = normalize(l_pos-objpos.xyz); float terminatorBrightness = 0.4; float intensity = min(max(5*dot(n,l_dir), terminatorBrightness), 1); - float shine = 0.0001; vec4 specular = vec4(0.1); vec4 ambient = vec4(0.f,0.f,0.f,1); - vec4 textureColor = texture(baseTexture, vs_st); + vec4 textureColor = texture(baseTexture, st); vec4 projectionColor = texture(projectionTexture, vs_st); if (projectionColor.a != 0.0) { textureColor.rgb = mix( diff --git a/modules/newhorizons/shaders/renderablePlanet_vs.glsl b/modules/newhorizons/shaders/renderablePlanet_vs.glsl index 22e8c00bfb..002a2a889c 100644 --- a/modules/newhorizons/shaders/renderablePlanet_vs.glsl +++ b/modules/newhorizons/shaders/renderablePlanet_vs.glsl @@ -44,9 +44,16 @@ uniform mat4 modelViewProjectionTransform; uniform bool _hasHeightMap; uniform float _heightExaggeration; uniform sampler2D heightTexture; +uniform bool shiftMeridian; void main() { vs_st = in_st; + + vec2 st = in_st; + if (shiftMeridian) { + st.s += 0.5; + } + vec4 tmp = in_position; // this is wrong for the normal. @@ -55,7 +62,7 @@ void main() { if (_hasHeightMap) { - float height = texture(heightTexture, in_st).r; + float height = texture(heightTexture, st).s; vec3 displacementDirection = (normalize(tmp.xyz)); float displacementFactor = height * _heightExaggeration / 750.0; tmp.xyz = tmp.xyz + displacementDirection * displacementFactor; From 437db6c6f6a82028e1ba2f7acc0c912c3d5ea337 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Sun, 5 Mar 2017 17:27:43 -0500 Subject: [PATCH 92/96] Rename PlutoProjection to Pluto --- .../scene/missions/newhorizons/pluto/pluto/pluto.mod | 10 +++++----- scripts/bind_keys_newhorizons.lua | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/data/scene/missions/newhorizons/pluto/pluto/pluto.mod b/data/scene/missions/newhorizons/pluto/pluto/pluto.mod index e512b74708..53118f9e84 100644 --- a/data/scene/missions/newhorizons/pluto/pluto/pluto.mod +++ b/data/scene/missions/newhorizons/pluto/pluto/pluto.mod @@ -30,9 +30,9 @@ return { }, }, }, - -- PlutoProjection module + -- Pluto module { - Name = "PlutoProjection", + Name = "Pluto", Parent = "PlutoBarycenter", Renderable = { Type = "RenderablePlanetProjection", @@ -184,7 +184,7 @@ return { }, { Name = "PlutoText", - Parent = "PlutoProjection", + Parent = "Pluto", Renderable = { Type = "RenderablePlane", Size = {1.0, 6.3}, @@ -202,7 +202,7 @@ return { }, { Name = "PlutoTexture", - Parent = "PlutoProjection", + Parent = "Pluto", Renderable = { Type = "RenderablePlane", Size = {1.0, 6.4}, @@ -220,7 +220,7 @@ return { }, { Name = "PlutoShadow", - Parent = "PlutoProjection", + Parent = "Pluto", Renderable = { Type = "RenderableShadowCylinder", TerminatorType = "PENUMBRAL", diff --git a/scripts/bind_keys_newhorizons.lua b/scripts/bind_keys_newhorizons.lua index 4d0310a146..f48117f86b 100644 --- a/scripts/bind_keys_newhorizons.lua +++ b/scripts/bind_keys_newhorizons.lua @@ -17,7 +17,7 @@ openspace.bindKey( ) openspace.bindKey( "s", - "openspace.setPropertyValue('Interaction.origin', 'PlutoProjection')", + "openspace.setPropertyValue('Interaction.origin', 'Pluto')", "Sets the focus of the camera on 'Pluto'" ) openspace.bindKey( @@ -38,7 +38,7 @@ openspace.bindKey( openspace.bindKey( "F8", - "openspace.setPropertyValue('PlutoProjection.renderable.ProjectionComponent.clearAllProjections', true);" .. + "openspace.setPropertyValue('Pluto.renderable.ProjectionComponent.clearAllProjections', true);" .. "openspace.setPropertyValue('Charon.renderable.ProjectionComponent.clearAllProjections', true);", "Removes all image projections from Pluto and Charon." ) @@ -46,19 +46,19 @@ openspace.bindKey( openspace.bindKey( "F9", "openspace.time.setTime('2015-07-14T09:00:00.00');" .. - "openspace.setPropertyValue('PlutoProjection.renderable.clearAllProjections', true);" .. + "openspace.setPropertyValue('Pluto.renderable.clearAllProjections', true);" .. "openspace.setPropertyValue('Charon.renderable.clearAllProjections', true);", "Jumps to the 14th of July 2015 at 0900 UTC and clears all projections." ) openspace.bindKey( "KP_8", - helper.property.increment('PlutoProjection.renderable.heightExaggeration', 2), + helper.property.increment('Pluto.renderable.heightExaggeration', 0.1), "Increases the height map exaggeration on Pluto." ) openspace.bindKey( "KP_2", - helper.property.decrement('PlutoProjection.renderable.heightExaggeration', 2), + helper.property.decrement('Pluto.renderable.heightExaggeration', 0.1), "Decreases the height map exaggeration on Pluto." ) openspace.bindKey( @@ -129,7 +129,7 @@ openspace.bindKey("p", helper.property.invert('Ganymede.renderable.performProjection') .. helper.property.invert('Europa.renderable.performProjection') .. helper.property.invert('Callisto.renderable.performProjection') .. - helper.property.invert('PlutoProjection.renderable.performProjection') .. + helper.property.invert('Pluto.renderable.performProjection') .. helper.property.invert('Charon.renderable.performProjection'), "Enables or disables the image projection on the different available objects." ) From ad2b627c0e7c47f914dd8562cde260c1cbacf2b7 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Sun, 5 Mar 2017 17:28:06 -0500 Subject: [PATCH 93/96] Fix LogFactory to actually use the presented values --- src/engine/logfactory.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/engine/logfactory.cpp b/src/engine/logfactory.cpp index bdc7d0498a..cddfd946b2 100644 --- a/src/engine/logfactory.cpp +++ b/src/engine/logfactory.cpp @@ -130,27 +130,27 @@ std::unique_ptr createLog(const ghoul::Dictionary& dictiona // the rest are optional bool append = true; if (dictionary.hasKeyAndValue(keyAppend)) { - dictionary.value(keyAppend); + append = dictionary.value(keyAppend); } bool timeStamp = true; if (dictionary.hasKeyAndValue(keyTimeStamping)) { - dictionary.value(keyTimeStamping); + timeStamp = dictionary.value(keyTimeStamping); } bool dateStamp = true; if (dictionary.hasKeyAndValue(keyDateStamping)) { - dictionary.value(keyDateStamping); + dateStamp = dictionary.value(keyDateStamping); } bool categoryStamp = true; if (dictionary.hasKeyAndValue(keyCategoryStamping)) { - dictionary.value(keyCategoryStamping); + categoryStamp = dictionary.value(keyCategoryStamping); } bool logLevelStamp = true; if (dictionary.hasKeyAndValue(keyLogLevelStamping)) { - dictionary.value(keyLogLevelStamping); + logLevelStamp = dictionary.value(keyLogLevelStamping); } std::string logLevel; if (dictionary.hasKeyAndValue(keyLogLevel)) { - dictionary.value(keyLogLevel); + logLevel = dictionary.value(keyLogLevel); } From 6aa774283d310037c38cab0fd49372339b9eb204 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Sun, 5 Mar 2017 17:46:29 -0500 Subject: [PATCH 94/96] Make Labelparser more robust by ignoring whitespaces --- modules/newhorizons/util/labelparser.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/modules/newhorizons/util/labelparser.cpp b/modules/newhorizons/util/labelparser.cpp index a6e734be12..6f3a72986c 100644 --- a/modules/newhorizons/util/labelparser.cpp +++ b/modules/newhorizons/util/labelparser.cpp @@ -185,12 +185,13 @@ bool LabelParser::create() { do { std::getline(file, line); - std::string read = line.substr(0, line.find_first_of(" ")); line.erase(std::remove(line.begin(), line.end(), '"'), line.end()); line.erase(std::remove(line.begin(), line.end(), ' '), line.end()); line.erase(std::remove(line.begin(), line.end(), '\r'), line.end()); + std::string read = line.substr(0, line.find_first_of("=")); + _detectorType = "CAMERA"; //default value /* Add more */ @@ -218,15 +219,19 @@ bool LabelParser::create() { if (read == "START_TIME"){ - std::string start = line.substr(line.find("=") + 2); + std::string start = line.substr(line.find("=") + 1); start.erase(std::remove(start.begin(), start.end(), ' '), start.end()); startTime = SpiceManager::ref().ephemerisTimeFromDate(start); count++; getline(file, line); - read = line.substr(0, line.find_first_of(" ")); + line.erase(std::remove(line.begin(), line.end(), '"'), line.end()); + line.erase(std::remove(line.begin(), line.end(), ' '), line.end()); + line.erase(std::remove(line.begin(), line.end(), '\r'), line.end()); + + read = line.substr(0, line.find_first_of("=")); if (read == "STOP_TIME"){ - std::string stop = line.substr(line.find("=") + 2); + std::string stop = line.substr(line.find("=") + 1); stop.erase( std::remove_if( stop.begin(), From 9b92a4e9caca196dc4d49da1082da513493b61c4 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Sun, 5 Mar 2017 18:46:31 -0500 Subject: [PATCH 95/96] Reenable Hybridparser (closes #221) --- modules/newhorizons/rendering/renderablefov.h | 2 +- modules/newhorizons/util/hongkangparser.cpp | 1 + modules/newhorizons/util/imagesequencer.cpp | 3 ++- modules/newhorizons/util/projectioncomponent.cpp | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/newhorizons/rendering/renderablefov.h b/modules/newhorizons/rendering/renderablefov.h index b28ef47cc4..c57091cd09 100644 --- a/modules/newhorizons/rendering/renderablefov.h +++ b/modules/newhorizons/rendering/renderablefov.h @@ -84,7 +84,7 @@ public: // instance variables int _nrInserted = 0; bool _rebuild = false; - bool _interceptTag[8]; + bool _interceptTag[35]; bool _withinFOV; std::vector _projectionBounds; psc _interceptVector; diff --git a/modules/newhorizons/util/hongkangparser.cpp b/modules/newhorizons/util/hongkangparser.cpp index cd6ef04e84..5e5ad9d345 100644 --- a/modules/newhorizons/util/hongkangparser.cpp +++ b/modules/newhorizons/util/hongkangparser.cpp @@ -120,6 +120,7 @@ bool HongKangParser::create() { if (extension == "txt") { // Hong Kang. pre-parsed playbook std::ifstream file; file.exceptions(std::ofstream::failbit | std::ofstream::badbit); + file.open(absPath(_fileName)); //std::ifstream file(_fileName , std::ios::binary); //if (!file.good()){ // LERROR("Failed to open event file '" << _fileName << "'"); diff --git a/modules/newhorizons/util/imagesequencer.cpp b/modules/newhorizons/util/imagesequencer.cpp index 55c5b75245..70883e2a85 100644 --- a/modules/newhorizons/util/imagesequencer.cpp +++ b/modules/newhorizons/util/imagesequencer.cpp @@ -388,7 +388,8 @@ void ImageSequencer::runSequenceParser(SequenceParser* parser){ std::vector captureProgression = parser->getCaptureProgression(); //in5 // check for sanity - if (translations.empty() || imageData.empty() || instrumentTimes.empty() || targetTimes.empty() || captureProgression.empty()) { + //if (translations.empty() || imageData.empty() || instrumentTimes.empty() || targetTimes.empty() || captureProgression.empty()) { + if (imageData.empty() || instrumentTimes.empty() || targetTimes.empty() || captureProgression.empty()) { LERROR("Missing sequence data"); return; } diff --git a/modules/newhorizons/util/projectioncomponent.cpp b/modules/newhorizons/util/projectioncomponent.cpp index e76ce80ff0..e6e542c16a 100644 --- a/modules/newhorizons/util/projectioncomponent.cpp +++ b/modules/newhorizons/util/projectioncomponent.cpp @@ -270,7 +270,7 @@ void ProjectionComponent::initialize(const ghoul::Dictionary& dictionary) { translationDictionary)); std::string _eventFile; - bool foundEventFile = dictionary.getValue("Projection.EventFile", _eventFile); + bool foundEventFile = dictionary.getValue("EventFile", _eventFile); if (foundEventFile) { //then read playbook _eventFile = absPath(_eventFile); From dcc9d6228d9ee1c95f0425942863be191ac07e42 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Sun, 5 Mar 2017 20:08:24 -0500 Subject: [PATCH 96/96] Some minor cleanup --- data/tasks/default.task | 4 +-- include/openspace/util/task.h | 12 +++++-- include/openspace/util/taskloader.h | 3 +- .../galaxy/tasks/milkywayconversiontask.cpp | 2 ++ .../tasks/kameleondocumentationtask.cpp | 4 ++- .../tasks/kameleondocumentationtask.h | 3 ++ .../tasks/kameleonmetadatatojsontask.cpp | 20 ++++++----- .../tasks/kameleonmetadatatojsontask.h | 3 ++ src/util/task.cpp | 34 +++++++++---------- 9 files changed, 52 insertions(+), 33 deletions(-) diff --git a/data/tasks/default.task b/data/tasks/default.task index 9f64865d8e..1170166620 100644 --- a/data/tasks/default.task +++ b/data/tasks/default.task @@ -1,3 +1,3 @@ return { - "kameleonmetadatatojson" -} \ No newline at end of file + "kameleonmetadatatojson" +} diff --git a/include/openspace/util/task.h b/include/openspace/util/task.h index 23844f8dfe..dc5cc69c7f 100644 --- a/include/openspace/util/task.h +++ b/include/openspace/util/task.h @@ -26,11 +26,14 @@ #define __OPENSPACE_CORE___TASK___H__ #include -#include -#include +#include + +namespace ghoul { class Dictionary; } namespace openspace { +namespace documentation { struct Documentation; } + class Task { public: using ProgressCallback = std::function; @@ -38,7 +41,10 @@ public: virtual ~Task() = default; virtual void perform(const ProgressCallback& onProgress) = 0; virtual std::string description() = 0; - static std::unique_ptr createFromDictionary(const ghoul::Dictionary& dictionary); + + static std::unique_ptr createFromDictionary( + const ghoul::Dictionary& dictionary + ); static documentation::Documentation documentation(); }; diff --git a/include/openspace/util/taskloader.h b/include/openspace/util/taskloader.h index 4b4bf18c6a..4081523c7d 100644 --- a/include/openspace/util/taskloader.h +++ b/include/openspace/util/taskloader.h @@ -30,12 +30,13 @@ #include namespace openspace { + class TaskLoader { public: std::vector> tasksFromDictionary(const ghoul::Dictionary& dictionary); std::vector> tasksFromFile(const std::string& path); }; -} +} // namespace openspace #endif // __OPENSPACE_CORE___TASKLOADER___H__ diff --git a/modules/galaxy/tasks/milkywayconversiontask.cpp b/modules/galaxy/tasks/milkywayconversiontask.cpp index 189a6ea23d..9a32d4cce8 100644 --- a/modules/galaxy/tasks/milkywayconversiontask.cpp +++ b/modules/galaxy/tasks/milkywayconversiontask.cpp @@ -30,6 +30,8 @@ #include +#include + namespace { const char* KeyInFilenamePrefix = "InFilenamePrefix"; const char* KeyInFilenameSuffix = "InFilenameSuffix"; diff --git a/modules/kameleonvolume/tasks/kameleondocumentationtask.cpp b/modules/kameleonvolume/tasks/kameleondocumentationtask.cpp index a8c2a275fb..3d0901b5f1 100644 --- a/modules/kameleonvolume/tasks/kameleondocumentationtask.cpp +++ b/modules/kameleonvolume/tasks/kameleondocumentationtask.cpp @@ -23,6 +23,7 @@ ****************************************************************************************/ #include + #include #include @@ -58,7 +59,8 @@ KameleonDocumentationTask::KameleonDocumentationTask(const ghoul::Dictionary& di } std::string KameleonDocumentationTask::description() { - return "Extract metadata from cdf-file " + _inputPath + " and output html documentation to " + _outputPath; + return "Extract metadata from cdf-file " + _inputPath + + " and output html documentation to " + _outputPath; } void KameleonDocumentationTask::perform(const Task::ProgressCallback & progressCallback) { diff --git a/modules/kameleonvolume/tasks/kameleondocumentationtask.h b/modules/kameleonvolume/tasks/kameleondocumentationtask.h index 90c133a07f..9938f29979 100644 --- a/modules/kameleonvolume/tasks/kameleondocumentationtask.h +++ b/modules/kameleonvolume/tasks/kameleondocumentationtask.h @@ -27,6 +27,8 @@ #include +#include + namespace openspace { class KameleonDocumentationTask : public Task { @@ -35,6 +37,7 @@ public: std::string description() override; void perform(const Task::ProgressCallback& progressCallback) override; static documentation::Documentation documentation(); + private: std::string _inputPath; std::string _outputPath; diff --git a/modules/kameleonvolume/tasks/kameleonmetadatatojsontask.cpp b/modules/kameleonvolume/tasks/kameleonmetadatatojsontask.cpp index 50e1775df8..19b8c81679 100644 --- a/modules/kameleonvolume/tasks/kameleonmetadatatojsontask.cpp +++ b/modules/kameleonvolume/tasks/kameleonmetadatatojsontask.cpp @@ -23,11 +23,14 @@ ****************************************************************************************/ #include + #include -#include + #include + #include #include + #include namespace { @@ -37,7 +40,9 @@ namespace { namespace openspace { -KameleonMetadataToJsonTask::KameleonMetadataToJsonTask(const ghoul::Dictionary& dictionary) { +KameleonMetadataToJsonTask::KameleonMetadataToJsonTask( + const ghoul::Dictionary& dictionary) +{ openspace::documentation::testSpecificationAndThrow( documentation(), dictionary, @@ -49,13 +54,15 @@ KameleonMetadataToJsonTask::KameleonMetadataToJsonTask(const ghoul::Dictionary& } std::string KameleonMetadataToJsonTask::description() { - return "Extract metadata from cdf-file " + _inputPath + " and write as json to " + _outputPath; + return "Extract metadata from cdf-file " + _inputPath + + " and write as json to " + _outputPath; } -void KameleonMetadataToJsonTask::perform(const Task::ProgressCallback & progressCallback) { +void KameleonMetadataToJsonTask::perform(const Task::ProgressCallback& progressCallback) { KameleonVolumeReader reader(_inputPath); ghoul::Dictionary dictionary = reader.readMetaData(); progressCallback(0.5f); + ghoul::DictionaryJsonFormatter formatter; std::string json = formatter.format(dictionary); std::ofstream output(_outputPath); @@ -63,8 +70,7 @@ void KameleonMetadataToJsonTask::perform(const Task::ProgressCallback & progress progressCallback(1.0f); } -documentation::Documentation KameleonMetadataToJsonTask::documentation() -{ +documentation::Documentation KameleonMetadataToJsonTask::documentation() { using namespace documentation; return { "KameleonMetadataToJsonTask", @@ -89,6 +95,4 @@ documentation::Documentation KameleonMetadataToJsonTask::documentation() }; } - - } // namespace openspace diff --git a/modules/kameleonvolume/tasks/kameleonmetadatatojsontask.h b/modules/kameleonvolume/tasks/kameleonmetadatatojsontask.h index 144b9a9330..42bf6a84b3 100644 --- a/modules/kameleonvolume/tasks/kameleonmetadatatojsontask.h +++ b/modules/kameleonvolume/tasks/kameleonmetadatatojsontask.h @@ -27,6 +27,8 @@ #include +#include + namespace openspace { class KameleonMetadataToJsonTask : public Task { @@ -35,6 +37,7 @@ public: std::string description() override; void perform(const Task::ProgressCallback& progressCallback) override; static documentation::Documentation documentation(); + private: std::string _inputPath; std::string _outputPath; diff --git a/src/util/task.cpp b/src/util/task.cpp index 044e8c44fd..891614c1c2 100644 --- a/src/util/task.cpp +++ b/src/util/task.cpp @@ -23,22 +23,20 @@ ****************************************************************************************/ #include + #include + +#include #include #include -#include - -namespace { - const std::string _loggerCat = "Task"; -} namespace openspace { documentation::Documentation Task::documentation() { - using namespace openspace::documentation; - return{ - "Renderable", - "renderable", + using namespace documentation; + return { + "Task", + "core_task", { { "Type", @@ -54,17 +52,17 @@ documentation::Documentation Task::documentation() { } std::unique_ptr Task::createFromDictionary(const ghoul::Dictionary& dictionary) { - openspace::documentation::testSpecificationAndThrow(documentation::Documentation(), dictionary, "Task"); + openspace::documentation::testSpecificationAndThrow( + documentation::Documentation(), + dictionary, + "Task" + ); + std::string taskType = dictionary.value("Type"); auto factory = FactoryManager::ref().factory(); + std::unique_ptr task = factory->create(taskType, dictionary); - - if (task == nullptr) { - LERROR("Failed to create a Task object of type '" << taskType << "'"); - return nullptr; - } - - return std::move(task); + return task; } -} \ No newline at end of file +} // namespace openspace