more pr comment edits

This commit is contained in:
ElonOlsson
2021-09-08 10:40:56 -04:00
parent 70424290b7
commit cd4ebd7532
5 changed files with 20 additions and 24 deletions

View File

@@ -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",

View File

@@ -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",

View File

@@ -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)
for i, imagename in ipairs(magnetograms) do
openspace.globebrowsing.deleteLayer(
'Sun', 'ColorLayers', 'magnetogram-' .. i
)
end
end)

View File

@@ -297,6 +297,7 @@ void RenderablePlaneTimeVaryingImage::updateActiveTriggerTimeIndex(double curren
_activeTriggerTimeIndex = static_cast<int>(_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<double>(_sourceFiles.size() - 1.0));
_sequenceEndTime = lastTriggerTime + averageStateDuration;
}
else {
// If there's just one state it should never disappear!
_sequenceEndTime = std::numeric_limits<double>::max();
}
}
void RenderablePlaneTimeVaryingImage::loadTexture() {
if (_activeTriggerTimeIndex != -1) {
_texture = _textureFiles[_activeTriggerTimeIndex].get();

View File

@@ -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<double>::max();
std::vector<std::string> _sourceFiles;
std::vector<double> _startTimes;
int _activeTriggerTimeIndex = 0;