From cd4ebd75328ab487f6740cc38fc82c81fb7ed69a Mon Sep 17 00:00:00 2001 From: ElonOlsson Date: Wed, 8 Sep 2021 10:40:56 -0400 Subject: [PATCH] more pr comment edits --- .../heliosphere/bastille_day/fieldlines.asset | 4 ---- .../bastille_day/fluxnodeslegend.asset | 17 ++++++++++------- .../bastille_day/magnetogram_textures.asset | 14 ++++++-------- .../renderableplanetimevaryingimage.cpp | 6 ++---- .../rendering/renderableplanetimevaryingimage.h | 3 ++- 5 files changed, 20 insertions(+), 24 deletions(-) diff --git a/data/assets/scene/solarsystem/heliosphere/bastille_day/fieldlines.asset b/data/assets/scene/solarsystem/heliosphere/bastille_day/fieldlines.asset index 352d29f24f..2aa12ff845 100644 --- a/data/assets/scene/solarsystem/heliosphere/bastille_day/fieldlines.asset +++ b/data/assets/scene/solarsystem/heliosphere/bastille_day/fieldlines.asset @@ -1,10 +1,6 @@ local assetHelper = asset.require('util/asset_helper') local heliosphereTransforms = asset.require('scene/solarsystem/sun/transforms_heliosphere') ---local transferFunctions = asset.localResource("transferfunctions") ---local masVelocityColorTable = transferFunctions .. "/velocity-fieldlines.txt" ---local masDensityColorTable = transferFunctions .. "/density-fieldlines.txt" - local fieldlinesDirectory = asset.syncedResource({ Name = "Bastille Day MAS Fieldlines", Type = "HttpSynchronization", diff --git a/data/assets/scene/solarsystem/heliosphere/bastille_day/fluxnodeslegend.asset b/data/assets/scene/solarsystem/heliosphere/bastille_day/fluxnodeslegend.asset index 5e26364178..c018acb173 100644 --- a/data/assets/scene/solarsystem/heliosphere/bastille_day/fluxnodeslegend.asset +++ b/data/assets/scene/solarsystem/heliosphere/bastille_day/fluxnodeslegend.asset @@ -12,16 +12,19 @@ local legend = { Identifier = "Legendfluxnodes", Type = "ScreenSpaceImageLocal", TexturePath = TexturesPath .. "/CMR_transparent_white_text.png", + Scale = 0.15, + CartesianPosition = { 0.677970, 0.0, -1.049180 } } -openspace.addScreenSpaceRenderable(legend) --- These numbers are there to put the legend on the side of the screen. -openspace.setPropertyValueSingle('ScreenSpace.Legendfluxnodes.CartesianPosition', { 0.677970, 0.0, -1.049180 }); -openspace.setPropertyValueSingle('ScreenSpace.Legendfluxnodes.Rotation', { 0.000000, 0.000000, 0.56652 }); -openspace.setPropertyValueSingle('ScreenSpace.Legendfluxnodes.Scale', 0.15); -openspace.setPropertyValueSingle('ScreenSpace.Legendfluxnodes.Enabled', false); +asset.onInitialize(function() + openspace.addScreenSpaceRenderable(legend) + -- These numbers are there to put the legend on the side of the screen. + openspace.setPropertyValueSingle('ScreenSpace.Legendfluxnodes.Rotation', { 0.000000, 0.000000, 0.56652 }); +end) -assetHelper.registerSceneGraphNodesAndExport(asset, { legend }) +asset.onDeinitialize(function () + openspace.removeScreenSpaceRenderable(legend.Identifier) +end) asset.meta = { Name = "Predictive Science Inc. Stream nodes Bastille Days", diff --git a/data/assets/scene/solarsystem/heliosphere/bastille_day/magnetogram_textures.asset b/data/assets/scene/solarsystem/heliosphere/bastille_day/magnetogram_textures.asset index 9f0c87b341..c8ba7727f9 100644 --- a/data/assets/scene/solarsystem/heliosphere/bastille_day/magnetogram_textures.asset +++ b/data/assets/scene/solarsystem/heliosphere/bastille_day/magnetogram_textures.asset @@ -18,7 +18,6 @@ asset.onInitialize(function () -- add all all elements in magnetograms as layers for i, imagename in ipairs(magnetograms) do - openspace.globebrowsing.addLayer( 'Sun', 'ColorLayers', @@ -31,13 +30,12 @@ asset.onInitialize(function () } ) end - end) asset.onDeinitialize(function () - --for i, imagename in ipairs(magnetograms) do - -- openspace.globebrowsing.removeLayer( - -- ? - -- ) - --end -end) \ No newline at end of file + for i, imagename in ipairs(magnetograms) do + openspace.globebrowsing.deleteLayer( + 'Sun', 'ColorLayers', 'magnetogram-' .. i + ) + end +end) diff --git a/modules/base/rendering/renderableplanetimevaryingimage.cpp b/modules/base/rendering/renderableplanetimevaryingimage.cpp index e8b3271d31..c50fff5feb 100644 --- a/modules/base/rendering/renderableplanetimevaryingimage.cpp +++ b/modules/base/rendering/renderableplanetimevaryingimage.cpp @@ -297,6 +297,7 @@ void RenderablePlaneTimeVaryingImage::updateActiveTriggerTimeIndex(double curren _activeTriggerTimeIndex = static_cast(_sourceFiles.size() - 1); } } + void RenderablePlaneTimeVaryingImage::computeSequenceEndTime() { if (_sourceFiles.size() > 1) { const double lastTriggerTime = _startTimes[_sourceFiles.size() - 1]; @@ -305,11 +306,8 @@ void RenderablePlaneTimeVaryingImage::computeSequenceEndTime() { (static_cast(_sourceFiles.size() - 1.0)); _sequenceEndTime = lastTriggerTime + averageStateDuration; } - else { - // If there's just one state it should never disappear! - _sequenceEndTime = std::numeric_limits::max(); - } } + void RenderablePlaneTimeVaryingImage::loadTexture() { if (_activeTriggerTimeIndex != -1) { _texture = _textureFiles[_activeTriggerTimeIndex].get(); diff --git a/modules/base/rendering/renderableplanetimevaryingimage.h b/modules/base/rendering/renderableplanetimevaryingimage.h index 17c2ef6af5..e6ef9f8a3e 100644 --- a/modules/base/rendering/renderableplanetimevaryingimage.h +++ b/modules/base/rendering/renderableplanetimevaryingimage.h @@ -60,7 +60,8 @@ private: void updateActiveTriggerTimeIndex(double currenttime); void computeSequenceEndTime(); - double _sequenceEndTime; + // If there's just one state it should never disappear + double _sequenceEndTime = std::numeric_limits::max(); std::vector _sourceFiles; std::vector _startTimes; int _activeTriggerTimeIndex = 0;