From 4952f8f977a01afd6db3112c62d5ed9f92ba8963 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Sun, 10 Jun 2018 04:47:34 +0000 Subject: [PATCH] Code cleanup branch (#618) * Make height map fallback layer work again * Add documentation to joystick button bindings * Removed grouped property headers * Add new version number constant generated by CMake * Make Joystick deadzone work properly * Change the startup date on Earth to today * Fix key modifier handling * Add debugging indices for TreeNodeDebugging * Fix script schedule for OsirisRex * Do not open Mission schedule automatically * Upload default projection texture automatically * General code cleanup * Fix check_style_guide warnings * Remove .clang-format * MacOS compile fixes * Clang analyzer fixes --- .clang-format | 47 - apps/OpenSpace/main.cpp | 2 + apps/Sync/main.cpp | 5 +- data/assets/examples/dashboarditems.asset | 43 + .../digitaluniverse/globularclusters.asset | 1 + .../scene/digitaluniverse/h2regions.asset | 3 +- .../digitaluniverse/obassociations.asset | 1 + .../scene/digitaluniverse/openclusters.asset | 1 + .../digitaluniverse/planetarynebulae.asset | 1 + .../scene/digitaluniverse/pulsars.asset | 3 +- .../digitaluniverse/supernovaremnants.asset | 1 + .../missions/osirisrex/script_schedule.asset | 18 +- .../solarsystem/planets/earth/earth.asset | 3 +- data/assets/scene/solarsystem/sun/sun.asset | 1 + data/assets/util/default_joystick.asset | 68 +- ext/ghoul | 2 +- ext/sgct | 2 +- .../openspace/documentation/documentation.h | 120 +- .../documentation/documentationengine.h | 21 +- include/openspace/documentation/verifier.h | 463 +-- include/openspace/engine/downloadmanager.h | 44 +- include/openspace/engine/logfactory.h | 1 + include/openspace/engine/moduleengine.h | 29 +- include/openspace/engine/moduleengine.inl | 43 + include/openspace/engine/openspaceengine.h | 13 +- include/openspace/engine/syncengine.h | 3 +- .../openspace/engine/virtualpropertymanager.h | 4 +- .../engine/wrapper/sgctwindowwrapper.h | 3 +- .../openspace/engine/wrapper/windowwrapper.h | 6 +- .../openspace/interaction/delayedvariable.h | 2 +- include/openspace/interaction/inputstate.h | 16 +- include/openspace/interaction/interpolator.h | 6 +- .../openspace/interaction/interpolator.inl | 12 +- .../interaction/joystickcamerastates.h | 7 +- .../openspace/interaction/keybindingmanager.h | 25 +- .../openspace/interaction/keyframenavigator.h | 6 +- .../openspace/interaction/navigationhandler.h | 22 +- .../openspace/interaction/orbitalnavigator.h | 11 +- include/openspace/mission/mission.h | 30 +- include/openspace/mission/missionmanager.h | 1 - include/openspace/network/messagestructures.h | 6 +- include/openspace/network/networkengine.h | 6 +- .../openspace/network/parallelconnection.h | 22 +- include/openspace/network/parallelpeer.h | 46 +- include/openspace/network/parallelserver.h | 21 +- .../openspace/performance/performancelayout.h | 12 +- .../performance/performancemanager.h | 30 +- .../performance/performancemeasurement.h | 1 - include/openspace/properties/matrixproperty.h | 50 - .../properties/numericalproperty.inl | 72 +- include/openspace/properties/optionproperty.h | 40 +- include/openspace/properties/property.h | 188 +- .../openspace/properties/propertydelegate.h | 6 +- .../openspace/properties/propertydelegate.inl | 6 +- include/openspace/properties/propertyowner.h | 122 +- include/openspace/properties/scalarproperty.h | 47 - .../openspace/properties/selectionproperty.h | 8 +- .../openspace/properties/templateproperty.h | 32 +- .../openspace/properties/templateproperty.inl | 53 +- include/openspace/query/query.h | 2 +- include/openspace/rendering/abufferrenderer.h | 40 +- include/openspace/rendering/dashboard.h | 1 - include/openspace/rendering/dashboarditem.h | 6 +- include/openspace/rendering/deferredcaster.h | 3 - .../rendering/deferredcasterlistener.h | 4 +- .../rendering/deferredcastermanager.h | 2 - .../openspace/rendering/framebufferrenderer.h | 37 +- include/openspace/rendering/loadingscreen.h | 27 +- include/openspace/rendering/luaconsole.h | 27 +- .../openspace/rendering/raycasterlistener.h | 6 +- .../openspace/rendering/raycastermanager.h | 2 +- include/openspace/rendering/renderable.h | 16 +- include/openspace/rendering/renderengine.h | 30 +- include/openspace/rendering/renderer.h | 8 +- .../rendering/screenspacerenderable.h | 20 +- .../openspace/rendering/transferfunction.h | 27 +- include/openspace/rendering/volume.h | 12 +- include/openspace/rendering/volumeraycaster.h | 25 +- include/openspace/scene/asset.h | 49 +- .../assetlistener.h} | 35 +- include/openspace/scene/assetloader.h | 48 +- include/openspace/scene/assetmanager.h | 12 +- include/openspace/scene/rotation.h | 7 +- include/openspace/scene/scale.h | 11 +- include/openspace/scene/scene.h | 40 +- include/openspace/scene/scenegraphnode.h | 20 +- include/openspace/scene/sceneinitializer.h | 12 +- include/openspace/scene/scenelicense.h | 10 +- include/openspace/scene/scenelicensewriter.h | 6 +- include/openspace/scene/translation.h | 6 +- include/openspace/scripting/lualibrary.h | 1 - include/openspace/scripting/scriptengine.h | 21 +- include/openspace/scripting/scriptscheduler.h | 64 +- .../scripting/systemcapabilitiesbinding.h | 4 +- .../util/blockplaneintersectiongeometry.h | 7 +- include/openspace/util/boxgeometry.h | 6 +- include/openspace/util/camera.h | 152 +- include/openspace/util/concurrentjobmanager.h | 11 +- .../openspace/util/concurrentjobmanager.inl | 11 +- include/openspace/util/concurrentqueue.h | 2 + include/openspace/util/concurrentqueue.inl | 6 + include/openspace/util/distanceconversion.h | 3 - include/openspace/util/factorymanager.h | 13 +- include/openspace/util/factorymanager.inl | 2 + include/openspace/util/gpudata.h | 16 +- include/openspace/util/histogram.h | 22 +- include/openspace/util/httprequest.h | 66 +- include/openspace/util/job.h | 45 + include/openspace/util/keys.h | 502 +-- include/openspace/util/mouse.h | 8 +- include/openspace/util/openspacemodule.h | 7 +- .../openspace/util/powerscaledcoordinate.h | 7 +- include/openspace/util/powerscaledscalar.h | 19 +- include/openspace/util/powerscaledsphere.h | 27 +- include/openspace/util/progressbar.h | 3 +- .../openspace/util/resourcesynchronization.h | 14 +- include/openspace/util/screenlog.h | 4 +- include/openspace/util/spicemanager.h | 486 ++- include/openspace/util/syncable.h | 54 + include/openspace/util/syncbuffer.h | 72 +- include/openspace/util/syncbuffer.inl | 57 + include/openspace/util/syncdata.h | 74 +- include/openspace/util/syncdata.inl | 75 + .../openspace/util/synchronizationwatcher.h | 5 +- include/openspace/util/task.h | 1 + include/openspace/util/taskloader.h | 11 +- include/openspace/util/threadpool.h | 6 +- include/openspace/util/time.h | 12 +- include/openspace/util/timeconversion.h | 2 - include/openspace/util/timeline.h | 14 +- include/openspace/util/timeline.inl | 126 +- include/openspace/util/timemanager.h | 14 +- include/openspace/util/timerange.h | 30 +- .../openspace/util/transformationmanager.h | 29 +- modules/atmosphere/atmospheremodule.cpp | 1 + .../rendering/atmospheredeferredcaster.cpp | 2854 +++++++------- .../rendering/renderableatmosphere.cpp | 61 +- modules/base/basemodule.cpp | 23 +- modules/base/dashboard/dashboarditemangle.cpp | 64 +- modules/base/dashboard/dashboarditemangle.h | 10 +- modules/base/dashboard/dashboarditemdate.cpp | 17 +- modules/base/dashboard/dashboarditemdate.h | 2 +- .../base/dashboard/dashboarditemdistance.cpp | 91 +- .../base/dashboard/dashboarditemdistance.h | 5 +- .../base/dashboard/dashboarditemframerate.cpp | 52 +- .../base/dashboard/dashboarditemframerate.h | 9 +- .../base/dashboard/dashboarditemmission.cpp | 98 +- modules/base/dashboard/dashboarditemmission.h | 6 +- .../dashboarditemparallelconnection.cpp | 72 +- .../dashboarditemparallelconnection.h | 6 +- .../dashboarditemsimulationincrement.cpp | 43 +- .../dashboarditemsimulationincrement.h | 6 +- .../base/dashboard/dashboarditemspacing.cpp | 4 +- modules/base/dashboard/dashboarditemspacing.h | 2 +- modules/base/rendering/modelgeometry.cpp | 68 +- modules/base/rendering/modelgeometry.h | 11 +- modules/base/rendering/multimodelgeometry.cpp | 7 +- modules/base/rendering/renderablemodel.cpp | 29 +- modules/base/rendering/renderablemodel.h | 4 +- modules/base/rendering/renderableplane.cpp | 33 +- modules/base/rendering/renderableplane.h | 15 +- .../rendering/renderableplaneimagelocal.cpp | 9 +- .../rendering/renderableplaneimagelocal.h | 2 +- .../rendering/renderableplaneimageonline.cpp | 9 +- .../rendering/renderableplaneimageonline.h | 6 +- modules/base/rendering/renderablesphere.cpp | 72 +- modules/base/rendering/renderablesphere.h | 9 +- .../rendering/renderablesphericalgrid.cpp | 35 +- .../base/rendering/renderablesphericalgrid.h | 21 +- modules/base/rendering/renderabletrail.cpp | 40 +- modules/base/rendering/renderabletrail.h | 3 +- .../base/rendering/renderabletrailorbit.cpp | 56 +- modules/base/rendering/renderabletrailorbit.h | 10 +- .../rendering/renderabletrailtrajectory.cpp | 33 +- .../rendering/renderabletrailtrajectory.h | 15 +- .../base/rendering/screenspacedashboard.cpp | 83 +- modules/base/rendering/screenspacedashboard.h | 4 +- .../base/rendering/screenspaceframebuffer.cpp | 47 +- .../base/rendering/screenspaceframebuffer.h | 15 +- .../base/rendering/screenspaceimagelocal.cpp | 13 +- .../base/rendering/screenspaceimagelocal.h | 4 +- .../base/rendering/screenspaceimageonline.cpp | 16 +- .../base/rendering/screenspaceimageonline.h | 8 +- modules/base/rotation/fixedrotation.cpp | 76 +- modules/base/rotation/fixedrotation.h | 2 +- modules/base/rotation/luarotation.cpp | 28 +- modules/base/rotation/luarotation.h | 5 +- modules/base/rotation/staticrotation.cpp | 11 +- modules/base/scale/luascale.cpp | 28 +- modules/base/scale/luascale.h | 4 +- modules/base/scale/staticscale.cpp | 10 +- modules/base/translation/luatranslation.cpp | 39 +- modules/base/translation/luatranslation.h | 5 +- .../base/translation/statictranslation.cpp | 10 +- modules/cefwebgui/cefwebguimodule.cpp | 83 +- modules/cefwebgui/cefwebguimodule.h | 9 +- modules/cefwebgui/include/guirenderhandler.h | 21 +- modules/cefwebgui/src/guirenderhandler.cpp | 50 +- modules/debugging/debuggingmodule.cpp | 5 +- modules/debugging/rendering/debugrenderer.cpp | 101 +- modules/debugging/rendering/debugrenderer.h | 24 +- .../rendering/renderabledebugplane.cpp | 29 +- .../rendering/renderabledebugplane.h | 7 +- .../digitaluniverse/digitaluniversemodule.cpp | 14 +- .../rendering/renderablebillboardscloud.cpp | 3282 ++++++++++------- .../rendering/renderablebillboardscloud.h | 290 +- .../rendering/renderabledumeshes.cpp | 278 +- .../rendering/renderabledumeshes.h | 32 +- .../rendering/renderableplanescloud.cpp | 389 +- .../rendering/renderableplanescloud.h | 34 +- .../rendering/renderablepoints.cpp | 126 +- .../rendering/renderablepoints.h | 125 +- modules/fieldlines/fieldlinesmodule.cpp | 5 +- .../rendering/renderablefieldlines.cpp | 220 +- .../rendering/renderablefieldlines.h | 14 +- .../fieldlinessequencemodule.cpp | 7 +- .../renderablefieldlinessequence.cpp | 234 +- .../rendering/renderablefieldlinessequence.h | 112 +- .../util/fieldlinesstate.cpp | 45 +- .../fieldlinessequence/util/fieldlinesstate.h | 21 +- .../util/kameleonfieldlinehelper.cpp | 40 +- .../util/kameleonfieldlinehelper.h | 2 +- modules/galaxy/galaxymodule.cpp | 8 +- modules/galaxy/rendering/galaxyraycaster.cpp | 70 +- modules/galaxy/rendering/galaxyraycaster.h | 22 +- modules/galaxy/rendering/renderablegalaxy.cpp | 150 +- modules/galaxy/rendering/renderablegalaxy.h | 12 +- .../galaxy/tasks/milkywayconversiontask.cpp | 62 +- modules/galaxy/tasks/milkywayconversiontask.h | 7 +- .../tasks/milkywaypointsconversiontask.cpp | 21 +- .../tasks/milkywaypointsconversiontask.h | 7 +- modules/globebrowsing/CMakeLists.txt | 7 +- modules/globebrowsing/cache/lrucache.h | 8 +- modules/globebrowsing/cache/lrucache.inl | 38 +- .../cache/memoryawaretilecache.cpp | 126 +- .../cache/memoryawaretilecache.h | 39 +- .../globebrowsing/cache/texturecontainer.cpp | 17 +- .../globebrowsing/cache/texturecontainer.h | 8 +- modules/globebrowsing/chunk/chunk.cpp | 86 +- modules/globebrowsing/chunk/chunk.h | 13 +- .../availabletiledataevaluator.cpp | 18 +- .../availabletiledataevaluator.h | 2 +- .../chunklevelevaluator/chunklevelevaluator.h | 4 +- .../chunklevelevaluator/distanceevaluator.cpp | 32 +- .../chunklevelevaluator/distanceevaluator.h | 2 +- .../projectedareaevaluator.cpp | 45 +- .../projectedareaevaluator.h | 3 +- modules/globebrowsing/chunk/chunknode.cpp | 33 +- modules/globebrowsing/chunk/chunknode.h | 6 +- .../chunk/culling/frustumculler.cpp | 17 +- .../chunk/culling/frustumculler.h | 2 +- .../chunk/culling/horizonculler.cpp | 69 +- modules/globebrowsing/geometry/aabb.cpp | 18 - modules/globebrowsing/geometry/aabb.h | 12 +- modules/globebrowsing/geometry/angle.h | 37 +- modules/globebrowsing/geometry/angle.inl | 87 +- modules/globebrowsing/geometry/ellipsoid.cpp | 70 +- modules/globebrowsing/geometry/ellipsoid.h | 8 +- modules/globebrowsing/geometry/geodetic2.cpp | 4 - modules/globebrowsing/geometry/geodetic2.h | 2 +- .../globebrowsing/geometry/geodeticpatch.cpp | 61 +- .../globebrowsing/geometry/geodeticpatch.h | 21 +- modules/globebrowsing/globebrowsingmodule.cpp | 223 +- modules/globebrowsing/globebrowsingmodule.h | 20 +- .../globebrowsing/globebrowsingmodule_lua.inl | 176 +- .../globebrowsing/globes/chunkedlodglobe.cpp | 177 +- .../globebrowsing/globes/chunkedlodglobe.h | 27 +- modules/globebrowsing/globes/pointglobe.cpp | 60 +- modules/globebrowsing/globes/pointglobe.h | 6 +- .../globebrowsing/globes/renderableglobe.cpp | 94 +- .../globebrowsing/globes/renderableglobe.h | 23 +- modules/globebrowsing/meshes/basicgrid.cpp | 27 +- modules/globebrowsing/meshes/basicgrid.h | 19 +- modules/globebrowsing/meshes/grid.cpp | 4 + modules/globebrowsing/meshes/grid.h | 40 +- modules/globebrowsing/meshes/skirtedgrid.cpp | 82 +- modules/globebrowsing/meshes/skirtedgrid.h | 17 +- modules/globebrowsing/meshes/trianglesoup.cpp | 63 +- modules/globebrowsing/meshes/trianglesoup.h | 11 +- modules/globebrowsing/other/lruthreadpool.h | 9 +- modules/globebrowsing/other/lruthreadpool.inl | 20 +- modules/globebrowsing/other/pixelbuffer.cpp | 5 +- modules/globebrowsing/other/pixelbuffer.h | 17 +- .../other/pixelbuffercontainer.h | 42 +- .../other/pixelbuffercontainer.inl | 23 +- .../other/prioritizingconcurrentjobmanager.h | 9 +- .../prioritizingconcurrentjobmanager.inl | 13 +- .../globebrowsing/other/statscollector.cpp | 47 +- modules/globebrowsing/other/statscollector.h | 65 +- .../other/templatedstatscollector.h | 81 + ...lector.inl => templatedstatscollector.inl} | 30 +- modules/globebrowsing/other/timequantizer.cpp | 127 + .../{distanceswitch.cpp => timequantizer.h} | 107 +- .../globebrowsing/rendering/chunkrenderer.cpp | 316 +- .../globebrowsing/rendering/chunkrenderer.h | 7 +- .../rendering/gpu/gpuchunktile.h | 1 - .../rendering/gpu/gpuchunktilepile.cpp | 4 +- .../rendering/gpu/gpuchunktilepile.h | 6 +- .../rendering/gpu/gpuheightlayer.cpp | 4 - .../rendering/gpu/gpuheightlayer.h | 2 - .../globebrowsing/rendering/gpu/gpulayer.cpp | 8 +- .../globebrowsing/rendering/gpu/gpulayer.h | 1 - .../rendering/gpu/gpulayeradjustment.cpp | 7 +- .../rendering/gpu/gpulayeradjustment.h | 3 +- .../rendering/gpu/gpulayergroup.cpp | 10 +- .../rendering/gpu/gpulayergroup.h | 11 +- .../rendering/gpu/gpulayermanager.cpp | 16 +- .../rendering/gpu/gpulayermanager.h | 18 +- .../rendering/gpu/gpulayerrendersettings.h | 1 - .../rendering/gpu/gputiledepthtransform.h | 1 - .../rendering/gpu/gputileuvtransform.cpp | 11 +- .../rendering/gpu/gputileuvtransform.h | 4 +- .../globebrowsing/rendering/layer/layer.cpp | 70 +- modules/globebrowsing/rendering/layer/layer.h | 14 +- .../rendering/layer/layeradjustment.cpp | 63 +- .../rendering/layer/layeradjustment.h | 13 +- .../rendering/layer/layergroup.cpp | 20 +- .../rendering/layer/layergroup.h | 9 +- .../rendering/layer/layergroupid.cpp | 6 +- .../rendering/layer/layermanager.cpp | 115 +- .../rendering/layer/layermanager.h | 22 +- .../rendering/layer/layerrendersettings.cpp | 58 +- .../rendering/layer/layerrendersettings.h | 2 +- .../rendering/layershadermanager.cpp | 73 +- .../rendering/layershadermanager.h | 24 +- .../tile/asynctiledataprovider.cpp | 87 +- .../tile/asynctiledataprovider.h | 28 +- modules/globebrowsing/tile/chunktile.h | 12 +- modules/globebrowsing/tile/pixelregion.cpp | 48 +- modules/globebrowsing/tile/pixelregion.h | 2 +- modules/globebrowsing/tile/rawtile.cpp | 10 - modules/globebrowsing/tile/rawtile.h | 29 +- .../gdalrawtiledatareader.cpp | 60 +- .../rawtiledatareader/gdalrawtiledatareader.h | 22 +- .../tile/rawtiledatareader/gdalwrapper.cpp | 40 +- .../tile/rawtiledatareader/gdalwrapper.h | 9 +- .../tile/rawtiledatareader/iodescription.cpp | 18 +- .../tile/rawtiledatareader/iodescription.h | 5 - .../rawtiledatareader/rawtiledatareader.cpp | 320 +- .../rawtiledatareader/rawtiledatareader.h | 76 +- .../simplerawtiledatareader.cpp | 100 +- .../simplerawtiledatareader.h | 18 +- .../tile/rawtiledatareader/tiledatatype.cpp | 76 +- .../tile/rawtiledatareader/tiledatatype.h | 15 +- modules/globebrowsing/tile/textureformat.h | 1 - modules/globebrowsing/tile/tile.cpp | 24 +- modules/globebrowsing/tile/tile.h | 18 +- modules/globebrowsing/tile/tileindex.cpp | 61 +- modules/globebrowsing/tile/tileindex.h | 37 +- modules/globebrowsing/tile/tileloadjob.cpp | 23 +- modules/globebrowsing/tile/tileloadjob.h | 9 +- modules/globebrowsing/tile/tilemetadata.cpp | 9 +- modules/globebrowsing/tile/tilemetadata.h | 6 +- .../tile/tileprovider/defaulttileprovider.cpp | 104 +- .../tile/tileprovider/defaulttileprovider.h | 47 +- .../tile/tileprovider/singleimageprovider.cpp | 12 +- .../tile/tileprovider/singleimageprovider.h | 4 +- .../sizereferencetileprovider.cpp | 68 +- .../tileprovider/sizereferencetileprovider.h | 2 +- .../tileprovider/temporaltileprovider.cpp | 362 +- .../tile/tileprovider/temporaltileprovider.h | 202 +- .../tile/tileprovider/texttileprovider.cpp | 11 +- .../tile/tileprovider/texttileprovider.h | 10 +- .../tileprovider/tileindextileprovider.cpp | 15 +- .../tile/tileprovider/tileprovider.cpp | 132 +- .../tile/tileprovider/tileprovider.h | 49 +- .../tile/tileprovider/tileproviderbyindex.cpp | 96 +- .../tile/tileprovider/tileproviderbyindex.h | 7 +- .../tile/tileprovider/tileproviderbylevel.cpp | 76 +- .../tile/tileprovider/tileproviderbylevel.h | 11 +- modules/globebrowsing/tile/tileselector.cpp | 49 +- modules/globebrowsing/tile/tileselector.h | 16 +- .../tile/tiletextureinitdata.cpp | 32 +- .../globebrowsing/tile/tiletextureinitdata.h | 9 +- modules/imgui/imguimodule.cpp | 16 +- modules/imgui/imguimodule.h | 1 + modules/imgui/include/gui.h | 81 +- modules/imgui/include/guiassetcomponent.h | 5 +- modules/imgui/include/guicomponent.h | 17 +- .../imgui/include/guiglobebrowsingcomponent.h | 4 - modules/imgui/include/guiiswacomponent.h | 7 +- modules/imgui/include/guiparallelcomponent.h | 4 +- .../imgui/include/guiperformancecomponent.h | 4 +- modules/imgui/include/guipropertycomponent.h | 5 +- modules/imgui/include/guispacetimecomponent.h | 16 +- modules/imgui/src/gui.cpp | 1066 ++---- modules/imgui/src/guiassetcomponent.cpp | 46 +- modules/imgui/src/guicomponent.cpp | 4 +- modules/imgui/src/guifilepathcomponent.cpp | 7 +- .../imgui/src/guiglobebrowsingcomponent.cpp | 68 +- modules/imgui/src/guihelpcomponent.cpp | 4 +- modules/imgui/src/guiiswacomponent.cpp | 105 +- modules/imgui/src/guimissioncomponent.cpp | 23 +- modules/imgui/src/guiparallelcomponent.cpp | 58 +- modules/imgui/src/guiperformancecomponent.cpp | 119 +- modules/imgui/src/guipropertycomponent.cpp | 106 +- modules/imgui/src/guispacetimecomponent.cpp | 115 +- modules/imgui/src/renderproperties.cpp | 52 +- modules/iswa/iswamodule.cpp | 6 + modules/iswa/rendering/datacygnet.cpp | 201 +- modules/iswa/rendering/datacygnet.h | 38 +- modules/iswa/rendering/dataplane.cpp | 84 +- modules/iswa/rendering/dataplane.h | 13 +- modules/iswa/rendering/datasphere.cpp | 68 +- modules/iswa/rendering/datasphere.h | 10 +- modules/iswa/rendering/iswabasegroup.cpp | 58 +- modules/iswa/rendering/iswabasegroup.h | 22 +- modules/iswa/rendering/iswacygnet.cpp | 179 +- modules/iswa/rendering/iswacygnet.h | 133 +- modules/iswa/rendering/iswadatagroup.cpp | 94 +- modules/iswa/rendering/iswadatagroup.h | 9 +- modules/iswa/rendering/iswakameleongroup.cpp | 78 +- modules/iswa/rendering/iswakameleongroup.h | 10 +- modules/iswa/rendering/kameleonplane.cpp | 158 +- modules/iswa/rendering/kameleonplane.h | 46 +- modules/iswa/rendering/screenspacecygnet.cpp | 34 +- modules/iswa/rendering/screenspacecygnet.h | 8 +- modules/iswa/rendering/texturecygnet.cpp | 24 +- modules/iswa/rendering/texturecygnet.h | 6 +- modules/iswa/rendering/textureplane.cpp | 44 +- modules/iswa/rendering/textureplane.h | 12 +- modules/iswa/util/dataprocessor.cpp | 192 +- modules/iswa/util/dataprocessor.h | 57 +- modules/iswa/util/dataprocessorjson.cpp | 105 +- modules/iswa/util/dataprocessorjson.h | 8 +- modules/iswa/util/dataprocessorkameleon.cpp | 218 +- modules/iswa/util/dataprocessorkameleon.h | 24 +- modules/iswa/util/dataprocessortext.cpp | 263 +- modules/iswa/util/dataprocessortext.h | 17 +- modules/iswa/util/iswamanager.cpp | 436 ++- modules/iswa/util/iswamanager.h | 72 +- modules/iswa/util/iswamanager_lua.inl | 9 +- modules/kameleon/include/kameleonhelper.h | 14 +- modules/kameleon/include/kameleonwrapper.h | 144 +- modules/kameleon/src/kameleonhelper.cpp | 36 +- modules/kameleon/src/kameleonwrapper.cpp | 2018 +++++----- modules/kameleonvolume/CMakeLists.txt | 2 +- .../kameleonvolume/kameleonvolumemodule.cpp | 16 +- modules/kameleonvolume/kameleonvolumemodule.h | 4 +- .../kameleonvolume/kameleonvolumereader.cpp | 220 +- modules/kameleonvolume/kameleonvolumereader.h | 36 +- .../rendering/renderablekameleonvolume.cpp | 180 +- .../rendering/renderablekameleonvolume.h | 34 +- .../tasks/kameleondocumentationtask.cpp | 45 +- .../tasks/kameleondocumentationtask.h | 8 +- .../tasks/kameleonmetadatatojsontask.cpp | 26 +- .../tasks/kameleonmetadatatojsontask.h | 8 +- .../tasks/kameleonvolumetorawtask.cpp | 205 +- .../tasks/kameleonvolumetorawtask.h | 13 +- .../multiresvolume/multiresvolumemodule.cpp | 1 + .../multiresvolume/rendering/atlasmanager.cpp | 24 +- .../multiresvolume/rendering/atlasmanager.h | 46 +- .../rendering/histogrammanager.h | 1 + .../rendering/localtfbrickselector.cpp | 1 + .../rendering/multiresvolumeraycaster.cpp | 12 +- .../rendering/multiresvolumeraycaster.h | 10 +- .../rendering/renderablemultiresvolume.cpp | 33 +- .../rendering/renderablemultiresvolume.h | 6 +- .../rendering/tfbrickselector.cpp | 1 + modules/server/CMakeLists.txt | 30 +- modules/server/include/connection.h | 36 +- modules/server/include/connectionpool.h | 23 +- modules/server/include/jsonconverters.h | 29 +- .../include/{ => topics}/authorizationtopic.h | 32 +- modules/server/include/topics/bouncetopic.h | 45 + .../include/{ => topics}/getpropertytopic.h | 17 +- .../include/{ => topics}/luascripttopic.h | 12 +- .../include/{ => topics}/setpropertytopic.h | 13 +- .../include/{ => topics}/subscriptiontopic.h | 28 +- .../server/include/{ => topics}/timetopic.h | 19 +- modules/server/include/{ => topics}/topic.h | 14 +- .../{ => topics}/triggerpropertytopic.h | 12 +- modules/server/servermodule.cpp | 79 +- modules/server/servermodule.h | 18 +- modules/server/src/connection.cpp | 78 +- modules/server/src/connectionpool.cpp | 51 +- modules/server/src/jsonconverters.cpp | 30 +- .../server/src/topics/authorizationtopic.cpp | 54 +- .../src/topics/bouncetopic.cpp} | 20 +- .../server/src/topics/getpropertytopic.cpp | 67 +- modules/server/src/topics/luascripttopic.cpp | 20 +- .../server/src/topics/setpropertytopic.cpp | 44 +- .../server/src/topics/subscriptiontopic.cpp | 55 +- modules/server/src/topics/timetopic.cpp | 48 +- modules/server/src/topics/topic.cpp | 11 +- .../src/topics/triggerpropertytopic.cpp | 30 +- modules/space/rendering/planetgeometry.cpp | 23 +- modules/space/rendering/planetgeometry.h | 12 +- .../renderableconstellationbounds.cpp | 66 +- .../rendering/renderableconstellationbounds.h | 35 +- modules/space/rendering/renderableplanet.cpp | 242 +- modules/space/rendering/renderableplanet.h | 25 +- modules/space/rendering/renderablerings.cpp | 47 +- modules/space/rendering/renderablerings.h | 10 +- modules/space/rendering/renderablestars.cpp | 1145 +++--- modules/space/rendering/renderablestars.h | 152 +- .../space/rendering/simplespheregeometry.cpp | 22 +- .../space/rendering/simplespheregeometry.h | 4 +- modules/space/rotation/spicerotation.cpp | 17 +- modules/space/rotation/spicerotation.h | 2 + modules/space/spacemodule.cpp | 15 +- .../space/translation/keplertranslation.cpp | 66 +- modules/space/translation/keplertranslation.h | 43 +- .../space/translation/spicetranslation.cpp | 11 +- modules/space/translation/tletranslation.cpp | 115 +- modules/space/translation/tletranslation.h | 6 +- modules/spacecraftinstruments/CMakeLists.txt | 1 + .../dashboard/dashboarditeminstruments.cpp | 495 +-- .../dashboard/dashboarditeminstruments.h | 3 +- .../rendering/renderablecrawlingline.cpp | 81 +- .../rendering/renderablecrawlingline.h | 10 +- .../rendering/renderablefov.cpp | 624 +--- .../rendering/renderablefov.h | 13 +- .../rendering/renderablemodelprojection.cpp | 117 +- .../rendering/renderablemodelprojection.h | 22 +- .../rendering/renderableplaneprojection.cpp | 129 +- .../rendering/renderableplaneprojection.h | 33 +- .../rendering/renderableplanetprojection.cpp | 101 +- .../rendering/renderableplanetprojection.h | 22 +- .../rendering/renderableshadowcylinder.cpp | 71 +- .../rendering/renderableshadowcylinder.h | 19 +- .../renderablePlanetProjection_fs.glsl | 4 +- .../renderablePlanetProjection_vs.glsl | 6 +- .../spacecraftinstrumentsmodule.cpp | 6 +- .../spacecraftinstruments/util/decoder.cpp | 14 +- modules/spacecraftinstruments/util/decoder.h | 6 +- .../util/hongkangparser.cpp | 396 +- .../util/hongkangparser.h | 12 +- .../util/image.h} | 58 +- .../util/imagesequencer.cpp | 519 ++- .../util/imagesequencer.h | 128 +- .../util/instrumentdecoder.cpp | 60 +- .../util/instrumentdecoder.h | 6 +- .../util/instrumenttimesparser.cpp | 103 +- .../util/instrumenttimesparser.h | 9 +- .../util/labelparser.cpp | 425 +-- .../spacecraftinstruments/util/labelparser.h | 28 +- .../util/projectioncomponent.cpp | 225 +- .../util/projectioncomponent.h | 55 +- .../util/scannerdecoder.cpp | 10 +- .../util/scannerdecoder.h | 8 +- .../util/sequenceparser.cpp | 40 +- .../util/sequenceparser.h | 25 +- .../util/targetdecoder.cpp | 4 +- .../util/targetdecoder.h | 4 +- modules/spout/renderableplanespout.cpp | 45 +- modules/spout/renderableplanespout.h | 8 +- modules/spout/screenspacespout.cpp | 32 +- modules/spout/screenspacespout.h | 4 +- modules/spout/spoutmodule.cpp | 3 +- modules/sync/syncmodule.cpp | 27 +- modules/sync/syncs/httpsynchronization.cpp | 56 +- modules/sync/syncs/httpsynchronization.h | 9 +- modules/sync/syncs/torrentsynchronization.cpp | 57 +- modules/sync/syncs/torrentsynchronization.h | 2 - modules/sync/syncs/urlsynchronization.cpp | 29 +- modules/sync/syncs/urlsynchronization.h | 5 +- modules/sync/tasks/syncassettask.cpp | 104 +- modules/sync/tasks/syncassettask.h | 19 +- modules/sync/torrentclient.cpp | 41 +- modules/sync/torrentclient.h | 9 +- modules/touch/ext/levmarq.cpp | 58 +- modules/touch/include/touchinteraction.h | 6 +- modules/touch/include/touchmarker.h | 3 +- modules/touch/src/touchinteraction.cpp | 85 +- modules/touch/src/touchmarker.cpp | 16 +- modules/touch/src/tuioear.cpp | 2 +- .../rendering/renderabletoyvolume.cpp | 55 +- .../toyvolume/rendering/renderabletoyvolume.h | 2 - .../rendering/toyvolumeraycaster.cpp | 51 +- .../toyvolume/rendering/toyvolumeraycaster.h | 22 +- modules/toyvolume/toyvolumemodule.cpp | 7 +- modules/volume/CMakeLists.txt | 2 + modules/volume/envelope.cpp | 165 +- modules/volume/envelope.h | 22 +- modules/volume/linearlrucache.h | 66 +- modules/volume/linearlrucache.inl | 85 + modules/volume/lrucache.h | 69 +- modules/volume/lrucache.inl | 87 + modules/volume/rawvolume.h | 8 +- modules/volume/rawvolume.inl | 14 +- modules/volume/rawvolumemetadata.cpp | 5 +- modules/volume/rawvolumemetadata.h | 2 +- modules/volume/rawvolumereader.h | 14 +- modules/volume/rawvolumereader.inl | 19 +- modules/volume/rawvolumewriter.h | 12 +- modules/volume/rawvolumewriter.inl | 25 +- .../volume/rendering/basicvolumeraycaster.cpp | 66 +- .../volume/rendering/basicvolumeraycaster.h | 42 +- .../rendering/renderabletimevaryingvolume.cpp | 287 +- .../rendering/renderabletimevaryingvolume.h | 39 +- modules/volume/rendering/volumeclipplane.cpp | 23 +- modules/volume/rendering/volumeclipplane.h | 17 +- modules/volume/rendering/volumeclipplanes.cpp | 32 +- modules/volume/rendering/volumeclipplanes.h | 16 +- .../volume/tasks/generaterawvolumetask.cpp | 4 +- modules/volume/tasks/generaterawvolumetask.h | 6 +- modules/volume/textureslicevolumereader.h | 27 +- modules/volume/textureslicevolumereader.inl | 66 +- modules/volume/transferfunction.cpp | 385 +- modules/volume/transferfunction.h | 21 +- modules/volume/transferfunctionhandler.cpp | 244 +- modules/volume/transferfunctionhandler.h | 39 +- modules/volume/transferfunctionproperty.cpp | 18 +- modules/volume/volumegridtype.cpp | 16 +- modules/volume/volumegridtype.h | 2 + modules/volume/volumemodule.cpp | 4 +- modules/volume/volumesampler.h | 10 +- modules/volume/volumesampler.inl | 25 +- modules/volume/volumeutils.cpp | 22 +- modules/volume/volumeutils.h | 6 +- modules/webbrowser/CMakeLists.txt | 4 +- modules/webbrowser/include/browserclient.h | 21 +- modules/webbrowser/include/browserinstance.h | 71 +- modules/webbrowser/include/cefhost.h | 16 +- .../include/defaultbrowserlauncher.h | 10 +- modules/webbrowser/include/eventhandler.h | 56 +- .../webbrowser/include/screenspacebrowser.h | 39 +- modules/webbrowser/include/webbrowserapp.h | 15 +- modules/webbrowser/include/webrenderhandler.h | 24 +- modules/webbrowser/src/browserclient.cpp | 10 +- modules/webbrowser/src/browserinstance.cpp | 78 +- modules/webbrowser/src/cefhost.cpp | 29 +- .../webbrowser/src/defaultbrowserlauncher.cpp | 29 +- modules/webbrowser/src/eventhandler.cpp | 148 +- modules/webbrowser/src/screenspacebrowser.cpp | 81 +- modules/webbrowser/src/webbrowserapp.cpp | 9 +- modules/webbrowser/src/webrenderhandler.cpp | 18 +- modules/webbrowser/webbrowsermodule.cpp | 56 +- modules/webbrowser/webbrowsermodule.h | 26 +- modules/webgui/webguimodule.cpp | 8 +- shaders/abuffer/resolveabuffer.vert | 6 +- shaders/framebuffer/resolveframebuffer.frag | 2 +- shaders/framebuffer/resolveframebuffer.vert | 12 +- src/CMakeLists.txt | 10 +- src/documentation/core_registration.cpp | 2 + src/documentation/documentation.cpp | 49 +- src/documentation/documentationengine.cpp | 84 +- src/documentation/documentationgenerator.cpp | 16 +- src/documentation/verifier.cpp | 37 +- src/engine/configuration.cpp | 8 + src/engine/downloadmanager.cpp | 138 +- src/engine/logfactory.cpp | 6 +- src/engine/moduleengine.cpp | 32 +- src/engine/moduleengine_lua.inl | 17 +- src/engine/openspaceengine.cpp | 53 +- src/engine/openspaceengine_lua.inl | 115 +- src/engine/syncengine.cpp | 6 +- src/engine/virtualpropertymanager.cpp | 1 + src/engine/wrapper/sgctwindowwrapper.cpp | 38 +- src/engine/wrapper/windowwrapper.cpp | 6 +- src/interaction/inputstate.cpp | 36 +- src/interaction/joystickcamerastates.cpp | 11 +- src/interaction/keybindingmanager.cpp | 51 +- src/interaction/keybindingmanager_lua.inl | 82 +- src/interaction/keyframenavigator.cpp | 11 +- src/interaction/luaconsole.cpp | 13 +- src/interaction/mousecamerastates.cpp | 20 +- src/interaction/navigationhandler.cpp | 42 +- src/interaction/navigationhandler_lua.inl | 107 +- src/interaction/orbitalnavigator.cpp | 343 +- src/interaction/touchbar.mm | 9 +- src/mission/mission.cpp | 30 +- src/mission/missionmanager.cpp | 15 +- src/mission/missionmanager_lua.inl | 30 +- src/network/networkengine.cpp | 31 +- src/network/parallelconnection.cpp | 66 +- src/network/parallelpeer.cpp | 311 +- src/network/parallelserver.cpp | 95 +- src/performance/performancelayout.cpp | 5 +- src/performance/performancemanager.cpp | 127 +- src/performance/performancemeasurement.cpp | 10 +- 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 | 5 +- src/properties/property.cpp | 50 +- src/properties/propertyowner.cpp | 40 +- src/properties/scalar/boolproperty.cpp | 2 +- src/properties/scalar/charproperty.cpp | 4 +- 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 | 4 +- 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 | 14 +- src/properties/stringlistproperty.cpp | 7 +- src/properties/stringproperty.cpp | 4 +- src/properties/vector/bvec2property.cpp | 10 +- src/properties/vector/bvec3property.cpp | 10 +- src/properties/vector/bvec4property.cpp | 8 +- src/properties/vector/dvec2property.cpp | 4 +- src/properties/vector/dvec3property.cpp | 6 +- src/properties/vector/dvec4property.cpp | 6 +- src/properties/vector/ivec2property.cpp | 6 +- src/properties/vector/ivec3property.cpp | 6 +- src/properties/vector/ivec4property.cpp | 6 +- src/properties/vector/uvec2property.cpp | 6 +- src/properties/vector/uvec3property.cpp | 6 +- src/properties/vector/uvec4property.cpp | 6 +- src/properties/vector/vec2property.cpp | 6 +- src/properties/vector/vec3property.cpp | 6 +- src/properties/vector/vec4property.cpp | 6 +- src/query/query.cpp | 22 +- src/rendering/abufferrenderer.cpp | 212 +- src/rendering/dashboard.cpp | 8 +- src/rendering/dashboard_lua.inl | 5 +- src/rendering/dashboarditem.cpp | 27 +- src/rendering/deferredcastermanager.cpp | 21 +- src/rendering/framebufferrenderer.cpp | 358 +- src/rendering/loadingscreen.cpp | 168 +- src/rendering/luaconsole.cpp | 285 +- src/rendering/raycastermanager.cpp | 15 +- src/rendering/renderable.cpp | 62 +- src/rendering/renderengine.cpp | 220 +- src/rendering/renderengine_lua.inl | 40 +- src/rendering/screenspacerenderable.cpp | 78 +- src/rendering/transferfunction.cpp | 48 +- .../rendering/volumeraycaster.cpp | 18 +- src/scene/asset.cpp | 233 +- src/scene/assetloader.cpp | 67 +- src/scene/assetmanager.cpp | 26 +- src/scene/assetmanager_lua.inl | 16 +- src/scene/rotation.cpp | 16 +- src/scene/scale.cpp | 19 +- src/scene/scene.cpp | 104 +- src/scene/scene_lua.inl | 80 +- src/scene/scenegraphnode.cpp | 176 +- src/scene/sceneinitializer.cpp | 6 +- src/scene/scenelicense.cpp | 17 +- src/scene/scenelicensewriter.cpp | 14 +- src/scene/translation.cpp | 12 +- src/scripting/scriptengine.cpp | 329 +- src/scripting/scriptengine_lua.inl | 76 +- src/scripting/scriptscheduler.cpp | 39 +- src/scripting/scriptscheduler_lua.inl | 32 +- src/scripting/systemcapabilitiesbinding.cpp | 63 +- src/util/blockplaneintersectiongeometry.cpp | 67 +- src/util/boxgeometry.cpp | 19 +- src/util/camera.cpp | 506 ++- src/util/distanceconversion.cpp | 26 +- src/util/factorymanager.cpp | 22 +- src/util/histogram.cpp | 110 +- src/util/httprequest.cpp | 83 +- src/util/keys.cpp | 33 +- src/util/openspacemodule.cpp | 8 +- src/util/powerscaledcoordinate.cpp | 49 +- src/util/powerscaledscalar.cpp | 185 +- src/util/powerscaledsphere.cpp | 45 +- src/util/progressbar.cpp | 17 +- src/util/resourcesynchronization.cpp | 49 +- src/util/screenlog.cpp | 6 +- src/util/spicemanager.cpp | 414 ++- src/util/spicemanager_lua.inl | 16 +- src/util/syncbuffer.cpp | 40 +- src/util/synchronizationwatcher.cpp | 29 +- src/util/task.cpp | 4 +- src/util/taskloader.cpp | 24 +- src/util/threadpool.cpp | 20 +- src/util/time.cpp | 89 +- src/util/timeconversion.cpp | 18 +- src/util/timemanager.cpp | 67 +- src/util/timerange.cpp | 10 +- src/util/transformationmanager.cpp | 16 +- support/cmake/openspace_header.template | 6 +- support/coding/check_style_guide.py | 10 +- tests/main.cpp | 1 + tests/test_angle.inl | 190 +- tests/test_assetloader.inl | 1 + tests/test_chunknode.inl | 8 +- tests/test_luaconversions.inl | 57 +- tests/test_rawvolumeio.inl | 11 +- 796 files changed, 22428 insertions(+), 24063 deletions(-) delete mode 100644 .clang-format create mode 100644 data/assets/examples/dashboarditems.asset create mode 100644 include/openspace/engine/moduleengine.inl delete mode 100644 include/openspace/properties/matrixproperty.h delete mode 100644 include/openspace/properties/scalarproperty.h rename include/openspace/{properties/vectorproperty.h => scene/assetlistener.h} (67%) create mode 100644 include/openspace/util/job.h create mode 100644 include/openspace/util/syncable.h create mode 100644 include/openspace/util/syncbuffer.inl create mode 100644 include/openspace/util/syncdata.inl create mode 100644 modules/globebrowsing/other/templatedstatscollector.h rename modules/globebrowsing/other/{statscollector.inl => templatedstatscollector.inl} (85%) create mode 100644 modules/globebrowsing/other/timequantizer.cpp rename modules/globebrowsing/other/{distanceswitch.cpp => timequantizer.h} (53%) rename modules/server/include/{ => topics}/authorizationtopic.h (77%) create mode 100644 modules/server/include/topics/bouncetopic.h rename modules/server/include/{ => topics}/getpropertytopic.h (88%) rename modules/server/include/{ => topics}/luascripttopic.h (91%) rename modules/server/include/{ => topics}/setpropertytopic.h (89%) rename modules/server/include/{ => topics}/subscriptiontopic.h (83%) rename modules/server/include/{ => topics}/timetopic.h (87%) rename modules/server/include/{ => topics}/topic.h (88%) rename modules/server/include/{ => topics}/triggerpropertytopic.h (91%) rename modules/{webbrowser/src/screenspacerenderhandler.cpp => server/src/topics/bouncetopic.cpp} (88%) rename modules/{globebrowsing/other/distanceswitch.h => spacecraftinstruments/util/image.h} (67%) create mode 100644 modules/volume/linearlrucache.inl create mode 100644 modules/volume/lrucache.inl rename modules/webbrowser/include/screenspacerenderhandler.h => src/rendering/volumeraycaster.cpp (84%) diff --git a/.clang-format b/.clang-format deleted file mode 100644 index 8065e04d7c..0000000000 --- a/.clang-format +++ /dev/null @@ -1,47 +0,0 @@ ---- -Language: Cpp -AccessModifierOffset: -4 -AlignEscapedNewlinesLeft: false -AlignTrailingComments: true -AllowAllParametersOfDeclarationOnNextLine: true -AllowShortFunctionsOnASingleLine: false -AllowShortIfStatementsOnASingleLine: false -AllowShortLoopsOnASingleLine: false -AlwaysBreakBeforeMultilineStrings: true -AlwaysBreakTemplateDeclarations: true -BinPackParameters: true -BreakBeforeBinaryOperators: true -BreakBeforeBraces: Stroustrup -BreakBeforeTernaryOperators: true -BreakConstructorInitializersBeforeComma: true -ColumnLimit: 90 -ConstructorInitializerAllOnOneLineOrOnePerLine: false -ConstructorInitializerIndentWidth: 4 -ContinuationIndentWidth: 6 -Cpp11BracedListStyle: true -DerivePointerBinding: false -IndentCaseLabels: true -#Check next -IndentFunctionDeclarationAfterType: true -IndentWidth: 4 -KeepEmptyLinesAtTheStartOfBlocks : false -MaxEmptyLinesToKeep: 1 -NamespaceIndentation: None -PenaltyBreakBeforeFirstCallParameter: 19 -PenaltyBreakComment: 300 -PenaltyBreakString: 1000 -PenaltyBreakFirstLessLess: 120 -PenaltyExcessCharacter: 1000000 -PenaltyReturnTypeOnItsOwnLine: 60 -PointerBindsToType: true -#Check next -SpaceBeforeAssignmentOperators: true -SpaceBeforeParens: ControlStatements -SpaceInEmptyParentheses: false -SpacesBeforeTrailingComments: 2 -SpacesInAngles: false -SpacesInCStyleCastParentheses: false -SpacesInParentheses: false -Standard: Cpp11 -UseTab: Never -... diff --git a/apps/OpenSpace/main.cpp b/apps/OpenSpace/main.cpp index fc05459112..e28195223a 100644 --- a/apps/OpenSpace/main.cpp +++ b/apps/OpenSpace/main.cpp @@ -25,8 +25,10 @@ #include #include #include +#include #include + #include #include #include diff --git a/apps/Sync/main.cpp b/apps/Sync/main.cpp index 202b717c67..f9d69dbd4c 100644 --- a/apps/Sync/main.cpp +++ b/apps/Sync/main.cpp @@ -28,8 +28,10 @@ #include #include #include +#include #include +#include #include #include #include @@ -53,8 +55,7 @@ int main(int argc, char** argv) { "Sync", fmt::format( "Synchronizing scene {} out of {}: {}", - i + 1, tasks.size(), - task.description() + i + 1, tasks.size(), task.description() ) ); ProgressBar progressBar(100); diff --git a/data/assets/examples/dashboarditems.asset b/data/assets/examples/dashboarditems.asset new file mode 100644 index 0000000000..bfb0590e6b --- /dev/null +++ b/data/assets/examples/dashboarditems.asset @@ -0,0 +1,43 @@ +local assetHelper = asset.require('util/asset_helper') + +assetHelper.registerDashboardItems(asset, { + { + Identifier = "Angle", + GuiName = "Angle", + Type = "DashboardItemAngle", + ReferenceType = "Node", + ReferenceNodeName = "Earth", + DestinationType = "Node", + DestinationNodeName = "Moon" + }, + { + Identifier = "Date", + GuiName = "Date", + Type = "DashboardItemDate" + }, + { + Identifier = "SimulationIncrement", + GuiName = "Simulation Increment", + Type = "DashboardItemSimulationIncrement" + }, + { + Identifier = "Distance", + GuiName = "Distance", + Type = "DashboardItemDistance" + }, + { + Identifier = "Framerate", + GuiName = "Framerate", + Type = "DashboardItemFramerate" + }, + { + Identifier = "ParallelConnection", + GuiName = "Parallel Connection", + Type = "DashboardItemParallelConnection" + }, + { + Identifier = "Mission", + GuiName = "Mission", + Type = "DashboardItemMission" + } +}) diff --git a/data/assets/scene/digitaluniverse/globularclusters.asset b/data/assets/scene/digitaluniverse/globularclusters.asset index 95e0505682..70ad83f995 100644 --- a/data/assets/scene/digitaluniverse/globularclusters.asset +++ b/data/assets/scene/digitaluniverse/globularclusters.asset @@ -31,6 +31,7 @@ local object = { ScaleFactor = 440.0, TextSize = 17.5, TextMinSize = 10.0, + TextMaxSize = 30.0, Unit = "pc" }, GUI = { diff --git a/data/assets/scene/digitaluniverse/h2regions.asset b/data/assets/scene/digitaluniverse/h2regions.asset index 61f756ef37..27772f3728 100644 --- a/data/assets/scene/digitaluniverse/h2regions.asset +++ b/data/assets/scene/digitaluniverse/h2regions.asset @@ -30,7 +30,8 @@ local object = { TextColor = { 0.5, 0.5, 0.5, 1.0 }, ScaleFactor = 420, TextSize = 17.25, - TextMinSize = 2.0, + TextMinSize = 10.0, + TextMinSize = 30.0, Unit = "pc" }, GUI = { diff --git a/data/assets/scene/digitaluniverse/obassociations.asset b/data/assets/scene/digitaluniverse/obassociations.asset index 4de911b1d5..44fda4b670 100644 --- a/data/assets/scene/digitaluniverse/obassociations.asset +++ b/data/assets/scene/digitaluniverse/obassociations.asset @@ -31,6 +31,7 @@ local object = { ScaleFactor = 428.0, TextSize = 17.0, TextMinSize = 5.76, + TextMaxSize = 30.0, Unit = "pc" }, GUI = { diff --git a/data/assets/scene/digitaluniverse/openclusters.asset b/data/assets/scene/digitaluniverse/openclusters.asset index 8bd27ec145..2fde394eda 100644 --- a/data/assets/scene/digitaluniverse/openclusters.asset +++ b/data/assets/scene/digitaluniverse/openclusters.asset @@ -31,6 +31,7 @@ local object = { ScaleFactor = 418.33, TextSize = 16.68, TextMinSize = 4.5, + TextMaxSize = 30.0, Unit = "pc" }, GUI = { diff --git a/data/assets/scene/digitaluniverse/planetarynebulae.asset b/data/assets/scene/digitaluniverse/planetarynebulae.asset index f4f55b1b9c..ccd45f3ce3 100644 --- a/data/assets/scene/digitaluniverse/planetarynebulae.asset +++ b/data/assets/scene/digitaluniverse/planetarynebulae.asset @@ -31,6 +31,7 @@ local object = { ScaleFactor = 418.33, TextSize = 16.68, TextMinSize = 4.5, + TextMaxSize = 30.0, Unit = "pc" }, GUI = { diff --git a/data/assets/scene/digitaluniverse/pulsars.asset b/data/assets/scene/digitaluniverse/pulsars.asset index 0eb50d72d0..401dca9381 100644 --- a/data/assets/scene/digitaluniverse/pulsars.asset +++ b/data/assets/scene/digitaluniverse/pulsars.asset @@ -30,7 +30,8 @@ local object = { TextColor = { 0.7, 0.0, 0.0, 1.0 }, ScaleFactor = 418.33, TextSize = 16.68, - TextMinSize = 4.5, + TextMinSize = 7.5, + TextMaxSize = 30.0, Unit = "pc" }, GUI = { diff --git a/data/assets/scene/digitaluniverse/supernovaremnants.asset b/data/assets/scene/digitaluniverse/supernovaremnants.asset index 783a7a48ea..31cbe5d1c5 100644 --- a/data/assets/scene/digitaluniverse/supernovaremnants.asset +++ b/data/assets/scene/digitaluniverse/supernovaremnants.asset @@ -31,6 +31,7 @@ local object = { ScaleFactor = 440.08, TextSize = 17.5, TextMinSize = 8.0, + TextMaxSize = 30.0, CorrectionSizeEndDistance = 17.5, CorrectionSizeFactor = 13.96, Unit = "pc" diff --git a/data/assets/scene/solarsystem/missions/osirisrex/script_schedule.asset b/data/assets/scene/solarsystem/missions/osirisrex/script_schedule.asset index 9c331e2000..4bbf29979c 100644 --- a/data/assets/scene/solarsystem/missions/osirisrex/script_schedule.asset +++ b/data/assets/scene/solarsystem/missions/osirisrex/script_schedule.asset @@ -1,15 +1,15 @@ local scriptSchedulerHelper = asset.require('util/script_scheduler_helper') asset.onInitialize(function () - scriptSchedulerHelper.scheduleRenderableEnabled("2016 SEP 08 23:05:00", "OsirisRexTrailSolarSystem", false) - scriptSchedulerHelper.scheduleRenderableEnabled("2016 SEP 08 23:05:00", "OsirisRexTrailBennu", false) - scriptSchedulerHelper.scheduleRenderableEnabledReversable("2016 SEP 08 23:05:01", "OsirisRexTrailEarth", true) - scriptSchedulerHelper.scheduleRenderableEnabledReversable("2016 SEP 09 00:00:00", "OsirisRexTrailSolarSystem", true) - scriptSchedulerHelper.scheduleRenderableEnabledReversable("2016 SEP 09 02:00:00", "OsirisRexTrailEarth", false) - scriptSchedulerHelper.scheduleRenderableEnabledReversable("2018 OCT 11 00:00:00", "OsirisRexTrailBennu", true) - scriptSchedulerHelper.scheduleRenderableEnabledReversable("2018 OCT 15 00:00:00", "OsirisRexTrailSolarSystem", false) - scriptSchedulerHelper.scheduleRenderableEnabledReversable("2019 AUG 01 00:00:00", "OsirisRexTrailSolarSystem", true) - scriptSchedulerHelper.scheduleRenderableEnabledReversable("2019 AUG 01 00:00:00", "OsirisRexTrailBennu", false) + scriptSchedulerHelper.scheduleRenderableEnabled("2016 SEP 08 23:05:00", "Scene.OsirisRexTrailSolarSystem", false) + scriptSchedulerHelper.scheduleRenderableEnabled("2016 SEP 08 23:05:00", "Scene.OsirisRexTrailBennu", false) + scriptSchedulerHelper.scheduleRenderableEnabledReversable("2016 SEP 08 23:05:01", "Scene.OsirisRexTrailEarth", true) + scriptSchedulerHelper.scheduleRenderableEnabledReversable("2016 SEP 09 00:00:00", "Scene.OsirisRexTrailSolarSystem", true) + scriptSchedulerHelper.scheduleRenderableEnabledReversable("2016 SEP 09 02:00:00", "Scene.OsirisRexTrailEarth", false) + scriptSchedulerHelper.scheduleRenderableEnabledReversable("2018 OCT 11 00:00:00", "Scene.OsirisRexTrailBennu", true) + scriptSchedulerHelper.scheduleRenderableEnabledReversable("2018 OCT 15 00:00:00", "Scene.OsirisRexTrailSolarSystem", false) + scriptSchedulerHelper.scheduleRenderableEnabledReversable("2019 AUG 01 00:00:00", "Scene.OsirisRexTrailSolarSystem", true) + scriptSchedulerHelper.scheduleRenderableEnabledReversable("2019 AUG 01 00:00:00", "Scene.OsirisRexTrailBennu", false) end) diff --git a/data/assets/scene/solarsystem/planets/earth/earth.asset b/data/assets/scene/solarsystem/planets/earth/earth.asset index e1074505e2..29e8f002b6 100644 --- a/data/assets/scene/solarsystem/planets/earth/earth.asset +++ b/data/assets/scene/solarsystem/planets/earth/earth.asset @@ -33,7 +33,7 @@ local Earth = { FilePath = openspace.globebrowsing.createTemporalGibsGdalXml( "VIIRS_SNPP_CorrectedReflectance_TrueColor", "2015-11-24", - "Yesterday", + "Today", "1d", "250m", "jpg" @@ -240,6 +240,7 @@ local Earth = { TilePixelSize = 64, Fallback = { Name = "Earth Bluemarble Height", + Identifier = "Earth_Bluemarble_Height", FilePath = texturesPath .. "/earth_bluemarble_height.jpg", Enabled = true } diff --git a/data/assets/scene/solarsystem/sun/sun.asset b/data/assets/scene/solarsystem/sun/sun.asset index b9a51bf6bc..3acbccb04a 100644 --- a/data/assets/scene/solarsystem/sun/sun.asset +++ b/data/assets/scene/solarsystem/sun/sun.asset @@ -10,6 +10,7 @@ local Sun = { Parent = transforms.SunIAU.Identifier, Renderable = { Type = "RenderablePlanet", + Enabled = false, Frame = "IAU_SUN", Body = "SUN", Geometry = { diff --git a/data/assets/util/default_joystick.asset b/data/assets/util/default_joystick.asset index 64be2b36c3..8a67a4fa8e 100644 --- a/data/assets/util/default_joystick.asset +++ b/data/assets/util/default_joystick.asset @@ -108,12 +108,12 @@ asset.onInitialize(function() -- Currently: XBoxController or PS4Controller local controller = XBoxController; - openspace.navigation.setAxisDeadZone(controller.LeftThumbStick[1], 0.05) - openspace.navigation.setAxisDeadZone(controller.LeftThumbStick[2], 0.05) - openspace.navigation.setAxisDeadZone(controller.RightThumbStick[1], 0.05) - openspace.navigation.setAxisDeadZone(controller.RightThumbStick[2], 0.05) - openspace.navigation.setAxisDeadZone(controller.LeftTrigger, 0.05) - openspace.navigation.setAxisDeadZone(controller.RightTrigger, 0.05) + openspace.navigation.setAxisDeadZone(controller.LeftThumbStick[1], 0.15) + openspace.navigation.setAxisDeadZone(controller.LeftThumbStick[2], 0.15) + openspace.navigation.setAxisDeadZone(controller.RightThumbStick[1], 0.15) + openspace.navigation.setAxisDeadZone(controller.RightThumbStick[2], 0.15) + openspace.navigation.setAxisDeadZone(controller.LeftTrigger, 0.15) + openspace.navigation.setAxisDeadZone(controller.RightTrigger, 0.15) openspace.navigation.bindJoystickAxis(controller.LeftThumbStick[1], "Orbit X"); openspace.navigation.bindJoystickAxis(controller.LeftThumbStick[2], "Orbit Y", true); @@ -122,15 +122,53 @@ asset.onInitialize(function() openspace.navigation.bindJoystickAxis(controller.LeftTrigger, "Zoom Out", false, true); openspace.navigation.bindJoystickAxis(controller.RightTrigger, "Zoom In", false, true); - openspace.navigation.bindJoystickButton(controller.LB, bindLocalRoll(controller.RightThumbStick[1])) - openspace.navigation.bindJoystickButton(controller.LB, unbindRoll(controller.RightThumbStick[1]), "Release") - openspace.navigation.bindJoystickButton(controller.RB, bindGlobalRoll(controller.RightThumbStick[1])) - openspace.navigation.bindJoystickButton(controller.RB, unbindRoll(controller.RightThumbStick[1]), "Release") + openspace.navigation.bindJoystickButton( + controller.LB, + bindLocalRoll(controller.RightThumbStick[1]), + "Switch to local roll mode" + ) + openspace.navigation.bindJoystickButton( + controller.LB, + unbindRoll(controller.RightThumbStick[1]), + "Switch back to normal mode", + "Release" + ) + openspace.navigation.bindJoystickButton( + controller.RB, + bindGlobalRoll(controller.RightThumbStick[1]), + "Switch to global roll mode" + ) + openspace.navigation.bindJoystickButton( + controller.RB, + unbindRoll(controller.RightThumbStick[1]), + "Switch back to normal mode", + "Release" + ) - openspace.navigation.bindJoystickButton(controller.A, propertyHelper.invert('NavigationHandler.OrbitalNavigator.Friction.ZoomFriction')) - openspace.navigation.bindJoystickButton(controller.B, propertyHelper.invert('NavigationHandler.OrbitalNavigator.Friction.RotationalFriction')) - openspace.navigation.bindJoystickButton(controller.DPad.Left, propertyHelper.invert('NavigationHandler.OrbitalNavigator.Friction.RollFriction')) + openspace.navigation.bindJoystickButton( + controller.A, + propertyHelper.invert('NavigationHandler.OrbitalNavigator.Friction.ZoomFriction'), + "Toggle zoom friction" + ) + openspace.navigation.bindJoystickButton( + controller.B, + propertyHelper.invert('NavigationHandler.OrbitalNavigator.Friction.RotationalFriction'), + "Toggle rotational friction" + ) + openspace.navigation.bindJoystickButton( + controller.DPad.Left, + propertyHelper.invert('NavigationHandler.OrbitalNavigator.Friction.RollFriction'), + "Toggle roll friction" + ) - openspace.navigation.bindJoystickButton(controller.X, "openspace.setPropertyValue('NavigationHandler.Origin', 'Earth')") - openspace.navigation.bindJoystickButton(controller.Y, "openspace.setPropertyValue('NavigationHandler.Origin', 'Mars')") + openspace.navigation.bindJoystickButton( + controller.X, + "openspace.setPropertyValue('NavigationHandler.Origin', 'Earth')", + "Switch target to Earth" + ) + openspace.navigation.bindJoystickButton( + controller.Y, + "openspace.setPropertyValue('NavigationHandler.Origin', 'Mars')", + "Switch target to Mars" + ) end) diff --git a/ext/ghoul b/ext/ghoul index c25721693b..23de750662 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit c25721693b499284c4dcf6c746ba85aa44655f27 +Subproject commit 23de7506623dea89daf8c282a5bb4d4cd776282a diff --git a/ext/sgct b/ext/sgct index 03a8cd877e..051d057eba 160000 --- a/ext/sgct +++ b/ext/sgct @@ -1 +1 @@ -Subproject commit 03a8cd877e540beb2e4762be6036cf895ee77647 +Subproject commit 051d057eba64bfc30820cfa3d5460e7d508e724e diff --git a/include/openspace/documentation/documentation.h b/include/openspace/documentation/documentation.h index 14ed0595fe..91b674e46c 100644 --- a/include/openspace/documentation/documentation.h +++ b/include/openspace/documentation/documentation.h @@ -27,7 +27,6 @@ #include #include - #include #include #include @@ -108,11 +107,13 @@ struct TestResult { struct SpecificationError : public ghoul::RuntimeError { /** * Creates the SpecificationError exception instance. - * \param result The offending TestResult that is passed on - * \param component The component that initiated the specification test - * \pre \p result%'s TestResult::success must be \c false + * + * \param res The offending TestResult that is passed on + * \param comp The component that initiated the specification test + * + * \pre \p res%'s TestResult::success must be \c false */ - SpecificationError(TestResult result, std::string component); + SpecificationError(TestResult res, std::string comp); /// The TestResult that caused the SpecificationError to be thrown TestResult result; @@ -141,50 +142,54 @@ struct DocumentationEntry { static const std::string Wildcard; /** - * The constructor for a DocumentationEntry describing a \p key in a Documentation. + * The constructor for a DocumentationEntry describing a key \p k in a Documentation. * The value for the key (or each value in the case of the - * DocumentationEntry::Wildcard) is tested using the \p verifier, that specifies the - * conditions that the \p key%'s value has to fulfill. The textual documentation + * DocumentationEntry::Wildcard) is tested using the verifier \p v, that specifies the + * conditions that the \p k%'s value has to fulfill. The textual documentation * \p doc shall describe the usage of the key-value pair and will be printed for human * consumption for example in the DocumentationEngine. Each DocumentationEntry can - * further be \p optional. - * \param key The key for which this DocumentationEntry is valid. If this valid is - * equal to DocumentationEntry::Wildcard, each entry in the Documentation that - * contains this DocumentationEntry will be matched - * \param verifier The Verifier that is used to test the \p key%'s value to determine - * if it is a valid value + * further be \p opt. + * + * \param k The key for which this DocumentationEntry is valid. If this valid is + * equal to DocumentationEntry::Wildcard, each entry in the Documentation that + * contains this DocumentationEntry will be matched + * \param v The Verifier that is used to test the \p k%'s value to determine if it is + * a valid value * \param doc The textual documentation that describes the DocumentationEntry in a - * human readable format - * \param optional Determines whether the Documentation containing this - * DocumentationEntry must have a key \p key, or whether it is optional - * \pre \p key must not be empty - * \pre \p verifier must not be nullptr + * human readable format + * \param opt Determines whether the Documentation containing this DocumentationEntry + * must have a key \p key, or whether it is optional + * + * \pre \p k must not be empty + * \pre \p v must not be nullptr */ - DocumentationEntry(std::string key, std::shared_ptr verifier, - Optional optional, std::string doc = ""); + DocumentationEntry(std::string k, std::shared_ptr v, + Optional opt, std::string doc = ""); /** - * The constructor for a DocumentationEntry describing a \p key in a Documentation. + * The constructor for a DocumentationEntry describing a key \p k in a Documentation. * The value for the key (or each value in the case of the - * DocumentationEntry::Wildcard) is tested using the \p verifier, that specifies the - * conditions that the \p key%'s value has to fulfill. The textual documentation + * DocumentationEntry::Wildcard) is tested using the verifier \p v, that specifies the + * conditions that the \p k%'s value has to fulfill. The textual documentation * \p doc shall describe the usage of the key-value pair and will be printed for human * consumption for example in the DocumentationEngine. Each DocumentationEntry can - * further be \p optional. - * \param key The key for which this DocumentationEntry is valid. If this valid is - * equal to DocumentationEntry::Wildcard, each entry in the Documentation that - * contains this DocumentationEntry will be matched - * \param verifier The Verifier that is used to test the \p key%'s value to determine - * if it is a valid value. The DocumentationEntry will take ownership of the passed - * object + * further be \p opt. + * + * \param k The key for which this DocumentationEntry is valid. If this valid is + * equal to DocumentationEntry::Wildcard, each entry in the Documentation that + * contains this DocumentationEntry will be matched + * \param v The Verifier that is used to test the \p key%'s value to determine if it is + * a valid value. The DocumentationEntry will take ownership of the passed + * object * \param doc The textual documentation that describes the DocumentationEntry in a - * human readable format - * \param optional Determines whether the Documentation containing this - * DocumentationEntry must have a key \p key, or whether it is optional - * \pre \p key must not be empty - * \pre \p verifier must not be nullptr + * human readable format + * \param opt Determines whether the Documentation containing this DocumentationEntry + * must have a key \p key, or whether it is optional + * + * \pre \p k must not be empty + * \pre \p v must not be nullptr */ - DocumentationEntry(std::string key, Verifier* verifier, Optional optional, + DocumentationEntry(std::string k, Verifier* v, Optional opt, std::string doc = ""); /// The key that is described by this DocumentationEntry @@ -225,29 +230,33 @@ struct Documentation { using DocumentationEntries = std::vector; /** - * Creates a Documentation with a human-readable \p name and a list of \p entries. - * \param name The human-readable name of this Documentation - * \param id A unique identifier which can be used by applications (or other - * Documentation%s to reference this entry - * \param entries A list of DocumentationEntry%s that describe the individual keys for - * this entrie Documentation + * Creates a Documentation with a human-readable name \p n and a list of entries + * \p ents. + * + * \param n The human-readable name of this Documentation + * \param i A unique identifier which can be used by applications (or other + * Documentation%s to reference this entry + * \param ents A list of DocumentationEntry%s that describe the individual keys for + * this entrie Documentation */ - Documentation(std::string name, std::string id, DocumentationEntries entries = {}); + Documentation(std::string n, std::string i, DocumentationEntries ents = {}); /** - * Creates a Documentation with a human-readable \p name. - * \param name The human-readable name of this Documentation - * \param entries A list of DocumentationEntry%s that describe the individual keys for - * this entrie Documentation + * Creates a Documentation with a human-readable name \p n. + * + * \param n The human-readable name of this Documentation + * \param ents A list of DocumentationEntry%s that describe the individual keys for + * this entrie Documentation */ - Documentation(std::string name, DocumentationEntries entries = {}); + Documentation(std::string n, DocumentationEntries ents = {}); /** * Creates a Documentation. + * * \param entries A list of DocumentationEntry%s that describe the individual keys for - * this entrie Documentation + * this entrie Documentation */ - Documentation(DocumentationEntries entries = {}); + Documentation(DocumentationEntries ents = {}); /// The human-readable name of the Documentation std::string name; @@ -263,9 +272,10 @@ struct Documentation { * will contain whether the \p dictionary adheres to the \p documentation and, in * addition, the list of all offending keys together with the reason why they are * offending. + * * \param documentation The Documentation that the \p dictionary is tested against * \param dictionary The ghoul::Dictionary that is to be tested against the - * \p documentation + * \p documentation * \return A TestResult that contains the results of the specification testing */ TestResult testSpecification(const Documentation& documentation, @@ -277,11 +287,13 @@ TestResult testSpecification(const Documentation& documentation, * specification a SpecificationError is thrown, and the exception contains the TestResult * that contains more information about the offending keys. If the \p dictionary adheres to * the \p documentation, the method returns normally. +* * \param documentation The Documentation that the \p dictionary is tested against * \param dictionary The ghoul::Dictionary that is to be tested against the -* \p documentation +* \p documentation * \param component The component that is using this method; this argument is passed to the -* SpecificationError that is thrown in case of not adhering to the \p documentation +* SpecificationError that is thrown in case of not adhering to the \p documentation +* * \throw SpecificationError If the \p dictionary does not adhere to the \p documentation */ void testSpecificationAndThrow(const Documentation& documentation, diff --git a/include/openspace/documentation/documentationengine.h b/include/openspace/documentation/documentationengine.h index 7d055ad8c0..f7b343875c 100644 --- a/include/openspace/documentation/documentationengine.h +++ b/include/openspace/documentation/documentationengine.h @@ -25,10 +25,10 @@ #ifndef __OPENSPACE_CORE___DOCUMENTATIONENGINE___H__ #define __OPENSPACE_CORE___DOCUMENTATIONENGINE___H__ -#include #include #include +#include #include namespace openspace::documentation { @@ -50,10 +50,11 @@ public: /** * Constructor of a DuplicateDocumentationException storing the offending * Documentation for later use. - * \param documentation The Documentation whose identifier was previously - * registered + * + * \param doc The Documentation whose identifier was previously + * registered */ - DuplicateDocumentationException(Documentation documentation); + DuplicateDocumentationException(Documentation doc); /// The offending Documentation whose identifier was previously registered Documentation documentation; @@ -64,20 +65,24 @@ public: /** * Adds the \p documentation to the list of Documentation%s that are written to a * documentation file with the writeDocumentation method. + * * \param documentation The Documentation object that is to be stored for later use - * \throws DuplicateDocumentationException If the \p documentation has a non-empty - * identifier and it was not unique + * + * \throw DuplicateDocumentationException If the \p documentation has a non-empty + * identifier and it was not unique */ void addDocumentation(Documentation documentation); /** - * Returns a list of all registered Documentation%s + * Returns a list of all registered Documentation%s. + * * \return A list of all registered Documentation%s */ std::vector documentations() const; /** - * Returns a static reference to the main singleton DocumentationEngine + * Returns a static reference to the main singleton DocumentationEngine. + * * \return A static reference to the main singleton DocumentationEngine */ static DocumentationEngine& ref(); diff --git a/include/openspace/documentation/verifier.h b/include/openspace/documentation/verifier.h index 5adf9af4bd..71fee5972a 100644 --- a/include/openspace/documentation/verifier.h +++ b/include/openspace/documentation/verifier.h @@ -26,9 +26,7 @@ #define __OPENSPACE_CORE___VERIFIER___H__ #include - #include - #include #include @@ -51,15 +49,17 @@ struct Verifier { * concrete subclass and can range from type testing (for example IntVerifier or * StringVerifier) to more complex testing (for example DoubleInRangeVerifier or * TableVerifier). + * * \param dictionary The dictionary that contains the \p key which is to be tested by - * this Verifier + * this Verifier * \param key The key inside the \p dictionary that is to be tested * \return A TestResult struct that contains information about whether the key adheres - * to the demands of the specific Verifier. If it does not, TestResult::offenders will - * either contain \p key or, in the case of a TableVerifier, a list of all offending - * subkeys as fully qualified names. + * to the demands of the specific Verifier. If it does not, + * TestResult::offenders will either contain \p key or, in the case of a + * TableVerifier, a list of all offending subkeys as fully qualified names. + * * \post If the return values' TestResult::success is \c true, its - * TestResult::offenders is empty + * TestResult::offenders is empty */ virtual TestResult operator()(const ghoul::Dictionary& dictionary, const std::string& key) const = 0; @@ -68,7 +68,9 @@ struct Verifier { * This method returns a human-readable string describing the type of object that is * handled by the Verifier subclass. This is only used for generating a human-readable * documentation and description of a Documenation object. + * * \return A human-readable string describing the type of object for the Verifier + * * \post The return value is not empty */ virtual std::string type() const = 0; @@ -77,8 +79,10 @@ struct Verifier { * This method returns a human-readable string describing the tests that the concrete * Verifier subclass implements. This is only used for generating a human-readable * documentation and description of a Documentation object. + * * \return A human-readable string describing the tests that are performed by the - * Verifier + * Verifier + * * \post The return value is not empty */ virtual std::string documentation() const = 0; @@ -101,13 +105,15 @@ struct TemplateVerifier : public Verifier { /** * Tests whether the \p key contained in the ghoul::Dictionary \p dictionary exists * and has the same type as \c T. + * * \param dictionary The ghoul::Dictionary that contains the \p key to be tested * \param key The key inside the \p dictinoary that is to be tested * \return A TestResult that contains the information whether the \p key exists in the - * \p dictionary and whether the key's value's type agrees with \c T. + * \p dictionary and whether the key's value's type agrees with \c T. + * * \post The return values' TestResult::success is either \c true and - * TestResult::offenders is empty, or it is \c false and TestResult::offenders - * contains \p key + * TestResult::offenders is empty, or it is \c false and TestResult::offenders + * contains \p key */ TestResult operator()(const ghoul::Dictionary& dictionary, const std::string& key) const override; @@ -124,19 +130,19 @@ struct BoolVerifier : public TemplateVerifier { }; /** -* A Verifier that checks whether a given key inside a ghoul::Dictionary is of type -* \c double. No implicit conversion is considered in this testing. -*/ + * A Verifier that checks whether a given key inside a ghoul::Dictionary is of type + * \c double. No implicit conversion is considered in this testing. + */ struct DoubleVerifier : public TemplateVerifier { std::string type() const override; }; /** -* A Verifier that checks whether a given key inside a ghoul::Dictionary is of type -* \c int. It will also return \c true if the key's value is of type \c double, but is a -* integer value (for example, 0.0, 12.0, but not -* 0.5). -*/ + * A Verifier that checks whether a given key inside a ghoul::Dictionary is of type + * \c int. It will also return \c true if the key's value is of type \c double, but is a + * integer value (for example, 0.0, 12.0, but not + * 0.5). + */ struct IntVerifier : public TemplateVerifier { TestResult operator()(const ghoul::Dictionary& dict, const std::string& key) const override; @@ -145,31 +151,32 @@ struct IntVerifier : public TemplateVerifier { }; /** -* A Verifier that checks whether a given key inside a ghoul::Dictionary is of type -* std::string. No implicit conversion is considered in this testing. -*/ + * A Verifier that checks whether a given key inside a ghoul::Dictionary is of type + * std::string. No implicit conversion is considered in this testing. + */ struct StringVerifier : public TemplateVerifier { std::string type() const override; }; /** -* A Verifier that checks whether a given key inside a ghoul::Dictionary is another -* ghoul::Dictionary. The constructor takes a list of DocumentationEntry%s, which are used -* recursively to check the contained table. If this list is empty, a simple type testing -* is performed instead. If the testing finds any offending keys, it will return those keys -* with fully qualified names, that is, the name of the table will be prepended to the -* offending keys. Example: If the key \c Table is tested and a passed DocumentationEntry -* checks for a nested key \c a and this does not comply, this Verifier will return -* Table.a as an offender. -*/ + * A Verifier that checks whether a given key inside a ghoul::Dictionary is another + * ghoul::Dictionary. The constructor takes a list of DocumentationEntry%s, which are used + * recursively to check the contained table. If this list is empty, a simple type testing + * is performed instead. If the testing finds any offending keys, it will return those + * keys with fully qualified names, that is, the name of the table will be prepended to + * the offending keys. Example: If the key \c Table is tested and a passed + * DocumentationEntry checks for a nested key \c a and this does not comply, this Verifier + * will return Table.a as an offender. + */ struct TableVerifier : public TemplateVerifier { /** * This constructor takes a list of DocumentationEntry%s that are used recursively to * check the table (= ghoul::Dictionary) contained in the key's value. Similar to the * Documentation, these DocumentationEntry%s can be Exhaustive or not. + * * \param documentationEntries The DocumentationEntry%s that are used to recursively - * test the ghoul::Dictionary that is contained inside. If this list is empty, only a - * type check is performed + * test the ghoul::Dictionary that is contained inside. If this list is empty, + * only a type check is performed */ TableVerifier(std::vector documentationEntries = {}); @@ -179,12 +186,13 @@ struct TableVerifier : public TemplateVerifier { * provided in the constructor. If the testing finds any offending keys, it will * return those keys with fully qualified names, that is, the name of the table will * be prepended to the offending keys. + * * \param dictionary The ghoul::Dictionary that is to be tested for the \p key * \param key The key for which the \p dictionary is tested * \return A TestResult containing the results of the testing. If DocumentationEntry%s - * were specified in the constructor and one of those values find an offending key - * inside the table, it's name will be returned with a fully qualified name by - * prepending the name (= \key) of the table. + * were specified in the constructor and one of those values find an offending + * key inside the table, it's name will be returned with a fully qualified + * name by prepending the name (= \key) of the table. */ TestResult operator()(const ghoul::Dictionary& dictionary, const std::string& key) const override; @@ -201,6 +209,7 @@ struct TableVerifier : public TemplateVerifier { struct StringListVerifier : public TableVerifier { /** * Constructor for a StringListVerifier. + * * \param elementDocumentation The documentation for each string in the list */ StringListVerifier(std::string elementDocumentation = ""); @@ -209,13 +218,14 @@ struct StringListVerifier : public TableVerifier { }; /** -* A Verifier that checks whether all values contained in a Table are of type \c int. -*/ + * A Verifier that checks whether all values contained in a Table are of type \c int. + */ struct IntListVerifier : public TableVerifier { /** - * Constructor for a IntListVerifier. - * \param elementDocumentation The documentation for each string in the list - */ + * Constructor for a IntListVerifier. + * + * \param elementDocumentation The documentation for each string in the list + */ IntListVerifier(std::string elementDocumentation = ""); std::string type() const override; @@ -242,25 +252,25 @@ struct Vector2Verifier : public TemplateVerifier>, public VectorVe }; /** -* This Verifier checks whether the value is of type glm::tvec3 -*/ + * This Verifier checks whether the value is of type glm::tvec3 + */ template struct Vector3Verifier : public TemplateVerifier>, public VectorVerifier { std::string type() const override; }; /** -* This Verifier checks whether the value is of type glm::tvec4 -*/ + * This Verifier checks whether the value is of type glm::tvec4 + */ template struct Vector4Verifier : public TemplateVerifier>, public VectorVerifier { std::string type() const override; }; /** -* A Verifier that checks whether all values contained in a Table are of -* type glm::tvec2 -*/ + * A Verifier that checks whether all values contained in a Table are of + * type glm::tvec2 + */ template struct Vector2ListVerifier : public TableVerifier { Vector2ListVerifier(std::string elementDocumentation = "") : TableVerifier({ @@ -274,9 +284,9 @@ struct Vector2ListVerifier : public TableVerifier { }; /** -* A Verifier that checks whether all values contained in a Table are of -* type glm::tvec3 -*/ + * A Verifier that checks whether all values contained in a Table are of + * type glm::tvec3 + */ template struct Vector3ListVerifier : public TableVerifier { Vector3ListVerifier(std::string elementDocumentation = "") : TableVerifier({ @@ -290,9 +300,9 @@ struct Vector3ListVerifier : public TableVerifier { }; /** -* A Verifier that checks whether all values contained in a Table are of -* type glm::tvec4 -*/ + * A Verifier that checks whether all values contained in a Table are of + * type glm::tvec4 + */ template struct Vector4ListVerifier : public TableVerifier { Vector4ListVerifier(std::string elementDocumentation = "") : TableVerifier({ @@ -309,16 +319,16 @@ struct Vector4ListVerifier : public TableVerifier { //---------------------------------------------------------------------------------------- /** -* This struct is the base class for all Verifier%s that check for \c glm matrix types. -* The template parameter for the subclasses is the containing type, not the full matrix -* type. For example to check for glm::dmat4x3, one would create a -* Matrix4x3Verifier. -*/ + * This struct is the base class for all Verifier%s that check for \c glm matrix types. + * The template parameter for the subclasses is the containing type, not the full matrix + * type. For example to check for glm::dmat4x3, one would create a + * Matrix4x3Verifier. + */ struct MatrixVerifier {}; /** -* This Verifier checks whether the value is of type glm::mat2x2 -*/ + * This Verifier checks whether the value is of type glm::mat2x2 + */ template struct Matrix2x2Verifier : public TemplateVerifier>, public MatrixVerifier @@ -327,8 +337,8 @@ struct Matrix2x2Verifier : }; /** -* This Verifier checks whether the value is of type glm::mat2x3 -*/ + * This Verifier checks whether the value is of type glm::mat2x3 + */ template struct Matrix2x3Verifier : public TemplateVerifier>, public MatrixVerifier { @@ -336,8 +346,8 @@ struct Matrix2x3Verifier : }; /** -* This Verifier checks whether the value is of type glm::mat2x4 -*/ + * This Verifier checks whether the value is of type glm::mat2x4 + */ template struct Matrix2x4Verifier : public TemplateVerifier>, public MatrixVerifier { @@ -345,8 +355,8 @@ struct Matrix2x4Verifier : }; /** -* This Verifier checks whether the value is of type glm::mat3x2 -*/ + * This Verifier checks whether the value is of type glm::mat3x2 + */ template struct Matrix3x2Verifier : public TemplateVerifier>, public MatrixVerifier { @@ -354,8 +364,8 @@ struct Matrix3x2Verifier : }; /** -* This Verifier checks whether the value is of type glm::mat3x3 -*/ + * This Verifier checks whether the value is of type glm::mat3x3 + */ template struct Matrix3x3Verifier : public TemplateVerifier>, public MatrixVerifier { @@ -363,8 +373,8 @@ struct Matrix3x3Verifier : }; /** -* This Verifier checks whether the value is of type glm::mat3x4 -*/ + * This Verifier checks whether the value is of type glm::mat3x4 + */ template struct Matrix3x4Verifier : public TemplateVerifier>, public MatrixVerifier { @@ -372,8 +382,8 @@ struct Matrix3x4Verifier : }; /** -* This Verifier checks whether the value is of type glm::mat4x2 -*/ + * This Verifier checks whether the value is of type glm::mat4x2 + */ template struct Matrix4x2Verifier : public TemplateVerifier>, public MatrixVerifier { @@ -381,8 +391,8 @@ struct Matrix4x2Verifier : }; /** -* This Verifier checks whether the value is of type glm::mat4x3 -*/ + * This Verifier checks whether the value is of type glm::mat4x3 + */ template struct Matrix4x3Verifier : public TemplateVerifier>, public MatrixVerifier { @@ -390,8 +400,8 @@ struct Matrix4x3Verifier : }; /** -* This Verifier checks whether the value is of type glm::mat4x4 -*/ + * This Verifier checks whether the value is of type glm::mat4x4 + */ template struct Matrix4x4Verifier : public TemplateVerifier>, public MatrixVerifier { @@ -432,13 +442,14 @@ struct OperatorVerifier : public T { * \p key%'s value is correct using the template paramater \c T as a verifier. Then, * the \p key%'s value is checked against the stored OperatorVerifier::value using the * \c Operator. + * * \param dictionary The ghoul::Dictionary that contains the \p key to be tested * \param key The key inside the \p dictinoary that is to be tested * \return A TestResult containing the results of the specification testing. If the - * \p key%'s value has the wrong type, it will be added to the TestResult's offense - * list with the reason TestResult::Offense::Reason::WrongType; if the \c Operator - * returns false, it will be added with the reason TestResult::Offense::Verification - * instead. + * \p key%'s value has the wrong type, it will be added to the TestResult's + * offense list with the reason TestResult::Offense::Reason::WrongType; if the + * \c Operator returns false, it will be added with the reason + * TestResult::Offense::Verification instead. */ TestResult operator()(const ghoul::Dictionary& dictionary, const std::string& key) const override; @@ -479,10 +490,10 @@ struct LessVerifier : public OperatorVerifier> { }; /** -* This Verifier checks whether the incoming value is smaller than or equal to the stored -* value. Due to the operator type restrictions, \c T cannot be a subclass of (or the same -* as) BoolVerifier, StringVerifier, TableVerifier, or VectorVerifier. -*/ + * This Verifier checks whether the incoming value is smaller than or equal to the stored + * value. Due to the operator type restrictions, \c T cannot be a subclass of (or the same + * as) BoolVerifier, StringVerifier, TableVerifier, or VectorVerifier. + */ template struct LessEqualVerifier : public OperatorVerifier> { static_assert( @@ -510,10 +521,10 @@ struct LessEqualVerifier : public OperatorVerifier struct GreaterVerifier : public OperatorVerifier> { static_assert( @@ -541,10 +552,10 @@ struct GreaterVerifier : public OperatorVerifier struct GreaterEqualVerifier : public OperatorVerifier> @@ -574,9 +585,10 @@ struct GreaterEqualVerifier : public OperatorVerifier struct EqualVerifier : public OperatorVerifier> { static_assert(!std::is_base_of::value, "T cannot be TableVerifier"); @@ -589,10 +601,10 @@ struct EqualVerifier : public OperatorVerifier struct UnequalVerifier : public OperatorVerifier> { static_assert(!std::is_base_of::value, "T cannot be TableVerifier"); @@ -621,6 +633,7 @@ struct InListVerifier : public T { /** * Constructs an InListVerifier that checks whether the incoming value is of the * correct type and whether the value is part of the list passed as \p values. + * * \param values The list of values against which the incoming value is tested */ InListVerifier(std::vector values); @@ -629,13 +642,14 @@ struct InListVerifier : public T { * Tests whether the \p key exists in the \p dictionary, whether it has the correct * type by invoking the template parameter \c T, and then tests if the \p key's value * is part of the list passed to the constructor. + * * \param dictionary The ghoul::Dictionary that contains the \p key * \param key The key that is contained in the \p dictionary and whose value is tested * \return A TestResult containing the results of the specification testing. If the - * \p key%'s value has the wrong type, it will be added to the TestResult's offense - * list with the reason TestResult::Offense::Reason::WrongType; if the value is not - * in the list, it will be added with the reason TestResult::Offense::Verification - * instead. + * \p key%'s value has the wrong type, it will be added to the TestResult's + * offense list with the reason TestResult::Offense::Reason::WrongType; if the + * value is not in the list, it will be added with the reason + * TestResult::Offense::Verification instead. */ TestResult operator()(const ghoul::Dictionary& dictionary, const std::string& key) const override; @@ -647,33 +661,36 @@ struct InListVerifier : public T { }; /** -* This Verifier checks whether the incoming value is of the correct type, using the -* Verifier passed as a template parameter \c T and then checks whether it is not part of a -* list that is passed to the constructor. To the missing equality operator, \c T cannot -* be a subclass of (or the same as) TableVerifier. -*/ + * This Verifier checks whether the incoming value is of the correct type, using the + * Verifier passed as a template parameter \c T and then checks whether it is not part of + * a list that is passed to the constructor. To the missing equality operator, \c T cannot + * be a subclass of (or the same as) TableVerifier. + */ template struct NotInListVerifier : public T { static_assert(!std::is_base_of::value, "T cannot be TableVerifier"); /** - * Constructs a NotInListVerifier that checks whether the incoming value is of the - * correct type and whether the value is not part of the list passed as \p values. - * \param values The list of values against which the incoming value is tested - */ + * Constructs a NotInListVerifier that checks whether the incoming value is of the + * correct type and whether the value is not part of the list passed as \p values. + * + * \param values The list of values against which the incoming value is tested + */ NotInListVerifier(std::vector values); /** - * Tests whether the \p key exists in the \p dictionary, whether it has the correct - * type by invoking the template parameter \c T, and then tests if the \p key's value - * is not part of the list passed to the constructor. - * \param dictionary The ghoul::Dictionary that contains the \p key - * \param key The key that is contained in the \p dictionary and whose value is tested - * \return A TestResult containing the results of the specification testing. If the - * \p key%'s value has the wrong type, it will be added to the TestResult's offense - * list with the reason TestResult::Offense::Reason::WrongType; if the value is in the - * list, it will be added with the reason TestResult::Offense::Verification instead. - */ + * Tests whether the \p key exists in the \p dictionary, whether it has the correct + * type by invoking the template parameter \c T, and then tests if the \p key's value + * is not part of the list passed to the constructor. + * + * \param dictionary The ghoul::Dictionary that contains the \p key + * \param key The key that is contained in the \p dictionary and whose value is tested + * \return A TestResult containing the results of the specification testing. If the + * \p key%'s value has the wrong type, it will be added to the TestResult's + * offense list with the reason TestResult::Offense::Reason::WrongType; if the + * value is in the list, it will be added with the reason + * TestResult::Offense::Verification instead. + */ TestResult operator()(const ghoul::Dictionary& dictionary, const std::string& key) const override; @@ -687,12 +704,12 @@ struct NotInListVerifier : public T { //---------------------------------------------------------------------------------------- /** -* This Verifier checks whether the incoming value is of the correct type, using the -* Verifier passed as a template parameter \c T and then checks whether it is greater or -* equal to a lower limit and less or equal to a higher limit. To the missing comparison -* operators, \c T cannot be a subclass of (or the same as) BoolVerifier, StringVerifier, -* TableVerifier, or VectorVerifier. Both the lower and the higher limit are inclusive). -*/ + * This Verifier checks whether the incoming value is of the correct type, using the + * Verifier passed as a template parameter \c T and then checks whether it is greater or + * equal to a lower limit and less or equal to a higher limit. To the missing comparison + * operators, \c T cannot be a subclass of (or the same as) BoolVerifier, StringVerifier, + * TableVerifier, or VectorVerifier. Both the lower and the higher limit are inclusive). + */ template struct InRangeVerifier : public T { static_assert( @@ -713,28 +730,32 @@ struct InRangeVerifier : public T { ); /** - * Constructs a InRangeVerifier that checks whether the incoming value is of the - * correct type and whether the value is greater or equal to \p lower and less or equal - * to \upper. - * \param lower The (inclusive) lower limit of the range - * \param upper The (inclusive) upper limit of the range - * \pre \p lower must be smaller or equal to \p upper - */ + * Constructs a InRangeVerifier that checks whether the incoming value is of the + * correct type and whether the value is greater or equal to \p lower and less or + * equal to \upper. + * + * \param lower The (inclusive) lower limit of the range + * \param upper The (inclusive) upper limit of the range + * + * \pre \p lower must be smaller or equal to \p upper + */ InRangeVerifier(typename T::Type lower, typename T::Type upper); /** - * Tests whether the \p key exists in the \p dictionary, whether it has the correct - * type by invoking the template parameter \c T, and then tests if the \p key's value - * is between the lower and upper limits (both inclusive) that were passed to the - * constructor. - * \param dictionary The ghoul::Dictionary that contains the \p key - * \param key The key that is contained in the \p dictionary and whose value is tested - * \return A TestResult containing the results of the specification testing. If the - * \p key%'s value has the wrong type, it will be added to the TestResult's offense - * list with the reason TestResult::Offense::Reason::WrongType; if the value is outside - * the range defined by the lower and upper limits passed to the constructor, it will - * be added with the reason TestResult::Offense::Verification instead. - */ + * Tests whether the \p key exists in the \p dictionary, whether it has the correct + * type by invoking the template parameter \c T, and then tests if the \p key's value + * is between the lower and upper limits (both inclusive) that were passed to the + * constructor. + * + * \param dictionary The ghoul::Dictionary that contains the \p key + * \param key The key that is contained in the \p dictionary and whose value is tested + * \return A TestResult containing the results of the specification testing. If the + * \p key%'s value has the wrong type, it will be added to the TestResult's + * offense list with the reason TestResult::Offense::Reason::WrongType; if the + * value is outside the range defined by the lower and upper limits passed to + * the constructor, it will be added with the reason + * TestResult::Offense::Verification instead. + */ TestResult operator()(const ghoul::Dictionary& dictionary, const std::string& key) const override; @@ -745,12 +766,12 @@ struct InRangeVerifier : public T { }; /** -* This Verifier checks whether the incoming value is of the correct type, using the -* Verifier passed as a template parameter \c T and then checks whether it is outside the -* (exclusive) range defined by a lower and upper limit. To the missing comparison -* operators, \c T cannot be a subclass of (or the same as) BoolVerifier, StringVerifier, -* TableVerifier, or VectorVerifier. Both the lower and the higher limit are exclusive). -*/ + * This Verifier checks whether the incoming value is of the correct type, using the + * Verifier passed as a template parameter \c T and then checks whether it is outside the + * (exclusive) range defined by a lower and upper limit. To the missing comparison + * operators, \c T cannot be a subclass of (or the same as) BoolVerifier, StringVerifier, + * TableVerifier, or VectorVerifier. Both the lower and the higher limit are exclusive). + */ template struct NotInRangeVerifier : public T { static_assert( @@ -771,27 +792,31 @@ struct NotInRangeVerifier : public T { ); /** - * Constructs a InRangeVerifier that checks whether the incoming value is of the - * correct type and whether the value is less then \p lower and greater than \upper. - * \param lower The (exclusive) lower limit of the range - * \param upper The (exclusive) upper limit of the range - * \pre \p lower must be smaller or equal to \p upper - */ + * Constructs a InRangeVerifier that checks whether the incoming value is of the + * correct type and whether the value is less then \p lower and greater than \p upper. + * + * \param lower The (exclusive) lower limit of the range + * \param upper The (exclusive) upper limit of the range + * + * \pre \p lower must be smaller or equal to \p upper + */ NotInRangeVerifier(typename T::Type lower, typename T::Type upper); /** - * Tests whether the \p key exists in the \p dictionary, whether it has the correct - * type by invoking the template parameter \c T, and then tests if the \p key's value - * is outside the lower and upper limits (both exclusive) that were passed to the - * constructor. - * \param dictionary The ghoul::Dictionary that contains the \p key - * \param key The key that is contained in the \p dictionary and whose value is tested - * \return A TestResult containing the results of the specification testing. If the - * \p key%'s value has the wrong type, it will be added to the TestResult's offense - * list with the reason TestResult::Offense::Reason::WrongType; if the value is greater - * or equal to the lower limit and less or equal to the upper limit, it will be added - * with the reason TestResult::Offense::Verification instead. - */ + * Tests whether the \p key exists in the \p dictionary, whether it has the correct + * type by invoking the template parameter \c T, and then tests if the \p key's value + * is outside the lower and upper limits (both exclusive) that were passed to the + * constructor. + * + * \param dictionary The ghoul::Dictionary that contains the \p key + * \param key The key that is contained in the \p dictionary and whose value is tested + * \return A TestResult containing the results of the specification testing. If the + * \p key%'s value has the wrong type, it will be added to the TestResult's + * offense list with the reason TestResult::Offense::Reason::WrongType; if the + * value is greater or equal to the lower limit and less or equal to the upper + * limit, it will be added with the reason TestResult::Offense::Verification + * instead. + */ TestResult operator()(const ghoul::Dictionary& dictionary, const std::string& key) const override; @@ -818,8 +843,10 @@ struct AnnotationVerifier : public T { /** * Constructs an AnnotationVerifier that contains the passed \p annotation which is * passed to the user when a documentation is requested. + * * \param annotation The annotation that is stored and returned to the user when it - * is requested. + * is requested. + * * \pre annotation must not be empty */ AnnotationVerifier(std::string annotation); @@ -834,7 +861,7 @@ struct AnnotationVerifier : public T { * This Verifier is a marker that performs the same testing as the \c T parameter, but * also adds a warning to the test result informing the user of the deprecation. * Furthermore, the documentation will contain the word (deprecated) in - * addition to the documentation returned by \c + * addition to the documentation returned by \c T * \tparam T The Verifier that is to be marked deprecated */ template @@ -842,6 +869,7 @@ struct DeprecatedVerifier : public T { /** * Tests the \p dictionary%s \p key using the Verifier \c T and adds a warning to the * TestResult informing the caller of the deprecation. + * * \param dictionary The ghoul::Dictionary whose \p key should be tested * \param key The key inside the \p dictionary that is to be tested * \return A TestResult that contains the results of the testing @@ -868,11 +896,12 @@ struct DeprecatedVerifier : public T { struct ReferencingVerifier : public TableVerifier { /** * Creates a ReferencingVerifier that references a documentation with the provided - * \p identifier. The ReferencingVerifier will use the static DocumentationEngine to - * retrieve Documentation%s and find the \p identifier among them. + * identifier \p id. The ReferencingVerifier will use the static DocumentationEngine + * to retrieve Documentation%s and find the \p identifier among them. + * * \param identifier The identifier of the Documentation that this Verifier references */ - ReferencingVerifier(std::string identifier); + ReferencingVerifier(std::string id); /** * Checks whether the \p key in the \p dictionary exists and is of type Table (similar @@ -883,6 +912,7 @@ struct ReferencingVerifier : public TableVerifier { * signaled. If the identifier exists and the \p key%'s value does not comply with the * Documentation, the offending keys will be returned in the TestResult with their * fully qualified names. + * * \param dictionary The ghoul::Dictionary whose \p key should be tested * \param key The key contained in the \p dictionary that should be tested * \return A TestResult struct that contains the results of the testing @@ -911,26 +941,29 @@ struct AndVerifier : public Verifier { /** * Constructs an AndVerifier with two Verifiers which must be cleared by incoming * values in order to pass this Verifier. - * \param lhs The first Verifier that is to be tested - * \param rhs The second Verifier that is to be tested - * \pre lhs must not be nullptr - * \pre rhs must not be nullptr + * + * \param l The first Verifier that is to be tested + * \param r The second Verifier that is to be tested + * + * \pre l must not be nullptr + * \pre r must not be nullptr */ - AndVerifier(Verifier* lhs, Verifier* rhs); + AndVerifier(Verifier* l, Verifier* r); /** * Checks whether the \p dictionary contains the \p key and whether this key passes * both Verifier%'s that were passed in the constructor. If the value fails either * of the two Verifiers, it is only added once to the TestResult::offenses list with * a reason of TestResult::Offense::Reason::Verification. + * * \param dictionary The ghoul::Dictionary that is to be tested * \param key The key contained in \p dictionary that is to be tested * \return A TestResult object that contains the test results. If the value fails - * either of the two Verifiers, TestResult::success is \c false and the - * TestResult::offenses list contains \p with a reason of - * TestResult::Offense::Reason::Verification. If \p key%'s value passes both - * Verifier%s, the result's TestResult::success is \c true and the - * TestResult::offenses is empty. + * either of the two Verifiers, TestResult::success is \c false and the + * TestResult::offenses list contains \p with a reason of + * TestResult::Offense::Reason::Verification. If \p key%'s value passes both + * Verifier%s, the result's TestResult::success is \c true and the + * TestResult::offenses is empty. */ TestResult operator()(const ghoul::Dictionary& dictionary, const std::string& key) const override; @@ -945,36 +978,40 @@ struct AndVerifier : public Verifier { }; /** -* This Verifier takes two Verifiers and performs a boolean \c or operation on their -* results. In essence, a value only passes this Verifier if it passes either of the two -* Verifier%s that are passed in the constructor. Opposed to the C++ -* || operator, the OrVerifier does not perform any short-circut evaluation. -*/ + * This Verifier takes two Verifiers and performs a boolean \c or operation on their + * results. In essence, a value only passes this Verifier if it passes either of the two + * Verifier%s that are passed in the constructor. Opposed to the C++ + * || operator, the OrVerifier does not perform any short-circut evaluation. + */ struct OrVerifier : public Verifier { /** - * Constructs an OrVerifier with two Verifiers, either of which must be cleared by - * incoming values in order to pass this Verifier. - * \param lhs The first Verifier that is to be tested - * \param rhs The second Verifier that is to be tested - * \pre lhs must not be nullptr - * \pre rhs must not be nullptr - */ - OrVerifier(Verifier* lhs, Verifier* rhs); + * Constructs an OrVerifier with two Verifiers, either of which must be cleared by + * incoming values in order to pass this Verifier. + * + * \param l The first Verifier that is to be tested + * \param r The second Verifier that is to be tested + * + * \pre l must not be nullptr + * \pre r must not be nullptr + */ + OrVerifier(Verifier* l, Verifier* r); /** - * Checks whether the \p dictionary contains the \p key and whether this key passes - * either of the two Verifier%'s that were passed in the constructor. If the value - * fails both Verifiers, it is added to the TestResult::offenses list with a reason of - * TestResult::Offense::Reason::Verification. - * \param dictionary The ghoul::Dictionary that is to be tested - * \param key The key contained in \p dictionary that is to be tested - * \return A TestResult object that contains the test results. If the value fails - * both Verifiers, TestResult::success is \c false and the TestResult::offenses list - * contains \p with a reason of TestResult::Offense::Reason::Verification. If \p key%'s - * value passes either of the two Verifier%s, the result's TestResult::success is - * \c true and the TestResult::offenses is empty. - */ - TestResult operator()(const ghoul::Dictionary& dict, + * Checks whether the \p dictionary contains the \p key and whether this key passes + * either of the two Verifier%'s that were passed in the constructor. If the value + * fails both Verifiers, it is added to the TestResult::offenses list with a reason of + * TestResult::Offense::Reason::Verification. + * + * \param dictionary The ghoul::Dictionary that is to be tested + * \param key The key contained in \p dictionary that is to be tested + * \return A TestResult object that contains the test results. If the value fails + * both Verifiers, TestResult::success is \c false and the + * TestResult::offenses list contains \p with a reason of + * TestResult::Offense::Reason::Verification. If \p key%'s value passes either + * of the two Verifier%s, the result's TestResult::success is \c true and the + * TestResult::offenses is empty. + */ + TestResult operator()(const ghoul::Dictionary& dictionary, const std::string& key) const override; std::string type() const override; diff --git a/include/openspace/engine/downloadmanager.h b/include/openspace/engine/downloadmanager.h index 2be6375148..36e21950c9 100644 --- a/include/openspace/engine/downloadmanager.h +++ b/include/openspace/engine/downloadmanager.h @@ -25,14 +25,14 @@ #ifndef __OPENSPACE_CORE___DOWNLOADMANAGER___H__ #define __OPENSPACE_CORE___DOWNLOADMANAGER___H__ -#include -#include - +#include #include +#include #include #include #include -#include + +namespace ghoul::filesystem { class File; } namespace openspace { @@ -46,17 +46,17 @@ public: FileFuture(std::string file); // Values that are written by the DownloadManager to be consumed by others - long long currentSize; - long long totalSize; - float progress; // [0,1] - float secondsRemaining; - bool isFinished; - bool isAborted; + long long currentSize = -1; + long long totalSize = -1; + float progress = 0.f; // [0,1] + float secondsRemaining = -1.f; + bool isFinished = false; + bool isAborted = false; std::string filePath; std::string errorMessage; std::string format; // Values set by others to be consumed by the DownloadManager - bool abortDownload; + bool abortDownload = false; }; struct MemoryFile { @@ -66,6 +66,11 @@ public: bool corrupted; }; + BooleanType(UseMultipleThreads); + BooleanType(OverrideFile); + BooleanType(FailOnError); + + using DownloadProgressCallback = std::function; using DownloadFinishedCallback = std::function; @@ -76,13 +81,14 @@ public: using AsyncDownloadFinishedCallback = std::function>&)>; - //Just a helper function to check if a future is ready to ".get()". Not specific + // Just a helper function to check if a future is ready to ".get()". Not specific // to DownloadManager but is useful for anyone using the DownloadManager template - static bool futureReady(std::future const& f) - { return f.wait_for(std::chrono::seconds(0)) == std::future_status::ready; } + static bool futureReady(std::future const& f) { + return f.wait_for(std::chrono::seconds(0)) == std::future_status::ready; + } - DownloadManager(bool useMultithreadedDownload = true); + DownloadManager(UseMultipleThreads useMultipleThreads = UseMultipleThreads::Yes); //downloadFile // url - specifies the target of the download @@ -94,15 +100,13 @@ public: // progressCallback - callback for status during (happens on different thread) std::shared_ptr downloadFile(const std::string& url, const ghoul::filesystem::File& file, - bool overrideFile = true, - bool failOnError = false, - unsigned int timeout_secs = 0, + OverrideFile overrideFile = OverrideFile::Yes, + FailOnError failOnError = FailOnError::No, unsigned int timeout_secs = 0, DownloadFinishedCallback finishedCallback = DownloadFinishedCallback(), DownloadProgressCallback progressCallback = DownloadProgressCallback() ); - std::future fetchFile( - const std::string& url, + std::future fetchFile(const std::string& url, SuccessCallback successCallback = SuccessCallback(), ErrorCallback errorCallback = ErrorCallback()); diff --git a/include/openspace/engine/logfactory.h b/include/openspace/engine/logfactory.h index 9ed1b0a801..e76b749ee3 100644 --- a/include/openspace/engine/logfactory.h +++ b/include/openspace/engine/logfactory.h @@ -57,6 +57,7 @@ std::unique_ptr createLog(const ghoul::Dictionary& dictiona /** * 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 */ diff --git a/include/openspace/engine/moduleengine.h b/include/openspace/engine/moduleengine.h index 51cf4b43ec..2dc4af83e8 100644 --- a/include/openspace/engine/moduleengine.h +++ b/include/openspace/engine/moduleengine.h @@ -25,20 +25,19 @@ #ifndef __OPENSPACE_CORE___MODULEENGINE___H__ #define __OPENSPACE_CORE___MODULEENGINE___H__ +#include + +#include #include #include -#include -#include - -#include -#include -#include - +namespace ghoul { class Dictionary; } namespace ghoul::systemcapabilities { struct Version; } namespace openspace { +class OpenSpaceModule; + namespace scripting { struct LuaLibrary; } /** @@ -87,7 +86,7 @@ public: * \pre \p module must not be nullptr */ void registerModule(std::unique_ptr module, - const ghoul::Dictionary& configuration); + const ghoul::Dictionary& configuration); /** * Returns a list of all registered OpenSpaceModule%s that have been registered with @@ -103,17 +102,7 @@ public: * \return a pointer to the module of the given subclass */ template - ModuleSubClass* module() const { - auto it = std::find_if(_modules.begin(), _modules.end(), - [](const std::unique_ptr& m) { - return m->identifier() == ModuleSubClass::Name; - }); - if (it != _modules.end()) { - return dynamic_cast(it->get()); - } else { - return nullptr; - } - } + ModuleSubClass* module() const; /** * Returns the combined minimum OpenGL version. The return value is the maximum @@ -135,4 +124,6 @@ private: } // namespace openspace +#include "moduleengine.inl" + #endif // __OPENSPACE_CORE___MODULEENGINE___H__ diff --git a/include/openspace/engine/moduleengine.inl b/include/openspace/engine/moduleengine.inl new file mode 100644 index 0000000000..2ee3931739 --- /dev/null +++ b/include/openspace/engine/moduleengine.inl @@ -0,0 +1,43 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2018 * + * * + * Permission is hereby 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 { + +template +ModuleSubClass* ModuleEngine::module() const { + const auto it = std::find_if(_modules.begin(), _modules.end(), + [](const std::unique_ptr& m) { + return m->identifier() == ModuleSubClass::Name; + }); + if (it != _modules.end()) { + return dynamic_cast(it->get()); + } + else { + return nullptr; + } +} + +} // namespace openspace diff --git a/include/openspace/engine/openspaceengine.h b/include/openspace/engine/openspaceengine.h index 140c857b73..7d110db256 100644 --- a/include/openspace/engine/openspaceengine.h +++ b/include/openspace/engine/openspaceengine.h @@ -25,13 +25,10 @@ #ifndef __OPENSPACE_CORE___OPENSPACEENGINE___H__ #define __OPENSPACE_CORE___OPENSPACEENGINE___H__ -#include #include #include #include #include -#include - #include #include #include @@ -61,6 +58,7 @@ class VirtualPropertyManager; class WindowWrapper; namespace interaction { + struct JoystickInputStates; class KeyBindingManager; class NavigationHandler; } // namespace interaction @@ -86,11 +84,11 @@ struct ShutdownInformation { class OpenSpaceEngine { public: - static void create(int argc, char** argv, std::unique_ptr windowWrapper, - std::vector& sgctArguments, - bool& requestClose, bool consoleLog = true); + std::vector& sgctArguments, bool& requestClose, + bool consoleLog = true); + static void destroy(); static OpenSpaceEngine& ref(); static bool isCreated(); @@ -108,7 +106,7 @@ public: void drawOverlays(); void postDraw(); void keyboardCallback(Key key, KeyModifier mod, KeyAction action); - void charCallback(unsigned int codepoint, KeyModifier mod); + void charCallback(unsigned int codepoint, KeyModifier modifier); void mouseButtonCallback(MouseButton button, MouseAction action); void mousePositionCallback(double x, double y); void mouseScrollWheelCallback(double posX, double posY); @@ -188,7 +186,6 @@ public: void writeSceneDocumentation(); void writeStaticDocumentation(); - /** * Returns the Lua library that contains all Lua functions available to affect the * application. diff --git a/include/openspace/engine/syncengine.h b/include/openspace/engine/syncengine.h index acd5da35bd..ff63f2bea0 100644 --- a/include/openspace/engine/syncengine.h +++ b/include/openspace/engine/syncengine.h @@ -28,9 +28,8 @@ #include #include - -#include #include +#include namespace openspace { diff --git a/include/openspace/engine/virtualpropertymanager.h b/include/openspace/engine/virtualpropertymanager.h index 26840c36c2..7cc74f80f1 100644 --- a/include/openspace/engine/virtualpropertymanager.h +++ b/include/openspace/engine/virtualpropertymanager.h @@ -27,13 +27,13 @@ #include -#include - #include #include namespace openspace { +class Property; + class VirtualPropertyManager : public properties::PropertyOwner { public: VirtualPropertyManager(); diff --git a/include/openspace/engine/wrapper/sgctwindowwrapper.h b/include/openspace/engine/wrapper/sgctwindowwrapper.h index 229c832baf..59f73443cd 100644 --- a/include/openspace/engine/wrapper/sgctwindowwrapper.h +++ b/include/openspace/engine/wrapper/sgctwindowwrapper.h @@ -35,6 +35,7 @@ namespace openspace { /** * WindowWrapper subclass wrapping the Simple Graphics Cluster Toolkit, forwarding all * method calls to the specific functions in the Engine and SGCTWindow classes. + * * \sa https://c-student.itn.liu.se/wiki/develop:sgct:sgct */ class SGCTWindowWrapper : public WindowWrapper { @@ -69,7 +70,7 @@ public: glm::mat4 viewProjectionMatrix() const override; glm::mat4 modelMatrix() const override; - void setNearFarClippingPlane(float near, float far) override; + void setNearFarClippingPlane(float nearPlane, float farPlane) override; void setEyeSeparationDistance(float distance) override; glm::ivec4 viewportPixelCoordinates() const override; diff --git a/include/openspace/engine/wrapper/windowwrapper.h b/include/openspace/engine/wrapper/windowwrapper.h index ce8bdaf396..c8ae700f3b 100644 --- a/include/openspace/engine/wrapper/windowwrapper.h +++ b/include/openspace/engine/wrapper/windowwrapper.h @@ -30,10 +30,6 @@ #include #include -#include -#include -#include - namespace openspace { namespace scripting { struct LuaLibrary; } @@ -283,7 +279,7 @@ public: virtual bool isSimpleRendering() const; /** - * Returns true if the rendering is being done using a Fisheye lens; + * Returns true if the rendering is being done using a Fisheye lens; * false otherwise. On default, this method returns * false */ diff --git a/include/openspace/interaction/delayedvariable.h b/include/openspace/interaction/delayedvariable.h index d231e0e713..dab326c01b 100644 --- a/include/openspace/interaction/delayedvariable.h +++ b/include/openspace/interaction/delayedvariable.h @@ -31,7 +31,7 @@ namespace openspace::interaction { * Class that acts as a smoothing filter to a variable. The filter has a step * response on a form that resembles the function y = 1-e^(-t/scale). The variable * will be updated as soon as it is set to a value (calling the set() function). -*/ + */ template class DelayedVariable { public: diff --git a/include/openspace/interaction/inputstate.h b/include/openspace/interaction/inputstate.h index 9ab85ffe8f..3569db80eb 100644 --- a/include/openspace/interaction/inputstate.h +++ b/include/openspace/interaction/inputstate.h @@ -25,20 +25,18 @@ #ifndef __OPENSPACE_CORE___INPUTSTATE___H__ #define __OPENSPACE_CORE___INPUTSTATE___H__ -#include #include #include #include -#include +#include namespace openspace::interaction { +struct JoystickInputStates; + // This class represents the global input state of interaction devices class InputState { public: - InputState() = default; - ~InputState() = default; - // Callback functions void keyboardCallback(Key key, KeyModifier modifier, KeyAction action); void mouseButtonCallback(MouseButton button, MouseAction action); @@ -48,11 +46,11 @@ public: void setJoystickInputStates(JoystickInputStates& states); // Accessors - const std::list>& pressedKeys() const; + const std::vector>& pressedKeys() const; bool isKeyPressed(std::pair keyModPair) const; bool isKeyPressed(Key key) const; - const std::list& pressedMouseButtons() const; + const std::vector& pressedMouseButtons() const; glm::dvec2 mousePosition() const; double mouseScrollDelta() const; bool isMouseButtonPressed(MouseButton mouseButton) const; @@ -63,10 +61,10 @@ public: private: // Input from keyboard - std::list> _keysDown; + std::vector> _keysDown; // Input from mouse - std::list _mouseButtonsDown; + std::vector _mouseButtonsDown; glm::dvec2 _mousePosition; double _mouseScrollDelta; diff --git a/include/openspace/interaction/interpolator.h b/include/openspace/interaction/interpolator.h index 29941c90b7..d9ef5825e8 100644 --- a/include/openspace/interaction/interpolator.h +++ b/include/openspace/interaction/interpolator.h @@ -51,9 +51,9 @@ public: private: std::function _transferFunction; - float _t; - float _interpolationTime; - float _scaledDeltaTime; + float _t = 0.f; + float _interpolationTime = 1.f; + float _scaledDeltaTime = 0.f; }; } // namespace openspace::interaction diff --git a/include/openspace/interaction/interpolator.inl b/include/openspace/interaction/interpolator.inl index 8bc83575a2..8c1de633e8 100644 --- a/include/openspace/interaction/interpolator.inl +++ b/include/openspace/interaction/interpolator.inl @@ -24,25 +24,21 @@ #include -#include - namespace openspace::interaction { template Interpolator::Interpolator() : _transferFunction([](float t){ return t; }) - , _t(0.0) - , _interpolationTime(1.0) {} template void Interpolator::start() { - _t = 0.0; + _t = 0.f; } template void Interpolator::end() { - _t = 1.0; + _t = 1.f; } template @@ -52,7 +48,7 @@ void Interpolator::setDeltaTime(float deltaTime) { template void Interpolator::setTransferFunction(std::function transferFunction) { - _transferFunction = transferFunction; + _transferFunction = std::move(transferFunction); } template @@ -78,7 +74,7 @@ T Interpolator::value() const { template bool Interpolator::isInterpolating() const { - return _t < 1.0 && _t >= 0.0; + return (_t < 1.f) && (_t >= 0.f); } } // namespace openspace::interaction diff --git a/include/openspace/interaction/joystickcamerastates.h b/include/openspace/interaction/joystickcamerastates.h index 97d155b279..7c8f05daf6 100644 --- a/include/openspace/interaction/joystickcamerastates.h +++ b/include/openspace/interaction/joystickcamerastates.h @@ -63,14 +63,11 @@ public: float deadzone = 0.f; }; - JoystickCameraStates(double sensitivity, double velocityScaleFactor); void updateStateFromInput(const InputState& inputState, double deltaTime) override; - void setAxisMapping( - int axis, - AxisType mapping, + void setAxisMapping(int axis, AxisType mapping, AxisInvert shouldInvert = AxisInvert::No, AxisNormalize shouldNormalize = AxisNormalize::No ); @@ -82,7 +79,7 @@ public: void bindButtonCommand(int button, std::string command, JoystickAction action, - ButtonCommandRemote local); + ButtonCommandRemote remote, std::string documentation); void clearButtonCommand(int button); std::vector buttonCommand(int button) const; diff --git a/include/openspace/interaction/keybindingmanager.h b/include/openspace/interaction/keybindingmanager.h index 11138eae38..5f71eaa4e3 100644 --- a/include/openspace/interaction/keybindingmanager.h +++ b/include/openspace/interaction/keybindingmanager.h @@ -26,15 +26,16 @@ #define __OPENSPACE_CORE___KEYBINDINGMANAGER___H__ #include -#include -#include +#include #include namespace openspace { class Camera; class SceneGraphNode; -} // namespace +} // namespace openspace + +namespace openspace::scripting { struct LuaLibrary; } namespace openspace::interaction { @@ -50,23 +51,14 @@ public: }; KeyBindingManager(); - ~KeyBindingManager() = default; void resetKeyBindings(); - void bindKeyLocal( - Key key, - KeyModifier modifier, - std::string luaCommand, - std::string documentation = "" - ); + void bindKeyLocal(Key key, KeyModifier modifier, std::string luaCommand, + std::string documentation = ""); - void bindKey( - Key key, - KeyModifier modifier, - std::string luaCommand, - std::string documentation = "" - ); + void bindKey(Key key, KeyModifier modifier, std::string luaCommand, + std::string documentation = ""); void removeKeyBinding(const std::string& key); @@ -75,7 +67,6 @@ public: static scripting::LuaLibrary luaLibrary(); - // Callback functions void keyboardCallback(Key key, KeyModifier modifier, KeyAction action); private: diff --git a/include/openspace/interaction/keyframenavigator.h b/include/openspace/interaction/keyframenavigator.h index 0346e894b4..e7ad1318d0 100644 --- a/include/openspace/interaction/keyframenavigator.h +++ b/include/openspace/interaction/keyframenavigator.h @@ -26,8 +26,7 @@ #define __OPENSPACE_CORE___KEYFRAMENAVIGATOR___H__ #include -#include - +#include #include #include @@ -45,9 +44,6 @@ public: bool followFocusNodeRotation; }; - KeyframeNavigator() = default; - ~KeyframeNavigator() = default; - void updateCamera(Camera& camera); Timeline& timeline(); diff --git a/include/openspace/interaction/navigationhandler.h b/include/openspace/interaction/navigationhandler.h index bec01c674f..84d9636d6c 100644 --- a/include/openspace/interaction/navigationhandler.h +++ b/include/openspace/interaction/navigationhandler.h @@ -27,26 +27,25 @@ #include -#include -#include -#include #include #include #include -#include #include #include -#include -#include - namespace openspace { class Camera; class SceneGraphNode; } // namespace openspace +namespace openspace::scripting { struct LuaLibrary; } + namespace openspace::interaction { +struct JoystickInputStates; +class KeyframeNavigator; +class OrbitalNavigator; + class NavigationHandler : public properties::PropertyOwner { public: NavigationHandler(); @@ -83,9 +82,7 @@ public: void setJoystickInputStates(JoystickInputStates& states); - void setJoystickAxisMapping( - int axis, - JoystickCameraStates::AxisType mapping, + void setJoystickAxisMapping(int axis, JoystickCameraStates::AxisType mapping, JoystickCameraStates::AxisInvert shouldInvert = JoystickCameraStates::AxisInvert::No, JoystickCameraStates::AxisNormalize shouldNormalize = @@ -98,7 +95,7 @@ public: float joystickAxisDeadzone(int axis) const; void bindJoystickButtonCommand(int button, std::string command, JoystickAction action, - JoystickCameraStates::ButtonCommandRemote remote); + JoystickCameraStates::ButtonCommandRemote remote, std::string documentation); void clearJoystickButtonCommand(int button); std::vector joystickButtonCommand(int button) const; @@ -118,12 +115,11 @@ private: bool _cameraUpdatedFromScript = false; std::unique_ptr _inputState; - Camera* _camera; + Camera* _camera = nullptr; std::unique_ptr _orbitalNavigator; std::unique_ptr _keyframeNavigator; - // Properties properties::StringProperty _origin; properties::BoolProperty _useKeyFrameInteraction; }; diff --git a/include/openspace/interaction/orbitalnavigator.h b/include/openspace/interaction/orbitalnavigator.h index 42bc765673..85d22b9e5f 100644 --- a/include/openspace/interaction/orbitalnavigator.h +++ b/include/openspace/interaction/orbitalnavigator.h @@ -25,16 +25,14 @@ #ifndef __OPENSPACE_CORE___ORBITALNAVIGATOR___H__ #define __OPENSPACE_CORE___ORBITALNAVIGATOR___H__ +#include + #include -#include #include #include #include - -#include #include #include - #include #include @@ -46,10 +44,11 @@ namespace openspace { namespace openspace::interaction { -class OrbitalNavigator : public properties::PropertyOwner { +class InputState; + +class OrbitalNavigator : public properties::PropertyOwner { public: OrbitalNavigator(); - ~OrbitalNavigator(); void updateStatesFromInput(const InputState& inputState, double deltaTime); void updateCameraStateFromStates(Camera& camera, double deltaTime); diff --git a/include/openspace/mission/mission.h b/include/openspace/mission/mission.h index 129b32a5a1..c0568a189d 100644 --- a/include/openspace/mission/mission.h +++ b/include/openspace/mission/mission.h @@ -27,7 +27,6 @@ #include -#include #include #include @@ -50,48 +49,55 @@ public: /** * Constructs a MissionPhase from the information provided in the \p dictionary. See * the MissionPhase::Documentation for accepted ghoul::Dictionary values. + * * \param dictionary The ghoul::Dictionary that contains information about the current - * MissionPhase + * MissionPhase + * * \throw SpecificationError If the \p dictionary does not adhere to the Documentation * \throw RuntimeError If the time range of subphases is smaller than the specified - * time range + * time range * \throw RuntimeError If neither subphases or a time range is specified */ MissionPhase(const ghoul::Dictionary& dictionary); /** * Returns the name of the MissionPhase. + * * \return The name of the MissionPhase */ - std::string name() const; + const std::string& name() const; /** * Returns the TimeRange of the MissionPhase. + * * \return The TimeRange of the MissionPhase */ - TimeRange timeRange() const; + const TimeRange& timeRange() const; /** * Returns the description of the MissionPhase. + * * \return The description of the MissionPhase */ - std::string description() const; + const std::string& description() const; /** * Returns all subphases sorted by start time. + * * \return All subphases sorted by start time */ - std::vector phases() const; + const std::vector& phases() const; using Trace = std::vector>; /** * Returns all MissionPhase%s whose MissionPhase::timeRange includes the provided * \p time, up to a maximum subphase depth of \p maxDepth. + * * \param time The time in which the subphases have to be active in order to be - * included + * included * \param maxDepth The maximum levels of subphases that will be considered. If this - * value is equal to -1, an infinite depth will be considered. + * value is equal to -1, an infinite depth will be considered. * \return A list of MissionPhases that cover the provided \p time */ Trace phaseTrace(double time, int maxDepth = -1) const; @@ -108,9 +114,11 @@ protected: * Recursive function that walks the subphases and adds the MissionPhase%s that cover * the provided \p time and adds these to the list of \p trace%s. Each recursive call * will decrease the \p maxDepth counter until it reaches 0. + * * \param time The time which the subphases have to cover to be added to the \p trace * \param trace The list of MissionPhase%s that are active during the time \p time * \param maxDepth The maximum depth of levels that will be considered + * * \pre maxDepth must not be negative */ void phaseTrace(double time, Trace& trace, int maxDepth) const; @@ -133,9 +141,11 @@ using Mission = MissionPhase; /** * This function constructs a Mission from the provided \p filename. The file must be a - * Lua table that describes the Mission according to MissionPhase::Documentation + * Lua table that describes the Mission according to MissionPhase::Documentation. + * * \param filename The file that is used to create the Mission * \return The constructed Mission + * * \pre \p filename must not be empty * \pre \p filename must not contain tokens * \pre \p filename must exist diff --git a/include/openspace/mission/missionmanager.h b/include/openspace/mission/missionmanager.h index cedd3dc57f..2052f1b451 100644 --- a/include/openspace/mission/missionmanager.h +++ b/include/openspace/mission/missionmanager.h @@ -29,7 +29,6 @@ #include #include - #include #include diff --git a/include/openspace/network/messagestructures.h b/include/openspace/network/messagestructures.h index 79a5eadc8f..d45ce85277 100644 --- a/include/openspace/network/messagestructures.h +++ b/include/openspace/network/messagestructures.h @@ -25,14 +25,12 @@ #ifndef __OPENSPACE_CORE___MESSAGESTRUCTURES___H__ #define __OPENSPACE_CORE___MESSAGESTRUCTURES___H__ +#include #include #include -//#include - -#include - namespace openspace::datamessagestructures { + enum class Type : uint32_t { CameraData = 0, TimeData, diff --git a/include/openspace/network/networkengine.h b/include/openspace/network/networkengine.h index 869fd8c65a..ab411b4c9d 100644 --- a/include/openspace/network/networkengine.h +++ b/include/openspace/network/networkengine.h @@ -34,7 +34,7 @@ namespace openspace { class NetworkEngine { public: - typedef uint16_t MessageIdentifier; + using MessageIdentifier = uint16_t; NetworkEngine(); @@ -57,7 +57,7 @@ public: private: std::map _identifiers; - MessageIdentifier _lastAssignedIdentifier; + MessageIdentifier _lastAssignedIdentifier = MessageIdentifier(-1); struct Message { MessageIdentifier identifer; @@ -67,7 +67,7 @@ private: std::vector _initialConnectionMessages; - bool _shouldPublishStatusMessage; + bool _shouldPublishStatusMessage = true; MessageIdentifier _statusMessageIdentifier; MessageIdentifier _identifierMappingIdentifier; diff --git a/include/openspace/network/parallelconnection.h b/include/openspace/network/parallelconnection.h index 9cd33e8bea..049b8ea1f6 100644 --- a/include/openspace/network/parallelconnection.h +++ b/include/openspace/network/parallelconnection.h @@ -26,9 +26,8 @@ #define __OPENSPACE_CORE___PARALLELCONNECTION___H__ #include - #include - +#include #include namespace openspace { @@ -54,22 +53,17 @@ public: }; struct Message { - Message() {}; - Message(MessageType t, const std::vector& c) - : type(t) - , content(c) - {}; + Message() = default; + Message(MessageType t, std::vector c); MessageType type; std::vector content; }; struct DataMessage { - DataMessage() {}; - DataMessage(datamessagestructures::Type t, const std::vector& c) - : type(t) - , content(c) - {}; + DataMessage() = default; + DataMessage(datamessagestructures::Type t, std::vector c); + datamessagestructures::Type type; std::vector content; }; @@ -81,9 +75,9 @@ public: ParallelConnection(std::unique_ptr socket); - bool isConnectedOrConnecting(); + bool isConnectedOrConnecting() const; void sendDataMessage(const ParallelConnection::DataMessage& dataMessage); - bool sendMessage(const ParallelConnection::Message& message); + bool sendMessage(const ParallelConnection::Message& message); void disconnect(); ghoul::io::TcpSocket* socket(); diff --git a/include/openspace/network/parallelpeer.h b/include/openspace/network/parallelpeer.h index 6b44b1fc68..b0029457f4 100644 --- a/include/openspace/network/parallelpeer.h +++ b/include/openspace/network/parallelpeer.h @@ -25,33 +25,28 @@ #ifndef __OPENSPACE_CORE___PARALLELPEER___H__ #define __OPENSPACE_CORE___PARALLELPEER___H__ -#include -#include #include + +#include #include -#include #include - -#include - #include -#include - -#include -#include -#include #include -#include +#include #include -#include -#include +#include +#include +#include namespace openspace { +namespace scripting { struct LuaLibrary; } + class ParallelPeer : public properties::PropertyOwner { public: ParallelPeer(); ~ParallelPeer(); + void connect(); void setPort(std::string port); void setAddress(std::string address); @@ -76,7 +71,7 @@ public: static scripting::LuaLibrary luaLibrary(); ParallelConnection::Status status(); int nConnections(); - std::shared_ptr> connectionEvent(); + ghoul::Event<>& connectionEvent(); private: void queueInMessage(const ParallelConnection::Message& message); @@ -85,9 +80,9 @@ private: void handleCommunication(); void handleMessage(const ParallelConnection::Message&); - void dataMessageReceived(const std::vector& messageContent); - void connectionStatusMessageReceived(const std::vector& messageContent); - void nConnectionsMessageReceived(const std::vector& messageContent); + void dataMessageReceived(const std::vector& message); + void connectionStatusMessageReceived(const std::vector& message); + void nConnectionsMessageReceived(const std::vector& message); void sendCameraKeyframe(); void sendTimeKeyframe(); @@ -100,6 +95,7 @@ private: properties::StringProperty _password; properties::StringProperty _hostPassword; + // Change to properties::IntProperty ? ---abock properties::StringProperty _port; properties::StringProperty _address; properties::StringProperty _name; @@ -108,13 +104,15 @@ private: properties::FloatProperty _cameraKeyframeInterval; properties::FloatProperty _timeTolerance; - double _lastTimeKeyframeTimestamp; - double _lastCameraKeyframeTimestamp; + double _lastTimeKeyframeTimestamp = 0.0; + double _lastCameraKeyframeTimestamp = 0.0; - std::atomic _shouldDisconnect; + std::atomic_bool _shouldDisconnect = false; + + std::atomic _nConnections = 0; + std::atomic _status = + ParallelConnection::Status::Disconnected; - std::atomic _nConnections; - std::atomic _status; std::string _hostName; std::deque _receiveBuffer; @@ -125,7 +123,7 @@ private: std::deque _latencyDiffs; double _initialTimeDiff; - std::unique_ptr _receiveThread; + std::unique_ptr _receiveThread = nullptr; std::shared_ptr> _connectionEvent; ParallelConnection _connection; diff --git a/include/openspace/network/parallelserver.h b/include/openspace/network/parallelserver.h index 79133e9fed..73aa8447b0 100644 --- a/include/openspace/network/parallelserver.h +++ b/include/openspace/network/parallelserver.h @@ -28,23 +28,19 @@ #include #include - #include -#include - +#include #include #include -#include namespace openspace { class ParallelServer { public: - void start(int port, - const std::string& password, + void start(int port, const std::string& password, const std::string& changeHostPassword); - void setDefaultHostAddress(std::string); + void setDefaultHostAddress(std::string defaultHostAddress); std::string defaultHostAddress() const; @@ -54,6 +50,9 @@ public: private: struct Peer { + //Peer(size_t id_, std::string name_, ParallelConnection parallelConnection_, + //ParallelConnection::Status status_, std::thread ) + size_t id; std::string name; ParallelConnection parallelConnection; @@ -80,20 +79,20 @@ private: void disconnect(std::shared_ptr peer); void setName(std::shared_ptr peer, std::string name); - void assignHost(std::shared_ptr peer); + void assignHost(std::shared_ptr newHost); void setToClient(std::shared_ptr peer); void setNConnections(size_t nConnections); void sendConnectionStatus(std::shared_ptr peer); - void handleAuthentication(std::shared_ptr peer, std::vector data); + void handleAuthentication(std::shared_ptr peer, std::vector message); void handleData(std::shared_ptr peer, std::vector data); - void handleHostshipRequest(std::shared_ptr peer, std::vector data); + void handleHostshipRequest(std::shared_ptr peer, std::vector message); void handleHostshipResignation(std::shared_ptr peer, std::vector data); void handleDisconnection(std::shared_ptr peer); void handleNewPeers(); void eventLoop(); - std::shared_ptr peer(size_t i); + std::shared_ptr peer(size_t id); void handlePeer(size_t id); void handlePeerMessage(PeerMessage peerMessage); diff --git a/include/openspace/performance/performancelayout.h b/include/openspace/performance/performancelayout.h index 07a9ee25ec..104f3ddedf 100644 --- a/include/openspace/performance/performancelayout.h +++ b/include/openspace/performance/performancelayout.h @@ -30,10 +30,10 @@ namespace openspace::performance { struct PerformanceLayout { - static const int8_t Version = 0; - static const int LengthName = 256; - static const int NumberValues = 256; - static const int MaxValues = 256; + constexpr static const int8_t Version = 0; + constexpr static const int LengthName = 256; + constexpr static const int NumberValues = 256; + constexpr static const int MaxValues = 1024; PerformanceLayout(); @@ -46,14 +46,14 @@ struct PerformanceLayout { float updateScaling[NumberValues]; }; SceneGraphPerformanceLayout sceneGraphEntries[MaxValues]; - int16_t nScaleGraphEntries; + int16_t nScaleGraphEntries = 0; struct FunctionPerformanceLayout { char name[LengthName]; float time[NumberValues]; }; FunctionPerformanceLayout functionEntries[MaxValues]; - int16_t nFunctionEntries; + int16_t nFunctionEntries = 0; }; } // namespace openspace::performance diff --git a/include/openspace/performance/performancemanager.h b/include/openspace/performance/performancemanager.h index 688b2d8e72..7c8558fef3 100644 --- a/include/openspace/performance/performancemanager.h +++ b/include/openspace/performance/performancemanager.h @@ -25,24 +25,22 @@ #ifndef __OPENSPACE_CORE___PERFORMANCEMANAGER___H__ #define __OPENSPACE_CORE___PERFORMANCEMANAGER___H__ -#include - -#include - #include #include +#include #include namespace ghoul { class SharedMemory; } - namespace openspace { class SceneGraphNode; } namespace openspace::performance { +struct PerformanceLayout; + class PerformanceManager { public: - static void createGlobalSharedMemory(); - static void destroyGlobalSharedMemory(); + static void CreateGlobalSharedMemory(); + static void DestroyGlobalSharedMemory(); PerformanceManager(std::string loggingDirectory = "${BASE}", std::string prefix = "PM-"); @@ -51,10 +49,8 @@ public: void resetPerformanceMeasurements(); - bool isMeasuringPerformance() const; - - void storeIndividualPerformanceMeasurement(std::string identifier, - long long nanoseconds); + void storeIndividualPerformanceMeasurement(const std::string& identifier, + long long microseconds); void storeScenePerformanceMeasurements( const std::vector& sceneNodes); @@ -65,9 +61,9 @@ public: std::string formatLogName(std::string nodeName); void logDir(std::string dir); - std::string logDir() const; + const std::string& logDir() const; void prefix(std::string prefix); - std::string prefix() const; + const std::string& prefix() const; void enableLogging(); void disableLogging(); @@ -78,19 +74,17 @@ public: PerformanceLayout* performanceData(); private: - bool _doPerformanceMeasurements; - bool _loggingEnabled; + bool _loggingEnabled = false; std::string _logDir; std::string _prefix; - std::string _suffix; - std::string _ext; + std::string _ext = "log"; std::map individualPerformanceLocations; std::unique_ptr _performanceMemory; - size_t _tick; + size_t _currentTick = 0; void tick(); bool createLogDir(); diff --git a/include/openspace/performance/performancemeasurement.h b/include/openspace/performance/performancemeasurement.h index 024541dae6..7ea34fe4cd 100644 --- a/include/openspace/performance/performancemeasurement.h +++ b/include/openspace/performance/performancemeasurement.h @@ -27,7 +27,6 @@ #include #include - #include #include diff --git a/include/openspace/properties/matrixproperty.h b/include/openspace/properties/matrixproperty.h deleted file mode 100644 index c64b0d38f4..0000000000 --- a/include/openspace/properties/matrixproperty.h +++ /dev/null @@ -1,50 +0,0 @@ -/***************************************************************************************** - * * - * OpenSpace * - * * - * Copyright (c) 2014-2018 * - * * - * Permission is hereby 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___MATRIXPROPERTY___H__ -#define __OPENSPACE_CORE___MATRIXPROPERTY___H__ - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#endif // __OPENSPACE_CORE___MATRIXPROPERTY___H__ diff --git a/include/openspace/properties/numericalproperty.inl b/include/openspace/properties/numericalproperty.inl index d4bfc6d9be..e8ece066d8 100644 --- a/include/openspace/properties/numericalproperty.inl +++ b/include/openspace/properties/numericalproperty.inl @@ -62,11 +62,11 @@ namespace openspace::properties { template <> \ template <> \ bool PropertyDelegate>::toLuaValue(lua_State* state, \ - TYPE value); \ + const TYPE& value); \ template <> \ template <> \ bool PropertyDelegate>::toLuaValue(lua_State* state, \ - TYPE value); \ + const TYPE& value); \ template <> \ int PropertyDelegate>::typeLua(); \ template <> \ @@ -74,23 +74,23 @@ namespace openspace::properties { \ template <> \ template <> \ - TYPE PropertyDelegate>::fromString(std::string value, \ + TYPE PropertyDelegate>::fromString(const std::string& value, \ bool& success); \ \ template <> \ template <> \ - TYPE PropertyDelegate>::fromString(std::string value, \ + TYPE PropertyDelegate>::fromString(const std::string& value, \ bool& success); \ \ template <> \ template <> \ bool PropertyDelegate>::toString(std::string& outValue, \ - TYPE inValue); \ + const TYPE& inValue); \ \ template <> \ template <> \ bool PropertyDelegate>::toString(std::string& outValue, \ - TYPE inValue); + const TYPE& inValue); #define REGISTER_NUMERICALPROPERTY_SOURCE(CLASS_NAME, TYPE, DEFAULT_VALUE, \ @@ -141,35 +141,35 @@ namespace openspace::properties { \ template <> \ template <> \ - TYPE PropertyDelegate>::fromLuaValue(lua_State* lua, \ - bool& successful) \ + TYPE PropertyDelegate>::fromLuaValue(lua_State* state, \ + bool& success) \ { \ - return FROM_LUA_LAMBDA_EXPRESSION(lua, successful); \ + return FROM_LUA_LAMBDA_EXPRESSION(state, success); \ } \ \ template <> \ template <> \ - TYPE PropertyDelegate>::fromLuaValue(lua_State* lua, \ - bool& successful) \ + TYPE PropertyDelegate>::fromLuaValue(lua_State* state, \ + bool& success) \ { \ return PropertyDelegate>::fromLuaValue( \ - lua, successful); \ + state, success); \ } \ \ template <> \ template <> \ - bool PropertyDelegate>::toLuaValue(lua_State* lua, \ - TYPE val) \ + bool PropertyDelegate>::toLuaValue(lua_State* state, \ + const TYPE& value) \ { \ - return TO_LUA_LAMBDA_EXPRESSION(lua, val); \ + return TO_LUA_LAMBDA_EXPRESSION(state, value); \ } \ \ template <> \ template <> \ bool PropertyDelegate>::toLuaValue(lua_State* state, \ - TYPE val) \ + const TYPE& value) \ { \ - return PropertyDelegate>::toLuaValue(state, val); \ + return PropertyDelegate>::toLuaValue(state, value); \ } \ \ template <> \ @@ -186,15 +186,15 @@ namespace openspace::properties { \ template <> \ template <> \ - TYPE PropertyDelegate>::fromString(std::string value, \ - bool& successful) \ + TYPE PropertyDelegate>::fromString(const std::string& value, \ + bool& success) \ { \ - return FROM_STRING_LAMBDA_EXPRESSION(value, successful); \ + return FROM_STRING_LAMBDA_EXPRESSION(value, success); \ } \ \ template <> \ template <> \ - TYPE PropertyDelegate>::fromString(std::string value, \ + TYPE PropertyDelegate>::fromString(const std::string& value, \ bool& success) \ { \ return PropertyDelegate>::fromString( \ @@ -205,18 +205,18 @@ namespace openspace::properties { \ template <> \ template <> \ - bool PropertyDelegate>::toString(std::string& out, \ - TYPE in) \ + bool PropertyDelegate>::toString(std::string& outValue, \ + const TYPE& inValue) \ { \ - return TO_STRING_LAMBDA_EXPRESSION(out, in); \ + return TO_STRING_LAMBDA_EXPRESSION(outValue, inValue); \ } \ \ template <> \ template <> \ - bool PropertyDelegate>::toString(std::string& out, \ - TYPE in) \ + bool PropertyDelegate>::toString(std::string& outValue, \ + const TYPE& inValue) \ { \ - return PropertyDelegate>::toString(out, in); \ + return PropertyDelegate>::toString(outValue, inValue); \ } @@ -420,22 +420,10 @@ std::string NumericalProperty::jsonValue() const { template void NumericalProperty::setInterpolationTarget(ghoul::any value) { - try { - T v = ghoul::any_cast(std::move(value)); + T v = ghoul::any_cast(std::move(value)); - _interpolationStart = TemplateProperty::_value; - _interpolationEnd = std::move(v); - } - catch (ghoul::bad_any_cast&) { - LERRORC( - "TemplateProperty", - fmt::format( - "Illegal cast from '{}' to '{}'", - value.type().name(), - typeid(T).name() - ) - ); - } + _interpolationStart = TemplateProperty::_value; + _interpolationEnd = std::move(v); } template diff --git a/include/openspace/properties/optionproperty.h b/include/openspace/properties/optionproperty.h index ac4d099869..864b4b6277 100644 --- a/include/openspace/properties/optionproperty.h +++ b/include/openspace/properties/optionproperty.h @@ -41,8 +41,8 @@ namespace openspace::properties { class OptionProperty : public IntProperty { public: /** - * The struct storing a single option consisting of an integer value and - * a string description. + * The struct storing a single option consisting of an integer \c value and a + * \c string description. */ struct Option { int value; @@ -55,10 +55,10 @@ public: }; /** - * The constructor delegating the identifier and the guiName - * to its super class. + * The constructor delegating the \c identifier and the \c guiName to its super class. + * * \param info The PropertyInfo structure that contains all the required static - * information for initializing this Property. + * information for initializing this Property. * \pre \p info.identifier must not be empty * \pre \p info.guiName must not be empty */ @@ -67,9 +67,11 @@ public: /** * The constructor delegating the identifier and the guiName * to its super class. + * * \param info The PropertyInfo structure that contains all the required static - * information for initializing this Property. + * information for initializing this Property. * \param displayType Optional DisplayType for GUI (default RADIO) + * * \pre \p info.identifier must not be empty * \pre \p info.guiName must not be empty */ @@ -77,21 +79,23 @@ public: /** * Returns the name of the class for reflection purposes. + * * \return The name of this class for reflection purposes */ std::string className() const override; using IntProperty::operator=; /** - * Returns the type for GUI display. - * \return OptionType for display purposes - */ + * Returns the type for GUI display. + * + * \return OptionType for display purposes + */ DisplayType displayType() const; /** - * Adds the passed option to the list of available options. The value of - * the option must not have been registered previously, or a warning will - * be logged. + * Adds the passed option to the list of available options. The \c value of the + * \c option must not have been registered previously, or a warning will be logged. + * * \param value The option that will be added to the list of available options * \param desc The description of the value that will be added */ @@ -100,12 +104,14 @@ public: /** * Adds multiple options to the OptionProperty. Each value in the vector consists of * an integer value and a string description. + * * \param options Pairs of that are added to the OptionProperty */ void addOptions(std::vector> options); /** * Returns the list of available options. + * * \return The list of available options */ const std::vector