This commit is contained in:
Jonathas Costa
2017-10-29 11:51:26 -04:00
131 changed files with 1726 additions and 895 deletions
+1
View File
@@ -107,6 +107,7 @@ add_subdirectory(${OPENSPACE_EXT_DIR}/ghoul)
target_link_libraries(libOpenSpace Ghoul)
set_property(TARGET Lua PROPERTY FOLDER "External")
set_property(TARGET lz4 PROPERTY FOLDER "External")
link_directories("${GHOUL_LIBRARY_DIRS}")
# SGCT
set(SGCT_TEXT OFF CACHE BOOL "" FORCE)
+6 -1
View File
@@ -454,7 +454,12 @@ void SyncWidget::syncButtonPressed() {
if (QFileInfo(dataFile).exists()) {
ghoul::Dictionary dataDictionary;
ghoul::lua::loadDictionaryFromFile(dataFile.toStdString(), dataDictionary);
try {
ghoul::lua::loadDictionaryFromFile(dataFile.toStdString(), dataDictionary);
}
catch (const ghoul::lua::LuaLoadingException& exception) {
LWARNINGC(exception.component, exception.message);
}
ghoul::Dictionary directDownloadFiles;
ghoul::Dictionary fileRequests;
-1
View File
@@ -313,7 +313,6 @@ void mainInitFunc() {
void mainPreSyncFunc() {
LTRACE("main::mainPreSyncFunc(begin)");
OsEng.setRunTime(sgct::Engine::getTime());
OsEng.preSynchronization();
LTRACE("main::mainPreSyncFunc(end)");
}
-49
View File
@@ -86,59 +86,10 @@ function postInitialization()
openspace.printInfo("Setting default values")
openspace.setPropertyValueSingle("SunGlare.renderable.Enabled", false)
openspace.setPropertyValueSingle("SunMarker.renderable.Enabled", false)
openspace.setPropertyValueSingle("Constellation Bounds.renderable.Enabled", false)
openspace.setPropertyValueSingle("Global Properties.GlobeBrowsing.GdalWrapper.LogGdalErrors", false)
-- Digital Universe
openspace.setPropertyValueSingle("Wilkinson Microwave Anisotropy Probe (WMAP).renderable.Enabled", false)
openspace.setPropertyValueSingle("Quasars.renderable.Enabled", false)
openspace.setPropertyValueSingle("Pulsars.renderable.Enabled", false)
openspace.setPropertyValueSingle("Globular Clusters.renderable.Enabled", false)
openspace.setPropertyValueSingle("Kepler Planetary Candidates.renderable.Enabled", false)
openspace.setPropertyValueSingle("Local Dwarf Galaxies.renderable.Enabled", false)
openspace.setPropertyValueSingle("Exoplanets.renderable.Enabled", false)
openspace.setPropertyValueSingle("Sloan Digital Sky Survey.renderable.Enabled", false)
openspace.setPropertyValueSingle("Planetary Nebulae.renderable.Enabled", false)
openspace.setPropertyValueSingle("OB Associations.renderable.Enabled", false)
openspace.setPropertyValueSingle("Open Star Clusters.renderable.Enabled", false)
openspace.setPropertyValueSingle("Supernova Remnants.renderable.Enabled", false)
openspace.setPropertyValueSingle("HII Regions.renderable.Enabled", false)
openspace.setPropertyValueSingle("Abell Galaxy Clusters.renderable.Enabled", false)
openspace.setPropertyValueSingle("2MASS Galaxies.renderable.Enabled", false)
openspace.setPropertyValueSingle("6dF Galaxies.renderable.Enabled", false)
openspace.setPropertyValueSingle("2dF Galaxies.renderable.Enabled", false)
openspace.setPropertyValueSingle("Cosmic Background Explorer.renderable.Enabled", false)
openspace.setPropertyValueSingle("Planck.renderable.Enabled", false)
openspace.setPropertyValueSingle("Dwarfs.renderable.Enabled", false)
openspace.setPropertyValueSingle("Nearby Galaxy Groups.renderable.Enabled", false)
openspace.setPropertyValueSingle("Galaxy Cluster Labels.renderable.Enabled", false)
openspace.setPropertyValueSingle("Voids.renderable.Enabled", false)
openspace.setPropertyValueSingle("Galaxy Superclusters.renderable.Enabled", false)
openspace.setPropertyValueSingle("Stars Labels.renderable.Enabled", false)
openspace.setPropertyValueSingle("Stars Labels - Alternate.renderable.Enabled", false)
openspace.setPropertyValueSingle("Tully Galaxies.renderable.Enabled", false)
openspace.setPropertyValueSingle("Tully Galaxies Pics.renderable.Enabled", false)
openspace.setPropertyValueSingle("Constellations (Extragalactic).renderable.Enabled", false)
openspace.setPropertyValueSingle("Constellations.renderable.Enabled", false)
openspace.setPropertyValueSingle("Earth.RenderableGlobe.Atmosphere", true)
openspace.setPropertyValueSingle("Earth.RenderableGlobe.Debug.LevelByProjectedAreaElseDistance", false)
openspace.setPropertyValueSingle("Ecliptic Grid.renderable.Enabled", false)
openspace.setPropertyValueSingle("Ecliptic Grid Labels.renderable.Enabled", false)
openspace.setPropertyValueSingle("Equatorial Grid.renderable.Enabled", false)
openspace.setPropertyValueSingle("Equatorial Grid Labels.renderable.Enabled", false)
openspace.setPropertyValueSingle("Galactic Grid.renderable.Enabled", false)
openspace.setPropertyValueSingle("Galactic Grid Labels.renderable.Enabled", false)
openspace.setPropertyValueSingle("100kly Grid.renderable.Enabled", false)
openspace.setPropertyValueSingle("1Mly Grid.renderable.Enabled", false)
openspace.setPropertyValueSingle("10Mly Grid.renderable.Enabled", false)
openspace.setPropertyValueSingle("100Mly Grid.renderable.Enabled", false)
openspace.setPropertyValueSingle("20Gly Grid.renderable.Enabled", false)
openspace.globebrowsing.goToGeo(58.5877, 16.1924, 20000000)
openspace.printInfo("Done setting default values")
+2 -2
View File
@@ -1,6 +1,6 @@
return {
FileRequest = {
{ Identifier = "digitaluniverse_2df_speck", Destination = "speck", Version = 1 },
{ Identifier = "digitaluniverse_2df_textures", Destination = "textures", Version = 1 }
{ Identifier = "digitaluniverse_2dF_speck", Destination = "speck", Version = 1 },
{ Identifier = "digitaluniverse_2dF_textures", Destination = "textures", Version = 1 }
}
}
+1
View File
@@ -5,6 +5,7 @@ return {
Parent = "Root",
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Color = { 1.0, 1.0, 1.0 },
Transparency = 1.0,
File = "speck/2dF.speck",
@@ -5,6 +5,7 @@ return {
Parent = "Root",
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Color = { 1.0, 0.4, 0.2 },
Transparency = 1.0,
File = "speck/2MASS.speck",
+2 -2
View File
@@ -1,6 +1,6 @@
return {
FileRequest = {
{ Identifier = "digitaluniverse_6df_speck", Destination = "speck", Version = 1 },
{ Identifier = "digitaluniverse_6df_textures", Destination = "textures", Version = 1 }
{ Identifier = "digitaluniverse_6dF_speck", Destination = "speck", Version = 1 },
{ Identifier = "digitaluniverse_6dF_textures", Destination = "textures", Version = 1 }
}
}
+1
View File
@@ -5,6 +5,7 @@ return {
Parent = "Root",
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Color = { 1.0, 1.0, 1.0 },
Transparency = 1.0,
File = "speck/6dF.speck",
@@ -5,6 +5,7 @@ return {
Parent = "Root",
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Color = { 1.0, 0.4, 0.2 },
Transparency = 1.0,
ScaleFactor = 525.0,
@@ -4,12 +4,10 @@ return {
Name = "Stars Labels - Alternate",
Parent = "Root",
Renderable = {
--Type = "RenderablePoints",
Type = "RenderableBillboardsCloud",
Enabled = false,
Color = {1.0, 1.0, 1.0},
Transparency = 0.65,
--ScaleFactor = 10.0,
--File = "speck/stars.speck",
LabelFile = "speck/stars-altlbl.label",
TextColor = { 0.4, 0.4, 0.4, 1.0 },
DrawLabels = true,
@@ -5,6 +5,7 @@ return {
Parent = "Root",
Renderable = {
Type = "RenderableSphere",
Enabled = false,
Size = 3975.41417036064E23,
Segments = 80,
Alpha = 0.5,
@@ -18,6 +19,7 @@ return {
Parent = "Root",
Renderable = {
Type = "RenderableSphere",
Enabled = false,
Size = 3975.41417036064E23,
Segments = 80,
Alpha = 0.5,
@@ -31,6 +33,7 @@ return {
Parent = "Root",
Renderable = {
Type = "RenderableSphere",
Enabled = false,
Size = 3975.41417036064E23,
Segments = 80,
Alpha = 0.5,
@@ -5,6 +5,7 @@ return {
Parent = "Root",
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Color = {1.0, 1.0, 1.0},
Transparency = 0.65,
LabelFile = "speck/galclust.label",
@@ -10,6 +10,7 @@ return {
Parent = "Root",
Renderable = {
Type = "RenderableConstellationBounds",
Enabled = false,
File = "data/bound_20.dat",
ConstellationFile = "data/constellations.dat"
-- ConstellationSelection = zodiacs
@@ -5,6 +5,7 @@ return {
Parent = "Root",
Renderable = {
Type = "RenderableDUMeshes",
Enabled = false,
Color = { 1.0, 0.4, 0.2 },
Transparency = 1.0,
ScaleFactor = 1.0,
@@ -23,6 +24,7 @@ return {
Parent = "Root",
Renderable = {
Type = "RenderableDUMeshes",
Enabled = false,
Color = { 1.0, 0.4, 0.2 },
Transparency = 1.0,
ScaleFactor = 1.0,
@@ -5,6 +5,7 @@ return {
Parent = "Root",
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Color = { 0.5, 1.0, 0.2 },
Transparency = 0.999,
File = "speck/dwarfs.speck",
@@ -5,6 +5,7 @@ return {
Parent = "Root",
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Color = { 1.0, 1.0, 1.0 },
Transparency = 0.65,
ScaleFactor = 10.0,
@@ -5,6 +5,7 @@ return {
Parent = "Root",
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Color = { 0.8, 0.8, 0.0 },
Transparency = 0.35,
File = "speck/gc.speck",
@@ -4,6 +4,7 @@ return {
Parent = "Root",
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Color = {1.0, 1.0, 1.0},
Transparency = 0.65,
--ScaleFactor = 10.0,
@@ -30,6 +31,7 @@ return {
Parent = "Root",
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Color = {1.0, 1.0, 1.0},
Transparency = 0.65,
--ScaleFactor = 10.0,
@@ -47,6 +49,7 @@ return {
Parent = "Root",
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Color = {1.0, 1.0, 1.0},
Transparency = 0.65,
--ScaleFactor = 10.0,
@@ -64,6 +67,7 @@ return {
Parent = "Root",
Renderable = {
Type = "RenderableDUMeshes",
Enabled = false,
Color = {1.0, 1.0, 1.0},
Transparency = 0.4,
ScaleFactor = 1.0,
@@ -82,6 +86,7 @@ return {
Parent = "Root",
Renderable = {
Type = "RenderableDUMeshes",
Enabled = false,
Color = {1.0, 1.0, 1.0},
Transparency = 0.4,
ScaleFactor = 1.0,
@@ -100,6 +105,7 @@ return {
Parent = "Root",
Renderable = {
Type = "RenderableDUMeshes",
Enabled = false,
Color = {1.0, 1.0, 1.0},
Transparency = 0.4,
ScaleFactor = 1.0,
@@ -118,6 +124,7 @@ return {
Parent = "Root",
Renderable = {
Type = "RenderableDUMeshes",
Enabled = false,
Color = {1.0, 1.0, 1.0},
Transparency = 0.4,
ScaleFactor = 1.0,
@@ -136,6 +143,7 @@ return {
Parent = "Root",
Renderable = {
Type = "RenderableDUMeshes",
Enabled = false,
Color = {1.0, 1.0, 1.0},
Transparency = 0.4,
ScaleFactor = 1.0,
@@ -5,6 +5,7 @@ return {
Parent = "Root",
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Color = { 1.0, 1.0, 1.0 },
Transparency = 0.65,
--ScaleFactor = 10.0,
@@ -5,6 +5,7 @@ return {
Parent = "Root",
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Color = { 0.0, 0.5, 1.0 },
Transparency = 0.35,
File = "speck/h2.speck",
@@ -5,6 +5,7 @@ return {
Parent = "Root",
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Color = { 1.0, 1.0, 0.0 },
Transparency = 0.99,
ScaleFactor = 395.0,
@@ -5,6 +5,7 @@ return {
Parent = "Root",
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Color = { 0.5, 1.0, 0.2 },
Transparency = 0.3,
File = "speck/localdwarfs.speck",
@@ -5,6 +5,7 @@ return {
Parent = "Root",
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Color = { 0.0, 0.0, 1.0 },
Transparency = 0.5,
File = "speck/ob.speck",
@@ -5,6 +5,7 @@ return {
Parent = "Root",
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Color = { 0.1, 0.8, 0.4 },
Transparency = 0.5,
File = "speck/oc.speck",
@@ -5,6 +5,7 @@ return {
Parent = "Root",
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Color = {0.4, 0.4, 0.9},
Transparency = 0.35,
File = "speck/pn.speck",
@@ -5,6 +5,7 @@ return {
Parent = "Root",
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Color = { 0.7, 0.0, 0.0 },
Transparency = 0.5,
File = "speck/pulsar.speck",
@@ -5,6 +5,7 @@ return {
Parent = "Root",
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Color = { 1.0, 0.4, 0.2 },
Transparency = 1.0,
File = "speck/quasars.speck",
@@ -5,6 +5,7 @@ return {
Parent = "Root",
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Color = { 0.8, 0.8, 1.0 },
Transparency = 1.0,
ScaleFactor = 507.88,
@@ -5,6 +5,7 @@ return {
Parent = "Root",
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Color = { 1.0, 1.0, 1.0 },
Transparency = 0.65,
LabelFile = "speck/stars.label",
@@ -5,6 +5,7 @@ return {
Parent = "Root",
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Color = { 1.0, 1.0, 1.0 },
Transparency = 0.65,
File = "speck/superclust.speck",
@@ -5,6 +5,7 @@ return {
Parent = "Root",
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Color = { 1.0, 0.5, 0.0 },
Transparency = 0.5,
File = "speck/snr.speck",
+1 -1
View File
@@ -1,6 +1,6 @@
return {
FileRequest = {
{ Identifier = "digitaluniverse_tully_speck", Destination = "speck", Version = 1 }
{ Identifier = "digitaluniverse_tully_speck", Destination = "speck", Version = 1 },
{ Identifier = "digitaluniverse_tully_textures", Destination = "textures", Version = 1 }
}
}
@@ -5,6 +5,7 @@ return {
Parent = "Root",
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Color = { 1.0, 0.4, 0.2 },
Transparency = 0.99,
ScaleFactor = 502.77,
@@ -38,6 +39,7 @@ return {
Parent = "Root",
Renderable = {
Type = "RenderablePlanesCloud",
Enabled = false,
Color = { 1.0, 1.0, 1.0 },
Transparency = 0.99,
ScaleFactor = 27.39,
@@ -5,6 +5,7 @@ return {
Parent = "Root",
Renderable = {
Type = "RenderableBillboardsCloud",
Enabled = false,
Color = { 1.0, 1.0, 1.0 },
Transparency = 0.65,
--ScaleFactor = 10.0,
@@ -0,0 +1,21 @@
return {
-- Earth barycenter module
{
Name = "Lua Transformation",
Parent = "SolarSystemBarycenter",
Transform = {
Rotation = {
Type = "LuaRotation",
Script = "rotation.lua"
},
Scale = {
Type = "LuaScale",
Script = "scale.lua"
},
Translation = {
Type = "LuaTranslation",
Script = "translate.lua"
}
}
}
}
@@ -0,0 +1,6 @@
-- t1: Ingame seconds past the J2000 epoch
-- t2: Wallclock milliseconds past the J2000 epoch
function rotation(t1, t2)
return 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0
end
@@ -0,0 +1,6 @@
-- t1: Ingame seconds past the J2000 epoch
-- t2: Wallclock milliseconds past the J2000 epoch
function scale(t1, t2)
return 1.0;
end
@@ -0,0 +1,6 @@
-- t1: Ingame seconds past the J2000 epoch
-- t2: Wallclock milliseconds past the J2000 epoch
function translation(t1, t2)
return 0.0, 0.0, 0.0
end
+3
View File
@@ -5,6 +5,7 @@ return {
Parent = "Root",
Renderable = {
Type = "RenderableSphericalGrid",
Enabled = false,
GridColor = { 0.7, 0.0, 0.0, 0.5},
LineWidth = 2.0,
Radius = 9.46377307652E17;
@@ -20,6 +21,7 @@ return {
Parent = "Root",
Renderable = {
Type = "RenderableSphericalGrid",
Enabled = false,
GridColor = { 0.0, 0.0, 1.0, 0.8},
LineWidth = 2.0,
Radius = 6.2440846E17,
@@ -35,6 +37,7 @@ return {
Parent = "SolarSystem",
Renderable = {
Type = "RenderableSphericalGrid",
Enabled = false,
LineWidth = 2.0,
Radius = 9.46377307652E18;
GridColor = { 0.0, 0.6, 0.6, 0.6}
+8 -4
View File
@@ -79,20 +79,24 @@ return {
},
{
Name = "Themis IR Day [Utah]",
FilePath = "map_service_configs/Utah/Themis_IR_Day.xml"
FilePath = "map_service_configs/Utah/Themis_IR_Day.xml",
BlendMode = "Color"
},
{
Name = "Themis IR Night [Utah]",
FilePath = "map_service_configs/Utah/Themis_IR_Night.xml"
FilePath = "map_service_configs/Utah/Themis_IR_Night.xml",
BlendMode = "Color"
},
{
Name = "Themis IR Day [AWS]",
FilePath = "map_service_configs/AWS/Themis_IR_Day.wms"
FilePath = "map_service_configs/AWS/Themis_IR_Day.wms",
BlendMode = "Color"
},
{
Name = "Themis IR Night [AWS]",
FilePath = "map_service_configs/AWS/Themis_IR_Night.wms"
FilePath = "map_service_configs/AWS/Themis_IR_Night.wms",
BlendMode = "Color"
}
},
Overlays = {
@@ -32,12 +32,7 @@ return {
Fadeable = false,
Ghosting = false,
},
Textures = {
Type = "simple",
Color = "textures/gray.png",
Project = "textures/defaultProj.png",
Default = "textures/defaultProj.png"
},
ColorTexture = "textures/gray.png",
Projection = {
Sequence = "InstrumentTimes",
SequenceType = "instrument-times",
@@ -1,20 +0,0 @@
<GDAL_WMS>
<Service name="TMS">
<ServerUrl>http://asgard.sci.utah.edu/Moon/Wac/tile/${z}/${y}/${x}</ServerUrl>
</Service>
<DataWindow>
<UpperLeftX>-180.0</UpperLeftX>
<UpperLeftY>90.0</UpperLeftY>
<LowerRightX>180.0</LowerRightX>
<LowerRightY>-90.0</LowerRightY>
<SizeX>109164</SizeX>
<SizeY>54582</SizeY>
<TileLevel>8</TileLevel>
<YOrigin>top</YOrigin>
</DataWindow>
<Projection>GEOGCS["GCS_Moon_2000",DATUM["D_Moon_2000",SPHEROID["Moon_2000_IAU_IAG",1737400.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]]</Projection>
<BlockSizeX>256</BlockSizeX>
<BlockSizeY>256</BlockSizeY>
<BandsCount>1</BandsCount>
<MaxConnections>10</MaxConnections>
</GDAL_WMS>
@@ -1,6 +1,6 @@
<GDAL_WMS>
<Service name="TMS">
<ServerUrl>http://moontrek.jpl.nasa.gov/trektiles/Moon/EQ/LRO_WAC_Mosaic_Global_303ppd_v02/1.0.0/default/default028mm/${z}/${y}/${x}.jpg</ServerUrl>
<ServerUrl>http://asgard.sci.utah.edu/Moon/Wac/tile/${z}/${y}/${x}</ServerUrl>
</Service>
<DataWindow>
<UpperLeftX>-180.0</UpperLeftX>
+5 -6
View File
@@ -24,9 +24,8 @@ return {
ColorLayers = {
-- MoonTrek based servers
{
Name = "WAC [MoonTrek]",
FilePath = "map_service_configs/MoonTrek/LRO WAC.wms",
Enabled = true
Name = "Apollo 16 Metric Cam Image Mosaic",
FilePath = "map_service_configs/MoonTrek/Apollo16_Metric_Cam_Image_Mosaic.wms"
},
-- Utah based servers
{
@@ -38,9 +37,9 @@ return {
FilePath = "map_service_configs/Utah/Kaguya.wms"
},
{
Name = "WAC [Utah]",
FilePath = "map_service_configs/Utah/Wac.wms"
-- Enabled = true,
Name = "WAC Utah",
FilePath = "map_service_configs/Utah/Wac.wms",
Enabled = true
}
},
HeightLayers = {
+1 -1
View File
@@ -121,7 +121,7 @@ return {
"sun",
"mercury",
"venus",
"lodglobes/earth",
"earth",
"moon",
"mars",
"jupiter",
+1
View File
@@ -69,6 +69,7 @@ return {
Name = "SunMarker",
Parent = "Sun",
Renderable = {
Enabled = false,
Type = "RenderablePlane",
Size = 3.0E11,
Origin = "Center",
+2 -2
View File
@@ -9,7 +9,7 @@ function remove(node) {
node.parentNode.removeChild(node);
}
function scrollTo(selector) {
function scrollToPosition(selector) {
var element = document.querySelector(selector);
if (element && element.scrollIntoView) {
element.scrollIntoView();
@@ -34,7 +34,7 @@ function pluralize(nItems, singular, plural) {
}
function scrollLink(content, selector) {
var html = '<a onclick="scrollTo(\'' + selector + '\')">' + content + "</a>";
var html = '<a onclick="scrollToPosition(\'' + selector + '\')">' + content + "</a>";
return html;
}
+1
View File
@@ -87,6 +87,7 @@ thead th:first-child {
.summary {
padding: 5px;
cursor: pointer;
}
.summary-warning {
background-color: #fef8c3;
+9
View File
@@ -0,0 +1,9 @@
<div id="page-content-wrapper">
<div class="container-fluid documentation-container">
<h1>OpenSpace Scene License Information</h1>
<p>Version: {{version.[0]}}.{{version.[1]}}.{{version.[2]}}</p>
{{#each sceneLicenses}}
{{> scenelicense}}
{{/each}}
</div>
</div>
+16
View File
@@ -0,0 +1,16 @@
<div class="documentation-item">
<div class="row">
<div class="col-lg-12">
<p>
<a href="#{{urlify module}}" name="{{urlify module}}">
<span class="documentation-key">{{module}}</span>
</a>
<p>{{name}}</p>
<br />
<p>{{attribution}}</p>
<p>{{url}}</p>
<p>{{licenseText}}</p>
</p>
</div>
</div>
</div>
+28
View File
@@ -0,0 +1,28 @@
window.onload = function () {
var mainTemplateElement = document.getElementById('mainTemplate');
var mainTemplate = Handlebars.compile(mainTemplateElement.innerHTML);
var sceneLicenseTemplate = document.getElementById('sceneLicenseTemplate');
Handlebars.registerPartial('scenelicense', sceneLicenseTemplate.innerHTML);
Handlebars.registerHelper('urlify', function(options, context) {
var data = context.data;
var identifier = options.replace(" ", "-").toLowerCase();
while (data = data._parent) {
if (data.key !== undefined) {
identifier = data.key + "-" + identifier;
}
}
return identifier;
});
var data = {
sceneLicenses: sceneLicenses,
version: version
}
var contents = mainTemplate(data);
document.body.innerHTML = contents;
}
@@ -67,6 +67,8 @@ public:
static const std::string KeyDocumentation;
/// The key that stores the factory documentation values
static const std::string KeyFactoryDocumentation;
/// The key that stores the scene license documentation values
static const std::string KeySceneLicenseDocumentation;
/// The key that stores the location of the scene file that is initially loaded
static const std::string KeyConfigScene;
/// The key that stores the location of the tasks files
@@ -79,9 +79,6 @@ public:
static OpenSpaceEngine& ref();
static bool isCreated();
double runTime();
void setRunTime(double t);
// callbacks
void initialize();
void initializeGL();
@@ -101,9 +98,6 @@ public:
void decode();
void scheduleLoadScene(std::string scenePath);
void enableBarrier();
void disableBarrier();
void writeDocumentation();
void toggleShutdownMode();
@@ -234,8 +228,6 @@ private:
std::vector<std::function<bool (double, double)>> mouseScrollWheel;
} _moduleCallbacks;
double _runTime;
// Structure that is responsible for the delayed shutdown of the application
struct {
// Whether the application is currently in shutdown mode (i.e. counting down the
@@ -49,6 +49,7 @@ public:
double averageDeltaTime() const override;
double deltaTime() const override;
double applicationTime() const override;
glm::vec2 mousePosition() const override;
uint32_t mouseButtons(int maxNumber) const override;
glm::ivec2 currentWindowSize() const override;
@@ -106,6 +106,13 @@ public:
*/
virtual double deltaTime() const;
/**
* Returns the time that has passed (in seconds) since application start
* \return The time that has passed (in seconds) since application start
* @return [description]
*/
virtual double applicationTime() const;
/**
* Returns the location of the mouse cursor in pixel screen coordinates. On default,
* this method returns <code>0,0</code>.
+1 -1
View File
@@ -55,6 +55,7 @@ public:
private:
void parallelConnectionChanged(const ParallelConnection::Status& status);
void addToCommand(std::string c);
std::string sanitizeInput(std::string str);
@@ -68,7 +69,6 @@ private:
properties::Vec4Property _historyTextColor;
properties::IntProperty _historyLength;
size_t _inputPosition;
std::vector<std::string> _commandsHistory;
size_t _activeCommand;
@@ -44,7 +44,9 @@ public:
static void createGlobalSharedMemory();
static void destroyGlobalSharedMemory();
PerformanceManager();
PerformanceManager(std::string loggingDirectory = "${BASE_PATH}",
std::string prefix = "PM-");
~PerformanceManager();
void resetPerformanceMeasurements();
+10 -2
View File
@@ -224,12 +224,20 @@ public:
std::vector<std::string> tags() const;
/**
* Adds a tag to the Property's list of assigned tags. Tags are useful for creating
* groups of Properties that can be used in batch operations.
* Adds a tag to the PropertyOwner's list of assigned tags. Tags are useful for
* creating oups of Properties that can be used in batch operations or to mark up
* PropertyOwners for other usages (such signalling to GUI applications).
* \param tag The string that is to be assigned to the Property
*/
void addTag(std::string tag);
/**
* Removes a tag from this PropertyOwner. No error is reported if the tag does not
* exist
* @param tag The tag is that is to be removed from this PropertyOwner
*/
void removeTag(const std::string& tag);
private:
/// The name of this PropertyOwner
std::string _name;
+6 -7
View File
@@ -65,7 +65,8 @@ public:
enum class FrametimeType {
DtTimeAvg = 0,
FPS,
FPSAvg
FPSAvg,
None
};
RenderEngine();
@@ -108,8 +109,8 @@ public:
void registerScreenSpaceRenderable(std::shared_ptr<ScreenSpaceRenderable> s);
void unregisterScreenSpaceRenderable(std::shared_ptr<ScreenSpaceRenderable> s);
void unregisterScreenSpaceRenderable(std::string name);
std::shared_ptr<ScreenSpaceRenderable> screenSpaceRenderable(std::string name);
void unregisterScreenSpaceRenderable(const std::string& name);
std::shared_ptr<ScreenSpaceRenderable> screenSpaceRenderable(const std::string& name);
std::vector<ScreenSpaceRenderable*> screenSpaceRenderables() const;
std::unique_ptr<ghoul::opengl::ProgramObject> buildRenderProgram(
@@ -168,8 +169,6 @@ public:
// Temporary fade functionality
void startFading(int direction, float fadeDuration);
void sortScreenspaceRenderables();
glm::ivec2 renderingResolution() const;
glm::ivec2 fontResolution() const;
@@ -177,7 +176,7 @@ public:
private:
void setRenderer(std::unique_ptr<Renderer> renderer);
RendererImplementation rendererFromString(const std::string& method);
RendererImplementation rendererFromString(const std::string& method) const;
void renderInformation();
@@ -185,7 +184,7 @@ private:
Scene* _scene;
std::unique_ptr<RaycasterManager> _raycasterManager;
properties::BoolProperty _performanceMeasurements;
properties::BoolProperty _doPerformanceMeasurements;
std::unique_ptr<performance::PerformanceManager> _performanceManager;
std::unique_ptr<Renderer> _renderer;
+4 -1
View File
@@ -47,10 +47,13 @@ public:
virtual ~Scale() = default;
virtual bool initialize();
virtual double scaleValue() const = 0;
virtual double scaleValue() const;
virtual void update(const UpdateData& data);
static documentation::Documentation Documentation();
protected:
double _scale;
};
} // namespace openspace
+16 -1
View File
@@ -32,9 +32,12 @@
#include <set>
#include <mutex>
#include <openspace/scene/scenelicense.h>
#include <openspace/scene/scenelicensewriter.h>
#include <openspace/scripting/scriptengine.h>
#include <openspace/util/camera.h>
#include <openspace/util/updatestructures.h>
#include <openspace/scripting/scriptengine.h>
#include <ghoul/opengl/programobject.h>
namespace ghoul { class Dictionary; }
@@ -122,6 +125,8 @@ public:
*/
void removeNode(SceneGraphNode* node, UpdateDependencies updateDeps = UpdateDependencies::Yes);
void addSceneLicense(SceneLicense license);
/**
* Update dependencies.
*/
@@ -132,6 +137,14 @@ public:
*/
const std::vector<SceneGraphNode*>& allSceneGraphNodes() const;
/**
* Write information about the license information for the scenegraph nodes that are
* contained in this scene
* \param path The file path that will contain the documentation about the licenses
* used in this scene
*/
void writeSceneLicenseDocumentation(const std::string& path) const;
/**
* Return a a map from name to scene graph node.
*/
@@ -160,6 +173,8 @@ private:
std::vector<SceneGraphNode*> _circularNodes;
std::map<std::string, SceneGraphNode*> _nodesByName;
std::vector<SceneLicense> _licenses;
std::mutex _programUpdateLock;
std::set<ghoul::opengl::ProgramObject*> _programsToUpdate;
std::vector<std::unique_ptr<ghoul::opengl::ProgramObject>> _programs;
+58
View File
@@ -0,0 +1,58 @@
/*****************************************************************************************
* *
* OpenSpace *
* *
* Copyright (c) 2014-2017 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
* without restriction, including without limitation the rights to use, copy, modify, *
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *
* permit persons to whom the Software is furnished to do so, subject to the following *
* conditions: *
* *
* The above copyright notice and this permission notice shall be included in all copies *
* or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#ifndef __OPENSPACE_CORE___SCENELICENSE___H__
#define __OPENSPACE_CORE___SCENELICENSE___H__
#include <openspace/documentation/documentation.h>
#include <string>
#include <vector>
namespace ghoul {
class Dictionary;
} // namespace ghoul
namespace openspace {
struct SceneLicense {
// module must not be empty
SceneLicense(const ghoul::Dictionary& dictionary, std::string module);
std::string module;
std::string name;
std::string attribution;
std::string url;
std::string licenseText;
static documentation::Documentation Documentation();
};
void writeSceneLicenseDocumentation(const std::vector<SceneLicense>& licenses,
const std::string& file, const std::string& type);
} // namespace openspace
#endif // __OPENSPACE_CORE___SCENELICENSE___H__
@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014 - 2017 *
* Copyright (c) 2014-2017 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
@@ -21,20 +21,28 @@
* 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___SCENELICENSEWRITER___H__
#define __OPENSPACE_CORE___SCENELICENSEWRITER___H__
#include "PowerScaling/powerScaling_fs.hglsl"
#include "fragment.glsl"
#include <openspace/documentation/documentationgenerator.h>
in vec4 vs_positionScreenSpace;
in vec4 vs_pointColor;
#include <openspace/scene/scenelicense.h>
#include <vector>
Fragment getFragment() {
if (vs_pointColor.a < 0.01) {
discard;
}
Fragment frag;
frag.color = vs_pointColor;
frag.depth = vs_positionScreenSpace.w;
return frag;
}
namespace openspace {
class SceneLicenseWriter : public DocumentationGenerator {
public:
SceneLicenseWriter(const std::vector<SceneLicense>& licenses);
private:
std::string generateJson() const override;
const std::vector<SceneLicense>& _licenses;
};
} // namespace openspace
#endif // __OPENSPACE_CORE___SCENELICENSEWRITER___H__
+11 -2
View File
@@ -26,6 +26,7 @@
#define __OPENSPACE_CORE___SCENELOADER___H__
#include <openspace/scene/scenegraphnode.h>
#include <openspace/scene/scenelicense.h>
#include <openspace/util/camera.h>
#include <ghoul/misc/dictionary.h>
@@ -33,6 +34,7 @@
#include <memory>
#include <string>
#include <utility>
namespace openspace {
@@ -51,7 +53,8 @@ public:
/**
* Import a directory of scene contents into an existing scene.
*/
std::vector<SceneGraphNode*> importDirectory(Scene& scene, const std::string& directory);
std::pair<std::vector<SceneGraphNode*>, std::vector<SceneLicense>>
importDirectory(Scene& scene, const std::string& directory);
/**
* Import a scene graph node from a dictionary into an existing scene.
@@ -98,10 +101,16 @@ private:
*/
std::vector<SceneLoader::LoadedNode> loadModule(const std::string& path, lua_State* luaState);
/**
* Loads an existing license file
*/
std::vector<SceneLicense> loadLicense(const std::string& path, std::string module);
/**
* Load a directory.
*/
std::vector<SceneLoader::LoadedNode> loadDirectory(const std::string& path, lua_State* luaState);
std::pair<std::vector<SceneLoader::LoadedNode>, std::vector<SceneLicense>>
loadDirectory(const std::string& path, lua_State* luaState);
/**
* Load a camera from a dictionary
+3 -1
View File
@@ -48,7 +48,7 @@ public:
virtual ~Translation() = default;
virtual bool initialize();
virtual glm::dvec3 position() const = 0;
virtual glm::dvec3 position() const;
virtual void update(const UpdateData& data);
glm::dvec3 position(double time);
@@ -63,6 +63,8 @@ protected:
void notifyObservers();
std::function<void()> _onParameterChangeCallback;
glm::dvec3 _positionValue;
};
} // namespace openspace
@@ -59,10 +59,10 @@ public:
TransformationManager();
~TransformationManager();
glm::dmat3 frameTransformationMatrix(std::string from, std::string to, double ephemerisTime) const;
glm::dmat3 frameTransformationMatrix(const std::string& from, const std::string& to, double ephemerisTime) const;
private:
glm::dmat3 kameleonTransformationMatrix(std::string from, std::string to, double ephemerisTime) const;
glm::dmat3 kameleonTransformationMatrix(const std::string& from, const std::string& to, double ephemerisTime) const;
#ifdef OPENSPACE_MODULE_KAMELEON_ENABLED
std::shared_ptr<ccmc::Kameleon> _kameleon;
+6 -5
View File
@@ -37,8 +37,11 @@ set(HEADER_FILES
${CMAKE_CURRENT_SOURCE_DIR}/rendering/screenspaceframebuffer.h
${CMAKE_CURRENT_SOURCE_DIR}/rendering/screenspaceimagelocal.h
${CMAKE_CURRENT_SOURCE_DIR}/rendering/screenspaceimageonline.h
${CMAKE_CURRENT_SOURCE_DIR}/translation/luatranslation.h
${CMAKE_CURRENT_SOURCE_DIR}/translation/statictranslation.h
${CMAKE_CURRENT_SOURCE_DIR}/rotation/luarotation.h
${CMAKE_CURRENT_SOURCE_DIR}/rotation/staticrotation.h
${CMAKE_CURRENT_SOURCE_DIR}/scale/luascale.h
${CMAKE_CURRENT_SOURCE_DIR}/scale/staticscale.h
)
source_group("Header Files" FILES ${HEADER_FILES})
@@ -56,8 +59,11 @@ set(SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/rendering/screenspaceframebuffer.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/screenspaceimagelocal.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/screenspaceimageonline.cpp
${CMAKE_CURRENT_SOURCE_DIR}/translation/luatranslation.cpp
${CMAKE_CURRENT_SOURCE_DIR}/translation/statictranslation.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rotation/luarotation.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rotation/staticrotation.cpp
${CMAKE_CURRENT_SOURCE_DIR}/scale/luascale.cpp
${CMAKE_CURRENT_SOURCE_DIR}/scale/staticscale.cpp
)
source_group("Source Files" FILES ${SOURCE_FILES})
@@ -67,13 +73,8 @@ set(SHADER_FILES
${CMAKE_CURRENT_SOURCE_DIR}/shaders/imageplane_vs.glsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/model_fs.glsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/model_vs.glsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/path_fs.glsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/path_gs.glsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/path_vs.glsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/plane_fs.glsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/plane_vs.glsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/pscstandard_fs.glsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/pscstandard_vs.glsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/renderabletrail_fs.glsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/renderabletrail_vs.glsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/screenspace_fs.glsl
+9
View File
@@ -43,10 +43,13 @@
#include <modules/base/rendering/screenspaceimageonline.h>
#include <modules/base/rendering/screenspaceframebuffer.h>
#include <modules/base/translation/luatranslation.h>
#include <modules/base/translation/statictranslation.h>
#include <modules/base/rotation/luarotation.h>
#include <modules/base/rotation/staticrotation.h>
#include <modules/base/scale/luascale.h>
#include <modules/base/scale/staticscale.h>
#include <ghoul/filesystem/filesystem>
@@ -85,16 +88,19 @@ void BaseModule::internalInitialize() {
auto fTranslation = FactoryManager::ref().factory<Translation>();
ghoul_assert(fTranslation, "Ephemeris factory was not created");
fTranslation->registerClass<LuaTranslation>("LuaTranslation");
fTranslation->registerClass<StaticTranslation>("StaticTranslation");
auto fRotation = FactoryManager::ref().factory<Rotation>();
ghoul_assert(fRotation, "Rotation factory was not created");
fRotation->registerClass<LuaRotation>("LuaRotation");
fRotation->registerClass<StaticRotation>("StaticRotation");
auto fScale = FactoryManager::ref().factory<Scale>();
ghoul_assert(fScale, "Scale factory was not created");
fScale->registerClass<LuaScale>("LuaScale");
fScale->registerClass<StaticScale>("StaticScale");
auto fModelGeometry = FactoryManager::ref().factory<modelgeometry::ModelGeometry>();
@@ -112,8 +118,11 @@ std::vector<documentation::Documentation> BaseModule::documentations() const {
ScreenSpaceFramebuffer::Documentation(),
ScreenSpaceImageLocal::Documentation(),
ScreenSpaceImageOnline::Documentation(),
LuaRotation::Documentation(),
StaticRotation::Documentation(),
LuaScale::Documentation(),
StaticScale::Documentation(),
LuaTranslation::Documentation(),
StaticTranslation::Documentation(),
modelgeometry::ModelGeometry::Documentation(),
};
@@ -38,7 +38,6 @@
namespace {
const char* KeyName = "Name";
const char* KeyUrl = "URL";
static const openspace::properties::Property::PropertyInfo TexturePathInfo = {
"TexturePath",
+133
View File
@@ -0,0 +1,133 @@
/*****************************************************************************************
* *
* OpenSpace *
* *
* Copyright (c) 2014-2017 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
* without restriction, including without limitation the rights to use, copy, modify, *
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *
* permit persons to whom the Software is furnished to do so, subject to the following *
* conditions: *
* *
* The above copyright notice and this permission notice shall be included in all copies *
* or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#include <modules/base/rotation/luarotation.h>
#include <openspace/documentation/documentation.h>
#include <openspace/documentation/verifier.h>
#include <openspace/util/updatestructures.h>
#include <ghoul/lua/ghoul_lua.h>
#include <ghoul/lua/lua_helper.h>
#include <ghoul/filesystem/filesystem.h>
#include <chrono>
namespace {
static const openspace::properties::Property::PropertyInfo ScriptInfo = {
"Script",
"Script",
"This value is the path to the Lua script that will be executed to compute the "
"rotation for this transformation. The script needs to define a function "
"'rotation' that takes the current simulation time in seconds past the J2000 "
"epoch as the first argument, the current wall time as milliseconds past the "
"J2000 epoch as the second argument and computes the rotation returned as 9 "
"values."
};} // namespace
namespace openspace {
documentation::Documentation LuaRotation::Documentation() {
using namespace openspace::documentation;
return {
"Lua Rotation",
"base_transform_rotation_lua",
{
{
"Type",
new StringEqualVerifier("LuaRotation"),
Optional::No
},
{
ScriptInfo.identifier,
new StringVerifier,
Optional::No,
ScriptInfo.description
}
}
};
}
LuaRotation::LuaRotation()
: _luaScriptFile(ScriptInfo)
, _state(false)
{
addProperty(_luaScriptFile);
}
LuaRotation::LuaRotation(const ghoul::Dictionary& dictionary)
: LuaRotation()
{
documentation::testSpecificationAndThrow(
Documentation(),
dictionary,
"LuaRotation"
);
_luaScriptFile = absPath(dictionary.value<std::string>(ScriptInfo.identifier));
}
void LuaRotation::update(const UpdateData& data) {
ghoul::lua::runScriptFile(_state, _luaScriptFile);
// Get the scaling function
lua_getglobal(_state, "rotation");
bool isFunction = lua_isfunction(_state, -1);
if (!isFunction) {
LERRORC(
"LuaRotation",
"Script '" << _luaScriptFile << "' does not have a function 'rotation'"
);
return;
}
// First argument is the number of seconds past the J2000 epoch in ingame time
lua_pushnumber(_state, data.time.j2000Seconds());
// Second argument is the number of milliseconds past the J2000 epoch in wallclock
using namespace std::chrono;
auto now = high_resolution_clock::now();
lua_pushnumber(
_state,
duration_cast<milliseconds>(now.time_since_epoch()).count()
);
// Execute the scaling function
int success = lua_pcall(_state, 2, 9, 0);
if (success != 0) {
LERRORC(
"LuaScale",
"Error executing 'rotation': " << lua_tostring(_state, -1)
);
}
double values[9];
for (int i = 0; i < 9; ++i) {
values[i] = luaL_checknumber(_state, -1 - i);
}
_matrix = glm::make_mat3(values);
}
} // namespace openspace
@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014 - 2017 *
* Copyright (c) 2014-2017 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
@@ -22,32 +22,33 @@
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#version __CONTEXT__
#ifndef __OPENSPACE_MODULE_BASE___LUAROTATION___H__
#define __OPENSPACE_MODULE_BASE___LUAROTATION___H__
#include "PowerScaling/powerScaling_vs.hglsl"
#include <openspace/scene/rotation.h>
layout(location = 0) in vec4 in_position;
layout(location = 1) in vec2 in_st;
layout(location = 2) in vec3 in_normal;
#include <openspace/properties/stringproperty.h>
out vec2 vs_st;
out vec4 vs_normal;
out vec4 vs_position;
#include <ghoul/lua/luastate.h>
uniform mat4 ViewProjection;
uniform mat4 ModelTransform;
void main() {
vs_st = in_st;
vs_position = in_position;
vec4 tmp = in_position;
// this is wrong for the normal. The normal transform is the transposed inverse of the model transform
vs_normal = normalize(ModelTransform * vec4(in_normal,0));
namespace openspace {
vec4 position = pscTransform(tmp, ModelTransform);
vs_position = tmp;
position = ViewProjection * position;
gl_Position = z_normalization(position);
}
namespace documentation { struct Documentation; }
class LuaRotation : public Rotation {
public:
LuaRotation();
LuaRotation(const ghoul::Dictionary& dictionary);
void update(const UpdateData& data) override;
static documentation::Documentation Documentation();
private:
properties::StringProperty _luaScriptFile;
ghoul::lua::LuaState _state;
};
} // namespace openspace
#endif // __OPENSPACE_MODULE_BASE___LUAROTATION___H__
+119
View File
@@ -0,0 +1,119 @@
/*****************************************************************************************
* *
* OpenSpace *
* *
* Copyright (c) 2014-2017 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
* without restriction, including without limitation the rights to use, copy, modify, *
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *
* permit persons to whom the Software is furnished to do so, subject to the following *
* conditions: *
* *
* The above copyright notice and this permission notice shall be included in all copies *
* or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#include <modules/base/scale/luascale.h>
#include <openspace/documentation/documentation.h>
#include <openspace/documentation/verifier.h>
#include <openspace/util/updatestructures.h>
#include <ghoul/lua/ghoul_lua.h>
#include <ghoul/lua/lua_helper.h>
#include <ghoul/filesystem/filesystem.h>
#include <chrono>
namespace {
static const openspace::properties::Property::PropertyInfo ScriptInfo = {
"Script",
"Script",
"This value is the path to the Lua script that will be executed to compute the "
"scaling factor for this transformation. The script needs to define a function "
"'scale' that takes the current simulation time in seconds past the J2000 epoch "
"as the first argument, the current wall time as milliseconds past the J2000 "
"epoch the second argument and computes the scaling factor."
};
} // namespace
namespace openspace {
documentation::Documentation LuaScale::Documentation() {
using namespace openspace::documentation;
return {
"Lua Scaling",
"base_scale_lua",
{
{
ScriptInfo.identifier,
new StringVerifier,
Optional::No,
ScriptInfo.description
}
}
};
}
LuaScale::LuaScale()
: _luaScriptFile(ScriptInfo)
, _state(false)
{
addProperty(_luaScriptFile);
}
LuaScale::LuaScale(const ghoul::Dictionary& dictionary)
: LuaScale()
{
documentation::testSpecificationAndThrow(Documentation(), dictionary, "LuaScale");
_luaScriptFile = absPath(dictionary.value<std::string>(ScriptInfo.identifier));
}
void LuaScale::update(const UpdateData& data) {
ghoul::lua::runScriptFile(_state, _luaScriptFile);
// Get the scaling function
lua_getglobal(_state, "scale");
bool isFunction = lua_isfunction(_state, -1);
if (!isFunction) {
LERRORC(
"LuaScale",
"Script '" << _luaScriptFile << "' does not have a function 'scale'"
);
return;
}
// First argument is the number of seconds past the J2000 epoch in ingame time
lua_pushnumber(_state, data.time.j2000Seconds());
// Second argument is the number of milliseconds past the J2000 epoch in wallclock
using namespace std::chrono;
auto now = high_resolution_clock::now();
lua_pushnumber(
_state,
duration_cast<milliseconds>(now.time_since_epoch()).count()
);
// Execute the scaling function
int success = lua_pcall(_state, 2, 1, 0);
if (success != 0) {
LERRORC(
"LuaScale",
"Error executing 'scale': " << lua_tostring(_state, -1)
);
}
_scale = luaL_checknumber(_state, -1);
}
} // namespace openspace
@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014 - 2017 *
* Copyright (c) 2014-2017 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
@@ -22,43 +22,33 @@
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#version __CONTEXT__
#ifndef __OPENSPACE_MODULE_BASE___LUASCALE___H__
#define __OPENSPACE_MODULE_BASE___LUASCALE___H__
#include "PowerScaling/powerScalingMath.hglsl"
#include <${SHADERS_GENERATED}/constants.hglsl>:notrack
#include <openspace/scene/scale.h>
layout(points) in;
layout(location = 0) in vec4 vs_point_position[];
layout(location = 1) in flat int isHour[];
layout(location = 2) in vec4 vs_point_color[];
#include <openspace/properties/stringproperty.h>
layout(points, max_vertices = 4) out;
layout(location = 0) out vec4 gs_point_position;
layout(location = 1) out vec4 gs_point_color;
#include <ghoul/lua/luastate.h>
uniform mat4 projection;
uniform mat4 ViewProjection;
namespace openspace {
namespace documentation { struct Documentation; }
class LuaScale : public Scale {
public:
LuaScale();
LuaScale(const ghoul::Dictionary& dictionary);
const vec2 corners[4] = vec2[4](
vec2(0.0, 1.0),
vec2(0.0, 0.0),
vec2(1.0, 1.0),
vec2(1.0, 0.0)
);
void update(const UpdateData& data) override;
static documentation::Documentation Documentation();
void main() {
gs_point_color = vs_point_color[0];
gs_point_position = vs_point_position[0];
if (isHour[0] == 1) {
gl_Position = gl_in[0].gl_Position;
EmitVertex();
EndPrimitive();
}
else {
gl_Position = gl_in[0].gl_Position;
EmitVertex();
EndPrimitive();
return;
}
}
private:
properties::StringProperty _luaScriptFile;
ghoul::lua::LuaState _state;
};
} // namespace openspace
#endif // __OPENSPACE_MODULE_BASE___LUASCALE___H__
+2 -4
View File
@@ -58,6 +58,8 @@ StaticScale::StaticScale()
: _scaleValue(ScaleInfo, 1.0, 1.0, 1e6)
{
addProperty(_scaleValue);
_scaleValue.onChange([&](){ _scale = _scaleValue; });
}
StaticScale::StaticScale(const ghoul::Dictionary& dictionary)
@@ -68,8 +70,4 @@ StaticScale::StaticScale(const ghoul::Dictionary& dictionary)
_scaleValue = static_cast<float>(dictionary.value<double>(ScaleInfo.identifier));
}
double StaticScale::scaleValue() const {
return _scaleValue;
}
} // namespace openspace
-2
View File
@@ -38,8 +38,6 @@ public:
StaticScale();
StaticScale(const ghoul::Dictionary& dictionary);
double scaleValue() const override;
static documentation::Documentation Documentation();
private:
-1
View File
@@ -29,7 +29,6 @@ in float vs_screenSpaceDepth;
uniform sampler2D texture1;
Fragment getFragment() {
Fragment frag;
+141
View File
@@ -0,0 +1,141 @@
/*****************************************************************************************
* *
* OpenSpace *
* *
* Copyright (c) 2014-2017 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
* without restriction, including without limitation the rights to use, copy, modify, *
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *
* permit persons to whom the Software is furnished to do so, subject to the following *
* conditions: *
* *
* The above copyright notice and this permission notice shall be included in all copies *
* or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#include <modules/base/translation/luatranslation.h>
#include <openspace/documentation/documentation.h>
#include <openspace/documentation/verifier.h>
#include <openspace/util/updatestructures.h>
#include <ghoul/lua/ghoul_lua.h>
#include <ghoul/lua/lua_helper.h>
#include <ghoul/filesystem/filesystem.h>
#include <chrono>
namespace {
static const openspace::properties::Property::PropertyInfo ScriptInfo = {
"Script",
"Script",
"This value is the path to the Lua script that will be executed to compute the "
"translation for this transformation. The script needs to define a function "
"'translate' that takes the current simulation time in seconds past the J2000 "
"epoch as the first argument, the current wall time as milliseconds past the "
"J2000 epoch as the second argument and computes the translation."
};
} // namespace
namespace openspace {
documentation::Documentation LuaTranslation::Documentation() {
using namespace documentation;
return {
"Lua Translation",
"base_transform_translation_lua",
{
{
"Type",
new StringEqualVerifier("LuaTranslation"),
Optional::No
},
{
ScriptInfo.identifier,
new StringVerifier,
Optional::No,
ScriptInfo.description
}
}
};
}
LuaTranslation::LuaTranslation()
: _luaScriptFile(ScriptInfo)
, _state(false)
{
addProperty(_luaScriptFile);
_luaScriptFile.onChange([&](){
_fileHandle = std::make_unique<ghoul::filesystem::File>(_luaScriptFile);
_fileHandle->setCallback([&](const ghoul::filesystem::File&){
notifyObservers();
});
});
}
LuaTranslation::LuaTranslation(const ghoul::Dictionary& dictionary)
: LuaTranslation()
{
documentation::testSpecificationAndThrow(
Documentation(),
dictionary,
"StaticTranslation"
);
_luaScriptFile = absPath(dictionary.value<std::string>(ScriptInfo.identifier));
}
void LuaTranslation::update(const UpdateData& data) {
ghoul::lua::runScriptFile(_state, _luaScriptFile);
// Get the scaling function
lua_getglobal(_state, "translation");
bool isFunction = lua_isfunction(_state, -1);
if (!isFunction) {
LERRORC(
"LuaScale",
"Script '" << _luaScriptFile << "' does not have a function 'translation'"
);
return;
}
// First argument is the number of seconds past the J2000 epoch in ingame time
lua_pushnumber(_state, data.time.j2000Seconds());
// Second argument is the number of milliseconds past the J2000 epoch in wallclock
using namespace std::chrono;
auto now = high_resolution_clock::now();
lua_pushnumber(
_state,
duration_cast<milliseconds>(now.time_since_epoch()).count()
);
// Execute the scaling function
int success = lua_pcall(_state, 2, 3, 0);
if (success != 0) {
LERRORC(
"LuaScale",
"Error executing 'translation': " << lua_tostring(_state, -1)
);
}
double values[3];
for (int i = 0; i < 3; ++i) {
values[i] = luaL_checknumber(_state, -1 - i);
}
_positionValue = glm::make_vec3(values);
}
} // namespace openspace
@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014 - 2017 *
* Copyright (c) 2014-2017 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
@@ -22,42 +22,38 @@
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#version __CONTEXT__
#ifndef __OPENSPACE_MODULE_BASE___LUATRANSLATION___H__
#define __OPENSPACE_MODULE_BASE___LUATRANSLATION___H__
#include "PowerScaling/powerScaling_vs.hglsl"
#include <openspace/scene/translation.h>
in vec4 in_point_position;
#include <openspace/properties/stringproperty.h>
out vec4 vs_positionScreenSpace;
out vec4 vs_pointColor;
#include <ghoul/filesystem/file.h>
#include <ghoul/lua/luastate.h>
uniform vec3 color;
uniform mat4 modelViewTransform;
uniform mat4 projectionTransform;
uniform int pointSteps;
#include <memory>
namespace openspace {
void main() {
vec4 positionCameraSpace = modelViewTransform * in_point_position;
vec4 positionClipSpace = projectionTransform * positionCameraSpace;
vs_positionScreenSpace = z_normalization(positionClipSpace);
namespace documentation { struct Documentation; }
class LuaTranslation : public Translation {
public:
LuaTranslation();
LuaTranslation(const ghoul::Dictionary& dictionary);
gl_Position = vs_positionScreenSpace;
virtual void update(const UpdateData& data) override;
if (mod(gl_VertexID, pointSteps) == 0) {
vs_pointColor.rgb = color;
gl_PointSize = 5.0f;
}
else {
vs_pointColor.rgb = (color + vec3(0.6, 0.6, 0.6)) / 2.0;
gl_PointSize = 2.f;
}
static documentation::Documentation Documentation();
// I don't like this random variable k defined in powerScalingMath.hglsl.
// Will ignore it and use 10 in protest of psc dependencies. /KB
// float maximumDistance = pow(k, 10);
float maximumDistance = pow(10, 10);
float distanceToCamera = length(positionCameraSpace.xyz);
private:
properties::StringProperty _luaScriptFile;
ghoul::lua::LuaState _state;
vs_pointColor.a = maximumDistance / (distanceToCamera / 100.0);
}
std::unique_ptr<ghoul::filesystem::File> _fileHandle;
};
} // namespace openspace
#endif // __OPENSPACE_MODULE_BASE___LUATRANSLATION___H__
@@ -69,6 +69,8 @@ StaticTranslation::StaticTranslation()
)
{
addProperty(_position);
_position.onChange([&](){ _positionValue = _position; });
}
StaticTranslation::StaticTranslation(const ghoul::Dictionary& dictionary)
@@ -83,8 +85,4 @@ StaticTranslation::StaticTranslation(const ghoul::Dictionary& dictionary)
_position = dictionary.value<glm::dvec3>(PositionInfo.identifier);
}
glm::dvec3 StaticTranslation::position() const {
return _position;
}
} // namespace openspace
@@ -38,8 +38,6 @@ public:
StaticTranslation();
StaticTranslation(const ghoul::Dictionary& dictionary);
virtual glm::dvec3 position() const override;
static documentation::Documentation Documentation();
private:
@@ -671,8 +671,8 @@ void RenderableBillboardsCloud::renderLabels(const RenderData& data, const glm::
scale = 306391534.73091 * PARSEC;
break;
}
for (const auto pair : _labelData) {
for (const std::pair<glm::vec3, std::string>& pair : _labelData) {
//glm::vec3 scaledPos(_transformationMatrix * glm::dvec4(pair.first, 1.0));
glm::vec3 scaledPos(pair.first);
scaledPos *= scale;
@@ -690,8 +690,7 @@ void RenderableBillboardsCloud::renderLabels(const RenderData& data, const glm::
_renderOption.value(),
"%s",
pair.second.c_str());
}
}
}
void RenderableBillboardsCloud::render(const RenderData& data, RendererTasks&) {
@@ -235,15 +235,15 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary)
, _alphaValue(TransparencyInfo, 1.f, 0.f, 1.f)
, _scaleFactor(ScaleFactorInfo, 1.f, 0.f, 64.f)
//, _pointColor(ColorInfo, glm::vec3(1.f, 0.4f, 0.2f), glm::vec3(0.f, 0.f, 0.f), glm::vec3(1.0f, 1.0f, 1.0f))
, _drawLabels(DrawLabelInfo, false)
, _textColor(
TextColorInfo,
glm::vec4(1.0f, 1.0, 1.0f, 1.f),
glm::vec4(0.f),
glm::vec4(1.f)
)
, _textSize(TextSizeInfo, 8.0, 0.5, 24.0)
, _textSize(TextSizeInfo, 8.0, 0.5, 24.0)
, _drawElements(DrawElementsInfo, true)
, _drawLabels(DrawLabelInfo, false)
, _renderOption(RenderOptionInfo, properties::OptionProperty::DisplayType::Dropdown)
, _program(nullptr)
, _fontRenderer(nullptr)
@@ -251,10 +251,8 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary)
, _speckFile("")
, _labelFile("")
, _unit(Parsec)
, _nValuesPerAstronomicalObject(0)
, _nValuesPerAstronomicalObject(0)
{
using File = ghoul::filesystem::File;
documentation::testSpecificationAndThrow(
Documentation(),
dictionary,
@@ -382,7 +380,6 @@ void RenderableDUMeshes::initialize() {
bool success = loadData();
if (!success) {
throw ghoul::RuntimeError("Error loading data");
return;
}
createMeshes();
@@ -400,7 +397,7 @@ void RenderableDUMeshes::initialize() {
}
void RenderableDUMeshes::deinitialize() {
for (auto pair : _renderingMeshesMap) {
for (const std::pair<int, RenderingMesh>& pair : _renderingMeshesMap) {
for (int i = 0; i < pair.second.numU; ++i) {
glDeleteVertexArrays(1, &pair.second.vaoArray[i]);
glDeleteBuffers(1, &pair.second.vboArray[i]);
@@ -414,8 +411,10 @@ void RenderableDUMeshes::deinitialize() {
}
}
void RenderableDUMeshes::renderMeshes(const RenderData& data, const glm::dmat4& modelViewMatrix,
const glm::dmat4& projectionMatrix) {
void RenderableDUMeshes::renderMeshes(const RenderData&,
const glm::dmat4& modelViewMatrix,
const glm::dmat4& projectionMatrix)
{
// Saving current OpenGL state
GLboolean blendEnabled = glIsEnabled(GL_BLEND);
GLenum blendEquationRGB;
@@ -514,7 +513,7 @@ void RenderableDUMeshes::renderLabels(const RenderData& data, const glm::dmat4&
break;
}
for (const auto pair : _labelData) {
for (const std::pair<glm::vec3, std::string>& pair : _labelData) {
//glm::vec3 scaledPos(_transformationMatrix * glm::dvec4(pair.first, 1.0));
glm::vec3 scaledPos(pair.first);
scaledPos *= scale;
@@ -154,7 +154,7 @@ private:
glm::dmat4 _transformationMatrix;
std::unordered_map<int, glm::vec3> _meshColorMap;
std::unordered_map<int, RenderingMesh> _renderingMeshesMap;
std::unordered_map<int, RenderingMesh> _renderingMeshesMap;
};
@@ -278,8 +278,6 @@ RenderablePlanesCloud::RenderablePlanesCloud(const ghoul::Dictionary& dictionary
, _sluminosity(1.f)
, _transformationMatrix(glm::dmat4(1.0))
{
using File = ghoul::filesystem::File;
documentation::testSpecificationAndThrow(
Documentation(),
dictionary,
@@ -431,7 +429,6 @@ void RenderablePlanesCloud::initialize() {
bool success = loadData();
if (!success) {
throw ghoul::RuntimeError("Error loading data");
return;
}
createPlanes();
@@ -468,8 +465,10 @@ void RenderablePlanesCloud::deinitialize() {
}
}
void RenderablePlanesCloud::renderPlanes(const RenderData& data, const glm::dmat4& modelViewMatrix,
const glm::dmat4& projectionMatrix) {
void RenderablePlanesCloud::renderPlanes(const RenderData&,
const glm::dmat4& modelViewMatrix,
const glm::dmat4& projectionMatrix)
{
// Saving current OpenGL state
GLboolean blendEnabled = glIsEnabled(GL_BLEND);
GLenum blendEquationRGB;
@@ -580,7 +579,7 @@ void RenderablePlanesCloud::renderLabels(const RenderData& data, const glm::dmat
break;
}
for (const auto pair : _labelData) {
for (const std::pair<glm::vec3, std::string>& pair : _labelData) {
//glm::vec3 scaledPos(_transformationMatrix * glm::dvec4(pair.first, 1.0));
glm::vec3 scaledPos(pair.first);
scaledPos *= scale;
+1
View File
@@ -168,6 +168,7 @@ set(SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/rendering/layer/layer.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/layer/layeradjustment.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/layer/layergroup.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/layer/layergroupid.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/layer/layermanager.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/layer/layerrendersettings.cpp
@@ -221,6 +221,8 @@ int loadWMSCapabilities(lua_State* L) {
std::move(globe),
std::move(url)
);
return 0;
}
int removeWMSServer(lua_State* L) {
@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014 - 2017 *
* Copyright (c) 2014-2017 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
@@ -22,54 +22,48 @@
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#include "PowerScaling/powerScaling_fs.hglsl"
#include "fragment.glsl"
#include <modules/globebrowsing/rendering/layer/layergroupid.h>
in vec2 vs_st;
in vec4 vs_normal;
in vec4 vs_position;
namespace openspace::globebrowsing::layergroupid {
uniform vec4 campos;
uniform vec4 objpos;
uniform vec3 sun_pos;
uniform bool _performShading = true;
uniform float transparency;
uniform int shadows;
uniform float time;
uniform sampler2D texture1;
Fragment getFragment() {
vec4 position = vs_position;
float depth = pscDepth(position);
vec4 diffuse = texture(texture1, vs_st);
Fragment frag;
if (_performShading) {
vec3 n = normalize(vs_normal.xyz);
vec3 l_pos = vec3(sun_pos); // sun.
vec3 l_dir = normalize(l_pos - objpos.xyz);
float intensity = min(max(5 * dot(n,l_dir), 0.0), 1);
// float shine = 0.0001;
const vec4 specular = vec4(0.5);
vec4 ambient = vec4(0.0, 0.0, 0.0, transparency);
/*
if(intensity > 0.f){
// halfway vector
vec3 h = normalize(l_dir + e);
// specular factor
float intSpec = max(dot(h,n),0.0);
spec = specular * pow(intSpec, shine);
TypeID getTypeIDFromTypeString(const std::string& typeString) {
for (int i = 0; i < NUM_LAYER_TYPES; ++i) {
if (typeString == LAYER_TYPE_NAMES[i]) {
return static_cast<TypeID>(i);
}
*/
diffuse = max(intensity * diffuse, ambient);
}
frag.color.rgb = diffuse.rgb;
frag.color.a = transparency;
frag.depth = depth;
return frag;
return TypeID::Unknown;
}
layergroupid::GroupID getGroupIDFromName(const std::string& layerGroupName) {
for (int i = 0; i < layergroupid::NUM_LAYER_GROUPS; ++i) {
if (layerGroupName == layergroupid::LAYER_GROUP_NAMES[i]) {
return static_cast<layergroupid::GroupID>(i);
}
}
return GroupID::Unknown;
}
layergroupid::AdjustmentTypeID getAdjustmentTypeIDFromName(
const std::string& adjustmentTypeName)
{
for (int i = 0; i < layergroupid::NUM_ADJUSTMENT_TYPES; ++i) {
if (adjustmentTypeName == layergroupid::ADJUSTMENT_TYPE_NAMES[i]) {
return static_cast<layergroupid::AdjustmentTypeID>(i);
}
}
return AdjustmentTypeID::None;
}
layergroupid::BlendModeID getBlendModeIDFromName(
const std::string& blendModeName)
{
for (int i = 0; i < layergroupid::NUM_BLEND_MODES; ++i) {
if (blendModeName == layergroupid::BLEND_MODE_NAMES[i]) {
return static_cast<layergroupid::BlendModeID>(i);
}
}
return BlendModeID::Normal;
}
} // namespace openspace::globebrowsing::layergroupid
@@ -110,45 +110,15 @@ enum class BlendModeID {
Color = 4,
};
static TypeID getTypeIDFromTypeString(std::string typeString) {
for (int i = 0; i < NUM_LAYER_TYPES; ++i) {
if (typeString == LAYER_TYPE_NAMES[i]) {
return static_cast<TypeID>(i);
}
}
return TypeID::Unknown;
}
TypeID getTypeIDFromTypeString(const std::string& typeString);
static layergroupid::GroupID getGroupIDFromName(std::string layerGroupName) {
for (int i = 0; i < layergroupid::NUM_LAYER_GROUPS; ++i) {
if (layerGroupName == layergroupid::LAYER_GROUP_NAMES[i]) {
return static_cast<layergroupid::GroupID>(i);
}
}
return GroupID::Unknown;
}
layergroupid::GroupID getGroupIDFromName(const std::string& layerGroupName);
static layergroupid::AdjustmentTypeID getAdjustmentTypeIDFromName(
std::string adjustmentTypeName)
{
for (int i = 0; i < layergroupid::NUM_ADJUSTMENT_TYPES; ++i) {
if (adjustmentTypeName == layergroupid::ADJUSTMENT_TYPE_NAMES[i]) {
return static_cast<layergroupid::AdjustmentTypeID>(i);
}
}
return AdjustmentTypeID::None;
}
layergroupid::AdjustmentTypeID getAdjustmentTypeIDFromName(
const std::string& adjustmentTypeName);
static layergroupid::BlendModeID getBlendModeIDFromName(
std::string blendModeName)
{
for (int i = 0; i < layergroupid::NUM_BLEND_MODES; ++i) {
if (blendModeName == layergroupid::BLEND_MODE_NAMES[i]) {
return static_cast<layergroupid::BlendModeID>(i);
}
}
return BlendModeID::Normal;
}
layergroupid::BlendModeID getBlendModeIDFromName(
const std::string& blendModeName);
} // namespace openspace::globebrowsing::layergroupid
+24 -14
View File
@@ -162,19 +162,25 @@ openspace.globebrowsing.parseInfoFile = function (file)
local dir = openspace.directoryForPath(file)
dofile(file)
local color = {
Name = Name,
Description = Description or "",
FilePath = dir .. '/' .. ColorFile,
BlendMode = "Color"
}
local color = nil
if ColorFile then
color = {
Name = Name,
Description = Description or "",
FilePath = dir .. '/' .. ColorFile,
BlendMode = "Color"
}
end
local height = {
Name = Name,
Description = Description or "",
FilePath = dir .. '/' .. HeightFile,
TilePixelSize = 90
}
local height = nil
if HeightFile then
local height = {
Name = Name,
Description = Description or "",
FilePath = dir .. '/' .. HeightFile,
TilePixelSize = 90
}
end
return color, height
end
@@ -186,8 +192,12 @@ openspace.globebrowsing.addBlendingLayersFromDirectory = function (dir, node_nam
if file:find('.info') then
c, h = openspace.globebrowsing.parseInfoFile(file)
openspace.globebrowsing.addLayer(node_name, "ColorLayers", c)
openspace.globebrowsing.addLayer(node_name, "HeightLayers", h)
if c then
openspace.globebrowsing.addLayer(node_name, "ColorLayers", c)
end
if h then
openspace.globebrowsing.addLayer(node_name, "HeightLayers", h)
end
end
end
end
@@ -41,7 +41,7 @@ namespace openspace::globebrowsing {
/**
* Function for passing GDAL error messages to the GHOUL logging system.
*/
static void gdalErrorHandler(CPLErr eErrClass, int errNo, const char* msg);
void gdalErrorHandler(CPLErr eErrClass, int errNo, const char* msg);
/**
* Singleton class interfacing with global GDAL functions.
+2 -1
View File
@@ -49,7 +49,7 @@ const char* configurationFile = "imgui.ini";
//const char* GuiFont = "${FONTS}/ubuntu/Ubuntu-Regular.ttf";
const char* GuiFont = "${FONTS}/arimo/Arimo-Regular.ttf";
const float FontSize = 14.f;
const ImVec2 size = ImVec2(350, 500);
const ImVec2 size = ImVec2(500, 500);
//GLuint fontTex = 0;
// A VBO max size of 0 will cause a lazy instantiation of the buffer
@@ -385,6 +385,7 @@ void GUI::initialize() {
_globalProperty.initialize();
_globalProperty.setHasRegularProperties(true);
_featuredProperties.initialize();
_featuredProperties.setHasRegularProperties(true);
_virtualProperty.initialize();
_filePath.initialize();
#ifdef GLOBEBROWSING_USE_GDAL
@@ -64,7 +64,6 @@ void GuiGlobeBrowsingComponent::render() {
using Layer = GlobeBrowsingModule::Layer;
bool e = _isEnabled;
e = e;
ImGui::Begin("Globe Browsing", &e, WindowSize, 0.5f);
_isEnabled = e;
+1 -1
View File
@@ -47,7 +47,7 @@ namespace {
openspace::MissionPhase::Trace t = mission.phaseTrace(currentTime, 0);
int treeOption = t.empty() ? 0 : ImGuiTreeNodeFlags_DefaultOpen;
if (ImGui::TreeNodeEx(("%s" + missionHashname).c_str(), treeOption, mission.name().c_str())) {
if (ImGui::TreeNodeEx(("%s" + missionHashname).c_str(), treeOption, "%s", mission.name().c_str())) {
if (!mission.description().empty()) {
ImGui::Text("%s", mission.description().c_str());
}
+1 -1
View File
@@ -147,8 +147,8 @@ namespace openspace::gui {
GuiPropertyComponent::GuiPropertyComponent(std::string name, UseTreeLayout useTree, IsTopLevelWindow topLevel)
: GuiComponent(std::move(name))
, _useTreeLayout(useTree)
, _isTopLevel(topLevel)
, _currentUseTreeLayout(useTree)
, _isTopLevel(topLevel)
{}
void GuiPropertyComponent::setSource(SourceFunction function) {
+23 -10
View File
@@ -139,10 +139,12 @@ void GuiSpaceTimeComponent::render() {
CaptionText("Time Controls");
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + 10.f);
ImGui::Text("Current Date: %s", OsEng.timeManager().time().UTC().c_str());
constexpr int BufferSize = 256;
static char Buffer[BufferSize];
bool dateChanged = ImGui::InputText(
"Date",
"Change Date",
Buffer,
BufferSize,
ImGuiInputTextFlags_EnterReturnsTrue
@@ -207,8 +209,26 @@ void GuiSpaceTimeComponent::render() {
incrementTime(-1);
}
ImGui::SameLine();
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + 55.f);
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + 15.f);
bool nowDay = ImGui::Button("Now");
if (nowDay) {
std::string nowTime = Time::now().UTC();
// UTC returns a string of the type YYYY MMM DDTHH:mm:ss.xxx
// setTime doesn't like the T in it and wants a space instead
nowTime[11] = ' ';
OsEng.scriptEngine().queueScript(
"openspace.time.setTime(\"" + nowTime + "\")",
scripting::ScriptEngine::RemoteScripting::Yes
);
}
ImGui::SameLine();
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + 15.f);
bool plusDay = ImGui::Button("+Day");
if (plusDay) {
@@ -262,13 +282,6 @@ void GuiSpaceTimeComponent::render() {
);
}
auto setDeltaTime = [](std::chrono::seconds dt) {
OsEng.scriptEngine().queueScript(
"openspace.time.setDeltaTime(" + std::to_string(dt.count()) + ")",
scripting::ScriptEngine::RemoteScripting::Yes
);
};
bool minusDs = ImGui::Button("-1d/s");
if (minusDs) {
OsEng.scriptEngine().queueScript(
@@ -274,8 +274,10 @@ bool RenderableConstellationBounds::loadVertexFile() {
std::string fileName = absPath(_vertexFilename);
std::ifstream file;
file.exceptions(std::ifstream::goodbit);
file.open(fileName);
if (!file.good()) {
return false;
}
ConstellationBound currentBound;
currentBound.constellationAbbreviation = "";
-1
View File
@@ -34,7 +34,6 @@ out vec4 vs_position;
uniform mat4 modelViewProjectionTransform;
void main() {
vs_st = in_st;
+1
View File
@@ -76,6 +76,7 @@ return {
KeyboardShortcuts = "${DOCUMENTATION}/KeyboardMapping.html",
Documentation = "${DOCUMENTATION}/Documentation.html",
FactoryDocumentation = "${DOCUMENTATION}/FactoryDocumentation.html",
LicenseDocumentation = "${DOCUMENTATION}/License.html",
-- CheckOpenGLState = true,
-- LogEachOpenGLCall = true,

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