diff --git a/.gitignore b/.gitignore
index a39f0eb829..7b140e286b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -55,8 +55,8 @@ data/scene/lodglobes/uranus/textures
data/scene/lodglobes/venus/textures
data/scene/mars/textures
data/scene/mercury/textures
-data/scene/milkyway/textures
-data/scene/milkyway-eso/textures
+data/scene/milkyway/digitaluniverse/textures
+data/scene/milkyway/eso/textures
data/scene/missions/dawn/ceres/textures
data/scene/missions/dawn/dawn/obj
data/scene/missions/dawn/dawn/textures
@@ -98,12 +98,12 @@ data/scene/saturn/rhea/textures
data/scene/saturn/saturn/textures
data/scene/saturn/tethys/textures
data/scene/saturn/titan/textures
-data/scene/stars/colorbv.cmap
-data/scene/stars/speck
-data/scene/stars/textures
-data/scene/stars-denver/denver_colorbv.cmap
-data/scene/stars-denver/speck
-data/scene/stars-denver/textures
+data/scene/stars/digitaluniverse/colorbv.cmap
+data/scene/stars/digitaluniverse/speck
+data/scene/stars/digitaluniverse/textures
+data/scene/stars/denver/denver_colorbv.cmap
+data/scene/stars/denver/speck
+data/scene/stars/denver/textures
data/scene/sun/textures
data/scene/uranus/textures
data/scene/venus/textures
diff --git a/data/scene/atmosphereearth.scene b/data/scene/atmosphereearth.scene
index a129c1700c..bbfaf10dd1 100644
--- a/data/scene/atmosphereearth.scene
+++ b/data/scene/atmosphereearth.scene
@@ -42,14 +42,14 @@ return {
Camera = {
Focus = "Earth",
Position = {1, 0, 0},
- Rotation = {0.250635, -0.028751, 0.879269, 0.404030},
+ Rotation = {0.250635, -0.028751, 0.879269, 0.404030},
},
Modules = {
"sun",
"earth",
- "stars",
- --"stars-denver",
- "milkyway",
- -- "milkyway-eso",
+ "stars/digitaluniverse",
+ -- "stars/denver",
+ "milkyway/digitaluniverse",
+ --"milkyway/eso",
}
}
diff --git a/data/scene/atmosphereearth/atmosphereearth.mod b/data/scene/atmosphereearth/atmosphereearth.mod
index b019c71241..fd7116b122 100644
--- a/data/scene/atmosphereearth/atmosphereearth.mod
+++ b/data/scene/atmosphereearth/atmosphereearth.mod
@@ -40,10 +40,10 @@ return {
},
--Caster2 = { Name = "Independency Day Ship", Radius = 0 }
},
+ ColorTexture = "textures/earth_bluemarble.jpg",
+ NightTexture = "textures/earth_night.jpg",
Textures = {
Type = "simple",
- Color = "textures/earth_bluemarble.jpg",
- Night = "textures/earth_night.jpg",
--Height = "textures/earth_bluemarble_height.jpg",
-- Depth = "textures/earth_depth.png",
Reflectance = "textures/earth_reflectance.png",
@@ -110,7 +110,7 @@ return {
Type = "RenderableTrailOrbit",
Translation = {
Type = "SpiceTranslation",
- Body = "EARTH",
+ Target = "EARTH",
Observer = "SUN"
},
Color = { 0.5, 0.8, 1.0 },
diff --git a/data/scene/lodglobes/arrows.png b/data/scene/common/textures/arrows.png
similarity index 100%
rename from data/scene/lodglobes/arrows.png
rename to data/scene/common/textures/arrows.png
diff --git a/data/scene/constellationbounds/constellationbounds.mod b/data/scene/constellationbounds/constellationbounds.mod
index beb1295d26..fe5e3b2122 100644
--- a/data/scene/constellationbounds/constellationbounds.mod
+++ b/data/scene/constellationbounds/constellationbounds.mod
@@ -1,3 +1,8 @@
+local zodiacs = {
+ "Cancer", "Taurus", "Pisces", "Aries", "Libra", "Aquarius", "Capricornus", "Scorpius",
+ "Virgo", "Sagittarius", "Gemini", "Leo"
+}
+
return {
-- Stars module
{
@@ -6,7 +11,8 @@ return {
Renderable = {
Type = "RenderableConstellationBounds",
File = "${OPENSPACE_DATA}/scene/constellationbounds/data/bound_20.dat",
- ConstellationFile = "${OPENSPACE_DATA}/scene/constellationbounds/data/constellations.dat"
+ ConstellationFile = "${OPENSPACE_DATA}/scene/constellationbounds/data/constellations.dat",
+ -- ConstellationSelection = zodiacs
},
Transform = {
Rotation = {
diff --git a/data/scene/dawn.scene b/data/scene/dawn.scene
index a18bf0c916..6dddbc93fd 100644
--- a/data/scene/dawn.scene
+++ b/data/scene/dawn.scene
@@ -51,8 +51,10 @@ return {
"uranus",
"neptune",
"pluto",
- "stars",
- "milkyway",
+ "stars/digitaluniverse",
+ -- "stars/denver",
+ "milkyway/digitaluniverse",
+ --"milkyway/eso",
"missions/dawn"
}
}
diff --git a/data/scene/default.scene b/data/scene/default.scene
index b887f7de54..48cb27dc77 100644
--- a/data/scene/default.scene
+++ b/data/scene/default.scene
@@ -1,3 +1,8 @@
+-- Add folders to this list that contain .info files describing HiRISE patches
+local mars_folders = {
+ -- Add a folder here whose contents will be automatically added to the Mars globe
+}
+
function preInitialization()
--[[
The scripts in this function are executed after the scene is loaded but before the
@@ -11,35 +16,76 @@ function preInitialization()
openspace.time.setTime(openspace.time.currentWallTime())
dofile(openspace.absPath('${SCRIPTS}/bind_common_keys.lua'))
+
+
+ -- Toggle night texture, shading, atmosphere and water
+ openspace.bindKey("s",
+ helper.property.invert('Earth.RenderableGlobe.Layers.NightLayers.Earth at Night 2012.Enabled') ..
+ helper.property.invert('Earth.RenderableGlobe.PerformShading') ..
+ helper.property.invert('Earth.RenderableGlobe.Atmosphere') ..
+ helper.property.invert('Earth.RenderableGlobe.Layers.WaterMasks.MODIS_Water_Mask.Enabled'),
+ "Toggle night texture, shading, atmosphere, and water for Earth."
+ )
+
+ -- Toggle background
+ openspace.bindKey("b",
+ helper.property.invert('MilkyWay.renderable.Enabled') ..
+ helper.property.invert('Stars.renderable.Enabled'),
+ "Toggle background (Stars and Milkyway)."
+ )
+
+ openspace.bindKey("g",
+ helper.property.invert('MilkyWay.renderable.Enabled') ..
+ helper.property.invert('Stars.renderable.Enabled') ..
+ helper.property.invert('Earth.RenderableGlobe.Layers.NightLayers.Earth at Night 2012.Enabled') ..
+ helper.property.invert('Earth.RenderableGlobe.PerformShading') ..
+ helper.property.invert('Mars.RenderableGlobe.PerformShading') ..
+ helper.property.invert('Earth.RenderableGlobe.Atmosphere') ..
+ helper.property.invert('Earth.RenderableGlobe.Layers.WaterMasks.MODIS_Water_Mask.Enabled') ..
+ helper.property.invert('Moon.RenderableGlobe.Enabled') ..
+ helper.property.invert('Sun.renderable.Enabled'),
+ "Toogles background and shading mode on the Earth and Mars alongside visibility of the Moon and the Sun"
+ )
+
+ openspace.bindKey("h",
+ "openspace.setPropertyValue('*Trail.renderable.Enabled', false)",
+ "Disables visibility of the trails"
+ )
end
function postInitialization()
- --[[
- The scripts in this function are executed after all objects in the scene have been
- created and initialized, but before the first render call. This is the place to set
- graphical settings for the renderables.
- ]]--
- openspace.printInfo("Setting default values")
- openspace.setPropertyValue("SunMarker.renderable.Enabled", false)
- openspace.setPropertyValue("EarthMarker.renderable.Enabled", false)
- openspace.setPropertyValue("Constellation Bounds.renderable.Enabled", false)
-
- openspace.setPropertyValue("MilkyWay.renderable.Transparency", 0.55)
- openspace.setPropertyValue("MilkyWay.renderable.Segments", 50)
-
openspace.addVirtualProperty(
"BoolProperty",
"Show Trails",
- "*Trail.renderable.enabled",
+ "*Trail.renderable.Enabled",
"Disable or enable all trails of the scene at the same time",
true,
nil,
nil
)
- openspace.navigation.resetCameraDirection()
+ openspace.printInfo("Setting default values")
+
+ openspace.setPropertyValue("SunGlare.renderable.Enabled", false)
+ openspace.setPropertyValue("SunMarker.renderable.Enabled", false)
+
+ openspace.setPropertyValue("Constellation Bounds.renderable.Enabled", false)
+
+ openspace.setPropertyValue("Earth.RenderableGlobe.Atmosphere", true)
+ openspace.setPropertyValue("Earth.RenderableGlobe.Debug.LevelByProjectedAreaElseDistance", false)
+
+ openspace.setPropertyValue("Ecliptic Grid.renderable.Enabled", false)
+ openspace.setPropertyValue("Equatorial Grid.renderable.Enabled", false)
+ openspace.setPropertyValue("Galactic Grid.renderable.Enabled", false)
+
+ openspace.globebrowsing.goToGeo(58.5877, 16.1924, 20000000)
openspace.printInfo("Done setting default values")
+
+ -- Add the HiRISE patches described at the top of this file
+ for _, file in pairs(mars_folders) do
+ openspace.globebrowsing.addBlendingLayersFromDirectory(file, "Mars")
+ end
end
@@ -48,23 +94,27 @@ return {
CommonFolder = "common",
Camera = {
Focus = "Earth",
- Position = {505370268486.696167, 1089706179272.719116, -890259148524.319458},
- Rotation = {0.250635, -0.028751, 0.879269, 0.404030},
+ Position = {0, 0, 0},
+ Rotation = {0.758797, 0.221490, -0.605693, -0.091135},
},
Modules = {
"sun",
"mercury",
"venus",
"earth",
+ "moon",
"mars",
"jupiter",
"saturn",
"uranus",
"neptune",
- "stars",
- -- "stars-denver",
- "milkyway",
- --"milkyway-eso",
+ "stars/digitaluniverse",
+ -- "stars/denver",
+ "milkyway/digitaluniverse",
+ --"milkyway/eso",
+ -- "satellites"
"constellationbounds",
+ "grids"
}
}
+
diff --git a/data/scene/batsrus/batsrus.mod b/data/scene/deprecated/batsrus/batsrus.mod
similarity index 100%
rename from data/scene/batsrus/batsrus.mod
rename to data/scene/deprecated/batsrus/batsrus.mod
diff --git a/data/scene/batsrus/psampler.glsl b/data/scene/deprecated/batsrus/psampler.glsl
similarity index 100%
rename from data/scene/batsrus/psampler.glsl
rename to data/scene/deprecated/batsrus/psampler.glsl
diff --git a/data/scene/batsrus/rhosampler.glsl b/data/scene/deprecated/batsrus/rhosampler.glsl
similarity index 100%
rename from data/scene/batsrus/rhosampler.glsl
rename to data/scene/deprecated/batsrus/rhosampler.glsl
diff --git a/data/scene/batsrus/transferfunctions/p.txt b/data/scene/deprecated/batsrus/transferfunctions/p.txt
similarity index 100%
rename from data/scene/batsrus/transferfunctions/p.txt
rename to data/scene/deprecated/batsrus/transferfunctions/p.txt
diff --git a/data/scene/batsrus/transferfunctions/rho.txt b/data/scene/deprecated/batsrus/transferfunctions/rho.txt
similarity index 100%
rename from data/scene/batsrus/transferfunctions/rho.txt
rename to data/scene/deprecated/batsrus/transferfunctions/rho.txt
diff --git a/data/scene/enlil/enlil.cl b/data/scene/deprecated/enlil/enlil.cl
similarity index 100%
rename from data/scene/enlil/enlil.cl
rename to data/scene/deprecated/enlil/enlil.cl
diff --git a/data/scene/enlil/enlil.mod b/data/scene/deprecated/enlil/enlil.mod
similarity index 100%
rename from data/scene/enlil/enlil.mod
rename to data/scene/deprecated/enlil/enlil.mod
diff --git a/data/scene/enlil/sampler.glsl b/data/scene/deprecated/enlil/sampler.glsl
similarity index 100%
rename from data/scene/enlil/sampler.glsl
rename to data/scene/deprecated/enlil/sampler.glsl
diff --git a/data/scene/enlil/transferfunctions/t1.txt b/data/scene/deprecated/enlil/transferfunctions/t1.txt
similarity index 100%
rename from data/scene/enlil/transferfunctions/t1.txt
rename to data/scene/deprecated/enlil/transferfunctions/t1.txt
diff --git a/data/scene/enlil/transferfunctions/t2.txt b/data/scene/deprecated/enlil/transferfunctions/t2.txt
similarity index 100%
rename from data/scene/enlil/transferfunctions/t2.txt
rename to data/scene/deprecated/enlil/transferfunctions/t2.txt
diff --git a/data/scene/enlilnh/enlilnh.mod b/data/scene/deprecated/enlilnh/enlilnh.mod
similarity index 100%
rename from data/scene/enlilnh/enlilnh.mod
rename to data/scene/deprecated/enlilnh/enlilnh.mod
diff --git a/data/scene/enlilnh/transferfunctions/fire.txt b/data/scene/deprecated/enlilnh/transferfunctions/fire.txt
similarity index 100%
rename from data/scene/enlilnh/transferfunctions/fire.txt
rename to data/scene/deprecated/enlilnh/transferfunctions/fire.txt
diff --git a/data/scene/flare/TSPTraversal_cs.glsl b/data/scene/deprecated/flare/TSPTraversal_cs.glsl
similarity index 100%
rename from data/scene/flare/TSPTraversal_cs.glsl
rename to data/scene/deprecated/flare/TSPTraversal_cs.glsl
diff --git a/data/scene/flare/TSPTraversal_fs.glsl b/data/scene/deprecated/flare/TSPTraversal_fs.glsl
similarity index 100%
rename from data/scene/flare/TSPTraversal_fs.glsl
rename to data/scene/deprecated/flare/TSPTraversal_fs.glsl
diff --git a/data/scene/flare/fire.txt b/data/scene/deprecated/flare/fire.txt
similarity index 100%
rename from data/scene/flare/fire.txt
rename to data/scene/deprecated/flare/fire.txt
diff --git a/data/scene/flare/flare.mod b/data/scene/deprecated/flare/flare.mod
similarity index 100%
rename from data/scene/flare/flare.mod
rename to data/scene/deprecated/flare/flare.mod
diff --git a/data/scene/flare/helpers_cs.hglsl b/data/scene/deprecated/flare/helpers_cs.hglsl
similarity index 100%
rename from data/scene/flare/helpers_cs.hglsl
rename to data/scene/deprecated/flare/helpers_cs.hglsl
diff --git a/data/scene/flare/passthrough_vs.glsl b/data/scene/deprecated/flare/passthrough_vs.glsl
similarity index 100%
rename from data/scene/flare/passthrough_vs.glsl
rename to data/scene/deprecated/flare/passthrough_vs.glsl
diff --git a/data/scene/flare/raycasterTSP_cs.glsl b/data/scene/deprecated/flare/raycasterTSP_cs.glsl
similarity index 100%
rename from data/scene/flare/raycasterTSP_cs.glsl
rename to data/scene/deprecated/flare/raycasterTSP_cs.glsl
diff --git a/data/scene/flare/raycasterTSP_fs.glsl b/data/scene/deprecated/flare/raycasterTSP_fs.glsl
similarity index 100%
rename from data/scene/flare/raycasterTSP_fs.glsl
rename to data/scene/deprecated/flare/raycasterTSP_fs.glsl
diff --git a/data/scene/iswa/cdf/fieldlines.json b/data/scene/deprecated/iswa/cdf/fieldlines.json
similarity index 100%
rename from data/scene/iswa/cdf/fieldlines.json
rename to data/scene/deprecated/iswa/cdf/fieldlines.json
diff --git a/data/scene/iswa/tfs/autumn.tf b/data/scene/deprecated/iswa/tfs/autumn.tf
similarity index 100%
rename from data/scene/iswa/tfs/autumn.tf
rename to data/scene/deprecated/iswa/tfs/autumn.tf
diff --git a/data/scene/iswa/tfs/blue.jpg b/data/scene/deprecated/iswa/tfs/blue.jpg
similarity index 100%
rename from data/scene/iswa/tfs/blue.jpg
rename to data/scene/deprecated/iswa/tfs/blue.jpg
diff --git a/data/scene/iswa/tfs/ccmc-cdf.tf b/data/scene/deprecated/iswa/tfs/ccmc-cdf.tf
similarity index 100%
rename from data/scene/iswa/tfs/ccmc-cdf.tf
rename to data/scene/deprecated/iswa/tfs/ccmc-cdf.tf
diff --git a/data/scene/iswa/tfs/colormap_autumn.png b/data/scene/deprecated/iswa/tfs/colormap_autumn.png
similarity index 100%
rename from data/scene/iswa/tfs/colormap_autumn.png
rename to data/scene/deprecated/iswa/tfs/colormap_autumn.png
diff --git a/data/scene/iswa/tfs/colormap_hot.jpg b/data/scene/deprecated/iswa/tfs/colormap_hot.jpg
similarity index 100%
rename from data/scene/iswa/tfs/colormap_hot.jpg
rename to data/scene/deprecated/iswa/tfs/colormap_hot.jpg
diff --git a/data/scene/iswa/tfs/colormap_hot.png b/data/scene/deprecated/iswa/tfs/colormap_hot.png
similarity index 100%
rename from data/scene/iswa/tfs/colormap_hot.png
rename to data/scene/deprecated/iswa/tfs/colormap_hot.png
diff --git a/data/scene/iswa/tfs/colormap_parula.jpg b/data/scene/deprecated/iswa/tfs/colormap_parula.jpg
similarity index 100%
rename from data/scene/iswa/tfs/colormap_parula.jpg
rename to data/scene/deprecated/iswa/tfs/colormap_parula.jpg
diff --git a/data/scene/iswa/tfs/colormap_parula.png b/data/scene/deprecated/iswa/tfs/colormap_parula.png
similarity index 100%
rename from data/scene/iswa/tfs/colormap_parula.png
rename to data/scene/deprecated/iswa/tfs/colormap_parula.png
diff --git a/data/scene/iswa/tfs/default.tf b/data/scene/deprecated/iswa/tfs/default.tf
similarity index 100%
rename from data/scene/iswa/tfs/default.tf
rename to data/scene/deprecated/iswa/tfs/default.tf
diff --git a/data/scene/iswa/tfs/green.jpg b/data/scene/deprecated/iswa/tfs/green.jpg
similarity index 100%
rename from data/scene/iswa/tfs/green.jpg
rename to data/scene/deprecated/iswa/tfs/green.jpg
diff --git a/data/scene/iswa/tfs/hot.tf b/data/scene/deprecated/iswa/tfs/hot.tf
similarity index 100%
rename from data/scene/iswa/tfs/hot.tf
rename to data/scene/deprecated/iswa/tfs/hot.tf
diff --git a/data/scene/iswa/tfs/parula.tf b/data/scene/deprecated/iswa/tfs/parula.tf
similarity index 100%
rename from data/scene/iswa/tfs/parula.tf
rename to data/scene/deprecated/iswa/tfs/parula.tf
diff --git a/data/scene/iswa/tfs/red.jpg b/data/scene/deprecated/iswa/tfs/red.jpg
similarity index 100%
rename from data/scene/iswa/tfs/red.jpg
rename to data/scene/deprecated/iswa/tfs/red.jpg
diff --git a/data/scene/iswa/tfs/rgb.tf b/data/scene/deprecated/iswa/tfs/rgb.tf
similarity index 100%
rename from data/scene/iswa/tfs/rgb.tf
rename to data/scene/deprecated/iswa/tfs/rgb.tf
diff --git a/data/scene/earth/earth.data b/data/scene/earth/earth.data
deleted file mode 100644
index e168d4c8be..0000000000
--- a/data/scene/earth/earth.data
+++ /dev/null
@@ -1,5 +0,0 @@
-return {
- FileRequest = {
- { Identifier = "earth_textures", Destination = "textures", Version = 2 }
- },
-}
diff --git a/data/scene/earth/earth.mod b/data/scene/earth/earth.mod
index 3e293f6f3d..da1de19a55 100644
--- a/data/scene/earth/earth.mod
+++ b/data/scene/earth/earth.mod
@@ -1,3 +1,4 @@
+earthEllipsoid = {6378137.0, 6378137.0, 6356752.314245} -- Earth's radii
return {
-- Earth barycenter module
{
@@ -6,7 +7,7 @@ return {
Transform = {
Translation = {
Type = "SpiceTranslation",
- Body = "EARTH",
+ Target = "EARTH",
Observer = "SUN",
Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp"
}
@@ -20,58 +21,19 @@ return {
Rotation = {
Type = "SpiceRotation",
SourceFrame = "J2000",
- DestinationFrame = "GALACTIC",
+ DestinationFrame = "GALACTIC"
}
- },
- },
- -- Earth module
- {
- Name = "Earth",
- Parent = "EarthBarycenter",
- Renderable = {
- Type = "RenderablePlanet",
- Frame = "IAU_EARTH",
- Body = "EARTH",
- Geometry = {
- Type = "SimpleSphere",
- Radius = 6.371E6,
- Segments = 100
- },
- Textures = {
- Type = "simple",
- Color = "textures/earth_bluemarble.jpg",
- Night = "textures/earth_night.jpg",
- Height = "textures/earth_bluemarble_height.jpg"
- },
- Atmosphere = {
- Type = "Nishita", -- for example, values missing etc etc
- MieFactor = 1.0,
- MieColor = {1.0, 1.0, 1.0}
- }
- },
- Tag = {"planet_solarSystem", "planet_terrestrial"},
- Transform = {
- Rotation = {
- Type = "SpiceRotation",
- SourceFrame = "IAU_EARTH",
- DestinationFrame = "GALACTIC",
- },
- Scale = {
- Type = "StaticScale",
- Scale = 1,
- },
- },
- GuiName = "/Solar/Planets/Earth"
+ }
},
-- EarthTrail module
- {
+ {
Name = "EarthTrail",
Parent = "SolarSystemBarycenter",
Renderable = {
Type = "RenderableTrailOrbit",
Translation = {
Type = "SpiceTranslation",
- Body = "EARTH",
+ Target = "EARTH",
Observer = "SUN"
},
Color = { 0.5, 0.8, 1.0 },
@@ -79,27 +41,154 @@ return {
-- EndTime = "2017 JAN 01 12:00:00.000",
-- SampleInterval = 3600
Period = 365.242,
- Resolution = 1000,
- Tag = {"planetTrail_solarSystem", "planetTrail_terrestrial"}
+ Resolution = 1000
},
- GuiName = "/Solar/EarthTrail",
+ Tag = { "planetTrail_solarSystem", "planetTrail_terrestrial" },
+ GuiName = "/Solar/EarthTrail"
},
- --[[
+ -- RenderableGlobe module
{
- Name = "EarthMarker",
- Parent = "Earth",
- Renderable = {
- Type = "RenderablePlane",
- Size = 3.0E11,
- Origin = "Center",
- Billboard = true,
- Texture = "textures/marker.png",
- BlendMode = "Additive"
+ Name = "Earth",
+ Parent = "EarthBarycenter",
+ Transform = {
+ Rotation = {
+ Type = "SpiceRotation",
+ SourceFrame = "IAU_EARTH",
+ DestinationFrame = "GALACTIC",
+ }
},
- Ephemeris = {
- Type = "Static",
- Position = {0, 0, 0, 5}
+ Tag = { "planet_solarSystem", "planet_terrestrial" },
+ Renderable = {
+ Type = "RenderableGlobe",
+ Radii = earthEllipsoid,
+ SegmentsPerPatch = 64,
+ Layers = {
+ ColorLayers = {
+ {
+ Name = "ESRI VIIRS Combo",
+ Type = "ByLevelTileLayer",
+ LevelTileProviders = {
+ {
+ MaxLevel = 3,
+ TileProvider = {
+ Name = "Temporal VIIRS SNPP",
+ Type = "TemporalTileLayer",
+ FilePath = "map_service_configs/GIBS/Temporal_VIIRS_SNPP_CorrectedReflectance_TrueColor.xml",
+ }
+ },
+ {
+ MaxLevel = 22,
+ TileProvider = {
+ Name = "ESRI Imagery World 2D",
+ FilePath = "map_service_configs/ESRI/ESRI_Imagery_World_2D.wms"
+ }
+ },
+ },
+ Enabled = true,
+ },
+ {
+ Name = "ESRI Imagery World 2D",
+ FilePath = "map_service_configs/ESRI/ESRI_Imagery_World_2D.wms",
+ },
+ {
+ Name = "Temporal VIIRS SNPP",
+ Type = "TemporalTileLayer",
+ FilePath = "map_service_configs/GIBS/Temporal_VIIRS_SNPP_CorrectedReflectance_TrueColor.xml",
+ },
+ {
+ Name = "BMNG",
+ FilePath = "map_service_configs/Utah/Bmng.wms"
+ },
+ {
+ Name = "Temporal_AMSR2_GCOM_W1_Sea_Ice_Concentration",
+ Type = "TemporalTileLayer",
+ FilePath = "map_service_configs/GIBS/Temporal_AMSR2_GCOM_W1_Sea_Ice_Concentration.xml",
+ },
+ {
+ Name = "MODIS_Terra_Chlorophyll_A",
+ Type = "TemporalTileLayer",
+ FilePath = openspace.globebrowsing.createTemporalGibsGdalXml(
+ "MODIS_Terra_Chlorophyll_A",
+ "2013-07-02",
+ "Yesterday",
+ "1d",
+ "1km",
+ "png"
+ )
+ },
+ {
+ Name = "GHRSST_L4_G1SST_Sea_Surface_Temperature",
+ Type = "TemporalTileLayer",
+ FilePath = openspace.globebrowsing.createTemporalGibsGdalXml(
+ "GHRSST_L4_G1SST_Sea_Surface_Temperature",
+ "2010-06-21",
+ "Yesterday",
+ "1d",
+ "1km",
+ "png"
+ )
+ },
+ },
+ NightLayers = {
+ {
+ Name = "Earth at Night 2012",
+ FilePath = "map_service_configs/GIBS/VIIRS_CityLights_2012.xml",
+ Enabled = true,
+ Settings = {
+ Opacity = 1.0,
+ Gamma = 1.5,
+ Multiplier = 15.0,
+ },
+ },
+ {
+ Name = "Temporal Earth at Night",
+ Type = "TemporalTileLayer",
+ FilePath = "map_service_configs/GIBS/Temporal_VIIRS_SNPP_DayNightBand_ENCC.xml"
+ }
+ },
+ WaterMasks = {
+ {
+ Name = "MODIS_Water_Mask",
+ FilePath = "map_service_configs/GIBS/MODIS_Water_Mask.xml",
+ Enabled = true,
+ },
+ {
+ Name = "GEBCO",
+ FilePath = "map_service_configs/Utah/Gebco.wms",
+ }
+ },
+ Overlays = {
+ {
+ Name = "Coastlines",
+ FilePath = "map_service_configs/GIBS/Coastlines.xml",
+ },
+ {
+ Name = "Reference_Features",
+ FilePath = "map_service_configs/GIBS/Reference_Features.xml",
+ },
+ {
+ Name = "Reference_Labels",
+ FilePath = "map_service_configs/GIBS/Reference_Labels.xml",
+ },
+ {
+ Name = "Tile Indices",
+ Type = "TileIndexTileLayer",
+ },
+ {
+ Name = "Size Reference",
+ Type = "SizeReferenceTileLayer",
+ Radii = earthEllipsoid,
+ },
+ },
+ HeightLayers = {
+ {
+ Name = "Terrain tileset",
+ FilePath = "map_service_configs/ESRI/TERRAIN.wms",
+ Enabled = true,
+ TilePixelSize = 64,
+ }
+ }
+ }
}
}
- ]]
}
diff --git a/data/scene/lodglobes/earth/map_service_configs/ESRI/ESRI_Imagery_World_2D.wms b/data/scene/earth/map_service_configs/ESRI/ESRI_Imagery_World_2D.wms
similarity index 100%
rename from data/scene/lodglobes/earth/map_service_configs/ESRI/ESRI_Imagery_World_2D.wms
rename to data/scene/earth/map_service_configs/ESRI/ESRI_Imagery_World_2D.wms
diff --git a/data/scene/lodglobes/earth/map_service_configs/ESRI/TERRAIN.wms b/data/scene/earth/map_service_configs/ESRI/TERRAIN.wms
similarity index 100%
rename from data/scene/lodglobes/earth/map_service_configs/ESRI/TERRAIN.wms
rename to data/scene/earth/map_service_configs/ESRI/TERRAIN.wms
diff --git a/data/scene/lodglobes/earth/map_service_configs/GIBS/Coastlines.xml b/data/scene/earth/map_service_configs/GIBS/Coastlines.xml
similarity index 100%
rename from data/scene/lodglobes/earth/map_service_configs/GIBS/Coastlines.xml
rename to data/scene/earth/map_service_configs/GIBS/Coastlines.xml
diff --git a/data/scene/lodglobes/earth/map_service_configs/GIBS/GIBS_Aqua_MODIS_true.xml b/data/scene/earth/map_service_configs/GIBS/GIBS_Aqua_MODIS_true.xml
similarity index 100%
rename from data/scene/lodglobes/earth/map_service_configs/GIBS/GIBS_Aqua_MODIS_true.xml
rename to data/scene/earth/map_service_configs/GIBS/GIBS_Aqua_MODIS_true.xml
diff --git a/data/scene/lodglobes/earth/map_service_configs/GIBS/MODIS_Terra_Brightness_Temp_Band31_Day.xml b/data/scene/earth/map_service_configs/GIBS/MODIS_Terra_Brightness_Temp_Band31_Day.xml
similarity index 100%
rename from data/scene/lodglobes/earth/map_service_configs/GIBS/MODIS_Terra_Brightness_Temp_Band31_Day.xml
rename to data/scene/earth/map_service_configs/GIBS/MODIS_Terra_Brightness_Temp_Band31_Day.xml
diff --git a/data/scene/lodglobes/earth/map_service_configs/GIBS/MODIS_Terra_CorrectedReflectance_TrueColor.xml b/data/scene/earth/map_service_configs/GIBS/MODIS_Terra_CorrectedReflectance_TrueColor.xml
similarity index 100%
rename from data/scene/lodglobes/earth/map_service_configs/GIBS/MODIS_Terra_CorrectedReflectance_TrueColor.xml
rename to data/scene/earth/map_service_configs/GIBS/MODIS_Terra_CorrectedReflectance_TrueColor.xml
diff --git a/data/scene/lodglobes/earth/map_service_configs/GIBS/MODIS_Water_Mask.xml b/data/scene/earth/map_service_configs/GIBS/MODIS_Water_Mask.xml
similarity index 100%
rename from data/scene/lodglobes/earth/map_service_configs/GIBS/MODIS_Water_Mask.xml
rename to data/scene/earth/map_service_configs/GIBS/MODIS_Water_Mask.xml
diff --git a/data/scene/lodglobes/earth/map_service_configs/GIBS/Reference_Features.xml b/data/scene/earth/map_service_configs/GIBS/Reference_Features.xml
similarity index 100%
rename from data/scene/lodglobes/earth/map_service_configs/GIBS/Reference_Features.xml
rename to data/scene/earth/map_service_configs/GIBS/Reference_Features.xml
diff --git a/data/scene/lodglobes/earth/map_service_configs/GIBS/Reference_Labels.xml b/data/scene/earth/map_service_configs/GIBS/Reference_Labels.xml
similarity index 100%
rename from data/scene/lodglobes/earth/map_service_configs/GIBS/Reference_Labels.xml
rename to data/scene/earth/map_service_configs/GIBS/Reference_Labels.xml
diff --git a/data/scene/lodglobes/earth/map_service_configs/GIBS/TERRA_CR_B143_2016-04-12.wms b/data/scene/earth/map_service_configs/GIBS/TERRA_CR_B143_2016-04-12.wms
similarity index 100%
rename from data/scene/lodglobes/earth/map_service_configs/GIBS/TERRA_CR_B143_2016-04-12.wms
rename to data/scene/earth/map_service_configs/GIBS/TERRA_CR_B143_2016-04-12.wms
diff --git a/data/scene/lodglobes/earth/map_service_configs/GIBS/Temporal_AMSR2_GCOM_W1_Sea_Ice_Concentration.xml b/data/scene/earth/map_service_configs/GIBS/Temporal_AMSR2_GCOM_W1_Sea_Ice_Concentration.xml
similarity index 100%
rename from data/scene/lodglobes/earth/map_service_configs/GIBS/Temporal_AMSR2_GCOM_W1_Sea_Ice_Concentration.xml
rename to data/scene/earth/map_service_configs/GIBS/Temporal_AMSR2_GCOM_W1_Sea_Ice_Concentration.xml
diff --git a/data/scene/lodglobes/earth/map_service_configs/GIBS/Temporal_Aqua_Orbit_Asc.xml b/data/scene/earth/map_service_configs/GIBS/Temporal_Aqua_Orbit_Asc.xml
similarity index 100%
rename from data/scene/lodglobes/earth/map_service_configs/GIBS/Temporal_Aqua_Orbit_Asc.xml
rename to data/scene/earth/map_service_configs/GIBS/Temporal_Aqua_Orbit_Asc.xml
diff --git a/data/scene/lodglobes/earth/map_service_configs/GIBS/Temporal_GHRSST_L4_MUR_Sea_Surface_Temperature.xml b/data/scene/earth/map_service_configs/GIBS/Temporal_GHRSST_L4_MUR_Sea_Surface_Temperature.xml
similarity index 100%
rename from data/scene/lodglobes/earth/map_service_configs/GIBS/Temporal_GHRSST_L4_MUR_Sea_Surface_Temperature.xml
rename to data/scene/earth/map_service_configs/GIBS/Temporal_GHRSST_L4_MUR_Sea_Surface_Temperature.xml
diff --git a/data/scene/lodglobes/earth/map_service_configs/GIBS/Temporal_MODIS_Aqua_CorrectedReflectance_TrueColor.xml b/data/scene/earth/map_service_configs/GIBS/Temporal_MODIS_Aqua_CorrectedReflectance_TrueColor.xml
similarity index 100%
rename from data/scene/lodglobes/earth/map_service_configs/GIBS/Temporal_MODIS_Aqua_CorrectedReflectance_TrueColor.xml
rename to data/scene/earth/map_service_configs/GIBS/Temporal_MODIS_Aqua_CorrectedReflectance_TrueColor.xml
diff --git a/data/scene/lodglobes/earth/map_service_configs/GIBS/Temporal_MODIS_Terra_CorrectedReflectance_TrueColor.xml b/data/scene/earth/map_service_configs/GIBS/Temporal_MODIS_Terra_CorrectedReflectance_TrueColor.xml
similarity index 100%
rename from data/scene/lodglobes/earth/map_service_configs/GIBS/Temporal_MODIS_Terra_CorrectedReflectance_TrueColor.xml
rename to data/scene/earth/map_service_configs/GIBS/Temporal_MODIS_Terra_CorrectedReflectance_TrueColor.xml
diff --git a/data/scene/lodglobes/earth/map_service_configs/GIBS/Temporal_VIIRS_SNPP_CorrectedReflectance_TrueColor.xml b/data/scene/earth/map_service_configs/GIBS/Temporal_VIIRS_SNPP_CorrectedReflectance_TrueColor.xml
similarity index 100%
rename from data/scene/lodglobes/earth/map_service_configs/GIBS/Temporal_VIIRS_SNPP_CorrectedReflectance_TrueColor.xml
rename to data/scene/earth/map_service_configs/GIBS/Temporal_VIIRS_SNPP_CorrectedReflectance_TrueColor.xml
diff --git a/data/scene/lodglobes/earth/map_service_configs/GIBS/Temporal_VIIRS_SNPP_DayNightBand_ENCC.xml b/data/scene/earth/map_service_configs/GIBS/Temporal_VIIRS_SNPP_DayNightBand_ENCC.xml
similarity index 100%
rename from data/scene/lodglobes/earth/map_service_configs/GIBS/Temporal_VIIRS_SNPP_DayNightBand_ENCC.xml
rename to data/scene/earth/map_service_configs/GIBS/Temporal_VIIRS_SNPP_DayNightBand_ENCC.xml
diff --git a/data/scene/lodglobes/earth/map_service_configs/GIBS/VIIRS_CityLights_2012.xml b/data/scene/earth/map_service_configs/GIBS/VIIRS_CityLights_2012.xml
similarity index 100%
rename from data/scene/lodglobes/earth/map_service_configs/GIBS/VIIRS_CityLights_2012.xml
rename to data/scene/earth/map_service_configs/GIBS/VIIRS_CityLights_2012.xml
diff --git a/data/scene/lodglobes/earth/map_service_configs/GIBS/VIIRS_SNPP_CorrectedReflectance_TrueColor.xml b/data/scene/earth/map_service_configs/GIBS/VIIRS_SNPP_CorrectedReflectance_TrueColor.xml
similarity index 100%
rename from data/scene/lodglobes/earth/map_service_configs/GIBS/VIIRS_SNPP_CorrectedReflectance_TrueColor.xml
rename to data/scene/earth/map_service_configs/GIBS/VIIRS_SNPP_CorrectedReflectance_TrueColor.xml
diff --git a/data/scene/lodglobes/earth/map_service_configs/Utah/Bmng.wms b/data/scene/earth/map_service_configs/Utah/Bmng.wms
similarity index 100%
rename from data/scene/lodglobes/earth/map_service_configs/Utah/Bmng.wms
rename to data/scene/earth/map_service_configs/Utah/Bmng.wms
diff --git a/data/scene/lodglobes/earth/map_service_configs/Utah/Gebco.wms b/data/scene/earth/map_service_configs/Utah/Gebco.wms
similarity index 100%
rename from data/scene/lodglobes/earth/map_service_configs/Utah/Gebco.wms
rename to data/scene/earth/map_service_configs/Utah/Gebco.wms
diff --git a/data/scene/lodglobes/earth/map_service_configs/other/ASTER_GDEM_Greyscale_Shaded_Relief.xml b/data/scene/earth/map_service_configs/other/ASTER_GDEM_Greyscale_Shaded_Relief.xml
similarity index 100%
rename from data/scene/lodglobes/earth/map_service_configs/other/ASTER_GDEM_Greyscale_Shaded_Relief.xml
rename to data/scene/earth/map_service_configs/other/ASTER_GDEM_Greyscale_Shaded_Relief.xml
diff --git a/data/scene/lodglobes/earth/map_service_configs/other/Landsat_WELD_CorrectedReflectance_TrueColor_Global_Monthly_v3_STD_temporal.xml b/data/scene/earth/map_service_configs/other/Landsat_WELD_CorrectedReflectance_TrueColor_Global_Monthly_v3_STD_temporal.xml
similarity index 100%
rename from data/scene/lodglobes/earth/map_service_configs/other/Landsat_WELD_CorrectedReflectance_TrueColor_Global_Monthly_v3_STD_temporal.xml
rename to data/scene/earth/map_service_configs/other/Landsat_WELD_CorrectedReflectance_TrueColor_Global_Monthly_v3_STD_temporal.xml
diff --git a/data/scene/lodglobes/earth/map_service_configs/other/MLS_O3_46hPa_Day.xml b/data/scene/earth/map_service_configs/other/MLS_O3_46hPa_Day.xml
similarity index 100%
rename from data/scene/lodglobes/earth/map_service_configs/other/MLS_O3_46hPa_Day.xml
rename to data/scene/earth/map_service_configs/other/MLS_O3_46hPa_Day.xml
diff --git a/data/scene/lodglobes/earth/map_service_configs/other/OpenStreetMap.xml b/data/scene/earth/map_service_configs/other/OpenStreetMap.xml
similarity index 100%
rename from data/scene/lodglobes/earth/map_service_configs/other/OpenStreetMap.xml
rename to data/scene/earth/map_service_configs/other/OpenStreetMap.xml
diff --git a/data/scene/lodglobes/earth/map_service_configs/other/frmt_wms_virtualearth.xml b/data/scene/earth/map_service_configs/other/frmt_wms_virtualearth.xml
similarity index 100%
rename from data/scene/lodglobes/earth/map_service_configs/other/frmt_wms_virtualearth.xml
rename to data/scene/earth/map_service_configs/other/frmt_wms_virtualearth.xml
diff --git a/data/scene/lodglobes/earth/map_service_configs/other/noaa_rt.xml b/data/scene/earth/map_service_configs/other/noaa_rt.xml
similarity index 100%
rename from data/scene/lodglobes/earth/map_service_configs/other/noaa_rt.xml
rename to data/scene/earth/map_service_configs/other/noaa_rt.xml
diff --git a/data/scene/lodglobes/earth/map_service_configs/other/test.wms b/data/scene/earth/map_service_configs/other/test.wms
similarity index 100%
rename from data/scene/lodglobes/earth/map_service_configs/other/test.wms
rename to data/scene/earth/map_service_configs/other/test.wms
diff --git a/data/scene/fieldlines.scene b/data/scene/fieldlines.scene
index b4936dc5d4..2a9da28b7c 100644
--- a/data/scene/fieldlines.scene
+++ b/data/scene/fieldlines.scene
@@ -49,11 +49,11 @@ return {
"saturn",
"uranus",
"neptune",
- "stars",
"fieldlines",
- -- "stars-denver",
- "milkyway",
- -- "milkyway-eso",
+ "stars/digitaluniverse",
+ -- "stars/denver",
+ "milkyway/digitaluniverse",
+ --"milkyway/eso",
"constellationbounds",
}
}
diff --git a/data/scene/globebrowsing.scene b/data/scene/globebrowsing.scene
deleted file mode 100644
index 96ff9c3df9..0000000000
--- a/data/scene/globebrowsing.scene
+++ /dev/null
@@ -1,93 +0,0 @@
-function preInitialization()
- --[[
- The scripts in this function are executed after the scene is loaded but before the
- scene elements have been initialized, thus they should be used to set the time at
- which the scene should start and other settings that might determine initialization
- critical objects.
- ]]--
-
- openspace.spice.loadKernel("${SPICE}/naif0012.tls")
- openspace.spice.loadKernel("${SPICE}/pck00010.tpc")
-
- -- For unit test
- --openspace.time.setTime("2016 SEP 8 23:00:00.500")
- --openspace.time.togglePause()
-
- openspace.time.setTime(openspace.time.currentWallTime())
- dofile(openspace.absPath('${SCRIPTS}/bind_common_keys.lua'))
-
-
- -- Toggle night texture, shading, atmosphere and water
- openspace.bindKey("s",
- helper.property.invert('Earth.RenderableGlobe.Layers.NightLayers.Earth at Night 2012.Enabled') ..
- helper.property.invert('Earth.RenderableGlobe.PerformShading') ..
- helper.property.invert('Earth.RenderableGlobe.Atmosphere') ..
- helper.property.invert('Earth.RenderableGlobe.Layers.WaterMasks.MODIS_Water_Mask.Enabled'),
- "Toggle night texture, shading, atmosphere, and water for Earth."
- )
-
- -- Toggle background
- openspace.bindKey("b",
- helper.property.invert('MilkyWay.renderable.Enabled') ..
- helper.property.invert('Stars.renderable.Enabled'),
- "Toggle background (Stars and Milkyway)."
- )
-
- openspace.bindKey("g",
- "openspace.setInteractionMode('GlobeBrowsing')" ..
- helper.property.invert('MilkyWay.renderable.Enabled') ..
- helper.property.invert('Stars.renderable.Enabled') ..
- helper.property.invert('Earth.RenderableGlobe.Layers.NightLayers.Earth at Night 2012.Enabled') ..
- helper.property.invert('Earth.RenderableGlobe.PerformShading') ..
- helper.property.invert('Mars.RenderableGlobe.PerformShading') ..
- helper.property.invert('Earth.RenderableGlobe.Atmosphere') ..
- helper.property.invert('Earth.RenderableGlobe.Layers.WaterMasks.MODIS_Water_Mask.Enabled') ..
- helper.property.invert('Moon.RenderableGlobe.Enabled') ..
- helper.property.invert('Sun.renderable.Enabled'),
- "Toogles background and shading mode on the Earth and Mars alongside visibility of the Moon and the Sun"
- )
-
- openspace.bindKey("h",
- "openspace.setPropertyValue('*Trail.renderable.Enabled', false)",
- "Disables visibility of the trails"
- )
-end
-
-function postInitialization()
- openspace.printInfo("Setting default values")
-
- openspace.setPropertyValue("MilkyWay.renderable.Transparency", 0.55)
- openspace.setPropertyValue("MilkyWay.renderable.Segments", 50)
-
- openspace.setPropertyValue("Sun.renderable.Enabled", true)
- openspace.setPropertyValue("SunGlare.renderable.Enabled", false)
- openspace.setPropertyValue("SunMarker.renderable.Enabled", false)
-
- openspace.setPropertyValue("Earth.RenderableGlobe.Atmosphere", true)
- openspace.setPropertyValue("Earth.RenderableGlobe.Debug.LevelByProjectedAreaElseDistance", false)
- openspace.setPropertyValue("Earth.RenderableGlobe.Layers.ColorLayers.BlendTileLevels", true)
-
- openspace.globebrowsing.goToGeo(0, 0, 20000000)
-
- openspace.printInfo("Done setting default values")
-end
-
-
-return {
- ScenePath = ".",
- CommonFolder = "common",
- Camera = {
- Focus = "Earth",
- Position = {0, 0, 0},
- Rotation = {0.758797, 0.221490, -0.605693, -0.091135},
- },
-
- Modules = {
- "lodglobes",
- "sun",
- "stars",
- "milkyway",
- -- "satellites"
- }
-}
-
diff --git a/data/scene/grids/gridEcliptic/gridEcliptic.mod b/data/scene/grids/gridEcliptic/gridEcliptic.mod
deleted file mode 100644
index ed4e7fb452..0000000000
--- a/data/scene/grids/gridEcliptic/gridEcliptic.mod
+++ /dev/null
@@ -1,17 +0,0 @@
-return {
- -- SphericalGrid module
- {
- Name = "SphericalGrid",
- Parent = "Root",
- Renderable = {
- Type = "RenderableSphericalGrid",
- GridType = "ECLIPJ2000",
- GridColor = { 0.4, 0.0, 0.0, 1},
- GridMatrix = { -0.05487554, 0.4941095, -0.8676661 , 0.0,
- -0.9938214 , -0.1109906, -0.0003515167, 0.0,
- -0.09647644, 0.8622859, 0.4971472 , 0.0,
- 0.0 , 0.0 , 0.0 , 1.0 },
- GridSegments = 36,
- }
- }
-}
\ No newline at end of file
diff --git a/data/scene/grids/gridEquatorial/gridEquatorial.mod b/data/scene/grids/gridEquatorial/gridEquatorial.mod
deleted file mode 100644
index ccee24ccad..0000000000
--- a/data/scene/grids/gridEquatorial/gridEquatorial.mod
+++ /dev/null
@@ -1,17 +0,0 @@
-return {
- -- SphericalGrid module
- {
- Name = "SphericalGrid",
- Parent = "Root",
- Renderable = {
- Type = "RenderableSphericalGrid",
- GridType = "ICRF",
- GridColor = { 0.0, 0.0, 0.4, 1},
- GridMatrix = { -0.05487554, 0.4941095, -0.8676661, 0.0,
- -0.8734371 , -0.4448296, -0.1980764, 0.0,
- -0.483835 , 0.7469823, 0.4559838, 0.0,
- 0.0 , 0.0 , 0.0 , 1.0 },
- GridSegments = 36,
- }
- }
-}
\ No newline at end of file
diff --git a/data/scene/grids/gridGalactic/gridGalactic.mod b/data/scene/grids/gridGalactic/gridGalactic.mod
deleted file mode 100644
index b27d939b6c..0000000000
--- a/data/scene/grids/gridGalactic/gridGalactic.mod
+++ /dev/null
@@ -1,17 +0,0 @@
-return {
- -- gridGalactic module
- {
- Name = "gridGalactic",
- Parent = "SolarSystem",
- Renderable = {
- Type = "RenderableSphericalGrid",
- GridType = "GALACTIC",
- GridColor = { 0.0, 0.4, 0.4, 1},
- GridMatrix = { 1.0, 0.0, 0.0, 0.0,
- 0.0, 1.0, 0.0, 0.0,
- 0.0, 0.0, 1.0, 0.0,
- 0.0, 0.0, 0.0, 1.0 },
- GridSegments = 36,
- }
- }
-}
\ No newline at end of file
diff --git a/data/scene/grids/grids.mod b/data/scene/grids/grids.mod
new file mode 100644
index 0000000000..a9ec4af6a4
--- /dev/null
+++ b/data/scene/grids/grids.mod
@@ -0,0 +1,38 @@
+return {
+ -- SphericalGrid module
+ {
+ Name = "Ecliptic Grid",
+ Parent = "Root",
+ Renderable = {
+ Type = "RenderableSphericalGrid",
+ GridColor = { 0.75, 0.0, 0.0, 1.0},
+ LineWidth = 0.75,
+ GridMatrix = { -0.05487554, 0.4941095, -0.8676661 , 0.0,
+ -0.9938214 , -0.1109906, -0.0003515167, 0.0,
+ -0.09647644, 0.8622859, 0.4971472 , 0.0,
+ 0.0 , 0.0 , 0.0 , 1.0 }
+ }
+ },
+ {
+ Name = "Equatorial Grid",
+ Parent = "Root",
+ Renderable = {
+ Type = "RenderableSphericalGrid",
+ GridColor = { 0.0, 0.0, 0.75, 1.0},
+ LineWidth = 0.75,
+ GridMatrix = { -0.05487554, 0.4941095, -0.8676661, 0.0,
+ -0.8734371 , -0.4448296, -0.1980764, 0.0,
+ -0.483835 , 0.7469823, 0.4559838, 0.0,
+ 0.0 , 0.0 , 0.0 , 1.0 }
+ }
+ },
+ {
+ Name = "Galactic Grid",
+ Parent = "SolarSystem",
+ Renderable = {
+ Type = "RenderableSphericalGrid",
+ LineWidth = 0.75,
+ GridColor = { 0.0, 0.75, 0.75, 1.0}
+ }
+ }
+}
diff --git a/data/scene/juno.scene b/data/scene/juno.scene
index f3fb214f73..69f68db08b 100755
--- a/data/scene/juno.scene
+++ b/data/scene/juno.scene
@@ -55,8 +55,10 @@ return {
"saturn/saturn",
"uranus",
"neptune",
- "stars",
- "milkyway",
+ "stars/digitaluniverse",
+ -- "stars/denver",
+ "milkyway/digitaluniverse",
+ --"milkyway/eso",
"missions/juno"
}
}
diff --git a/data/scene/jupiter/callisto/callisto.mod b/data/scene/jupiter/callisto/callisto.mod
index aa6122bd47..7ee86055fb 100644
--- a/data/scene/jupiter/callisto/callisto.mod
+++ b/data/scene/jupiter/callisto/callisto.mod
@@ -1,46 +1,38 @@
return {
- -- Callisto module
- {
+ -- RenderableGlobe module
+ {
Name = "Callisto",
Parent = "JupiterBarycenter",
- Renderable = {
- Type = "RenderablePlanet",
- Frame = "IAU_CALLISTO", -- should exist.
- Body = "CALLISTO",
- Geometry = {
- Type = "SimpleSphere",
- Radius = 2.631E6,
- Segments = 100
- },
- Textures = {
- Type = "simple",
- Color = "textures/callisto.jpg",
- },
- Atmosphere = {
- Type = "Nishita", -- for example, values missing etc etc
- MieFactor = 1.0,
- MieColor = {1.0, 1.0, 1.0}
- }
- },
Transform = {
- Translation = {
- Type = "SpiceTranslation",
- Body = "CALLISTO",
- Observer = "JUPITER BARYCENTER",
- Kernels = "${OPENSPACE_DATA}/spice/jup260.bsp"
- },
Rotation = {
Type = "SpiceRotation",
SourceFrame = "IAU_CALLISTO",
- DestinationFrame = "IAU_JUPITER",
- },
- Scale = {
- Type = "StaticScale",
- Scale = 1,
+ DestinationFrame = "GALACTIC",
},
+ Translation = {
+ Type = "SpiceTranslation",
+ Target = "CALLISTO",
+ Observer = "JUPITER BARYCENTER",
+ Kernels = "${OPENSPACE_DATA}/spice/jup260.bsp"
+ }
+ },
+ Renderable = {
+ Type = "RenderableGlobe",
+ Radii = 2410000,
+ SegmentsPerPatch = 64,
+ Layers = {
+ ColorLayers = {
+ {
+ Name = "Callisto Texture",
+ FilePath = "textures/callisto.jpg",
+ Enabled = true
+ }
+ }
+ }
}
},
- -- CallistoTrail module
+
+ -- Trail module
{
Name = "CallistoTrail",
Parent = "JupiterBarycenter",
@@ -48,11 +40,11 @@ return {
Type = "RenderableTrailOrbit",
Translation = {
Type = "SpiceTranslation",
- Body = "CALLISTO",
- Observer = "JUPITER BARYCENTER",
+ Target = "CALLISTO",
+ Observer = "JUPITER BARYCENTER"
},
Color = { 0.4, 0.3, 0.01 },
- Period = 17,
+ Period = 17,
Resolution = 1000
}
}
diff --git a/data/scene/jupiter/europa/europa.mod b/data/scene/jupiter/europa/europa.mod
index fea16b4627..92f9177da0 100644
--- a/data/scene/jupiter/europa/europa.mod
+++ b/data/scene/jupiter/europa/europa.mod
@@ -1,42 +1,38 @@
return {
- -- Europa module
- {
+ -- RenderableGlobe module
+ {
Name = "Europa",
Parent = "JupiterBarycenter",
- Renderable = {
- Type = "RenderablePlanet",
- Frame = "IAU_EUROPA", -- should exist.
- Body = "EUROPA",
- Geometry = {
- Type = "SimpleSphere",
- Radius = 1.561E6,
- Segments = 100
- },
- Textures = {
- Type = "simple",
- Color = "textures/europa.jpg",
- },
- Atmosphere = {
- Type = "Nishita", -- for example, values missing etc etc
- MieFactor = 1.0,
- MieColor = {1.0, 1.0, 1.0}
- }
- },
Transform = {
- Translation = {
- Type = "SpiceTranslation",
- Body = "EUROPA",
- Observer = "JUPITER BARYCENTER",
- Kernels = "${OPENSPACE_DATA}/spice/jup260.bsp"
- },
Rotation = {
Type = "SpiceRotation",
SourceFrame = "IAU_EUROPA",
- DestinationFrame = "IAU_JUPITER",
- }
+ DestinationFrame = "GALACTIC",
+ },
+ Translation = {
+ Type = "SpiceTranslation",
+ Target = "EUROPA",
+ Observer = "JUPITER BARYCENTER",
+ Kernels = "${OPENSPACE_DATA}/spice/jup260.bsp"
+ },
+ },
+ Renderable = {
+ Type = "RenderableGlobe",
+ Radii = 1560800,
+ SegmentsPerPatch = 64,
+ Layers = {
+ ColorLayers = {
+ {
+ Name = "Europa Texture",
+ FilePath = "textures/europa.jpg",
+ Enabled = true,
+ },
+ },
+ },
}
},
- -- EuropaTrail module
+
+ -- Trail module
{
Name = "EuropaTrail",
Parent = "JupiterBarycenter",
@@ -44,7 +40,7 @@ return {
Type = "RenderableTrailOrbit",
Translation = {
Type = "SpiceTranslation",
- Body = "EUROPA",
+ Target = "EUROPA",
Observer = "JUPITER BARYCENTER",
},
Color = { 0.5, 0.3, 0.3 },
diff --git a/data/scene/jupiter/ganymede/ganymede.mod b/data/scene/jupiter/ganymede/ganymede.mod
index 16aa1c175a..61f048b368 100644
--- a/data/scene/jupiter/ganymede/ganymede.mod
+++ b/data/scene/jupiter/ganymede/ganymede.mod
@@ -1,46 +1,37 @@
return {
- -- Ganymede module
- {
+ -- RenderableGlobe module
+ {
Name = "Ganymede",
Parent = "JupiterBarycenter",
- Renderable = {
- Type = "RenderablePlanet",
- Frame = "IAU_GANYMEDE", -- should exist.
- Body = "JUPITER BARYCENTER",
- Geometry = {
- Type = "SimpleSphere",
- Radius = 2.631E6,
- Segments = 100
- },
- Textures = {
- Type = "simple",
- Color = "textures/ganymede.jpg",
- },
- Atmosphere = {
- Type = "Nishita", -- for example, values missing etc etc
- MieFactor = 1.0,
- MieColor = {1.0, 1.0, 1.0}
- }
- },
Transform = {
- Translation = {
- Type = "SpiceTranslation",
- Body = "GANYMEDE",
- Observer = "JUPITER BARYCENTER",
- Kernels = "${OPENSPACE_DATA}/spice/jup260.bsp"
- },
Rotation = {
Type = "SpiceRotation",
SourceFrame = "IAU_GANYMEDE",
- DestinationFrame = "IAU_JUPITER",
- },
- Scale = {
- Type = "StaticScale",
- Scale = 1,
+ DestinationFrame = "GALACTIC"
},
+ Translation = {
+ Type = "SpiceTranslation",
+ Target = "GANYMEDE",
+ Observer = "JUPITER BARYCENTER",
+ Kernels = "${OPENSPACE_DATA}/spice/jup260.bsp"
+ }
+ },
+ Renderable = {
+ Type = "RenderableGlobe",
+ Radii = 2631000,
+ SegmentsPerPatch = 64,
+ Layers = {
+ ColorLayers = {
+ {
+ Name = "Ganymede Texture",
+ FilePath = "textures/ganymede.jpg",
+ Enabled = true
+ }
+ }
+ }
}
},
- -- GanymedeTrail module
+ -- Trail module
{
Name = "GanymedeTrail",
Parent = "JupiterBarycenter",
@@ -48,8 +39,8 @@ return {
Type = "RenderableTrailOrbit",
Translation = {
Type = "SpiceTranslation",
- Body = "GANYMEDE",
- Observer = "JUPITER BARYCENTER",
+ Target = "GANYMEDE",
+ Observer = "JUPITER BARYCENTER"
},
Color = { 0.4, 0.3, 0.3 },
Period = 172 / 24,
diff --git a/data/scene/jupiter/io/io.mod b/data/scene/jupiter/io/io.mod
index 98e5e88e7f..70c265d266 100644
--- a/data/scene/jupiter/io/io.mod
+++ b/data/scene/jupiter/io/io.mod
@@ -1,46 +1,37 @@
return {
- -- Io module
- {
+ -- RenderableGlobe module
+ {
Name = "Io",
Parent = "JupiterBarycenter",
- Renderable = {
- Type = "RenderablePlanet",
- Frame = "IAU_IO", -- should exist.
- Body = "IO",
- Geometry = {
- Type = "SimpleSphere",
- Radius = 1.8213E6,
- Segments = 100
- },
- Textures = {
- Type = "simple",
- Color = "textures/io.jpg",
- },
- Atmosphere = {
- Type = "Nishita", -- for example, values missing etc etc
- MieFactor = 1.0,
- MieColor = {1.0, 1.0, 1.0}
- }
- },
Transform = {
- Translation = {
- Type = "SpiceTranslation",
- Body = "IO",
- Observer = "JUPITER BARYCENTER",
- Kernels = "${OPENSPACE_DATA}/spice/jup260.bsp"
- },
Rotation = {
Type = "SpiceRotation",
SourceFrame = "IAU_IO",
- DestinationFrame = "IAU_JUPITER",
+ DestinationFrame = "GALACTIC"
},
- Scale = {
- Type = "StaticScale",
- Scale = 1,
+ Translation = {
+ Type = "SpiceTranslation",
+ Target = "IO",
+ Observer = "JUPITER BARYCENTER",
+ Kernels = "${OPENSPACE_DATA}/spice/jup260.bsp"
},
+ },
+ Renderable = {
+ Type = "RenderableGlobe",
+ Radii = 1821600,
+ SegmentsPerPatch = 64,
+ Layers = {
+ ColorLayers = {
+ {
+ Name = "Io Texture",
+ FilePath = "textures/io.jpg",
+ Enabled = true
+ }
+ }
+ }
}
},
- -- IoTrail module
+ -- Trail module
{
Name = "IoTrail",
Parent = "JupiterBarycenter",
@@ -48,8 +39,8 @@ return {
Type = "RenderableTrailOrbit",
Translation = {
Type = "SpiceTranslation",
- Body = "IO",
- Observer = "JUPITER BARYCENTER",
+ Target = "IO",
+ Observer = "JUPITER BARYCENTER"
},
Color = { 0.4, 0.4, 0.2 },
Period = 42 / 24,
diff --git a/data/scene/jupiter/jupiter/jupiter.mod b/data/scene/jupiter/jupiter/jupiter.mod
index f9030b25f1..c8e822b5af 100644
--- a/data/scene/jupiter/jupiter/jupiter.mod
+++ b/data/scene/jupiter/jupiter/jupiter.mod
@@ -1,58 +1,45 @@
return {
- -- Jupiter barycenter module
+ -- Barycenter module
{
Name = "JupiterBarycenter",
Parent = "SolarSystemBarycenter",
Transform = {
Translation = {
Type = "SpiceTranslation",
- Body = "JUPITER BARYCENTER",
+ Target = "JUPITER BARYCENTER",
Observer = "SUN",
Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp"
- },
- },
+ }
+ }
},
- -- Jupiter module
- {
+ -- RenderableGlobe module
+ {
Name = "Jupiter",
Parent = "JupiterBarycenter",
- Renderable = {
- Type = "RenderablePlanet",
- Frame = "IAU_JUPITER",
- Body = "JUPITER BARYCENTER",
- Geometry = {
- Type = "SimpleSphere",
- Radius = 0.71492E8,
- Segments = 200
- },
- Textures = {
- Type = "simple",
- Color = "textures/jupiter.jpg",
- },
- Atmosphere = {
- Type = "Nishita", -- for example, values missing etc etc
- MieFactor = 1.0,
- MieColor = {1.0, 1.0, 1.0}
- }
- },
- Tag = "planet_solarSystem",
Transform = {
- Translation = {
- Type = "StaticTranslation",
- Position = {0, 0, 0}, -- jupiter is at its barycenter
- },
Rotation = {
Type = "SpiceRotation",
SourceFrame = "IAU_JUPITER",
- DestinationFrame = "ECLIPJ2000",
+ DestinationFrame = "GALACTIC"
},
- Scale = {
- Type = "StaticScale",
- Scale = 1,
- },
- }
+ },
+ Renderable = {
+ Type = "RenderableGlobe",
+ Radii = { 71492000, 71492000, 66854000 },
+ SegmentsPerPatch = 64,
+ Layers = {
+ ColorLayers = {
+ {
+ Name = "Jupiter Texture",
+ FilePath = "textures/jupiter.jpg",
+ Enabled = true
+ }
+ }
+ }
+ },
+ Tag = { "planet_solarSystem", "planet_giants" },
},
- -- JupiterTrail module
+ -- Trail module
{
Name = "JupiterTrail",
Parent = "SolarSystemBarycenter",
@@ -60,13 +47,13 @@ return {
Type = "RenderableTrailOrbit",
Translation = {
Type = "SpiceTranslation",
- Body = "JUPITER BARYCENTER",
- Observer = "SUN",
+ Target = "JUPITER BARYCENTER",
+ Observer = "SUN"
},
Color = { 0.8, 0.7, 0.7 },
Period = 4330.595,
- Resolution = 1000,
+ Resolution = 1000
},
- Tag = "planetTrail_solarSystem"
+ Tag = { "planetTrail_solarSystem", "planetTrail_giants" }
}
-}
+}
\ No newline at end of file
diff --git a/data/scene/lodglobes/earth/earth.data b/data/scene/lodglobes/earth/earth.data
deleted file mode 100644
index e168d4c8be..0000000000
--- a/data/scene/lodglobes/earth/earth.data
+++ /dev/null
@@ -1,5 +0,0 @@
-return {
- FileRequest = {
- { Identifier = "earth_textures", Destination = "textures", Version = 2 }
- },
-}
diff --git a/data/scene/lodglobes/earth/earth.mod b/data/scene/lodglobes/earth/earth.mod
deleted file mode 100644
index 0819aa8638..0000000000
--- a/data/scene/lodglobes/earth/earth.mod
+++ /dev/null
@@ -1,188 +0,0 @@
-earthEllipsoid = {6378137.0, 6378137.0, 6356752.314245} -- Earth's radii
-return {
- -- Earth barycenter module
- {
- Name = "EarthBarycenter",
- Parent = "SolarSystemBarycenter",
- Transform = {
- Translation = {
- Type = "SpiceTranslation",
- Body = "EARTH",
- Observer = "SUN",
- Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp"
- },
- },
- },
- {
- -- The default reference frame for Earth-orbiting satellites
- Name = "EarthInertial",
- Parent = "EarthBarycenter",
- Transform = {
- Rotation = {
- Type = "SpiceRotation",
- SourceFrame = "J2000",
- DestinationFrame = "GALACTIC",
- }
- },
- },
- -- EarthTrail module
- {
- Name = "EarthTrail",
- Parent = "SolarSystemBarycenter",
- Renderable = {
- Type = "RenderableTrailOrbit",
- Translation = {
- Type = "SpiceTranslation",
- Body = "EARTH",
- Observer = "SUN"
- },
- Color = { 0.5, 0.8, 1.0 },
- -- StartTime = "2016 JUN 01 12:00:00.000",
- -- EndTime = "2017 JAN 01 12:00:00.000",
- -- SampleInterval = 3600
- Period = 365.242,
- Resolution = 1000
- },
- GuiName = "/Solar/EarthTrail"
- },
- -- RenderableGlobe module
- {
- Name = "Earth",
- Parent = "EarthBarycenter",
- Transform = {
- Rotation = {
- Type = "SpiceRotation",
- SourceFrame = "IAU_EARTH",
- DestinationFrame = "GALACTIC",
- },
- Scale = {
- Type = "StaticScale",
- Scale = 1,
- },
- },
- Renderable = {
- Type = "RenderableGlobe",
- Radii = earthEllipsoid,
- SegmentsPerPatch = 64,
- Layers = {
- ColorLayers = {
- {
- Name = "ESRI VIIRS Combo",
- Type = "ByLevelTileLayer",
- LevelTileProviders = {
- {
- MaxLevel = 3,
- TileProvider = {
- Type = "TemporalTileLayer",
- Name = "Temporal VIIRS SNPP",
- FilePath = "map_service_configs/GIBS/Temporal_VIIRS_SNPP_CorrectedReflectance_TrueColor.xml", },
- },
- {
- MaxLevel = 22,
- TileProvider = {
- Name = "ESRI Imagery World 2D",
- FilePath = "map_service_configs/ESRI/ESRI_Imagery_World_2D.wms"
- },
- },
- },
- Enabled = true,
- },
- {
- FilePath = "map_service_configs/ESRI/ESRI_Imagery_World_2D.wms",
- Name = "ESRI",
- },
- {
- Name = "BMNG",
- FilePath = "map_service_configs/Utah/Bmng.wms"
- },
- {
- Type = "TemporalTileLayer",
- Name = "Temporal_AMSR2_GCOM_W1_Sea_Ice_Concentration",
- FilePath = "map_service_configs/GIBS/Temporal_AMSR2_GCOM_W1_Sea_Ice_Concentration.xml",
- },
- {
- Type = "TemporalTileLayer",
- Name = "MODIS_Terra_Chlorophyll_A",
- FilePath = openspace.globebrowsing.createTemporalGibsGdalXml(
- "MODIS_Terra_Chlorophyll_A",
- "2013-07-02",
- "Yesterday",
- "1d",
- "1km",
- "png")
- },
- {
- Type = "TemporalTileLayer",
- Name = "GHRSST_L4_G1SST_Sea_Surface_Temperature",
- FilePath = openspace.globebrowsing.createTemporalGibsGdalXml(
- "GHRSST_L4_G1SST_Sea_Surface_Temperature",
- "2010-06-21",
- "Yesterday",
- "1d",
- "1km",
- "png")
- },
- },
- NightLayers = {
- {
- Name = "Earth at Night 2012",
- FilePath = "map_service_configs/GIBS/VIIRS_CityLights_2012.xml",
- Enabled = true,
- Settings = {
- Opacity = 1.0,
- Gamma = 1.5,
- Multiplier = 15.0,
- },
- },
- {
- Type = "TemporalTileLayer",
- Name = "Temporal Earth at Night",
- FilePath = "map_service_configs/GIBS/Temporal_VIIRS_SNPP_DayNightBand_ENCC.xml"
- }
- },
- WaterMasks = {
- {
- Name = "MODIS_Water_Mask",
- FilePath = "map_service_configs/GIBS/MODIS_Water_Mask.xml",
- Enabled = true,
- },
- {
- Name = "GEBCO",
- FilePath = "map_service_configs/Utah/Gebco.wms",
- }
- },
- Overlays = {
- {
- Name = "Coastlines",
- FilePath = "map_service_configs/GIBS/Coastlines.xml",
- },
- {
- Name = "Reference_Features",
- FilePath = "map_service_configs/GIBS/Reference_Features.xml",
- },
- {
- Name = "Reference_Labels",
- FilePath = "map_service_configs/GIBS/Reference_Labels.xml",
- },
- {
- Type = "TileIndexTileLayer",
- Name = "Tile Indices",
- },
- {
- Type = "SizeReferenceTileLayer",
- Name = "Size Reference",
- Radii = earthEllipsoid,
- },
- },
- HeightLayers = {
- {
- Name = "Terrain tileset",
- FilePath = "map_service_configs/ESRI/TERRAIN.wms",
- Enabled = true,
- TilePixelSize = 64,
- },
- },
- },
- }
- },
-}
\ No newline at end of file
diff --git a/data/scene/lodglobes/jupiter/callisto/callisto.data b/data/scene/lodglobes/jupiter/callisto/callisto.data
deleted file mode 100644
index 9c381ecce7..0000000000
--- a/data/scene/lodglobes/jupiter/callisto/callisto.data
+++ /dev/null
@@ -1,5 +0,0 @@
-return {
- FileRequest = {
- { Identifier = "callisto_textures", Destination = "textures", Version = 1 }
- },
-}
\ No newline at end of file
diff --git a/data/scene/lodglobes/jupiter/callisto/callisto.mod b/data/scene/lodglobes/jupiter/callisto/callisto.mod
deleted file mode 100644
index 302fc7a103..0000000000
--- a/data/scene/lodglobes/jupiter/callisto/callisto.mod
+++ /dev/null
@@ -1,54 +0,0 @@
-return {
- -- RenderableGlobe module
- {
- Name = "Callisto",
- Parent = "JupiterBarycenter",
- Transform = {
- Rotation = {
- Type = "SpiceRotation",
- SourceFrame = "IAU_CALLISTO",
- DestinationFrame = "GALACTIC",
- },
- Translation = {
- Type = "SpiceTranslation",
- Body = "CALLISTO",
- Observer = "JUPITER BARYCENTER",
- Kernels = "${OPENSPACE_DATA}/spice/jup260.bsp"
- },
- Scale = {
- Type = "StaticScale",
- Scale = 1,
- },
- },
- Renderable = {
- Type = "RenderableGlobe",
- Radii = {2631000, 2631000, 2631000},
- SegmentsPerPatch = 64,
- Layers = {
- ColorLayers = {
- {
- Name = "Callisto Texture",
- FilePath = "textures/callisto.jpg",
- Enabled = true,
- },
- },
- },
- }
- },
- -- Trail module
- {
- Name = "CallistoTrail",
- Parent = "JupiterBarycenter",
- Renderable = {
- Type = "RenderableTrailOrbit",
- Translation = {
- Type = "SpiceTranslation",
- Body = "CALLISTO",
- Observer = "JUPITER BARYCENTER",
- },
- Color = { 0.4, 0.3, 0.01 },
- Period = 17,
- Resolution = 1000
- }
- }
-}
diff --git a/data/scene/lodglobes/jupiter/europa/europa.data b/data/scene/lodglobes/jupiter/europa/europa.data
deleted file mode 100644
index 4364fcbc49..0000000000
--- a/data/scene/lodglobes/jupiter/europa/europa.data
+++ /dev/null
@@ -1,5 +0,0 @@
-return {
- FileRequest = {
- { Identifier = "europa_textures", Destination = "textures", Version = 1 }
- },
-}
\ No newline at end of file
diff --git a/data/scene/lodglobes/jupiter/europa/europa.mod b/data/scene/lodglobes/jupiter/europa/europa.mod
deleted file mode 100644
index d84d20d48d..0000000000
--- a/data/scene/lodglobes/jupiter/europa/europa.mod
+++ /dev/null
@@ -1,55 +0,0 @@
-return {
- -- RenderableGlobe module
- {
- Name = "Europa",
- Parent = "JupiterBarycenter",
- Transform = {
- Rotation = {
- Type = "SpiceRotation",
- SourceFrame = "IAU_EUROPA",
- DestinationFrame = "GALACTIC",
- },
- Translation = {
- Type = "SpiceTranslation",
- Body = "EUROPA",
- Observer = "JUPITER BARYCENTER",
- Kernels = "${OPENSPACE_DATA}/spice/jup260.bsp"
- },
- Scale = {
- Type = "StaticScale",
- Scale = 1,
- },
- },
- Renderable = {
- Type = "RenderableGlobe",
- Radii = {1561000, 1561000, 1561000},
- SegmentsPerPatch = 64,
- Layers = {
- ColorLayers = {
- {
- Name = "Europa Texture",
- FilePath = "textures/europa.jpg",
- Enabled = true,
- },
- },
- },
- }
- },
-
- -- Trail module
- {
- Name = "EuropaTrail",
- Parent = "JupiterBarycenter",
- Renderable = {
- Type = "RenderableTrailOrbit",
- Translation = {
- Type = "SpiceTranslation",
- Body = "EUROPA",
- Observer = "JUPITER BARYCENTER",
- },
- Color = { 0.5, 0.3, 0.3 },
- Period = 85 / 24,
- Resolution = 1000
- }
- }
-}
diff --git a/data/scene/lodglobes/jupiter/ganymede/ganymede.data b/data/scene/lodglobes/jupiter/ganymede/ganymede.data
deleted file mode 100644
index 4ae2714582..0000000000
--- a/data/scene/lodglobes/jupiter/ganymede/ganymede.data
+++ /dev/null
@@ -1,5 +0,0 @@
-return {
- FileRequest = {
- { Identifier = "ganymede_textures", Destination = "textures", Version = 1 }
- },
-}
\ No newline at end of file
diff --git a/data/scene/lodglobes/jupiter/ganymede/ganymede.mod b/data/scene/lodglobes/jupiter/ganymede/ganymede.mod
deleted file mode 100644
index e37a193bb8..0000000000
--- a/data/scene/lodglobes/jupiter/ganymede/ganymede.mod
+++ /dev/null
@@ -1,54 +0,0 @@
-return {
- -- RenderableGlobe module
- {
- Name = "Ganymede",
- Parent = "JupiterBarycenter",
- Transform = {
- Rotation = {
- Type = "SpiceRotation",
- SourceFrame = "IAU_GANYMEDE",
- DestinationFrame = "GALACTIC",
- },
- Translation = {
- Type = "SpiceTranslation",
- Body = "GANYMEDE",
- Observer = "JUPITER BARYCENTER",
- Kernels = "${OPENSPACE_DATA}/spice/jup260.bsp"
- },
- Scale = {
- Type = "StaticScale",
- Scale = 1,
- },
- },
- Renderable = {
- Type = "RenderableGlobe",
- Radii = {2631000, 2631000, 2631000},
- SegmentsPerPatch = 64,
- Layers = {
- ColorLayers = {
- {
- Name = "Ganymede Texture",
- FilePath = "textures/ganymede.jpg",
- Enabled = true,
- },
- },
- },
- }
- },
- -- Trail module
- {
- Name = "GanymedeTrail",
- Parent = "JupiterBarycenter",
- Renderable = {
- Type = "RenderableTrailOrbit",
- Translation = {
- Type = "SpiceTranslation",
- Body = "GANYMEDE",
- Observer = "JUPITER BARYCENTER",
- },
- Color = { 0.4, 0.3, 0.3 },
- Period = 172 / 24,
- Resolution = 1000
- }
- }
-}
diff --git a/data/scene/lodglobes/jupiter/io/io.data b/data/scene/lodglobes/jupiter/io/io.data
deleted file mode 100644
index baca863e4b..0000000000
--- a/data/scene/lodglobes/jupiter/io/io.data
+++ /dev/null
@@ -1,5 +0,0 @@
-return {
- FileRequest = {
- { Identifier = "io_textures", Destination = "textures", Version = 1 }
- },
-}
\ No newline at end of file
diff --git a/data/scene/lodglobes/jupiter/io/io.mod b/data/scene/lodglobes/jupiter/io/io.mod
deleted file mode 100644
index 87dfc06b20..0000000000
--- a/data/scene/lodglobes/jupiter/io/io.mod
+++ /dev/null
@@ -1,54 +0,0 @@
-return {
- -- RenderableGlobe module
- {
- Name = "Io",
- Parent = "JupiterBarycenter",
- Transform = {
- Rotation = {
- Type = "SpiceRotation",
- SourceFrame = "IAU_IO",
- DestinationFrame = "GALACTIC",
- },
- Translation = {
- Type = "SpiceTranslation",
- Body = "IO",
- Observer = "JUPITER BARYCENTER",
- Kernels = "${OPENSPACE_DATA}/spice/jup260.bsp"
- },
- Scale = {
- Type = "StaticScale",
- Scale = 1,
- },
- },
- Renderable = {
- Type = "RenderableGlobe",
- Radii = {1821300, 1821300, 1821300},
- SegmentsPerPatch = 64,
- Layers = {
- ColorLayers = {
- {
- Name = "Io Texture",
- FilePath = "textures/io.jpg",
- Enabled = true,
- },
- },
- },
- }
- },
- -- Trail module
- {
- Name = "IoTrail",
- Parent = "JupiterBarycenter",
- Renderable = {
- Type = "RenderableTrailOrbit",
- Translation = {
- Type = "SpiceTranslation",
- Body = "IO",
- Observer = "JUPITER BARYCENTER",
- },
- Color = { 0.4, 0.4, 0.2 },
- Period = 42 / 24,
- Resolution = 1000
- }
- }
-}
diff --git a/data/scene/lodglobes/jupiter/jupiter/jup260.bsp.torrent b/data/scene/lodglobes/jupiter/jupiter/jup260.bsp.torrent
deleted file mode 100644
index 0c82073d38..0000000000
Binary files a/data/scene/lodglobes/jupiter/jupiter/jup260.bsp.torrent and /dev/null differ
diff --git a/data/scene/lodglobes/jupiter/jupiter/jupiter.data b/data/scene/lodglobes/jupiter/jupiter/jupiter.data
deleted file mode 100644
index b22e81119b..0000000000
--- a/data/scene/lodglobes/jupiter/jupiter/jupiter.data
+++ /dev/null
@@ -1,8 +0,0 @@
-return {
- FileRequest = {
- { Identifier = "jupiter_textures", Destination = "textures", Version = 1 }
- },
- TorrentFiles = {
- { File = "jup260.bsp.torrent", Destination = "${SPICE}" },
- }
-}
\ No newline at end of file
diff --git a/data/scene/lodglobes/jupiter/jupiter/jupiter.mod b/data/scene/lodglobes/jupiter/jupiter/jupiter.mod
deleted file mode 100644
index 58dc65149d..0000000000
--- a/data/scene/lodglobes/jupiter/jupiter/jupiter.mod
+++ /dev/null
@@ -1,65 +0,0 @@
-return {
- -- Barycenter module
- {
- Name = "JupiterBarycenter",
- Parent = "SolarSystemBarycenter",
- Transform = {
- Translation = {
- Type = "SpiceTranslation",
- Body = "JUPITER BARYCENTER",
- Observer = "SUN",
- Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp"
- },
- },
- },
- -- RenderableGlobe module
- {
- Name = "Jupiter",
- Parent = "JupiterBarycenter",
- Transform = {
- Rotation = {
- Type = "SpiceRotation",
- SourceFrame = "IAU_JUPITER",
- DestinationFrame = "GALACTIC",
- },
- Translation = {
- Type = "StaticTranslation",
- Position = {0, 0, 0}, -- jupiter is at its barycenter
- },
- Scale = {
- Type = "StaticScale",
- Scale = 1,
- },
- },
- Renderable = {
- Type = "RenderableGlobe",
- Radii = {71492000, 71492000, 66854000},
- SegmentsPerPatch = 64,
- Layers = {
- ColorLayers = {
- {
- Name = "Jupiter Texture",
- FilePath = "textures/jupiter.jpg",
- Enabled = true,
- },
- },
- },
- }
- },
- -- Trail module
- {
- Name = "JupiterTrail",
- Parent = "SolarSystemBarycenter",
- Renderable = {
- Type = "RenderableTrailOrbit",
- Translation = {
- Type = "SpiceTranslation",
- Body = "JUPITER BARYCENTER",
- Observer = "SUN",
- },
- Color = { 0.8, 0.7, 0.7 },
- Period = 4330.595,
- Resolution = 1000
- }
- }
-}
\ No newline at end of file
diff --git a/data/scene/lodglobes/mars/MAR063.BSP.torrent b/data/scene/lodglobes/mars/MAR063.BSP.torrent
deleted file mode 100644
index 50cab2e6bf..0000000000
Binary files a/data/scene/lodglobes/mars/MAR063.BSP.torrent and /dev/null differ
diff --git a/data/scene/lodglobes/mars/mars.data b/data/scene/lodglobes/mars/mars.data
deleted file mode 100644
index afaf7ab69d..0000000000
--- a/data/scene/lodglobes/mars/mars.data
+++ /dev/null
@@ -1,8 +0,0 @@
-return {
- FileRequest = {
- { Identifier = "mars_textures", Destination = "textures", Version = 1 }
- },
- TorrentFiles = {
- -- { File = "MAR063.BSP.torrent", Destination = "${SPICE}" }
- }
-}
\ No newline at end of file
diff --git a/data/scene/lodglobes/mars/mars.mod b/data/scene/lodglobes/mars/mars.mod
deleted file mode 100644
index ceee56e4ea..0000000000
--- a/data/scene/lodglobes/mars/mars.mod
+++ /dev/null
@@ -1,96 +0,0 @@
-local marsEllipsoid = {3396190.0, 3396190.0, 3376200.0}
-
-return {
- -- Barycenter module
- {
- Name = "MarsBarycenter",
- Parent = "SolarSystemBarycenter",
- Transform = {
- Translation = {
- Type = "SpiceTranslation",
- Body = "MARS BARYCENTER",
- Observer = "SUN",
- Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp"
- },
- },
- },
- -- RenderableGlobe module
- {
- Name = "Mars",
- Parent = "MarsBarycenter",
- Transform = {
- Rotation = {
- Type = "SpiceRotation",
- SourceFrame = "IAU_MARS",
- DestinationFrame = "GALACTIC",
- },
- Scale = {
- Type = "StaticScale",
- Scale = 1,
- },
- },
- Renderable = {
- Type = "RenderableGlobe",
- Radii = marsEllipsoid,
- SegmentsPerPatch = 90,
- Layers = {
- ColorLayers = {
- {
- Name = "Viking",
- FilePath = "map_service_configs/MARS_Viking_MDIM21.xml",
- Enabled = true,
- },
- {
- Name = "MOLA Pseudo Color",
- FilePath = "map_service_configs/Utah/MolaPseudoColor.xml",
- },
- {
- Name = "CTX Mosaic [Europe]",
- FilePath = "map_service_configs/CTX_Mosaic.xml",
- BlendMode = "Color"
- },
- {
- Name = "CTX Mosaic [Utah]",
- FilePath = "map_service_configs/Utah/CTX_Mosaic.xml",
- BlendMode = "Color"
- },
- },
- Overlays = {
- {
- Type = "TileIndexTileLayer",
- Name = "Indices",
- },
- {
- Type = "SizeReferenceTileLayer",
- Name = "Size Reference",
- Radii = marsEllipsoid,
- },
- },
- HeightLayers = {
- {
- Name = "Mola Elevation [Europe]",
- FilePath = "map_service_configs/Mola_Elevation.xml",
- Enabled = true,
- TilePixelSize = 90,
- },
- },
- },
- }
- },
- -- Trail module
- {
- Name = "MarsTrail",
- Parent = "SolarSystemBarycenter",
- Renderable = {
- Type = "RenderableTrailOrbit",
- Translation = {
- Type = "SpiceTranslation",
- Body = "MARS BARYCENTER",
- Observer = "SUN",
- },
- Color = { 0.814, 0.305, 0.220 },
- Period = 686.973,
- Resolution = 1000
- }
- }
-}
diff --git a/data/scene/lodglobes/mercury/mercury.data b/data/scene/lodglobes/mercury/mercury.data
deleted file mode 100644
index f2df36620b..0000000000
--- a/data/scene/lodglobes/mercury/mercury.data
+++ /dev/null
@@ -1,5 +0,0 @@
-return {
- FileRequest = {
- { Identifier = "mercury_textures", Destination = "textures", Version = 1 }
- },
-}
\ No newline at end of file
diff --git a/data/scene/lodglobes/mercury/mercury.mod b/data/scene/lodglobes/mercury/mercury.mod
deleted file mode 100644
index 531b855ba7..0000000000
--- a/data/scene/lodglobes/mercury/mercury.mod
+++ /dev/null
@@ -1,74 +0,0 @@
-return {
- -- Barycenter module
- {
- Name = "MercuryBarycenter",
- Parent = "SolarSystemBarycenter",
- Transform = {
- Translation = {
- Type = "SpiceTranslation",
- Body = "MERCURY",
- Observer = "SUN",
- Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp"
- },
- },
- },
- -- RenderableGlobe module
- {
- Name = "Mercury",
- Parent = "MercuryBarycenter",
- Transform = {
- Rotation = {
- Type = "SpiceRotation",
- SourceFrame = "IAU_MERCURY",
- DestinationFrame = "GALACTIC",
- },
- Scale = {
- Type = "StaticScale",
- Scale = 1,
- },
- },
- Renderable = {
- Type = "RenderableGlobe",
- Radii = {2439700, 2439700.0, 2439700.0},
- Frame = "IAU_MERCURY",
- Body = "MERCURY",
-
- CameraMinHeight = 300,
- InteractionDepthBelowEllipsoid = 0, -- Useful when having negative height map values
- SegmentsPerPatch = 64,
- Layers = {
- ColorLayers = {
- {
- Name = "Simple Texture",
- FilePath = "textures/mercury.jpg",
- Enabled = true,
- },
- {
- Name = "Messenger_Mosaic",
- FilePath = "map_service_configs/Utah/MessengerMosaic.wms"
- },
- {
- Name = "Messenger_MDIS",
- FilePath = "map_service_configs/Utah/MessengerMDIS.wms"
- }
- },
- },
- },
- },
- -- Trail module
- {
- Name = "MercuryTrail",
- Parent = "SolarSystemBarycenter",
- Renderable = {
- Type = "RenderableTrailOrbit",
- Translation = {
- Type = "SpiceTranslation",
- Body = "MERCURY",
- Observer = "SUN",
- },
- Color = {0.6, 0.5, 0.5 },
- Period = 87.968,
- Resolution = 100
- }
- }
-}
diff --git a/data/scene/lodglobes/moon/moon.data b/data/scene/lodglobes/moon/moon.data
deleted file mode 100644
index f8c7094165..0000000000
--- a/data/scene/lodglobes/moon/moon.data
+++ /dev/null
@@ -1,5 +0,0 @@
-return {
- FileRequest = {
- { Identifier = "moon_textures", Destination = "textures", Version = 1 }
- },
-}
\ No newline at end of file
diff --git a/data/scene/lodglobes/moon/moon.mod b/data/scene/lodglobes/moon/moon.mod
deleted file mode 100644
index 1ddb3cf044..0000000000
--- a/data/scene/lodglobes/moon/moon.mod
+++ /dev/null
@@ -1,71 +0,0 @@
-return {
- -- Moon module
- {
- Name = "Moon",
- Parent = "EarthBarycenter",
- Transform = {
- Translation = {
- Type = "SpiceTranslation",
- Body = "MOON",
- Observer = "EARTH BARYCENTER",
- Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp"
- },
- Rotation = {
- Type = "SpiceRotation",
- SourceFrame = "IAU_MOON",
- DestinationFrame = "GALACTIC"
- },
- },
- Renderable = {
- Type = "RenderableGlobe",
- Radii = {1738140, 1738140, 1735970}, -- Moons's radius
- SegmentsPerPatch = 64,
- Layers = {
- ColorLayers = {
- {
- Name = "OnMoonColorGrayscale",
- FilePath = "map_service_configs/OnMoonColor.xml",
- Enabled = true,
- },
- {
- Name = "ClemUvvis",
- FilePath = "map_service_configs/Utah/ClemUvvis.wms"
- },
- {
- Name = "Kaguya",
- FilePath = "map_service_configs/Utah/Kaguya.wms"
- },
- {
- Name = "WAC",
- FilePath = "map_service_configs/Utah/Wac.wms"
- }
- },
- HeightLayers = {
- {
- Name = "LolaDem",
- FilePath = "map_service_configs/Utah/LolaDem.wms",
- Enabled = true,
- TilePixelSize = 64,
- Settings = { Multiplier = 0.5 },
- }
- },
- },
- }
- },
- -- MoonTrail module
- {
- Name = "MoonTrail",
- Parent = "EarthBarycenter",
- Renderable = {
- Type = "RenderableTrailOrbit",
- Translation = {
- Type = "SpiceTranslation",
- Body = "MOON",
- Observer = "EARTH BARYCENTER",
- },
- Color = { 0.5, 0.3, 0.3 },
- Period = 27,
- Resolution = 1000
- },
- }
-}
diff --git a/data/scene/lodglobes/neptune/neptune.data b/data/scene/lodglobes/neptune/neptune.data
deleted file mode 100644
index 60b294047e..0000000000
--- a/data/scene/lodglobes/neptune/neptune.data
+++ /dev/null
@@ -1,5 +0,0 @@
-return {
- FileRequest = {
- { Identifier = "neptune_textures", Destination = "textures", Version = 1 }
- },
-}
\ No newline at end of file
diff --git a/data/scene/lodglobes/neptune/neptune.mod b/data/scene/lodglobes/neptune/neptune.mod
deleted file mode 100644
index 99513e18bb..0000000000
--- a/data/scene/lodglobes/neptune/neptune.mod
+++ /dev/null
@@ -1,62 +0,0 @@
-return {
- -- Barycenter module
- {
- Name = "NeptuneBarycenter",
- Parent = "SolarSystemBarycenter",
- Transform = {
- Translation = {
- Type = "SpiceTranslation",
- Body = "NEPTUNE BARYCENTER",
- Observer = "SUN",
- Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp"
- },
- },
- },
- -- RenderableGlobe module
- {
- Name = "Neptune",
- Parent = "NeptuneBarycenter",
- Transform = {
- Rotation = {
- Type = "SpiceRotation",
- SourceFrame = "IAU_NEPTUNE",
- DestinationFrame = "GALACTIC",
- },
- Scale = {
- Type = "StaticScale",
- Scale = 1,
- },
- -- No translation, Neptune is in its barycenter
- },
- Renderable = {
- Type = "RenderableGlobe",
- Radii = {24764000, 24764000, 24314000},
- SegmentsPerPatch = 64,
- Layers = {
- ColorLayers = {
- {
- Name = "Texture",
- FilePath = "textures/neptune.jpg",
- Enabled = true,
- },
- },
- },
- },
- },
- -- Trail module
- {
- Name = "NeptuneTrail",
- Parent = "SolarSystemBarycenter",
- Renderable = {
- Type = "RenderableTrailOrbit",
- Translation = {
- Type = "SpiceTranslation",
- Body = "NEPTUNE BARYCENTER",
- Observer = "SUN",
- },
- Color = {0.2, 0.5, 1.0 },
- Period = 60200,
- Resolution = 1000
- },
- }
-}
diff --git a/data/scene/lodglobes/saturn/saturn.data b/data/scene/lodglobes/saturn/saturn.data
deleted file mode 100644
index cf0748dfc1..0000000000
--- a/data/scene/lodglobes/saturn/saturn.data
+++ /dev/null
@@ -1,8 +0,0 @@
-return {
- FileRequest = {
- { Identifier = "saturn_textures", Destination = "textures", Version = 2 }
- },
- TorrentFiles = {
- { File = "sat375.bsp.torrent", Destination = "${SPICE}" },
- }
-}
\ No newline at end of file
diff --git a/data/scene/lodglobes/saturn/saturn.mod b/data/scene/lodglobes/saturn/saturn.mod
deleted file mode 100644
index dc1ef691eb..0000000000
--- a/data/scene/lodglobes/saturn/saturn.mod
+++ /dev/null
@@ -1,72 +0,0 @@
-return {
- -- Barycenter module
- {
- Name = "SaturnBarycenter",
- Parent = "SolarSystemBarycenter",
- Transform = {
- Translation = {
- Type = "SpiceTranslation",
- Body = "SATURN BARYCENTER",
- Observer = "SUN",
- Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp"
- },
- },
- },
- -- RenderableGlobe module
- {
- Name = "Saturn",
- Parent = "SaturnBarycenter",
- Transform = {
- Rotation = {
- Type = "SpiceRotation",
- SourceFrame = "IAU_SATURN",
- DestinationFrame = "GALACTIC",
- },
- Scale = {
- Type = "StaticScale",
- Scale = 1,
- },
- -- No translation, Saturn is in its barycenter
- },
- Renderable = {
- Type = "RenderableGlobe",
- Radii = {60268000, 60268000, 54364000},
- SegmentsPerPatch = 64,
- Layers = {
- ColorLayers = {
- {
- Name = "Saturn Texture",
- FilePath = "textures/saturn.jpg",
- Enabled = true,
- },
- },
- },
- },
- },
- {
- Name = "SaturnRings",
- Parent = "Saturn",
- Renderable = {
- Type = "RenderableRings",
- Texture = "textures/saturn_rings.png",
- Size = 140220000,
- Offset = { 74500 / 140445.100671159, 1.0 } -- min / max extend
- },
- },
- -- Trail module
- {
- Name = "SaturnTrail",
- Parent = "SolarSystemBarycenter",
- Renderable = {
- Type = "RenderableTrailOrbit",
- Translation = {
- Type = "SpiceTranslation",
- Body = "SATURN BARYCENTER",
- Observer = "SUN",
- },
- Color = {0.85,0.75,0.51 },
- Period = 10746.94,
- Resolution = 1000
- },
- }
-}
diff --git a/data/scene/lodglobes/uranus/uranus.data b/data/scene/lodglobes/uranus/uranus.data
deleted file mode 100644
index 1260617597..0000000000
--- a/data/scene/lodglobes/uranus/uranus.data
+++ /dev/null
@@ -1,5 +0,0 @@
-return {
- FileRequest = {
- { Identifier = "uranus_textures", Destination = "textures", Version = 1 }
- },
-}
\ No newline at end of file
diff --git a/data/scene/lodglobes/uranus/uranus.mod b/data/scene/lodglobes/uranus/uranus.mod
deleted file mode 100644
index b8cda62a16..0000000000
--- a/data/scene/lodglobes/uranus/uranus.mod
+++ /dev/null
@@ -1,62 +0,0 @@
-return {
- -- Barycenter module
- {
- Name = "UranusBarycenter",
- Parent = "SolarSystemBarycenter",
- Transform = {
- Translation = {
- Type = "SpiceTranslation",
- Body = "URANUS BARYCENTER",
- Observer = "SUN",
- Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp"
- },
- },
- },
- -- RenderableGlobe module
- {
- Name = "Uranus",
- Parent = "UranusBarycenter",
- Transform = {
- Rotation = {
- Type = "SpiceRotation",
- SourceFrame = "IAU_URANUS",
- DestinationFrame = "GALACTIC",
- },
- Scale = {
- Type = "StaticScale",
- Scale = 1,
- },
- -- No translation, Uranus is in its barycenter
- },
- Renderable = {
- Type = "RenderableGlobe",
- Radii = {25559000, 25559000, 24973000},
- SegmentsPerPatch = 64,
- Layers = {
- ColorLayers = {
- {
- Name = "Texture",
- FilePath = "textures/uranus.jpg",
- Enabled = true,
- },
- },
- },
- },
- },
- -- Trail module
- {
- Name = "UranusTrail",
- Parent = "SolarSystemBarycenter",
- Renderable = {
- Type = "RenderableTrailOrbit",
- Translation = {
- Type = "SpiceTranslation",
- Body = "URANUS BARYCENTER",
- Observer = "SUN",
- },
- Color = {0.60, 0.95, 1.00 },
- Period = 30588.740,
- Resolution = 1000
- },
- }
-}
diff --git a/data/scene/lodglobes/venus/venus.data b/data/scene/lodglobes/venus/venus.data
deleted file mode 100644
index 07753359f6..0000000000
--- a/data/scene/lodglobes/venus/venus.data
+++ /dev/null
@@ -1,5 +0,0 @@
-return {
- FileRequest = {
- { Identifier = "venus_textures", Destination = "textures", Version = 1 }
- },
-}
\ No newline at end of file
diff --git a/data/scene/lodglobes/venus/venus.mod b/data/scene/lodglobes/venus/venus.mod
deleted file mode 100644
index 285f88f466..0000000000
--- a/data/scene/lodglobes/venus/venus.mod
+++ /dev/null
@@ -1,67 +0,0 @@
-return {
- -- Barycenter module
- {
- Name = "VenusBarycenter",
- Parent = "SolarSystemBarycenter",
- Transform = {
- Translation = {
- Type = "SpiceTranslation",
- Body = "VENUS BARYCENTER",
- Observer = "SUN",
- Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp"
- },
- },
- },
- -- RenderableGlobe module
- {
- Name = "Venus",
- Parent = "VenusBarycenter",
- Transform = {
- Rotation = {
- Type = "SpiceRotation",
- SourceFrame = "IAU_VENUS",
- DestinationFrame = "GALACTIC",
- },
- Scale = {
- Type = "StaticScale",
- Scale = 1,
- },
- Translation = {
- Type = "SpiceTranslation",
- Body = "VENUS",
- Observer = "VENUS BARYCENTER",
- Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp"
- },
- },
- Renderable = {
- Type = "RenderableGlobe",
- Radii = {6051900, 6051900, 6051800},
- SegmentsPerPatch = 64,
- Layers = {
- ColorLayers = {
- {
- Name = "Venus Texture",
- FilePath = "textures/venus.jpg",
- Enabled = true,
- },
- },
- },
- },
- },
- -- Trail module
- {
- Name = "VenusTrail",
- Parent = "SolarSystemBarycenter",
- Renderable = {
- Type = "RenderableTrailOrbit",
- Translation = {
- Type = "SpiceTranslation",
- Body = "VENUS BARYCENTER",
- Observer = "SUN",
- },
- Color = { 1.0, 0.5, 0.2 },
- Period = 224.695,
- Resolution = 1000
- },
- }
-}
diff --git a/data/scene/lodglobes/mars/map_service_configs/CTX_Mosaic.xml b/data/scene/mars/map_service_configs/CTX_Mosaic.xml
similarity index 100%
rename from data/scene/lodglobes/mars/map_service_configs/CTX_Mosaic.xml
rename to data/scene/mars/map_service_configs/CTX_Mosaic.xml
diff --git a/data/scene/lodglobes/mars/map_service_configs/MARS_Viking.xml b/data/scene/mars/map_service_configs/MARS_Viking.xml
similarity index 100%
rename from data/scene/lodglobes/mars/map_service_configs/MARS_Viking.xml
rename to data/scene/mars/map_service_configs/MARS_Viking.xml
diff --git a/data/scene/lodglobes/mars/map_service_configs/MARS_Viking_MDIM21.xml b/data/scene/mars/map_service_configs/MARS_Viking_MDIM21.xml
similarity index 100%
rename from data/scene/lodglobes/mars/map_service_configs/MARS_Viking_MDIM21.xml
rename to data/scene/mars/map_service_configs/MARS_Viking_MDIM21.xml
diff --git a/data/scene/lodglobes/mars/map_service_configs/MDIM21_color.xml b/data/scene/mars/map_service_configs/MDIM21_color.xml
similarity index 100%
rename from data/scene/lodglobes/mars/map_service_configs/MDIM21_color.xml
rename to data/scene/mars/map_service_configs/MDIM21_color.xml
diff --git a/data/scene/lodglobes/mars/map_service_configs/Mars_MGS_MOLA_DEM.xml b/data/scene/mars/map_service_configs/Mars_MGS_MOLA_DEM.xml
similarity index 100%
rename from data/scene/lodglobes/mars/map_service_configs/Mars_MGS_MOLA_DEM.xml
rename to data/scene/mars/map_service_configs/Mars_MGS_MOLA_DEM.xml
diff --git a/data/scene/lodglobes/mars/map_service_configs/Mola_Elevation.xml b/data/scene/mars/map_service_configs/Mola_Elevation.xml
similarity index 100%
rename from data/scene/lodglobes/mars/map_service_configs/Mola_Elevation.xml
rename to data/scene/mars/map_service_configs/Mola_Elevation.xml
diff --git a/data/scene/lodglobes/mars/map_service_configs/Utah/CTX_Mosaic.xml b/data/scene/mars/map_service_configs/Utah/CTX_Mosaic.xml
similarity index 100%
rename from data/scene/lodglobes/mars/map_service_configs/Utah/CTX_Mosaic.xml
rename to data/scene/mars/map_service_configs/Utah/CTX_Mosaic.xml
diff --git a/data/scene/lodglobes/mars/map_service_configs/Utah/Mdim.xml b/data/scene/mars/map_service_configs/Utah/Mdim.xml
similarity index 100%
rename from data/scene/lodglobes/mars/map_service_configs/Utah/Mdim.xml
rename to data/scene/mars/map_service_configs/Utah/Mdim.xml
diff --git a/data/scene/lodglobes/mars/map_service_configs/Utah/MolaCTX_Elevation.xml b/data/scene/mars/map_service_configs/Utah/MolaCTX_Elevation.xml
similarity index 100%
rename from data/scene/lodglobes/mars/map_service_configs/Utah/MolaCTX_Elevation.xml
rename to data/scene/mars/map_service_configs/Utah/MolaCTX_Elevation.xml
diff --git a/data/scene/lodglobes/mars/map_service_configs/Utah/MolaPseudoColor.xml b/data/scene/mars/map_service_configs/Utah/MolaPseudoColor.xml
similarity index 100%
rename from data/scene/lodglobes/mars/map_service_configs/Utah/MolaPseudoColor.xml
rename to data/scene/mars/map_service_configs/Utah/MolaPseudoColor.xml
diff --git a/data/scene/lodglobes/mars/map_service_configs/Utah/Mola_Elevation.xml b/data/scene/mars/map_service_configs/Utah/Mola_Elevation.xml
similarity index 100%
rename from data/scene/lodglobes/mars/map_service_configs/Utah/Mola_Elevation.xml
rename to data/scene/mars/map_service_configs/Utah/Mola_Elevation.xml
diff --git a/data/scene/lodglobes/mars/map_service_configs/Utah/ThemisIRDay.xml b/data/scene/mars/map_service_configs/Utah/ThemisIRDay.xml
similarity index 100%
rename from data/scene/lodglobes/mars/map_service_configs/Utah/ThemisIRDay.xml
rename to data/scene/mars/map_service_configs/Utah/ThemisIRDay.xml
diff --git a/data/scene/lodglobes/mars/map_service_configs/Utah/ThemisIRNight.xml b/data/scene/mars/map_service_configs/Utah/ThemisIRNight.xml
similarity index 100%
rename from data/scene/lodglobes/mars/map_service_configs/Utah/ThemisIRNight.xml
rename to data/scene/mars/map_service_configs/Utah/ThemisIRNight.xml
diff --git a/data/scene/mars/mars.mod b/data/scene/mars/mars.mod
index 301f510e5f..dbcaf7838f 100644
--- a/data/scene/mars/mars.mod
+++ b/data/scene/mars/mars.mod
@@ -1,54 +1,81 @@
+local marsEllipsoid = {3396190.0, 3396190.0, 3376200.0}
+
return {
- -- Mars barycenter module
+ -- Barycenter module
{
Name = "MarsBarycenter",
Parent = "SolarSystemBarycenter",
Transform = {
Translation = {
Type = "SpiceTranslation",
- Body = "MARS BARYCENTER",
+ Target = "MARS BARYCENTER",
Observer = "SUN",
Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp"
}
}
},
- -- Mars module
+ -- RenderableGlobe module
{
Name = "Mars",
Parent = "MarsBarycenter",
- Renderable = {
- Type = "RenderablePlanet",
- Frame = "IAU_MARS",
- Body = "MARS BARYCENTER",
- Geometry = {
- Type = "SimpleSphere",
- Radius = 6.390E6,
- Segments = 100
- },
- Textures = {
- Type = "simple",
- Color = "textures/mars.jpg",
- },
- Atmosphere = {
- Type = "Nishita", -- for example, values missing etc etc
- MieFactor = 1.0,
- MieColor = {1.0, 1.0, 1.0}
- }
- },
- Tag = {"planet_solarSystem", "planet_terrestrial"},
Transform = {
Rotation = {
Type = "SpiceRotation",
SourceFrame = "IAU_MARS",
- DestinationFrame = "GALACTIC",
- },
- Scale = {
- Type = "StaticScale",
- Scale = 1,
- },
- }
+ DestinationFrame = "GALACTIC"
+ }
+ },
+ Renderable = {
+ Type = "RenderableGlobe",
+ Radii = marsEllipsoid,
+ SegmentsPerPatch = 90,
+ Layers = {
+ ColorLayers = {
+ {
+ Name = "Viking",
+ FilePath = "map_service_configs/MARS_Viking_MDIM21.xml",
+ Enabled = true,
+ },
+ {
+ Name = "MOLA Pseudo Color",
+ FilePath = "map_service_configs/Utah/MolaPseudoColor.xml"
+ },
+ {
+ Name = "CTX Mosaic [Europe]",
+ FilePath = "map_service_configs/CTX_Mosaic.xml",
+ BlendMode = "Color"
+ },
+ {
+ Name = "CTX Mosaic [Utah]",
+ FilePath = "map_service_configs/Utah/CTX_Mosaic.xml",
+ BlendMode = "Color"
+ }
+ },
+ Overlays = {
+ {
+ Type = "TileIndexTileLayer",
+ Name = "Indices"
+ },
+ {
+ Type = "SizeReferenceTileLayer",
+ Name = "Size Reference",
+ Radii = marsEllipsoid
+ }
+ },
+ HeightLayers = {
+ {
+ Name = "Mola Elevation [Europe]",
+ FilePath = "map_service_configs/Mola_Elevation.xml",
+ Enabled = true,
+ TilePixelSize = 90
+ }
+ }
+ }
+ },
+ Tag = { "planet_solarSystem", "planet_terrestrial" },
},
- -- MarsTrail module
+
+ -- Trail module
{
Name = "MarsTrail",
Parent = "SolarSystemBarycenter",
@@ -56,13 +83,13 @@ return {
Type = "RenderableTrailOrbit",
Translation = {
Type = "SpiceTranslation",
- Body = "MARS BARYCENTER",
- Observer = "SUN",
+ Target = "MARS BARYCENTER",
+ Observer = "SUN"
},
Color = { 0.814, 0.305, 0.220 },
Period = 686.973,
- Resolution = 1000,
- Tag = {"planetTrail_solarSystem", "planetTrail_terrestrial"}
- }
+ Resolution = 1000
+ },
+ Tag = { "planetTrail_solarSystem", "planetTrail_terrestrial" }
}
}
diff --git a/data/scene/lodglobes/mercury/map_service_configs/OnMercuryColor.xml b/data/scene/mercury/map_service_configs/OnMercuryColor.xml
similarity index 100%
rename from data/scene/lodglobes/mercury/map_service_configs/OnMercuryColor.xml
rename to data/scene/mercury/map_service_configs/OnMercuryColor.xml
diff --git a/data/scene/lodglobes/mercury/map_service_configs/OnMercuryElevationGaskell.xml b/data/scene/mercury/map_service_configs/OnMercuryElevationGaskell.xml
similarity index 100%
rename from data/scene/lodglobes/mercury/map_service_configs/OnMercuryElevationGaskell.xml
rename to data/scene/mercury/map_service_configs/OnMercuryElevationGaskell.xml
diff --git a/data/scene/lodglobes/mercury/map_service_configs/OnMercuryImage.xml b/data/scene/mercury/map_service_configs/OnMercuryImage.xml
similarity index 100%
rename from data/scene/lodglobes/mercury/map_service_configs/OnMercuryImage.xml
rename to data/scene/mercury/map_service_configs/OnMercuryImage.xml
diff --git a/data/scene/lodglobes/mercury/map_service_configs/Utah/MessengerMdis.wms b/data/scene/mercury/map_service_configs/Utah/MessengerMdis.wms
similarity index 100%
rename from data/scene/lodglobes/mercury/map_service_configs/Utah/MessengerMdis.wms
rename to data/scene/mercury/map_service_configs/Utah/MessengerMdis.wms
diff --git a/data/scene/lodglobes/mercury/map_service_configs/Utah/MessengerMosaic.wms b/data/scene/mercury/map_service_configs/Utah/MessengerMosaic.wms
similarity index 100%
rename from data/scene/lodglobes/mercury/map_service_configs/Utah/MessengerMosaic.wms
rename to data/scene/mercury/map_service_configs/Utah/MessengerMosaic.wms
diff --git a/data/scene/mercury/mercury.data b/data/scene/mercury/mercury.data
deleted file mode 100644
index f2df36620b..0000000000
--- a/data/scene/mercury/mercury.data
+++ /dev/null
@@ -1,5 +0,0 @@
-return {
- FileRequest = {
- { Identifier = "mercury_textures", Destination = "textures", Version = 1 }
- },
-}
\ No newline at end of file
diff --git a/data/scene/mercury/mercury.mod b/data/scene/mercury/mercury.mod
index 61d5c6ff8b..7f825463d8 100644
--- a/data/scene/mercury/mercury.mod
+++ b/data/scene/mercury/mercury.mod
@@ -1,54 +1,52 @@
return {
- -- Mercury barycenter module
+ -- Barycenter module
{
Name = "MercuryBarycenter",
Parent = "SolarSystemBarycenter",
Transform = {
Translation = {
Type = "SpiceTranslation",
- Body = "MERCURY BARYCENTER",
+ Target = "MERCURY",
Observer = "SUN",
Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp"
- },
+ }
}
},
- -- Mercury module
+ -- RenderableGlobe module
{
Name = "Mercury",
Parent = "MercuryBarycenter",
- Renderable = {
- Type = "RenderablePlanet",
- Frame = "IAU_MERCURY",
- Body = "MERCURY",
- Geometry = {
- Type = "SimpleSphere",
- Radius = 2.4397E6,
- Segments = 100
- },
- Textures = {
- Type = "simple",
- Color = "textures/mercury.jpg",
- },
- Atmosphere = {
- Type = "Nishita", -- for example, values missing etc etc
- MieFactor = 1.0,
- MieColor = {1.0, 1.0, 1.0}
- }
- },
- Tag = {"planet_solarSystem", "planet_terrestrial"},
Transform = {
Rotation = {
Type = "SpiceRotation",
SourceFrame = "IAU_MERCURY",
- DestinationFrame = "ECLIPJ2000",
- },
- Scale = {
- Type = "StaticScale",
- Scale = 1,
- },
- }
+ DestinationFrame = "GALACTIC"
+ }
+ },
+ Renderable = {
+ Type = "RenderableGlobe",
+ Radii = 2439700,
+ Frame = "IAU_MERCURY",
+ Body = "MERCURY",
+ CameraMinHeight = 300,
+ SegmentsPerPatch = 64,
+ Layers = {
+ ColorLayers = {
+ {
+ Name = "Messenger_MDIS",
+ FilePath = "map_service_configs/Utah/MessengerMDIS.wms",
+ Enabled = true
+ },
+ {
+ Name = "Messenger_Mosaic",
+ FilePath = "map_service_configs/Utah/MessengerMosaic.wms"
+ }
+ }
+ }
+ },
+ Tag = { "planet_solarSystem", "planet_terrestrial" },
},
- -- MercuryTrail module
+ -- Trail module
{
Name = "MercuryTrail",
Parent = "SolarSystemBarycenter",
@@ -56,13 +54,13 @@ return {
Type = "RenderableTrailOrbit",
Translation = {
Type = "SpiceTranslation",
- Body = "MERCURY",
+ Target = "MERCURY",
Observer = "SUN",
},
Color = {0.6, 0.5, 0.5 },
Period = 87.968,
- Resolution = 100,
- Tag = {"planetTrail_solarSystem", "planetTrail_terrestrial"}
- }
+ Resolution = 100
+ },
+ Tag = { "planetTrail_solarSystem", "planetTrail_terrestrial" }
}
}
diff --git a/data/scene/milkyway/milkyway.data b/data/scene/milkyway/digitaluniverse/digitaluniverse.data
similarity index 100%
rename from data/scene/milkyway/milkyway.data
rename to data/scene/milkyway/digitaluniverse/digitaluniverse.data
diff --git a/data/scene/milkyway/milkyway.mod b/data/scene/milkyway/digitaluniverse/digitaluniverse.mod
similarity index 100%
rename from data/scene/milkyway/milkyway.mod
rename to data/scene/milkyway/digitaluniverse/digitaluniverse.mod
diff --git a/data/scene/milkyway-eso/milkyway-eso.data b/data/scene/milkyway/eso/eso.data
similarity index 100%
rename from data/scene/milkyway-eso/milkyway-eso.data
rename to data/scene/milkyway/eso/eso.data
diff --git a/data/scene/milkyway-eso/milkyway-eso.mod b/data/scene/milkyway/eso/eso.mod
similarity index 100%
rename from data/scene/milkyway-eso/milkyway-eso.mod
rename to data/scene/milkyway/eso/eso.mod
diff --git a/data/scene/missions/dawn/ceres/ceres.mod b/data/scene/missions/dawn/ceres/ceres.mod
index 0c29ae852b..775b94dae8 100644
--- a/data/scene/missions/dawn/ceres/ceres.mod
+++ b/data/scene/missions/dawn/ceres/ceres.mod
@@ -13,10 +13,7 @@ return {
Radius = 6.390E5,
Segments = 100
},
- Textures = {
- Type = "simple",
- Color = "textures/gray.png",
- },
+ ColorTexture = "textures/gray.png",
StartTime = "2010 JAN 01 00:00:00",
EndTime = "2018 JAN 22 12:00:00"
},
diff --git a/data/scene/missions/dawn/dawn/dawn.mod b/data/scene/missions/dawn/dawn/dawn.mod
index 3d4a14e917..54aae8158d 100644
--- a/data/scene/missions/dawn/dawn/dawn.mod
+++ b/data/scene/missions/dawn/dawn/dawn.mod
@@ -11,10 +11,7 @@ return {
Type = "MultiModelGeometry",
GeometryFile = "${OPENSPACE_DATA}/scene/dawn/obj/mainbodydawn.obj",
},
- Textures = {
- Type = "simple",
- Color = "textures/gray.png",
- },
+ ColorTexture = "textures/gray.png",
Rotation = {
Source = "DAWN_SPACECRAFT",
Destination = "GALACTIC"
@@ -634,10 +631,7 @@ return {
Type = "MultiModelGeometry",
GeometryFile = "${OPENSPACE_DATA}/scene/dawn/obj/solarpanelleft.obj",
},
- Textures = {
- Type = "simple",
- Color = "textures/gray.png",
- },
+ ColorTexture = "textures/gray.png",
Rotation = {
Source = "DAWN_SA-Y",
Destination = "GALACTIC"
@@ -657,10 +651,7 @@ return {
Type = "MultiModelGeometry",
GeometryFile = "${OPENSPACE_DATA}/scene/dawn/obj/solarpanelright.obj",
},
- Textures = {
- Type = "simple",
- Color = "textures/gray.png",
- },
+ ColorTexture = "textures/gray.png",
Rotation = {
Source = "DAWN_SA+Y",
Destination = "GALACTIC"
@@ -703,7 +694,7 @@ return {
Type = "RenderableTrailTrajectory",
Translation = {
Type = "SpiceTranslation",
- Body = "DAWN",
+ Target = "DAWN",
Observer = "SUN",
},
Color = { 0.7, 0.4, 0.9 },
diff --git a/data/scene/missions/dawn/vestaprojection/vestaprojection.mod b/data/scene/missions/dawn/vestaprojection/vestaprojection.mod
index f0b8cc87b6..379d0272c2 100644
--- a/data/scene/missions/dawn/vestaprojection/vestaprojection.mod
+++ b/data/scene/missions/dawn/vestaprojection/vestaprojection.mod
@@ -11,9 +11,9 @@ return {
Type = "MultiModelGeometry",
GeometryFile = "${OPENSPACE_DATA}/scene/vestaprojection_2/obj/VestaComet_5000.obj",
},
+ ColorTexture = "textures/dummy.jpg",
Textures = {
Type = "simple",
- Color = "textures/dummy.jpg",
Project = "textures/projectMe.png",
Default = "textures/defaultProj_backup.png"
},
@@ -103,7 +103,7 @@ return {
Type = "RenderableTrailOrbit",
Translation = {
Type = "SpiceTranslation",
- Body = "VESTA",
+ Target = "VESTA",
Observer = "SUN",
},
Color = { 0.7, 0.8, 0.7 },
diff --git a/data/scene/missions/juno/juno/juno.mod b/data/scene/missions/juno/juno/juno.mod
index 823c8f9339..8ef710ddcc 100644
--- a/data/scene/missions/juno/juno/juno.mod
+++ b/data/scene/missions/juno/juno/juno.mod
@@ -13,10 +13,7 @@ return {
GeometryFile = "Juno.obj",
Magnification = 4,
},
- Textures = {
- Type = "simple",
- Color = "textures/gray.png",
- },
+ ColorTexture = "textures/gray.png",
Rotation = {
Source = "JUNO_SPACECRAFT",
Destination = "GALACTIC",
@@ -129,7 +126,7 @@ return {
Type = "RenderableTrailTrajectory",
Translation = {
Type = "SpiceTranslation",
- Body = "JUNO",
+ Target = "JUNO",
Observer = "JUPITER BARYCENTER"
},
Color = { 0.70, 0.50, 0.20 },
diff --git a/data/scene/missions/newhorizons/jupiter/callisto/callisto.mod b/data/scene/missions/newhorizons/jupiter/callisto/callisto.mod
index 3a51e4c5bb..25facc74d4 100644
--- a/data/scene/missions/newhorizons/jupiter/callisto/callisto.mod
+++ b/data/scene/missions/newhorizons/jupiter/callisto/callisto.mod
@@ -15,9 +15,9 @@ return {
Radius = callisto_radius,
Segments = 100
},
+ ColorTexture = "textures/callisto.jpg",
Textures = {
Type = "simple",
- Color = "textures/callisto.jpg",
Project = "textures/defaultProj.png",
Sequencing = "true",
},
@@ -45,7 +45,7 @@ return {
Transform = {
Translation = {
Type = "SpiceTranslation",
- Body = "CALLISTO",
+ Target = "CALLISTO",
Observer = "JUPITER BARYCENTER",
Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp"
},
@@ -88,7 +88,7 @@ return {
Type = "RenderableTrailOrbit",
Translation = {
Type = "SpiceTranslation",
- Body = "CALLISTO",
+ Target = "CALLISTO",
Observer = "JUPITER BARYCENTER",
},
Color = { 0.4, 0.3, 0.01 },
diff --git a/data/scene/missions/newhorizons/jupiter/europa/europa.mod b/data/scene/missions/newhorizons/jupiter/europa/europa.mod
index 37a137fdb0..8d0fbe1039 100644
--- a/data/scene/missions/newhorizons/jupiter/europa/europa.mod
+++ b/data/scene/missions/newhorizons/jupiter/europa/europa.mod
@@ -15,9 +15,9 @@ return {
Radius = europa_radius,
Segments = 100
},
+ ColorTexture = "textures/europa.jpg",
Textures = {
Type = "simple",
- Color = "textures/europa.jpg",
Project = "textures/defaultProj.png",
Sequencing = "true",
},
@@ -45,7 +45,7 @@ return {
Transform = {
Translation = {
Type = "SpiceTranslation",
- Body = "EUROPA",
+ Target = "EUROPA",
Observer = "JUPITER BARYCENTER",
Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp"
},
@@ -88,7 +88,7 @@ return {
Type = "RenderableTrailOrbit",
Translation = {
Type = "SpiceTranslation",
- Body = "EUROPA",
+ Target = "EUROPA",
Observer = "JUPITER BARYCENTER",
},
Color = { 0.5, 0.3, 0.3 },
diff --git a/data/scene/missions/newhorizons/jupiter/ganymede/ganymede.mod b/data/scene/missions/newhorizons/jupiter/ganymede/ganymede.mod
index 9d16289f9b..fe5facac2b 100644
--- a/data/scene/missions/newhorizons/jupiter/ganymede/ganymede.mod
+++ b/data/scene/missions/newhorizons/jupiter/ganymede/ganymede.mod
@@ -15,9 +15,9 @@ return {
Radius = ganymede_local,
Segments = 100
},
+ ColorTexture = "textures/ganymede.jpg",
Textures = {
Type = "simple",
- Color = "textures/ganymede.jpg",
Project = "textures/defaultProj.png",
Sequencing = "true",
},
@@ -45,7 +45,7 @@ return {
Transform = {
Translation = {
Type = "SpiceTranslation",
- Body = "GANYMEDE",
+ Target = "GANYMEDE",
Observer = "JUPITER BARYCENTER",
Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp"
},
@@ -82,7 +82,7 @@ return {
Type = "RenderableTrailOrbit",
Translation = {
Type = "SpiceTranslation",
- Body = "GANYMEDE",
+ Target = "GANYMEDE",
Observer = "JUPITER BARYCENTER",
},
Color = { 0.4, 0.3, 0.3 },
diff --git a/data/scene/missions/newhorizons/jupiter/io/io.mod b/data/scene/missions/newhorizons/jupiter/io/io.mod
index 60ed022544..c8bc937554 100644
--- a/data/scene/missions/newhorizons/jupiter/io/io.mod
+++ b/data/scene/missions/newhorizons/jupiter/io/io.mod
@@ -15,9 +15,9 @@ return {
Radius = io_radius,
Segments = 100
},
+ ColorTexture = "textures/io.jpg",
Textures = {
Type = "simple",
- Color = "textures/io.jpg",
Project = "textures/defaultProj.png",
Sequencing = "true",
},
@@ -45,7 +45,7 @@ return {
Transform = {
Translation = {
Type = "SpiceTranslation",
- Body = "IO",
+ Target = "IO",
Observer = "JUPITER BARYCENTER",
Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp"
},
@@ -98,7 +98,7 @@ return {
Type = "RenderableTrailOrbit",
Translation = {
Type = "SpiceTranslation",
- Body = "IO",
+ Target = "IO",
Observer = "JUPITER BARYCENTER",
},
Color = { 0.4, 0.4, 0.2 },
diff --git a/data/scene/missions/newhorizons/jupiter/jupiter/jupiter.mod b/data/scene/missions/newhorizons/jupiter/jupiter/jupiter.mod
index f4fbe278f0..f611aa5542 100644
--- a/data/scene/missions/newhorizons/jupiter/jupiter/jupiter.mod
+++ b/data/scene/missions/newhorizons/jupiter/jupiter/jupiter.mod
@@ -8,7 +8,7 @@ return {
Transform = {
Translation = {
Type = "SpiceTranslation",
- Body = "JUPITER BARYCENTER",
+ Target = "JUPITER BARYCENTER",
Observer = "SUN",
Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp"
},
@@ -28,9 +28,9 @@ return {
Radius = jupiter_local,
Segments = 200,
},
+ ColorTexture = "textures/jupiterFlipped_low.jpg",
Textures = {
Type = "simple",
- Color = "textures/jupiterFlipped_low.jpg",
Project = "textures/lorriTest1.jpg",
Sequencing = "true",
},
@@ -125,7 +125,7 @@ return {
Type = "RenderableTrailOrbit",
Translation = {
Type = "SpiceTranslation",
- Body = "JUPITER BARYCENTER",
+ Target = "JUPITER BARYCENTER",
Observer = "SUN",
},
Color = { 0.8, 0.7, 0.7 },
diff --git a/data/scene/missions/newhorizons/newhorizons/newhorizons.mod b/data/scene/missions/newhorizons/newhorizons/newhorizons.mod
index 3e00eac771..d15b46d79d 100644
--- a/data/scene/missions/newhorizons/newhorizons/newhorizons.mod
+++ b/data/scene/missions/newhorizons/newhorizons/newhorizons.mod
@@ -74,7 +74,7 @@ return {
Transform = {
Translation = {
Type = "SpiceTranslation",
- Body = "NEW HORIZONS",
+ Target = "NEW HORIZONS",
Observer = "SUN",
Kernels = NewHorizonsKernels
},
@@ -98,10 +98,7 @@ return {
GeometryFile = "models/NewHorizonsCleanModel.obj",
-- Magnification = 4,
},
- Textures = {
- Type = "simple",
- Color = "textures/NHTexture.jpg",
- },
+ ColorTexture = "textures/NHTexture.jpg",
Shading = {
PerformShading = true,
Fadeable = false,
@@ -145,9 +142,9 @@ return {
GeometryFile = "models/Labels.obj",
-- Magnification = 4,
},
+ ColorTexture = "textures/labels.png",
Textures = {
Type = "simple",
- Color = "textures/labels.png",
BumpMap = "textures/goldfoilbump.tif"
},
Rotation = {
@@ -168,7 +165,7 @@ return {
Type = "RenderableTrailTrajectory",
Translation = {
Type = "SpiceTranslation",
- Body = "NEW HORIZONS",
+ Target = "NEW HORIZONS",
Observer = "PLUTO BARYCENTER"
},
Color = { 1.0, 0.8, 0.4 },
diff --git a/data/scene/missions/newhorizons/pluto/charon/charon.mod b/data/scene/missions/newhorizons/pluto/charon/charon.mod
index 1813547e25..2f611209cb 100644
--- a/data/scene/missions/newhorizons/pluto/charon/charon.mod
+++ b/data/scene/missions/newhorizons/pluto/charon/charon.mod
@@ -31,10 +31,8 @@ return {
Radius = charon_radius,
Segments = 100
},
- Textures = {
- Color = ColorTexture,
- Height = "textures/cpdem-Mcolor2-MLorriCA-lr-5_ZMfs-cyl.jpg",
- },
+ ColorTexture = ColorTexture,
+ HeightTexture = "textures/cpdem-Mcolor2-MLorriCA-lr-5_ZMfs-cyl.jpg",
Projection = {
Observer = "NEW HORIZONS",
Target = "CHARON",
@@ -60,7 +58,7 @@ return {
Transform = {
Translation = {
Type = "SpiceTranslation",
- Body = "CHARON",
+ Target = "CHARON",
Observer = "PLUTO BARYCENTER",
Kernels = NewHorizonsKernels
},
@@ -99,7 +97,6 @@ return {
Observer = "NEW HORIZONS",
Body = "CHARON",
BodyFrame = "IAU_CHARON",
- MainFrame = "GALACTIC",
Aberration = "NONE",
},
},
@@ -111,7 +108,7 @@ return {
Type = "RenderableTrailOrbit",
Translation = {
Type = "SpiceTranslation",
- Body = "CHARON",
+ Target = "CHARON",
Observer = "PLUTO BARYCENTER",
},
Color = {0.00, 0.62, 1.00},
diff --git a/data/scene/missions/newhorizons/pluto/hydra/hydra.mod b/data/scene/missions/newhorizons/pluto/hydra/hydra.mod
index 9418f4ceb4..b6d7101c42 100644
--- a/data/scene/missions/newhorizons/pluto/hydra/hydra.mod
+++ b/data/scene/missions/newhorizons/pluto/hydra/hydra.mod
@@ -25,15 +25,12 @@ return {
Radius = charon_radius,
Segments = 100
},
- Textures = {
- Type = "simple",
- Color = "textures/gray.jpg",
- }
+ ColorTexture = "textures/gray.jpg",
},
Transform = {
Translation = {
Type = "SpiceTranslation",
- Body = "HYDRA",
+ Target = "HYDRA",
Observer = "PLUTO BARYCENTER",
Kernels = NewHorizonsKernels
},
@@ -69,7 +66,7 @@ return {
Type = "RenderableTrailOrbit",
Translation = {
Type = "SpiceTranslation",
- Body = "HYDRA",
+ Target = "HYDRA",
Observer = "PLUTO BARYCENTER",
},
Color = {0.00, 0.62, 1.00},
diff --git a/data/scene/missions/newhorizons/pluto/kerberos/kerberos.mod b/data/scene/missions/newhorizons/pluto/kerberos/kerberos.mod
index 9dab2c556f..f75c930f0d 100644
--- a/data/scene/missions/newhorizons/pluto/kerberos/kerberos.mod
+++ b/data/scene/missions/newhorizons/pluto/kerberos/kerberos.mod
@@ -25,15 +25,12 @@ return {
Radius = kerberos_radius,
Segments = 100
},
- Textures = {
- Type = "simple",
- Color = "textures/gray.jpg",
- }
+ ColorTexture = "textures/gray.jpg",
},
Transform = {
Translation = {
Type = "SpiceTranslation",
- Body = "KERBEROS",
+ Target = "KERBEROS",
Observer = "PLUTO BARYCENTER",
Kernels = NewHorizonsKernels
},
@@ -69,7 +66,7 @@ return {
Type = "RenderableTrailOrbit",
Translation = {
Type = "SpiceTranslation",
- Body = "KERBEROS",
+ Target = "KERBEROS",
Observer = "PLUTO BARYCENTER",
},
Color = {0.00, 0.62, 1.00},
diff --git a/data/scene/missions/newhorizons/pluto/nix/nix.mod b/data/scene/missions/newhorizons/pluto/nix/nix.mod
index 5ea9374cf0..f5c75c866f 100644
--- a/data/scene/missions/newhorizons/pluto/nix/nix.mod
+++ b/data/scene/missions/newhorizons/pluto/nix/nix.mod
@@ -25,15 +25,12 @@ return {
Radius = nix_radius,
Segments = 100
},
- Textures = {
- Type = "simple",
- Color = "textures/gray.jpg",
- }
+ ColorTexture = "textures/gray.jpg",
},
Transform = {
Translation = {
Type = "SpiceTranslation",
- Body = "NIX",
+ Target = "NIX",
Observer = "PLUTO BARYCENTER",
Kernels = NewHorizonsKernels
},
@@ -63,7 +60,7 @@ return {
Type = "RenderableTrailOrbit",
Translation = {
Type = "SpiceTranslation",
- Body = "NIX",
+ Target = "NIX",
Observer = "PLUTO BARYCENTER",
},
Color = {0.00, 0.62, 1.00},
diff --git a/data/scene/missions/newhorizons/pluto/pluto/pluto.mod b/data/scene/missions/newhorizons/pluto/pluto/pluto.mod
index 4e54ff8b2a..5077ef65af 100644
--- a/data/scene/missions/newhorizons/pluto/pluto/pluto.mod
+++ b/data/scene/missions/newhorizons/pluto/pluto/pluto.mod
@@ -26,7 +26,7 @@ return {
Transform = {
Translation = {
Type = "SpiceTranslation",
- Body = "PLUTO BARYCENTER",
+ Target = "PLUTO BARYCENTER",
Observer = "SUN",
Kernels = NewHorizonsKernels
},
@@ -44,10 +44,8 @@ return {
Radius = pluto_radius,
Segments = 100
},
- Textures = {
- Color = ColorTexture,
- Height = "textures/pluto_shenk_heightmap.jpg",
- },
+ ColorTexture = ColorTexture,
+ HeightTexture = "textures/pluto_shenk_heightmap.jpg",
Projection = {
Sequence = "${OPENSPACE_DATA}/scene/missions/newhorizons/pluto/pluto/images",
EventFile = "${OPENSPACE_DATA}/scene/missions/newhorizons/pluto/pluto/assets/core_v9h_obs_getmets_v8_time_fix_nofrcd_mld.txt",
@@ -159,7 +157,7 @@ return {
Transform = {
Translation = {
Type = "SpiceTranslation",
- Body = "PLUTO",
+ Target = "PLUTO",
Observer = "PLUTO BARYCENTER",
Kernels = NewHorizonsKernels
},
@@ -231,7 +229,6 @@ return {
Observer = "NEW HORIZONS",
Body = "PLUTO",
BodyFrame = "IAU_PLUTO",
- MainFrame = "GALACTIC",
Aberration = "NONE",
},
},
@@ -243,7 +240,7 @@ return {
Type = "RenderableTrailOrbit",
Translation = {
Type = "SpiceTranslation",
- Body = "PLUTO",
+ Target = "PLUTO",
Observer = "PLUTO BARYCENTER",
},
Color = {0.00, 0.62, 1.00},
@@ -259,7 +256,7 @@ return {
Type = "RenderableTrailOrbit",
Translation = {
Type = "SpiceTranslation",
- Body = "PLUTO BARYCENTER",
+ Target = "PLUTO BARYCENTER",
Observer = "SUN",
},
Color = { 0.3, 0.7, 0.3 },
diff --git a/data/scene/missions/newhorizons/pluto/styx/styx.mod b/data/scene/missions/newhorizons/pluto/styx/styx.mod
index da6e1bce05..3d157182e5 100644
--- a/data/scene/missions/newhorizons/pluto/styx/styx.mod
+++ b/data/scene/missions/newhorizons/pluto/styx/styx.mod
@@ -25,15 +25,12 @@ return {
Radius = styx_radius,
Segments = 100
},
- Textures = {
- Type = "simple",
- Color = "textures/gray.jpg",
- }
+ ColorTexture = "textures/gray.jpg",
},
Transform = {
Translation = {
Type = "SpiceTranslation",
- Body = "STYX",
+ Target = "STYX",
Observer = "PLUTO BARYCENTER",
Kernels = NewHorizonsKernels
},
@@ -70,7 +67,7 @@ return {
Type = "RenderableTrailOrbit",
Translation = {
Type = "SpiceTranslation",
- Body = "STYX",
+ Target = "STYX",
Observer = "PLUTO BARYCENTER",
},
Color = {0.00, 0.62, 1.00},
diff --git a/data/scene/missions/osirisrex/bennu/bennu.mod b/data/scene/missions/osirisrex/bennu/bennu.mod
index d7718f66bb..ff099ce50e 100644
--- a/data/scene/missions/osirisrex/bennu/bennu.mod
+++ b/data/scene/missions/osirisrex/bennu/bennu.mod
@@ -10,7 +10,7 @@ return {
Transform = {
Translation = {
Type = "SpiceTranslation",
- Body = BENNU_BODY,
+ Target = BENNU_BODY,
Observer = "SUN",
},
},
@@ -100,7 +100,7 @@ return {
Type = "RenderableTrailTrajectory",
Translation = {
Type = "SpiceTranslation",
- Body = BENNU_BODY,
+ Target = BENNU_BODY,
Observer = "SUN",
},
Color = { 0.4, 0.0, 0.7},
diff --git a/data/scene/missions/osirisrex/osirisrex/osirisrex.mod b/data/scene/missions/osirisrex/osirisrex/osirisrex.mod
index 12776ce226..8871183179 100644
--- a/data/scene/missions/osirisrex/osirisrex/osirisrex.mod
+++ b/data/scene/missions/osirisrex/osirisrex/osirisrex.mod
@@ -169,10 +169,7 @@ return {
GeometryFile = "models/orx_base_resized_12_sep_2016.obj",
Magnification = 0,
},
- Textures = {
- Type = "simple",
- Color = "textures/osirisTex.png",
- },
+ ColorTexture = "textures/osirisTex.png",
Shading = {
PerformShading = true,
Fadeable = false,
@@ -182,7 +179,7 @@ return {
Transform = {
Translation = {
Type = "SpiceTranslation",
- Body = "OSIRIS-REX",
+ Target = "OSIRIS-REX",
Observer = "SUN",
Kernels = OsirisRexKernels
},
@@ -204,10 +201,7 @@ return {
GeometryFile = "models/orx_polycam_resized_12_sep_2016.obj",
Magnification = 0,
},
- Textures = {
- Type = "simple",
- Color = "textures/osirisTex.png",
- },
+ ColorTexture = "textures/osirisTex.png",
Shading = {
PerformShading = true,
Fadeable = false,
@@ -237,10 +231,7 @@ return {
GeometryFile = "models/orx_rexis_resized_12_sep_2016.obj",
Magnification = 0,
},
- Textures = {
- Type = "simple",
- Color = "textures/osirisTex.png",
- },
+ ColorTexture = "textures/osirisTex.png",
Shading = {
PerformShading = true,
Fadeable = false,
@@ -345,7 +336,7 @@ return {
Type = "RenderableTrailTrajectory",
Translation = {
Type = "SpiceTranslation",
- Body = "OSIRIS-REX",
+ Target = "OSIRIS-REX",
Frame = "IAU_EARTH",
Observer = "EARTH",
},
@@ -364,7 +355,7 @@ return {
Type = "RenderableTrailTrajectory",
Translation = {
Type = "SpiceTranslation",
- Body = "OSIRIS-REX",
+ Target = "OSIRIS-REX",
Observer = "SUN",
},
Color = { 0.2, 0.9, 0.2 },
@@ -382,7 +373,7 @@ return {
Type = "RenderableTrailTrajectory",
Translation = {
Type = "SpiceTranslation",
- Body = "OSIRIS-REX",
+ Target = "OSIRIS-REX",
Observer = BENNU_BODY,
},
Color = { 0.9, 0.2, 0.9 },
diff --git a/data/scene/missions/rosetta/67P/67P.mod b/data/scene/missions/rosetta/67P/67P.mod
index a039c22b4d..ca06b45f03 100644
--- a/data/scene/missions/rosetta/67P/67P.mod
+++ b/data/scene/missions/rosetta/67P/67P.mod
@@ -6,7 +6,7 @@ return {
Transform = {
Translation = {
Type = "SpiceTranslation",
- Body = "CHURYUMOV-GERASIMENKO",
+ Target = "CHURYUMOV-GERASIMENKO",
Observer = "SUN",
},
},
@@ -22,10 +22,7 @@ return {
GeometryFile = "obj/67P_rotated_5_130.obj",
Magnification = 0,
},
- Textures = {
- Color = "textures/gray.jpg",
- -- Color = "textures/may9_map.jpg",
- },
+ ColorTexture = "textures/gray.jpg",
Projection = {
Sequence = "rosettaimages",
SequenceType = "image-sequence",
@@ -90,7 +87,7 @@ return {
Type = "RenderableTrailTrajectory",
Translation = {
Type = "SpiceTranslation",
- Body = "CHURYUMOV-GERASIMENKO",
+ Target = "CHURYUMOV-GERASIMENKO",
Observer = "SUN",
},
Color = { 0.1, 0.9, 0.2 },
diff --git a/data/scene/missions/rosetta/rosetta/rosetta.mod b/data/scene/missions/rosetta/rosetta/rosetta.mod
index 930a4941df..fecc927266 100644
--- a/data/scene/missions/rosetta/rosetta/rosetta.mod
+++ b/data/scene/missions/rosetta/rosetta/rosetta.mod
@@ -48,7 +48,7 @@ RosettaKernels = {
"${OPENSPACE_DATA}/spice/Rosetta/PCK/ROS_CGS_RSOC_V03.TPC",
}
-RotationMatrix = {
+local RotationMatrix = {
0, 1, 0,
0, 0, 1,
1, 0, 0
@@ -63,7 +63,7 @@ return {
Transform = {
Translation = {
Type = "SpiceTranslation",
- Body = "ROSETTA",
+ Target = "ROSETTA",
Observer = "SUN",
Kernels = RosettaKernels
},
@@ -95,11 +95,8 @@ return {
Type = "MultiModelGeometry",
GeometryFile = "rosetta/black_foil.obj"
},
- Textures = {
- Type = "simple",
- Color = "textures/foil_silver_ramp.png"
- },
- Rotation = { ModelTransform = RotationMatrix }
+ ColorTexture = "textures/foil_silver_ramp.png",
+ ModelTransform = RotationMatrix
}
},
{
@@ -112,11 +109,8 @@ return {
Type = "MultiModelGeometry",
GeometryFile = "rosetta/black_parts.obj"
},
- Textures = {
- Type = "simple",
- Color = "textures/foil_silver_ramp.png"
- },
- Rotation = { ModelTransform = RotationMatrix }
+ ColorTexture = "textures/foil_silver_ramp.png",
+ ModelTransform = RotationMatrix
}
},
{
@@ -129,20 +123,9 @@ return {
Type = "MultiModelGeometry",
GeometryFile = "rosetta/dish.obj"
},
- Textures = {
- Type = "simple",
- Color = "textures/dish_AO.png"
- },
- Rotation = { ModelTransform = RotationMatrix }
-
+ ColorTexture = "textures/dish_AO.png",
+ ModelTransform = RotationMatrix
},
- -- Transform = {
- -- Rotation = {
- -- Type = "SpiceRotation",
- -- SourceFrame = "-226071", -- ROS_HGA
- -- DestinationFrame = "ROS_SPACECRAFT",
- -- }
- -- }
},
{
Name = "Rosetta_parts",
@@ -154,12 +137,8 @@ return {
Type = "MultiModelGeometry",
GeometryFile = "rosetta/parts.obj"
},
- Textures = {
- Type = "simple",
- Color = "textures/parts2_AO.png"
- },
- Rotation = { ModelTransform = RotationMatrix }
-
+ ColorTexture = "textures/parts2_AO.png",
+ ModelTransform = RotationMatrix
}
},
{
@@ -172,12 +151,8 @@ return {
Type = "MultiModelGeometry",
GeometryFile = "rosetta/silver_foil.obj"
},
- Textures = {
- Type = "simple",
- Color = "textures/foil_silver_ramp.png"
- },
- Rotation = { ModelTransform = RotationMatrix }
-
+ ColorTexture = "textures/foil_silver_ramp.png",
+ ModelTransform = RotationMatrix
}
},
{
@@ -190,12 +165,8 @@ return {
Type = "MultiModelGeometry",
GeometryFile = "rosetta/vents.obj"
},
- Textures = {
- Type = "simple",
- Color = "textures/tex_01.png"
- },
- Rotation = { ModelTransform = RotationMatrix }
-
+ ColorTexture = "textures/tex_01.png",
+ ModelTransform = RotationMatrix
}
},
{
@@ -208,20 +179,9 @@ return {
Type = "MultiModelGeometry",
GeometryFile = "rosetta/wingA.obj"
},
- Textures = {
- Type = "simple",
- Color = "textures/tex_01.png"
- },
- Rotation = { ModelTransform = RotationMatrix }
-
+ ColorTexture = "textures/tex_01.png",
+ ModelTransform = RotationMatrix
},
- -- Transform = {
- -- Rotation = {
- -- Type = "SpiceRotation",
- -- SourceFrame = "-226015", -- ROS_SA
- -- DestinationFrame = "ROS_SPACECRAFT",
- -- }
- -- }
},
{
Name = "Rosetta_wing_b",
@@ -233,12 +193,8 @@ return {
Type = "MultiModelGeometry",
GeometryFile = "rosetta/wingB.obj"
},
- Textures = {
- Type = "simple",
- Color = "textures/tex_01.png"
- },
- Rotation = { ModelTransform = RotationMatrix }
-
+ ColorTexture = "textures/tex_01.png",
+ ModelTransform = RotationMatrix
},
-- Transform = {
-- Rotation = {
@@ -258,12 +214,8 @@ return {
Type = "MultiModelGeometry",
GeometryFile = "rosetta/yellow_foil.obj"
},
- Textures = {
- Type = "simple",
- Color = "textures/foil_gold_ramp.png"
- },
- Rotation = { ModelTransform = RotationMatrix }
-
+ ColorTexture = "textures/foil_gold_ramp.png",
+ ModelTransform = RotationMatrix
}
},
{
@@ -274,7 +226,7 @@ return {
Transform = {
Translation = {
Type = "SpiceTranslation",
- Body = "PHILAE",
+ Target = "PHILAE",
Observer = "CHURYUMOV-GERASIMENKO",
Kernels = RosettaKernels
},
@@ -300,12 +252,8 @@ return {
Type = "MultiModelGeometry",
GeometryFile = "rosetta/lander_foil.obj"
},
- Textures = {
- Type = "simple",
- Color = "textures/foil_silver_ramp.png"
- },
- Rotation = { ModelTransform = RotationMatrix }
-
+ ColorTexture = "textures/foil_silver_ramp.png",
+ ModelTransform = RotationMatrix
}
},
{
@@ -318,12 +266,8 @@ return {
Type = "MultiModelGeometry",
GeometryFile = "rosetta/lander_lids.obj"
},
- Textures = {
- Type = "simple",
- Color = "textures/parts2_AO.png"
- },
- Rotation = { ModelTransform = RotationMatrix }
-
+ ColorTexture = "textures/parts2_AO.png",
+ ModelTransform = RotationMatrix
}
},
{
@@ -336,12 +280,8 @@ return {
Type = "MultiModelGeometry",
GeometryFile = "rosetta/lander_parts.obj"
},
- Textures = {
- Type = "simple",
- Color = "textures/foil_silver_ramp.png"
- },
- Rotation = { ModelTransform = RotationMatrix }
-
+ ColorTexture = "textures/foil_silver_ramp.png",
+ ModelTransform = RotationMatrix
}
},
{
@@ -354,11 +294,8 @@ return {
Type = "MultiModelGeometry",
GeometryFile = "rosetta/lander_solarp.obj"
},
- Textures = {
- Type = "simple",
- Color = "textures/tex_01.png"
- },
- Rotation = { ModelTransform = RotationMatrix }
+ ColorTexture = "textures/tex_01.png",
+ ModelTransform = RotationMatrix
}
},
{
@@ -368,7 +305,7 @@ return {
Type = "RenderableTrailTrajectory",
Translation = {
Type = "SpiceTranslation",
- Body = "ROSETTA",
+ Target = "ROSETTA",
Observer = "CHURYUMOV-GERASIMENKO",
},
Color = { 0.288, 0.375, 0.934 },
@@ -384,7 +321,7 @@ return {
Type = "RenderableTrailTrajectory",
Translation = {
Type = "SpiceTranslation",
- Body = "PHILAE",
+ Target = "PHILAE",
Observer = "CHURYUMOV-GERASIMENKO",
},
Color = { 0.8, 0.5, 1.0 },
diff --git a/data/scene/lodglobes/moon/map_service_configs/OnMoonColor.xml b/data/scene/moon/map_service_configs/OnMoonColor.xml
similarity index 100%
rename from data/scene/lodglobes/moon/map_service_configs/OnMoonColor.xml
rename to data/scene/moon/map_service_configs/OnMoonColor.xml
diff --git a/data/scene/lodglobes/moon/map_service_configs/OnMoonHeight.xml b/data/scene/moon/map_service_configs/OnMoonHeight.xml
similarity index 100%
rename from data/scene/lodglobes/moon/map_service_configs/OnMoonHeight.xml
rename to data/scene/moon/map_service_configs/OnMoonHeight.xml
diff --git a/data/scene/lodglobes/moon/map_service_configs/Utah/ClemUvvis.wms b/data/scene/moon/map_service_configs/Utah/ClemUvvis.wms
similarity index 100%
rename from data/scene/lodglobes/moon/map_service_configs/Utah/ClemUvvis.wms
rename to data/scene/moon/map_service_configs/Utah/ClemUvvis.wms
diff --git a/data/scene/lodglobes/moon/map_service_configs/Utah/Kaguya.wms b/data/scene/moon/map_service_configs/Utah/Kaguya.wms
similarity index 100%
rename from data/scene/lodglobes/moon/map_service_configs/Utah/Kaguya.wms
rename to data/scene/moon/map_service_configs/Utah/Kaguya.wms
diff --git a/data/scene/lodglobes/moon/map_service_configs/Utah/LolaClrShade.wms b/data/scene/moon/map_service_configs/Utah/LolaClrShade.wms
similarity index 100%
rename from data/scene/lodglobes/moon/map_service_configs/Utah/LolaClrShade.wms
rename to data/scene/moon/map_service_configs/Utah/LolaClrShade.wms
diff --git a/data/scene/lodglobes/moon/map_service_configs/Utah/LolaDem.wms b/data/scene/moon/map_service_configs/Utah/LolaDem.wms
similarity index 100%
rename from data/scene/lodglobes/moon/map_service_configs/Utah/LolaDem.wms
rename to data/scene/moon/map_service_configs/Utah/LolaDem.wms
diff --git a/data/scene/lodglobes/moon/map_service_configs/Utah/LolaShade.wms b/data/scene/moon/map_service_configs/Utah/LolaShade.wms
similarity index 100%
rename from data/scene/lodglobes/moon/map_service_configs/Utah/LolaShade.wms
rename to data/scene/moon/map_service_configs/Utah/LolaShade.wms
diff --git a/data/scene/lodglobes/moon/map_service_configs/Utah/UvvisHybrid.wms b/data/scene/moon/map_service_configs/Utah/UvvisHybrid.wms
similarity index 100%
rename from data/scene/lodglobes/moon/map_service_configs/Utah/UvvisHybrid.wms
rename to data/scene/moon/map_service_configs/Utah/UvvisHybrid.wms
diff --git a/data/scene/lodglobes/moon/map_service_configs/Utah/Wac.wms b/data/scene/moon/map_service_configs/Utah/Wac.wms
similarity index 100%
rename from data/scene/lodglobes/moon/map_service_configs/Utah/Wac.wms
rename to data/scene/moon/map_service_configs/Utah/Wac.wms
diff --git a/data/scene/moon/moon.data b/data/scene/moon/moon.data
deleted file mode 100644
index f8c7094165..0000000000
--- a/data/scene/moon/moon.data
+++ /dev/null
@@ -1,5 +0,0 @@
-return {
- FileRequest = {
- { Identifier = "moon_textures", Destination = "textures", Version = 1 }
- },
-}
\ No newline at end of file
diff --git a/data/scene/moon/moon.mod b/data/scene/moon/moon.mod
index 534adf617c..6c441d2b7b 100644
--- a/data/scene/moon/moon.mod
+++ b/data/scene/moon/moon.mod
@@ -1,46 +1,56 @@
return {
-- Moon module
- {
+ {
Name = "Moon",
Parent = "EarthBarycenter",
- Renderable = {
- Type = "RenderablePlanet",
- Frame = "IAU_MOON",
- Body = "MOON",
- Geometry = {
- Type = "SimpleSphere",
- Radius = 1.737E6,
- Segments = 100
- },
- Shadow_Group = {
- Source1 = {
- Name = "Sun",
- Radius = 696.3E6
- },
- Caster1 = {
- Name = "Earth",
- Radius = 6.371E6
- },
- },
- Textures = {
- Type = "simple",
- Color = "textures/Moon16K.dds",
- --Color = "textures/moonmap4k.jpg",
- },
- },
Transform = {
Translation = {
Type = "SpiceTranslation",
- Body = "MOON",
+ Target = "MOON",
Observer = "EARTH BARYCENTER",
Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp"
},
Rotation = {
Type = "SpiceRotation",
SourceFrame = "IAU_MOON",
- DestinationFrame = "ECLIPJ2000"
- },
+ DestinationFrame = "GALACTIC"
+ }
},
+ Renderable = {
+ Type = "RenderableGlobe",
+ Radii = 1738140,
+ SegmentsPerPatch = 64,
+ Layers = {
+ ColorLayers = {
+ {
+ Name = "OnMoonColorGrayscale",
+ FilePath = "map_service_configs/OnMoonColor.xml",
+ Enabled = true,
+ },
+ {
+ Name = "ClemUvvis",
+ FilePath = "map_service_configs/Utah/ClemUvvis.wms"
+ },
+ {
+ Name = "Kaguya",
+ FilePath = "map_service_configs/Utah/Kaguya.wms"
+ },
+ {
+ Name = "WAC",
+ FilePath = "map_service_configs/Utah/Wac.wms"
+ }
+ },
+ HeightLayers = {
+ {
+ Name = "LolaDem",
+ FilePath = "map_service_configs/Utah/LolaDem.wms",
+ Enabled = true,
+ TilePixelSize = 64,
+ Settings = { Multiplier = 0.5 },
+ }
+ }
+ }
+ }
},
-- MoonTrail module
{
@@ -50,12 +60,12 @@ return {
Type = "RenderableTrailOrbit",
Translation = {
Type = "SpiceTranslation",
- Body = "MOON",
- Observer = "EARTH BARYCENTER",
+ Target = "MOON",
+ Observer = "EARTH BARYCENTER"
},
Color = { 0.5, 0.3, 0.3 },
Period = 27,
Resolution = 1000
- },
+ }
}
}
diff --git a/data/scene/neptune/neptune.mod b/data/scene/neptune/neptune.mod
index 38e698c9ea..57448d3042 100644
--- a/data/scene/neptune/neptune.mod
+++ b/data/scene/neptune/neptune.mod
@@ -1,50 +1,46 @@
return {
- -- Neptune barycenter module
+ -- Barycenter module
{
Name = "NeptuneBarycenter",
Parent = "SolarSystemBarycenter",
Transform = {
Translation = {
Type = "SpiceTranslation",
- Body = "NEPTUNE BARYCENTER",
+ Target = "NEPTUNE BARYCENTER",
Observer = "SUN",
Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp"
}
}
},
-
- -- Neptune module
+ -- RenderableGlobe module
{
Name = "Neptune",
Parent = "NeptuneBarycenter",
- Renderable = {
- Type = "RenderablePlanet",
- Frame = "IAU_NEPTUNE",
- Body = "NEPTUNE BARYCENTER",
- Geometry = {
- Type = "SimpleSphere",
- Radius = 2.4622E7,
- Segments = 100
- },
- Textures = {
- Type = "simple",
- Color = "textures/neptune.jpg",
- }
- },
- Tag = "planet_solarSystem",
Transform = {
Rotation = {
Type = "SpiceRotation",
SourceFrame = "IAU_NEPTUNE",
DestinationFrame = "GALACTIC"
- },
- Scale = {
- Type = "StaticScale",
- Scale = 1,
- },
- }
+ }
+ },
+ Renderable = {
+ Type = "RenderableGlobe",
+ Radii = { 24764000, 24764000, 24314000 },
+ SegmentsPerPatch = 64,
+ Layers = {
+ ColorLayers = {
+ {
+ Name = "Texture",
+ FilePath = "textures/neptune.jpg",
+ Enabled = true
+ }
+ }
+ }
+ },
+ Tag = { "planet_solarSystem", "planet_giants" },
+
},
- -- NeptuneTrail module
+ -- Trail module
{
Name = "NeptuneTrail",
Parent = "SolarSystemBarycenter",
@@ -52,13 +48,13 @@ return {
Type = "RenderableTrailOrbit",
Translation = {
Type = "SpiceTranslation",
- Body = "NEPTUNE BARYCENTER",
- Observer = "SUN",
+ Target = "NEPTUNE BARYCENTER",
+ Observer = "SUN"
},
Color = {0.2, 0.5, 1.0 },
Period = 60200,
- Resolution = 1000,
- Tag = "planetTrail_solarSystem"
- }
+ Resolution = 1000
+ },
+ Tag = { "planetTrail_solarSystem", "planetTrail_giants" }
}
}
diff --git a/data/scene/newhorizons.scene b/data/scene/newhorizons.scene
index 7dc39df870..267a88e5d5 100644
--- a/data/scene/newhorizons.scene
+++ b/data/scene/newhorizons.scene
@@ -16,7 +16,139 @@ function preInitialization()
openspace.time.setTime("2015-07-14T10:05:00.00")
- dofile(openspace.absPath('${SCRIPTS}/bind_keys_newhorizons.lua'))
+ -- Load the common helper functions
+ dofile(openspace.absPath('${SCRIPTS}/common.lua'))
+
+ openspace.clearKeys()
+ helper.setCommonKeys()
+ helper.setDeltaTimeKeys({
+ 1, 5, 10, 20, 40, 60, 120, 360, 540, 1080,
+ 2160, 4320, 8640
+ })
+
+ openspace.bindKey(
+ "a",
+ "openspace.setPropertyValue('Interaction.origin', 'NewHorizons')",
+ "Sets the focus of the camera on 'NewHorizons'."
+ )
+ openspace.bindKey(
+ "s",
+ "openspace.setPropertyValue('Interaction.origin', 'Pluto')",
+ "Sets the focus of the camera on 'Pluto'"
+ )
+ openspace.bindKey(
+ "d",
+ "openspace.setPropertyValue('Interaction.origin', 'Charon')",
+ "Sets the focus of the camera on 'Charon'."
+ )
+ openspace.bindKey(
+ "z",
+ "openspace.setPropertyValue('Interaction.origin', 'JupiterProjection')",
+ "Sets the focus of the camera on 'Jupiter'."
+ )
+ openspace.bindKey(
+ "x",
+ "openspace.setPropertyValue('Interaction.origin', 'Europa')",
+ "Sets the focus of the camera on 'Europa'."
+ )
+
+ openspace.bindKey(
+ "F8",
+ "openspace.setPropertyValue('Pluto.renderable.ProjectionComponent.clearAllProjections', true);" ..
+ "openspace.setPropertyValue('Charon.renderable.ProjectionComponent.clearAllProjections', true);",
+ "Removes all image projections from Pluto and Charon."
+ )
+
+ openspace.bindKey(
+ "F9",
+ "openspace.time.setTime('2015-07-14T09:00:00.00');" ..
+ "openspace.setPropertyValue('Pluto.renderable.clearAllProjections', true);" ..
+ "openspace.setPropertyValue('Charon.renderable.clearAllProjections', true);",
+ "Jumps to the 14th of July 2015 at 0900 UTC and clears all projections."
+ )
+
+ openspace.bindKey(
+ "KP_8",
+ helper.property.increment('Pluto.renderable.heightExaggeration', 0.1),
+ "Increases the height map exaggeration on Pluto."
+ )
+ openspace.bindKey(
+ "KP_2",
+ helper.property.decrement('Pluto.renderable.heightExaggeration', 0.1),
+ "Decreases the height map exaggeration on Pluto."
+ )
+ openspace.bindKey(
+ "KP_9",
+ helper.property.increment('Charon.renderable.heightExaggeration', 2),
+ "Increases the height map exaggeration on Charon."
+ )
+ openspace.bindKey(
+ "KP_3",
+ helper.property.decrement('Charon.renderable.heightExaggeration', 2),
+ "Decreases the height map exaggeration on Charon."
+ )
+
+ openspace.bindKey(
+ "q",
+ helper.property.invert('SunMarker.renderable.enabled'),
+ "Toggles the visibility of the text marking the location of the Sun."
+ )
+ openspace.bindKey(
+ "e",
+ helper.property.invert('EarthMarker.renderable.enabled'),
+ "Toggles the visibility of the text marking the location of the Earth."
+ )
+ openspace.bindKey(
+ "o",
+ helper.property.invert('PlutoTrail.renderable.enabled'),
+ "Toggles the visibility of the trail behind Pluto."
+ )
+
+ openspace.bindKey(
+ "j",
+ helper.renderable.toggle('PlutoText') .. helper.renderable.toggle('CharonText') ..
+ helper.renderable.toggle('HydraText') .. helper.renderable.toggle('NixText') ..
+ helper.renderable.toggle('KerberosText') .. helper.renderable.toggle('StyxText'),
+ "Toggles the visibility of the text labels of Pluto, Charon, Hydra, Nix, Kerberos, and Styx."
+ )
+
+ openspace.bindKey(
+ "l",
+ helper.property.invert('Labels.renderable.performFading'),
+ "Toggles the visibility of the labels for the New Horizons instruments."
+ )
+
+ openspace.bindKey("m",
+ helper.property.invert('NH_LORRI.renderable.solidDraw') ..
+ helper.property.invert('NH_RALPH_LEISA.renderable.solidDraw') ..
+ helper.property.invert('NH_RALPH_MVIC_PAN1.renderable.solidDraw') ..
+ helper.property.invert('NH_RALPH_MVIC_PAN2.renderable.solidDraw') ..
+ helper.property.invert('NH_RALPH_MVIC_RED.renderable.solidDraw') ..
+ helper.property.invert('NH_RALPH_MVIC_BLUE.renderable.solidDraw') ..
+ helper.property.invert('NH_RALPH_MVIC_FT.renderable.solidDraw') ..
+ helper.property.invert('NH_RALPH_MVIC_METHANE.renderable.solidDraw') ..
+ helper.property.invert('NH_RALPH_MVIC_NIR.renderable.solidDraw') ..
+ helper.property.invert('NH_ALICE_AIRGLOW.renderable.solidDraw') ..
+ helper.property.invert('NH_ALICE_SOC.renderable.solidDraw'),
+ "Draws the instrument field of views in a solid color or as lines."
+ )
+
+ openspace.bindKey(
+ "t",
+ helper.renderable.toggle('PlutoShadow') .. helper.renderable.toggle('CharonShadow'),
+ "Toggles the visibility of the shadow visualization of Pluto and Charon."
+ )
+
+ openspace.bindKey("p",
+ helper.property.invert('JupiterProjection.renderable.performProjection') ..
+ helper.property.invert('Io.renderable.performProjection') ..
+ helper.property.invert('Ganymede.renderable.performProjection') ..
+ helper.property.invert('Europa.renderable.performProjection') ..
+ helper.property.invert('Callisto.renderable.performProjection') ..
+ helper.property.invert('Pluto.renderable.performProjection') ..
+ helper.property.invert('Charon.renderable.performProjection'),
+ "Enables or disables the image projection on the different available objects."
+ )
end
function postInitialization()
@@ -56,10 +188,10 @@ return {
"saturn/saturn",
"uranus",
"neptune",
- "stars",
- -- "stars-denver",
- "milkyway",
- -- "milkyway-eso",
+ "stars/digitaluniverse",
+ -- "stars/denver",
+ "milkyway/digitaluniverse",
+ --"milkyway/eso",
"missions/newhorizons/pluto",
"missions/newhorizons/jupiter",
"missions/newhorizons/newhorizons",
diff --git a/data/scene/osirisrex.scene b/data/scene/osirisrex.scene
index b869051f7b..0902c47df5 100644
--- a/data/scene/osirisrex.scene
+++ b/data/scene/osirisrex.scene
@@ -12,13 +12,68 @@ function preInitialization()
openspace.spice.loadKernel("${SPICE}/naif0012.tls")
openspace.spice.loadKernel("${SPICE}/pck00010.tpc")
- dofile(openspace.absPath('${SCRIPTS}/bind_keys_osirisrex.lua'))
-
--local startTime = "2019 APR 16 12:03:00.00"
openspace.time.setTime("2016 SEP 8 23:00:00.500")
- openspace.scriptScheduler.loadFile("${OPENSPACE_DATA}/scene/missions/osirisrex/scheduled_scripts.lua")
+ -- Load the common helper functions
+ dofile(openspace.absPath('${SCRIPTS}/common.lua'))
+ dofile(openspace.absPath('${SCRIPTS}/bind_common_keys.lua'))
+ -- Set focuses
+ openspace.bindKey(
+ "a",
+ "openspace.setPropertyValue('Interaction.origin', 'OsirisRex')",
+ "Sets the focus of the camera on 'Osiris Rex'."
+ )
+ openspace.bindKey(
+ "s",
+ "openspace.setPropertyValue('Interaction.origin', 'BennuBarycenter')",
+ "Sets the focus of the camera on 'Bennu'."
+ )
+
+ openspace.bindKey(
+ "F6" ,
+ "openspace.printInfo('Set time: Launch');openspace.time.setTime('2016 SEP 08 23:05:00');",
+ "Sets the time to the launch."
+ )
+ openspace.bindKey(
+ "F7",
+ "openspace.printInfo('Set time: Gravity Assist');openspace.time.setTime('2017 SEP 22 15:00:00');",
+ "Sets the time to the Earth gravity assist."
+ )
+ openspace.bindKey(
+ "F8",
+ "openspace.printInfo('Set time: Approach');openspace.time.setTime('2018-SEP-11 21:31:01.183');",
+ "Sets the time to the approach at Bennu."
+ )
+ openspace.bindKey(
+ "F9",
+ "openspace.printInfo('Set time: Preliminary Survey');openspace.time.setTime('2018-NOV-20 01:13:12.183');",
+ "Sets the time to the preliminary survey of Bennu."
+ )
+ openspace.bindKey(
+ "F10",
+ "openspace.printInfo('Set time: Orbital B');openspace.time.setTime('2019-APR-08 10:35:27.186');",
+ "Sets the time to the orbital B event."
+ )
+ openspace.bindKey(
+ "F11",
+ "openspace.printInfo('Set time: Recon');openspace.time.setTime('2019-MAY-25 03:50:31.195');",
+ "Sets the time to the recon event."
+ )
+
+ openspace.bindKey(
+ "q",
+ helper.property.invert('SunMarker.renderable.enabled'),
+ "Toggles the visibility of the text marking the location of the Sun."
+ )
+ openspace.bindKey(
+ "e",
+ helper.property.invert('EarthMarker.renderable.enabled'),
+ "Toggles the visibility of the text marking the location of the Earth."
+ )
+
+ openspace.scriptScheduler.loadFile("${OPENSPACE_DATA}/scene/missions/osirisrex/scheduled_scripts.lua")
end
function postInitialization()
@@ -68,10 +123,10 @@ return {
"saturn",
"uranus",
"neptune",
- "stars",
- -- "stars-denver",
- "milkyway",
- -- "milkyway-eso",
+ "stars/digitaluniverse",
+ -- "stars/denver",
+ "milkyway/digitaluniverse",
+ --"milkyway/eso",
"missions/osirisrex",
}
}
diff --git a/data/scene/pluto/pluto.data b/data/scene/pluto/pluto.data
deleted file mode 100644
index db86c15f8c..0000000000
--- a/data/scene/pluto/pluto.data
+++ /dev/null
@@ -1,7 +0,0 @@
-return {
- FileRequest = {
- { Identifier = "charon_textures", Destination = "textures", Version = 1 },
- { Identifier = "pluto_textures", Destination = "textures", Version = 4 },
- { Identifier = "pluto_spice", Destination = "${SPICE}", Version = 1 }
- }
-}
\ No newline at end of file
diff --git a/data/scene/pluto/pluto.mod b/data/scene/pluto/pluto.mod
deleted file mode 100644
index 27f540d731..0000000000
--- a/data/scene/pluto/pluto.mod
+++ /dev/null
@@ -1,140 +0,0 @@
-return {
- -- Pluto barycenter module
- {
- Name = "PlutoBarycenter",
- Parent = "SolarSystemBarycenter",
- Transform = {
- Translation = {
- Type = "SpiceTranslation",
- Body = "PLUTO BARYCENTER",
- Observer = "SUN",
- Kernels = {
- "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp",
- "${OPENSPACE_DATA}/spice/plu055.bsp",
- }
- }
- }
- },
- -- Pluto module
- {
- Name = "Pluto",
- Parent = "PlutoBarycenter",
- Renderable = {
- Type = "RenderablePlanet",
- Frame = "IAU_PLUTO",
- Body = "PLUTO",
- Geometry = {
- Type = "SimpleSphere",
- Radius = 1.173E6,
- Segments = 100
- },
- Textures = {
- Type = "simple",
- Color = "textures/pluto.jpg",
- },
- Atmosphere = {
- Type = "Nishita", -- for example, values missing etc etc
- MieFactor = 1.0,
- MieColor = {1.0, 1.0, 1.0}
- }
- },
- Transformation = {
- Translation = {
- Type = "SpiceTranslation",
- Body = "PLUTO",
- Observer = "PLUTO BARYCENTER",
- Kernels = "${OPENSPACE_DATA}/spice/plu055.bsp",
- },
- Rotation = {
- Type = "Spice",
- SourceFrame = "IAU_PLUTO",
- DestinationFrame = "GALACTIC"
- }
- }
- },
- {
- Name = "Charon",
- Parent = "PlutoBarycenter",
- Renderable = {
- Type = "RenderablePlanet",
- Frame = "IAU_CHARON",
- Body = "CHARON",
- Geometry = {
- Type = "SimpleSphere",
- Radius = 6.035E5,
- Segments = 100
- },
- Textures = {
- Type = "simple",
- Color = "textures/gray.jpg",
- },
- Atmosphere = {
- Type = "Nishita", -- for example, values missing etc etc
- MieFactor = 1.0,
- MieColor = {1.0, 1.0, 1.0}
- }
- },
- Transformation = {
- Translation = {
- Type = "SpiceTranslation",
- Body = "CHARON",
- Observer = "PLUTO BARYCENTER",
- Kernels = "${OPENSPACE_DATA}/spice/plu055.bsp",
- },
- Rotation = {
- Type = "Spice",
- SourceFrame = "IAU_CHARON",
- DestinationFrame = "GALACTIC"
- }
- }
- },
- -- CharonTrail module
- {
- Name = "CharonTrail",
- Parent = "PlutoBarycenter",
- Renderable = {
- Type = "RenderableTrailOrbit",
- Translation = {
- Type = "SpiceTranslation",
- Body = "CHARON",
- Observer = "PLUTO BARYCENTER",
- },
- Color = {0.00,0.62,1.00},
- Period = 6.38725,
- Resolution = 1000,
- },
- },
- -- PlutoTrail module
- {
- Name = "PlutoTrailSolarSystem",
- Parent = "SolarSystemBarycenter",
- Renderable = {
- Type = "RenderableTrailOrbit",
- Translation = {
- Type = "SpiceTranslation",
- Body = "PLUTO BARYCENTER",
- Observer = "SUN",
- },
- Color = {0.58, 0.61, 1.00},
- Period = 247.92 * 365.242,
- Resolution = 1000
- },
- GuiName = "/Solar/PlutoTrail"
- },
- {
- Name = "PlutoTrailPluto",
- Parent = "PlutoBarycenter",
- Renderable = {
- Type = "RenderableTrailOrbit",
- Translation = {
- Type = "SpiceTranslation",
- Body = "PLUTO",
- Observer = "PLUTO BARYCENTER",
- },
- Color = {0.58, 0.61, 1.00},
- Period = 6.38725,
- Resolution = 1000
- },
- GuiName = "/Solar/PlutoTrail"
- }
-}
diff --git a/data/scene/rosetta.scene b/data/scene/rosetta.scene
index ce4c0213da..1c6727314c 100644
--- a/data/scene/rosetta.scene
+++ b/data/scene/rosetta.scene
@@ -18,7 +18,71 @@ function preInitialization()
-- Shadow flyby
-- openspace.time.setTime("2015-02-14T12:00:00.000")
- dofile(openspace.absPath('${SCRIPTS}/bind_keys_rosetta.lua'))
+ -- Load the common helper functions
+ dofile(openspace.absPath('${SCRIPTS}/common.lua'))
+
+ openspace.clearKeys()
+ helper.setCommonKeys()
+
+ helper.setDeltaTimeKeys({
+ 1, 5, 10, 20, 40, 90, 360, 720, 2880, 14400,
+ 28800, 57600, 115200, 230400, 460800, 921600, 1843200, 3686400, 7372800, 14745600
+ })
+
+ openspace.bindKey(
+ "a",
+ "openspace.setPropertyValue('Interaction.origin', '67P')",
+ "Sets the focus of the camera on '67P'."
+ )
+ openspace.bindKey(
+ "s",
+ "openspace.setPropertyValue('Interaction.origin', 'Rosetta')",
+ "Sets the focus of the camera on 'Rosetta'."
+ )
+
+ openspace.bindKey(
+ "F5",
+ "openspace.time.setTime('2014-08-01T03:05:18.101')",
+ "Jumps to the time of initial approach of Rosetta to 67P."
+ )
+ openspace.bindKey(
+ "F6",
+ "openspace.time.setTime('2014-11-12T08:20:00.00')",
+ "Jumps to the time when the Philae lander is released."
+ )
+ openspace.bindKey(
+ "F8",
+ "openspace.setPropertyValue('67P.renderable.ProjectionComponent.clearAllProjections', true)",
+ "Removes all image projections from 67P."
+ )
+
+ openspace.bindKey(
+ "i",
+ helper.renderable.toggle('ImagePlaneRosetta'),
+ "Toggles the visibility of the free floating image plane."
+ )
+ openspace.bindKey(
+ "q",
+ helper.renderable.toggle('SunMarker'),
+ "Toggles the visibility of the text marking the location of the Sun."
+ )
+ openspace.bindKey(
+ "e",
+ helper.renderable.toggle('JupiterTrail') .. helper.renderable.toggle('SaturnTrail') ..
+ helper.renderable.toggle('UranusTrail') .. helper.renderable.toggle('NeptuneTrail'),
+ "Toggles the visibility of all trails further from the Sun than 67P."
+ )
+ openspace.bindKey(
+ "f",
+ helper.renderable.toggle('PhilaeTrail'),
+ "Toggles the visibility of Philae's trail."
+ )
+
+ openspace.bindKey(
+ "p",
+ helper.property.invert('67P.renderable.ProjectionComponent.performProjection'),
+ "Enables or disables the image projection on 67P."
+ )
end
function postInitialization()
@@ -58,8 +122,10 @@ return {
"saturn/saturn",
"uranus",
-- "neptune",
- "stars",
- "milkyway",
+ "stars/digitaluniverse",
+ -- "stars/denver",
+ "milkyway/digitaluniverse",
+ --"milkyway/eso",
"missions/rosetta",
}
}
diff --git a/data/scene/satellites.scene b/data/scene/satellites.scene
deleted file mode 100644
index 46cf989799..0000000000
--- a/data/scene/satellites.scene
+++ /dev/null
@@ -1,71 +0,0 @@
-function preInitialization()
- --[[
- The scripts in this function are executed after the scene is loaded but before the
- scene elements have been initialized, thus they should be used to set the time at
- which the scene should start and other settings that might determine initialization
- critical objects.
- ]]--
-
- openspace.spice.loadKernel("${SPICE}/naif0011.tls")
- openspace.spice.loadKernel("${SPICE}/pck00010.tpc")
- -- openspace.spice.loadKernel("${OPENSPACE_DATA}/spice/de430_1850-2150.bsp")
-
- openspace.time.setTime(openspace.time.currentWallTime())
-
- --Test for vernal equinox time 2017
- --openspace.time.setTime("2017 MAR 20 10:28:30.500")
-
- dofile(openspace.absPath('${SCRIPTS}/bind_keys_satellites.lua'))
-end
-
-function postInitialization()
- --[[
- The scripts in this function are executed after all objects in the scene have been
- created and initialized, but before the first render call. This is the place to set
- graphical settings for the renderables.
- ]]--
- openspace.printInfo("Setting default values")
- openspace.setPropertyValue("SunMarker.renderable.Enabled", false)
- openspace.setPropertyValue("SunGlare.renderable.Enabled", false)
- openspace.setPropertyValue("MilkyWay.renderable.Enabled", false)
- openspace.setPropertyValue("EarthMarker.renderable.Enabled", false)
- openspace.setPropertyValue("EarthTrail.renderable.Enabled", false)
- openspace.setPropertyValue("Earth.renderable.PerformShading", false)
-
- openspace.navigation.resetCameraDirection()
-
- openspace.printInfo("Done setting default values")
-
- if openspace.modules.isLoaded("ISWA") then
-
- openspace.iswa.addCdfFiles("${OPENSPACE_DATA}/cdflist.json");
-
- --openspace.iswa.addCygnet(7);
-
- --openspace.iswa.addCygnet(-4,"Data","Gm");
- --openspace.iswa.addCygnet(-5,"Data","Gm");
- --openspace.iswa.addCygnet(-6,"Data","Gm");
- --openspace.iswa.addCygnet(-7,"Data","Gm");
- --openspace.iswa.addCygnet(-8,"Data","Gm");
- --openspace.iswa.addCygnet(-9,"Data","Gm");
- end
-end
-
-return {
- ScenePath = ".",
- CommonFolder = "common",
- Camera = {
- Focus = "Earth",
- Position = {-54343425747.129051, -73298476295.934555, 116584089130.590012},
- Rotation = {-0.078983, 0.830093, 0.014241, -0.551819},
- },
- Modules = {
- --"satellites/earth",
- "sun",
- "earth",
- -- "stars",
- -- "milkyway",
- "satellites"
- }
-}
-
diff --git a/data/scene/saturn/dione/dione.mod b/data/scene/saturn/dione/dione.mod
index 477705ea2b..57517df105 100644
--- a/data/scene/saturn/dione/dione.mod
+++ b/data/scene/saturn/dione/dione.mod
@@ -3,22 +3,23 @@ return {
Name = "Dione",
Parent = "SaturnBarycenter",
Renderable = {
- Type = "RenderablePlanet",
- Frame = "IAU_DIONE",
- Body = "DIONE",
- Geometry = {
- Type = "SimpleSphere",
- Radius = 0.563E3,
- Segments = 50
- },
- Textures = {
- Color = "textures/dione.jpg"
+ Type = "RenderableGlobe",
+ Radii = 561400,
+ SegmentsPerPatch = 64,
+ Layers = {
+ ColorLayers = {
+ {
+ Name = "Dione Texture",
+ FilePath = "textures/dione.jpg",
+ Enabled = true
+ }
+ }
}
},
Transform = {
Translation = {
Type = "SpiceTranslation",
- Body = "DIONE",
+ Target = "DIONE",
Observer = "SATURN BARYCENTER",
Kernels = "${OPENSPACE_DATA}/spice/sat375.bsp"
},
@@ -36,7 +37,7 @@ return {
Type = "RenderableTrailOrbit",
Translation = {
Type = "SpiceTranslation",
- Body = "DIONE",
+ Target = "DIONE",
Observer = "SATURN BARYCENTER",
},
Color = { 0.5, 0.3, 0.3 },
@@ -44,4 +45,4 @@ return {
Resolution = 1000
}
}
-}
\ No newline at end of file
+}
diff --git a/data/scene/saturn/enceladus/enceladus.mod b/data/scene/saturn/enceladus/enceladus.mod
index f49104d3ca..877ffd5ac1 100644
--- a/data/scene/saturn/enceladus/enceladus.mod
+++ b/data/scene/saturn/enceladus/enceladus.mod
@@ -3,22 +3,23 @@ return {
Name = "Enceladus",
Parent = "SaturnBarycenter",
Renderable = {
- Type = "RenderablePlanet",
- Frame = "IAU_ENCELADUS",
- Body = "ENCELADUS",
- Geometry = {
- Type = "SimpleSphere",
- Radius = 0.257E3,
- Segments = 50
- },
- Textures = {
- Color = "textures/enceladus.jpg"
+ Type = "RenderableGlobe",
+ Radii = 252000,
+ SegmentsPerPatch = 64,
+ Layers = {
+ ColorLayers = {
+ {
+ Name = "Enceladus Texture",
+ FilePath = "textures/enceladus.jpg",
+ Enabled = true
+ }
+ }
}
},
Transform = {
Translation = {
Type = "SpiceTranslation",
- Body = "ENCELADUS",
+ Target = "ENCELADUS",
Observer = "SATURN BARYCENTER",
Kernels = "${OPENSPACE_DATA}/spice/sat375.bsp"
},
@@ -36,7 +37,7 @@ return {
Type = "RenderableTrailOrbit",
Translation = {
Type = "SpiceTranslation",
- Body = "ENCELADUS",
+ Target = "ENCELADUS",
Observer = "SATURN BARYCENTER",
},
Color = { 0.5, 0.3, 0.3 },
@@ -44,4 +45,4 @@ return {
Resolution = 1000
}
}
-}
\ No newline at end of file
+}
diff --git a/data/scene/saturn/iapetus/iapetus.mod b/data/scene/saturn/iapetus/iapetus.mod
index 0bcc6b8c38..077282c537 100644
--- a/data/scene/saturn/iapetus/iapetus.mod
+++ b/data/scene/saturn/iapetus/iapetus.mod
@@ -3,22 +3,23 @@ return {
Name = "Iapetus",
Parent = "SaturnBarycenter",
Renderable = {
- Type = "RenderablePlanet",
- Frame = "IAU_IAPETUS",
- Body = "IAPETUS",
- Geometry = {
- Type = "SimpleSphere",
- Radius = 0.746E3,
- Segments = 50
- },
- Textures = {
- Color = "textures/iapetus.jpg"
+ Type = "RenderableGlobe",
+ Radii = 734000,
+ SegmentsPerPatch = 64,
+ Layers = {
+ ColorLayers = {
+ {
+ Name = "Iapetus Texture",
+ FilePath = "textures/iapetus.jpg",
+ Enabled = true
+ }
+ }
}
},
Transform = {
Translation = {
Type = "SpiceTranslation",
- Body = "IAPETUS",
+ Target = "IAPETUS",
Observer = "SATURN BARYCENTER",
Kernels = "${OPENSPACE_DATA}/spice/sat375.bsp"
},
@@ -36,7 +37,7 @@ return {
Type = "RenderableTrailOrbit",
Translation = {
Type = "SpiceTranslation",
- Body = "IAPETUS",
+ Target = "IAPETUS",
Observer = "SATURN BARYCENTER",
},
Color = { 0.5, 0.3, 0.3 },
@@ -44,4 +45,4 @@ return {
Resolution = 1000
}
}
-}
\ No newline at end of file
+}
diff --git a/data/scene/saturn/mimas/mimas.mod b/data/scene/saturn/mimas/mimas.mod
index 9f8e5242e6..3d4eb0bf4d 100644
--- a/data/scene/saturn/mimas/mimas.mod
+++ b/data/scene/saturn/mimas/mimas.mod
@@ -3,22 +3,23 @@ return {
Name = "Mimas",
Parent = "SaturnBarycenter",
Renderable = {
- Type = "RenderablePlanet",
- Frame = "IAU_MIMAS",
- Body = "MIMAS",
- Geometry = {
- Type = "SimpleSphere",
- Radius = 0.28E3,
- Segments = 50
- },
- Textures = {
- Color = "textures/mimas.jpg"
+ Type = "RenderableGlobe",
+ Radii = 198000,
+ SegmentsPerPatch = 64,
+ Layers = {
+ ColorLayers = {
+ {
+ Name = "Mimas Texture",
+ FilePath = "textures/mimas.jpg",
+ Enabled = true
+ }
+ }
}
},
Transform = {
Translation = {
Type = "SpiceTranslation",
- Body = "MIMAS",
+ Target = "MIMAS",
Observer = "SATURN BARYCENTER",
Kernels = "${OPENSPACE_DATA}/spice/sat375.bsp"
},
@@ -36,7 +37,7 @@ return {
Type = "RenderableTrailOrbit",
Translation = {
Type = "SpiceTranslation",
- Body = "MIMAS",
+ Target = "MIMAS",
Observer = "SATURN BARYCENTER",
},
Color = { 0.5, 0.3, 0.3 },
diff --git a/data/scene/saturn/rhea/rhea.mod b/data/scene/saturn/rhea/rhea.mod
index 8bb6c61393..52e61ed44c 100644
--- a/data/scene/saturn/rhea/rhea.mod
+++ b/data/scene/saturn/rhea/rhea.mod
@@ -3,22 +3,23 @@ return {
Name = "Rhea",
Parent = "SaturnBarycenter",
Renderable = {
- Type = "RenderablePlanet",
- Frame = "IAU_RHEA",
- Body = "RHEA",
- Geometry = {
- Type = "SimpleSphere",
- Radius = 0.765E3,
- Segments = 50
- },
- Textures = {
- Color = "textures/rhea.jpg"
+ Type = "RenderableGlobe",
+ Radii = 765000,
+ SegmentsPerPatch = 64,
+ Layers = {
+ ColorLayers = {
+ {
+ Name = "Rhea Texture",
+ FilePath = "textures/rhea.jpg",
+ Enabled = true
+ }
+ }
}
},
Transform = {
Translation = {
Type = "SpiceTranslation",
- Body = "RHEA",
+ Target = "RHEA",
Observer = "SATURN BARYCENTER",
Kernels = "${OPENSPACE_DATA}/spice/sat375.bsp"
},
@@ -36,7 +37,7 @@ return {
Type = "RenderableTrailOrbit",
Translation = {
Type = "SpiceTranslation",
- Body = "RHEA",
+ Target = "RHEA",
Observer = "SATURN BARYCENTER",
},
Color = { 0.5, 0.3, 0.3 },
@@ -44,4 +45,4 @@ return {
Resolution = 1000
}
}
-}
\ No newline at end of file
+}
diff --git a/data/scene/saturn/saturn/saturn.mod b/data/scene/saturn/saturn/saturn.mod
index 675910faab..f597dfcdb3 100644
--- a/data/scene/saturn/saturn/saturn.mod
+++ b/data/scene/saturn/saturn/saturn.mod
@@ -6,11 +6,11 @@ return {
Transform = {
Translation = {
Type = "SpiceTranslation",
- Body = "SATURN BARYCENTER",
+ Target = "SATURN BARYCENTER",
Observer = "SUN",
Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp"
}
- },
+ }
},
-- Saturn module
@@ -18,36 +18,27 @@ return {
Name = "Saturn",
Parent = "SaturnBarycenter",
Renderable = {
- Type = "RenderablePlanet",
- Frame = "IAU_SATURN",
- Body = "SATURN BARYCENTER",
- Geometry = {
- Type = "SimpleSphere",
- Radius = 5.8232E7,
- Segments = 100
- },
- Textures = {
- Type = "simple",
- Color = "textures/saturn.jpg",
- },
- Atmosphere = {
- Type = "Nishita", -- for example, values missing etc etc
- MieFactor = 1.0,
- MieColor = {1.0, 1.0, 1.0}
+ Type = "RenderableGlobe",
+ Radii = { 60268000, 60268000, 54364000 },
+ SegmentsPerPatch = 64,
+ Layers = {
+ ColorLayers = {
+ {
+ Name = "Saturn Texture",
+ FilePath = "textures/saturn.jpg",
+ Enabled = true
+ }
+ }
}
},
- Tag = "planet_solarSystem",
+ Tag = { "planet_solarSystem", "planet_giants" },
Transform = {
Rotation = {
Type = "SpiceRotation",
SourceFrame = "IAU_SATURN",
- DestinationFrame = "GALACTIC",
- },
- Scale = {
- Type = "StaticScale",
- Scale = 1,
- },
- },
+ DestinationFrame = "GALACTIC"
+ }
+ }
},
{
Name = "SaturnRings",
@@ -57,9 +48,7 @@ return {
Texture = "textures/saturn_rings.png",
Size = 140220000,
Offset = { 74500 / 140445.100671159, 1.0 } -- min / max extend
-
- },
-
+ }
},
-- SaturnTrail module
{
@@ -69,13 +58,13 @@ return {
Type = "RenderableTrailOrbit",
Translation = {
Type = "SpiceTranslation",
- Body = "SATURN BARYCENTER",
- Observer = "SUN",
+ Target = "SATURN BARYCENTER",
+ Observer = "SUN"
},
Color = {0.85,0.75,0.51 },
Period = 10746.94,
Resolution = 1000,
- Tag = "planetTrail_solarSystem"
},
+ Tag = { "planetTrail_solarSystem", "planetTrail_giants" }
}
}
diff --git a/data/scene/saturn/tethys/tethys.mod b/data/scene/saturn/tethys/tethys.mod
index 8fe16fa3cd..c7c94548bc 100644
--- a/data/scene/saturn/tethys/tethys.mod
+++ b/data/scene/saturn/tethys/tethys.mod
@@ -3,22 +3,23 @@ return {
Name = "Tethys",
Parent = "SaturnBarycenter",
Renderable = {
- Type = "RenderablePlanet",
- Frame = "IAU_TETHYS",
- Body = "TETHYS",
- Geometry = {
- Type = "SimpleSphere",
- Radius = 0.538E3,
- Segments = 50
- },
- Textures = {
- Color = "textures/tethys.jpg"
+ Type = "RenderableGlobe",
+ Radii = 531100,
+ SegmentsPerPatch = 64,
+ Layers = {
+ ColorLayers = {
+ {
+ Name = "Tethys Texture",
+ FilePath = "textures/tethys.jpg",
+ Enabled = true
+ }
+ }
}
},
Transform = {
Translation = {
Type = "SpiceTranslation",
- Body = "TETHYS",
+ Target = "TETHYS",
Observer = "SATURN BARYCENTER",
Kernels = "${OPENSPACE_DATA}/spice/sat375.bsp"
},
@@ -36,7 +37,7 @@ return {
Type = "RenderableTrailOrbit",
Translation = {
Type = "SpiceTranslation",
- Body = "TETHYS",
+ Target = "TETHYS",
Observer = "SATURN BARYCENTER",
},
Color = { 0.5, 0.3, 0.3 },
@@ -44,4 +45,4 @@ return {
Resolution = 1000
}
}
-}
\ No newline at end of file
+}
diff --git a/data/scene/saturn/titan/titan.mod b/data/scene/saturn/titan/titan.mod
index 12cc0d6034..47f20679c7 100644
--- a/data/scene/saturn/titan/titan.mod
+++ b/data/scene/saturn/titan/titan.mod
@@ -3,22 +3,23 @@ return {
Name = "Titan",
Parent = "SaturnBarycenter",
Renderable = {
- Type = "RenderablePlanet",
- Frame = "IAU_TITAN",
- Body = "TITAN",
- Geometry = {
- Type = "SimpleSphere",
- Radius = 0.2575E4,
- Segments = 50
- },
- Textures = {
- Color = "textures/titan.jpg"
+ Type = "RenderableGlobe",
+ Radii = 2576000,
+ SegmentsPerPatch = 64,
+ Layers = {
+ ColorLayers = {
+ {
+ Name = "Titan Texture",
+ FilePath = "textures/titan.jpg",
+ Enabled = true
+ }
+ }
}
- },
+ },
Transform = {
Translation = {
Type = "SpiceTranslation",
- Body = "TITAN",
+ Target = "TITAN",
Observer = "SATURN BARYCENTER",
Kernels = "${OPENSPACE_DATA}/spice/sat375.bsp"
},
@@ -36,7 +37,7 @@ return {
Type = "RenderableTrailOrbit",
Translation = {
Type = "SpiceTranslation",
- Body = "TITAN",
+ Target = "TITAN",
Observer = "SATURN BARYCENTER",
},
Color = { 0.5, 0.3, 0.3 },
@@ -44,4 +45,4 @@ return {
Resolution = 1000
}
}
-}
\ No newline at end of file
+}
diff --git a/data/scene/stars-denver/stars-denver.data b/data/scene/stars/denver/denver.data
similarity index 100%
rename from data/scene/stars-denver/stars-denver.data
rename to data/scene/stars/denver/denver.data
diff --git a/data/scene/stars-denver/stars-denver.mod b/data/scene/stars/denver/denver.mod
similarity index 100%
rename from data/scene/stars-denver/stars-denver.mod
rename to data/scene/stars/denver/denver.mod
diff --git a/data/scene/stars/stars.data b/data/scene/stars/digitaluniverse/digitaluniverse.data
similarity index 100%
rename from data/scene/stars/stars.data
rename to data/scene/stars/digitaluniverse/digitaluniverse.data
diff --git a/data/scene/stars/stars.mod b/data/scene/stars/digitaluniverse/digitaluniverse.mod
similarity index 100%
rename from data/scene/stars/stars.mod
rename to data/scene/stars/digitaluniverse/digitaluniverse.mod
diff --git a/data/scene/sun/sun.mod b/data/scene/sun/sun.mod
index 11b0e1516d..86d5516c68 100644
--- a/data/scene/sun/sun.mod
+++ b/data/scene/sun/sun.mod
@@ -24,16 +24,13 @@ return {
Radius = 6.957E8,
Segments = 100
},
- Textures = {
- Type = "simple",
- Color = "textures/sun.jpg",
- },
+ ColorTexture = "textures/sun.jpg",
PerformShading = false,
},
Transform = {
Translation = {
Type = "SpiceTranslation",
- Body = "SUN",
+ Target = "SUN",
Observer = "SSB",
Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp"
},
@@ -59,7 +56,7 @@ return {
Transform = {
Translation = {
Type = "SpiceTranslation",
- Body = "SUN",
+ Target = "SUN",
Observer = "SSB",
Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp"
}
diff --git a/data/scene/uranus/uranus.mod b/data/scene/uranus/uranus.mod
index 28e4568118..648a60f943 100644
--- a/data/scene/uranus/uranus.mod
+++ b/data/scene/uranus/uranus.mod
@@ -1,56 +1,45 @@
return {
- -- Uranus barycenter module
+ -- Barycenter module
{
Name = "UranusBarycenter",
Parent = "SolarSystemBarycenter",
Transform = {
Translation = {
Type = "SpiceTranslation",
- Body = "URANUS BARYCENTER",
+ Target = "URANUS BARYCENTER",
Observer = "SUN",
Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp"
- },
+ }
}
},
-
- -- Uranus module
+ -- RenderableGlobe module
{
Name = "Uranus",
Parent = "UranusBarycenter",
- Renderable = {
- Type = "RenderablePlanet",
- Frame = "IAU_URANUS",
- Body = "URANUS BARYCENTER",
- Geometry = {
- Type = "SimpleSphere",
- Radius = 2.5362E7,
- Segments = 100
- },
- Textures = {
- Type = "simple",
- Color = "textures/uranus.jpg",
- },
- Atmosphere = {
- Type = "Nishita", -- for example, values missing etc etc
- MieFactor = 1.0,
- MieColor = {1.0, 1.0, 1.0}
- }
- },
- Tag = "planet_solarSystem",
Transform = {
Rotation = {
Type = "SpiceRotation",
SourceFrame = "IAU_URANUS",
- DestinationFrame = "ECLIPJ2000",
- },
- Scale = {
- Type = "StaticScale",
- Scale = 1,
- },
+ DestinationFrame = "GALACTIC"
+ }
},
+ Renderable = {
+ Type = "RenderableGlobe",
+ Radii = { 25559000, 25559000, 24973000 },
+ SegmentsPerPatch = 64,
+ Layers = {
+ ColorLayers = {
+ {
+ Name = "Texture",
+ FilePath = "textures/uranus.jpg",
+ Enabled = true
+ }
+ }
+ }
+ },
+ Tag = { "planet_solarSystem", "planet_giants" }
},
-
- -- UranusTrail module
+ -- Trail module
{
Name = "UranusTrail",
Parent = "SolarSystemBarycenter",
@@ -58,13 +47,13 @@ return {
Type = "RenderableTrailOrbit",
Translation = {
Type = "SpiceTranslation",
- Body = "URANUS BARYCENTER",
- Observer = "SUN",
+ Target = "URANUS BARYCENTER",
+ Observer = "SUN"
},
Color = {0.60, 0.95, 1.00 },
Period = 30588.740,
- Resolution = 1000,
- Tag = "planetTrail_solarSystem"
- }
+ Resolution = 1000
+ },
+ Tag = { "planetTrail_solarSystem", "planetTrail_giants" }
}
}
diff --git a/data/scene/venus/venus.mod b/data/scene/venus/venus.mod
index 7badb32f9c..60a095ad9d 100644
--- a/data/scene/venus/venus.mod
+++ b/data/scene/venus/venus.mod
@@ -1,70 +1,65 @@
return {
- -- Venus barycenter module
+ -- Barycenter module
{
Name = "VenusBarycenter",
Parent = "SolarSystemBarycenter",
Transform = {
Translation = {
Type = "SpiceTranslation",
- Body = "VENUS BARYCENTER",
+ Target = "VENUS BARYCENTER",
Observer = "SUN",
Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp"
- },
+ }
}
},
-
- -- Venus module
+ -- RenderableGlobe module
{
Name = "Venus",
Parent = "VenusBarycenter",
- Renderable = {
- Type = "RenderablePlanet",
- Frame = "IAU_VENUS",
- Body = "VENUS",
- Geometry = {
- Type = "SimpleSphere",
- Radius = 3.760E6,
- Segments = 100
- },
- Textures = {
- Type = "simple",
- Color = "textures/venus.jpg",
- },
- Atmosphere = {
- Type = "Nishita", -- for example, values missing etc etc
- MieFactor = 1.0,
- MieColor = {1.0, 1.0, 1.0}
- }
- },
- Tag = {"planet_solarSystem", "planet_terrestrial"},
Transform = {
Rotation = {
Type = "SpiceRotation",
SourceFrame = "IAU_VENUS",
DestinationFrame = "GALACTIC"
},
- Scale = {
- Type = "StaticScale",
- Scale = 1,
- },
+ Translation = {
+ Type = "SpiceTranslation",
+ Target = "VENUS",
+ Observer = "VENUS BARYCENTER",
+ Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp"
+ }
},
+ Renderable = {
+ Type = "RenderableGlobe",
+ Radii = { 6051900, 6051900, 6051800 },
+ SegmentsPerPatch = 64,
+ Layers = {
+ ColorLayers = {
+ {
+ Name = "Venus Texture",
+ FilePath = "textures/venus.jpg",
+ Enabled = true
+ }
+ }
+ }
+ },
+ Tag = { "planet_solarSystem", "planet_terrestrial" },
},
-
- -- VenusTrail module
- {
+ -- Trail module
+ {
Name = "VenusTrail",
Parent = "SolarSystemBarycenter",
Renderable = {
Type = "RenderableTrailOrbit",
Translation = {
Type = "SpiceTranslation",
- Body = "VENUS BARYCENTER",
- Observer = "SUN",
+ Target = "VENUS BARYCENTER",
+ Observer = "SUN"
},
Color = { 1.0, 0.5, 0.2 },
Period = 224.695,
- Resolution = 1000,
- Tag = {"planetTrail_solarSystem", "planetTrail_terrestrial"}
- }
+ Resolution = 1000
+ },
+ Tag = { "planetTrail_solarSystem", "planetTrail_terrestrial" }
}
}
diff --git a/data/web/common/style.css b/data/web/common/style.css
index ac82e9fe77..f785e54ff7 100644
--- a/data/web/common/style.css
+++ b/data/web/common/style.css
@@ -57,6 +57,10 @@
font-size: 0.9em;
}
+.documentation-documentation {
+ font-size: 0.9em;
+}
+
.documentation-container {
font-size: 1.2em;
}
diff --git a/data/web/properties/property.hbs b/data/web/properties/property.hbs
index b01807229d..7a0bd7a430 100644
--- a/data/web/properties/property.hbs
+++ b/data/web/properties/property.hbs
@@ -10,6 +10,7 @@
{{fullyQualifiedId}}
copy
+ {{description}}
diff --git a/ext/ghoul b/ext/ghoul
index 1fc3d1f78d..de8da4af5e 160000
--- a/ext/ghoul
+++ b/ext/ghoul
@@ -1 +1 @@
-Subproject commit 1fc3d1f78dfd9227ee0068f388f96ea6b1b7bf9f
+Subproject commit de8da4af5e21f2c7ca8e8a520e6ac98e522be42f
diff --git a/include/openspace/documentation/documentation.h b/include/openspace/documentation/documentation.h
index 852b8faa9b..1bc33344e3 100644
--- a/include/openspace/documentation/documentation.h
+++ b/include/openspace/documentation/documentation.h
@@ -37,7 +37,6 @@ namespace ghoul { class Dictionary; }
namespace openspace::documentation {
using Optional = ghoul::Boolean;
-using Exhaustive = ghoul::Boolean;
/**
* The TestResult structure returns the information from the #testSpecification method. It
@@ -162,7 +161,7 @@ struct DocumentationEntry {
* \pre \p verifier must not be nullptr
*/
DocumentationEntry(std::string key, std::shared_ptr verifier,
- std::string doc = "", Optional optional = Optional::No);
+ Optional optional, std::string doc = "");
/**
* The constructor for a DocumentationEntry describing a \p key in a Documentation.
@@ -185,8 +184,8 @@ struct DocumentationEntry {
* \pre \p key must not be empty
* \pre \p verifier must not be nullptr
*/
- DocumentationEntry(std::string key, Verifier* verifier, std::string doc = "",
- Optional optional = Optional::No);
+ DocumentationEntry(std::string key, Verifier* verifier, Optional optional,
+ std::string doc = "");
/// The key that is described by this DocumentationEntry
std::string key;
@@ -204,11 +203,8 @@ struct DocumentationEntry {
* used to impose restrictions on keys and values and determine whether a given
* ghoul::Dictionary adheres to these specifications (see #testSpecification and
* #testSpecificationAndThrow methods). Each Documentation consists of a human-readable
- * \c name, a list of DocumentationEntry%s that each describe a single key value, and a
- * flag whether these entries are Exhaustive or not. If a Documentation is Exhaustive, a
- * ghoul::Dictionary that contains additional keys will fail the specification, whereas a
- * non-exhaustive Documentation allow for other (potentially non used) keys. The most
- * convenient way of creating a Documentation is by using nested initializer lists:
+ * \c name, and a list of DocumentationEntry%s that each describe a single key value. The
+ * most convenient way of creating a Documentation is by using nested initializer lists:
*\verbatim
Documentation doc = {
"Documentation for an arbitrary dictionary",
@@ -216,9 +212,8 @@ Documentation doc = {
{ "key1", new IntVerifier, "Documentation key1", Optional::Yes },
{ "key2", new FloatVerifier, "Documentation key2" },
{ "key3", new StringVerifier }
- },
- Exhaustive::Yes
-+;
+ }
+};
\endverbatim
*
* If multiple DocumentationEntries cover the same key, they are all evaluated for that
@@ -236,31 +231,23 @@ struct Documentation {
* Documentation%s to reference this entry
* \param entries A list of DocumentationEntry%s that describe the individual keys for
* this entrie Documentation
- * \param exhaustive Determines whether the \p entries are an exhaustive specification
- * of the object or whether additional, potentially unused, keys are allowed
*/
- Documentation(std::string name, std::string id, DocumentationEntries entries = {},
- Exhaustive exhaustive = Exhaustive::No);
+ Documentation(std::string name, std::string id, DocumentationEntries entries = {});
/**
* 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
- * \param exhaustive Determines whether the \p entries are an exhaustive specification
- * of the object or whether additional, potentially unused, keys are allowed
*/
- Documentation(std::string name, DocumentationEntries entries = {},
- Exhaustive exhaustive = Exhaustive::No);
+ Documentation(std::string name, DocumentationEntries entries = {});
/**
* Creates a Documentation.
* \param entries A list of DocumentationEntry%s that describe the individual keys for
* this entrie Documentation
- * \param exhaustive Determines whether the \p entries are an exhaustive specification
- * of the object or whether additional, potentially unused, keys are allowed
*/
- Documentation(DocumentationEntries entries = {}, Exhaustive exhaustive = Exhaustive::No);
+ Documentation(DocumentationEntries entries = {});
/// The human-readable name of the Documentation
std::string name;
@@ -268,8 +255,6 @@ struct Documentation {
std::string id;
/// A list of specifications that are describing this Documentation
DocumentationEntries entries;
- /// A flag to say wheter the DocumentationEntries are an exhaustive description
- Exhaustive exhaustive;
};
/**
diff --git a/include/openspace/documentation/verifier.h b/include/openspace/documentation/verifier.h
index d82681b0e7..aacecf1e44 100644
--- a/include/openspace/documentation/verifier.h
+++ b/include/openspace/documentation/verifier.h
@@ -170,12 +170,8 @@ struct TableVerifier : public TemplateVerifier {
* \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
- * \param exhaustive Whether the DocumentationEntry%s contained in
- * \p documentationEntries completely describe the contained table or whether
- * additional keys are allowed
*/
- TableVerifier(std::vector documentationEntries = {},
- Exhaustive exhaustive = Exhaustive::No);
+ TableVerifier(std::vector documentationEntries = {});
/**
* Checks whether the \p key%'s value is a table (= ghoul::Dictionary) and (if
@@ -197,9 +193,6 @@ struct TableVerifier : public TemplateVerifier {
/// The documentations passed in the constructor
std::vector documentations;
- /// Flag that specifies whether the TableVerifier::documentation exhaustively
- /// describes the table or whether additional keys are allowed
- Exhaustive exhaustive;
};
/**
diff --git a/include/openspace/interaction/orbitalnavigator.h b/include/openspace/interaction/orbitalnavigator.h
index eaf3c6277c..24a86b1a44 100644
--- a/include/openspace/interaction/orbitalnavigator.h
+++ b/include/openspace/interaction/orbitalnavigator.h
@@ -64,10 +64,16 @@ private:
glm::dquat globalRotation;
};
- // Properties
- properties::BoolProperty _rollFriction;
- properties::BoolProperty _rotationalFriction;
- properties::BoolProperty _zoomFriction;
+ struct Friction : public properties::PropertyOwner {
+ Friction();
+
+ properties::BoolProperty roll;
+ properties::BoolProperty rotational;
+ properties::BoolProperty zoom;
+ };
+
+ Friction _friction;
+
properties::FloatProperty _followFocusNodeRotationDistance;
properties::FloatProperty _minimumAllowedDistance;
properties::FloatProperty _sensitivity;
diff --git a/include/openspace/properties/numericalproperty.inl b/include/openspace/properties/numericalproperty.inl
index 0c524a3b0c..79d2f13b23 100644
--- a/include/openspace/properties/numericalproperty.inl
+++ b/include/openspace/properties/numericalproperty.inl
@@ -27,7 +27,7 @@
namespace openspace::properties {
#define REGISTER_NUMERICALPROPERTY_HEADER(CLASS_NAME, TYPE) \
- typedef NumericalProperty CLASS_NAME; \
+ using CLASS_NAME = NumericalProperty; \
\
template <> \
std::string PropertyDelegate>::className(); \
diff --git a/include/openspace/properties/propertyowner.h b/include/openspace/properties/propertyowner.h
index 693b7df1e6..ae4c4c3926 100644
--- a/include/openspace/properties/propertyowner.h
+++ b/include/openspace/properties/propertyowner.h
@@ -51,9 +51,14 @@ class PropertyOwner {
public:
/// The separator that is used while accessing the properties and/or sub-owners
static const char URISeparator = '.';
+
+ struct PropertyOwnerInfo {
+ std::string name;
+ std::string description;
+ };
/// The constructor initializing the PropertyOwner's name to ""
- PropertyOwner(std::string name = "");
+ PropertyOwner(PropertyOwnerInfo info);
/**
* The destructor will remove all Propertys and PropertyOwners it owns along with
@@ -75,7 +80,12 @@ public:
* Returns the name of this PropertyOwner.
* \return The name of this PropertyOwner
*/
- const std::string& name() const;
+ std::string name() const;
+
+ void setDescription(std::string description);
+
+ std::string description() const;
+
/**
* Returns a list of all Propertys directly owned by this PropertyOwner. This list not
@@ -223,6 +233,8 @@ public:
private:
/// The name of this PropertyOwner
std::string _name;
+ /// The description for this PropertyOwner
+ std::string _description;
/// The owner of this PropertyOwner
PropertyOwner* _owner;
/// A list of all registered Property's
diff --git a/include/openspace/properties/selectionproperty.h b/include/openspace/properties/selectionproperty.h
index ea59ad2d4d..84300f43b7 100644
--- a/include/openspace/properties/selectionproperty.h
+++ b/include/openspace/properties/selectionproperty.h
@@ -44,6 +44,11 @@ public:
void removeOptions();
const std::vector& options() const;
+ using TemplateProperty>::operator std::vector;
+
+ using TemplateProperty>::operator=;
+
+
private:
static const std::string OptionsKey;
std::string generateAdditionalDescription() const;
diff --git a/include/openspace/rendering/renderable.h b/include/openspace/rendering/renderable.h
index 623535fc81..9feffdb280 100644
--- a/include/openspace/rendering/renderable.h
+++ b/include/openspace/rendering/renderable.h
@@ -64,8 +64,8 @@ public:
Renderable(const ghoul::Dictionary& dictionary);
virtual ~Renderable();
- virtual bool initialize() = 0;
- virtual bool deinitialize() = 0;
+ virtual void initialize();
+ virtual void deinitialize();
virtual bool isReady() const = 0;
bool isEnabled() const;
diff --git a/include/openspace/scene/scenegraphnode.h b/include/openspace/scene/scenegraphnode.h
index 7f940aafc7..0c4a95e9fa 100644
--- a/include/openspace/scene/scenegraphnode.h
+++ b/include/openspace/scene/scenegraphnode.h
@@ -75,8 +75,8 @@ public:
static std::unique_ptr createFromDictionary(const ghoul::Dictionary& dictionary);
- bool initialize();
- bool deinitialize();
+ void initialize();
+ void deinitialize();
void traversePreOrder(std::function fn);
void traversePostOrder(std::function fn);
diff --git a/modules/base/rendering/modelgeometry.cpp b/modules/base/rendering/modelgeometry.cpp
index c82d08c700..2a52631a6d 100644
--- a/modules/base/rendering/modelgeometry.cpp
+++ b/modules/base/rendering/modelgeometry.cpp
@@ -55,16 +55,16 @@ documentation:: Documentation ModelGeometry::Documentation() {
{
KeyType,
new StringVerifier,
- "The type of the Model Geometry that should be generated",
- Optional::No
+ Optional::No,
+ "The type of the Model Geometry that should be generated"
},
{
KeyGeomModelFile,
new StringVerifier,
+ Optional::No,
"The file that should be loaded in this ModelGeometry. The file can "
"contain filesystem tokens or can be specified relatively to the "
- "location of the .mod file.",
- Optional::No
+ "location of the .mod file."
}
}
};
@@ -85,7 +85,7 @@ std::unique_ptr ModelGeometry::createFromDictionary(
}
ModelGeometry::ModelGeometry(const ghoul::Dictionary& dictionary)
- : properties::PropertyOwner("ModelGeometry")
+ : properties::PropertyOwner({ "ModelGeometry" })
, _mode(GL_TRIANGLES)
{
documentation::testSpecificationAndThrow(
diff --git a/modules/base/rendering/renderablemodel.cpp b/modules/base/rendering/renderablemodel.cpp
index 374ae7587b..f096f547fa 100644
--- a/modules/base/rendering/renderablemodel.cpp
+++ b/modules/base/rendering/renderablemodel.cpp
@@ -42,13 +42,11 @@
#include
#include
-namespace {
+namespace {
const char* KeyGeometry = "Geometry";
- const char* KeyTexture = "Textures.Color";
- const char* KeyModelTransform = "Rotation.ModelTransform";
static const openspace::properties::Property::PropertyInfo TextureInfo = {
- "ColorTexture", // @TODO replace with only "Texture"
+ "ColorTexture",
"Color Texture",
"This value points to a color texture file that is applied to the geometry "
"rendered in this object."
@@ -60,6 +58,13 @@ namespace {
"This value determines whether this model should be shaded by using the position "
"of the Sun."
};
+
+ static const openspace::properties::Property::PropertyInfo ModelTransformInfo = {
+ "ModelTransform",
+ "Model Transform",
+ "This value specifies the model transform that is applied to the model before "
+ "all other transformations are applied."
+ };
} // namespace
namespace openspace {
@@ -73,27 +78,26 @@ documentation::Documentation RenderableModel::Documentation() {
{
KeyGeometry,
new ReferencingVerifier("base_geometry_model"),
- "This specifies the model that is rendered by the Renderable.",
- Optional::No
+ Optional::No,
+ "This specifies the model that is rendered by the Renderable."
},
{
- KeyTexture, // @TODO replace with TextureInfo.identifier
+ TextureInfo.identifier,
new StringVerifier,
- TextureInfo.description,
- Optional::Yes
+ Optional::Yes,
+ TextureInfo.description
},
{
ShadingInfo.identifier,
new BoolVerifier,
- ShadingInfo.description,
- Optional::Yes
+ Optional::Yes,
+ ShadingInfo.description
},
{
- KeyModelTransform,
+ ModelTransformInfo.identifier,
new DoubleMatrix3Verifier,
- "Specifies a distinct transformation matrix that is applied to the "
- "model. If it is not specified, it is equal to the Identity matrix.",
- Optional::Yes
+ Optional::Yes,
+ ModelTransformInfo.description
}
}
};
@@ -104,9 +108,9 @@ RenderableModel::RenderableModel(const ghoul::Dictionary& dictionary)
, _geometry(nullptr)
, _colorTexturePath(TextureInfo)
, _performShading(ShadingInfo, true)
+ , _modelTransform(ModelTransformInfo, glm::mat3(1.0))
, _programObject(nullptr)
, _texture(nullptr)
- , _modelTransform(1.0)
{
ghoul_precondition(
dictionary.hasKeyAndValue(SceneGraphNode::KeyName),
@@ -126,12 +130,14 @@ RenderableModel::RenderableModel(const ghoul::Dictionary& dictionary)
_geometry = modelgeometry::ModelGeometry::createFromDictionary(dict);
}
- if (dictionary.hasKey(KeyTexture)) {
- _colorTexturePath = absPath(dictionary.value(KeyTexture));
+ if (dictionary.hasKey(TextureInfo.identifier)) {
+ _colorTexturePath = absPath(dictionary.value(
+ TextureInfo.identifier
+ ));
}
- if (dictionary.hasKey(KeyModelTransform)) {
- _modelTransform = dictionary.value(KeyModelTransform);
+ if (dictionary.hasKey(ModelTransformInfo.identifier)) {
+ _modelTransform = dictionary.value(ModelTransformInfo.identifier);
}
if (dictionary.hasKey(ShadingInfo.identifier)) {
@@ -150,7 +156,7 @@ bool RenderableModel::isReady() const {
return _programObject && _texture;
}
-bool RenderableModel::initialize() {
+void RenderableModel::initialize() {
_programObject = OsEng.renderEngine().buildRenderProgram(
"ModelProgram",
"${MODULE_BASE}/shaders/model_vs.glsl",
@@ -159,13 +165,10 @@ bool RenderableModel::initialize() {
loadTexture();
- bool completeSuccess = true;
- completeSuccess &= (_texture != nullptr);
- completeSuccess &= _geometry->initialize(this);
- return completeSuccess;
+ _geometry->initialize(this);
}
-bool RenderableModel::deinitialize() {
+void RenderableModel::deinitialize() {
if (_geometry) {
_geometry->deinitialize();
_geometry = nullptr;
@@ -176,8 +179,6 @@ bool RenderableModel::deinitialize() {
OsEng.renderEngine().removeRenderProgram(_programObject);
_programObject = nullptr;
}
-
- return true;
}
void RenderableModel::render(const RenderData& data, RendererTasks&) {
@@ -187,7 +188,7 @@ void RenderableModel::render(const RenderData& data, RendererTasks&) {
glm::dmat4 modelTransform =
glm::translate(glm::dmat4(1.0), data.modelTransform.translation) * // Translation
glm::dmat4(data.modelTransform.rotation) * // Spice rotation
- glm::dmat4(glm::scale(glm::dmat4(_modelTransform), glm::dvec3(data.modelTransform.scale)));
+ glm::dmat4(glm::scale(glm::dmat4(_modelTransform.value()), glm::dvec3(data.modelTransform.scale)));
glm::dmat4 modelViewTransform = data.camera.combinedViewMatrix() * modelTransform;
glm::vec3 directionToSun = glm::normalize(_sunPos - data.modelTransform.translation);
@@ -197,7 +198,6 @@ void RenderableModel::render(const RenderData& data, RendererTasks&) {
_programObject->setUniform("modelViewTransform", glm::mat4(modelViewTransform));
_programObject->setUniform("projectionTransform", data.camera.projectionMatrix());
_programObject->setUniform("performShading", _performShading);
- _programObject->setUniform("fading", 1.f); // @TODO remove this
_geometry->setUniforms(*_programObject);
diff --git a/modules/base/rendering/renderablemodel.h b/modules/base/rendering/renderablemodel.h
index 1fc9ec5c51..86b8d1c35f 100644
--- a/modules/base/rendering/renderablemodel.h
+++ b/modules/base/rendering/renderablemodel.h
@@ -28,9 +28,9 @@
#include
#include
+#include
#include
#include
-#include
#include
@@ -51,8 +51,8 @@ class RenderableModel : public Renderable {
public:
RenderableModel(const ghoul::Dictionary& dictionary);
- bool initialize() override;
- bool deinitialize() override;
+ void initialize() override;
+ void deinitialize() override;
bool isReady() const override;
@@ -69,11 +69,11 @@ private:
properties::StringProperty _colorTexturePath;
properties::BoolProperty _performShading;
+ properties::Mat3Property _modelTransform;
std::unique_ptr _programObject;
std::unique_ptr _texture;
- glm::dmat3 _modelTransform;
glm::dvec3 _sunPos;
};
diff --git a/modules/base/rendering/renderableplane.cpp b/modules/base/rendering/renderableplane.cpp
index 8dafb0a336..432c898e3a 100644
--- a/modules/base/rendering/renderableplane.cpp
+++ b/modules/base/rendering/renderableplane.cpp
@@ -82,26 +82,26 @@ documentation::Documentation RenderablePlane::Documentation() {
{
SizeInfo.identifier,
new DoubleVerifier,
- SizeInfo.description,
- Optional::No
+ Optional::No,
+ SizeInfo.description
},
{
BillboardInfo.identifier,
new BoolVerifier,
- BillboardInfo.description,
- Optional::Yes
+ Optional::Yes,
+ BillboardInfo.description
},
{
BlendModeInfo.identifier,
new StringInListVerifier({ "Normal", "Additive" }),
+ Optional::Yes,
BlendModeInfo.description, // + " The default value is 'Normal'.",
- Optional::Yes
},
{
TextureInfo.identifier,
new StringVerifier,
+ Optional::No,
TextureInfo.description,
- Optional::No
}
}
};
@@ -179,7 +179,7 @@ bool RenderablePlane::isReady() const {
return _shader && _texture;
}
-bool RenderablePlane::initialize() {
+void RenderablePlane::initialize() {
glGenVertexArrays(1, &_quad); // generate array
glGenBuffers(1, &_vertexPositionBuffer); // generate buffer
createPlane();
@@ -187,14 +187,12 @@ bool RenderablePlane::initialize() {
_shader = OsEng.renderEngine().buildRenderProgram("PlaneProgram",
"${MODULE_BASE}/shaders/plane_vs.glsl",
"${MODULE_BASE}/shaders/plane_fs.glsl"
- );
+ );
loadTexture();
-
- return isReady();
}
-bool RenderablePlane::deinitialize() {
+void RenderablePlane::deinitialize() {
glDeleteVertexArrays(1, &_quad);
_quad = 0;
@@ -208,8 +206,6 @@ bool RenderablePlane::deinitialize() {
renderEngine.removeRenderProgram(_shader);
_shader = nullptr;
}
-
- return true;
}
void RenderablePlane::render(const RenderData& data, RendererTasks&) {
diff --git a/modules/base/rendering/renderableplane.h b/modules/base/rendering/renderableplane.h
index 143a004cae..a18659d6b1 100644
--- a/modules/base/rendering/renderableplane.h
+++ b/modules/base/rendering/renderableplane.h
@@ -54,8 +54,8 @@ class RenderablePlane : public Renderable {
public:
RenderablePlane(const ghoul::Dictionary& dictionary);
- bool initialize() override;
- bool deinitialize() override;
+ void initialize() override;
+ void deinitialize() override;
bool isReady() const override;
diff --git a/modules/base/rendering/renderablesphere.cpp b/modules/base/rendering/renderablesphere.cpp
index a226bd7bda..9ea2204c79 100644
--- a/modules/base/rendering/renderablesphere.cpp
+++ b/modules/base/rendering/renderablesphere.cpp
@@ -92,32 +92,32 @@ documentation::Documentation RenderableSphere::Documentation() {
{
SizeInfo.identifier,
new DoubleVerifier,
- SizeInfo.description,
- Optional::No
+ Optional::No,
+ SizeInfo.description
},
{
SegmentsInfo.identifier,
new IntVerifier,
- SegmentsInfo.description,
- Optional::No
+ Optional::No,
+ SegmentsInfo.description
},
{
TextureInfo.identifier,
new StringVerifier,
- TextureInfo.description,
- Optional::No
+ Optional::No,
+ TextureInfo.description
},
{
OrientationInfo.identifier,
new StringInListVerifier({ "Inside", "Outside", "Inside/Outside" }),
- OrientationInfo.description,
- Optional::Yes
+ Optional::Yes,
+ OrientationInfo.description
},
{
TransparencyInfo.identifier,
new DoubleInRangeVerifier(0.0, 1.0),
- TransparencyInfo.description,
- Optional::Yes
+ Optional::Yes,
+ TransparencyInfo.description
}
}
};
@@ -202,7 +202,7 @@ bool RenderableSphere::isReady() const {
return _shader && _texture;
}
-bool RenderableSphere::initialize() {
+void RenderableSphere::initialize() {
_sphere = std::make_unique(
PowerScaledScalar::CreatePSS(_size), _segments
);
@@ -214,19 +214,15 @@ bool RenderableSphere::initialize() {
"${MODULE_BASE}/shaders/sphere_fs.glsl");
loadTexture();
-
- return isReady();
}
-bool RenderableSphere::deinitialize() {
+void RenderableSphere::deinitialize() {
_texture = nullptr;
if (_shader) {
OsEng.renderEngine().removeRenderProgram(_shader);
_shader = nullptr;
}
-
- return true;
}
void RenderableSphere::render(const RenderData& data, RendererTasks&) {
diff --git a/modules/base/rendering/renderablesphere.h b/modules/base/rendering/renderablesphere.h
index 12417125d2..2e7a223b31 100644
--- a/modules/base/rendering/renderablesphere.h
+++ b/modules/base/rendering/renderablesphere.h
@@ -49,8 +49,8 @@ class RenderableSphere : public Renderable {
public:
RenderableSphere(const ghoul::Dictionary& dictionary);
- bool initialize() override;
- bool deinitialize() override;
+ void initialize() override;
+ void deinitialize() override;
bool isReady() const override;
diff --git a/modules/base/rendering/renderablesphericalgrid.cpp b/modules/base/rendering/renderablesphericalgrid.cpp
index f960e02fa8..bd6b558a55 100644
--- a/modules/base/rendering/renderablesphericalgrid.cpp
+++ b/modules/base/rendering/renderablesphericalgrid.cpp
@@ -26,124 +26,152 @@
#include
#include
+#include
#include
#include
+#include
#include
+#include
#define _USE_MATH_DEFINES
#include
namespace {
- static const char* _loggerCat = "RenderableSphericalGrid";
- const char* KeyGridType = "GridType";
- const char* KeyGridColor = "GridColor";
- const char* KeyGridMatrix = "GridMatrix";
- const char* KeyGridSegments = "GridSegments";
- const char* KeyGridRadius = "GridRadius";
- const char* KeyGridParentsRotation = "ParentsRotation";
- const glm::vec2 GridRadius = { 1.f, 20.f };
+ static const openspace::properties::Property::PropertyInfo GridColorInfo = {
+ "GridColor",
+ "Grid Color",
+ "This value determines the color of the grid lines that are rendered."
+ };
+
+ static const openspace::properties::Property::PropertyInfo GridMatrixInfo = {
+ "GridMatrix",
+ "Grid Matrix",
+ "This value specifies the local transformation matrix that defines the "
+ "orientation of this grid relative to the parent's rotation."
+ };
+
+ static const openspace::properties::Property::PropertyInfo SegmentsInfo = {
+ "Segments",
+ "Number of Segments",
+ "This value specifies the number of segments that are used to render the "
+ "surrounding sphere."
+ };
+
+ static const openspace::properties::Property::PropertyInfo LineWidthInfo = {
+ "LineWidth",
+ "Line Width",
+ "This value specifies the line width of the spherical grid."
+ };
+
+ static const openspace::properties::Property::PropertyInfo RadiusInfo = {
+ "Radius",
+ "Radius",
+ "This value specifies the radius of the grid."
+ };
} // namespace
namespace openspace {
+documentation::Documentation RenderableSphericalGrid::Documentation() {
+ using namespace documentation;
+ return {
+ "RenderableSphericalGrid",
+ "base_renderable_sphericalgrid",
+ {
+ {
+ GridMatrixInfo.identifier,
+ new DoubleMatrix4x4Verifier,
+ Optional::Yes,
+ GridMatrixInfo.description
+ },
+ {
+ GridColorInfo.identifier,
+ new DoubleVector4Verifier,
+ Optional::Yes,
+ GridColorInfo.description
+ },
+ {
+ SegmentsInfo.identifier,
+ new IntVerifier,
+ Optional::Yes,
+ SegmentsInfo.description
+ },
+ {
+ LineWidthInfo.identifier,
+ new DoubleVerifier,
+ Optional::Yes,
+ LineWidthInfo.description
+ },
+ {
+ RadiusInfo.identifier,
+ new DoubleVerifier,
+ Optional::Yes,
+ RadiusInfo.description
+ }
+ }
+ };
+}
+
+
RenderableSphericalGrid::RenderableSphericalGrid(const ghoul::Dictionary& dictionary)
: Renderable(dictionary)
, _gridProgram(nullptr)
+ , _gridMatrix(GridMatrixInfo, glm::mat4(1.f))
+ , _gridColor(
+ GridColorInfo,
+ glm::vec4(0.5f, 0.5, 0.5f, 1.f),
+ glm::vec4(0.f),
+ glm::vec4(1.f)
+ )
+ , _segments(SegmentsInfo, 36, 4, 200)
+ , _lineWidth(LineWidthInfo, 0.5f, 0.f, 20.f)
+ , _radius(RadiusInfo, 1e20f, 1.f, 1e35f)
+ , _gridIsDirty(true)
, _vaoID(0)
, _vBufferID(0)
, _iBufferID(0)
, _mode(GL_LINES)
{
- _gridMatrix = glm::mat4(1);
- dictionary.getValue(KeyGridType, _gridType);
- dictionary.getValue(KeyGridColor, _gridColor);
+ documentation::testSpecificationAndThrow(
+ Documentation(),
+ dictionary,
+ "RenderableSphericalGrid"
+ );
- staticGrid = dictionary.getValue(KeyGridMatrix, _gridMatrix);
- if (!staticGrid){
- staticGrid = dictionary.getValue(KeyGridParentsRotation, _parentsRotation);
+ if (dictionary.hasKey(GridMatrixInfo.identifier)) {
+ _gridMatrix = dictionary.value(GridMatrixInfo.identifier);
}
-
- _segments = static_cast(dictionary.value(KeyGridSegments));
- //dictionary.getValue(KeyGridSegments, _segments);
+ addProperty(_gridMatrix);
-
- /*glm::vec2 radius;
- dictionary.getValue(constants::renderablesphericalgrid::gridRadius, radius);
- */
-
- _isize = int(6 * _segments * _segments);
- _vsize = int((_segments + 1) * (_segments + 1));
- _varray = new Vertex[_vsize];
- _iarray = new int[_isize];
-
- static_assert(sizeof(Vertex) == 64, "The size of the Vertex needs to be 64 for performance");
-
- int nr = 0;
- const float fsegments = static_cast(_segments);
- const float r = static_cast(GridRadius[0]);
-
- //int nr2 = 0;
-
- for (int nSegment = 0; nSegment <= _segments; ++nSegment) {
- // define an extra vertex around the y-axis due to texture mapping
- for (int j = 0; j <= _segments; j++) {
- const float fi = static_cast(nSegment);
- const float fj = static_cast(j);
-
- // inclination angle (north to south)
- const float theta = fi * float(M_PI) / fsegments*2.f; // 0 -> PI
-
- // azimuth angle (east to west)
- const float phi = fj * float(M_PI) * 2.0f / fsegments; // 0 -> 2*PI
-
- const float x = r * sin(phi) * sin(theta); //
- const float y = r * cos(theta); // up
- const float z = r * cos(phi) * sin(theta); //
-
- glm::vec3 normal = glm::vec3(x, y, z);
- if (!(x == 0.f && y == 0.f && z == 0.f))
- normal = glm::normalize(normal);
-
- //const float t1 = fj / fsegments;
- const float t2 = fi / fsegments;
-
- // tex coord. not used, use to manip color
- if (round(y) == 0.0f) _varray[nr].tex[0] = -2;
- _varray[nr].tex[1] = t2;
-
- glm::vec4 tmp(x, y, z, 1);
- glm::mat4 rot = glm::rotate(glm::mat4(1), static_cast(M_PI_2), glm::vec3(1, 0, 0));
- tmp = _gridMatrix*rot*tmp;
-
- for (int i = 0; i < 3; i++){
- _varray[nr].location[i] = tmp[i];
- _varray[nr].normal[i] = normal[i];
- }
- _varray[nr].location[3] = static_cast(GridRadius[1]);
- ++nr;
- }
+ if (dictionary.hasKey(GridColorInfo.identifier)) {
+ _gridColor = dictionary.value(GridColorInfo.identifier);
}
- nr = 0;
- // define indices for all triangles
- for (int i = 1; i <= _segments; ++i) {
- for (int j = 0; j < _segments; ++j) {
- const int t = _segments + 1;
- _iarray[nr] = t * (i - 1) + j + 0; ++nr;
- _iarray[nr] = t * (i + 0) + j + 0; ++nr;
- _iarray[nr] = t * (i + 0) + j + 1; ++nr;
- _iarray[nr] = t * (i - 1) + j + 1; ++nr;
- _iarray[nr] = t * (i - 1) + j + 0; ++nr;
- }
+ _gridColor.setViewOption(properties::Property::ViewOptions::Color);
+ addProperty(_gridColor);
+
+ if (dictionary.hasKey(SegmentsInfo.identifier)) {
+ _segments = static_cast(dictionary.value(SegmentsInfo.identifier));
}
+ _segments.onChange([&]() { _gridIsDirty = true; });
+ addProperty(_segments);
+
+ if (dictionary.hasKey(LineWidthInfo.identifier)) {
+ _lineWidth = static_cast(
+ dictionary.value(LineWidthInfo.identifier)
+ );
+ }
+ addProperty(_lineWidth);
+
+ if (dictionary.hasKey(RadiusInfo.identifier)) {
+ _radius = static_cast(
+ dictionary.value(RadiusInfo.identifier)
+ );
+ }
+ _radius.onChange([&]() { _gridIsDirty = true; });
+ addProperty(_radius);
}
-RenderableSphericalGrid::~RenderableSphericalGrid(){
- deinitialize();
-
- // Delete not done in deinitialize because new is done in constructor
- delete[] _varray;
- delete[] _iarray;
-}
+RenderableSphericalGrid::~RenderableSphericalGrid() {}
bool RenderableSphericalGrid::isReady() const {
bool ready = true;
@@ -151,7 +179,7 @@ bool RenderableSphericalGrid::isReady() const {
return ready;
}
-bool RenderableSphericalGrid::deinitialize(){
+void RenderableSphericalGrid::deinitialize() {
glDeleteVertexArrays(1,&_vaoID);
_vaoID = 0;
@@ -160,69 +188,47 @@ bool RenderableSphericalGrid::deinitialize(){
glDeleteBuffers(1,&_iBufferID);
_iBufferID = 0;
-
- return true;
}
-bool RenderableSphericalGrid::initialize(){
- bool completeSuccess = true;
- if (_gridProgram == nullptr)
- completeSuccess &= OsEng.ref().configurationManager().getValue("GridProgram", _gridProgram);
+void RenderableSphericalGrid::initialize() {
+ _gridProgram = OsEng.renderEngine().buildRenderProgram(
+ "GridProgram",
+ "${MODULE_BASE}/shaders/grid_vs.glsl",
+ "${MODULE_BASE}/shaders/grid_fs.glsl"
+ );
- // Initialize and upload to graphics card
glGenVertexArrays(1, &_vaoID);
glGenBuffers(1, &_vBufferID);
glGenBuffers(1, &_iBufferID);
- // First VAO setup
glBindVertexArray(_vaoID);
glBindBuffer(GL_ARRAY_BUFFER, _vBufferID);
- glBufferData(GL_ARRAY_BUFFER, _vsize * sizeof(Vertex), _varray, GL_STATIC_DRAW);
-
- glEnableVertexAttribArray(0);
- glEnableVertexAttribArray(1);
- glEnableVertexAttribArray(2);
- glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, sizeof(Vertex),
- reinterpret_cast(offsetof(Vertex, location)));
- glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, sizeof(Vertex),
- reinterpret_cast(offsetof(Vertex, tex)));
- glVertexAttribPointer(2, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex),
- reinterpret_cast(offsetof(Vertex, normal)));
-
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _iBufferID);
- glBufferData(GL_ELEMENT_ARRAY_BUFFER, _isize * sizeof(int), _iarray, GL_STATIC_DRAW);
-
+ glEnableVertexAttribArray(0);
glBindVertexArray(0);
-
- return completeSuccess;
}
void RenderableSphericalGrid::render(const RenderData& data, RendererTasks&){
_gridProgram->activate();
- glm::mat4 transform;
- for (int i = 0; i < 3; i++){
- for (int j = 0; j < 3; j++){
- transform[i][j] = static_cast(_parentMatrix[i][j]);
- }
- }
+ glm::dmat4 modelTransform =
+ glm::translate(glm::dmat4(1.0), data.modelTransform.translation) * // Translation
+ glm::dmat4(data.modelTransform.rotation) * // Spice rotation
+ glm::dmat4(glm::scale(glm::dmat4(1.0), glm::dvec3(data.modelTransform.scale)));
+ glm::dmat4 modelViewTransform = data.camera.combinedViewMatrix() * modelTransform;
- using IgnoreError = ghoul::opengl::ProgramObject::IgnoreError;
+ _gridProgram->setUniform("modelViewTransform", glm::mat4(modelViewTransform));
+ _gridProgram->setUniform("projectionTransform", data.camera.projectionMatrix());
- // setup the data to the shader
- _gridProgram->setIgnoreUniformLocationError(IgnoreError::Yes);
- _gridProgram->setUniform("ViewProjection", data.camera.viewProjectionMatrix());
- _gridProgram->setUniform("ModelTransform", transform);
- setPscUniforms(*_gridProgram, data.camera, data.position);
_gridProgram->setUniform("gridColor", _gridColor);
- glLineWidth(0.5f);
+ glLineWidth(_lineWidth);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
glEnable(GL_LINE_SMOOTH);
- glBindVertexArray(_vaoID); // select first VAO
+ glBindVertexArray(_vaoID);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _iBufferID);
glDrawElements(_mode, _isize, GL_UNSIGNED_INT, 0);
glBindVertexArray(0);
@@ -231,8 +237,72 @@ void RenderableSphericalGrid::render(const RenderData& data, RendererTasks&){
}
void RenderableSphericalGrid::update(const UpdateData& data) {
- _parentMatrix = SpiceManager::ref().positionTransformMatrix("IAU_JUPITER", "GALACTIC", data.time.j2000Seconds());
+ if (_gridIsDirty) {
+ _isize = int(6 * _segments * _segments);
+ _vsize = int((_segments + 1) * (_segments + 1));
+ _varray.resize(_vsize);
+ _iarray.resize(_isize);
+ int nr = 0;
+ const float fsegments = static_cast(_segments);
+ const float r = _radius;
+
+ for (int nSegment = 0; nSegment <= _segments; ++nSegment) {
+ // define an extra vertex around the y-axis due to texture mapping
+ for (int j = 0; j <= _segments; j++) {
+ const float fi = static_cast(nSegment);
+ const float fj = static_cast(j);
+
+ // inclination angle (north to south)
+ const float theta = fi * float(M_PI) / fsegments*2.f; // 0 -> PI
+
+ // azimuth angle (east to west)
+ const float phi = fj * float(M_PI) * 2.0f / fsegments; // 0 -> 2*PI
+
+ const float x = r * sin(phi) * sin(theta); //
+ const float y = r * cos(theta); // up
+ const float z = r * cos(phi) * sin(theta); //
+
+ glm::vec3 normal = glm::vec3(x, y, z);
+ if (!(x == 0.f && y == 0.f && z == 0.f))
+ normal = glm::normalize(normal);
+
+ //const float t1 = fj / fsegments;
+ const float t2 = fi / fsegments;
+
+ glm::vec4 tmp(x, y, z, 1);
+ glm::mat4 rot = glm::rotate(glm::mat4(1), static_cast(M_PI_2), glm::vec3(1, 0, 0));
+ tmp = glm::vec4(_gridMatrix.value() * glm::dmat4(rot) * glm::dvec4(tmp));
+
+ for (int i = 0; i < 3; i++) {
+ _varray[nr].location[i] = tmp[i];
+ }
+ ++nr;
+ }
+ }
+ nr = 0;
+ // define indices for all triangles
+ for (int i = 1; i <= _segments; ++i) {
+ for (int j = 0; j < _segments; ++j) {
+ const int t = _segments + 1;
+ _iarray[nr] = t * (i - 1) + j + 0; ++nr;
+ _iarray[nr] = t * (i + 0) + j + 0; ++nr;
+ _iarray[nr] = t * (i + 0) + j + 1; ++nr;
+ _iarray[nr] = t * (i - 1) + j + 1; ++nr;
+ _iarray[nr] = t * (i - 1) + j + 0; ++nr;
+ }
+ }
+
+ glBindVertexArray(_vaoID);
+ glBindBuffer(GL_ARRAY_BUFFER, _vBufferID);
+ glBufferData(GL_ARRAY_BUFFER, _vsize * sizeof(Vertex), _varray.data(), GL_STATIC_DRAW);
+
+ glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex),
+ reinterpret_cast(offsetof(Vertex, location)));
+
+ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _iBufferID);
+ glBufferData(GL_ELEMENT_ARRAY_BUFFER, _isize * sizeof(int), _iarray.data(), GL_STATIC_DRAW);
+ }
}
} // namespace openspace
diff --git a/modules/base/rendering/renderablesphericalgrid.h b/modules/base/rendering/renderablesphericalgrid.h
index 54673c86b5..ee5d829885 100644
--- a/modules/base/rendering/renderablesphericalgrid.h
+++ b/modules/base/rendering/renderablesphericalgrid.h
@@ -26,10 +26,20 @@
#define __OPENSPACE_MODULE_BASE___RENDERABLESPHERICALGRID___H__
#include
-#include
-#include
-#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+
+namespace ghoul::opengl {
+ class ProgramObject;
+} // namespace ghoul::opengl
+
+namespace openspace::documentation { struct Documentation; }
namespace openspace {
@@ -38,41 +48,40 @@ public:
RenderableSphericalGrid(const ghoul::Dictionary& dictionary);
~RenderableSphericalGrid();
- bool initialize() override;
- bool deinitialize() override;
+ void initialize() override;
+ void deinitialize() override;
bool isReady() const override;
void render(const RenderData& data, RendererTasks& rendererTask) override;
- void update(const UpdateData& data) override;
+ void update(const UpdateData& data);
+
+ static documentation::Documentation Documentation();
protected:
- typedef struct {
- GLfloat location[4];
- GLfloat tex[2];
- GLfloat normal[3];
- GLubyte padding[28]; // Pads the struct out to 64 bytes for performance increase
- } Vertex;
+ struct Vertex {
+ float location[3];
+ };
- ghoul::opengl::ProgramObject* _gridProgram;
- std::string _gridType;
- glm::vec4 _gridColor;
- glm::mat4 _gridMatrix;
- int _segments;
+ std::unique_ptr _gridProgram;
- bool staticGrid;
- std::string _parentsRotation;
- glm::dmat3 _parentMatrix;
+ properties::DMat4Property _gridMatrix;
+ properties::Vec4Property _gridColor;
+ properties::IntProperty _segments;
+ properties::FloatProperty _lineWidth;
+ properties::FloatProperty _radius;
- GLuint _vaoID = 3;
- GLuint _vBufferID = 4;
- GLuint _iBufferID = 5;
+ bool _gridIsDirty;
+
+ GLuint _vaoID;
+ GLuint _vBufferID;
+ GLuint _iBufferID;
GLenum _mode;
unsigned int _isize;
unsigned int _vsize;
- Vertex* _varray;
- int* _iarray;
+ std::vector _varray;
+ std::vector _iarray;
};
}// namespace openspace
diff --git a/modules/base/rendering/renderabletrail.cpp b/modules/base/rendering/renderabletrail.cpp
index 898346c226..cd88928123 100644
--- a/modules/base/rendering/renderabletrail.cpp
+++ b/modules/base/rendering/renderabletrail.cpp
@@ -111,39 +111,39 @@ documentation::Documentation RenderableTrail::Documentation() {
{
KeyTranslation,
new ReferencingVerifier("core_transform_translation"),
+ Optional::No,
"This object is used to compute locations along the path. Any "
- "Translation object can be used here.",
- Optional::No
+ "Translation object can be used here."
},
{
LineColorInfo.identifier,
new DoubleVector3Verifier,
- LineColorInfo.description,
- Optional::No
+ Optional::No,
+ LineColorInfo.description
},
{
EnableFadeInfo.identifier,
new BoolVerifier,
- EnableFadeInfo.description,
- Optional::Yes
+ Optional::Yes,
+ EnableFadeInfo.description
},
{
FadeInfo.identifier,
new DoubleVerifier,
- FadeInfo.description,
- Optional::Yes
+ Optional::Yes,
+ FadeInfo.description
},
{
LineWidthInfo.identifier,
new DoubleVerifier,
- LineWidthInfo.description,
- Optional::Yes
+ Optional::Yes,
+ LineWidthInfo.description
},
{
PointSizeInfo.identifier,
new DoubleVerifier,
- PointSizeInfo.description,
- Optional::Yes
+ Optional::Yes,
+ PointSizeInfo.description
},
{
RenderingModeInfo.identifier,
@@ -151,11 +151,10 @@ documentation::Documentation RenderableTrail::Documentation() {
// Taken from the RenderingModeConversion map above
{ "Lines", "Points", "Lines+Points", "Points+Lines" }
),
- RenderingModeInfo.description,
- Optional::Yes
+ Optional::Yes,
+ RenderingModeInfo.description
}
- },
- Exhaustive::No
+ }
};
}
@@ -218,7 +217,7 @@ RenderableTrail::RenderableTrail(const ghoul::Dictionary& dictionary)
addProperty(_renderingModes);
}
-bool RenderableTrail::initialize() {
+void RenderableTrail::initialize() {
RenderEngine& renderEngine = OsEng.renderEngine();
_programObject = renderEngine.buildRenderProgram(
"EphemerisProgram",
@@ -227,17 +226,14 @@ bool RenderableTrail::initialize() {
);
setRenderBin(Renderable::RenderBin::Overlay);
-
- return true;
}
-bool RenderableTrail::deinitialize() {
+void RenderableTrail::deinitialize() {
RenderEngine& renderEngine = OsEng.renderEngine();
if (_programObject) {
renderEngine.removeRenderProgram(_programObject);
_programObject = nullptr;
}
- return true;
}
bool RenderableTrail::isReady() const {
diff --git a/modules/base/rendering/renderabletrail.h b/modules/base/rendering/renderabletrail.h
index 962bdf5245..ed721582a9 100644
--- a/modules/base/rendering/renderabletrail.h
+++ b/modules/base/rendering/renderabletrail.h
@@ -73,8 +73,8 @@ class RenderableTrail : public Renderable {
public:
~RenderableTrail() = default;
- bool initialize() override;
- bool deinitialize() override;
+ void initialize() override;
+ void deinitialize() override;
bool isReady() const override;
diff --git a/modules/base/rendering/renderabletrailorbit.cpp b/modules/base/rendering/renderabletrailorbit.cpp
index d69d2adceb..2877e31777 100644
--- a/modules/base/rendering/renderabletrailorbit.cpp
+++ b/modules/base/rendering/renderabletrailorbit.cpp
@@ -112,14 +112,14 @@ documentation::Documentation RenderableTrailOrbit::Documentation() {
{
PeriodInfo.identifier,
new DoubleVerifier,
- PeriodInfo.description,
- Optional::No
+ Optional::No,
+ PeriodInfo.description
},
{
ResolutionInfo.identifier,
new IntVerifier,
- ResolutionInfo.description,
- Optional::No
+ Optional::No,
+ ResolutionInfo.description
}
}
};
@@ -169,22 +169,20 @@ RenderableTrailOrbit::RenderableTrailOrbit(const ghoul::Dictionary& dictionary)
_primaryRenderInformation.sorting = RenderInformation::VertexSorting::NewestFirst;
}
-bool RenderableTrailOrbit::initialize() {
- bool res = RenderableTrail::initialize();
+void RenderableTrailOrbit::initialize() {
+ RenderableTrail::initialize();
glGenVertexArrays(1, &_primaryRenderInformation._vaoID);
glGenBuffers(1, &_primaryRenderInformation._vBufferID);
glGenBuffers(1, &_primaryRenderInformation._iBufferID);
-
- return res;
}
-bool RenderableTrailOrbit::deinitialize() {
+void RenderableTrailOrbit::deinitialize() {
glDeleteVertexArrays(1, &_primaryRenderInformation._vaoID);
glDeleteBuffers(1, &_primaryRenderInformation._vBufferID);
glDeleteBuffers(1, &_primaryRenderInformation._iBufferID);
- return RenderableTrail::deinitialize();
+ RenderableTrail::deinitialize();
}
void RenderableTrailOrbit::update(const UpdateData& data) {
diff --git a/modules/base/rendering/renderabletrailorbit.h b/modules/base/rendering/renderabletrailorbit.h
index a37ce098ce..325f195f7d 100644
--- a/modules/base/rendering/renderabletrailorbit.h
+++ b/modules/base/rendering/renderabletrailorbit.h
@@ -48,8 +48,8 @@ class RenderableTrailOrbit : public RenderableTrail {
public:
explicit RenderableTrailOrbit(const ghoul::Dictionary& dictionary);
- bool initialize() override;
- bool deinitialize() override;
+ void initialize() override;
+ void deinitialize() override;
void update(const UpdateData& data) override;
diff --git a/modules/base/rendering/renderabletrailtrajectory.cpp b/modules/base/rendering/renderabletrailtrajectory.cpp
index d44705a6f6..5aa6f2161e 100644
--- a/modules/base/rendering/renderabletrailtrajectory.cpp
+++ b/modules/base/rendering/renderabletrailtrajectory.cpp
@@ -97,32 +97,32 @@ documentation::Documentation RenderableTrailTrajectory::Documentation() {
{
StartTimeInfo.identifier,
new StringAnnotationVerifier("A valid date in ISO 8601 format"),
- StartTimeInfo.description,
- Optional::No
+ Optional::No,
+ StartTimeInfo.description
},
{
EndTimeInfo.identifier,
new StringAnnotationVerifier("A valid date in ISO 8601 format"),
- EndTimeInfo.description,
- Optional::No
+ Optional::No,
+ EndTimeInfo.description
},
{
SampleIntervalInfo.identifier,
new DoubleVerifier,
- SampleIntervalInfo.description,
- Optional::No
+ Optional::No,
+ SampleIntervalInfo.description
},
{
TimeSubSampleInfo.identifier,
new IntVerifier,
- TimeSubSampleInfo.description,
- Optional::Yes
+ Optional::Yes,
+ TimeSubSampleInfo.description
},
{
RenderFullPathInfo.identifier,
new BoolVerifier,
- RenderFullPathInfo.description,
- Optional::Yes
+ Optional::Yes,
+ RenderFullPathInfo.description
}
}
};
@@ -189,8 +189,8 @@ RenderableTrailTrajectory::RenderableTrailTrajectory(const ghoul::Dictionary& di
_primaryRenderInformation.sorting = RenderInformation::VertexSorting::OldestFirst;
}
-bool RenderableTrailTrajectory::initialize() {
- bool res = RenderableTrail::initialize();
+void RenderableTrailTrajectory::initialize() {
+ RenderableTrail::initialize();
// We don't need an index buffer, so we keep it at the default value of 0
glGenVertexArrays(1, &_primaryRenderInformation._vaoID);
@@ -201,18 +201,16 @@ bool RenderableTrailTrajectory::initialize() {
glGenVertexArrays(1, &_floatingRenderInformation._vaoID);
glGenBuffers(1, &_floatingRenderInformation._vBufferID);
_floatingRenderInformation.sorting = RenderInformation::VertexSorting::OldestFirst;
-
- return res;
}
-bool RenderableTrailTrajectory::deinitialize() {
+void RenderableTrailTrajectory::deinitialize() {
glDeleteVertexArrays(1, &_primaryRenderInformation._vaoID);
glDeleteBuffers(1, &_primaryRenderInformation._vBufferID);
glDeleteVertexArrays(1, &_floatingRenderInformation._vaoID);
glDeleteBuffers(1, &_floatingRenderInformation._vBufferID);
- return RenderableTrail::deinitialize();
+ RenderableTrail::deinitialize();
}
void RenderableTrailTrajectory::update(const UpdateData& data) {
diff --git a/modules/base/rendering/renderabletrailtrajectory.h b/modules/base/rendering/renderabletrailtrajectory.h
index 62f600d5a4..93d0367c9d 100644
--- a/modules/base/rendering/renderabletrailtrajectory.h
+++ b/modules/base/rendering/renderabletrailtrajectory.h
@@ -53,8 +53,8 @@ class RenderableTrailTrajectory : public RenderableTrail {
public:
explicit RenderableTrailTrajectory(const ghoul::Dictionary& dictionary);
- bool initialize() override;
- bool deinitialize() override;
+ void initialize() override;
+ void deinitialize() override;
void update(const UpdateData& data) override;
diff --git a/modules/base/rendering/screenspaceframebuffer.cpp b/modules/base/rendering/screenspaceframebuffer.cpp
index 8bc62a2c51..3f83cd16b4 100644
--- a/modules/base/rendering/screenspaceframebuffer.cpp
+++ b/modules/base/rendering/screenspaceframebuffer.cpp
@@ -50,8 +50,7 @@ documentation::Documentation ScreenSpaceFramebuffer::Documentation() {
return {
"ScreenSpace Framebuffer",
"base_screenspace_framebuffer",
- {},
- Exhaustive::Yes
+ {}
};
}
diff --git a/modules/base/rendering/screenspaceimage.cpp b/modules/base/rendering/screenspaceimage.cpp
index 8f8932d681..735e53c171 100644
--- a/modules/base/rendering/screenspaceimage.cpp
+++ b/modules/base/rendering/screenspaceimage.cpp
@@ -61,15 +61,15 @@ documentation::Documentation ScreenSpaceImage::Documentation() {
{
KeyName,
new StringVerifier,
- "Specifies the GUI name of the ScreenspaceImage",
- Optional::Yes
+ Optional::Yes,
+ "Specifies the GUI name of the ScreenspaceImage"
},
{
KeyTexturePath,
new StringVerifier,
+ Optional::Yes,
"Specifies the image that is shown on the screenspace-aligned plane. If "
- "this value is set and the URL is not, the disk image is used.",
- Optional::Yes
+ "this value is set and the URL is not, the disk image is used."
}
}
};
diff --git a/modules/base/rotation/staticrotation.cpp b/modules/base/rotation/staticrotation.cpp
index 8f88d81389..3929b9c808 100644
--- a/modules/base/rotation/staticrotation.cpp
+++ b/modules/base/rotation/staticrotation.cpp
@@ -47,7 +47,6 @@ documentation::Documentation StaticRotation::Documentation() {
{
"Type",
new StringEqualVerifier("StaticRotation"),
- "",
Optional::No
},
{
@@ -56,12 +55,11 @@ documentation::Documentation StaticRotation::Documentation() {
new DoubleVector3Verifier(),
new DoubleMatrix3Verifier()
),
+ Optional::No,
"Stores the static rotation as either a vector containing Euler angles "
- "or by specifiying the 3x3 rotation matrix directly",
- Optional::No
+ "or by specifiying the 3x3 rotation matrix directly"
}
- },
- Exhaustive::Yes
+ }
};
}
diff --git a/modules/base/scale/staticscale.cpp b/modules/base/scale/staticscale.cpp
index 69db7ea3f8..8a9f895856 100644
--- a/modules/base/scale/staticscale.cpp
+++ b/modules/base/scale/staticscale.cpp
@@ -47,8 +47,8 @@ documentation::Documentation StaticScale::Documentation() {
{
ScaleInfo.identifier,
new DoubleVerifier,
- ScaleInfo.description,
- Optional::No
+ Optional::No,
+ ScaleInfo.description
}
}
};
diff --git a/modules/base/shaders/grid_fs.glsl b/modules/base/shaders/grid_fs.glsl
new file mode 100644
index 0000000000..ae1a552211
--- /dev/null
+++ b/modules/base/shaders/grid_fs.glsl
@@ -0,0 +1,37 @@
+/*****************************************************************************************
+ * *
+ * 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 "fragment.glsl"
+#include "PowerScaling/powerScaling_fs.hglsl"
+
+in float vs_screenSpaceDepth;
+
+uniform vec4 gridColor;
+
+Fragment getFragment() {
+ Fragment frag;
+ frag.color = gridColor;
+ frag.depth = vs_screenSpaceDepth;
+ return frag;
+}
diff --git a/modules/base/shaders/grid_vs.glsl b/modules/base/shaders/grid_vs.glsl
new file mode 100644
index 0000000000..878ac109cd
--- /dev/null
+++ b/modules/base/shaders/grid_vs.glsl
@@ -0,0 +1,42 @@
+/*****************************************************************************************
+ * *
+ * OpenSpace *
+ * *
+ * Copyright (c) 2014 - 2017 *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this *
+ * software and associated documentation files (the "Software"), to deal in the Software *
+ * without restriction, including without limitation the rights to use, copy, modify, *
+ * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *
+ * permit persons to whom the Software is furnished to do so, subject to the following *
+ * conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included in all copies *
+ * or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
+ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ ****************************************************************************************/
+
+#version __CONTEXT__
+
+#include "PowerScaling/powerScaling_vs.hglsl"
+
+layout(location = 0) in vec3 in_position;
+
+out float vs_screenSpaceDepth;
+
+uniform mat4 modelViewTransform;
+uniform mat4 projectionTransform;
+
+void main() {
+ vec4 positionClipSpace = projectionTransform * modelViewTransform * vec4(in_position, 1.0);
+ vec4 positionScreenSpace = z_normalization(positionClipSpace);
+ vs_screenSpaceDepth = positionScreenSpace.w;
+
+ gl_Position = positionScreenSpace;
+}
diff --git a/modules/base/shaders/imageplane_vs.glsl b/modules/base/shaders/imageplane_vs.glsl
index 1d1a27a13c..0525313528 100644
--- a/modules/base/shaders/imageplane_vs.glsl
+++ b/modules/base/shaders/imageplane_vs.glsl
@@ -36,9 +36,9 @@ uniform mat4 modelViewProjectionTransform;
void main() {
- const vec4 position = vec4(in_position.xyz * pow(10, in_position.w), 1);
- const vec4 positionClipSpace = modelViewProjectionTransform * position;
- const vec4 positionScreenSpace = z_normalization(positionClipSpace);
+ vec4 position = vec4(in_position.xyz * pow(10, in_position.w), 1);
+ vec4 positionClipSpace = modelViewProjectionTransform * position;
+ vec4 positionScreenSpace = z_normalization(positionClipSpace);
gl_Position = positionScreenSpace;
vs_st = in_st;
diff --git a/modules/base/shaders/model_fs.glsl b/modules/base/shaders/model_fs.glsl
index da2bb50a24..4b75fce4d9 100644
--- a/modules/base/shaders/model_fs.glsl
+++ b/modules/base/shaders/model_fs.glsl
@@ -29,7 +29,6 @@ in vec3 vs_normalViewSpace;
in vec4 vs_positionCameraSpace;
in float vs_screenSpaceDepth;
-uniform float fading;
uniform bool performShading = true;
uniform vec3 directionToSunViewSpace;
uniform sampler2D texture1;
@@ -37,7 +36,7 @@ uniform sampler2D texture1;
const vec3 SpecularAlbedo = vec3(1.0);
Fragment getFragment() {
- const vec3 diffuseAlbedo = texture(texture1, vs_st).rgb;
+ vec3 diffuseAlbedo = texture(texture1, vs_st).rgb;
Fragment frag;
@@ -46,22 +45,22 @@ Fragment getFragment() {
const vec3 lightColorAmbient = vec3(1.0);
const vec3 lightColor = vec3(1.0);
- const vec3 n = normalize(vs_normalViewSpace);
- const vec3 l = directionToSunViewSpace;
- const vec3 c = normalize(vs_positionCameraSpace.xyz);
- const vec3 r = reflect(l, n);
+ vec3 n = normalize(vs_normalViewSpace);
+ vec3 l = directionToSunViewSpace;
+ vec3 c = normalize(vs_positionCameraSpace.xyz);
+ vec3 r = reflect(l, n);
const float ambientIntensity = 0.2;
const float diffuseIntensity = 1;
const float specularIntensity = 1;
- const float diffuseCosineFactor = dot(n,l);
- const float specularCosineFactor = dot(c,r);
+ float diffuseCosineFactor = dot(n,l);
+ float specularCosineFactor = dot(c,r);
const float specularPower = 100.0;
- const vec3 ambientColor = ambientIntensity * lightColorAmbient * diffuseAlbedo;
- const vec3 diffuseColor = diffuseIntensity * lightColor * diffuseAlbedo * max(diffuseCosineFactor, 0);
- const vec3 specularColor = specularIntensity * lightColor * SpecularAlbedo * pow(max(specularCosineFactor, 0), specularPower);
+ vec3 ambientColor = ambientIntensity * lightColorAmbient * diffuseAlbedo;
+ vec3 diffuseColor = diffuseIntensity * lightColor * diffuseAlbedo * max(diffuseCosineFactor, 0);
+ vec3 specularColor = specularIntensity * lightColor * SpecularAlbedo * pow(max(specularCosineFactor, 0), specularPower);
frag.color.rgb = ambientColor + diffuseColor + specularColor;
}
@@ -69,7 +68,7 @@ Fragment getFragment() {
frag.color.rgb = diffuseAlbedo;
}
- frag.color.a = fading;
+ frag.color.a = 1.0;
frag.depth = vs_screenSpaceDepth;
return frag;
diff --git a/modules/base/shaders/model_vs.glsl b/modules/base/shaders/model_vs.glsl
index fb54dd8a1d..1b4fc0b5df 100644
--- a/modules/base/shaders/model_vs.glsl
+++ b/modules/base/shaders/model_vs.glsl
@@ -41,8 +41,8 @@ uniform mat4 projectionTransform;
void main() {
vs_positionCameraSpace = modelViewTransform * in_position;
- const vec4 positionClipSpace = projectionTransform * vs_positionCameraSpace;
- const vec4 positionScreenSpace = z_normalization(positionClipSpace);
+ vec4 positionClipSpace = projectionTransform * vs_positionCameraSpace;
+ vec4 positionScreenSpace = z_normalization(positionClipSpace);
gl_Position = positionScreenSpace;
vs_st = in_st;
diff --git a/modules/base/shaders/path_vs.glsl b/modules/base/shaders/path_vs.glsl
index 54be145867..6b9af3658a 100644
--- a/modules/base/shaders/path_vs.glsl
+++ b/modules/base/shaders/path_vs.glsl
@@ -38,8 +38,8 @@ uniform int pointSteps;
void main() {
- const vec4 positionCameraSpace = modelViewTransform * in_point_position;
- const vec4 positionClipSpace = projectionTransform * positionCameraSpace;
+ vec4 positionCameraSpace = modelViewTransform * in_point_position;
+ vec4 positionClipSpace = projectionTransform * positionCameraSpace;
vs_positionScreenSpace = z_normalization(positionClipSpace);
gl_Position = vs_positionScreenSpace;
diff --git a/modules/base/shaders/plane_vs.glsl b/modules/base/shaders/plane_vs.glsl
index 5f5e1f67e0..10a044d23d 100644
--- a/modules/base/shaders/plane_vs.glsl
+++ b/modules/base/shaders/plane_vs.glsl
@@ -37,9 +37,9 @@ uniform mat4 modelViewProjectionTransform;
void main() {
- const vec4 position = vec4(in_position.xyz * pow(10, in_position.w), 1);
- const vec4 positionClipSpace = modelViewProjectionTransform * position;
- const vec4 positionScreenSpace = z_normalization(positionClipSpace);
+ vec4 position = vec4(in_position.xyz * pow(10, in_position.w), 1);
+ vec4 positionClipSpace = modelViewProjectionTransform * position;
+ vec4 positionScreenSpace = z_normalization(positionClipSpace);
gl_Position = positionScreenSpace;
diff --git a/modules/base/shaders/pscstandard_fs.glsl b/modules/base/shaders/pscstandard_fs.glsl
index ea5aeb3fcf..94f501eb84 100644
--- a/modules/base/shaders/pscstandard_fs.glsl
+++ b/modules/base/shaders/pscstandard_fs.glsl
@@ -46,15 +46,15 @@ Fragment getFragment() {
Fragment frag;
if (_performShading) {
- const vec3 n = normalize(vs_normal.xyz);
- const vec3 l_pos = vec3(sun_pos); // sun.
- const vec3 l_dir = normalize(l_pos - objpos.xyz);
- const float intensity = min(max(5 * dot(n,l_dir), 0.0), 1);
+ 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);
- const vec4 ambient = vec4(0.0, 0.0, 0.0, transparency);
+ vec4 ambient = vec4(0.0, 0.0, 0.0, transparency);
/*
if(intensity > 0.f){
// halfway vector
diff --git a/modules/base/translation/statictranslation.cpp b/modules/base/translation/statictranslation.cpp
index 27b013fab0..be2c3c9520 100644
--- a/modules/base/translation/statictranslation.cpp
+++ b/modules/base/translation/statictranslation.cpp
@@ -47,17 +47,15 @@ documentation::Documentation StaticTranslation::Documentation() {
{
"Type",
new StringEqualVerifier("StaticTranslation"),
- "",
Optional::No
},
{
PositionInfo.identifier,
new DoubleVector3Verifier,
- PositionInfo.description,
- Optional::No
+ Optional::No,
+ PositionInfo.description
}
- },
- Exhaustive::Yes
+ }
};
}
@@ -89,6 +87,4 @@ glm::dvec3 StaticTranslation::position() const {
return _position;
}
-void StaticTranslation::update(const UpdateData&) {}
-
} // namespace openspace
diff --git a/modules/base/translation/statictranslation.h b/modules/base/translation/statictranslation.h
index fd92a76645..a7bd625054 100644
--- a/modules/base/translation/statictranslation.h
+++ b/modules/base/translation/statictranslation.h
@@ -38,7 +38,6 @@ public:
StaticTranslation();
StaticTranslation(const ghoul::Dictionary& dictionary);
virtual glm::dvec3 position() const;
- virtual void update(const UpdateData& data) override;
static documentation::Documentation Documentation();
diff --git a/modules/debugging/rendering/renderabledebugplane.cpp b/modules/debugging/rendering/renderabledebugplane.cpp
index 3442f909d7..1234c3474f 100644
--- a/modules/debugging/rendering/renderabledebugplane.cpp
+++ b/modules/debugging/rendering/renderabledebugplane.cpp
@@ -89,31 +89,30 @@ documentation::Documentation RenderableDebugPlane::Documentation() {
{
TextureInfo.identifier,
new IntVerifier,
- TextureInfo.description,
- Optional::Yes
+ Optional::Yes,
+ TextureInfo.description
},
{
BillboardInfo.identifier,
new BoolVerifier,
- BillboardInfo.description,
- Optional::Yes
+ Optional::Yes,
+ BillboardInfo.description
},
{
SizeInfo.identifier,
new DoubleVerifier,
- SizeInfo.description,
- Optional::Yes
+ Optional::Yes,
+ SizeInfo.description
},
{
OriginInfo.identifier,
new StringInListVerifier(
{ "LowerLeft", "LowerRight", "UpperLeft", "UpperRight", "Center" }
),
- OriginInfo.description,
- Optional::Yes
+ Optional::Yes,
+ OriginInfo.description
}
- },
- Exhaustive::Yes
+ }
};
}
@@ -191,7 +190,7 @@ bool RenderableDebugPlane::isReady() const {
return ready;
}
-bool RenderableDebugPlane::initialize() {
+void RenderableDebugPlane::initialize() {
glGenVertexArrays(1, &_quad); // generate array
glGenBuffers(1, &_vertexPositionBuffer); // generate buffer
createPlane();
@@ -203,11 +202,9 @@ bool RenderableDebugPlane::initialize() {
"${MODULE_BASE}/shaders/plane_fs.glsl"
);
}
-
- return isReady();
}
-bool RenderableDebugPlane::deinitialize() {
+void RenderableDebugPlane::deinitialize() {
glDeleteVertexArrays(1, &_quad);
_quad = 0;
@@ -219,8 +216,6 @@ bool RenderableDebugPlane::deinitialize() {
renderEngine.removeRenderProgram(_shader);
_shader = nullptr;
}
-
- return true;
}
void RenderableDebugPlane::render(const RenderData& data, RendererTasks&) {
diff --git a/modules/debugging/rendering/renderabledebugplane.h b/modules/debugging/rendering/renderabledebugplane.h
index 6ea0db8819..91fa8914b2 100644
--- a/modules/debugging/rendering/renderabledebugplane.h
+++ b/modules/debugging/rendering/renderabledebugplane.h
@@ -49,8 +49,8 @@ public:
RenderableDebugPlane(const ghoul::Dictionary& dictionary);
~RenderableDebugPlane();
- bool initialize() override;
- bool deinitialize() override;
+ void initialize() override;
+ void deinitialize() override;
bool isReady() const override;
diff --git a/modules/fieldlines/rendering/renderablefieldlines.cpp b/modules/fieldlines/rendering/renderablefieldlines.cpp
index 0813f76ae1..24aaba8404 100644
--- a/modules/fieldlines/rendering/renderablefieldlines.cpp
+++ b/modules/fieldlines/rendering/renderablefieldlines.cpp
@@ -232,12 +232,9 @@ bool RenderableFieldlines::isReady() const {
return programReady && vectorFieldReady && fieldlineReady && seedPointsReady;
}
-bool RenderableFieldlines::initialize() {
- if (_vectorFieldInfo.empty() ||
- _fieldlineInfo.empty() ||
- _seedPointsInfo.empty())
- {
- return false;
+void RenderableFieldlines::initialize() {
+ if (_vectorFieldInfo.empty() || _fieldlineInfo.empty() || _seedPointsInfo.empty()) {
+ throw ghoul::RuntimeError("Error initializing");
}
_program = OsEng.renderEngine().buildRenderProgram(
@@ -246,14 +243,9 @@ bool RenderableFieldlines::initialize() {
"${MODULE_FIELDLINES}/shaders/fieldline_fs.glsl",
"${MODULE_FIELDLINES}/shaders/fieldline_gs.glsl"
);
-
- if (!_program)
- return false;
-
- return true;
}
-bool RenderableFieldlines::deinitialize() {
+void RenderableFieldlines::deinitialize() {
glDeleteVertexArrays(1, &_fieldlineVAO);
_fieldlineVAO = 0;
glDeleteBuffers(1, &_vertexPositionBuffer);
@@ -264,8 +256,6 @@ bool RenderableFieldlines::deinitialize() {
renderEngine.removeRenderProgram(_program);
_program = nullptr;
}
-
- return true;
}
void RenderableFieldlines::render(const RenderData& data, RendererTasks&) {
diff --git a/modules/fieldlines/rendering/renderablefieldlines.h b/modules/fieldlines/rendering/renderablefieldlines.h
index 1827b83353..10d9d92b63 100644
--- a/modules/fieldlines/rendering/renderablefieldlines.h
+++ b/modules/fieldlines/rendering/renderablefieldlines.h
@@ -45,8 +45,8 @@ class RenderableFieldlines : public Renderable {
public:
RenderableFieldlines(const ghoul::Dictionary& dictionary);
- bool initialize() override;
- bool deinitialize() override;
+ void initialize() override;
+ void deinitialize() override;
bool isReady() const override;
diff --git a/modules/fieldlines/shaders/fieldline_fs.glsl b/modules/fieldlines/shaders/fieldline_fs.glsl
index a3e103aa59..46edd1da7a 100644
--- a/modules/fieldlines/shaders/fieldline_fs.glsl
+++ b/modules/fieldlines/shaders/fieldline_fs.glsl
@@ -34,7 +34,7 @@ uniform vec4 fieldLineColor;
Fragment getFragment() {
- const float alpha = 1 - length(gs_normal) * length(gs_normal);
+ float alpha = 1 - length(gs_normal) * length(gs_normal);
Fragment frag;
if (classification) {
diff --git a/modules/galaxy/rendering/renderablegalaxy.cpp b/modules/galaxy/rendering/renderablegalaxy.cpp
index 94b86c6671..f01aff865c 100644
--- a/modules/galaxy/rendering/renderablegalaxy.cpp
+++ b/modules/galaxy/rendering/renderablegalaxy.cpp
@@ -153,7 +153,7 @@ namespace openspace {
RenderableGalaxy::~RenderableGalaxy() {}
-bool RenderableGalaxy::initialize() {
+void RenderableGalaxy::initialize() {
// Aspect is currently hardcoded to cubic voxels.
_aspect = static_cast(_volumeDimensions);
_aspect = _aspect / std::max(std::max(_aspect.x, _aspect.y), _aspect.z);
@@ -178,7 +178,7 @@ bool RenderableGalaxy::initialize() {
OsEng.renderEngine().raycasterManager().attachRaycaster(*_raycaster.get());
- std::function onChange = [&](bool enabled) {
+ auto onChange = [&](bool enabled) {
if (enabled) {
OsEng.renderEngine().raycasterManager().attachRaycaster(*_raycaster.get());
}
@@ -273,16 +273,13 @@ bool RenderableGalaxy::initialize() {
glBindBuffer(GL_ARRAY_BUFFER, 0);
glBindVertexArray(0);
-
- return true;
}
-bool RenderableGalaxy::deinitialize() {
+void RenderableGalaxy::deinitialize() {
if (_raycaster) {
OsEng.renderEngine().raycasterManager().detachRaycaster(*_raycaster.get());
_raycaster = nullptr;
}
- return true;
}
bool RenderableGalaxy::isReady() const {
diff --git a/modules/galaxy/rendering/renderablegalaxy.h b/modules/galaxy/rendering/renderablegalaxy.h
index 77c5608a0a..cb398be19c 100644
--- a/modules/galaxy/rendering/renderablegalaxy.h
+++ b/modules/galaxy/rendering/renderablegalaxy.h
@@ -41,8 +41,8 @@ public:
RenderableGalaxy(const ghoul::Dictionary& dictionary);
~RenderableGalaxy();
- bool initialize() override;
- bool deinitialize() override;
+ void initialize() override;
+ void deinitialize() override;
bool isReady() const override;
void render(const RenderData& data, RendererTasks& tasks) override;
void update(const UpdateData& data) override;
diff --git a/modules/galaxy/shaders/points.fs b/modules/galaxy/shaders/points.fs
index 810b75863d..ebad5e5887 100644
--- a/modules/galaxy/shaders/points.fs
+++ b/modules/galaxy/shaders/points.fs
@@ -34,7 +34,7 @@ uniform float emittanceFactor;
Fragment getFragment() {
Fragment frag;
- const float coefficient = exp(1.38 * log(emittanceFactor) - 2*log(depth));
+ float coefficient = exp(1.38 * log(emittanceFactor) - 2*log(depth));
frag.color = vec4(vsColor.rgb * coefficient, 1.0);
frag.depth = pscDepth(vec4(vsPosition, 0.0));
diff --git a/modules/galaxy/shaders/raycasterbounds.fs b/modules/galaxy/shaders/raycasterbounds.fs
index d4d1027dac..6009b0aec4 100644
--- a/modules/galaxy/shaders/raycasterbounds.fs
+++ b/modules/galaxy/shaders/raycasterbounds.fs
@@ -32,8 +32,8 @@ uniform uint blendMode;
Fragment getFragment() {
- const vec4 position = worldPosition;
- const float depth = pscDepth(position);
+ vec4 position = worldPosition;
+ float depth = pscDepth(position);
Fragment frag;
frag.color = vec4((vPosition + 0.5), 1.0);
diff --git a/modules/galaxy/shaders/raycasterbounds.vs b/modules/galaxy/shaders/raycasterbounds.vs
index b1f5014578..30db1c1622 100644
--- a/modules/galaxy/shaders/raycasterbounds.vs
+++ b/modules/galaxy/shaders/raycasterbounds.vs
@@ -40,7 +40,7 @@ void main() {
worldPosition = modelTransform * vec4(vertPosition.xyz, 1.0);
worldPosition.w = 0.0;
- const vec4 position = pscTransform(worldPosition, mat4(1.0));
+ vec4 position = pscTransform(worldPosition, mat4(1.0));
gl_Position = z_normalization(viewProjection * position);
}
diff --git a/modules/globebrowsing/cache/memoryawaretilecache.cpp b/modules/globebrowsing/cache/memoryawaretilecache.cpp
index f97d196be8..b146f31f36 100644
--- a/modules/globebrowsing/cache/memoryawaretilecache.cpp
+++ b/modules/globebrowsing/cache/memoryawaretilecache.cpp
@@ -82,7 +82,7 @@ namespace {
namespace openspace::globebrowsing::cache {
MemoryAwareTileCache::MemoryAwareTileCache()
- : PropertyOwner("TileCache")
+ : PropertyOwner({ "TileCache" })
, _numTextureBytesAllocatedOnCPU(0)
, _cpuAllocatedTileData(CpuAllocatedDataInfo, 1024, 128, 2048, 1)
, _gpuAllocatedTileData(GpuAllocatedDataInfo, 1024, 128, 2048, 1)
diff --git a/modules/globebrowsing/globebrowsingmodule.cpp b/modules/globebrowsing/globebrowsingmodule.cpp
index 404348d26a..51fb67cd22 100644
--- a/modules/globebrowsing/globebrowsingmodule.cpp
+++ b/modules/globebrowsing/globebrowsingmodule.cpp
@@ -345,12 +345,12 @@ std::string GlobeBrowsingModule::layerGroupNamesList() {
}
std::string GlobeBrowsingModule::layerTypeNamesList() {
- std::string listLayerTypes("");
+ std::string listLayerTypes;
for (int i = 0; i < globebrowsing::layergroupid::NUM_LAYER_TYPES - 1; ++i) {
- listLayerTypes += globebrowsing::layergroupid::LAYER_TYPE_NAMES[i] + ", ";
+ listLayerTypes += std::string(globebrowsing::layergroupid::LAYER_TYPE_NAMES[i]) + ", ";
}
listLayerTypes +=
- " and " + globebrowsing::layergroupid::LAYER_TYPE_NAMES[globebrowsing::layergroupid::NUM_LAYER_TYPES - 1];
+ " and " + std::string(globebrowsing::layergroupid::LAYER_TYPE_NAMES[globebrowsing::layergroupid::NUM_LAYER_TYPES - 1]);
return listLayerTypes;
}
diff --git a/modules/globebrowsing/globes/chunkedlodglobe.cpp b/modules/globebrowsing/globes/chunkedlodglobe.cpp
index 7317939c2e..0ded2257ea 100644
--- a/modules/globebrowsing/globes/chunkedlodglobe.cpp
+++ b/modules/globebrowsing/globes/chunkedlodglobe.cpp
@@ -94,14 +94,6 @@ ChunkedLodGlobe::ChunkedLodGlobe(const RenderableGlobe& owner, size_t segmentsPe
// with a forward declaration
ChunkedLodGlobe::~ChunkedLodGlobe() {}
-bool ChunkedLodGlobe::initialize() {
- return true;
-}
-
-bool ChunkedLodGlobe::deinitialize() {
- return true;
-}
-
bool ChunkedLodGlobe::isReady() const {
return true;
}
diff --git a/modules/globebrowsing/globes/chunkedlodglobe.h b/modules/globebrowsing/globes/chunkedlodglobe.h
index 15f9ea3091..530e6470cf 100644
--- a/modules/globebrowsing/globes/chunkedlodglobe.h
+++ b/modules/globebrowsing/globes/chunkedlodglobe.h
@@ -52,8 +52,6 @@ public:
std::shared_ptr layerManager);
~ChunkedLodGlobe();
- bool initialize() override;
- bool deinitialize() override;
bool isReady() const override;
void render(const RenderData& data, RendererTasks& rendererTask) override;
diff --git a/modules/globebrowsing/globes/pointglobe.cpp b/modules/globebrowsing/globes/pointglobe.cpp
index 3514648d18..52e99b35c2 100644
--- a/modules/globebrowsing/globes/pointglobe.cpp
+++ b/modules/globebrowsing/globes/pointglobe.cpp
@@ -64,7 +64,7 @@ PointGlobe::~PointGlobe() {
glDeleteVertexArrays(1, &_vaoID);
}
-bool PointGlobe::initialize() {
+void PointGlobe::initialize() {
_programObject = OsEng.renderEngine().buildRenderProgram(
"PointGlobe",
"${MODULE_GLOBEBROWSING}/shaders/pointglobe_vs.glsl",
@@ -98,12 +98,11 @@ bool PointGlobe::initialize() {
glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, sizeof(glm::vec2), 0);
glBindVertexArray(0);
-
- return isReady();
}
-bool PointGlobe::deinitialize() {
- return true;
+void PointGlobe::deinitialize() {
+ glDeleteVertexArrays(1, &_vaoID);
+ glDeleteBuffers(1, &_vertexBufferID);
}
bool PointGlobe::isReady() const {
diff --git a/modules/globebrowsing/globes/pointglobe.h b/modules/globebrowsing/globes/pointglobe.h
index 59cd91fdee..213122efb2 100644
--- a/modules/globebrowsing/globes/pointglobe.h
+++ b/modules/globebrowsing/globes/pointglobe.h
@@ -41,8 +41,8 @@ public:
PointGlobe(const RenderableGlobe& owner);
virtual ~PointGlobe();
- bool initialize() override;
- bool deinitialize() override;
+ void initialize() override;
+ void deinitialize() override;
bool isReady() const override;
void render(const RenderData& data, RendererTasks& rendererTask) override;
diff --git a/modules/globebrowsing/globes/renderableglobe.cpp b/modules/globebrowsing/globes/renderableglobe.cpp
index 01045b9611..4d7f1887a6 100644
--- a/modules/globebrowsing/globes/renderableglobe.cpp
+++ b/modules/globebrowsing/globes/renderableglobe.cpp
@@ -179,17 +179,23 @@ RenderableGlobe::RenderableGlobe(const ghoul::Dictionary& dictionary)
FloatProperty(CameraMinHeightInfo, 100.f, 0.f, 1000.f),
FloatProperty(OrenNayarRoughnessInfo, 0.f, 0.f, 1.f)
})
- , _debugPropertyOwner("Debug")
+ , _debugPropertyOwner({ "Debug" })
{
setName("RenderableGlobe");
dictionary.getValue(keyFrame, _frame);
// Read the radii in to its own dictionary
- glm::dvec3 radii;
- dictionary.getValue(keyRadii, radii);
- _ellipsoid = Ellipsoid(radii);
- setBoundingSphere(static_cast(_ellipsoid.maximumRadius()));
+ if (dictionary.hasKeyAndValue(keyRadii)) {
+ const glm::dvec3 radii = dictionary.value(keyRadii);
+ _ellipsoid = Ellipsoid(radii);
+ setBoundingSphere(static_cast(_ellipsoid.maximumRadius()));
+ }
+ else if (dictionary.hasKeyAndValue(keyRadii)) {
+ const double radius = dictionary.value(keyRadii);
+ _ellipsoid = Ellipsoid({ radius, radius, radius });
+ setBoundingSphere(static_cast(_ellipsoid.maximumRadius()));
+ }
// Ghoul can't read ints from lua dictionaries...
double patchSegmentsd;
@@ -199,8 +205,7 @@ RenderableGlobe::RenderableGlobe(const ghoul::Dictionary& dictionary)
// Init layer manager
ghoul::Dictionary layersDictionary;
if (!dictionary.getValue(keyLayers, layersDictionary)) {
- throw ghoul::RuntimeError(
- std::string(keyLayers) + " must be specified specified!");
+ throw ghoul::RuntimeError(std::string(keyLayers) + " must be specified");
}
_layerManager = std::make_shared(layersDictionary);
@@ -255,12 +260,12 @@ RenderableGlobe::RenderableGlobe(const ghoul::Dictionary& dictionary)
//addPropertySubOwner(_pointGlobe.get());
}
-bool RenderableGlobe::initialize() {
- return _distanceSwitch.initialize();
+void RenderableGlobe::initialize() {
+ _distanceSwitch.initialize();
}
-bool RenderableGlobe::deinitialize() {
- return _distanceSwitch.deinitialize();
+void RenderableGlobe::deinitialize() {
+ _distanceSwitch.deinitialize();
}
bool RenderableGlobe::isReady() const {
diff --git a/modules/globebrowsing/globes/renderableglobe.h b/modules/globebrowsing/globes/renderableglobe.h
index 54a4ecde10..b43111dfaf 100644
--- a/modules/globebrowsing/globes/renderableglobe.h
+++ b/modules/globebrowsing/globes/renderableglobe.h
@@ -81,8 +81,8 @@ public:
RenderableGlobe(const ghoul::Dictionary& dictionary);
~RenderableGlobe() = default;
- bool initialize() override;
- bool deinitialize() override;
+ void initialize() override;
+ void deinitialize() override;
bool isReady() const override;
void render(const RenderData& data, RendererTasks& rendererTask) override;
diff --git a/modules/globebrowsing/rendering/layer/layer.cpp b/modules/globebrowsing/rendering/layer/layer.cpp
index 4887d15f14..fec5f0b5c7 100644
--- a/modules/globebrowsing/rendering/layer/layer.cpp
+++ b/modules/globebrowsing/rendering/layer/layer.cpp
@@ -32,6 +32,7 @@ namespace {
const char* _loggerCat = "Layer";
const char* keyName = "Name";
+ const char* keyDescription = "Description";
const char* keyEnabled = "Enabled";
const char* keyLayerGroupID = "LayerGroupID";
const char* keySettings = "Settings";
@@ -73,11 +74,13 @@ namespace {
"If the 'Type' of this layer is a solid color, this value determines what this "
"solid color is."
};
-
} // namespace
Layer::Layer(layergroupid::GroupID id, const ghoul::Dictionary& layerDict)
- : properties::PropertyOwner(layerDict.value(keyName))
+ : properties::PropertyOwner({
+ layerDict.value(keyName),
+ layerDict.hasKey(keyDescription) ? layerDict.value(keyDescription) : ""
+ })
, _typeOption(TypeInfo, properties::OptionProperty::DisplayType::Dropdown)
, _blendModeOption(BlendModeInfo, properties::OptionProperty::DisplayType::Dropdown)
, _enabled(EnabledInfo, false)
diff --git a/modules/globebrowsing/rendering/layer/layeradjustment.cpp b/modules/globebrowsing/rendering/layer/layeradjustment.cpp
index 63ce096e6f..bcc826ead1 100644
--- a/modules/globebrowsing/rendering/layer/layeradjustment.cpp
+++ b/modules/globebrowsing/rendering/layer/layeradjustment.cpp
@@ -52,7 +52,7 @@ namespace {
namespace openspace::globebrowsing {
LayerAdjustment::LayerAdjustment()
- : properties::PropertyOwner("adjustment")
+ : properties::PropertyOwner({ "adjustment" })
, chromaKeyColor(ChromaKeyColorInfo, glm::vec3(0.f), glm::vec3(0.f), glm::vec3(1.f))
, chromaKeyTolerance(ChromaKeyToleranceInfo, 0.f, 0.f, 1.f)
, _typeOption(TypeInfo, properties::OptionProperty::DisplayType::Dropdown)
diff --git a/modules/globebrowsing/rendering/layer/layergroup.cpp b/modules/globebrowsing/rendering/layer/layergroup.cpp
index 917c5d7793..c2b5a09da2 100644
--- a/modules/globebrowsing/rendering/layer/layergroup.cpp
+++ b/modules/globebrowsing/rendering/layer/layergroup.cpp
@@ -34,7 +34,8 @@ namespace {
"Blend between levels",
"If this value is enabled, images between different levels are interpolated, "
"rather than switching between levels abruptly. This makes transitions smoother "
- "and more visually pleasing."
+ "and more visually pleasing.",
+ openspace::properties::Property::Visibility::Hidden
};
} // namespace
@@ -42,7 +43,7 @@ namespace {
namespace openspace::globebrowsing {
LayerGroup::LayerGroup(layergroupid::GroupID id)
- : properties::PropertyOwner(std::move(layergroupid::LAYER_GROUP_NAMES[id]))
+ : properties::PropertyOwner({ std::move(layergroupid::LAYER_GROUP_NAMES[id]) })
, _groupId(id)
, _levelBlendingEnabled(BlendTileInfo, true)
{
@@ -90,11 +91,13 @@ void LayerGroup::addLayer(const ghoul::Dictionary& layerDict) {
else {
_layers.push_back(layer);
update();
- if(_onChangeCallback) {
+ if (_onChangeCallback) {
_onChangeCallback();
}
addPropertySubOwner(layer.get());
}
+
+ _levelBlendingEnabled.setVisibility(properties::Property::Visibility::User);
}
void LayerGroup::deleteLayer(const std::string& layerName) {
@@ -103,10 +106,16 @@ void LayerGroup::deleteLayer(const std::string& layerName) {
removePropertySubOwner(it->get());
_layers.erase(it);
update();
- if(_onChangeCallback) {
+ if (_onChangeCallback) {
_onChangeCallback();
}
LINFO("Deleted layer " + layerName);
+
+ if (_layers.empty()) {
+ _levelBlendingEnabled.setVisibility(
+ properties::Property::Visibility::Hidden
+ );
+ }
return;
}
}
diff --git a/modules/globebrowsing/rendering/layer/layergroupid.h b/modules/globebrowsing/rendering/layer/layergroupid.h
index c015a999c1..70eced37a8 100644
--- a/modules/globebrowsing/rendering/layer/layergroupid.h
+++ b/modules/globebrowsing/rendering/layer/layergroupid.h
@@ -29,8 +29,8 @@
namespace openspace::globebrowsing::layergroupid {
-static const int NUM_LAYER_GROUPS = 5;
-static const std::string LAYER_GROUP_NAMES[NUM_LAYER_GROUPS] = {
+static constexpr int NUM_LAYER_GROUPS = 5;
+static constexpr const char* LAYER_GROUP_NAMES[NUM_LAYER_GROUPS] = {
"HeightLayers",
"ColorLayers",
"Overlays",
@@ -47,8 +47,8 @@ enum GroupID {
Unknown,
};
-static const int NUM_LAYER_TYPES = 8;
-static const std::string LAYER_TYPE_NAMES[NUM_LAYER_TYPES] = {
+static constexpr int NUM_LAYER_TYPES = 8;
+static constexpr const char* LAYER_TYPE_NAMES[NUM_LAYER_TYPES] = {
"DefaultTileLayer",
"SingleImageTileLayer",
"SizeReferenceTileLayer",
@@ -74,8 +74,8 @@ enum class TypeID {
SolidColor = 7,
};
-static const int NUM_ADJUSTMENT_TYPES = 3;
-static const std::string ADJUSTMENT_TYPE_NAMES[NUM_ADJUSTMENT_TYPES] = {
+static constexpr int NUM_ADJUSTMENT_TYPES = 3;
+static constexpr const char* ADJUSTMENT_TYPE_NAMES[NUM_ADJUSTMENT_TYPES] = {
"None",
"ChromaKey",
"TransferFunction",
@@ -90,8 +90,8 @@ enum class AdjustmentTypeID {
TransferFunction = 2,
};
-static const int NUM_BLEND_MODES = 5;
-static const std::string BLEND_MODE_NAMES[NUM_BLEND_MODES] = {
+static constexpr int NUM_BLEND_MODES = 5;
+static constexpr const char* BLEND_MODE_NAMES[NUM_BLEND_MODES] = {
"Normal",
"Multiply",
"Add",
diff --git a/modules/globebrowsing/rendering/layer/layermanager.cpp b/modules/globebrowsing/rendering/layer/layermanager.cpp
index d59d994861..2c5c87fd8c 100644
--- a/modules/globebrowsing/rendering/layer/layermanager.cpp
+++ b/modules/globebrowsing/rendering/layer/layermanager.cpp
@@ -35,7 +35,7 @@ namespace {
namespace openspace::globebrowsing {
LayerManager::LayerManager(const ghoul::Dictionary& layerGroupsDict)
- : properties::PropertyOwner("Layers")
+ : properties::PropertyOwner({ "Layers" })
{
// First create empty layer groups in case not all are specified
_layerGroups.resize(layergroupid::NUM_LAYER_GROUPS);
diff --git a/modules/globebrowsing/rendering/layer/layerrendersettings.cpp b/modules/globebrowsing/rendering/layer/layerrendersettings.cpp
index f8cb1ec335..62bb2e5ca1 100644
--- a/modules/globebrowsing/rendering/layer/layerrendersettings.cpp
+++ b/modules/globebrowsing/rendering/layer/layerrendersettings.cpp
@@ -70,7 +70,7 @@ namespace {
namespace openspace::globebrowsing {
LayerRenderSettings::LayerRenderSettings()
- : properties::PropertyOwner("Settings")
+ : properties::PropertyOwner({ "Settings" })
, setDefault(SetDefaultInfo)
, opacity(OpacityInfo, 1.f, 0.f, 1.f)
, gamma(GammaInfo, 1.f, 0.f, 5.f)
diff --git a/modules/globebrowsing/scripts/layer_support.lua b/modules/globebrowsing/scripts/layer_support.lua
index a1af426327..9304a41da7 100644
--- a/modules/globebrowsing/scripts/layer_support.lua
+++ b/modules/globebrowsing/scripts/layer_support.lua
@@ -1,14 +1,4 @@
openspace.globebrowsing.documentation = {
- {
- Name = "createTextureLayers",
- Arguments = "table",
- Documentation = "Creates a table used in the 'ColorLayers', 'GrayScaleLayers', or 'GrayScaleColorOverlays' of a RenderableGlobe."
- },
- {
- Name = "createHeightLayers",
- Arguments = "table",
- Documentation = "Creates a table used in the 'HeightLayers' of a RenderableGlobe."
- },
{
Name = "createTemporalGibsGdalXml",
Arguments = "string, string, string, string, string, string",
@@ -57,34 +47,31 @@ openspace.globebrowsing.documentation = {
")" ..
"}" ..
")"
+ },
+ {
+ Name = "parseInfoFile",
+ Arguments = "string",
+ Documentation =
+ "Parses the passed info file and returns two tables. The first return value " ..
+ "contains the table for the color layer of a RenderableGlobe. The second " ..
+ "return value contains the table for the height layer of a RenderableGlobe." ..
+ "Usage: local color, height = openspace.globebrowsing.parseInfoFile(file)" ..
+ "openspace.globebrowsing.addLayer(\"Earth\", \"ColorLayers\", color)" ..
+ "openspace.globebrowsing.addLayer(\"Earth\", \"HeightLayers\", height)"
+
+ },
+ {
+ Name = "addBlendingLayersFromDirectory",
+ Arguments = "string, string",
+ Documentation =
+ "Retrieves all info files recursively in the directory passed as the first " ..
+ "argument to this function. The color and height tables retrieved from these " ..
+ "info files are then added to the RenderableGlobe identified by name passed " ..
+ "to the second argument." ..
+ "Usage: openspace.globebrowsing.addBlendingLayersFromDirectory(directory, \"Earth\")"
}
}
--- Creates a table used in the 'ColorLayers', 'GrayScaleLayers', or 'GrayScaleColorOverlays'
--- of a RenderableGlobe
--- Usage:
--- table.unpack(openspace.globebrowsing.createTextureLayers(p))
--- where p is an array that contains tables with 'Name' and 'Texture' values
-openspace.globebrowsing.createTextureLayers = function (patches)
- result = {}
- for k,v in pairs(patches) do
- table.insert(result, { Name = v["Name"], FilePath = v["Texture"] })
- end
- return result
-end
-
--- Creates a table used in the 'HeightLayers' of a RenderableGlobe
--- Usage:
--- table.unpack(openspace.globebrowsing.openspace.globebrowsing.createHeightLayers(p))
--- where p is an array that contains tables with 'Name' and 'Height' values
-openspace.globebrowsing.createHeightLayers = function (patches)
- result = {}
- for k,v in pairs(patches) do
- table.insert(result, { Name = v["Name"], FilePath = v["Height"], TilePixelSize = 90, PerformPreProcessing = true })
- end
- return result
-end
-
openspace.globebrowsing.createTemporalGibsGdalXml = function (layerName, startDate, endDate, timeResolution, resolution, format)
temporalTemplate =
"" ..
@@ -162,4 +149,38 @@ openspace.globebrowsing.createGibsGdalXml = function (layerName, date, resolutio
""
return gdalWmsTemplate
+end
+
+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 height = {
+ Name = Name,
+ Description = Description or "",
+ FilePath = dir .. '/' .. HeightFile,
+ TilePixelSize = 90
+ }
+
+ return color, height
+end
+
+openspace.globebrowsing.addBlendingLayersFromDirectory = function (dir, node_name)
+ local files = openspace.walkDirectoryFiles(dir, true, true)
+
+ for _, file in pairs(files) do
+ 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)
+ end
+ end
end
\ No newline at end of file
diff --git a/modules/globebrowsing/shaders/blending.hglsl b/modules/globebrowsing/shaders/blending.hglsl
index 62de022b35..732eb011a3 100644
--- a/modules/globebrowsing/shaders/blending.hglsl
+++ b/modules/globebrowsing/shaders/blending.hglsl
@@ -75,10 +75,10 @@ vec3 hsl2rgb(in vec3 c) {
}
vec3 HueShift(in vec3 color, in float shift) {
- const vec3 P = vec3(0.55735) * dot(vec3(0.55735), color);
- const vec3 U = color - P;
- const vec3 V = cross(vec3(0.55735), U);
- const vec3 c = U*cos(shift*6.2832) + V*sin(shift*6.2832) + P;
+ vec3 P = vec3(0.55735) * dot(vec3(0.55735), color);
+ vec3 U = color - P;
+ vec3 V = cross(vec3(0.55735), U);
+ vec3 c = U*cos(shift*6.2832) + V*sin(shift*6.2832) + P;
return c;
}
diff --git a/modules/globebrowsing/shaders/ellipsoid.hglsl b/modules/globebrowsing/shaders/ellipsoid.hglsl
index 6a00242f58..708a469615 100644
--- a/modules/globebrowsing/shaders/ellipsoid.hglsl
+++ b/modules/globebrowsing/shaders/ellipsoid.hglsl
@@ -37,7 +37,7 @@ struct Intersection {
};
vec3 geodeticSurfaceNormal(float latitude, float longitude) {
- const float cosLat = cos(latitude);
+ float cosLat = cos(latitude);
return vec3(
cosLat * cos(longitude),
cosLat * sin(longitude),
@@ -48,10 +48,10 @@ vec3 geodeticSurfaceNormal(float latitude, float longitude) {
PositionNormalPair geodetic3ToCartesian(float latitude, float longitude, float height,
vec3 radiiSquared)
{
- const vec3 normal = geodeticSurfaceNormal(latitude, longitude);
- const vec3 k = radiiSquared * normal;
- const float gamma = sqrt(dot(k, normal));
- const vec3 rSurface = k / gamma;
+ vec3 normal = geodeticSurfaceNormal(latitude, longitude);
+ vec3 k = radiiSquared * normal;
+ float gamma = sqrt(dot(k, normal));
+ vec3 rSurface = k / gamma;
PositionNormalPair toReturn;
toReturn.position = rSurface + height * normal;
toReturn.normal = normal;
@@ -79,22 +79,22 @@ vec3 latLonToCartesian(float latitude, float longitude, float radius) {
Intersection rayIntersectEllipsoid(vec3 rayOrigin, vec3 rayOriginSquared,
vec3 rayDirection, vec3 oneOverEllipsoidRadiiSquared)
{
- const float a = dot(rayDirection * rayDirection, oneOverEllipsoidRadiiSquared);
- const float b = 2.0 * dot(rayOrigin * rayDirection, oneOverEllipsoidRadiiSquared);
- const float c = dot(rayOriginSquared, oneOverEllipsoidRadiiSquared) - 1.0;
- const float discriminant = b * b - 4.0 * a * c;
+ float a = dot(rayDirection * rayDirection, oneOverEllipsoidRadiiSquared);
+ float b = 2.0 * dot(rayOrigin * rayDirection, oneOverEllipsoidRadiiSquared);
+ float c = dot(rayOriginSquared, oneOverEllipsoidRadiiSquared) - 1.0;
+ float discriminant = b * b - 4.0 * a * c;
if (discriminant < 0.0) {
return Intersection(false, 0.0, 0.0);
}
else if (discriminant == 0.0) {
- const float time = -0.5 * b / a;
+ float time = -0.5 * b / a;
return Intersection(true, time, time);
}
- const float t = -0.5 * (b + (b > 0.0 ? 1.0 : -1.0) * sqrt(discriminant));
- const float root1 = t / a;
- const float root2 = c / t;
+ float t = -0.5 * (b + (b > 0.0 ? 1.0 : -1.0) * sqrt(discriminant));
+ float root1 = t / a;
+ float root2 = c / t;
return Intersection(true, min(root1, root2), max(root1, root2));
}
diff --git a/modules/globebrowsing/shaders/globalchunkedlodpatch_vs.glsl b/modules/globebrowsing/shaders/globalchunkedlodpatch_vs.glsl
index 00e5b8af8f..b67b2e5890 100644
--- a/modules/globebrowsing/shaders/globalchunkedlodpatch_vs.glsl
+++ b/modules/globebrowsing/shaders/globalchunkedlodpatch_vs.glsl
@@ -71,10 +71,10 @@ PositionNormalPair globalInterpolation(vec2 uv) {
void main() {
PositionNormalPair pair = globalInterpolation(in_uv);
- const float distToVertexOnEllipsoid =
+ float distToVertexOnEllipsoid =
length(pair.position + pair.normal * chunkMinHeight - cameraPosition);
- const float levelInterpolationParameter =
+ float levelInterpolationParameter =
getLevelInterpolationParameter(
chunkLevel,
distanceScaleFactor,
@@ -94,21 +94,21 @@ void main() {
// tileDelta is a step length (epsilon). Should be small enough for accuracy but not
// Too small for precision. 1 / 512 is good.
const float tileDelta = 1.0 / 512.0;
- const PositionNormalPair pair10 = globalInterpolation(
+ PositionNormalPair pair10 = globalInterpolation(
in_uv + vec2(1.0, 0.0) * tileDelta
);
- const PositionNormalPair pair01 = globalInterpolation(
+ PositionNormalPair pair01 = globalInterpolation(
in_uv + vec2(0.0, 1.0) * tileDelta
);
- const vec3 ellipsoidTangentTheta = normalize(pair10.position - pair.position);
- const vec3 ellipsoidTangentPhi = normalize(pair01.position - pair.position);
+ vec3 ellipsoidTangentTheta = normalize(pair10.position - pair.position);
+ vec3 ellipsoidTangentPhi = normalize(pair01.position - pair.position);
ellipsoidTangentThetaCameraSpace = mat3(modelViewTransform) * ellipsoidTangentTheta;
ellipsoidTangentPhiCameraSpace = mat3(modelViewTransform) * ellipsoidTangentPhi;
#endif // USE_ACCURATE_NORMALS
// Add the height in the direction of the normal
pair.position += pair.normal * height;
- const vec4 positionClippingSpace =
+ vec4 positionClippingSpace =
modelViewProjectionTransform * vec4(pair.position, 1);
// Write output
diff --git a/modules/globebrowsing/shaders/globeshading.hglsl b/modules/globebrowsing/shaders/globeshading.hglsl
index cdaf0cf3d9..bf595e20e5 100644
--- a/modules/globebrowsing/shaders/globeshading.hglsl
+++ b/modules/globebrowsing/shaders/globeshading.hglsl
@@ -29,25 +29,25 @@ float orenNayarDiffuse(vec3 lightDirection, vec3 viewDirection, vec3 surfaceNorm
float roughness)
{
// calculate intermediary values
- const float NdotL = dot(surfaceNormal, lightDirection);
- const float NdotV = dot(surfaceNormal, viewDirection);
+ float NdotL = dot(surfaceNormal, lightDirection);
+ float NdotV = dot(surfaceNormal, viewDirection);
- const float angleVN = acos(NdotV);
- const float angleLN = acos(NdotL);
+ float angleVN = acos(NdotV);
+ float angleLN = acos(NdotL);
- const float alpha = max(angleVN, angleLN);
- const float beta = min(angleVN, angleLN);
- const float gamma = dot(
+ float alpha = max(angleVN, angleLN);
+ float beta = min(angleVN, angleLN);
+ float gamma = dot(
viewDirection - surfaceNormal * dot(viewDirection, surfaceNormal),
lightDirection - surfaceNormal * dot(lightDirection, surfaceNormal)
);
- const float roughnessSquared = roughness * roughness;
+ float roughnessSquared = roughness * roughness;
// calculate A and B
- const float A = 1.0 - 0.5 * (roughnessSquared / (roughnessSquared + 0.57));
- const float B = 0.45 * (roughnessSquared / (roughnessSquared + 0.09));
- const float C = sin(alpha) * tan(beta);
+ float A = 1.0 - 0.5 * (roughnessSquared / (roughnessSquared + 0.57));
+ float B = 0.45 * (roughnessSquared / (roughnessSquared + 0.09));
+ float C = sin(alpha) * tan(beta);
// put it all together
return max(0.0, NdotL) * (A + B * max(0.0, gamma) * C);
diff --git a/modules/globebrowsing/shaders/localchunkedlodpatch_vs.glsl b/modules/globebrowsing/shaders/localchunkedlodpatch_vs.glsl
index 667b8be322..db535a6b20 100644
--- a/modules/globebrowsing/shaders/localchunkedlodpatch_vs.glsl
+++ b/modules/globebrowsing/shaders/localchunkedlodpatch_vs.glsl
@@ -70,9 +70,9 @@ void main() {
// Calculate desired level based on distance to the vertex on the ellipsoid
// Before any heightmapping is done
- const float distToVertexOnEllipsoid =
+ float distToVertexOnEllipsoid =
length(p + patchNormalCameraSpace * chunkMinHeight);
- const float levelInterpolationParameter =
+ float levelInterpolationParameter =
getLevelInterpolationParameter(
chunkLevel,
distanceScaleFactor,
@@ -82,13 +82,13 @@ void main() {
levelWeights = getLevelWeights(levelInterpolationParameter);
// Get the height value and apply skirts
- const float height =
+ float height =
getTileHeightScaled(in_uv, levelWeights) - getTileVertexSkirtLength();
// Translate the point along normal
p += patchNormalCameraSpace * height;
- const vec4 positionClippingSpace = projectionTransform * vec4(p, 1);
+ vec4 positionClippingSpace = projectionTransform * vec4(p, 1);
#if USE_ACCURATE_NORMALS
// Calculate tangents
diff --git a/modules/globebrowsing/shaders/pointglobe_vs.glsl b/modules/globebrowsing/shaders/pointglobe_vs.glsl
index 79e879f861..1a980168e8 100644
--- a/modules/globebrowsing/shaders/pointglobe_vs.glsl
+++ b/modules/globebrowsing/shaders/pointglobe_vs.glsl
@@ -40,15 +40,15 @@ uniform mat4 directionToSunViewSpace;
void main() {
vs_positionModelSpace = in_position;
- const float totalIntensity = lightIntensityClamped;
+ float totalIntensity = lightIntensityClamped;
- const vec4 positionCameraSpace = modelViewTransform * vec4(
+ vec4 positionCameraSpace = modelViewTransform * vec4(
in_position * totalIntensity,
0.0,
1.0
);
- const vec4 positionClipSpace = projectionTransform * positionCameraSpace;
+ vec4 positionClipSpace = projectionTransform * positionCameraSpace;
vs_positionClipSpace = z_normalization(positionClipSpace);
gl_Position = z_normalization(positionClipSpace);
}
diff --git a/modules/globebrowsing/shaders/texturetilemapping.hglsl b/modules/globebrowsing/shaders/texturetilemapping.hglsl
index 3c59b5cd5f..64b75a2355 100644
--- a/modules/globebrowsing/shaders/texturetilemapping.hglsl
+++ b/modules/globebrowsing/shaders/texturetilemapping.hglsl
@@ -65,7 +65,7 @@
#define SHOW_HEIGHT_RESOLUTION #{showHeightResolution}
#define SHOW_HEIGHT_INTENSITIES #{showHeightIntensities}
-float performLayerSettingsRGB(float currentValue, const LayerSettings settings) {
+float performLayerSettingsRGB(float currentValue, LayerSettings settings) {
float newValue = currentValue;
newValue = sign(newValue) * pow(abs(newValue), settings.gamma);
@@ -75,7 +75,7 @@ float performLayerSettingsRGB(float currentValue, const LayerSettings settings)
return newValue;
}
-vec4 performLayerSettingsRGB(vec4 currentValue, const LayerSettings settings) {
+vec4 performLayerSettingsRGB(vec4 currentValue, LayerSettings settings) {
vec4 newValue = vec4(
performLayerSettingsRGB(currentValue.r, settings),
performLayerSettingsRGB(currentValue.g, settings),
@@ -86,22 +86,22 @@ vec4 performLayerSettingsRGB(vec4 currentValue, const LayerSettings settings) {
return newValue;
}
-float performLayerSettingsAlpha(float currentValue, const LayerSettings settings) {
+float performLayerSettingsAlpha(float currentValue, LayerSettings settings) {
return currentValue * settings.opacity;
}
-vec4 performLayerSettingsAlpha(vec4 currentValue, const LayerSettings settings) {
+vec4 performLayerSettingsAlpha(vec4 currentValue, LayerSettings settings) {
return vec4(currentValue.rgb, performLayerSettingsAlpha(currentValue.a, settings));
}
-float performLayerSettings(float currentValue, const LayerSettings settings) {
+float performLayerSettings(float currentValue, LayerSettings settings) {
return performLayerSettingsAlpha(
performLayerSettingsRGB(currentValue, settings),
settings
);
}
-vec4 performLayerSettings(vec4 currentValue, const LayerSettings settings) {
+vec4 performLayerSettings(vec4 currentValue, LayerSettings settings) {
return performLayerSettingsAlpha(
performLayerSettingsRGB(currentValue, settings),
settings
@@ -112,8 +112,8 @@ vec4 performLayerSettings(vec4 currentValue, const LayerSettings settings) {
#for id, layerGroup in layerGroups
#for i in 0..#{lastLayerIndex#{layerGroup}}
-vec4 getSample#{layerGroup}#{i}(const vec2 uv, const LevelWeights levelWeights,
- const Layer #{layerGroup}[#{lastLayerIndex#{layerGroup}} + 1])
+vec4 getSample#{layerGroup}#{i}(vec2 uv, LevelWeights levelWeights,
+ Layer #{layerGroup}[#{lastLayerIndex#{layerGroup}} + 1])
{
vec4 color = vec4(0,0,0,1);
@@ -176,7 +176,7 @@ vec4 blend#{layerGroup}#{i}(vec4 currentColor, vec4 newColor, float blendFactor)
#for i in 0..#{lastLayerIndex#{layerGroup}}
vec4 performAdjustment#{layerGroup}#{i}(vec4 currentColor,
- const LayerAdjustment adjustment)
+ LayerAdjustment adjustment)
{
#if (#{#{layerGroup}#{i}LayerAdjustmentType} == 0) // Default, None
return currentColor;
@@ -201,10 +201,9 @@ vec4 performAdjustment#{layerGroup}#{i}(vec4 currentColor,
#endfor
#endfor
-float calculateUntransformedHeight(
- vec2 uv,
- LevelWeights levelWeights,
- const Layer HeightLayers[NUMLAYERS_HEIGHTMAP]) {
+float calculateUntransformedHeight(vec2 uv, LevelWeights levelWeights,
+ Layer HeightLayers[NUMLAYERS_HEIGHTMAP])
+{
float height = 0;
@@ -229,7 +228,7 @@ float calculateUntransformedHeight(
float calculateHeight(
vec2 uv,
LevelWeights levelWeights,
- const Layer HeightLayers[NUMLAYERS_HEIGHTMAP]) {
+ Layer HeightLayers[NUMLAYERS_HEIGHTMAP]) {
float height = 0;
@@ -256,12 +255,9 @@ float calculateHeight(
return height;
}
-vec4 calculateColor(
- const vec4 currentColor,
- const vec2 uv,
- LevelWeights levelWeights,
- const Layer ColorLayers[NUMLAYERS_COLORTEXTURE]) {
-
+vec4 calculateColor(vec4 currentColor, vec2 uv, LevelWeights levelWeights,
+ Layer ColorLayers[NUMLAYERS_COLORTEXTURE])
+{
vec4 color = currentColor;
// The shader compiler will remove unused code when variables are multiplied by
@@ -290,30 +286,27 @@ float gridDots(vec2 uv, vec2 gridResolution){
return 1-length(1-uvDotSpace);
}
-vec4 calculateDebugColor(vec2 uv, vec4 fragPos, vec2 vertexResolution){
+vec4 calculateDebugColor(vec2 uv, vec4 fragPos, vec2 vertexResolution) {
vec2 uvVertexSpace = fract(vertexResolution * uv);
- vec3 colorUv = vec3(0.3*uv.x, 0.3*uv.y, 0);
- vec3 colorDistance = vec3(0, 0, min( 0.4*log(fragPos.w) - 3.9, 1));
- vec3 colorVertex = (1.0-length(uvVertexSpace)) * vec3(0.5);
+ vec3 colorUv = vec3(0.3 * uv.x, 0.3 * uv.y, 0);
+ vec3 colorDistance = vec3(0, 0, min( 0.4 * log(fragPos.w) - 3.9, 1));
+ vec3 colorVertex = (1.0 - length(uvVertexSpace)) * vec3(0.5);
vec3 colorSum = colorUv + colorDistance + colorVertex;
return vec4(0.5 * colorSum, 1);
}
-float tileResolution(vec2 tileUV, const ChunkTile chunkTile){
+float tileResolution(vec2 tileUV, ChunkTile chunkTile) {
vec2 heightResolution = textureSize(chunkTile.textureSampler, 0);
vec2 uv = TileUVToTextureSamplePosition(chunkTile, tileUV);
return gridDots(uv, heightResolution);
}
-vec4 calculateNight(
- const vec4 currentColor,
- const vec2 uv,
- LevelWeights levelWeights,
- const Layer NightLayers[NUMLAYERS_NIGHTTEXTURE],
- const vec3 ellipsoidNormalCameraSpace,
- const vec3 lightDirectionCameraSpace) {
-
- vec4 nightColor = vec4(0,0,0,0);
+vec4 calculateNight(vec4 currentColor, vec2 uv, LevelWeights levelWeights,
+ Layer NightLayers[NUMLAYERS_NIGHTTEXTURE],
+ vec3 ellipsoidNormalCameraSpace,
+ vec3 lightDirectionCameraSpace)
+{
+ vec4 nightColor = vec4(0.0);
vec4 color = currentColor;
// The shader compiler will remove unused code when variables are multiplied by
@@ -343,12 +336,9 @@ vec4 calculateNight(
return color;
}
-vec4 calculateShadedColor(
- const vec4 currentColor,
- const vec3 ellipsoidNormalCameraSpace,
- const vec3 lightDirectionCameraSpace,
- const vec3 viewDirectionCameraSpace,
- float roughness)
+vec4 calculateShadedColor(vec4 currentColor, vec3 ellipsoidNormalCameraSpace,
+ vec3 lightDirectionCameraSpace, vec3 viewDirectionCameraSpace,
+ float roughness)
{
vec3 shadedColor = currentColor.rgb * 0.05;
@@ -367,12 +357,9 @@ vec4 calculateShadedColor(
return color;
}
-vec4 calculateOverlay(
- const vec4 currentColor,
- const vec2 uv,
- LevelWeights levelWeights,
- const Layer Overlays[NUMLAYERS_OVERLAY]) {
-
+vec4 calculateOverlay(vec4 currentColor, vec2 uv, LevelWeights levelWeights,
+ Layer Overlays[NUMLAYERS_OVERLAY])
+{
vec4 color = currentColor;
// The shader compiler will remove unused code when variables are multiplied by
@@ -396,16 +383,12 @@ vec4 calculateOverlay(
return color;
}
-vec4 calculateWater(
- const vec4 currentColor,
- const vec2 uv,
- LevelWeights levelWeights,
- const Layer WaterMasks[NUMLAYERS_WATERMASK],
- const vec3 ellipsoidNormalCameraSpace,
- const vec3 lightDirectionCameraSpace,
- const vec3 positionCameraSpace) {
-
- vec4 waterColor = vec4(0,0,0,0);
+vec4 calculateWater(vec4 currentColor, vec2 uv, LevelWeights levelWeights,
+ Layer WaterMasks[NUMLAYERS_WATERMASK],
+ vec3 ellipsoidNormalCameraSpace,
+ vec3 lightDirectionCameraSpace, vec3 positionCameraSpace)
+{
+ vec4 waterColor = vec4(0.0);
// The shader compiler will remove unused code when variables are multiplied by
// a constant 0
diff --git a/modules/globebrowsing/shaders/tile.hglsl b/modules/globebrowsing/shaders/tile.hglsl
index ac56c8fcb8..d7060b0880 100644
--- a/modules/globebrowsing/shaders/tile.hglsl
+++ b/modules/globebrowsing/shaders/tile.hglsl
@@ -49,11 +49,11 @@ struct TileDepthTransform {
float depthOffset;
};
-float getTransformedTexVal(const TileDepthTransform transform, const float val) {
+float getTransformedTexVal(TileDepthTransform transform, float val) {
return transform.depthOffset + transform.depthScale * val;
}
-vec4 getTransformedTexVal(const TileDepthTransform transform, const vec4 val) {
+vec4 getTransformedTexVal(TileDepthTransform transform, vec4 val) {
return transform.depthOffset + transform.depthScale * val;
}
@@ -77,18 +77,18 @@ struct ChunkTile {
TileUvTransform uvTransform;
};
-vec2 compensateSourceTextureSampling(vec2 startOffset, vec2 sizeDiff,
- const ChunkTile chunkTile, vec2 tileUV)
+vec2 compensateSourceTextureSampling(vec2 startOffset, vec2 sizeDiff, ChunkTile chunkTile,
+ vec2 tileUV)
{
- const ivec2 resolution = textureSize(chunkTile.textureSampler, 0);
+ ivec2 resolution = textureSize(chunkTile.textureSampler, 0);
- const vec2 sourceSize = vec2(resolution) + sizeDiff;
- const vec2 currentSize = vec2(resolution);
- const vec2 sourceToCurrentSize = currentSize / sourceSize;
+ vec2 sourceSize = vec2(resolution) + sizeDiff;
+ vec2 currentSize = vec2(resolution);
+ vec2 sourceToCurrentSize = currentSize / sourceSize;
return sourceToCurrentSize * (tileUV - startOffset / sourceSize);
}
-vec2 TileUVToTextureSamplePosition(const ChunkTile chunkTile, vec2 tileUV) {
+vec2 TileUVToTextureSamplePosition(ChunkTile chunkTile, vec2 tileUV) {
vec2 uv = chunkTile.uvTransform.uvOffset + chunkTile.uvTransform.uvScale * tileUV;
return compensateSourceTextureSampling(
TILE_PIXEL_START_OFFSET,
@@ -98,7 +98,7 @@ vec2 TileUVToTextureSamplePosition(const ChunkTile chunkTile, vec2 tileUV) {
);
}
-vec4 getTexVal(const ChunkTile chunkTile, vec2 tileUV) {
+vec4 getTexVal(ChunkTile chunkTile, vec2 tileUV) {
return texture(
chunkTile.textureSampler,
TileUVToTextureSamplePosition(chunkTile, tileUV)
@@ -148,8 +148,8 @@ struct LevelWeights {
float getLevelInterpolationParameter(int chunkLevel, float distanceScaleFactor,
float distToVertexOnEllipsoid)
{
- const float projectedScaleFactor = distanceScaleFactor / distToVertexOnEllipsoid;
- const float desiredLevel = log2(projectedScaleFactor);
+ float projectedScaleFactor = distanceScaleFactor / distToVertexOnEllipsoid;
+ float desiredLevel = log2(projectedScaleFactor);
return chunkLevel - desiredLevel;
}
@@ -172,7 +172,7 @@ LevelWeights getDefaultLevelWeights() {
return levelWeights;
}
-vec4 getTexVal(const ChunkTilePile chunkTilePile, const LevelWeights w, const vec2 uv) {
+vec4 getTexVal(ChunkTilePile chunkTilePile, LevelWeights w, vec2 uv) {
return w.w1 * getTexVal(chunkTilePile.chunkTile0, uv) +
w.w2 * getTexVal(chunkTilePile.chunkTile1, uv) +
w.w3 * getTexVal(chunkTilePile.chunkTile2, uv);
diff --git a/modules/globebrowsing/shaders/tilefragcolor.hglsl b/modules/globebrowsing/shaders/tilefragcolor.hglsl
index 7b6119aaa4..8d639fd7c6 100644
--- a/modules/globebrowsing/shaders/tilefragcolor.hglsl
+++ b/modules/globebrowsing/shaders/tilefragcolor.hglsl
@@ -144,9 +144,9 @@ vec4 getTileFragColor() {
#if USE_ATMOSPHERE
// Temporary until the real atmosphere code is here
//color = color + vec4(0.5,0.5,1,0) * 0.3; // Just to see something for now
- const vec3 n = normalize(ellipsoidNormalCameraSpace);
- const vec3 l = lightDirectionCameraSpace;
- const vec3 c = normalize(positionCameraSpace);
+ vec3 n = normalize(ellipsoidNormalCameraSpace);
+ vec3 l = lightDirectionCameraSpace;
+ vec3 c = normalize(positionCameraSpace);
float cosFactor = 1 - clamp(dot(-n * 0.9, c), 0, 1);
cosFactor *= 1.1;
cosFactor -= 0.1;
@@ -154,12 +154,12 @@ vec4 getTileFragColor() {
cosFactor = cosFactor + pow(cosFactor, 5);
const float shadowLight = 0.15;
- const float cosFactorLight = pow(max(dot(-l, n), -shadowLight) + shadowLight, 0.8);
+ float cosFactorLight = pow(max(dot(-l, n), -shadowLight) + shadowLight, 0.8);
//float cosFactorScatter = pow(max(dot(l, n) + shadowLight, 0), 5);
//float cosFactorLight = max(dot(-lightDirectionCameraSpace, normalize(ellipsoidNormalCameraSpace)), 0);
//vec3 r = reflect(l, n);
//float scatteredLight = pow(clamp(dot(-r,c), 0, 1), 20);
- const vec3 atmosphereColor = vec3(0.5, 0.5, 1.0) * 2.0;
+ vec3 atmosphereColor = vec3(0.5, 0.5, 1.0) * 2.0;
color += vec4(atmosphereColor,0) * cosFactor * cosFactorLight * 0.5;
#endif // USE_ATMOSPHERE
diff --git a/modules/globebrowsing/shaders/tileheight.hglsl b/modules/globebrowsing/shaders/tileheight.hglsl
index 98f4f0661a..e8436feefe 100644
--- a/modules/globebrowsing/shaders/tileheight.hglsl
+++ b/modules/globebrowsing/shaders/tileheight.hglsl
@@ -100,20 +100,18 @@ vec3 getTileNormal(vec2 uv, LevelWeights levelWeights, vec3 ellipsoidNormalCamer
return ellipsoidNormalCameraSpace;
#if USE_ACCURATE_NORMALS
- const float deltaPhi = mix(deltaPhi0, deltaPhi1, uv.x);
- const float deltaTheta = mix(deltaTheta0, deltaTheta1, uv.y);
+ float deltaPhi = mix(deltaPhi0, deltaPhi1, uv.x);
+ float deltaTheta = mix(deltaTheta0, deltaTheta1, uv.y);
- const vec3 deltaPhiVec = ellipsoidTangentPhiCameraSpace * deltaPhi;
- const vec3 deltaThetaVec = ellipsoidTangentThetaCameraSpace * deltaTheta;
+ vec3 deltaPhiVec = ellipsoidTangentPhiCameraSpace * deltaPhi;
+ vec3 deltaThetaVec = ellipsoidTangentThetaCameraSpace * deltaTheta;
- const float height00 = getTileHeightScaled(uv, levelWeights);
- const float height10 = getTileHeightScaled(uv + vec2(tileDelta, 0.0f), levelWeights);
- const float height01 = getTileHeightScaled(uv + vec2(0.0f, tileDelta), levelWeights);
+ float height00 = getTileHeightScaled(uv, levelWeights);
+ float height10 = getTileHeightScaled(uv + vec2(tileDelta, 0.0f), levelWeights);
+ float height01 = getTileHeightScaled(uv + vec2(0.0f, tileDelta), levelWeights);
- const vec3 diffTheta =
- deltaThetaVec + ellipsoidNormalCameraSpace * (height10 - height00);
- const vec3 diffPhi =
- deltaPhiVec + ellipsoidNormalCameraSpace * (height01 - height00);
+ vec3 diffTheta = deltaThetaVec + ellipsoidNormalCameraSpace * (height10 - height00);
+ vec3 diffPhi = deltaPhiVec + ellipsoidNormalCameraSpace * (height01 - height00);
return normalize(cross(diffTheta, diffPhi));
#endif // USE_ACCURATE_NORMALS
diff --git a/modules/globebrowsing/shaders/tilevertexskirt.hglsl b/modules/globebrowsing/shaders/tilevertexskirt.hglsl
index de2aa6b435..9b31c640ae 100644
--- a/modules/globebrowsing/shaders/tilevertexskirt.hglsl
+++ b/modules/globebrowsing/shaders/tilevertexskirt.hglsl
@@ -31,8 +31,8 @@ uniform int xSegments;
uniform float skirtLength;
bool tileVertexIsSkirtVertex() {
- const int vertexIDx = gl_VertexID % (xSegments + 3);
- const int vertexIDy = gl_VertexID / (xSegments + 3);
+ int vertexIDx = gl_VertexID % (xSegments + 3);
+ int vertexIDy = gl_VertexID / (xSegments + 3);
return vertexIDx == 0 || vertexIDy == 0 ||
vertexIDx == (xSegments + 2) || vertexIDy == (xSegments + 2);
}
diff --git a/modules/globebrowsing/tile/rawtiledatareader/gdalwrapper.cpp b/modules/globebrowsing/tile/rawtiledatareader/gdalwrapper.cpp
index ce50ee17cd..e66cc3c2a0 100644
--- a/modules/globebrowsing/tile/rawtiledatareader/gdalwrapper.cpp
+++ b/modules/globebrowsing/tile/rawtiledatareader/gdalwrapper.cpp
@@ -109,7 +109,7 @@ bool GdalWrapper::logGdalErrors() const {
}
GdalWrapper::GdalWrapper(size_t maximumCacheSize, size_t maximumMaximumCacheSize)
- : PropertyOwner("GdalWrapper")
+ : PropertyOwner({ "GdalWrapper" })
, _logGdalErrors(LogGdalErrorInfo, true)
, _gdalMaximumCacheSize (
GdalMaximumCacheInfo,
diff --git a/modules/globebrowsing/tile/tileprovider/tileprovider.cpp b/modules/globebrowsing/tile/tileprovider/tileprovider.cpp
index a230f278d4..eb0f4a1571 100644
--- a/modules/globebrowsing/tile/tileprovider/tileprovider.cpp
+++ b/modules/globebrowsing/tile/tileprovider/tileprovider.cpp
@@ -52,7 +52,7 @@ std::unique_ptr TileProvider::createFromDictionary(
}
TileProvider::TileProvider()
- : properties::PropertyOwner("tileProvider")
+ : properties::PropertyOwner({ "tileProvider" })
, _initialized(false)
, _defaultTile(nullptr, nullptr, Tile::Status::Unavailable)
{
@@ -60,7 +60,7 @@ TileProvider::TileProvider()
}
TileProvider::TileProvider(const ghoul::Dictionary&)
- : properties::PropertyOwner("tileProvider")
+ : properties::PropertyOwner({ "tileProvider" })
, _initialized(false)
, _defaultTile(nullptr, nullptr, Tile::Status::Unavailable)
{
diff --git a/modules/iswa/rendering/dataplane.cpp b/modules/iswa/rendering/dataplane.cpp
index 10823897e0..51848ae93b 100644
--- a/modules/iswa/rendering/dataplane.cpp
+++ b/modules/iswa/rendering/dataplane.cpp
@@ -43,20 +43,20 @@ DataPlane::DataPlane(const ghoul::Dictionary& dictionary)
DataPlane::~DataPlane(){}
-bool DataPlane::initialize(){
+void DataPlane::initialize() {
IswaCygnet::initialize();
- if(_group){
+ if (_group) {
_dataProcessor = _group->dataProcessor();
subscribeToGroup();
- }else{
+ } else {
_dataProcessor = std::make_shared();
//If autofiler is on, background values property should be hidden
- _autoFilter.onChange([this](){
+ _autoFilter.onChange([this]() {
// If autofiler is selected, use _dataProcessor to set backgroundValues
// and unregister backgroundvalues property.
- if(_autoFilter.value()){
+ if (_autoFilter.value()) {
_backgroundValues.setValue(_dataProcessor->filterValues());
_backgroundValues.setVisibility(properties::Property::Visibility::Hidden);
//_backgroundValues.setVisible(false);
@@ -73,8 +73,6 @@ bool DataPlane::initialize(){
setPropertyCallbacks();
_autoFilter.setValue(true);
-
- return true;
}
bool DataPlane::createGeometry() {
diff --git a/modules/iswa/rendering/dataplane.h b/modules/iswa/rendering/dataplane.h
index 149ba8f2d2..960d0db7b4 100644
--- a/modules/iswa/rendering/dataplane.h
+++ b/modules/iswa/rendering/dataplane.h
@@ -40,7 +40,7 @@ public:
DataPlane(const ghoul::Dictionary& dictionary);
~DataPlane();
- bool initialize() override;
+ void initialize() override;
private:
diff --git a/modules/iswa/rendering/datasphere.cpp b/modules/iswa/rendering/datasphere.cpp
index 652fbfa566..527e191674 100644
--- a/modules/iswa/rendering/datasphere.cpp
+++ b/modules/iswa/rendering/datasphere.cpp
@@ -54,22 +54,22 @@ DataSphere::DataSphere(const ghoul::Dictionary& dictionary)
DataSphere::~DataSphere() {}
-bool DataSphere::initialize() {
+void DataSphere::initialize() {
IswaCygnet::initialize();
//rotate 90 degrees because of the texture coordinates in PowerScaledSphere
_rotation = glm::rotate(_rotation, (float)M_PI_2, glm::vec3(1.0, 0.0, 0.0));
- if(_group){
+ if (_group) {
_dataProcessor = _group->dataProcessor();
subscribeToGroup();
- }else{
+ } else {
_dataProcessor = std::make_shared();
//If autofiler is on, background values property should be hidden
- _autoFilter.onChange([this](){
+ _autoFilter.onChange([this]() {
// If autofiler is selected, use _dataProcessor to set backgroundValues
// and unregister backgroundvalues property.
- if(_autoFilter.value()){
+ if (_autoFilter.value()) {
_backgroundValues.setValue(_dataProcessor->filterValues());
_backgroundValues.setVisibility(properties::Property::Visibility::Hidden);
//_backgroundValues.setVisible(false);
@@ -86,8 +86,6 @@ bool DataSphere::initialize() {
setPropertyCallbacks();
_useHistogram.setValue(true);
_autoFilter.setValue(true);
-
- return true;
}
bool DataSphere::createGeometry() {
diff --git a/modules/iswa/rendering/datasphere.h b/modules/iswa/rendering/datasphere.h
index 7387df9d01..dff23ca92e 100644
--- a/modules/iswa/rendering/datasphere.h
+++ b/modules/iswa/rendering/datasphere.h
@@ -41,7 +41,7 @@ public:
DataSphere(const ghoul::Dictionary& dictionary);
~DataSphere();
- bool initialize() override;
+ void initialize() override;
protected:
/**
diff --git a/modules/iswa/rendering/iswabasegroup.cpp b/modules/iswa/rendering/iswabasegroup.cpp
index db2c08d102..ba8bc5b570 100644
--- a/modules/iswa/rendering/iswabasegroup.cpp
+++ b/modules/iswa/rendering/iswabasegroup.cpp
@@ -62,7 +62,7 @@ namespace {
namespace openspace {
IswaBaseGroup::IswaBaseGroup(std::string name, std::string type)
- : properties::PropertyOwner(std::move(name))
+ : properties::PropertyOwner({ std::move(name) })
, _enabled(EnabledInfo, true)
, _alpha(AlphaInfo, 0.9f, 0.f, 1.f)
, _delete(DeleteInfo)
diff --git a/modules/iswa/rendering/iswacygnet.cpp b/modules/iswa/rendering/iswacygnet.cpp
index 4ad94a72e4..9b31573fd5 100644
--- a/modules/iswa/rendering/iswacygnet.cpp
+++ b/modules/iswa/rendering/iswacygnet.cpp
@@ -116,13 +116,13 @@ IswaCygnet::IswaCygnet(const ghoul::Dictionary& dictionary)
IswaCygnet::~IswaCygnet(){}
-bool IswaCygnet::initialize(){
+void IswaCygnet::initialize() {
_textures.push_back(nullptr);
- if(!_data->groupName.empty()){
+ if (!_data->groupName.empty()) {
initializeGroup();
- }else{
- _delete.onChange([this](){
+ } else {
+ _delete.onChange([this]() {
deinitialize();
OsEng.scriptEngine().queueScript(
"openspace.removeSceneGraphNode('" + name() + "')",
@@ -135,19 +135,16 @@ bool IswaCygnet::initialize(){
createGeometry();
createShader();
downloadTextureResource();
-
- return true;
}
-bool IswaCygnet::deinitialize(){
- if(!_data->groupName.empty())
+void IswaCygnet::deinitialize() {
+ if (!_data->groupName.empty()) {
_group->groupEvent()->unsubscribe(name());
+ }
unregisterProperties();
destroyGeometry();
destroyShader();
-
- return true;
}
bool IswaCygnet::isReady() const{
diff --git a/modules/iswa/rendering/iswacygnet.h b/modules/iswa/rendering/iswacygnet.h
index edbc4a1b5b..581e50855e 100644
--- a/modules/iswa/rendering/iswacygnet.h
+++ b/modules/iswa/rendering/iswacygnet.h
@@ -70,8 +70,8 @@ public:
IswaCygnet(const ghoul::Dictionary& dictionary);
~IswaCygnet();
- virtual bool initialize();
- virtual bool deinitialize();
+ void initialize() override;
+ void deinitialize() override;
virtual bool isReady() const;
void render(const RenderData& data, RendererTasks& rendererTask);
void update(const UpdateData& data);
diff --git a/modules/iswa/rendering/kameleonplane.cpp b/modules/iswa/rendering/kameleonplane.cpp
index 03d25aea2b..03e8d4d2dd 100644
--- a/modules/iswa/rendering/kameleonplane.cpp
+++ b/modules/iswa/rendering/kameleonplane.cpp
@@ -100,15 +100,13 @@ KameleonPlane::KameleonPlane(const ghoul::Dictionary& dictionary)
KameleonPlane::~KameleonPlane() {}
-bool KameleonPlane::deinitialize() {
+void KameleonPlane::deinitialize() {
IswaCygnet::deinitialize();
_fieldlines.set(std::vector());
- return true;
}
-bool KameleonPlane::initialize(){
-
- if(!_data->groupName.empty()){
+void KameleonPlane::initialize() {
+ if (!_data->groupName.empty()) {
initializeGroup();
}
@@ -174,8 +172,6 @@ bool KameleonPlane::initialize(){
_group->updateGroup();
}
updateTextureResource();
-
- return true;
}
bool KameleonPlane::createGeometry() {
diff --git a/modules/iswa/rendering/kameleonplane.h b/modules/iswa/rendering/kameleonplane.h
index 4b6be6c4c3..30f50f1bba 100644
--- a/modules/iswa/rendering/kameleonplane.h
+++ b/modules/iswa/rendering/kameleonplane.h
@@ -43,8 +43,8 @@ public:
KameleonPlane(const ghoul::Dictionary& dictionary);
~KameleonPlane();
- bool initialize() override;
- bool deinitialize() override;
+ void initialize() override;
+ void deinitialize() override;
private:
diff --git a/modules/iswa/shaders/dataplane_fs.glsl b/modules/iswa/shaders/dataplane_fs.glsl
index 6da931cd31..0fe897c252 100644
--- a/modules/iswa/shaders/dataplane_fs.glsl
+++ b/modules/iswa/shaders/dataplane_fs.glsl
@@ -41,11 +41,11 @@ const vec4 Transparent = vec4(0.0);
Fragment getFragment() {
vec4 position = vs_position;
- const float depth = pscDepth(position);
+ float depth = pscDepth(position);
vec4 diffuse = Transparent;
- const float x = backgroundValues.x;
- const float y = backgroundValues.y;
+ float x = backgroundValues.x;
+ float y = backgroundValues.y;
if (numTextures > 0) {
if ((numTransferFunctions == 1) || (numTextures > numTransferFunctions)) {
diff --git a/modules/iswa/shaders/datasphere_fs.glsl b/modules/iswa/shaders/datasphere_fs.glsl
index 9a2e661a38..d4015e2fe4 100644
--- a/modules/iswa/shaders/datasphere_fs.glsl
+++ b/modules/iswa/shaders/datasphere_fs.glsl
@@ -43,11 +43,11 @@ const vec4 Transparent = vec4(0.0);
Fragment getFragment() {
vec4 position = vs_position;
- const float depth = pscDepth(position);
+ float depth = pscDepth(position);
vec4 diffuse = Transparent;
- const float x = backgroundValues.x;
- const float y = backgroundValues.y;
+ float x = backgroundValues.x;
+ float y = backgroundValues.y;
if ((numTransferFunctions == 1) || (numTextures > numTransferFunctions)) {
float v = 0;
diff --git a/modules/iswa/shaders/textureplane_fs.glsl b/modules/iswa/shaders/textureplane_fs.glsl
index 4cc4857ac8..5fdf25c92b 100644
--- a/modules/iswa/shaders/textureplane_fs.glsl
+++ b/modules/iswa/shaders/textureplane_fs.glsl
@@ -35,8 +35,8 @@ uniform float transparency;
Fragment getFragment() {
vec4 position = vs_position;
- const float depth = pscDepth(position);
- const vec4 diffuse = texture(texture1, vs_st);
+ float depth = pscDepth(position);
+ vec4 diffuse = texture(texture1, vs_st);
Fragment frag;
frag.color = diffuse * vec4(1.0, 1.0, 1.0, transparency);
diff --git a/modules/iswa/util/iswamanager.cpp b/modules/iswa/util/iswamanager.cpp
index 34c852889d..c5113952f0 100644
--- a/modules/iswa/util/iswamanager.cpp
+++ b/modules/iswa/util/iswamanager.cpp
@@ -57,7 +57,7 @@ namespace {
namespace openspace {
IswaManager::IswaManager()
- : properties::PropertyOwner("IswaManager")
+ : properties::PropertyOwner({ "IswaManager" })
, _iswaEvent()
, _baseUrl("https://iswa-demo-server.herokuapp.com/")
{
diff --git a/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp b/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp
index 9b0a27c389..f5dfc49ae6 100644
--- a/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp
+++ b/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp
@@ -250,7 +250,7 @@ RenderableKameleonVolume::RenderableKameleonVolume(const ghoul::Dictionary& dict
RenderableKameleonVolume::~RenderableKameleonVolume() {}
-bool RenderableKameleonVolume::initialize() {
+void RenderableKameleonVolume::initialize() {
load();
_volumeTexture->uploadTexture();
@@ -305,7 +305,6 @@ bool RenderableKameleonVolume::initialize() {
addProperty(_gridType);
addProperty(_cache);
addPropertySubOwner(_clipPlanes.get());
- return true;
}
void RenderableKameleonVolume::updateRaycasterModelTransform() {
@@ -443,12 +442,11 @@ void RenderableKameleonVolume::storeRaw(const std::string& path) {
writer.write(*_rawVolume);
}
-bool RenderableKameleonVolume::deinitialize() {
+void RenderableKameleonVolume::deinitialize() {
if (_raycaster) {
OsEng.renderEngine().raycasterManager().detachRaycaster(*_raycaster.get());
_raycaster = nullptr;
}
- return true;
}
bool RenderableKameleonVolume::isReady() const {
diff --git a/modules/kameleonvolume/rendering/renderablekameleonvolume.h b/modules/kameleonvolume/rendering/renderablekameleonvolume.h
index bb49de9f6b..35b0f512ec 100644
--- a/modules/kameleonvolume/rendering/renderablekameleonvolume.h
+++ b/modules/kameleonvolume/rendering/renderablekameleonvolume.h
@@ -49,8 +49,8 @@ public:
RenderableKameleonVolume(const ghoul::Dictionary& dictionary);
~RenderableKameleonVolume();
- bool initialize() override;
- bool deinitialize() override;
+ void initialize() override;
+ void deinitialize() override;
bool isReady() const override;
void render(const RenderData& data, RendererTasks& tasks) override;
void update(const UpdateData& data) override;
diff --git a/modules/kameleonvolume/shaders/boundsfs.glsl b/modules/kameleonvolume/shaders/boundsfs.glsl
index b4875b92c9..bff3312952 100644
--- a/modules/kameleonvolume/shaders/boundsfs.glsl
+++ b/modules/kameleonvolume/shaders/boundsfs.glsl
@@ -30,7 +30,7 @@ in vec4 positionCameraSpace;
Fragment getFragment() {
vec4 position = positionCameraSpace;
- const float depth = pscDepth(position);
+ float depth = pscDepth(position);
Fragment frag;
frag.color = vec4(positionLocalSpace.xyz + 0.5, 1.0);
diff --git a/modules/kameleonvolume/shaders/boundsvs.glsl b/modules/kameleonvolume/shaders/boundsvs.glsl
index 962d40741b..60eec613d1 100644
--- a/modules/kameleonvolume/shaders/boundsvs.glsl
+++ b/modules/kameleonvolume/shaders/boundsvs.glsl
@@ -39,8 +39,8 @@ void main() {
positionLocalSpace = vec4(vertPosition, 1.0);
positionCameraSpace = modelViewTransform * positionLocalSpace;
- const vec4 positionClipSpace = projectionTransform * positionCameraSpace;
- const vec4 positionScreenSpace = z_normalization(positionClipSpace);
+ vec4 positionClipSpace = projectionTransform * positionCameraSpace;
+ vec4 positionScreenSpace = z_normalization(positionClipSpace);
gl_Position = positionScreenSpace;
}
diff --git a/modules/kameleonvolume/shaders/helper.glsl b/modules/kameleonvolume/shaders/helper.glsl
index cf1e5bd5e6..30c3a73449 100644
--- a/modules/kameleonvolume/shaders/helper.glsl
+++ b/modules/kameleonvolume/shaders/helper.glsl
@@ -27,9 +27,9 @@
vec3 kameleon_cartesianToSpherical(vec3 zeroToOneCoords) {
// Put cartesian in [-1..1] range first
- const vec3 cartesian = vec3(-1.0,-1.0,-1.0) + zeroToOneCoords * 2.0f;
+ vec3 cartesian = vec3(-1.0,-1.0,-1.0) + zeroToOneCoords * 2.0f;
- const float r = length(cartesian);
+ float r = length(cartesian);
float theta = 0.0;
float phi = 0.0;
diff --git a/modules/kameleonvolume/shaders/raycast.glsl b/modules/kameleonvolume/shaders/raycast.glsl
index 5e009d4463..54a0bf77d1 100644
--- a/modules/kameleonvolume/shaders/raycast.glsl
+++ b/modules/kameleonvolume/shaders/raycast.glsl
@@ -42,19 +42,19 @@ void sample#{id}(vec3 samplePos, vec3 dir, inout vec3 accumulatedColor,
}
float clipAlpha = 1.0;
- const vec3 centerToPos = transformedPos - vec3(0.5);
+ vec3 centerToPos = transformedPos - vec3(0.5);
for (int i = 0; i < nClips_#{id} && i < 8; i++) {
- const vec3 clipNormal = clipNormals_#{id}[i];
- const float clipBegin = clipOffsets_#{id}[i].x;
- const float clipEnd = clipBegin + clipOffsets_#{id}[i].y;
+ vec3 clipNormal = clipNormals_#{id}[i];
+ float clipBegin = clipOffsets_#{id}[i].x;
+ float clipEnd = clipBegin + clipOffsets_#{id}[i].y;
clipAlpha *= smoothstep(clipBegin, clipEnd, dot(centerToPos, clipNormal));
}
if (clipAlpha > 0) {
- const float val = texture(volumeTexture_#{id}, transformedPos).r;
- const vec4 color = texture(transferFunction_#{id}, val);
+ float val = texture(volumeTexture_#{id}, transformedPos).r;
+ vec4 color = texture(transferFunction_#{id}, val);
vec3 backColor = color.rgb;
vec3 backAlpha = color.aaa;
@@ -64,7 +64,7 @@ void sample#{id}(vec3 samplePos, vec3 dir, inout vec3 accumulatedColor,
backColor = clamp(backColor, 0.0, 1.0);
backAlpha = clamp(backAlpha, 0.0, 1.0);
- const vec3 oneMinusFrontAlpha = vec3(1.0) - accumulatedAlpha;
+ vec3 oneMinusFrontAlpha = vec3(1.0) - accumulatedAlpha;
accumulatedColor += oneMinusFrontAlpha * backColor;
accumulatedAlpha += oneMinusFrontAlpha * backAlpha;
}
diff --git a/modules/kameleonvolume/tasks/kameleondocumentationtask.cpp b/modules/kameleonvolume/tasks/kameleondocumentationtask.cpp
index 3de805b347..7ced53033f 100644
--- a/modules/kameleonvolume/tasks/kameleondocumentationtask.cpp
+++ b/modules/kameleonvolume/tasks/kameleondocumentationtask.cpp
@@ -145,16 +145,19 @@ documentation::Documentation KameleonDocumentationTask::documentation() {
{
"Type",
new StringEqualVerifier("KameleonDocumentationTask"),
+ Optional::No,
"The type of this task"
},
{
KeyInput,
new StringAnnotationVerifier("A file path to a cdf file"),
+ Optional::No,
"The cdf file to extract data from"
},
{
KeyOutput,
new StringAnnotationVerifier("A valid filepath"),
+ Optional::No,
"The html file to write documentation to"
}
}
diff --git a/modules/kameleonvolume/tasks/kameleonmetadatatojsontask.cpp b/modules/kameleonvolume/tasks/kameleonmetadatatojsontask.cpp
index 536301af87..75309f32cf 100644
--- a/modules/kameleonvolume/tasks/kameleonmetadatatojsontask.cpp
+++ b/modules/kameleonvolume/tasks/kameleonmetadatatojsontask.cpp
@@ -79,16 +79,19 @@ documentation::Documentation KameleonMetadataToJsonTask::documentation() {
{
"Type",
new StringEqualVerifier("KameleonMetadataToJsonTask"),
+ Optional::No,
"The type of this task"
},
{
KeyInput,
new StringAnnotationVerifier("A file path to a cdf file"),
+ Optional::No,
"The cdf file to extract data from"
},
{
KeyOutput,
new StringAnnotationVerifier("A valid filepath"),
+ Optional::No,
"The json file to export data into"
}
}
diff --git a/modules/multiresvolume/rendering/renderablemultiresvolume.cpp b/modules/multiresvolume/rendering/renderablemultiresvolume.cpp
index 090e5c4b70..98cb29d764 100644
--- a/modules/multiresvolume/rendering/renderablemultiresvolume.cpp
+++ b/modules/multiresvolume/rendering/renderablemultiresvolume.cpp
@@ -419,8 +419,7 @@ bool RenderableMultiresVolume::setSelectorType(Selector selector) {
return false;
}
-bool RenderableMultiresVolume::initialize() {
-
+void RenderableMultiresVolume::initialize() {
bool success = _tsp && _tsp->load();
unsigned int maxNumBricks = _tsp->header().xNumBricks_ * _tsp->header().yNumBricks_ * _tsp->header().zNumBricks_;
@@ -477,20 +476,20 @@ bool RenderableMultiresVolume::initialize() {
onEnabledChange(onChange);
- return success;
+ if (!success) {
+ throw ghoul::RuntimeError("Error during initialization");
+ }
}
-bool RenderableMultiresVolume::deinitialize() {
+void RenderableMultiresVolume::deinitialize() {
_tsp = nullptr;
_transferFunction = nullptr;
- return true;
}
bool RenderableMultiresVolume::isReady() const {
return true;
}
-
bool RenderableMultiresVolume::initializeSelector() {
int nHistograms = 50;
bool success = true;
diff --git a/modules/multiresvolume/rendering/renderablemultiresvolume.h b/modules/multiresvolume/rendering/renderablemultiresvolume.h
index fc86c139ee..0127002d47 100644
--- a/modules/multiresvolume/rendering/renderablemultiresvolume.h
+++ b/modules/multiresvolume/rendering/renderablemultiresvolume.h
@@ -68,8 +68,8 @@ public:
bool setSelectorType(Selector selector);
bool initializeSelector();
- bool initialize() override;
- bool deinitialize() override;
+ void initialize() override;
+ void deinitialize() override;
bool isReady() const override;
diff --git a/modules/multiresvolume/shaders/boundsFs.glsl b/modules/multiresvolume/shaders/boundsFs.glsl
index f75ad12ebe..d53ea7e6d1 100644
--- a/modules/multiresvolume/shaders/boundsFs.glsl
+++ b/modules/multiresvolume/shaders/boundsFs.glsl
@@ -30,8 +30,8 @@ in vec4 worldPosition;
Fragment getFragment() {
- const vec4 position = worldPosition;
- const float depth = pscDepth(position);
+ vec4 position = worldPosition;
+ float depth = pscDepth(position);
Fragment frag;
frag.color = vec4(vPosition + 0.5, 1.0);
diff --git a/modules/multiresvolume/shaders/raycast.glsl b/modules/multiresvolume/shaders/raycast.glsl
index 4c777f6bc9..52efcede6e 100644
--- a/modules/multiresvolume/shaders/raycast.glsl
+++ b/modules/multiresvolume/shaders/raycast.glsl
@@ -39,32 +39,32 @@ uniform float stepSizeCoefficient_#{id} = 1.0;
void atlasMapDataFunction_#{id}(ivec3 brickCoords, inout uint atlasIntCoord,
inout uint level)
{
- const int linearBrickCoord = multires_intCoord(
+ int linearBrickCoord = multires_intCoord(
brickCoords,
ivec3(maxNumBricksPerAxis_#{id})
);
- const uint mapData = atlasMap_#{id}[linearBrickCoord];
+ uint mapData = atlasMap_#{id}[linearBrickCoord];
level = mapData >> 28;
atlasIntCoord = mapData & 0x0FFFFFFF;
}
vec3 atlasCoordsFunction_#{id}(vec3 position) {
- const uint maxNumBricksPerAxis = maxNumBricksPerAxis_#{id};
- const uint paddedBrickDim = paddedBrickDim_#{id};
+ uint maxNumBricksPerAxis = maxNumBricksPerAxis_#{id};
+ uint paddedBrickDim = paddedBrickDim_#{id};
- const ivec3 brickCoords = ivec3(position * maxNumBricksPerAxis);
+ ivec3 brickCoords = ivec3(position * maxNumBricksPerAxis);
uint atlasIntCoord;
uint level;
atlasMapDataFunction_#{id}(brickCoords, atlasIntCoord, level);
- const float levelDim = float(maxNumBricksPerAxis) / pow(2.0, level);
- const vec3 inBrickCoords = mod(position * levelDim, 1.0);
+ float levelDim = float(maxNumBricksPerAxis) / pow(2.0, level);
+ vec3 inBrickCoords = mod(position * levelDim, 1.0);
- const float scale = float(paddedBrickDim) - 2.0;
- const vec3 paddedInBrickCoords = (1.0 + inBrickCoords * scale) / paddedBrickDim;
+ float scale = float(paddedBrickDim) - 2.0;
+ vec3 paddedInBrickCoords = (1.0 + inBrickCoords * scale) / paddedBrickDim;
- const ivec3 numBricksInAtlas = ivec3(vec3(atlasSize_#{id}) / paddedBrickDim);
- const vec3 atlasOffset = multires_vec3Coords(atlasIntCoord, numBricksInAtlas);
+ ivec3 numBricksInAtlas = ivec3(vec3(atlasSize_#{id}) / paddedBrickDim);
+ vec3 atlasOffset = multires_vec3Coords(atlasIntCoord, numBricksInAtlas);
return (atlasOffset + paddedInBrickCoords) / vec3(numBricksInAtlas);
}
@@ -88,10 +88,10 @@ void sample#{id}(vec3 samplePos, vec3 dir, inout vec3 accumulatedColor,
if (gridType_#{id} == 1) {
samplePos = multires_cartesianToSpherical(samplePos);
}
- const vec3 sampleCoords = atlasCoordsFunction_#{id}(samplePos);
+ vec3 sampleCoords = atlasCoordsFunction_#{id}(samplePos);
//return vec4(sampleCoords, 1.0);
//sampleCoords = vec3(1.0,0.0, 0.0);
- const float intensity = texture(textureAtlas_#{id}, sampleCoords).x;
+ float intensity = texture(textureAtlas_#{id}, sampleCoords).x;
//intensity = sampleCoords;
maxStepSize = stepSizeCoefficient_#{id}/float(maxNumBricksPerAxis_#{id})/float(paddedBrickDim_#{id});
//return vec4(vec3(intensity), 1.0);
@@ -107,7 +107,7 @@ void sample#{id}(vec3 samplePos, vec3 dir, inout vec3 accumulatedColor,
//maxStepSize = 0.01;
- const vec3 oneMinusFrontAlpha = vec3(1.0) - accumulatedAlpha;
+ vec3 oneMinusFrontAlpha = vec3(1.0) - accumulatedAlpha;
accumulatedColor += oneMinusFrontAlpha * contribution.rgb * contribution.a;
accumulatedAlpha += oneMinusFrontAlpha * vec3(contribution.a);
} else {
diff --git a/modules/newhorizons/rendering/renderablecrawlingline.cpp b/modules/newhorizons/rendering/renderablecrawlingline.cpp
index a4516d0e1c..b1767b3c5b 100644
--- a/modules/newhorizons/rendering/renderablecrawlingline.cpp
+++ b/modules/newhorizons/rendering/renderablecrawlingline.cpp
@@ -61,46 +61,43 @@ documentation::Documentation RenderableCrawlingLine::Documentation() {
{
KeySource,
new StringVerifier,
+ Optional::No,
"Denotes the SPICE name of the source of the renderable crawling line, "
- "for example, the space craft",
- Optional::No
+ "for example, the space craft"
},
{
KeyTarget,
new StringVerifier,
- "Denotes the SPICE name of the target of the crawling line",
- Optional::Yes
+ Optional::Yes,
+ "Denotes the SPICE name of the target of the crawling line"
},
{
KeyInstrument,
new StringVerifier,
+ Optional::No,
"Denotes the SPICE name of the instrument that is used to render the "
- "crawling line",
- Optional::No
+ "crawling line"
},
{
KeyColor,
new TableVerifier({
{
- {
- KeyColorStart,
- new DoubleVector4Verifier,
- "The color at the start of the line",
- Optional::No
- },
- {
- KeyColorEnd,
- new DoubleVector4Verifier,
- "The color at the end of the line",
- Optional::No
- }
+ KeyColorStart,
+ new DoubleVector4Verifier,
+ Optional::No,
+ "The color at the start of the line",
},
- Exhaustive::Yes
+ {
+ KeyColorEnd,
+ new DoubleVector4Verifier,
+ Optional::No,
+ "The color at the end of the line"
+ }
}),
+ Optional::No,
"Specifies the colors that are used for the crawling line. One value "
"determines the starting color of the line, the second value is the "
- "color at the end of the line.",
- Optional::No
+ "color at the end of the line."
}
}
};
@@ -138,7 +135,7 @@ bool RenderableCrawlingLine::isReady() const {
return (_program != nullptr);
}
-bool RenderableCrawlingLine::initialize() {
+void RenderableCrawlingLine::initialize() {
RenderEngine& renderEngine = OsEng.renderEngine();
_program = renderEngine.buildRenderProgram(
"RenderableCrawlingLine",
@@ -167,11 +164,9 @@ bool RenderableCrawlingLine::initialize() {
);
glBindVertexArray(0);
-
- return true;
}
-bool RenderableCrawlingLine::deinitialize(){
+void RenderableCrawlingLine::deinitialize(){
glDeleteVertexArrays(1, &_vao);
_vao = 0;
glDeleteBuffers(1, &_vbo);
@@ -182,8 +177,6 @@ bool RenderableCrawlingLine::deinitialize(){
renderEngine.removeRenderProgram(_program);
_program = nullptr;
}
-
- return true;
}
void RenderableCrawlingLine::render(const RenderData& data, RendererTasks&) {
diff --git a/modules/newhorizons/rendering/renderablecrawlingline.h b/modules/newhorizons/rendering/renderablecrawlingline.h
index c34129f26a..0700f8098a 100644
--- a/modules/newhorizons/rendering/renderablecrawlingline.h
+++ b/modules/newhorizons/rendering/renderablecrawlingline.h
@@ -38,8 +38,8 @@ class RenderableCrawlingLine : public Renderable {
public:
RenderableCrawlingLine(const ghoul::Dictionary& dictionary);
- bool initialize() override;
- bool deinitialize() override;
+ void initialize() override;
+ void deinitialize() override;
bool isReady() const override;
diff --git a/modules/newhorizons/rendering/renderablefov.cpp b/modules/newhorizons/rendering/renderablefov.cpp
index e830715a20..34f29bd58c 100644
--- a/modules/newhorizons/rendering/renderablefov.cpp
+++ b/modules/newhorizons/rendering/renderablefov.cpp
@@ -143,16 +143,16 @@ documentation::Documentation RenderableFov::Documentation() {
{
KeyBody,
new StringVerifier,
+ Optional::No,
"The SPICE name of the source body for which the field of view should be "
- "rendered.",
- Optional::No
+ "rendered."
},
{
KeyFrame,
new StringVerifier,
+ Optional::No,
"The SPICE name of the source body's frame in which the field of view "
- "should be rendered.",
- Optional::No
+ "should be rendered."
},
{
KeyInstrument,
@@ -160,8 +160,8 @@ documentation::Documentation RenderableFov::Documentation() {
{
KeyInstrumentName,
new StringVerifier,
- "The SPICE name of the instrument that is rendered",
- Optional::No
+ Optional::No,
+ "The SPICE name of the instrument that is rendered"
},
{
KeyInstrumentAberration,
@@ -173,45 +173,46 @@ documentation::Documentation RenderableFov::Documentation() {
"XLT", "XLT+S",
"XCN", "XCN+S"
}),
+ Optional::Yes,
"The aberration correction that is used for this field of view. "
- "The default is 'NONE'.",
- Optional::Yes
+ "The default is 'NONE'."
}
}),
+ Optional::No,
"A table describing the instrument whose field of view should be "
- "rendered.",
- Optional::No
+ "rendered."
},
{
KeyPotentialTargets,
new StringListVerifier,
+ Optional::No,
"A list of potential targets (specified as SPICE names) that the field "
- "of view should be tested against.",
- Optional::No
+ "of view should be tested against."
},
{
KeyFrameConversions,
new TableVerifier({
{
DocumentationEntry::Wildcard,
- new StringVerifier
+ new StringVerifier,
+ Optional::No
}
}),
+ Optional::Yes,
"A list of frame conversions that should be registered with the "
- "SpiceManager.",
- Optional::Yes
+ "SpiceManager."
},
{
LineWidthInfo.identifier,
new DoubleVerifier,
- LineWidthInfo.description,
- Optional::Yes
+ Optional::Yes,
+ LineWidthInfo.description
},
{
StandoffDistanceInfo.identifier,
new DoubleVerifier,
- StandoffDistanceInfo.description,
- Optional::Yes
+ Optional::Yes,
+ StandoffDistanceInfo.description
}
}
};
@@ -296,7 +297,7 @@ RenderableFov::RenderableFov(const ghoul::Dictionary& dictionary)
addProperty(_colors.square);
}
-bool RenderableFov::initialize() {
+void RenderableFov::initialize() {
RenderEngine& renderEngine = OsEng.renderEngine();
_programObject = renderEngine.buildRenderProgram(
"FovProgram",
@@ -313,8 +314,10 @@ bool RenderableFov::initialize() {
res.shape == SpiceManager::FieldOfViewResult::Shape::Polygon ||
res.shape == SpiceManager::FieldOfViewResult::Shape::Rectangle;
if (!supportedShape) {
- LWARNINGC("RenderableFov", "'" << _instrument.name << "' has unsupported shape");
- return false;
+ throw ghoul::RuntimeError(
+ "'" + _instrument.name + "' has unsupported shape",
+ "RenderableFov"
+ );
}
_instrument.bounds = std::move(res.bounds);
@@ -404,11 +407,9 @@ bool RenderableFov::initialize() {
);
glBindVertexArray(0);
-
- return true;
}
-bool RenderableFov::deinitialize() {
+void RenderableFov::deinitialize() {
OsEng.renderEngine().removeRenderProgram(_programObject);
_programObject = nullptr;
@@ -417,8 +418,6 @@ bool RenderableFov::deinitialize() {
glDeleteBuffers(1, &_fieldOfViewBounds.vbo);
glDeleteVertexArrays(1, &_fieldOfViewBounds.vao);
-
- return true;
}
bool RenderableFov::isReady() const {
diff --git a/modules/newhorizons/rendering/renderablefov.h b/modules/newhorizons/rendering/renderablefov.h
index 4694f0f7c0..6c09c02deb 100644
--- a/modules/newhorizons/rendering/renderablefov.h
+++ b/modules/newhorizons/rendering/renderablefov.h
@@ -49,8 +49,8 @@ class RenderableFov : public Renderable {
public:
RenderableFov(const ghoul::Dictionary& dictionary);
- bool initialize() override;
- bool deinitialize() override;
+ void initialize() override;
+ void deinitialize() override;
bool isReady() const override;
diff --git a/modules/newhorizons/rendering/renderablemodelprojection.cpp b/modules/newhorizons/rendering/renderablemodelprojection.cpp
index 6b023ada05..9a36d22876 100644
--- a/modules/newhorizons/rendering/renderablemodelprojection.cpp
+++ b/modules/newhorizons/rendering/renderablemodelprojection.cpp
@@ -44,21 +44,18 @@
namespace {
const char* _loggerCat = "RenderableModelProjection";
- const char* keySource = "Rotation.Source";
- const char* keyDestination = "Rotation.Destination";
+
const char* keyGeometry = "Geometry";
const char* keyProjection = "Projection";
const char* keyBoundingSphereRadius = "BoundingSphereRadius";
- const char* keyTextureColor = "Textures.Color";
-
- const char* _destination = "GALACTIC";
+ const char* DestinationFrame = "GALACTIC";
static const openspace::properties::Property::PropertyInfo ColorTextureInfo = {
"ColorTexture",
"Color Base Texture",
- "This is the path to a local image file that is used as the base texture for "
- "the model on which the image projections are layered."
+ "This is the path to a local image file that is used as the base texture for the "
+ "model on which the image projections are layered."
};
static const openspace::properties::Property::PropertyInfo PerformShadingInfo = {
@@ -82,41 +79,40 @@ documentation::Documentation RenderableModelProjection::Documentation() {
{
"Type",
new StringEqualVerifier("RenderableModelProjection"),
- "",
Optional::No
},
{
keyGeometry,
new ReferencingVerifier("base_geometry_model"),
- "The geometry that is used for rendering this model.",
- Optional::No
+ Optional::No,
+ "The geometry that is used for rendering this model."
},
{
keyProjection,
new ReferencingVerifier("newhorizons_projectioncomponent"),
- "Contains information about projecting onto this planet.",
- Optional::No
+ Optional::No,
+ "Contains information about projecting onto this planet."
},
{
- keyTextureColor, // @TODO Change to ColorTextureInfo.identifier
+ ColorTextureInfo.identifier,
new StringVerifier,
- ColorTextureInfo.description,
- Optional::No
+ Optional::No,
+ ColorTextureInfo.description
},
{
PerformShadingInfo.identifier,
new BoolVerifier,
- PerformShadingInfo.description,
- Optional::Yes
+ Optional::Yes,
+ PerformShadingInfo.description
},
{
keyBoundingSphereRadius,
new DoubleVerifier,
+ Optional::Yes,
"The radius of the bounding sphere of this object. This has to be a "
"radius that is larger than anything that is rendered by it. It has to "
"be at least as big as the convex hull of the object. The default value "
- "is 10e9 meters.",
- Optional::Yes
+ "is 10e9 meters."
}
}
};
@@ -125,7 +121,6 @@ documentation::Documentation RenderableModelProjection::Documentation() {
RenderableModelProjection::RenderableModelProjection(const ghoul::Dictionary& dictionary)
: Renderable(dictionary)
, _colorTexturePath(ColorTextureInfo)
- , _rotation({ "Rotation", "Rotation", "" }, glm::vec3(0.f), glm::vec3(0.f), glm::vec3(360.f)) // @TODO Remove this property
, _programObject(nullptr)
, _fboProgramObject(nullptr)
, _baseTexture(nullptr)
@@ -150,7 +145,9 @@ RenderableModelProjection::RenderableModelProjection(const ghoul::Dictionary& di
ModelGeometry::createFromDictionary(geometryDictionary)
);
- _colorTexturePath = absPath(dictionary.value(keyTextureColor));
+ _colorTexturePath = absPath(dictionary.value(
+ ColorTextureInfo.identifier
+ ));
addPropertySubOwner(_geometry.get());
addPropertySubOwner(_projectionComponent);
@@ -171,14 +168,11 @@ RenderableModelProjection::RenderableModelProjection(const ghoul::Dictionary& di
}
Renderable::addProperty(_performShading);
- Renderable::addProperty(_rotation);
-}
-
-RenderableModelProjection::~RenderableModelProjection() {
- // This empty method needs to be here in order to use forward declaration with
- // std::unique_ptr
}
+// This empty method needs to be here in order to use forward declaration with
+// std::unique_ptr
+RenderableModelProjection::~RenderableModelProjection() {}
bool RenderableModelProjection::isReady() const {
bool ready = true;
@@ -188,9 +182,7 @@ bool RenderableModelProjection::isReady() const {
return ready;
}
-bool RenderableModelProjection::initialize() {
- bool completeSuccess = true;
-
+void RenderableModelProjection::initialize() {
RenderEngine& renderEngine = OsEng.renderEngine();
_programObject = renderEngine.buildRenderProgram("ModelShader",
"${MODULE_NEWHORIZONS}/shaders/renderableModel_vs.glsl",
@@ -209,19 +201,18 @@ bool RenderableModelProjection::initialize() {
"${MODULE_NEWHORIZONS}/shaders/renderableModelDepth_fs.glsl");
- completeSuccess &= loadTextures();
- completeSuccess &= _projectionComponent.initializeGL();
+ loadTextures();
+ _projectionComponent.initializeGL();
float bs = boundingSphere();
- completeSuccess &= _geometry->initialize(this);
+ _geometry->initialize(this);
setBoundingSphere(bs); // ignore bounding sphere set by geometry.
-
- return completeSuccess;
}
-bool RenderableModelProjection::deinitialize() {
- if (_geometry)
+void RenderableModelProjection::deinitialize() {
+ if (_geometry) {
_geometry->deinitialize();
+ }
_geometry = nullptr;
_baseTexture = nullptr;
@@ -230,8 +221,6 @@ bool RenderableModelProjection::deinitialize() {
OsEng.renderEngine().removeRenderProgram(_programObject);
_programObject = nullptr;
-
- return true;
}
ghoul::opengl::Texture& RenderableModelProjection::baseTexture() const {
@@ -239,13 +228,15 @@ ghoul::opengl::Texture& RenderableModelProjection::baseTexture() const {
}
void RenderableModelProjection::render(const RenderData& data, RendererTasks&) {
- if (_projectionComponent.needsClearProjection())
+ if (_projectionComponent.needsClearProjection()) {
_projectionComponent.clearAllProjections();
+ }
_up = data.camera.lookUpVectorCameraSpace();
- if (_capture && _projectionComponent.doesPerformProjection())
+ if (_capture && _projectionComponent.doesPerformProjection()) {
project();
+ }
_programObject->activate();
@@ -298,8 +289,9 @@ void RenderableModelProjection::update(const UpdateData& data) {
_projectionComponent.update();
- if (_depthFboProgramObject->isDirty())
+ if (_depthFboProgramObject->isDirty()) {
_depthFboProgramObject->rebuildFromFile();
+ }
_time = data.time.j2000Seconds();
@@ -370,52 +362,40 @@ void RenderableModelProjection::imageProjectGPU(
void RenderableModelProjection::attitudeParameters(double time) {
try {
- _instrumentMatrix = SpiceManager::ref().positionTransformMatrix(_projectionComponent.instrumentId(), _destination, time);
+ _instrumentMatrix = SpiceManager::ref().positionTransformMatrix(
+ _projectionComponent.instrumentId(),
+ DestinationFrame,
+ time
+ );
}
catch (const SpiceManager::SpiceException&) {
return;
}
- _transform = glm::mat4(1);
- glm::mat4 rotPropX = glm::rotate(
- _transform,
- glm::radians(static_cast(_rotation.value().x)),
- glm::vec3(1, 0, 0)
- );
- glm::mat4 rotPropY = glm::rotate(
- _transform,
- glm::radians(static_cast(_rotation.value().y)),
- glm::vec3(0, 1, 0)
- );
- glm::mat4 rotPropZ = glm::rotate(
- _transform,
- glm::radians(static_cast(_rotation.value().z)),
- glm::vec3(0, 0, 1)
- );
-
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
_transform[i][j] = static_cast(_stateMatrix[i][j]);
}
}
- _transform = _transform * rotPropX * rotPropY * rotPropZ;
-
glm::dvec3 boresight;
try {
- SpiceManager::FieldOfViewResult res = SpiceManager::ref().fieldOfView(_projectionComponent.instrumentId());
+ SpiceManager::FieldOfViewResult res = SpiceManager::ref().fieldOfView(
+ _projectionComponent.instrumentId()
+ );
boresight = std::move(res.boresightVector);
} catch (const SpiceManager::SpiceException&) {
return;
}
double lightTime;
- glm::dvec3 p =
- SpiceManager::ref().targetPosition(
- _projectionComponent.projectorId(),
- _projectionComponent.projecteeId(),
- _destination,
- _projectionComponent.aberration(),
- time, lightTime);
+ glm::dvec3 p = SpiceManager::ref().targetPosition(
+ _projectionComponent.projectorId(),
+ _projectionComponent.projecteeId(),
+ DestinationFrame,
+ _projectionComponent.aberration(),
+ time, lightTime
+ );
+
psc position = PowerScaledCoordinate::CreatePowerScaledCoordinate(p.x, p.y, p.z);
position[3] += 4;
@@ -434,12 +414,13 @@ void RenderableModelProjection::attitudeParameters(double time) {
);
}
-
-
void RenderableModelProjection::project() {
for (auto img : _imageTimes) {
attitudeParameters(img.timeRange.start);
- auto projTexture = _projectionComponent.loadProjectionTexture(img.path, img.isPlaceholder);
+ auto projTexture = _projectionComponent.loadProjectionTexture(
+ img.path,
+ img.isPlaceholder
+ );
imageProjectGPU(projTexture);
}
_capture = false;
@@ -448,8 +429,9 @@ void RenderableModelProjection::project() {
bool RenderableModelProjection::loadTextures() {
_baseTexture = nullptr;
if (_colorTexturePath.value() != "") {
- _baseTexture = ghoul::io::TextureReader::ref().loadTexture(absPath(_colorTexturePath))
- ;
+ _baseTexture = ghoul::io::TextureReader::ref().loadTexture(
+ absPath(_colorTexturePath)
+ );
if (_baseTexture) {
LDEBUG("Loaded texture from '" << absPath(_colorTexturePath) << "'");
_baseTexture->uploadTexture();
diff --git a/modules/newhorizons/rendering/renderablemodelprojection.h b/modules/newhorizons/rendering/renderablemodelprojection.h
index 1b0cc9b22d..a0bff0abd3 100644
--- a/modules/newhorizons/rendering/renderablemodelprojection.h
+++ b/modules/newhorizons/rendering/renderablemodelprojection.h
@@ -55,8 +55,8 @@ public:
RenderableModelProjection(const ghoul::Dictionary& dictionary);
~RenderableModelProjection();
- bool initialize() override;
- bool deinitialize() override;
+ void initialize() override;
+ void deinitialize() override;
bool isReady() const override;
@@ -78,8 +78,6 @@ private:
properties::StringProperty _colorTexturePath;
- properties::Vec3Property _rotation;
-
std::unique_ptr _programObject;
std::unique_ptr _fboProgramObject;
std::unique_ptr _depthFboProgramObject;
diff --git a/modules/newhorizons/rendering/renderableplaneprojection.cpp b/modules/newhorizons/rendering/renderableplaneprojection.cpp
index 7ac1dbb430..4a69268517 100644
--- a/modules/newhorizons/rendering/renderableplaneprojection.cpp
+++ b/modules/newhorizons/rendering/renderableplaneprojection.cpp
@@ -94,27 +94,23 @@ bool RenderablePlaneProjection::isReady() const {
return _shader && _texture;
}
-bool RenderablePlaneProjection::initialize() {
+void RenderablePlaneProjection::initialize() {
glGenVertexArrays(1, &_quad); // generate array
glGenBuffers(1, &_vertexPositionBuffer); // generate buffer
- // Plane program
- if (_shader == nullptr) {
- // Image Plane Program
- RenderEngine& renderEngine = OsEng.renderEngine();
- _shader = renderEngine.buildRenderProgram("Image Plane",
- "${MODULE_BASE}/shaders/imageplane_vs.glsl",
- "${MODULE_BASE}/shaders/imageplane_fs.glsl");
- if (!_shader)
- return false;
- }
+ // Image Plane Program
+ RenderEngine& renderEngine = OsEng.renderEngine();
+ _shader = renderEngine.buildRenderProgram(
+ "Image Plane",
+ "${MODULE_BASE}/shaders/imageplane_vs.glsl",
+ "${MODULE_BASE}/shaders/imageplane_fs.glsl"
+ );
setTarget(_defaultTarget);
loadTexture();
- return isReady();
}
-bool RenderablePlaneProjection::deinitialize() {
+void RenderablePlaneProjection::deinitialize() {
RenderEngine& renderEngine = OsEng.renderEngine();
if (_shader) {
renderEngine.removeRenderProgram(_shader);
@@ -126,7 +122,6 @@ bool RenderablePlaneProjection::deinitialize() {
glDeleteBuffers(1, &_vertexPositionBuffer);
_vertexPositionBuffer = 0;
_texture = nullptr;
- return true;
}
void RenderablePlaneProjection::render(const RenderData& data, RendererTasks&) {
diff --git a/modules/newhorizons/rendering/renderableplaneprojection.h b/modules/newhorizons/rendering/renderableplaneprojection.h
index c4f7af8557..9cb259e93b 100644
--- a/modules/newhorizons/rendering/renderableplaneprojection.h
+++ b/modules/newhorizons/rendering/renderableplaneprojection.h
@@ -55,8 +55,8 @@ public:
RenderablePlaneProjection(const ghoul::Dictionary& dictionary);
~RenderablePlaneProjection();
- bool initialize() override;
- bool deinitialize() override;
+ void initialize() override;
+ void deinitialize() override;
bool isReady() const override;
diff --git a/modules/newhorizons/rendering/renderableplanetprojection.cpp b/modules/newhorizons/rendering/renderableplanetprojection.cpp
index 62450baa15..9aab0e6bc9 100644
--- a/modules/newhorizons/rendering/renderableplanetprojection.cpp
+++ b/modules/newhorizons/rendering/renderableplanetprojection.cpp
@@ -54,36 +54,27 @@
namespace {
const char* _loggerCat = "RenderablePlanetProjection";
- const char* keyGeometry = "Geometry";
- const char* keyProjection = "Projection";
- const char* keyMeridianShift = "Textures.MeridianShift";
- const char* keyColorTexture = "Textures.Color";
- const char* keyHeightTexture = "Textures.Height";
+ const char* KeyGeometry = "Geometry";
+ const char* KeyProjection = "Projection";
- const char* keyRadius = "Geometry.Radius";
+ const char* KeyRadius = "Geometry.Radius";
// const char* keyShading = "PerformShading";
const char* _mainFrame = "GALACTIC";
static const openspace::properties::Property::PropertyInfo ColorTextureInfo = {
- "PlanetTexture",
+ "ColorTexture",
"Color Base Texture",
"The path to the base color texture that is used on the planet prior to any "
"image projection."
};
static const openspace::properties::Property::PropertyInfo HeightTextureInfo = {
- "HeightMap",
+ "HeightTexture",
"Heightmap Texture",
"The path to the height map texture that is used for the planet. If no height "
"map is specified the planet does not use a height field."
};
- static const openspace::properties::Property::PropertyInfo ShiftMeridianInfo = {
- "ShiftMeridian",
- "Shift Meridian by 180 deg",
- "Shift the position of the meridian by 180 degrees. This value "
- };
-
static const openspace::properties::Property::PropertyInfo HeightExaggerationInfo = {
"HeightExaggeration",
"Height Exaggeration",
@@ -104,45 +95,38 @@ documentation::Documentation RenderablePlanetProjection::Documentation() {
{
"Type",
new StringEqualVerifier("RenderablePlanetProjection"),
- "",
- Optional::No
+ Optional::No,
+ ""
},
{
- keyGeometry,
+ KeyGeometry,
new ReferencingVerifier("space_geometry_planet"),
+ Optional::No,
"The geometry that is used for rendering this planet.",
- Optional::No
},
{
- keyProjection,
+ KeyProjection,
new ReferencingVerifier("newhorizons_projectioncomponent"),
+ Optional::No,
"Contains information about projecting onto this planet.",
- Optional::No
},
{
- keyMeridianShift,
- new BoolVerifier,
- "Determines whether the meridian of the planet should be shifted by 180 "
- "degrees. The default value is 'false'",
- Optional::Yes
- },
- {
- keyColorTexture, // @TODO This should be ColorTextureInfo.identifier
+ ColorTextureInfo.identifier,
new StringVerifier,
- ColorTextureInfo.description,
- Optional::No
+ Optional::No,
+ ColorTextureInfo.description
},
{
- keyHeightTexture, // @TODO This should be HeightTextureInfo.identifier
+ HeightTextureInfo.identifier,
new StringVerifier,
- HeightTextureInfo.description,
- Optional::Yes
+ Optional::Yes,
+ HeightTextureInfo.description
},
{
HeightExaggerationInfo.identifier,
new DoubleVerifier,
- HeightExaggerationInfo.description,
- Optional::Yes
+ Optional::Yes,
+ HeightExaggerationInfo.description
}
}
};
@@ -152,12 +136,10 @@ RenderablePlanetProjection::RenderablePlanetProjection(const ghoul::Dictionary&
: Renderable(dictionary)
, _colorTexturePath(ColorTextureInfo)
, _heightMapTexturePath(HeightTextureInfo)
- , _rotation({ "Rotation", "Rotation", "" }, 0, 0, 360) // @TODO Missing documentation
, _programObject(nullptr)
, _fboProgramObject(nullptr)
, _baseTexture(nullptr)
, _heightMapTexture(nullptr)
- , _shiftMeridianBy180({"asd", "", "" }, false) // @TODO Missing documentation
, _heightExaggeration(HeightExaggerationInfo, 1.f, 0.f, 100.f)
, _capture(false)
{
@@ -172,8 +154,7 @@ RenderablePlanetProjection::RenderablePlanetProjection(const ghoul::Dictionary&
ghoul_assert(success, "");
ghoul::Dictionary geometryDictionary;
- success = dictionary.getValue(
- keyGeometry, geometryDictionary);
+ success = dictionary.getValue(KeyGeometry, geometryDictionary);
if (success) {
geometryDictionary.setValue(SceneGraphNode::KeyName, name);
using planetgeometry::PlanetGeometry;
@@ -182,38 +163,34 @@ RenderablePlanetProjection::RenderablePlanetProjection(const ghoul::Dictionary&
);
}
- _projectionComponent.initialize(dictionary.value(keyProjection));
+ _projectionComponent.initialize(dictionary.value(KeyProjection));
// TODO: textures need to be replaced by a good system similar to the geometry as soon
// as the requirements are fixed (ab)
std::string texturePath = "";
- success = dictionary.getValue("Textures.Color", texturePath);
+ success = dictionary.getValue(ColorTextureInfo.identifier, texturePath);
if (success) {
_colorTexturePath = absPath(texturePath);
}
std::string heightMapPath = "";
- success = dictionary.getValue("Textures.Height", heightMapPath);
+ success = dictionary.getValue(HeightTextureInfo.identifier, heightMapPath);
if (success) {
_heightMapTexturePath = absPath(heightMapPath);
}
- if (dictionary.hasKeyAndValue(keyMeridianShift)) {
- _shiftMeridianBy180 = dictionary.value(keyMeridianShift);
- }
-
float radius = std::pow(10.f, 9.f);
- dictionary.getValue(keyRadius, radius);
+ dictionary.getValue(KeyRadius, radius);
setBoundingSphere(radius);
addPropertySubOwner(_geometry.get());
addPropertySubOwner(_projectionComponent);
addProperty(_colorTexturePath);
- _colorTexturePath.onChange(std::bind(&RenderablePlanetProjection::loadTextures, this));
+ _colorTexturePath.onChange([&]() { loadTextures(); });
addProperty(_heightMapTexturePath);
- _heightMapTexturePath.onChange(std::bind(&RenderablePlanetProjection::loadTextures, this));
+ _heightMapTexturePath.onChange([&]() { loadTextures(); });
if (dictionary.hasKey(HeightExaggerationInfo.identifier)) {
_heightExaggeration = static_cast(
@@ -222,60 +199,54 @@ RenderablePlanetProjection::RenderablePlanetProjection(const ghoul::Dictionary&
}
addProperty(_heightExaggeration);
-
- addProperty(_shiftMeridianBy180);
}
RenderablePlanetProjection::~RenderablePlanetProjection() {}
-bool RenderablePlanetProjection::initialize() {
- bool completeSuccess = true;
-
- _programObject = OsEng.renderEngine().buildRenderProgram("projectiveProgram",
+void RenderablePlanetProjection::initialize() {
+ _programObject = OsEng.renderEngine().buildRenderProgram(
+ "projectiveProgram",
"${MODULE_NEWHORIZONS}/shaders/renderablePlanet_vs.glsl",
"${MODULE_NEWHORIZONS}/shaders/renderablePlanet_fs.glsl"
);
- _fboProgramObject = ghoul::opengl::ProgramObject::Build("fboPassProgram",
+ _fboProgramObject = ghoul::opengl::ProgramObject::Build(
+ "fboPassProgram",
"${MODULE_NEWHORIZONS}/shaders/renderablePlanetProjection_vs.glsl",
"${MODULE_NEWHORIZONS}/shaders/renderablePlanetProjection_fs.glsl"
);
- completeSuccess &= loadTextures();
- completeSuccess &= _projectionComponent.initializeGL();
- completeSuccess &= _geometry->initialize(this);
+ loadTextures();
+ _projectionComponent.initializeGL();
+ _geometry->initialize(this);
- if (completeSuccess) {
- //completeSuccess &= auxiliaryRendertarget();
- // SCREEN-QUAD
- const GLfloat size = 1.f;
- const GLfloat w = 1.f;
- const GLfloat vertex_data[] = {
- -size, -size, 0.f, w, 0.f, 0.f,
- size, size, 0.f, w, 1.f, 1.f,
- -size, size, 0.f, w, 0.f, 1.f,
- -size, -size, 0.f, w, 0.f, 0.f,
- size, -size, 0.f, w, 1.f, 0.f,
- size, size, 0.f, w, 1.f, 1.f,
- };
+ //completeSuccess &= auxiliaryRendertarget();
+ // SCREEN-QUAD
+ const GLfloat size = 1.f;
+ const GLfloat w = 1.f;
+ const GLfloat vertex_data[] = {
+ -size, -size, 0.f, w, 0.f, 0.f,
+ size, size, 0.f, w, 1.f, 1.f,
+ -size, size, 0.f, w, 0.f, 1.f,
+ -size, -size, 0.f, w, 0.f, 0.f,
+ size, -size, 0.f, w, 1.f, 0.f,
+ size, size, 0.f, w, 1.f, 1.f,
+ };
- glGenVertexArrays(1, &_quad);
- glBindVertexArray(_quad);
- glGenBuffers(1, &_vertexPositionBuffer);
- glBindBuffer(GL_ARRAY_BUFFER, _vertexPositionBuffer);
- glBufferData(GL_ARRAY_BUFFER, sizeof(vertex_data), vertex_data, GL_STATIC_DRAW);
- glEnableVertexAttribArray(0);
- glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, sizeof(GLfloat) * 6, reinterpret_cast(0));
- glEnableVertexAttribArray(1);
- glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, sizeof(GLfloat) * 6, reinterpret_cast(sizeof(GLfloat) * 4));
+ glGenVertexArrays(1, &_quad);
+ glBindVertexArray(_quad);
+ glGenBuffers(1, &_vertexPositionBuffer);
+ glBindBuffer(GL_ARRAY_BUFFER, _vertexPositionBuffer);
+ glBufferData(GL_ARRAY_BUFFER, sizeof(vertex_data), vertex_data, GL_STATIC_DRAW);
+ glEnableVertexAttribArray(0);
+ glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, sizeof(GLfloat) * 6, reinterpret_cast(0));
+ glEnableVertexAttribArray(1);
+ glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, sizeof(GLfloat) * 6, reinterpret_cast(sizeof(GLfloat) * 4));
- glBindVertexArray(0);
- }
-
- return completeSuccess;
+ glBindVertexArray(0);
}
-bool RenderablePlanetProjection::deinitialize() {
+void RenderablePlanetProjection::deinitialize() {
_projectionComponent.deinitialize();
_baseTexture = nullptr;
_geometry = nullptr;
@@ -287,9 +258,8 @@ bool RenderablePlanetProjection::deinitialize() {
_programObject = nullptr;
_fboProgramObject = nullptr;
-
- return true;
}
+
bool RenderablePlanetProjection::isReady() const {
return _geometry && _programObject && _baseTexture && _projectionComponent.isReady();
}
@@ -311,17 +281,17 @@ void RenderablePlanetProjection::imageProjectGPU(
_fboProgramObject->setUniform("_scaling" , _camScaling);
_fboProgramObject->setUniform("boresight" , _boresight);
- if (_geometry->hasProperty("radius")){
- ghoul::any r = _geometry->property("radius")->get();
+ if (_geometry->hasProperty("Radius")){
+ ghoul::any r = _geometry->property("Radius")->get();
if (glm::vec3* radius = ghoul::any_cast(&r)){
_fboProgramObject->setUniform("_radius", radius);
}
- }else{
+ } else {
LERROR("Geometry object needs to provide radius");
}
- if (_geometry->hasProperty("segments")){
- ghoul::any s = _geometry->property("segments")->get();
- if (int* segments = ghoul::any_cast(&s)){
+ if (_geometry->hasProperty("Segments")) {
+ ghoul::any s = _geometry->property("Segments")->get();
+ if (int* segments = ghoul::any_cast(&s)) {
_fboProgramObject->setUniform("_segments", segments[0]);
}
}else{
@@ -353,13 +323,8 @@ void RenderablePlanetProjection::attitudeParameters(double time) {
static_cast(M_PI_2),
glm::vec3(0, -1, 0)
);
- glm::mat4 rotProp = glm::rotate(
- _transform,
- static_cast(glm::radians(static_cast(_rotation))),
- glm::vec3(0, 1, 0)
- );
- _transform = glm::mat4(_stateMatrix) * rot * roty * rotProp;
+ _transform = glm::mat4(_stateMatrix) * rot * roty;
glm::dvec3 bs;
try {
@@ -465,8 +430,6 @@ void RenderablePlanetProjection::render(const RenderData& data, RendererTasks&)
//setPscUniforms(*_programObject.get(), data.camera, data.position);
- _programObject->setUniform("shiftMeridian", _shiftMeridianBy180);
-
ghoul::opengl::TextureUnit unit[3];
unit[0].activate();
_baseTexture->bind();
diff --git a/modules/newhorizons/rendering/renderableplanetprojection.h b/modules/newhorizons/rendering/renderableplanetprojection.h
index ee131fdcb4..eaafec317a 100644
--- a/modules/newhorizons/rendering/renderableplanetprojection.h
+++ b/modules/newhorizons/rendering/renderableplanetprojection.h
@@ -44,8 +44,8 @@ public:
RenderablePlanetProjection(const ghoul::Dictionary& dictionary);
~RenderablePlanetProjection();
- bool initialize() override;
- bool deinitialize() override;
+ void initialize() override;
+ void deinitialize() override;
bool isReady() const override;
void render(const RenderData& data, RendererTasks& rendererTask) override;
@@ -67,16 +67,12 @@ private:
properties::StringProperty _colorTexturePath;
properties::StringProperty _heightMapTexturePath;
- properties::IntProperty _rotation;
-
std::unique_ptr _programObject;
std::unique_ptr _fboProgramObject;
std::unique_ptr _baseTexture;
std::unique_ptr _heightMapTexture;
- properties::BoolProperty _shiftMeridianBy180;
-
properties::FloatProperty _heightExaggeration;
std::unique_ptr _geometry;
diff --git a/modules/newhorizons/rendering/renderableshadowcylinder.cpp b/modules/newhorizons/rendering/renderableshadowcylinder.cpp
index 60fa854b48..a3013bfba7 100644
--- a/modules/newhorizons/rendering/renderableshadowcylinder.cpp
+++ b/modules/newhorizons/rendering/renderableshadowcylinder.cpp
@@ -34,7 +34,7 @@
#include
namespace {
- const char* KeyMainFrame = "MainFrame";
+ const char* MainFrame = "GALACTIC";
static const openspace::properties::Property::PropertyInfo NumberPointsInfo = {
"AmountOfPoints",
@@ -112,26 +112,26 @@ documentation::Documentation RenderableShadowCylinder::Documentation() {
{
"Type",
new StringEqualVerifier("RenderableShadowCylinder"),
- "",
- Optional::No
+ Optional::No,
+ ""
},
{
NumberPointsInfo.identifier,
new IntVerifier,
- NumberPointsInfo.description,
- Optional::Yes
+ Optional::Yes,
+ NumberPointsInfo.description
},
{
ShadowLengthInfo.identifier,
new DoubleVerifier,
- ShadowLengthInfo.description,
- Optional::Yes
+ Optional::Yes,
+ ShadowLengthInfo.description
},
{
ShadowColorInfo.identifier,
new DoubleVector4Verifier,
- ShadowColorInfo.description,
- Optional::Yes
+ Optional::Yes,
+ ShadowColorInfo.description
},
{
TerminatorTypeInfo.identifier,
@@ -139,32 +139,32 @@ documentation::Documentation RenderableShadowCylinder::Documentation() {
// Synchronized with SpiceManager::terminatorTypeFromString
"UMBRAL", "PENUMBRAL"
}),
- TerminatorTypeInfo.description,
- Optional::No
+ Optional::No,
+ TerminatorTypeInfo.description
},
{
LightSourceInfo.identifier,
new StringVerifier,
- LightSourceInfo.description,
- Optional::No
+ Optional::No,
+ LightSourceInfo.description
},
{
ObserverInfo.identifier,
new StringVerifier,
- ObserverInfo.description,
- Optional::No
+ Optional::No,
+ ObserverInfo.description
},
{
BodyInfo.identifier,
new StringVerifier,
- BodyInfo.description,
- Optional::No
+ Optional::No,
+ BodyInfo.description
},
{
BodyFrameInfo.identifier,
new StringVerifier,
- BodyFrameInfo.description,
- Optional::No
+ Optional::No,
+ BodyFrameInfo.description
},
{
AberrationInfo.identifier,
@@ -172,11 +172,10 @@ documentation::Documentation RenderableShadowCylinder::Documentation() {
// SpiceManager::AberrationCorrection::AberrationCorrection
"NONE", "LT", "LT+S", "CN", "CN+S"
}),
- AberrationInfo.description,
- Optional::No
+ Optional::No,
+ AberrationInfo.description
},
- },
- Exhaustive::Yes
+ }
};
}
@@ -197,7 +196,6 @@ RenderableShadowCylinder::RenderableShadowCylinder(const ghoul::Dictionary& dict
, _observer(ObserverInfo)
, _body(BodyInfo)
, _bodyFrame(BodyFrameInfo)
- , _mainFrame({"mainFrame", "Main Frame", ""}) // @TODO Remove this
, _aberration(AberrationInfo)
, _shader(nullptr)
, _vao(0)
@@ -246,8 +244,6 @@ RenderableShadowCylinder::RenderableShadowCylinder(const ghoul::Dictionary& dict
_observer = dictionary.value(ObserverInfo.identifier);
_body = dictionary.value(BodyInfo.identifier);
_bodyFrame = dictionary.value(BodyFrameInfo.identifier);
- _mainFrame = dictionary.value(KeyMainFrame);
-
using T = SpiceManager::AberrationCorrection::Type;
_aberration.addOptions({
@@ -264,7 +260,7 @@ RenderableShadowCylinder::RenderableShadowCylinder(const ghoul::Dictionary& dict
_aberration = static_cast(aberration.type);
}
-bool RenderableShadowCylinder::initialize() {
+void RenderableShadowCylinder::initialize() {
glGenVertexArrays(1, &_vao);
glGenBuffers(1, &_vbo);
@@ -274,11 +270,9 @@ bool RenderableShadowCylinder::initialize() {
"${MODULE_NEWHORIZONS}/shaders/terminatorshadow_vs.glsl",
"${MODULE_NEWHORIZONS}/shaders/terminatorshadow_fs.glsl"
);
-
- return true;
}
-bool RenderableShadowCylinder::deinitialize() {
+void RenderableShadowCylinder::deinitialize() {
RenderEngine& renderEngine = OsEng.renderEngine();
if (_shader) {
renderEngine.removeRenderProgram(_shader);
@@ -289,8 +283,6 @@ bool RenderableShadowCylinder::deinitialize() {
_vao = 0;
glDeleteBuffers(1, &_vbo);
_vbo = 0;
-
- return true;
}
bool RenderableShadowCylinder::isReady() const {
@@ -330,7 +322,7 @@ void RenderableShadowCylinder::render(const RenderData& data, RendererTasks&) {
void RenderableShadowCylinder::update(const UpdateData& data) {
_stateMatrix = SpiceManager::ref().positionTransformMatrix(
_bodyFrame,
- _mainFrame,
+ MainFrame,
data.time.j2000Seconds()
);
if (_shader->isDirty()) {
@@ -383,7 +375,7 @@ void RenderableShadowCylinder::createCylinder(double time) {
glm::dvec3 vecLightSource = SpiceManager::ref().targetPosition(
_body,
_lightSource,
- _mainFrame,
+ MainFrame,
{
SpiceManager::AberrationCorrection::Type(_aberration.value()),
SpiceManager::AberrationCorrection::Direction::Reception
diff --git a/modules/newhorizons/rendering/renderableshadowcylinder.h b/modules/newhorizons/rendering/renderableshadowcylinder.h
index cebe3a4bdc..fd43474039 100644
--- a/modules/newhorizons/rendering/renderableshadowcylinder.h
+++ b/modules/newhorizons/rendering/renderableshadowcylinder.h
@@ -50,8 +50,8 @@ class RenderableShadowCylinder : public Renderable {
public:
RenderableShadowCylinder(const ghoul::Dictionary& dictionary);
- bool initialize() override;
- bool deinitialize() override;
+ void initialize() override;
+ void deinitialize() override;
bool isReady() const override;
void render(const RenderData& data, RendererTasks& rendererTask) override;
@@ -75,7 +75,6 @@ private:
properties::StringProperty _observer;
properties::StringProperty _body;
properties::StringProperty _bodyFrame;
- properties::StringProperty _mainFrame;
properties::OptionProperty _aberration;
std::unique_ptr _shader;
diff --git a/modules/newhorizons/shaders/dilation_fs.glsl b/modules/newhorizons/shaders/dilation_fs.glsl
index 5d545b302e..caa39f649a 100644
--- a/modules/newhorizons/shaders/dilation_fs.glsl
+++ b/modules/newhorizons/shaders/dilation_fs.glsl
@@ -59,7 +59,7 @@ vec3 gatherNeighboringColors() {
// the viewport such that pixels=texels, so we can use gl_FragCoord as an
// integer texel coordinate
// First offsetting them, then dividing by the texture size to get to [0,1]
- const vec2 samplePosition = (gl_FragCoord.xy + offsets[i]) / texSize;
+ vec2 samplePosition = (gl_FragCoord.xy + offsets[i]) / texSize;
// The stencelling determines the areas that we have to enlarge, such that we
// do not enlarge a previously enlarged area
diff --git a/modules/newhorizons/shaders/renderableModelProjection_fs.glsl b/modules/newhorizons/shaders/renderableModelProjection_fs.glsl
index 6407eaaada..bb1d9a2ccd 100644
--- a/modules/newhorizons/shaders/renderableModelProjection_fs.glsl
+++ b/modules/newhorizons/shaders/renderableModelProjection_fs.glsl
@@ -47,13 +47,13 @@ bool inRange(float x, float a, float b) {
}
void main() {
- const vec3 n = normalize(vs_normal.xyz);
- const vec4 projected = vs_ndc;
- const vec2 uv = vec2(0.5) * projected.xy + vec2(0.5);
+ vec3 n = normalize(vs_normal.xyz);
+ vec4 projected = vs_ndc;
+ vec2 uv = vec2(0.5) * projected.xy + vec2(0.5);
if (needShadowMap) {
- const float thisDepth = projected.z * 0.5 + 0.5;
- const float closestDepth = texture(depthTexture, uv).r;
+ float thisDepth = projected.z * 0.5 + 0.5;
+ float closestDepth = texture(depthTexture, uv).r;
const float epsilon = 0.001;
if (inRange(uv.x, 0.0, 1.0) && inRange(uv.y, 0.0, 1.0) &&
diff --git a/modules/newhorizons/shaders/renderableModel_fs.glsl b/modules/newhorizons/shaders/renderableModel_fs.glsl
index fb0fde667e..0d5fda887e 100644
--- a/modules/newhorizons/shaders/renderableModel_fs.glsl
+++ b/modules/newhorizons/shaders/renderableModel_fs.glsl
@@ -40,7 +40,7 @@ uniform vec3 directionToSunViewSpace;
Fragment getFragment() {
vec4 textureColor = texture(baseTexture, vs_st);
- const vec4 projectionColor = texture(projectionTexture, vs_st);
+ vec4 projectionColor = texture(projectionTexture, vs_st);
if (projectionColor.a > 0.0) {
textureColor.rgb = mix(
textureColor.rgb,
@@ -49,8 +49,8 @@ Fragment getFragment() {
);
}
- const vec3 diffuseAlbedo = textureColor.rgb;
- const vec3 specularAlbedo = vec3(1.0);
+ vec3 diffuseAlbedo = textureColor.rgb;
+ vec3 specularAlbedo = vec3(1.0);
Fragment frag;
if (_performShading) {
@@ -58,23 +58,23 @@ Fragment getFragment() {
const vec3 lightColorAmbient = vec3(1.0);
const vec3 lightColor = vec3(1.0);
- const vec3 n = normalize(vs_normalViewSpace);
- const vec3 l = directionToSunViewSpace;
- const vec3 c = normalize(vs_positionCameraSpace.xyz);
- const vec3 r = reflect(l, n);
+ vec3 n = normalize(vs_normalViewSpace);
+ vec3 l = directionToSunViewSpace;
+ vec3 c = normalize(vs_positionCameraSpace.xyz);
+ vec3 r = reflect(l, n);
const float ambientIntensity = 0.15;
const float diffuseIntensity = 1.0;
const float specularIntensity = 0.0;
- const float diffuseCosineFactor = dot(n,l);
- const float specularCosineFactor = dot(c,r);
- const float specularPower = 100;
+ float diffuseCosineFactor = dot(n,l);
+ float specularCosineFactor = dot(c,r);
+ const float specularPower = 100.0;
- const vec3 ambientColor = ambientIntensity * lightColorAmbient * diffuseAlbedo;
- const vec3 diffuseColor =
+ vec3 ambientColor = ambientIntensity * lightColorAmbient * diffuseAlbedo;
+ vec3 diffuseColor =
diffuseIntensity * lightColor * diffuseAlbedo * max(diffuseCosineFactor, 0.0);
- const vec3 specularColor = specularIntensity * lightColor * specularAlbedo *
+ vec3 specularColor = specularIntensity * lightColor * specularAlbedo *
pow(max(specularCosineFactor, 0.0), specularPower);
frag.color.rgb = ambientColor + diffuseColor + specularColor;
diff --git a/modules/newhorizons/shaders/renderablePlanetProjection_fs.glsl b/modules/newhorizons/shaders/renderablePlanetProjection_fs.glsl
index 4e88284d38..d57d4cfa08 100644
--- a/modules/newhorizons/shaders/renderablePlanetProjection_fs.glsl
+++ b/modules/newhorizons/shaders/renderablePlanetProjection_fs.glsl
@@ -45,15 +45,15 @@ uniform vec3 boresight;
#define M_PI 3.14159265358979323846
vec4 uvToModel(vec2 uv, vec3 radius, float segments){
- const float fj = uv.x * segments;
- const float fi = (1.0 - uv.y) * segments;
+ float fj = uv.x * segments;
+ float fi = (1.0 - uv.y) * segments;
- const float theta = fi * float(M_PI) / segments; // 0 -> PI
- const float phi = fj * float(M_PI) * 2.0f / segments;
+ float theta = fi * float(M_PI) / segments; // 0 -> PI
+ float phi = fj * float(M_PI) * 2.0f / segments;
- const float x = radius[0] * sin(phi) * sin(theta); //
- const float y = radius[1] * cos(theta); // up
- const float z = radius[2] * cos(phi) * sin(theta); //
+ float x = radius[0] * sin(phi) * sin(theta); //
+ float y = radius[1] * cos(theta); // up
+ float z = radius[2] * cos(phi) * sin(theta); //
return vec4(x, y, z, 0.0);
}
diff --git a/modules/newhorizons/shaders/renderablePlanet_fs.glsl b/modules/newhorizons/shaders/renderablePlanet_fs.glsl
index d0d4b14aaf..049b1deb8e 100644
--- a/modules/newhorizons/shaders/renderablePlanet_fs.glsl
+++ b/modules/newhorizons/shaders/renderablePlanet_fs.glsl
@@ -47,10 +47,10 @@ Fragment getFragment() {
vec3 n = normalize(vs_normal.xyz);
- const vec3 l_pos = sun_pos; // sun
- const vec3 l_dir = normalize(l_pos - objpos.xyz);
+ vec3 l_pos = sun_pos; // sun
+ vec3 l_dir = normalize(l_pos - objpos.xyz);
const float terminatorBrightness = 0.4;
- const float intensity = min(max(5 * dot(n,l_dir), terminatorBrightness), 1);
+ float intensity = min(max(5 * dot(n,l_dir), terminatorBrightness), 1);
// float shine = 0.0001;
vec4 ambient = vec4(0.0, 0.0, 0.0, 1.0);
diff --git a/modules/newhorizons/shaders/renderablePlanet_vs.glsl b/modules/newhorizons/shaders/renderablePlanet_vs.glsl
index f14fb9eab8..1ef4e23d9b 100644
--- a/modules/newhorizons/shaders/renderablePlanet_vs.glsl
+++ b/modules/newhorizons/shaders/renderablePlanet_vs.glsl
@@ -40,16 +40,10 @@ uniform mat4 modelViewProjectionTransform;
uniform bool _hasHeightMap;
uniform float _heightExaggeration;
uniform sampler2D heightTexture;
-uniform bool shiftMeridian;
void main() {
vs_st = in_st;
- vec2 st = in_st;
- if (shiftMeridian) {
- st.s += 0.5;
- }
-
vec4 tmp = in_position;
// this is wrong for the normal.
@@ -58,9 +52,9 @@ void main() {
if (_hasHeightMap) {
- const float height = texture(heightTexture, st).s;
- const vec3 displacementDirection = (normalize(tmp.xyz));
- const float displacementFactor = height * _heightExaggeration / 750.0;
+ float height = texture(heightTexture, in_st).s;
+ vec3 displacementDirection = (normalize(tmp.xyz));
+ float displacementFactor = height * _heightExaggeration / 750.0;
tmp.xyz += displacementDirection * displacementFactor;
}
diff --git a/modules/newhorizons/util/projectioncomponent.cpp b/modules/newhorizons/util/projectioncomponent.cpp
index 06b19c6141..a3cbccbccf 100644
--- a/modules/newhorizons/util/projectioncomponent.cpp
+++ b/modules/newhorizons/util/projectioncomponent.cpp
@@ -125,34 +125,34 @@ documentation::Documentation ProjectionComponent::Documentation() {
{
keyInstrument,
new StringAnnotationVerifier("A SPICE name of an instrument"),
- "The instrument that is used to perform the projections",
- Optional::No
+ Optional::No,
+ "The instrument that is used to perform the projections"
},
{
keyInstrumentFovy,
new DoubleVerifier,
- "The field of view in degrees along the y axis",
- Optional::No
+ Optional::No,
+ "The field of view in degrees along the y axis"
},
{
keyInstrumentAspect,
new DoubleVerifier,
- "The aspect ratio of the instrument in relation between x and y axis",
- Optional::No
+ Optional::No,
+ "The aspect ratio of the instrument in relation between x and y axis"
},
{
keyProjObserver,
new StringAnnotationVerifier("A SPICE name of the observing object"),
+ Optional::No,
"The observer that is doing the projection. This has to be a valid SPICE "
- "name or SPICE integer.",
- Optional::No
+ "name or SPICE integer."
},
{
keyProjTarget,
new StringAnnotationVerifier("A SPICE name of the observed object"),
+ Optional::No,
"The observed object that is projected on. This has to be a valid SPICE "
- "name or SPICE integer.",
- Optional::No
+ "name or SPICE integer."
},
{
keyProjAberration,
@@ -160,52 +160,51 @@ documentation::Documentation ProjectionComponent::Documentation() {
// from SpiceManager::AberrationCorrection::AberrationCorrection
"NONE", "LT", "LT+S", "CN", "CN+S", "XLT", "XLT+S", "XCN", "XCN+S"
}),
+ Optional::No,
"The aberration correction that is supposed to be used for the "
"projection. The values for the correction correspond to the SPICE "
"definition as described in "
- "ftp://naif.jpl.nasa.gov/pub/naif/toolkit_docs/IDL/cspice/spkezr_c.html",
- Optional::No
+ "ftp://naif.jpl.nasa.gov/pub/naif/toolkit_docs/IDL/cspice/spkezr_c.html"
},
{
keyPotentialTargets,
new StringListVerifier,
+ Optional::Yes,
"The list of potential targets that are involved with the image "
- "projection",
- Optional::Yes
+ "projection"
},
{
keyNeedsTextureMapDilation,
new BoolVerifier,
+ Optional::Yes,
"Determines whether a dilation step of the texture map has to be "
"performed after each projection. This is necessary if the texture of "
"the projected object is a texture map where the borders are not "
- "touching. The default value is 'false'.",
- Optional::Yes
+ "touching. The default value is 'false'."
},
{
keyNeedsShadowing,
new BoolVerifier,
+ Optional::Yes,
"Determines whether the object requires a self-shadowing algorithm. This "
"is necessary if the object is concave and might cast a shadow on itself "
- "during presentation. The default value is 'false'.",
- Optional::Yes
+ "during presentation. The default value is 'false'."
},
{
keyTextureMapAspectRatio,
new DoubleVerifier,
+ Optional::Yes,
"Sets the desired aspect ratio of the projected texture. This might be "
"necessary as planets usually have 2x1 aspect ratios, whereas this does "
"not hold for non-planet objects (comets, asteroids, etc). The default "
- "value is '1.0'.",
- Optional::Yes
+ "value is '1.0'."
}
-
}
};
}
ProjectionComponent::ProjectionComponent()
- : properties::PropertyOwner("ProjectionComponent")
+ : properties::PropertyOwner({ "ProjectionComponent" })
, _performProjection(ProjectionInfo, true)
, _clearAllProjections(ClearProjectionInfo, false)
, _projectionFading(FadingInfo, 1.f, 0.f, 1.f)
diff --git a/modules/onscreengui/src/guicomponent.cpp b/modules/onscreengui/src/guicomponent.cpp
index d915aa918c..e4d93a8d9e 100644
--- a/modules/onscreengui/src/guicomponent.cpp
+++ b/modules/onscreengui/src/guicomponent.cpp
@@ -35,7 +35,7 @@ namespace {
namespace openspace::gui {
GuiComponent::GuiComponent(std::string name)
- : properties::PropertyOwner(std::move(name))
+ : properties::PropertyOwner({ std::move(name) })
, _isEnabled(EnabledInfo, false)
{
addProperty(_isEnabled);
diff --git a/modules/onscreengui/src/guiorigincomponent.cpp b/modules/onscreengui/src/guiorigincomponent.cpp
index 3505f904cd..eed136c37a 100644
--- a/modules/onscreengui/src/guiorigincomponent.cpp
+++ b/modules/onscreengui/src/guiorigincomponent.cpp
@@ -64,12 +64,12 @@ void GuiOriginComponent::render() {
// only then it would be a real error
ghoul_assert(iCurrentFocus != nodes.end(), "Focus node not found");
}
- int currentPosition = static_cast(std::distance(iCurrentFocus, nodes.begin()));
+ int currentPosition = static_cast(std::distance(nodes.begin(), iCurrentFocus));
bool hasChanged = ImGui::Combo("Origin", ¤tPosition, nodeNames.c_str());
if (hasChanged) {
OsEng.scriptEngine().queueScript(
- "openspace.setPropertyValue('NavigationHandler.origin', '" +
+ "openspace.setPropertyValue('NavigationHandler.Origin', '" +
nodes[currentPosition]->name() + "');",
scripting::ScriptEngine::RemoteScripting::Yes
);
diff --git a/modules/onscreengui/src/guipropertycomponent.cpp b/modules/onscreengui/src/guipropertycomponent.cpp
index 1d929f5c3c..11b351e4b4 100644
--- a/modules/onscreengui/src/guipropertycomponent.cpp
+++ b/modules/onscreengui/src/guipropertycomponent.cpp
@@ -49,6 +49,15 @@ namespace {
}
));
}
+
+ void renderTooltip(openspace::properties::PropertyOwner* propOwner) {
+ const bool shouldDisplay =
+ ImGui::IsItemHovered() && (!propOwner->description().empty());
+
+ if (shouldDisplay) {
+ ImGui::SetTooltip(propOwner->description().c_str());
+ }
+ }
} // namespace
namespace openspace::gui {
@@ -87,7 +96,9 @@ void GuiPropertyComponent::renderPropertyOwner(properties::PropertyOwner* owner)
renderPropertyOwner(subOwner);
}
else {
- if (ImGui::TreeNode(subOwner->name().c_str())) {
+ bool opened = ImGui::TreeNode(subOwner->name().c_str());
+ renderTooltip(subOwner);
+ if (opened) {
renderPropertyOwner(subOwner);
ImGui::TreePop();
}
diff --git a/modules/space/rendering/planetgeometry.cpp b/modules/space/rendering/planetgeometry.cpp
index ad66dfc7bf..f81af71d5b 100644
--- a/modules/space/rendering/planetgeometry.cpp
+++ b/modules/space/rendering/planetgeometry.cpp
@@ -45,8 +45,8 @@ documentation::Documentation PlanetGeometry::Documentation() {
{
KeyType,
new StringVerifier,
- "The type of the PlanetGeometry that will can be constructed.",
- Optional::No
+ Optional::No,
+ "The type of the PlanetGeometry that will can be constructed."
}
}
};
@@ -74,7 +74,7 @@ std::unique_ptr PlanetGeometry::createFromDictionary(
}
PlanetGeometry::PlanetGeometry()
- : properties::PropertyOwner("PlanetGeometry")
+ : properties::PropertyOwner({ "PlanetGeometry" })
, _parent(nullptr)
{}
diff --git a/modules/space/rendering/renderableconstellationbounds.cpp b/modules/space/rendering/renderableconstellationbounds.cpp
index 0e8d96366a..82124eefe2 100644
--- a/modules/space/rendering/renderableconstellationbounds.cpp
+++ b/modules/space/rendering/renderableconstellationbounds.cpp
@@ -94,28 +94,28 @@ documentation::Documentation RenderableConstellationBounds::Documentation() {
{
VertexInfo.identifier,
new StringVerifier,
- VertexInfo.description,
- Optional::No
+ Optional::No,
+ VertexInfo.description
},
{
ConstellationInfo.identifier,
new StringVerifier,
+ Optional::Yes,
"Specifies the file that contains the mapping between constellation "
"abbreviations and full name of the constellation. If the file is "
- "omitted, the abbreviations are used as the full names.",
- Optional::Yes
+ "omitted, the abbreviations are used as the full names."
},
{
DistanceInfo.identifier,
new DoubleVerifier,
- DistanceInfo.description,
- Optional::Yes
+ Optional::Yes,
+ DistanceInfo.description
},
{
SelectionInfo.identifier,
new StringListVerifier,
- SelectionInfo.description,
- Optional::Yes
+ Optional::Yes,
+ SelectionInfo.description
}
}
};
@@ -158,13 +158,50 @@ RenderableConstellationBounds::RenderableConstellationBounds(
addProperty(_distance);
fillSelectionProperty();
+ _constellationSelection.onChange([this]() { selectionPropertyHasChanged(); });
addProperty(_constellationSelection);
- _constellationSelection.onChange(
- [this]() { selectionPropertyHasChanged(); }
- );
+
+ if (dictionary.hasKey(SelectionInfo.identifier)) {
+ const ghoul::Dictionary selection = dictionary.value(
+ SelectionInfo.identifier
+ );
+
+ std::vector options =
+ _constellationSelection.options();
+ std::vector selectedIndices;
+
+ for (int i = 1; i <= selection.size(); ++i) {
+ const std::string s = selection.value(std::to_string(i));
+
+ auto it = std::find_if(
+ options.begin(),
+ options.end(),
+ [&s](const properties::SelectionProperty::Option& o) {
+ return o.description == s;
+ }
+ );
+ if (it == options.end()) {
+ // The user has specified a constellation name that doesn't exist
+ LWARNINGC(
+ "RenderableConstellationBounds",
+ "Option '" << s << "' not found in list of constellations"
+ );
+ }
+ else {
+ // If the found the option, we push the index of the found value into the
+ // array
+ selectedIndices.push_back(static_cast(
+ std::distance(options.begin(), it)
+ ));
+ }
+ }
+
+ _constellationSelection = selectedIndices;
+ }
+
}
-bool RenderableConstellationBounds::initialize() {
+void RenderableConstellationBounds::initialize() {
_program = OsEng.renderEngine().buildRenderProgram(
"ConstellationBounds",
"${MODULE_SPACE}/shaders/constellationbounds_vs.glsl",
@@ -189,11 +226,9 @@ bool RenderableConstellationBounds::initialize() {
glVertexAttribPointer(positionAttrib, 3, GL_FLOAT, GL_FALSE, 0, 0);
glBindVertexArray(0);
-
- return true;
}
-bool RenderableConstellationBounds::deinitialize() {
+void RenderableConstellationBounds::deinitialize() {
glDeleteBuffers(1, &_vbo);
_vbo = 0;
glDeleteVertexArrays(1, &_vao);
@@ -203,8 +238,6 @@ bool RenderableConstellationBounds::deinitialize() {
OsEng.renderEngine().removeRenderProgram(_program);
_program = nullptr;
}
-
- return true;
}
bool RenderableConstellationBounds::isReady() const {
diff --git a/modules/space/rendering/renderableconstellationbounds.h b/modules/space/rendering/renderableconstellationbounds.h
index 200e2d8359..b1d7cdc566 100644
--- a/modules/space/rendering/renderableconstellationbounds.h
+++ b/modules/space/rendering/renderableconstellationbounds.h
@@ -50,8 +50,8 @@ class RenderableConstellationBounds : public Renderable {
public:
RenderableConstellationBounds(const ghoul::Dictionary& dictionary);
- bool initialize() override;
- bool deinitialize() override;
+ void initialize() override;
+ void deinitialize() override;
bool isReady() const override;
diff --git a/modules/space/rendering/renderableplanet.cpp b/modules/space/rendering/renderableplanet.cpp
index 28c70d9264..7b75071c89 100644
--- a/modules/space/rendering/renderableplanet.cpp
+++ b/modules/space/rendering/renderableplanet.cpp
@@ -53,10 +53,6 @@
namespace {
const char* KeyGeometry = "Geometry";
const char* KeyRadius = "Radius";
- const char* KeyColorTexture = "Textures.Color";
- const char* KeyNightTexture = "Textures.Night";
- const char* KeyHeightTexture = "Textures.Height";
- const char* KeyShading = "PerformShading";
static const char* _loggerCat = "RenderablePlanet";
@@ -67,14 +63,14 @@ namespace {
const char* keyBody = "Body";
static const openspace::properties::Property::PropertyInfo ColorTextureInfo = {
- "PlanetTexture",
+ "ColorTexture",
"Color Base Texture",
"The path to the base color texture that is used on the planet prior to any "
"image projection."
};
static const openspace::properties::Property::PropertyInfo HeightTextureInfo = {
- "HeightMap",
+ "HeightTexture",
"Heightmap Texture",
"The path to the height map texture that is used for the planet. If no height "
"map is specified the planet does not use a height field."
@@ -101,7 +97,8 @@ namespace {
"Perform Shading",
"If this value is enabled, the model will be shaded based on the relative "
"location to the Sun. If this value is disabled, shading is disabled and the "
- "entire model is rendered brightly."
+ "entire model is rendered brightly. If this value is 'false', any existing night "
+ "texture will not be used."
};
} // namespace
@@ -116,54 +113,51 @@ documentation::Documentation RenderablePlanet::Documentation() {
{
KeyGeometry,
new ReferencingVerifier("space_geometry_planet"),
- "Specifies the planet geometry that is used for this RenderablePlanet.",
- Optional::No
+ Optional::No,
+ "Specifies the planet geometry that is used for this RenderablePlanet."
},
{
KeyRadius,
new DoubleVerifier,
+ Optional::Yes,
"Specifies the radius of the planet. If this value is not specified, it "
- "will try to query the SPICE library for radius values.",
- Optional::Yes
+ "will try to query the SPICE library for radius values."
},
{
- KeyColorTexture, // @TODO Use ColorTextureInfo.identifier instead
+ ColorTextureInfo.identifier,
new StringVerifier,
- "Specifies the color texture that is used for this RenderablePlanet.",
- Optional::Yes
+ Optional::Yes,
+ ColorTextureInfo.description
},
{
- KeyHeightTexture, // @TODO Use HeightTextureInfo.identifier instead
+ HeightTextureInfo.identifier,
new StringVerifier,
- "Specifies the height texture that is used for this RenderablePlanet.",
- Optional::Yes
+ Optional::Yes,
+ HeightTextureInfo.description
},
{
- KeyNightTexture, // @TODO Use NightTextureInfo.identifier instead
+ NightTextureInfo.identifier,
new StringVerifier,
- "Specifies the texture that is used for the night side of this "
- "RenderablePlanet.",
- Optional::Yes
- },
- {
- KeyShading,
- new BoolVerifier,
- "Specifies whether the planet should be rendered shaded by the Sun. If "
- "this value is 'false', any existing night texture will not be used. "
- "This value defaults to 'true'.",
- Optional::Yes
- },
- {
- HeightExaggerationInfo.identifier,
- new DoubleVerifier,
- HeightExaggerationInfo.description,
- Optional::Yes
+ Optional::Yes,
+ NightTextureInfo.description
},
{
PerformShadingInfo.identifier,
new BoolVerifier,
- PerformShadingInfo.description,
- Optional::Yes
+ Optional::Yes,
+ PerformShadingInfo.description
+ },
+ {
+ HeightExaggerationInfo.identifier,
+ new DoubleVerifier,
+ Optional::Yes,
+ HeightExaggerationInfo.description
+ },
+ {
+ PerformShadingInfo.identifier,
+ new BoolVerifier,
+ Optional::Yes,
+ PerformShadingInfo.description
}
}
};
@@ -221,27 +215,33 @@ RenderablePlanet::RenderablePlanet(const ghoul::Dictionary& dictionary)
_geometry = planetgeometry::PlanetGeometry::createFromDictionary(geomDict);
- if (dictionary.hasKey(KeyColorTexture)) {
- _colorTexturePath = absPath(dictionary.value(KeyColorTexture));
+ if (dictionary.hasKey(ColorTextureInfo.identifier)) {
+ _colorTexturePath = absPath(dictionary.value(
+ ColorTextureInfo.identifier
+ ));
}
- if (dictionary.hasKey(KeyNightTexture)) {
+ if (dictionary.hasKey(NightTextureInfo.identifier)) {
_hasNightTexture = true;
- _nightTexturePath = absPath(dictionary.value(KeyNightTexture));
+ _nightTexturePath = absPath(dictionary.value(
+ NightTextureInfo.identifier
+ ));
}
- if (dictionary.hasKey(KeyHeightTexture)) {
+ if (dictionary.hasKey(HeightTextureInfo.identifier)) {
_hasHeightTexture = true;
- _heightMapTexturePath = absPath(dictionary.value(KeyHeightTexture));
+ _heightMapTexturePath = absPath(dictionary.value(
+ HeightTextureInfo.identifier
+ ));
}
- if (dictionary.hasKey(KeyShading)) {
- _performShading = dictionary.value(KeyShading);
+ if (dictionary.hasKey(PerformShadingInfo.identifier)) {
+ _performShading = dictionary.value(PerformShadingInfo.identifier);
}
addPropertySubOwner(_geometry.get());
- auto loadTextureCallback = [this]() {loadTexture(); };
+ auto loadTextureCallback = [this]() { loadTexture(); };
addProperty(_colorTexturePath);
_colorTexturePath.onChange(loadTextureCallback);
@@ -339,7 +339,7 @@ RenderablePlanet::RenderablePlanet(const ghoul::Dictionary& dictionary)
}
}
-bool RenderablePlanet::initialize() {
+void RenderablePlanet::initialize() {
RenderEngine& renderEngine = OsEng.renderEngine();
if (_programObject == nullptr && _shadowEnabled && _hasNightTexture) {
@@ -379,11 +379,9 @@ bool RenderablePlanet::initialize() {
_programObject->deactivate();
loadTexture();
-
- return isReady();
}
-bool RenderablePlanet::deinitialize() {
+void RenderablePlanet::deinitialize() {
if (_geometry) {
_geometry->deinitialize();
_geometry = nullptr;
@@ -398,8 +396,6 @@ bool RenderablePlanet::deinitialize() {
_geometry = nullptr;
_texture = nullptr;
_nightTexture = nullptr;
-
- return true;
}
bool RenderablePlanet::isReady() const {
diff --git a/modules/space/rendering/renderableplanet.h b/modules/space/rendering/renderableplanet.h
index bd037b6292..1fb3603f5d 100644
--- a/modules/space/rendering/renderableplanet.h
+++ b/modules/space/rendering/renderableplanet.h
@@ -68,8 +68,8 @@ public:
public:
RenderablePlanet(const ghoul::Dictionary& dictionary);
- bool initialize() override;
- bool deinitialize() override;
+ void initialize() override;
+ void deinitialize() override;
bool isReady() const override;
void render(const RenderData& data, RendererTasks& rendererTask) override;
diff --git a/modules/space/rendering/renderablerings.cpp b/modules/space/rendering/renderablerings.cpp
index 646716317c..3368d051aa 100644
--- a/modules/space/rendering/renderablerings.cpp
+++ b/modules/space/rendering/renderablerings.cpp
@@ -87,38 +87,37 @@ documentation::Documentation RenderableRings::Documentation() {
{
"Type",
new StringEqualVerifier("RenderableRings"),
- "",
Optional::No
},
{
TextureInfo.identifier,
new StringVerifier,
- TextureInfo.description,
- Optional::No
+ Optional::No,
+ TextureInfo.description
},
{
SizeInfo.identifier,
new DoubleVerifier,
- SizeInfo.description,
- Optional::No
+ Optional::No,
+ SizeInfo.description
},
{
OffsetInfo.identifier,
new DoubleVector2Verifier,
- OffsetInfo.description,
- Optional::Yes
+ Optional::Yes,
+ OffsetInfo.description
},
{
NightFactorInfo.identifier,
new DoubleVerifier,
- NightFactorInfo.description,
- Optional::Yes
+ Optional::Yes,
+ NightFactorInfo.description
},
{
TransparencyInfo.identifier,
new DoubleVerifier,
- TransparencyInfo.description,
- Optional::Yes
+ Optional::Yes,
+ TransparencyInfo.description
}
}
};
@@ -185,7 +184,7 @@ bool RenderableRings::isReady() const {
return _shader && _texture;
}
-bool RenderableRings::initialize() {
+void RenderableRings::initialize() {
if (!_shader) {
RenderEngine& renderEngine = OsEng.renderEngine();
_shader = renderEngine.buildRenderProgram("RingProgram",
@@ -201,11 +200,9 @@ bool RenderableRings::initialize() {
glGenBuffers(1, &_vertexPositionBuffer);
createPlane();
loadTexture();
-
- return isReady();
}
-bool RenderableRings::deinitialize() {
+void RenderableRings::deinitialize() {
glDeleteVertexArrays(1, &_quad);
_quad = 0;
@@ -217,8 +214,6 @@ bool RenderableRings::deinitialize() {
OsEng.renderEngine().removeRenderProgram(_shader);
_shader = nullptr;
-
- return true;
}
void RenderableRings::render(const RenderData& data, RendererTasks&) {
diff --git a/modules/space/rendering/renderablerings.h b/modules/space/rendering/renderablerings.h
index 446ec280dd..3d39feb896 100644
--- a/modules/space/rendering/renderablerings.h
+++ b/modules/space/rendering/renderablerings.h
@@ -46,8 +46,8 @@ class RenderableRings : public Renderable {
public:
RenderableRings(const ghoul::Dictionary& dictionary);
- bool initialize() override;
- bool deinitialize() override;
+ void initialize() override;
+ void deinitialize() override;
bool isReady() const override;
diff --git a/modules/space/rendering/renderablestars.cpp b/modules/space/rendering/renderablestars.cpp
index ccdd5f5143..c0a277f83a 100644
--- a/modules/space/rendering/renderablestars.cpp
+++ b/modules/space/rendering/renderablestars.cpp
@@ -132,53 +132,52 @@ documentation::Documentation RenderableStars::Documentation() {
{
"Type",
new StringEqualVerifier("RenderableStars"),
- "",
Optional::No
},
{
KeyFile,
new StringVerifier,
+ Optional::No,
"The path to the SPECK file that contains information about the stars "
- "being rendered.",
- Optional::No
+ "being rendered."
},
{
PsfTextureInfo.identifier,
new StringVerifier,
- PsfTextureInfo.description,
- Optional::No
+ Optional::No,
+ PsfTextureInfo.description
},
{
ColorTextureInfo.identifier,
new StringVerifier,
- ColorTextureInfo.description,
- Optional::No
+ Optional::No,
+ ColorTextureInfo.description
},
{
ColorOptionInfo.identifier,
new StringInListVerifier({
"Color", "Velocity", "Speed"
}),
- ColorOptionInfo.description,
- Optional::Yes
+ Optional::Yes,
+ ColorOptionInfo.description
},
{
TransparencyInfo.identifier,
new DoubleVerifier,
- TransparencyInfo.description,
- Optional::Yes
+ Optional::Yes,
+ TransparencyInfo.description
},
{
ScaleFactorInfo.identifier,
new DoubleVerifier,
- ScaleFactorInfo.description,
- Optional::Yes
+ Optional::Yes,
+ ScaleFactorInfo.description
},
{
MinBillboardSizeInfo.identifier,
new DoubleVerifier,
- MinBillboardSizeInfo.description,
- Optional::Yes
+ Optional::Yes,
+ MinBillboardSizeInfo.description
}
}
};
@@ -289,25 +288,20 @@ bool RenderableStars::isReady() const {
return (_program != nullptr) && (!_fullData.empty());
}
-bool RenderableStars::initialize() {
- bool completeSuccess = true;
-
+void RenderableStars::initialize() {
RenderEngine& renderEngine = OsEng.renderEngine();
_program = renderEngine.buildRenderProgram("Star",
"${MODULE_SPACE}/shaders/star_vs.glsl",
"${MODULE_SPACE}/shaders/star_fs.glsl",
"${MODULE_SPACE}/shaders/star_ge.glsl");
- if (!_program) {
- return false;
+ bool success = loadData();
+ if (!success) {
+ throw ghoul::RuntimeError("Error loading data");
}
- completeSuccess &= loadData();
- completeSuccess &= (_pointSpreadFunctionTexture != nullptr);
-
- return completeSuccess;
}
-bool RenderableStars::deinitialize() {
+void RenderableStars::deinitialize() {
glDeleteBuffers(1, &_vbo);
_vbo = 0;
glDeleteVertexArrays(1, &_vao);
@@ -321,7 +315,6 @@ bool RenderableStars::deinitialize() {
renderEngine.removeRenderProgram(_program);
_program = nullptr;
}
- return true;
}
void RenderableStars::render(const RenderData& data, RendererTasks&) {
diff --git a/modules/space/rendering/renderablestars.h b/modules/space/rendering/renderablestars.h
index c346eac3e8..346a4dbd02 100644
--- a/modules/space/rendering/renderablestars.h
+++ b/modules/space/rendering/renderablestars.h
@@ -48,8 +48,8 @@ public:
explicit RenderableStars(const ghoul::Dictionary& dictionary);
~RenderableStars();
- bool initialize() override;
- bool deinitialize() override;
+ void initialize() override;
+ void deinitialize() override;
bool isReady() const override;
diff --git a/modules/space/rendering/simplespheregeometry.cpp b/modules/space/rendering/simplespheregeometry.cpp
index 88dff332cf..3e583b08f6 100644
--- a/modules/space/rendering/simplespheregeometry.cpp
+++ b/modules/space/rendering/simplespheregeometry.cpp
@@ -59,14 +59,14 @@ documentation::Documentation SimpleSphereGeometry::Documentation() {
new DoubleVerifier,
new DoubleVector3Verifier
),
- RadiusInfo.description,
- Optional::No
+ Optional::No,
+ RadiusInfo.description
},
{
SegmentsInfo.identifier,
new IntVerifier,
- SegmentsInfo.description,
- Optional::No
+ Optional::No,
+ SegmentsInfo.description
}
}
};
diff --git a/modules/space/rotation/spicerotation.cpp b/modules/space/rotation/spicerotation.cpp
index d1117f2df0..16886e3544 100644
--- a/modules/space/rotation/spicerotation.cpp
+++ b/modules/space/rotation/spicerotation.cpp
@@ -60,20 +60,19 @@ documentation::Documentation SpiceRotation::Documentation() {
{
"Type",
new StringEqualVerifier("SpiceRotation"),
- "",
Optional::No
},
{
SourceInfo.identifier,
new StringAnnotationVerifier("A valid SPICE NAIF name or integer"),
- SourceInfo.description,
- Optional::No
+ Optional::No,
+ SourceInfo.description
},
{
DestinationInfo.identifier,
new StringAnnotationVerifier("A valid SPICE NAIF name or integer"),
- DestinationInfo.description,
- Optional::No
+ Optional::No,
+ DestinationInfo.description
},
{
KeyKernels,
@@ -81,10 +80,10 @@ documentation::Documentation SpiceRotation::Documentation() {
new StringListVerifier,
new StringVerifier
),
+ Optional::Yes,
"A single kernel or list of kernels that this SpiceTranslation depends "
"on. All provided kernels will be loaded before any other operation is "
- "performed.",
- Optional::Yes
+ "performed."
}
}
};
diff --git a/modules/space/shaders/nighttexture_fs.glsl b/modules/space/shaders/nighttexture_fs.glsl
index 132969c618..1a3b6a33ab 100644
--- a/modules/space/shaders/nighttexture_fs.glsl
+++ b/modules/space/shaders/nighttexture_fs.glsl
@@ -44,22 +44,22 @@ uniform sampler2D nightTex;
Fragment getFragment() {
vec4 diffuse = texture(texture1, vs_st);
- const vec4 diffuse2 = texture(nightTex, vs_st);
+ vec4 diffuse2 = texture(nightTex, vs_st);
Fragment frag;
if (_performShading) {
- const vec3 n = normalize(vs_normal.xyz);
- const vec3 l_pos = sun_pos; // sun
- const vec3 l_dir = normalize(l_pos - objpos.xyz);
- const float intensity = min(max(5 * dot(n, l_dir), 0.0), 1.0);
- const float darkSide = min(max(5 * dot(n, -l_dir), 0.0), 1.0);
+ vec3 n = normalize(vs_normal.xyz);
+ vec3 l_pos = sun_pos; // sun
+ vec3 l_dir = normalize(l_pos - objpos.xyz);
+ float intensity = min(max(5 * dot(n, l_dir), 0.0), 1.0);
+ float darkSide = min(max(5 * dot(n, -l_dir), 0.0), 1.0);
// float shine = 0.0001;
- const vec4 ambient = vec4(0.0, 0.0, 0.0, transparency);
+ vec4 ambient = vec4(0.0, 0.0, 0.0, transparency);
- const vec4 daytex = max(intensity * diffuse, ambient);
- const vec4 mixtex = mix(diffuse, diffuse2, (1.0 + dot(n, -l_dir)) / 2.0);
+ vec4 daytex = max(intensity * diffuse, ambient);
+ vec4 mixtex = mix(diffuse, diffuse2, (1.0 + dot(n, -l_dir)) / 2.0);
diffuse = (daytex * 2.0 + mixtex) / 3.0;
}
diff --git a/modules/space/shaders/nighttexture_vs.glsl b/modules/space/shaders/nighttexture_vs.glsl
index c73efbeaea..0f9dbf922e 100644
--- a/modules/space/shaders/nighttexture_vs.glsl
+++ b/modules/space/shaders/nighttexture_vs.glsl
@@ -53,9 +53,9 @@ void main() {
vec4 position = vec4(tmp.xyz * pow(10, tmp. w), 1.0);
if (_hasHeightMap) {
- const float height = texture(heightTex, in_st).r;
- const vec3 displacementDirection = abs(normalize(in_normal.xyz));
- const float displacementFactor = height * _heightExaggeration;
+ float height = texture(heightTex, in_st).r;
+ vec3 displacementDirection = abs(normalize(in_normal.xyz));
+ float displacementFactor = height * _heightExaggeration;
position.xyz = position.xyz + displacementDirection * displacementFactor;
}
diff --git a/modules/space/shaders/renderableplanet_fs.glsl b/modules/space/shaders/renderableplanet_fs.glsl
index 7b05e136dd..dd617b49d7 100644
--- a/modules/space/shaders/renderableplanet_fs.glsl
+++ b/modules/space/shaders/renderableplanet_fs.glsl
@@ -41,11 +41,11 @@ Fragment getFragment() {
Fragment frag;
if (_performShading) {
- const vec4 ambient = vec4(0.0,0.0,0.0,transparency);
- const vec3 n = normalize(vs_normal.xyz);
- const vec3 l_pos = vec3(sun_pos); // sun
- const vec3 l_dir = normalize(l_pos - objpos.xyz);
- const float intensity = min(max(5.0 * dot(n, l_dir), 0.0), 1.0);
+ vec4 ambient = vec4(0.0,0.0,0.0,transparency);
+ 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.0 * dot(n, l_dir), 0.0), 1.0);
diffuse = max(intensity * diffuse, ambient);
}
diff --git a/modules/space/shaders/rings_fs.glsl b/modules/space/shaders/rings_fs.glsl
index 285a08515c..615a413c62 100644
--- a/modules/space/shaders/rings_fs.glsl
+++ b/modules/space/shaders/rings_fs.glsl
@@ -52,13 +52,13 @@ Fragment getFragment() {
// Radius \in [0,1], texCoord \in [textureOffset.x, textureOffset.y]
// textureOffset.x -> 0
// textureOffset.y -> 1
- const float texCoord = (radius - textureOffset.x) / (textureOffset.y - textureOffset.x);
+ float texCoord = (radius - textureOffset.x) / (textureOffset.y - textureOffset.x);
if (texCoord < 0.f || texCoord > 1.f) {
discard;
}
vec4 diffuse = texture(texture1, texCoord);
- const float colorValue = length(diffuse.rgb);
+ float colorValue = length(diffuse.rgb);
// times 3 as length of vec3(1.0, 1.0, 1.0) will return 3 and we want
// to normalize the transparency value to [0,1]
if (colorValue < 3.0 * transparency) {
diff --git a/modules/space/shaders/shadow_fs.glsl b/modules/space/shaders/shadow_fs.glsl
index 53ecdd0e7e..ae8c1cd819 100644
--- a/modules/space/shaders/shadow_fs.glsl
+++ b/modules/space/shaders/shadow_fs.glsl
@@ -52,13 +52,11 @@ uniform float transparency;
uniform sampler2D texture1;
-vec4 butterworthFunc(const float d, const float r, const float n) {
+vec4 butterworthFunc(float d, float r, float n) {
return vec4(vec3(sqrt(r / (r + pow(d, 2 * n)))), 1.0);
}
-vec4 calcShadow(const ShadowRenderingStruct shadowInfoArray[numberOfShadows],
- const vec3 position)
-{
+vec4 calcShadow(ShadowRenderingStruct shadowInfoArray[numberOfShadows], vec3 position) {
if (shadowInfoArray[0].isShadowing) {
vec3 pc = shadowInfoArray[0].casterPositionVec - position;
// we can pass this normalized to the shader
@@ -97,14 +95,14 @@ Fragment getFragment() {
Fragment frag;
if (_performShading) {
// directional lighting
- const vec3 n = normalize(vs_normal.xyz);
- const vec3 l_pos = vec3(sun_pos); // sun
- const vec3 l_dir = normalize(l_pos - objpos.xyz);
- const float intensity = min(max(5.0 * dot(n, l_dir), 0.0), 1.0);
- const float darkSide = min(max(5.0 * dot(n, -l_dir), 0.0), 1.0);
+ 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.0 * dot(n, l_dir), 0.0), 1.0);
+ float darkSide = min(max(5.0 * dot(n, -l_dir), 0.0), 1.0);
- const vec4 ambient = vec4(0.0, 0.0, 0.0, transparency);
- const vec4 daytex = max(intensity * diffuse, ambient);
+ vec4 ambient = vec4(0.0, 0.0, 0.0, transparency);
+ vec4 daytex = max(intensity * diffuse, ambient);
diffuse = daytex * calcShadow(shadowDataArray, vs_posWorld.xyz);
}
diff --git a/modules/space/shaders/shadow_nighttexture_fs.glsl b/modules/space/shaders/shadow_nighttexture_fs.glsl
index 1061844862..1916c49606 100644
--- a/modules/space/shaders/shadow_nighttexture_fs.glsl
+++ b/modules/space/shaders/shadow_nighttexture_fs.glsl
@@ -57,13 +57,11 @@ uniform sampler2D texture1;
uniform sampler2D nightTex;
-vec4 butterworthFunc(const float d, const float r, const float n) {
+vec4 butterworthFunc(float d, float r, float n) {
return vec4(vec3(sqrt(r/(r + pow(d, 2*n)))), 1.0);
}
-vec4 calcShadow(const ShadowRenderingStruct shadowInfoArray[numberOfShadows],
- const vec3 position)
-{
+vec4 calcShadow(ShadowRenderingStruct shadowInfoArray[numberOfShadows], vec3 position) {
if (shadowInfoArray[0].isShadowing) {
vec3 pc = shadowInfoArray[0].casterPositionVec - position;
// we can pass this normalized to the shader
@@ -102,16 +100,16 @@ Fragment getFragment() {
Fragment frag;
if (_performShading) {
- const vec3 n = normalize(vs_normal.xyz);
- const vec3 l_pos = vec3(sun_pos); // sun.
- const vec3 l_dir = normalize(l_pos - objpos.xyz);
- const float intensity = min(max(5.0 * dot(n, l_dir), 0.0), 1.0);
- const float darkSide = min(max(5.0 * dot(n, -l_dir), 0.0), 1.0);
+ 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.0 * dot(n, l_dir), 0.0), 1.0);
+ float darkSide = min(max(5.0 * dot(n, -l_dir), 0.0), 1.0);
- const vec4 ambient = vec4(0.0, 0.0, 0.0, transparency);
+ vec4 ambient = vec4(0.0, 0.0, 0.0, transparency);
- const vec4 daytex = max(intensity * diffuse, ambient);
- const vec4 mixtex = mix(diffuse, diffuse2, (1.0 + dot(n, -l_dir)) / 2.0);
+ vec4 daytex = max(intensity * diffuse, ambient);
+ vec4 mixtex = mix(diffuse, diffuse2, (1.0 + dot(n, -l_dir)) / 2.0);
diffuse = ((daytex*2 + mixtex) / 3) * calcShadow(shadowDataArray, vs_posWorld.xyz);
}
diff --git a/modules/space/shaders/star_fs.glsl b/modules/space/shaders/star_fs.glsl
index 2b07b0e306..42f2c492a0 100644
--- a/modules/space/shaders/star_fs.glsl
+++ b/modules/space/shaders/star_fs.glsl
@@ -50,7 +50,7 @@ uniform vec2 magnitudeClamp;
vec4 bv2rgb(float bv) {
// BV is [-0.4,2.0]
- const float t = (bv + 0.4) / (2.0 + 0.4);
+ float t = (bv + 0.4) / (2.0 + 0.4);
return texture(colorTexture, t);
}
diff --git a/modules/space/shaders/star_ge.glsl b/modules/space/shaders/star_ge.glsl
index 48c6445a76..ee1184684e 100644
--- a/modules/space/shaders/star_ge.glsl
+++ b/modules/space/shaders/star_ge.glsl
@@ -67,8 +67,8 @@ void main() {
ge_velocity = vs_velocity[0];
ge_speed = vs_speed[0];
- const float absoluteMagnitude = vs_brightness[0].z;
- const float modifiedSpriteSize =
+ float absoluteMagnitude = vs_brightness[0].z;
+ float modifiedSpriteSize =
exp((-30.623 - absoluteMagnitude) * 0.462) * scaleFactor * 2000;
vec4 projPos[4];
@@ -80,8 +80,8 @@ void main() {
// Calculate the positions of the lower left and upper right corners of the
// billboard in screen-space
- const vec2 ll = (((projPos[1].xy / projPos[1].w) + 1.0) / 2.0) * screenSize;
- const vec2 ur = (((projPos[2].xy / projPos[2].w) + 1.0) / 2.0) * screenSize;
+ vec2 ll = (((projPos[1].xy / projPos[1].w) + 1.0) / 2.0) * screenSize;
+ vec2 ur = (((projPos[2].xy / projPos[2].w) + 1.0) / 2.0) * screenSize;
// The billboard is smaller than one pixel, we can discard it
float sizeInPixels = length(ll - ur);
diff --git a/modules/space/translation/keplertranslation.cpp b/modules/space/translation/keplertranslation.cpp
index 765c2e86f7..aeb1d43096 100644
--- a/modules/space/translation/keplertranslation.cpp
+++ b/modules/space/translation/keplertranslation.cpp
@@ -129,59 +129,57 @@ documentation::Documentation KeplerTranslation::Documentation() {
{
"Type",
new StringEqualVerifier("KeplerTranslation"),
- "",
Optional::No
},
{
EccentricityInfo.identifier,
new DoubleInRangeVerifier(0.0, 1.0),
- EccentricityInfo.description,
- Optional::No
+ Optional::No,
+ EccentricityInfo.description
},
{
SemiMajorAxisInfo.identifier,
new DoubleVerifier,
- SemiMajorAxisInfo.description,
- Optional::No
+ Optional::No,
+ SemiMajorAxisInfo.description
},
{
InclinationInfo.identifier,
new DoubleInRangeVerifier(0.0, 360.0),
- InclinationInfo.description,
- Optional::No
+ Optional::No,
+ InclinationInfo.description
},
{
AscendingNodeInfo.identifier,
new DoubleInRangeVerifier(0.0, 360.0),
- AscendingNodeInfo.description,
- Optional::No
+ Optional::No,
+ AscendingNodeInfo.description
},
{
ArgumentOfPeriapsisInfo.identifier,
new DoubleInRangeVerifier(0.0, 360.0),
- ArgumentOfPeriapsisInfo.description,
- Optional::No
+ Optional::No,
+ ArgumentOfPeriapsisInfo.description
},
{
MeanAnomalyAtEpochInfo.identifier,
new DoubleInRangeVerifier(0.0, 360.0),
- MeanAnomalyAtEpochInfo.description,
- Optional::No
+ Optional::No,
+ MeanAnomalyAtEpochInfo.description
},
{
EpochInfo.identifier,
new StringVerifier,
- EpochInfo.description,
- Optional::No
+ Optional::No,
+ EpochInfo.description
},
{
PeriodInfo.identifier,
new DoubleGreaterVerifier(0.0),
- PeriodInfo.description,
- Optional::No
+ Optional::No,
+ PeriodInfo.description
},
- },
- Exhaustive::Yes
+ }
};
}
diff --git a/modules/space/translation/spicetranslation.cpp b/modules/space/translation/spicetranslation.cpp
index 01fbadfc18..28fb2424c6 100644
--- a/modules/space/translation/spicetranslation.cpp
+++ b/modules/space/translation/spicetranslation.cpp
@@ -33,7 +33,6 @@
#include
namespace {
- const char* KeyBody = "Body";
const char* KeyKernels = "Kernels";
const char* DefaultReferenceFrame = "GALACTIC";
@@ -74,30 +73,29 @@ documentation::Documentation SpiceTranslation::Documentation() {
{
"Type",
new StringEqualVerifier("SpiceTranslation"),
- "",
Optional::No
},
{
- KeyBody, // @TODO Rename to TargetInfo.identifier
+ TargetInfo.identifier,
new StringAnnotationVerifier("A valid SPICE NAIF name or identifier"),
+ Optional::No,
"This is the SPICE NAIF name for the body whose translation is to be "
"computed by the SpiceTranslation. It can either be a fully qualified "
- "name (such as 'EARTH') or a NAIF integer id code (such as '399').",
- Optional::No
+ "name (such as 'EARTH') or a NAIF integer id code (such as '399')."
},
{
ObserverInfo.identifier,
new StringAnnotationVerifier("A valid SPICE NAIF name or identifier"),
- ObserverInfo.description,
- Optional::No
+ Optional::No,
+ ObserverInfo.description
},
{
FrameInfo.identifier,
new StringAnnotationVerifier(
"A valid SPICE NAIF name for a reference frame"
),
- FrameInfo.description,
- Optional::Yes
+ Optional::Yes,
+ FrameInfo.description
},
{
KeyKernels,
@@ -105,13 +103,12 @@ documentation::Documentation SpiceTranslation::Documentation() {
new StringListVerifier,
new StringVerifier
),
+ Optional::Yes,
"A single kernel or list of kernels that this SpiceTranslation depends "
"on. All provided kernels will be loaded before any other operation is "
- "performed.",
- Optional::Yes
+ "performed."
}
- },
- Exhaustive::Yes
+ }
};
}
@@ -126,7 +123,7 @@ SpiceTranslation::SpiceTranslation(const ghoul::Dictionary& dictionary)
"SpiceTranslation"
);
- _target = dictionary.value(KeyBody);
+ _target = dictionary.value(TargetInfo.identifier);
_observer = dictionary.value(ObserverInfo.identifier);
if (dictionary.hasKey(FrameInfo.identifier)) {
diff --git a/modules/space/translation/tletranslation.cpp b/modules/space/translation/tletranslation.cpp
index ebc7897b51..836d9a8526 100644
--- a/modules/space/translation/tletranslation.cpp
+++ b/modules/space/translation/tletranslation.cpp
@@ -239,23 +239,22 @@ documentation::Documentation TLETranslation::Documentation() {
{
"Type",
new StringEqualVerifier("TLETranslation"),
- "",
Optional::No
},
{
KeyFile,
new StringVerifier,
- "Specifies the filename of the Two-Line-Element file",
- Optional::No
+ Optional::No,
+ "Specifies the filename of the Two-Line-Element file"
},
{
KeyLineNum,
new DoubleGreaterVerifier(0),
- "Specifies the line number within the file where the group of 3 TLE lines begins (1-based)",
- Optional::No
+ Optional::No,
+ "Specifies the line number within the file where the group of 3 TLE "
+ "lines begins (1-based)."
}
- },
- Exhaustive::No
+ }
};
}
diff --git a/modules/touch/shaders/marker_fs.glsl b/modules/touch/shaders/marker_fs.glsl
index 18d51528cf..76e54c69a6 100644
--- a/modules/touch/shaders/marker_fs.glsl
+++ b/modules/touch/shaders/marker_fs.glsl
@@ -45,9 +45,9 @@ Fragment getFragment() {
n.z = sqrt(1.0 - mag);
// calculate lighting
- const vec3 light_dir = vec3(0.0, 0.0, 1.0);
- const float diffuse = max(0.0, dot(light_dir, n));
- const float alpha = min(pow(sqrt(mag), thickness), transparency);
+ vec3 light_dir = vec3(0.0, 0.0, 1.0);
+ float diffuse = max(0.0, dot(light_dir, n));
+ float alpha = min(pow(sqrt(mag), thickness), transparency);
Fragment frag;
frag.color = vec4(color * diffuse, alpha);
diff --git a/modules/touch/src/touchinteraction.cpp b/modules/touch/src/touchinteraction.cpp
index c2b83202d2..c53d5c8ccc 100644
--- a/modules/touch/src/touchinteraction.cpp
+++ b/modules/touch/src/touchinteraction.cpp
@@ -74,7 +74,7 @@ using namespace TUIO;
namespace openspace {
TouchInteraction::TouchInteraction()
- : properties::PropertyOwner("TouchInteraction")
+ : properties::PropertyOwner({ "TouchInteraction" })
, _origin({ "Origin", "Origin", "" }) // @TODO Missing documentation
, _unitTest(
{ "Click to take a unit test", "Take a unit test saving the LM data into file", "" }, // @TODO Missing documentation
diff --git a/modules/touch/src/touchmarker.cpp b/modules/touch/src/touchmarker.cpp
index 05b6439ee7..13fd753a09 100644
--- a/modules/touch/src/touchmarker.cpp
+++ b/modules/touch/src/touchmarker.cpp
@@ -38,7 +38,7 @@ namespace {
namespace openspace {
TouchMarker::TouchMarker()
- : properties::PropertyOwner("TouchMarker")
+ : properties::PropertyOwner({ "TouchMarker" })
, _visible({ "TouchMarkers visible", "Toggle visibility of markers", "" }, true) // @TODO Missing documentation
, _radiusSize({ "Marker size", "Marker radius", "" }, 30.f, 0.f, 100.f) // @TODO Missing documentation
, _transparency({ "Transparency of marker", "Marker transparency", "" }, 0.8f, 0.f, 1.f) // @TODO Missing documentation
diff --git a/modules/toyvolume/rendering/renderabletoyvolume.cpp b/modules/toyvolume/rendering/renderabletoyvolume.cpp
index cf862861a7..5ea3fa67bb 100644
--- a/modules/toyvolume/rendering/renderabletoyvolume.cpp
+++ b/modules/toyvolume/rendering/renderabletoyvolume.cpp
@@ -70,7 +70,7 @@ RenderableToyVolume::RenderableToyVolume(const ghoul::Dictionary& dictionary)
RenderableToyVolume::~RenderableToyVolume() {}
-bool RenderableToyVolume::initialize() {
+void RenderableToyVolume::initialize() {
_raycaster = std::make_unique(_color);
_raycaster->initialize();
@@ -93,25 +93,22 @@ bool RenderableToyVolume::initialize() {
addProperty(_translation);
addProperty(_rotation);
addProperty(_color);
-
- return true;
}
-bool RenderableToyVolume::deinitialize() {
+void RenderableToyVolume::deinitialize() {
if (_raycaster) {
OsEng.renderEngine().raycasterManager().detachRaycaster(*_raycaster.get());
_raycaster = nullptr;
}
- return true;
}
bool RenderableToyVolume::isReady() const {
+ // @TODO isReady function needs to be filled
return true;
}
void RenderableToyVolume::update(const UpdateData& data) {
if (_raycaster) {
-
glm::mat4 transform = glm::translate(glm::mat4(1.0), static_cast(_translation) * std::pow(10.0f, static_cast(_scalingExponent)));
glm::vec3 eulerRotation = static_cast(_rotation);
transform = glm::rotate(transform, eulerRotation.x, glm::vec3(1, 0, 0));
diff --git a/modules/toyvolume/rendering/renderabletoyvolume.h b/modules/toyvolume/rendering/renderabletoyvolume.h
index b5e1390ffc..5655cbf9c0 100644
--- a/modules/toyvolume/rendering/renderabletoyvolume.h
+++ b/modules/toyvolume/rendering/renderabletoyvolume.h
@@ -44,8 +44,8 @@ public:
RenderableToyVolume(const ghoul::Dictionary& dictionary);
~RenderableToyVolume();
- bool initialize() override;
- bool deinitialize() override;
+ void initialize() override;
+ void deinitialize() override;
bool isReady() const override;
void render(const RenderData& data, RendererTasks& tasks) override;
void update(const UpdateData& data) override;
diff --git a/modules/toyvolume/shaders/raycast.glsl b/modules/toyvolume/shaders/raycast.glsl
index a0c8f4f142..0920d5f224 100644
--- a/modules/toyvolume/shaders/raycast.glsl
+++ b/modules/toyvolume/shaders/raycast.glsl
@@ -33,18 +33,18 @@ void sample#{id}(vec3 samplePos, vec3 dir, inout vec3 accumulatedColor,
// In real situations, the sample function would sample a
// 3D texture to retrieve the color contribution of a given point.
- const vec3 fromCenter = vec3(0.5, 0.5, 0.5) - samplePos;
+ vec3 fromCenter = vec3(0.5, 0.5, 0.5) - samplePos;
- const float theta = atan(fromCenter.x, fromCenter.z);
+ float theta = atan(fromCenter.x, fromCenter.z);
float angularRatio = (theta + 3.1415) / 6.283;
angularRatio = mod(angularRatio + time#{id}*0.01, 1.0);
- const float timeWave = sin(mod(time#{id}*0.05, 2.0 * 3.1415));
- const float rDisplacement = 0.1 * timeWave;
+ float timeWave = sin(mod(time#{id}*0.05, 2.0 * 3.1415));
+ float rDisplacement = 0.1 * timeWave;
vec4 c = color#{id};
- const float r = length(fromCenter);
+ float r = length(fromCenter);
c.a *= (1.0 - smoothstep(0.35 + rDisplacement, 0.40 + rDisplacement, r));
c.a *= (1.0 - smoothstep(0.30 + rDisplacement, 0.25 + rDisplacement, r));
c.a *= (1.0 - smoothstep(0.1, 0.2, abs(fromCenter.y) / angularRatio * 0.5));
@@ -61,7 +61,7 @@ void sample#{id}(vec3 samplePos, vec3 dir, inout vec3 accumulatedColor,
backColor = clamp(backColor, 0.0, 1.0);
backAlpha = clamp(backAlpha, 0.0, 1.0);
- const vec3 oneMinusFrontAlpha = vec3(1.0) - accumulatedAlpha;
+ vec3 oneMinusFrontAlpha = vec3(1.0) - accumulatedAlpha;
accumulatedColor += oneMinusFrontAlpha * backColor;
accumulatedAlpha += oneMinusFrontAlpha * backAlpha;
diff --git a/modules/volume/rendering/volumeclipplane.cpp b/modules/volume/rendering/volumeclipplane.cpp
index f160e74999..3aafeae2dd 100644
--- a/modules/volume/rendering/volumeclipplane.cpp
+++ b/modules/volume/rendering/volumeclipplane.cpp
@@ -30,7 +30,8 @@
namespace openspace {
VolumeClipPlane::VolumeClipPlane(const ghoul::Dictionary& dictionary)
- : _normal(
+ : properties::PropertyOwner({ "" }) // @TODO Missing name
+ , _normal(
{ "Normal", "Normal", "" }, // @TODO Missing documentation
glm::vec3(1.f, 0.f, 0.f),
glm::vec3(-1.f),
diff --git a/modules/volume/rendering/volumeclipplanes.cpp b/modules/volume/rendering/volumeclipplanes.cpp
index a093262b9d..38c034a6ca 100644
--- a/modules/volume/rendering/volumeclipplanes.cpp
+++ b/modules/volume/rendering/volumeclipplanes.cpp
@@ -30,7 +30,8 @@
namespace openspace {
VolumeClipPlanes::VolumeClipPlanes(const ghoul::Dictionary& dictionary)
- : _nClipPlanes({ "nClipPlanes", "Number of clip planes", "" }, 0, 0, 10) // @TODO Missing documentation
+ : properties::PropertyOwner({ "" }) // @TODO Missing name
+ , _nClipPlanes({ "nClipPlanes", "Number of clip planes", "" }, 0, 0, 10) // @TODO Missing documentation
{
std::vector keys = dictionary.keys();
for (const std::string& key : keys) {
diff --git a/openspace.cfg b/openspace.cfg
index 1843f47a02..12db70bccb 100644
--- a/openspace.cfg
+++ b/openspace.cfg
@@ -30,7 +30,6 @@ return {
-- Sets the scene that is to be loaded by OpenSpace. A scene file is a description
-- of all entities that will be visible during an instance of OpenSpace
Scene = "${SCENE}/default.scene",
- -- Scene = "${SCENE}/globebrowsing.scene",
-- Scene = "${SCENE}/newhorizons.scene",
-- Scene = "${SCENE}/rosetta.scene",
-- Scene = "${SCENE}/osirisrex.scene",
diff --git a/scripts/bind_keys_newhorizons.lua b/scripts/bind_keys_newhorizons.lua
deleted file mode 100644
index f48117f86b..0000000000
--- a/scripts/bind_keys_newhorizons.lua
+++ /dev/null
@@ -1,135 +0,0 @@
---[[ OpenSpace keybinding script loaded from the newhorizons.scene file ]]--
-
--- Load the common helper functions
-dofile(openspace.absPath('${SCRIPTS}/common.lua'))
-
-openspace.clearKeys()
-helper.setCommonKeys()
-helper.setDeltaTimeKeys({
- 1, 5, 10, 20, 40, 60, 120, 360, 540, 1080,
- 2160, 4320, 8640
-})
-
-openspace.bindKey(
- "a",
- "openspace.setPropertyValue('Interaction.origin', 'NewHorizons')",
- "Sets the focus of the camera on 'NewHorizons'."
-)
-openspace.bindKey(
- "s",
- "openspace.setPropertyValue('Interaction.origin', 'Pluto')",
- "Sets the focus of the camera on 'Pluto'"
-)
-openspace.bindKey(
- "d",
- "openspace.setPropertyValue('Interaction.origin', 'Charon')",
- "Sets the focus of the camera on 'Charon'."
-)
-openspace.bindKey(
- "z",
- "openspace.setPropertyValue('Interaction.origin', 'JupiterProjection')",
- "Sets the focus of the camera on 'Jupiter'."
-)
-openspace.bindKey(
- "x",
- "openspace.setPropertyValue('Interaction.origin', 'Europa')",
- "Sets the focus of the camera on 'Europa'."
-)
-
-openspace.bindKey(
- "F8",
- "openspace.setPropertyValue('Pluto.renderable.ProjectionComponent.clearAllProjections', true);" ..
- "openspace.setPropertyValue('Charon.renderable.ProjectionComponent.clearAllProjections', true);",
- "Removes all image projections from Pluto and Charon."
-)
-
-openspace.bindKey(
- "F9",
- "openspace.time.setTime('2015-07-14T09:00:00.00');" ..
- "openspace.setPropertyValue('Pluto.renderable.clearAllProjections', true);" ..
- "openspace.setPropertyValue('Charon.renderable.clearAllProjections', true);",
- "Jumps to the 14th of July 2015 at 0900 UTC and clears all projections."
-)
-
-openspace.bindKey(
- "KP_8",
- helper.property.increment('Pluto.renderable.heightExaggeration', 0.1),
- "Increases the height map exaggeration on Pluto."
-)
-openspace.bindKey(
- "KP_2",
- helper.property.decrement('Pluto.renderable.heightExaggeration', 0.1),
- "Decreases the height map exaggeration on Pluto."
-)
-openspace.bindKey(
- "KP_9",
- helper.property.increment('Charon.renderable.heightExaggeration', 2),
- "Increases the height map exaggeration on Charon."
-)
-openspace.bindKey(
- "KP_3",
- helper.property.decrement('Charon.renderable.heightExaggeration', 2),
- "Decreases the height map exaggeration on Charon."
-)
-
-openspace.bindKey(
- "q",
- helper.property.invert('SunMarker.renderable.enabled'),
- "Toggles the visibility of the text marking the location of the Sun."
-)
-openspace.bindKey(
- "e",
- helper.property.invert('EarthMarker.renderable.enabled'),
- "Toggles the visibility of the text marking the location of the Earth."
-)
-openspace.bindKey(
- "o",
- helper.property.invert('PlutoTrail.renderable.enabled'),
- "Toggles the visibility of the trail behind Pluto."
-)
-
-openspace.bindKey(
- "j",
- helper.renderable.toggle('PlutoText') .. helper.renderable.toggle('CharonText') ..
- helper.renderable.toggle('HydraText') .. helper.renderable.toggle('NixText') ..
- helper.renderable.toggle('KerberosText') .. helper.renderable.toggle('StyxText'),
- "Toggles the visibility of the text labels of Pluto, Charon, Hydra, Nix, Kerberos, and Styx."
-)
-
-openspace.bindKey(
- "l",
- helper.property.invert('Labels.renderable.performFading'),
- "Toggles the visibility of the labels for the New Horizons instruments."
-)
-
-openspace.bindKey("m",
- helper.property.invert('NH_LORRI.renderable.solidDraw') ..
- helper.property.invert('NH_RALPH_LEISA.renderable.solidDraw') ..
- helper.property.invert('NH_RALPH_MVIC_PAN1.renderable.solidDraw') ..
- helper.property.invert('NH_RALPH_MVIC_PAN2.renderable.solidDraw') ..
- helper.property.invert('NH_RALPH_MVIC_RED.renderable.solidDraw') ..
- helper.property.invert('NH_RALPH_MVIC_BLUE.renderable.solidDraw') ..
- helper.property.invert('NH_RALPH_MVIC_FT.renderable.solidDraw') ..
- helper.property.invert('NH_RALPH_MVIC_METHANE.renderable.solidDraw') ..
- helper.property.invert('NH_RALPH_MVIC_NIR.renderable.solidDraw') ..
- helper.property.invert('NH_ALICE_AIRGLOW.renderable.solidDraw') ..
- helper.property.invert('NH_ALICE_SOC.renderable.solidDraw'),
- "Draws the instrument field of views in a solid color or as lines."
-)
-
-openspace.bindKey(
- "t",
- helper.renderable.toggle('PlutoShadow') .. helper.renderable.toggle('CharonShadow'),
- "Toggles the visibility of the shadow visualization of Pluto and Charon."
-)
-
-openspace.bindKey("p",
- helper.property.invert('JupiterProjection.renderable.performProjection') ..
- helper.property.invert('Io.renderable.performProjection') ..
- helper.property.invert('Ganymede.renderable.performProjection') ..
- helper.property.invert('Europa.renderable.performProjection') ..
- helper.property.invert('Callisto.renderable.performProjection') ..
- helper.property.invert('Pluto.renderable.performProjection') ..
- helper.property.invert('Charon.renderable.performProjection'),
- "Enables or disables the image projection on the different available objects."
-)
diff --git a/scripts/bind_keys_osirisrex.lua b/scripts/bind_keys_osirisrex.lua
deleted file mode 100644
index 1963734dad..0000000000
--- a/scripts/bind_keys_osirisrex.lua
+++ /dev/null
@@ -1,59 +0,0 @@
---[[ OpenSpace keybinding script loaded from the osirisrex.scene file ]]--
-
--- Load the common helper functions
-dofile(openspace.absPath('${SCRIPTS}/common.lua'))
-dofile(openspace.absPath('${SCRIPTS}/bind_common_keys.lua'))
-
--- Set focuses
-openspace.bindKey(
- "a",
- "openspace.setPropertyValue('Interaction.origin', 'OsirisRex')",
- "Sets the focus of the camera on 'Osiris Rex'."
-)
-openspace.bindKey(
- "s",
- "openspace.setPropertyValue('Interaction.origin', 'BennuBarycenter')",
- "Sets the focus of the camera on 'Bennu'."
-)
-
-openspace.bindKey(
- "F6" ,
- "openspace.printInfo('Set time: Launch');openspace.time.setTime('2016 SEP 08 23:05:00');",
- "Sets the time to the launch."
-)
-openspace.bindKey(
- "F7",
- "openspace.printInfo('Set time: Gravity Assist');openspace.time.setTime('2017 SEP 22 15:00:00');",
- "Sets the time to the Earth gravity assist."
-)
-openspace.bindKey(
- "F8",
- "openspace.printInfo('Set time: Approach');openspace.time.setTime('2018-SEP-11 21:31:01.183');",
- "Sets the time to the approach at Bennu."
-)
-openspace.bindKey(
- "F9",
- "openspace.printInfo('Set time: Preliminary Survey');openspace.time.setTime('2018-NOV-20 01:13:12.183');",
- "Sets the time to the preliminary survey of Bennu."
-)
-openspace.bindKey(
- "F10",
- "openspace.printInfo('Set time: Orbital B');openspace.time.setTime('2019-APR-08 10:35:27.186');",
- "Sets the time to the orbital B event."
-)
-openspace.bindKey(
- "F11",
- "openspace.printInfo('Set time: Recon');openspace.time.setTime('2019-MAY-25 03:50:31.195');",
- "Sets the time to the recon event."
-)
-
-openspace.bindKey(
- "q",
- helper.property.invert('SunMarker.renderable.enabled'),
- "Toggles the visibility of the text marking the location of the Sun."
-)
-openspace.bindKey(
- "e",
- helper.property.invert('EarthMarker.renderable.enabled'),
- "Toggles the visibility of the text marking the location of the Earth."
-)
diff --git a/scripts/bind_keys_rosetta.lua b/scripts/bind_keys_rosetta.lua
deleted file mode 100644
index 5683217018..0000000000
--- a/scripts/bind_keys_rosetta.lua
+++ /dev/null
@@ -1,68 +0,0 @@
---[[ OpenSpace keybinding script loaded from the rosetta.scene file ]]--
--- This script sets the default keybindings and is executed at startup
-
--- Load the common helper functions
-dofile(openspace.absPath('${SCRIPTS}/common.lua'))
-
-openspace.clearKeys()
-helper.setCommonKeys()
-
-helper.setDeltaTimeKeys({
- 1, 5, 10, 20, 40, 90, 360, 720, 2880, 14400,
- 28800, 57600, 115200, 230400, 460800, 921600, 1843200, 3686400, 7372800, 14745600
-})
-
-openspace.bindKey(
- "a",
- "openspace.setPropertyValue('Interaction.origin', '67P')",
- "Sets the focus of the camera on '67P'."
-)
-openspace.bindKey(
- "s",
- "openspace.setPropertyValue('Interaction.origin', 'Rosetta')",
- "Sets the focus of the camera on 'Rosetta'."
-)
-
-openspace.bindKey(
- "F5",
- "openspace.time.setTime('2014-08-01T03:05:18.101')",
- "Jumps to the time of initial approach of Rosetta to 67P."
-)
-openspace.bindKey(
- "F6",
- "openspace.time.setTime('2014-11-12T08:20:00.00')",
- "Jumps to the time when the Philae lander is released."
-)
-openspace.bindKey(
- "F8",
- "openspace.setPropertyValue('67P.renderable.ProjectionComponent.clearAllProjections', true)",
- "Removes all image projections from 67P."
-)
-
-openspace.bindKey(
- "i",
- helper.renderable.toggle('ImagePlaneRosetta'),
- "Toggles the visibility of the free floating image plane."
-)
-openspace.bindKey(
- "q",
- helper.renderable.toggle('SunMarker'),
- "Toggles the visibility of the text marking the location of the Sun."
-)
-openspace.bindKey(
- "e",
- helper.renderable.toggle('JupiterTrail') .. helper.renderable.toggle('SaturnTrail') ..
- helper.renderable.toggle('UranusTrail') .. helper.renderable.toggle('NeptuneTrail'),
- "Toggles the visibility of all trails further from the Sun than 67P."
-)
-openspace.bindKey(
- "f",
- helper.renderable.toggle('PhilaeTrail'),
- "Toggles the visibility of Philae's trail."
-)
-
-openspace.bindKey(
- "p",
- helper.property.invert('67P.renderable.ProjectionComponent.performProjection'),
- "Enables or disables the image projection on 67P."
-)
diff --git a/scripts/bind_keys_satellites.lua b/scripts/bind_keys_satellites.lua
deleted file mode 100644
index c2d53dbd7c..0000000000
--- a/scripts/bind_keys_satellites.lua
+++ /dev/null
@@ -1,23 +0,0 @@
---[[ OpenSpace keybinding script loaded from the satellites.scene file ]]--
-
--- Load the common helper functions
-dofile(openspace.absPath('${SCRIPTS}/common.lua'))
-dofile(openspace.absPath('${SCRIPTS}/bind_common_keys.lua'))
-
--- Set focuses
-
-openspace.bindKey(
- "p" ,
- "if gpsVis then gpsVis = false; else gpsVis = true; end; openspace.setPropertyValue('gps-ops*.renderable.enabled', not gpsVis)",
- "Toggles visibility of gps satellites."
-)
-openspace.bindKey(
- "s" ,
- "if stVis then stVis = false; else stVis = true; end; openspace.setPropertyValue('station*.renderable.enabled', not stVis)",
- "Toggles visibility of stations."
-)
-openspace.bindKey(
- "g" ,
- "if geoVis then geoVis = false; else geoVis = true; end; openspace.setPropertyValue('geo*.renderable.enabled', not geoVis)",
- "Toggles visibility of geostationary."
-)
\ No newline at end of file
diff --git a/scripts/common.lua b/scripts/common.lua
index b80c4fdc1a..2a69962d24 100644
--- a/scripts/common.lua
+++ b/scripts/common.lua
@@ -52,18 +52,18 @@ helper.setCommonKeys = function()
openspace.bindKey(
"f",
- helper.property.invert('NavigationHandler.OrbitalNavigator.RotationalFriction'),
+ helper.property.invert('NavigationHandler.OrbitalNavigator.Friction.RotationalFriction'),
"Toggles the rotational friction of the camera. If it is disabled, the camera rotates around the focus object indefinitely."
)
openspace.bindKey(
"Shift+f",
- helper.property.invert('NavigationHandler.OrbitalNavigator.ZoomFriction'),
+ helper.property.invert('NavigationHandler.OrbitalNavigator.Friction.ZoomFriction'),
"Toggles the zoom friction of the camera. If it is disabled, the camera rises up from or closes in towards the focus object indefinitely."
)
openspace.bindKey(
"Ctrl+f",
- helper.property.invert('NavigationHandler.OrbitalNavigator.RollFriction'),
+ helper.property.invert('NavigationHandler.OrbitalNavigator.Friction.RollFriction'),
"Toggles the roll friction of the camera. If it is disabled, the camera rolls around its own axis indefinitely."
)
diff --git a/src/documentation/documentation.cpp b/src/documentation/documentation.cpp
index 9bd66deaf5..1318d5e3c3 100644
--- a/src/documentation/documentation.cpp
+++ b/src/documentation/documentation.cpp
@@ -115,7 +115,7 @@ SpecificationError::SpecificationError(TestResult res, std::string component)
}
DocumentationEntry::DocumentationEntry(std::string k, std::shared_ptr v,
- std::string doc, Optional opt)
+ Optional opt, std::string doc)
: key(std::move(k))
, verifier(std::move(v))
, optional(opt)
@@ -125,26 +125,24 @@ DocumentationEntry::DocumentationEntry(std::string k, std::shared_ptr
ghoul_assert(verifier, "Verifier must not be nullptr");
}
-DocumentationEntry::DocumentationEntry(std::string key, Verifier* v, std::string doc,
- Optional optional)
- : DocumentationEntry(std::move(key), std::shared_ptr(v), std::move(doc),
- optional)
+DocumentationEntry::DocumentationEntry(std::string key, Verifier* v, Optional optional,
+ std::string doc)
+ : DocumentationEntry(std::move(key), std::shared_ptr(v), optional,
+ std::move(doc))
{}
-Documentation::Documentation(std::string n, std::string id, DocumentationEntries entries,
- Exhaustive exh)
+Documentation::Documentation(std::string n, std::string id, DocumentationEntries entries)
: name(std::move(n))
, id(std::move(id))
, entries(std::move(entries))
- , exhaustive(std::move(exh))
{}
-Documentation::Documentation(std::string n, DocumentationEntries entries, Exhaustive exh)
- : Documentation(n, "", entries, exh)
+Documentation::Documentation(std::string n, DocumentationEntries entries)
+ : Documentation(n, "", entries)
{}
-Documentation::Documentation(DocumentationEntries entries, Exhaustive exh)
- : Documentation("", "", entries, exh)
+Documentation::Documentation(DocumentationEntries entries)
+ : Documentation("", "", entries)
{}
TestResult testSpecification(const Documentation& d, const ghoul::Dictionary& dict) {
@@ -184,33 +182,6 @@ TestResult testSpecification(const Documentation& d, const ghoul::Dictionary& di
}
}
- if (d.exhaustive) {
- // If the documentation is exhaustive, we have to check if there are extra values
- // in the table that are not covered by the Documentation
-
- for (const std::string& key : dict.keys()) {
- auto it = std::find_if(
- d.entries.begin(),
- d.entries.end(),
- [&key](const DocumentationEntry& entry) {
- if (entry.key == DocumentationEntry::Wildcard) {
- return true;
- }
- else {
- return entry.key == key;
- }
- }
- );
-
- if (it == d.entries.end()) {
- result.success = false;
- result.offenses.push_back(
- { key, TestResult::Offense::Reason::ExtraKey }
- );
- }
- }
- }
-
// Remove duplicate offenders that might occur if multiple rules apply to a single
// key and more than one of these rules are broken
std::set uniqueOffenders(
diff --git a/src/documentation/documentationgenerator.cpp b/src/documentation/documentationgenerator.cpp
index 96eb80d1f0..75026e4f30 100644
--- a/src/documentation/documentationgenerator.cpp
+++ b/src/documentation/documentationgenerator.cpp
@@ -125,17 +125,10 @@ void DocumentationGenerator::writeDocumentation(const std::string& filename) {
std::to_string(OPENSPACE_VERSION_PATCH) +
"]";
- std::string generationTime;
- try {
- generationTime = Time::now().ISO8601();
- }
- catch (...) {}
-
file
<< "\t" << "" << '\n'
diff --git a/src/documentation/verifier.cpp b/src/documentation/verifier.cpp
index 73c116c1a7..58dde75390 100644
--- a/src/documentation/verifier.cpp
+++ b/src/documentation/verifier.cpp
@@ -165,16 +165,15 @@ std::string StringVerifier::type() const {
return "String";
}
-TableVerifier::TableVerifier(std::vector d, Exhaustive exhaustive)
+TableVerifier::TableVerifier(std::vector d)
: documentations(std::move(d))
- , exhaustive(std::move(exhaustive))
{}
TestResult TableVerifier::operator()(const ghoul::Dictionary& dict,
const std::string& key) const {
if (dict.hasKeyAndValue(key)) {
ghoul::Dictionary d = dict.value(key);
- TestResult res = testSpecification({documentations, exhaustive}, d);
+ TestResult res = testSpecification({documentations}, d);
// Add the 'key' as a prefix to make the new offender a fully qualified identifer
for (TestResult::Offense& s : res.offenses) {
@@ -204,7 +203,9 @@ std::string TableVerifier::type() const {
}
StringListVerifier::StringListVerifier(std::string elementDocumentation)
- : TableVerifier({{ "*", new StringVerifier, std::move(elementDocumentation) }})
+ : TableVerifier({
+ { "*", new StringVerifier, Optional::No, std::move(elementDocumentation) }
+ })
{}
std::string StringListVerifier::type() const {
@@ -212,7 +213,9 @@ std::string StringListVerifier::type() const {
}
IntListVerifier::IntListVerifier(std::string elementDocumentation)
- : TableVerifier({ { "*", new IntVerifier, std::move(elementDocumentation) } })
+ : TableVerifier({
+ { "*", new IntVerifier, Optional::No, std::move(elementDocumentation) }
+ })
{}
std::string IntListVerifier::type() const {
diff --git a/src/engine/configurationmanager_doc.inl b/src/engine/configurationmanager_doc.inl
index 982bc65607..d0c9740275 100644
--- a/src/engine/configurationmanager_doc.inl
+++ b/src/engine/configurationmanager_doc.inl
@@ -37,51 +37,51 @@ documentation::Documentation ConfigurationManager::Documentation() {
{
ConfigurationManager::KeyConfigSgct,
new StringAnnotationVerifier("A valid SGCT configuration file"),
+ Optional::No,
"The SGCT configuration file that determines the window and view frustum "
- "settings that are being used when OpenSpace is started.",
- Optional::No
+ "settings that are being used when OpenSpace is started."
},
{
ConfigurationManager::KeyConfigScene,
new StringAnnotationVerifier(
"A valid scene file as described in the Scene documentation"
),
+ Optional::No,
"The scene description that is used to populate the application after "
"startup. The scene determines which objects are loaded, the startup "
"time and other scene-specific settings. More information is provided in "
- "the Scene documentation.",
- Optional::No
+ "the Scene documentation."
},
{
ConfigurationManager::KeyConfigTask,
new StringAnnotationVerifier(
- "A valid task file as described in the Task documentation"),
- "The root task to be performed when launching the task runner "
- "applicaition.",
- Optional::Yes
+ "A valid task file as described in the Task documentation"
+ ),
+ Optional::Yes,
+ "The root task to be performed when launching the task runner application."
},
{
ConfigurationManager::KeyPaths,
new StringListVerifier,
+ Optional::No,
"A list of paths that are automatically registered with the file system. "
"If a key X is used in the table, it is then useable by referencing ${X} "
- "in all other configuration files or scripts.",
- Optional::No
+ "in all other configuration files or scripts."
},
{
ConfigurationManager::KeyPaths + '.' + ConfigurationManager::KeyCache,
new StringVerifier,
+ Optional::No,
"The path to be used as a cache folder. If per scene caching is enabled, the "
- "name of the scene will be appended to this folder",
- Optional::No
+ "name of the scene will be appended to this folder"
},
{
ConfigurationManager::KeyFonts,
new StringListVerifier("Font paths loadable by FreeType"),
+ Optional::Yes,
"A list of all fonts that will automatically be loaded on startup. Each "
"key-value pair contained in the table will become the name and the file "
- "for a font.",
- Optional::Yes
+ "for a font."
},
{
ConfigurationManager::KeyLogging,
@@ -89,15 +89,15 @@ documentation::Documentation ConfigurationManager::Documentation() {
{
ConfigurationManager::PartLogDir,
new StringVerifier,
- "The directory for logs. Default value is \"${BASE_PATH}\"",
- Optional::Yes
+ Optional::Yes,
+ "The directory for logs. Default value is \"${BASE_PATH}\""
},
{
ConfigurationManager::PartLogPerformancePrefix,
new StringVerifier,
+ Optional::Yes,
"A string to prefix PerformanceMeasurement logfiles."
- "Default value is \"PM-\"",
- Optional::Yes
+ "Default value is \"PM-\""
},
{
ConfigurationManager::PartLogLevel,
@@ -105,21 +105,21 @@ documentation::Documentation ConfigurationManager::Documentation() {
// List from logmanager.cpp::levelFromString
{ "Trace", "Debug", "Info", "Warning", "Error", "Fatal", "None" }
),
+ Optional::Yes,
"The severity of log messages that will be displayed. Only "
"messages of the selected level or higher will be displayed. All "
"levels below will be silently discarded. The order of "
- "severities is: Debug < Info < Warning < Error < Fatal < None.",
- Optional::Yes
+ "severities is: Debug < Info < Warning < Error < Fatal < None."
},
{
ConfigurationManager::PartImmediateFlush,
new BoolVerifier,
+ Optional::Yes,
"Determines whether error messages will be displayed immediately "
"or if it is acceptable to have a short delay, but being more "
"performant. If the delay is allowed ('true'), messages might "
"get lost if the application crashes shortly after a message was "
- "logged.",
- Optional::Yes
+ "logged."
},
{
ConfigurationManager::PartLogs,
@@ -127,14 +127,15 @@ documentation::Documentation ConfigurationManager::Documentation() {
{
"*",
new ReferencingVerifier("core_logfactory"),
+ Optional::No,
"Additional log files"
}
}),
+ Optional::Yes,
"Per default, log messages are written to the console, the "
"onscreen text, and (if available) the Visual Studio output "
"window. This table can define other logging methods that will "
- "be used additionally.",
- Optional::Yes
+ "be used additionally."
},
{
ConfigurationManager::PartCapabilitiesVerbosity,
@@ -142,62 +143,62 @@ documentation::Documentation ConfigurationManager::Documentation() {
// List from OpenspaceEngine::initialize
{ "None", "Minimal", "Default", "Full" }
),
+ Optional::Yes,
"At startup, a list of system capabilities is created and logged."
- "This value determines how verbose this listing should be.",
- Optional::Yes
+ "This value determines how verbose this listing should be."
}
}),
+ Optional::Yes,
"Configurations for the logging of messages that are generated "
"throughout the code and are useful for debugging potential errors or "
- "other information.",
- Optional::Yes
+ "other information."
},
{
ConfigurationManager::KeyLuaDocumentation,
new StringVerifier,
+ Optional::Yes,
"The filename that will be created on startup containing the documentation "
"of available Lua functions that can be executed in scene files or per "
- "console. Any existing file will be silently overwritten.",
- Optional::Yes
+ "console. Any existing file will be silently overwritten."
},
{
ConfigurationManager::KeyPropertyDocumentation,
new StringVerifier,
+ Optional::Yes,
"The file that will be created on startup containing a list of all "
- "properties in the scene. Any existing file will be silently overwritten.",
- Optional::Yes
+ "properties in the scene. Any existing file will be silently overwritten."
},
{
ConfigurationManager::KeyScriptLog,
new StringVerifier,
+ Optional::Yes,
"The file that will be created on startup containing the log of all Lua "
"scripts that are executed in the last session. Any existing file (including "
- "the results from previous runs) will be silently overwritten.",
- Optional::Yes
+ "the results from previous runs) will be silently overwritten."
},
{
ConfigurationManager::KeyKeyboardShortcuts,
new StringVerifier,
+ Optional::Yes,
"The file that will be created on startup containing the list of all "
"keyboard bindings with their respective Lua scripts. For each key, it "
- "mentions which scripts will be executed in the current session.",
- Optional::Yes
+ "mentions which scripts will be executed in the current session."
},
{
ConfigurationManager::KeyDocumentation,
new StringVerifier,
+ Optional::Yes,
"The file that will be created on startup containing this documentation. Any "
- "previous file in this location will be silently overwritten.",
- Optional::Yes
+ "previous file in this location will be silently overwritten."
},
{
ConfigurationManager::KeyFactoryDocumentation,
new StringVerifier,
+ Optional::Yes,
"The file that will be created on startup containing the factory "
"documentation which shows the different types of objects that can be "
"created in the current application configuration. Any previous file in this "
- "location will be silently overritten.",
- Optional::Yes
+ "location will be silently overritten."
},
{
ConfigurationManager::KeyLauncher,
@@ -208,32 +209,32 @@ documentation::Documentation ConfigurationManager::Documentation() {
// List from logmanager.cpp::levelFromString
{ "Trace", "Debug", "Info", "Warning", "Error", "Fatal", "None" }
),
+ Optional::Yes,
"The severity of log messages that will be displayed. Only "
"messages of the selected level or higher will be displayed. All "
"levels below will be silently discarded. The order of "
- "severities is: Debug < Info < Warning < Error < Fatal < None.",
- Optional::Yes
+ "severities is: Debug < Info < Warning < Error < Fatal < None."
},
}),
- "Configurations for the Launcher & syncing application.",
- Optional::Yes
+ Optional::Yes,
+ "Configurations for the Launcher & syncing application."
},
{
ConfigurationManager::KeyShutdownCountdown,
new DoubleGreaterEqualVerifier(0.0),
+ Optional::Yes,
"The countdown that the application will wait between pressing ESC and "
"actually shutting down. If ESC is pressed again in this time, the "
- "shutdown is aborted.",
- Optional::Yes
+ "shutdown is aborted."
},
{
ConfigurationManager::KeyPerSceneCache,
new BoolVerifier,
+ Optional::Yes,
"If this is set to 'true', the name of the scene will be appended to the "
"cache directory, thus not reusing the same directory. This is useful in "
"cases where the same instance of OpenSpace is run with multiple scenes, but "
- "the caches should be retained. This value defaults to 'false'.",
- Optional::Yes
+ "the caches should be retained. This value defaults to 'false'."
},
{
ConfigurationManager::KeyOnScreenTextScaling,
@@ -241,11 +242,11 @@ documentation::Documentation ConfigurationManager::Documentation() {
// Values from RenderEngine:updateRenderer
"window", "framebuffer"
}),
+ Optional::Yes,
"The method for scaling the onscreen text in the window. As the resolution "
"of the rendering can be different from the size of the window, the onscreen "
"text can either be scaled according to the window size ('window'), or the "
- "rendering resolution ('framebuffer'). This value defaults to 'window'.",
- Optional::Yes
+ "rendering resolution ('framebuffer'). This value defaults to 'window'."
},
{
ConfigurationManager::KeyDownloadRequestURL,
@@ -253,10 +254,10 @@ documentation::Documentation ConfigurationManager::Documentation() {
new StringVerifier,
new StringListVerifier
),
+ Optional::Yes,
"The URL from which files will be downloaded by the Launcher. This can "
"either be a single URL or a list of possible URLs from which the "
- "Launcher can then choose.",
- Optional::Yes
+ "Launcher can then choose."
},
{
ConfigurationManager::KeyRenderingMethod,
@@ -264,27 +265,27 @@ documentation::Documentation ConfigurationManager::Documentation() {
// List from RenderEngine::setRendererFromString
{ "Framebuffer", "ABuffer" }
),
+ Optional::Yes,
"The renderer that is use after startup. The renderer 'ABuffer' requires "
- "support for at least OpenGL 4.3",
- Optional::Yes
+ "support for at least OpenGL 4.3"
},
{
ConfigurationManager::KeyDisableMasterRendering,
new BoolVerifier,
+ Optional::Yes,
"Toggles whether the master in a multi-application setup should be rendering "
"or just managing the state of the network. This is desired in cases where "
- "the master computer does not have the resources to render a scene.",
- Optional::Yes
+ "the master computer does not have the resources to render a scene."
},
{
ConfigurationManager::KeyDisableSceneOnMaster,
new BoolVerifier,
+ Optional::Yes,
"Toggles whether a potential scene transformation matrix, for example as "
"specified in an SGCT configuration file, should apply to the master node. "
"With some configurations, applying such a transformation complicates the "
"interaction and it is thus desired to disable the transformation. The "
- "default is false.",
- Optional::Yes
+ "default is false."
},
{
ConfigurationManager::KeyHttpProxy,
@@ -292,11 +293,13 @@ documentation::Documentation ConfigurationManager::Documentation() {
{
ConfigurationManager::PartHttpProxyAddress,
new StringVerifier,
+ Optional::No,
"The address of the http proxy"
},
{
ConfigurationManager::PartHttpProxyPort,
new StringVerifier,
+ Optional::No,
"The port of the http proxy"
},
{
@@ -304,25 +307,25 @@ documentation::Documentation ConfigurationManager::Documentation() {
new StringInListVerifier(
{ "basic", "ntlm", "digest", "any" }
),
- "The authentication method of the http proxy",
- Optional::Yes
+ Optional::Yes,
+ "The authentication method of the http proxy"
},
{
ConfigurationManager::PartHttpProxyUser,
new StringVerifier,
- "The user of the http proxy",
- Optional::Yes
+ Optional::Yes,
+ "The user of the http proxy"
},
{
ConfigurationManager::PartHttpProxyPassword,
new StringVerifier,
- "The password of the http proxy",
- Optional::Yes
+ Optional::Yes,
+ "The password of the http proxy"
}
}),
+ Optional::Yes,
"This defines the use for a proxy when fetching data over http."
- "No proxy will be used if this is left out.",
- Optional::Yes
+ "No proxy will be used if this is left out."
},
{
ConfigurationManager::KeyOpenGLDebugContext,
@@ -330,17 +333,17 @@ documentation::Documentation ConfigurationManager::Documentation() {
{
ConfigurationManager::PartActivate,
new BoolVerifier,
- "Determines whether the OpenGL context should be a debug context",
- Optional::No
+ Optional::No,
+ "Determines whether the OpenGL context should be a debug context"
},
{
ConfigurationManager::PartSynchronous,
new BoolVerifier,
+ Optional::Yes,
"Determines whether the OpenGL debug callbacks are performed "
"synchronously. If set to the callbacks are in the same thead "
"as the context and in the scope of the OpenGL function that "
- "triggered the message. The default value is .",
- Optional::Yes
+ "triggered the message. The default value is ."
},
{
ConfigurationManager::PartFilterIdentifier,
@@ -350,8 +353,8 @@ documentation::Documentation ConfigurationManager::Documentation() {
{
ConfigurationManager::PartFilterIdentifierIdentifier,
new IntVerifier,
- "The identifier that is to be filtered",
- Optional::No
+ Optional::No,
+ "The identifier that is to be filtered"
},
{
ConfigurationManager::PartFilterIdentifierSource,
@@ -360,8 +363,8 @@ documentation::Documentation ConfigurationManager::Documentation() {
"API", "Window System", "Shader Compiler",
"Third Party", "Application", "Other", "Don't care"
}),
- "The source of the identifier to be filtered",
- Optional::No
+ Optional::No,
+ "The source of the identifier to be filtered"
},
{
ConfigurationManager::PartFilterIdentifierType,
@@ -371,13 +374,15 @@ documentation::Documentation ConfigurationManager::Documentation() {
"Performance", "Marker", "Push group", "Pop group",
"Other", "Don't care"
}),
+ Optional::No,
"The type of the identifier to be filtered"
}
}),
+ Optional::No,
"Individual OpenGL debug message identifiers"
}}),
- "A list of OpenGL debug messages identifiers that are filtered",
- Optional::Yes
+ Optional::Yes,
+ "A list of OpenGL debug messages identifiers that are filtered"
},
{
ConfigurationManager::PartFilterSeverity,
@@ -387,32 +392,33 @@ documentation::Documentation ConfigurationManager::Documentation() {
new StringInListVerifier(
// ghoul::debugcontext.cpp
{ "High", "Medium", "Low", "Notification" }
- )
+ ),
+ Optional::No
}
}),
- "A list of severities that can are filtered out",
- Optional::Yes
+ Optional::Yes,
+ "A list of severities that can are filtered out"
}
}),
+ Optional::Yes,
"Determines the settings for the creation of an OpenGL debug context.",
- Optional::Yes
},
{
ConfigurationManager::KeyCheckOpenGLState,
new BoolVerifier,
+ Optional::Yes,
"Determines whether the OpenGL state is checked after each OpenGL function "
"call. This will dramatically slow down the rendering, but will make finding "
- "OpenGL errors easier. This defaults to 'false'.",
- Optional::Yes
+ "OpenGL errors easier. This defaults to 'false'."
},
{
ConfigurationManager::KeyLogEachOpenGLCall,
new BoolVerifier,
+ Optional::Yes,
"Determines whether each OpenGL call that happens should be logged using the "
"'TRACE' loglevel. This will bring the rendering to a crawl but provides "
"useful debugging features for the order in which OpenGL calls occur. This "
- "defaults to 'false'.",
- Optional::Yes
+ "defaults to 'false'."
}
}
};
diff --git a/src/engine/logfactory.cpp b/src/engine/logfactory.cpp
index ea6c3f84d4..0867c78f7c 100644
--- a/src/engine/logfactory.cpp
+++ b/src/engine/logfactory.cpp
@@ -67,50 +67,51 @@ documentation::Documentation LogFactoryDocumentation() {
// List from createLog
valueTextLog, valueHtmlLog
}),
+ Optional::No,
"The type of the new log to be generated."
},
{
keyFilename,
new StringVerifier,
+ Optional::No,
"The filename to which the log will be written."
},
{
keyAppend,
new BoolVerifier,
+ Optional::Yes,
"Determines whether the file will be cleared at startup or if the "
- "contents will be appended to previous runs.",
- Optional::Yes
+ "contents will be appended to previous runs."
},
{
keyTimeStamping,
new BoolVerifier,
+ Optional::Yes,
"Determines whether the log entires should be stamped with the time at "
- "which the message was logged.",
- Optional::Yes
+ "which the message was logged."
},
{
keyDateStamping,
new BoolVerifier,
+ Optional::Yes,
"Determines whether the log entries should be stamped with the date at "
- "which the message was logged.",
- Optional::Yes
+ "which the message was logged."
},
{
keyCategoryStamping,
new BoolVerifier,
+ Optional::Yes,
"Determines whether the log entries should be stamped with the "
- "category that creates the log message.",
- Optional::Yes
+ "category that creates the log message."
},
{
keyLogLevelStamping,
new BoolVerifier,
+ Optional::Yes,
"Determines whether the log entries should be stamped with the log level "
- "that was used to create the log message.",
- Optional::Yes
+ "that was used to create the log message."
}
- },
- Exhaustive::Yes
+ }
};
}
diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp
index 082452fe34..02afab7dca 100644
--- a/src/engine/openspaceengine.cpp
+++ b/src/engine/openspaceengine.cpp
@@ -144,7 +144,7 @@ OpenSpaceEngine::OpenSpaceEngine(std::string programName,
, _scriptEngine(new scripting::ScriptEngine)
, _scriptScheduler(new scripting::ScriptScheduler)
, _virtualPropertyManager(new VirtualPropertyManager)
- , _globalPropertyNamespace(new properties::PropertyOwner(""))
+ , _globalPropertyNamespace(new properties::PropertyOwner({ "" }))
, _scheduledSceneSwitch(false)
, _scenePath("")
, _runTime(0.0)
diff --git a/src/engine/settingsengine.cpp b/src/engine/settingsengine.cpp
index ee3b397e64..458f0c5fd2 100644
--- a/src/engine/settingsengine.cpp
+++ b/src/engine/settingsengine.cpp
@@ -51,7 +51,7 @@ namespace {
namespace openspace {
SettingsEngine::SettingsEngine()
- : properties::PropertyOwner("Global Properties")
+ : properties::PropertyOwner({ "Global Properties" })
, _scenes(SceneInfo, properties::OptionProperty::DisplayType::Dropdown)
{
addProperty(_scenes);
diff --git a/src/engine/virtualpropertymanager.cpp b/src/engine/virtualpropertymanager.cpp
index fefb2c06ea..5e40fc0e2e 100644
--- a/src/engine/virtualpropertymanager.cpp
+++ b/src/engine/virtualpropertymanager.cpp
@@ -28,7 +28,7 @@
namespace openspace {
-VirtualPropertyManager::VirtualPropertyManager() : properties::PropertyOwner("") {}
+VirtualPropertyManager::VirtualPropertyManager() : properties::PropertyOwner({ "" }) {}
void VirtualPropertyManager::addProperty(std::unique_ptr prop) {
// PropertyOwner does not take the ownership of the pointer
diff --git a/src/engine/wrapper/windowwrapper.cpp b/src/engine/wrapper/windowwrapper.cpp
index 4629d59592..3cb2784651 100644
--- a/src/engine/wrapper/windowwrapper.cpp
+++ b/src/engine/wrapper/windowwrapper.cpp
@@ -53,7 +53,7 @@ WindowWrapper::WindowWrapperException::WindowWrapperException(const std::string&
{}
WindowWrapper::WindowWrapper()
- : properties::PropertyOwner("WindowWrapper")
+ : properties::PropertyOwner({ "WindowWrapper" })
{}
scripting::LuaLibrary WindowWrapper::luaLibrary() {
diff --git a/src/interaction/luaconsole.cpp b/src/interaction/luaconsole.cpp
index dba135d8fc..6f100b1d10 100644
--- a/src/interaction/luaconsole.cpp
+++ b/src/interaction/luaconsole.cpp
@@ -125,7 +125,7 @@ namespace {
namespace openspace {
LuaConsole::LuaConsole()
- : properties::PropertyOwner("LuaConsole")
+ : properties::PropertyOwner({ "LuaConsole" })
, _isVisible(VisibleInfo, false)
, _remoteScripting(RemoveScriptingInfo, false)
, _backgroundColor(
diff --git a/src/interaction/navigationhandler.cpp b/src/interaction/navigationhandler.cpp
index 29b722a239..6ff64b7b76 100644
--- a/src/interaction/navigationhandler.cpp
+++ b/src/interaction/navigationhandler.cpp
@@ -68,7 +68,7 @@ namespace {
namespace openspace::interaction {
NavigationHandler::NavigationHandler()
- : properties::PropertyOwner("NavigationHandler")
+ : properties::PropertyOwner({ "NavigationHandler" })
, _origin(OriginInfo)
, _useKeyFrameInteraction(KeyFrameInfo, false)
{
diff --git a/src/interaction/orbitalnavigator.cpp b/src/interaction/orbitalnavigator.cpp
index df19529c41..e2810f306c 100644
--- a/src/interaction/orbitalnavigator.cpp
+++ b/src/interaction/orbitalnavigator.cpp
@@ -90,16 +90,24 @@ namespace {
namespace openspace::interaction {
+OrbitalNavigator::Friction::Friction()
+ : properties::PropertyOwner({ "Friction" })
+ , roll(RollFrictionInfo, true)
+ , rotational(RotationalFrictionInfo, true)
+ , zoom(ZoomFrictionInfo, true)
+{
+ addProperty(roll);
+ addProperty(rotational);
+ addProperty(zoom);
+}
+
OrbitalNavigator::OrbitalNavigator()
- : properties::PropertyOwner("OrbitalNavigator")
- , _rollFriction(RollFrictionInfo, true)
- , _rotationalFriction(RotationalFrictionInfo, true)
- , _zoomFriction(ZoomFrictionInfo, true)
+ : properties::PropertyOwner({ "OrbitalNavigator" })
, _followFocusNodeRotationDistance(FollowFocusNodeInfo, 2.0f, 0.0f, 10.f)
- , _minimumAllowedDistance(FollowFocusNodeInfo, 10.0f, 0.0f, 10000.f)
+ , _minimumAllowedDistance(MinimumDistanceInfo, 10.0f, 0.0f, 10000.f)
, _sensitivity(SensitivityInfo, 20.0f, 1.0f, 50.f)
, _motionLag(FrictionInfo, 0.5f, 0.f, 1.f)
- , _mouseStates(_sensitivity * pow(10.0,-4), 1 / (_motionLag + 0.0000001))
+ , _mouseStates(_sensitivity * pow(10.0, -4), 1 / (_motionLag + 0.0000001))
{
auto smoothStep =
[](double t) {
@@ -123,21 +131,20 @@ OrbitalNavigator::OrbitalNavigator()
// As an example f_orig(t) = 1 - t yields f(t) = 1 / (1 - t) which results in a linear
// interpolation from 1 to 0.
- auto smoothStepDerivedTranferFunction =
- [](double t) {
- return (6 * (t + t*t) / (1 - 3 * t*t + 2 * t*t*t));
- };
+ auto smoothStepDerivedTranferFunction = [](double t) {
+ return (6 * (t + t*t) / (1 - 3 * t*t + 2 * t*t*t));
+ };
_rotateToFocusNodeInterpolator.setTransferFunction(smoothStepDerivedTranferFunction);
// Define callback functions for changed properties
- _rollFriction.onChange([&]() {
- _mouseStates.setRotationalFriction(_rollFriction);
+ _friction.roll.onChange([&]() {
+ _mouseStates.setRotationalFriction(_friction.roll);
});
- _rotationalFriction.onChange([&]() {
- _mouseStates.setHorizontalFriction(_rotationalFriction);
+ _friction.rotational.onChange([&]() {
+ _mouseStates.setHorizontalFriction(_friction.rotational);
});
- _zoomFriction.onChange([&]() {
- _mouseStates.setVerticalFriction(_zoomFriction);
+ _friction.zoom.onChange([&]() {
+ _mouseStates.setVerticalFriction(_friction.zoom);
});
_sensitivity.onChange([&]() {
_mouseStates.setSensitivity(_sensitivity * pow(10.0,-4));
@@ -146,18 +153,15 @@ OrbitalNavigator::OrbitalNavigator()
_mouseStates.setVelocityScaleFactor(1 / (_motionLag + 0.0000001));
});
- // Add the properties
- addProperty(_rollFriction);
- addProperty(_rotationalFriction);
- addProperty(_zoomFriction);
+ addPropertySubOwner(_friction);
+
addProperty(_followFocusNodeRotationDistance);
addProperty(_minimumAllowedDistance);
addProperty(_sensitivity);
addProperty(_motionLag);
}
-OrbitalNavigator::~OrbitalNavigator()
-{ }
+OrbitalNavigator::~OrbitalNavigator() {}
void OrbitalNavigator::updateMouseStatesFromInput(const InputState& inputState,
double deltaTime)
@@ -165,9 +169,7 @@ void OrbitalNavigator::updateMouseStatesFromInput(const InputState& inputState,
_mouseStates.updateMouseStatesFromInput(inputState, deltaTime);
}
-void OrbitalNavigator::updateCameraStateFromMouseStates(Camera& camera,
- double deltaTime)
-{
+void OrbitalNavigator::updateCameraStateFromMouseStates(Camera& camera, double deltaTime){
if (_focusNode) {
// Read the current state of the camera
glm::dvec3 camPos = camera.positionVec3();
@@ -332,7 +334,7 @@ OrbitalNavigator::CameraRotationDecomposition
}
glm::dquat OrbitalNavigator::roll(double deltaTime,
- const glm::dquat& localCameraRotation) const
+ const glm::dquat& localCameraRotation) const
{
glm::dquat rollQuat = glm::angleAxis(
_mouseStates.localRollMouseVelocity().x * deltaTime,
@@ -353,9 +355,8 @@ glm::dquat OrbitalNavigator::rotateLocally(double deltaTime,
return localCameraRotation * rotationDiff;
}
-glm::dquat OrbitalNavigator::interpolateLocalRotation(
- double deltaTime,
- const glm::dquat& localCameraRotation)
+glm::dquat OrbitalNavigator::interpolateLocalRotation(double deltaTime,
+ const glm::dquat& localCameraRotation)
{
if (_rotateToFocusNodeInterpolator.isInterpolating()) {
double t = _rotateToFocusNodeInterpolator.value();
@@ -375,13 +376,12 @@ glm::dquat OrbitalNavigator::interpolateLocalRotation(
}
}
-glm::dvec3 OrbitalNavigator::translateHorizontally(
- double deltaTime,
- const glm::dvec3& cameraPosition,
- const glm::dvec3& objectPosition,
- const glm::dquat& /*focusNodeRotationDiff*/,
- const glm::dquat& globalCameraRotation,
- const SurfacePositionHandle& positionHandle) const
+glm::dvec3 OrbitalNavigator::translateHorizontally(double deltaTime,
+ const glm::dvec3& cameraPosition,
+ const glm::dvec3& objectPosition,
+ const glm::dquat& /*focusNodeRotationDiff*/,
+ const glm::dquat& globalCameraRotation,
+ const SurfacePositionHandle& positionHandle) const
{
glm::dmat4 modelTransform = _focusNode->modelTransform();
diff --git a/src/mission/mission.cpp b/src/mission/mission.cpp
index 2dac741175..5c702c1d29 100644
--- a/src/mission/mission.cpp
+++ b/src/mission/mission.cpp
@@ -50,32 +50,31 @@ documentation::Documentation MissionPhase::Documentation() {
{
KeyName,
new StringVerifier,
+ Optional::No,
"The human readable name of this mission or mission phase that is "
- "displayed to the user.",
- Optional::No
+ "displayed to the user."
},
{
KeyDescription,
new StringVerifier,
- "A description of this mission or mission phase.",
- Optional::Yes
+ Optional::Yes,
+ "A description of this mission or mission phase."
},
{
KeyTimeRange,
new ReferencingVerifier("core_util_timerange"),
+ Optional::Yes,
"The time range for which this mission or mission phase is valid. If no "
"time range is specified, the ranges of sub mission phases are used "
- "instead.",
- Optional::Yes
+ "instead."
},
{
KeyPhases,
new ReferencingVerifier("core_mission_mission"),
- "The phases into which this mission or mission phase is separated.",
- Optional::Yes
+ Optional::Yes,
+ "The phases into which this mission or mission phase is separated."
}
- },
- Exhaustive::Yes
+ }
};
}
diff --git a/src/network/parallelconnection.cpp b/src/network/parallelconnection.cpp
index aa817dd756..a5dc973343 100644
--- a/src/network/parallelconnection.cpp
+++ b/src/network/parallelconnection.cpp
@@ -150,7 +150,7 @@ namespace {
namespace openspace {
ParallelConnection::ParallelConnection()
- : properties::PropertyOwner("ParallelConnection")
+ : properties::PropertyOwner({ "ParallelConnection" })
, _password(PasswordInfo)
, _hostPassword(HostPasswordInfo)
, _port(PortInfo, "20501")
diff --git a/src/properties/propertyowner.cpp b/src/properties/propertyowner.cpp
index 00435e5b4c..671dde7fe6 100644
--- a/src/properties/propertyowner.cpp
+++ b/src/properties/propertyowner.cpp
@@ -45,8 +45,9 @@ namespace {
} // namespace
-PropertyOwner::PropertyOwner(std::string name)
- : _name(std::move(name))
+PropertyOwner::PropertyOwner(PropertyOwnerInfo info)
+ : _name(std::move(info.name))
+ , _description(std::move(info.description))
, _owner(nullptr)
{}
@@ -269,10 +270,18 @@ void PropertyOwner::setName(std::string name) {
_name = std::move(name);
}
-const std::string& PropertyOwner::name() const {
+std::string PropertyOwner::name() const {
return _name;
}
+void PropertyOwner::setDescription(std::string description) {
+ _description = std::move(description);
+}
+
+std::string PropertyOwner::description() const {
+ return _description;
+}
+
std::vector PropertyOwner::tags() const {
return _tags;
}
diff --git a/src/rendering/renderable.cpp b/src/rendering/renderable.cpp
index 65b51003ed..645b2664f1 100644
--- a/src/rendering/renderable.cpp
+++ b/src/rendering/renderable.cpp
@@ -62,11 +62,11 @@ documentation::Documentation Renderable::Documentation() {
{
KeyType,
new StringAnnotationVerifier("A valid Renderable created by a factory"),
+ Optional::No,
"This key specifies the type of Renderable that gets created. It has to be one"
"of the valid Renderables that are available for creation (see the "
"FactoryDocumentation for a list of possible Renderables), which depends on "
- "the configration of the application",
- Optional::No
+ "the configration of the application"
}
}
};
@@ -98,7 +98,7 @@ std::unique_ptr Renderable::createFromDictionary(
}
Renderable::Renderable(const ghoul::Dictionary& dictionary)
- : properties::PropertyOwner("renderable")
+ : properties::PropertyOwner({ "renderable" })
, _enabled(EnabledInfo, true)
, _renderBin(RenderBin::Opaque)
, _startTime("")
@@ -139,6 +139,10 @@ Renderable::Renderable(const ghoul::Dictionary& dictionary)
Renderable::~Renderable() {}
+void Renderable::initialize() {}
+
+void Renderable::deinitialize() {}
+
void Renderable::setBoundingSphere(float boundingSphere) {
_boundingSphere = boundingSphere;
}
diff --git a/src/rendering/renderengine.cpp b/src/rendering/renderengine.cpp
index 15e772a277..08766aee41 100644
--- a/src/rendering/renderengine.cpp
+++ b/src/rendering/renderengine.cpp
@@ -188,7 +188,7 @@ namespace {
namespace openspace {
RenderEngine::RenderEngine()
- : properties::PropertyOwner("RenderEngine")
+ : properties::PropertyOwner({ "RenderEngine" })
, _camera(nullptr)
, _scene(nullptr)
, _raycasterManager(nullptr)
diff --git a/src/rendering/screenspacerenderable.cpp b/src/rendering/screenspacerenderable.cpp
index a9af742723..29966e3c80 100644
--- a/src/rendering/screenspacerenderable.cpp
+++ b/src/rendering/screenspacerenderable.cpp
@@ -121,11 +121,11 @@ documentation::Documentation ScreenSpaceRenderable::Documentation() {
{
KeyType,
new StringAnnotationVerifier("Must name a valid Screenspace renderable"),
+ Optional::No,
"The type of the Screenspace renderable that is to be created. The "
"available types of Screenspace renderable depend on the configuration of"
"the application and can be written to disk on application startup into "
- "the FactoryDocumentation.",
- Optional::No
+ "the FactoryDocumentation."
}
}
};
@@ -155,7 +155,7 @@ std::unique_ptr ScreenSpaceRenderable::createFromDictiona
}
ScreenSpaceRenderable::ScreenSpaceRenderable(const ghoul::Dictionary& dictionary)
- : properties::PropertyOwner("")
+ : properties::PropertyOwner({ "" })
, _enabled(EnabledInfo, true)
, _useFlatScreen(FlatScreenInfo, true)
, _euclideanPosition(
diff --git a/src/scene/rotation.cpp b/src/scene/rotation.cpp
index 9aaee189a8..c8965f35a7 100644
--- a/src/scene/rotation.cpp
+++ b/src/scene/rotation.cpp
@@ -47,11 +47,11 @@ documentation::Documentation Rotation::Documentation() {
{
KeyType,
new StringAnnotationVerifier("Must name a valid Rotation type."),
+ Optional::No,
"The type of the rotation that is described in this element. The "
"available types of rotations depend on the configuration of the "
"application and can be written to disk on application startup into the "
- "FactoryDocumentation.",
- Optional::No
+ "FactoryDocumentation."
}
}
};
@@ -67,11 +67,11 @@ std::unique_ptr Rotation::createFromDictionary(const ghoul::Dictionary
}
Rotation::Rotation()
- : properties::PropertyOwner("Rotation")
+ : properties::PropertyOwner({ "Rotation" })
{}
Rotation::Rotation(const ghoul::Dictionary&)
- : properties::PropertyOwner("Rotation")
+ : properties::PropertyOwner({ "Rotation" })
{}
bool Rotation::initialize() {
diff --git a/src/scene/scale.cpp b/src/scene/scale.cpp
index cd2c152186..dae3cf2ae1 100644
--- a/src/scene/scale.cpp
+++ b/src/scene/scale.cpp
@@ -48,14 +48,13 @@ documentation::Documentation Scale::Documentation() {
{
KeyType,
new StringAnnotationVerifier("Must name a valid Scale type"),
+ Optional::No,
"The type of the scaling that is described in this element. "
"The available types of scaling depend on the configuration "
"of the application and can be written to disk on "
- "application startup into the FactoryDocumentation.",
- Optional::No
+ "application startup into the FactoryDocumentation."
}
- },
- Exhaustive::No
+ }
};
}
@@ -72,7 +71,7 @@ std::unique_ptr Scale::createFromDictionary(const ghoul::Dictionary& dict
}
Scale::Scale()
- : properties::PropertyOwner("Scale")
+ : properties::PropertyOwner({ "Scale" })
{}
bool Scale::initialize() {
diff --git a/src/scene/scene.cpp b/src/scene/scene.cpp
index 2f65a7b5d7..0321bac716 100644
--- a/src/scene/scene.cpp
+++ b/src/scene/scene.cpp
@@ -212,13 +212,10 @@ void Scene::sortTopologically() {
void Scene::initialize() {
for (SceneGraphNode* node : _topologicallySortedNodes) {
try {
- bool success = node->initialize();
- if (success)
- LDEBUG(node->name() << " initialized successfully!");
- else
- LWARNING(node->name() << " not initialized.");
+ node->initialize();
}
catch (const ghoul::RuntimeError& e) {
+ LERROR(node->name() << " not initialized.");
LERRORC(std::string(_loggerCat) + "(" + e.component + ")", e.what());
}
}
@@ -290,7 +287,8 @@ std::string Scene::generateJson() const {
json << "\"id\": \"" << p->identifier() << "\",";
json << "\"type\": \"" << p->className() << "\",";
json << "\"fullyQualifiedId\": \"" << p->fullyQualifiedIdentifier() << "\",";
- json << "\"guiName\": \"" << p->guiName() << "\"";
+ json << "\"guiName\": \"" << p->guiName() << "\",";
+ json << "\"description\": \"" << escapedJson(p->description()) << "\"";
json << "}";
if (p != properties.back()) {
json << ",";
diff --git a/src/scene/scene_doc.inl b/src/scene/scene_doc.inl
index c6be2cc5a2..7e12ff7475 100644
--- a/src/scene/scene_doc.inl
+++ b/src/scene/scene_doc.inl
@@ -37,16 +37,16 @@ documentation::Documentation Scene::Documentation() {
{
"ScenePath",
new StringVerifier,
+ Optional::Yes,
"The path to the base directory of the scene. The path is considered "
- "relative to the location of the scene description file.",
- Optional::Yes
+ "relative to the location of the scene description file."
},
{
"CommonFolder",
new StringAnnotationVerifier("A valid scene module folder"),
+ Optional::Yes,
"The path to the common folder that is loaded and will be bound to the "
- "${COMMON_MODULE} path token so that assets can be reused easily.",
- Optional::Yes
+ "${COMMON_MODULE} path token so that assets can be reused easily."
},
{
"Camera",
@@ -54,37 +54,42 @@ documentation::Documentation Scene::Documentation() {
{
"Focus",
new StringAnnotationVerifier("A valid object in the scene"),
+ Optional::No,
"The initial focus node of the camera, i.e., the node around which "
"the interaction will be performed."
},
{
"Position",
new DoubleVector3Verifier,
- "The initial camera positive relative to the focus object.",
- Optional::Yes
+ Optional::Yes,
+ "The initial camera positive relative to the focus object."
},
{
"Rotation",
new DoubleVector4Verifier,
- "The initial camera rotation expressed as a quaternion.",
- Optional::Yes
+ Optional::Yes,
+ "The initial camera rotation expressed as a quaternion."
}
}),
+ Optional::Yes,
"Definitions of the camera starting parameters, such as focus, location, and "
- "orientation.",
- Optional::Yes
+ "orientation."
},
{
"Modules",
new TableVerifier({
- { "*", new StringAnnotationVerifier(
+ {
+ "*",
+ new StringVerifier,
+ Optional::No,
"Loadable module folders. This means that they either have to point "
"to a folder that contains a ModuleFile or a folder which contains "
"other folders that eventually contain ModuleFile. This second "
"recursive approach is useful for grouping modules into logical "
"units."
- )}
+ }
}),
+ Optional::No,
"This is the list of modules that will be loaded into the initial scene. The "
"values in this table have to correspond to folders relative to the "
"ScenePath key. The order in which the modules are loaded is the same as the "
diff --git a/src/scene/scenegraphnode.cpp b/src/scene/scenegraphnode.cpp
index 4f65fa39fd..411917d809 100644
--- a/src/scene/scenegraphnode.cpp
+++ b/src/scene/scenegraphnode.cpp
@@ -166,7 +166,7 @@ std::unique_ptr SceneGraphNode::createFromDictionary(const ghoul
}
SceneGraphNode::SceneGraphNode()
- : properties::PropertyOwner("")
+ : properties::PropertyOwner({ "" })
, _parent(nullptr)
, _scene(nullptr)
, _performanceRecord({0, 0, 0, 0, 0})
@@ -182,7 +182,7 @@ SceneGraphNode::~SceneGraphNode() {
deinitialize();
}
-bool SceneGraphNode::initialize() {
+void SceneGraphNode::initialize() {
if (_renderable) {
_renderable->initialize();
}
@@ -197,11 +197,9 @@ bool SceneGraphNode::initialize() {
if (_transform.scale) {
_transform.scale->initialize();
}
-
- return true;
}
-bool SceneGraphNode::deinitialize() {
+void SceneGraphNode::deinitialize() {
LDEBUG("Deinitialize: " << name());
if (_renderable) {
@@ -210,10 +208,7 @@ bool SceneGraphNode::deinitialize() {
}
_children.clear();
- // reset variables
_parent = nullptr;
-
- return true;
}
void SceneGraphNode::traversePreOrder(std::function fn) {
diff --git a/src/scene/scenegraphnode_doc.inl b/src/scene/scenegraphnode_doc.inl
index 2766c91ee4..038d6c001e 100644
--- a/src/scene/scenegraphnode_doc.inl
+++ b/src/scene/scenegraphnode_doc.inl
@@ -37,33 +37,33 @@ documentation::Documentation SceneGraphNode::Documentation() {
{
"Name",
new StringVerifier,
+ Optional::No,
"The name of this scenegraph node. This name must be unique among all scene "
"graph nodes that are loaded in a specific scene. If a duplicate is detected "
"the loading of the node will fail, as will all childing that depend on the "
- "node.",
- Optional::No
+ "node."
},
{
"Parent",
new StringAnnotationVerifier(
"Must be a name for another scenegraph node, or 'Root'"
),
+ Optional::No,
"This names the parent of the currently specified scenegraph node. The "
"parent must not have been defined earlier, but must exist at loading time, "
"or the scenegraph node creation will fail. A special parent 'Root' is "
- "available that denotes the root of the scenegraph.",
- Optional::No
+ "available that denotes the root of the scenegraph."
},
{
"Renderable",
new ReferencingVerifier("renderable"),
+ Optional::Yes,
"The renderable that is to be created for this scenegraph node. A renderable "
"is a component of a scenegraph node that will lead to some visual result on "
"the screen. The specifics heavily depend on the 'Type' of the renderable. "
"If no Renderable is specified, this scenegraph node is an internal node and "
"can be used for either group children, or apply common transformations to a "
- "group of children.",
- Optional::Yes
+ "group of children."
},
{
"Transform",
@@ -71,33 +71,33 @@ documentation::Documentation SceneGraphNode::Documentation() {
{
"Translation",
new ReferencingVerifier("core_transform_translation"),
+ Optional::Yes,
"This node describes a translation that is applied to the scenegraph "
"node and all its children. Depending on the 'Type' of the "
"translation, this can either be a static translation or a "
- "time-varying one.",
- Optional::Yes
+ "time-varying one."
},
{
"Rotation",
new ReferencingVerifier("core_transform_rotation"),
+ Optional::Yes,
"This nodes describes a rotation that is applied to the scenegraph "
"node and all its children. Depending on the 'Type' of the rotation, "
- "this can either be a static rotation or a time-varying one.",
- Optional::Yes
+ "this can either be a static rotation or a time-varying one."
},
{
"Scale",
new ReferencingVerifier("core_transform_scaling"),
+ Optional::Yes,
"This node describes a scaling that is applied to the scenegraph "
"node and all its children. Depending on the 'Type' of the scaling, "
- "this can either be a static scaling or a time-varying one.",
- Optional::Yes
+ "this can either be a static scaling or a time-varying one."
}
}),
+ Optional::Yes,
"This describes a set of transformations that are applied to this scenegraph "
"node and all of its children. There are only three possible values "
- "corresponding to a 'Translation', a 'Rotation', and a 'Scale'.",
- Optional::Yes
+ "corresponding to a 'Translation', a 'Rotation', and a 'Scale'."
},
}
};
diff --git a/src/scene/translation.cpp b/src/scene/translation.cpp
index 9dc3eb3931..03d07c7aba 100644
--- a/src/scene/translation.cpp
+++ b/src/scene/translation.cpp
@@ -47,14 +47,13 @@ documentation::Documentation Translation::Documentation() {
{
KeyType,
new StringAnnotationVerifier("Must name a valid Translation type"),
+ Optional::No,
"The type of translation that is described in this element. "
"The available types of translations depend on the "
"configuration of the application and can be written to disk "
- "on application startup into the FactoryDocumentation.",
- Optional::No
+ "on application startup into the FactoryDocumentation."
}
- },
- Exhaustive::No
+ }
};
}
@@ -73,7 +72,7 @@ std::unique_ptr Translation::createFromDictionary(
}
Translation::Translation()
- : properties::PropertyOwner("Translation")
+ : properties::PropertyOwner({ "Translation" })
{}
bool Translation::initialize() {
diff --git a/src/scripting/scriptengine.cpp b/src/scripting/scriptengine.cpp
index 2a3d95e536..13d24c4311 100644
--- a/src/scripting/scriptengine.cpp
+++ b/src/scripting/scriptengine.cpp
@@ -408,100 +408,114 @@ void ScriptEngine::addLibraryFunctions(lua_State* state, LuaLibrary& library, bo
}
void ScriptEngine::addBaseLibrary() {
- LuaLibrary lib = {
- "",
+LuaLibrary lib = {
+ "",
+ {
{
- {
- "printTrace",
- &luascriptfunctions::printTrace,
- "*",
- "Logs the passed value to the installed LogManager with a LogLevel of "
- "'Trace'"
- },
- {
- "printDebug",
- &luascriptfunctions::printDebug,
- "*",
- "Logs the passed value to the installed LogManager with a LogLevel of "
- "'Debug'"
- },
- {
- "printInfo",
- &luascriptfunctions::printInfo,
- "*",
- "Logs the passed value to the installed LogManager with a LogLevel of "
- "'Info'"
- },
- {
- "printWarning",
- &luascriptfunctions::printWarning,
- "*",
- "Logs the passed value to the installed LogManager with a LogLevel of "
- "'Warning'"
- },
- {
- "printError",
- &luascriptfunctions::printError,
- "*",
- "Logs the passed value to the installed LogManager with a LogLevel of "
- "'Error'"
- },
- {
- "printFatal",
- &luascriptfunctions::printFatal,
- "*",
- "Logs the passed value to the installed LogManager with a LogLevel of "
- "'Fatal'"
- },
- {
- "absPath",
- &luascriptfunctions::absolutePath,
- "string",
- "Returns the absolute path to the passed path, resolving path tokens as "
- "well as resolving relative paths"
- },
- {
- "fileExists",
- &luascriptfunctions::fileExists,
- "string",
- "Checks whether the provided file exists."
- },
- {
- "setPathToken",
- &luascriptfunctions::setPathToken,
- "string, string",
- "Registers a new path token provided by the first argument to the path "
- "provided in the second argument"
- },
- {
- "walkDirectory",
- &luascriptfunctions::walkDirectory,
- "string [bool, bool]",
- "Walks a directory and returns all contents (files and directories) of "
- "the directory as absolute paths. The first argument is the path of the "
- "directory that should be walked, the second argument determines if the "
- "walk is recursive and will continue in contained directories. The third "
- "argument determines whether the table that is returned is sorted."
- },
- {
- "walkDirectoryFiles",
- &luascriptfunctions::walkDirectoryFiles,
- "string [bool, bool]",
- "Walks a directory and returns the files of the directory as absolute "
- "paths. The first argument is the path of the directory that should be "
- "walked, the second argument determines if the walk is recursive and "
- "will continue in contained directories. The third argument determines "
- "whether the table that is returned is sorted."
- },
- {
- "walkDirectoryFolder",
- &luascriptfunctions::walkDirectoryFolder,
- "string [bool, bool]",
- "Walks a directory and returns the subfolders of the directory as "
- "absolute paths. The first argument is the path of the directory that "
- "should be walked, the second argument determines if the walk is "
- "recursive and will continue in contained directories. The third "
- "argument determines whether the table that is returned is sorted."
+ "printTrace",
+ &luascriptfunctions::printTrace,
+ "*",
+ "Logs the passed value to the installed LogManager with a LogLevel of "
+ "'Trace'"
+ },
+ {
+ "printDebug",
+ &luascriptfunctions::printDebug,
+ "*",
+ "Logs the passed value to the installed LogManager with a LogLevel of "
+ "'Debug'"
+ },
+ {
+ "printInfo",
+ &luascriptfunctions::printInfo,
+ "*",
+ "Logs the passed value to the installed LogManager with a LogLevel of "
+ "'Info'"
+ },
+ {
+ "printWarning",
+ &luascriptfunctions::printWarning,
+ "*",
+ "Logs the passed value to the installed LogManager with a LogLevel of "
+ "'Warning'"
+ },
+ {
+ "printError",
+ &luascriptfunctions::printError,
+ "*",
+ "Logs the passed value to the installed LogManager with a LogLevel of "
+ "'Error'"
+ },
+ {
+ "printFatal",
+ &luascriptfunctions::printFatal,
+ "*",
+ "Logs the passed value to the installed LogManager with a LogLevel of "
+ "'Fatal'"
+ },
+ {
+ "absPath",
+ &luascriptfunctions::absolutePath,
+ "string",
+ "Returns the absolute path to the passed path, resolving path tokens as "
+ "well as resolving relative paths"
+ },
+ {
+ "fileExists",
+ &luascriptfunctions::fileExists,
+ "string",
+ "Checks whether the provided file exists."
+ },
+ {
+ "directoryExists",
+ &luascriptfunctions::directoryExists,
+ "string",
+ "Chckes whether the provided directory exists."
+ },
+ {
+ "setPathToken",
+ &luascriptfunctions::setPathToken,
+ "string, string",
+ "Registers a new path token provided by the first argument to the path "
+ "provided in the second argument"
+ },
+ {
+ "walkDirectory",
+ &luascriptfunctions::walkDirectory,
+ "string [bool, bool]",
+ "Walks a directory and returns all contents (files and directories) of "
+ "the directory as absolute paths. The first argument is the path of the "
+ "directory that should be walked, the second argument determines if the "
+ "walk is recursive and will continue in contained directories. The third "
+ "argument determines whether the table that is returned is sorted."
+ },
+ {
+ "walkDirectoryFiles",
+ &luascriptfunctions::walkDirectoryFiles,
+ "string [bool, bool]",
+ "Walks a directory and returns the files of the directory as absolute "
+ "paths. The first argument is the path of the directory that should be "
+ "walked, the second argument determines if the walk is recursive and "
+ "will continue in contained directories. The third argument determines "
+ "whether the table that is returned is sorted."
+ },
+ {
+ "walkDirectoryFolder",
+ &luascriptfunctions::walkDirectoryFolder,
+ "string [bool, bool]",
+ "Walks a directory and returns the subfolders of the directory as "
+ "absolute paths. The first argument is the path of the directory that "
+ "should be walked, the second argument determines if the walk is "
+ "recursive and will continue in contained directories. The third "
+ "argument determines whether the table that is returned is sorted."
+ },
+ {
+ "directoryForPath",
+ &luascriptfunctions::directoryForPath,
+ "string",
+ "This function extracts the directory part of the passed path. For example, "
+ "if the parameter is 'C:/OpenSpace/foobar/foo.txt', this function returns "
+ "'C:/OpenSpace/foobar'."
}
}
};
diff --git a/src/scripting/scriptengine_lua.inl b/src/scripting/scriptengine_lua.inl
index cc966c168a..de5ba643d2 100644
--- a/src/scripting/scriptengine_lua.inl
+++ b/src/scripting/scriptengine_lua.inl
@@ -226,12 +226,8 @@ int setPathToken(lua_State* L) {
/**
* \ingroup LuaScripts
- * walkDirectory(string, bool, bool):
- * Walks a directory and returns the contents of the directory as absolute paths. The
- * first argument is the path of the directory that should be walked, the second argument
- * determines if the walk is recursive and will continue in contained directories. The
- * default value for this parameter is "false". The third argument determines whether the
- * table that is returned is sorted. The default value for this parameter is "false".
+ * fileExists(string):
+ * Checks whether the provided file exists
*/
int fileExists(lua_State* L) {
const int nArguments = lua_gettop(L);
@@ -241,10 +237,24 @@ int fileExists(lua_State* L) {
const std::string file = luaL_checkstring(L, -1);
const bool e = FileSys.fileExists(absPath(file));
- lua_pushboolean(
- L,
- e ? 1 : 0
- );
+ lua_pushboolean(L, (e ? 1 : 0));
+ return 1;
+}
+
+/**
+* \ingroup LuaScripts
+* directoryExists(string):
+* Checks whether the provided file exists
+*/
+int directoryExists(lua_State* L) {
+ const int nArguments = lua_gettop(L);
+ if (nArguments != 1) {
+ return luaL_error(L, "Expected %i arguments, got %i", 1, nArguments);
+ }
+
+ const std::string file = luaL_checkstring(L, -1);
+ const bool e = FileSys.directoryExists(absPath(file));
+ lua_pushboolean(L, (e ? 1 : 0));
return 1;
}
@@ -286,7 +296,26 @@ int walkDirectoryFiles(lua_State* L) {
*/
int walkDirectoryFolder(lua_State* L) {
return walkCommon(L, &ghoul::filesystem::Directory::readDirectories);
+}
+
+/**
+ * \ingroup LuaScripts
+ * directoryForPath(string):
+ * This function extracts the directory part of the passed path. For example, if the
+ * parameter is 'C:\\OpenSpace\\foobar\\foo.txt', this function returns
+ * 'C:\\OpenSpace\\foobar'."
+ */
+int directoryForPath(lua_State* L) {
+ const int nArguments = lua_gettop(L);
+ if (nArguments != 1) {
+ return luaL_error(L, "Expected %i arguments, got %i", 1, nArguments);
+ }
+
+ const std::string file = luaL_checkstring(L, -1);
+ const std::string path = ghoul::filesystem::File(file).directoryName();
+ lua_pushstring(L, path.c_str());
+ return 1;
}
} // namespace openspace::luascriptfunctions
diff --git a/src/scripting/scriptscheduler.cpp b/src/scripting/scriptscheduler.cpp
index 5b7db34bef..afe21bc787 100644
--- a/src/scripting/scriptscheduler.cpp
+++ b/src/scripting/scriptscheduler.cpp
@@ -61,39 +61,39 @@ documentation::Documentation ScriptScheduler::Documentation() {
{
KeyTime,
new TimeVerifier,
+ Optional::No,
"The time at which, when the in game time passes it, the two "
"scripts will be executed. If the traversal is forwards (towards "
"+ infinity), the ForwardScript will be executed, otherwise the "
- "BackwardScript will be executed instead.",
- Optional::No
+ "BackwardScript will be executed instead."
},
{
KeyUniversalScript,
new LuaScriptVerifier,
+ Optional::Yes,
"The Lua script that will be executed when the specified time is "
"passed independent of its direction. This script will be "
"executed before the specific scripts if both versions are "
- "specified",
- Optional::Yes
+ "specified"
},
{
KeyForwardScript,
new LuaScriptVerifier,
+ Optional::Yes,
"The Lua script that is executed when OpenSpace passes the time "
- "in a forward direction.",
- Optional::Yes
+ "in a forward direction."
},
{
KeyBackwardScript,
new LuaScriptVerifier,
+ Optional::Yes,
"The Lua script that is executed when OpenSpace passes the time "
- "in a backward direction.",
- Optional::Yes
+ "in a backward direction."
}
- })
+ }),
+ Optional::No
}
- },
- Exhaustive::Yes
+ }
};
}
diff --git a/src/util/openspacemodule.cpp b/src/util/openspacemodule.cpp
index ebd51b5bdf..09e6f5032b 100644
--- a/src/util/openspacemodule.cpp
+++ b/src/util/openspacemodule.cpp
@@ -39,7 +39,7 @@ namespace {
namespace openspace {
OpenSpaceModule::OpenSpaceModule(std::string name)
- : properties::PropertyOwner(std::move(name))
+ : properties::PropertyOwner({ std::move(name) })
{}
void OpenSpaceModule::initialize() {
diff --git a/src/util/task.cpp b/src/util/task.cpp
index 891614c1c2..2efc36d0cb 100644
--- a/src/util/task.cpp
+++ b/src/util/task.cpp
@@ -41,11 +41,11 @@ documentation::Documentation Task::documentation() {
{
"Type",
new StringAnnotationVerifier("A valid Task created by a factory"),
+ Optional::No,
"This key specifies the type of Task that gets created. It has to be one"
"of the valid Tasks that are available for creation (see the "
"FactoryDocumentation for a list of possible Tasks), which depends on "
- "the configration of the application",
- Optional::No
+ "the configration of the application"
}
}
};
diff --git a/src/util/timerange.cpp b/src/util/timerange.cpp
index 7c74baeb79..16b890b728 100644
--- a/src/util/timerange.cpp
+++ b/src/util/timerange.cpp
@@ -46,17 +46,16 @@ documentation::Documentation TimeRange::Documentation() {
{
KeyStart,
new StringAnnotationVerifier("A string representing a valid date"),
- "The start date of the time range",
- Optional::No
+ Optional::No,
+ "The start date of the time range"
},
{
KeyEnd,
new StringAnnotationVerifier("A string representing a valid date"),
- "The end date of the time range",
- Optional::No
+ Optional::No,
+ "The end date of the time range"
}
- },
- Exhaustive::Yes
+ }
};
}
diff --git a/tests/test_documentation.inl b/tests/test_documentation.inl
index a1ee9982ff..ad07e0f360 100644
--- a/tests/test_documentation.inl
+++ b/tests/test_documentation.inl
@@ -40,62 +40,62 @@ TEST_F(DocumentationTest, Constructor) {
Documentation doc;
// Basic Verifiers
- doc.entries.emplace_back("BoolVerifier", new BoolVerifier);
- doc.entries.emplace_back("DoubleVerifier", new DoubleVerifier);
- doc.entries.emplace_back("IntVerifier", new IntVerifier);
- doc.entries.emplace_back("StringVerifier", new StringVerifier);
- doc.entries.emplace_back("TableVerifier", new TableVerifier);
+ doc.entries.emplace_back("BoolVerifier", new BoolVerifier, Optional::No);
+ doc.entries.emplace_back("DoubleVerifier", new DoubleVerifier, Optional::No);
+ doc.entries.emplace_back("IntVerifier", new IntVerifier, Optional::No);
+ doc.entries.emplace_back("StringVerifier", new StringVerifier, Optional::No);
+ doc.entries.emplace_back("TableVerifier", new TableVerifier, Optional::No);
// Operator Verifiers
- doc.entries.emplace_back("LessDouble", new DoubleLessVerifier(0.0));
- doc.entries.emplace_back("LessInt", new IntLessVerifier(0));
+ doc.entries.emplace_back("LessDouble", new DoubleLessVerifier(0.0), Optional::No);
+ doc.entries.emplace_back("LessInt", new IntLessVerifier(0), Optional::No);
- doc.entries.emplace_back("LessEqualDouble", new DoubleLessEqualVerifier(0.0));
- doc.entries.emplace_back("LessEqualInt", new IntLessEqualVerifier(0));
+ doc.entries.emplace_back("LessEqualDouble", new DoubleLessEqualVerifier(0.0), Optional::No);
+ doc.entries.emplace_back("LessEqualInt", new IntLessEqualVerifier(0), Optional::No);
- doc.entries.emplace_back("GreaterDouble", new DoubleGreaterVerifier(0.0));
- doc.entries.emplace_back("GreaterInt", new IntGreaterVerifier(0));
+ doc.entries.emplace_back("GreaterDouble", new DoubleGreaterVerifier(0.0), Optional::No);
+ doc.entries.emplace_back("GreaterInt", new IntGreaterVerifier(0), Optional::No);
- doc.entries.emplace_back("GreaterEqualDouble", new DoubleGreaterEqualVerifier(0.0));
- doc.entries.emplace_back("GreaterEqualInt", new IntGreaterEqualVerifier(0));
+ doc.entries.emplace_back("GreaterEqualDouble", new DoubleGreaterEqualVerifier(0.0), Optional::No);
+ doc.entries.emplace_back("GreaterEqualInt", new IntGreaterEqualVerifier(0), Optional::No);
- doc.entries.emplace_back("EqualBool", new BoolEqualVerifier(false));
- doc.entries.emplace_back("EqualDouble", new DoubleEqualVerifier(0.0));
- doc.entries.emplace_back("EqualInt", new IntEqualVerifier(0));
- doc.entries.emplace_back("EqualString", new StringEqualVerifier(""));
+ doc.entries.emplace_back("EqualBool", new BoolEqualVerifier(false), Optional::No);
+ doc.entries.emplace_back("EqualDouble", new DoubleEqualVerifier(0.0), Optional::No);
+ doc.entries.emplace_back("EqualInt", new IntEqualVerifier(0), Optional::No);
+ doc.entries.emplace_back("EqualString", new StringEqualVerifier(""), Optional::No);
- doc.entries.emplace_back("UnequalBool", new BoolUnequalVerifier(false));
- doc.entries.emplace_back("UnequalDouble", new DoubleUnequalVerifier(0.0));
- doc.entries.emplace_back("UnequalInt", new IntUnequalVerifier(0));
- doc.entries.emplace_back("UnequalString", new StringUnequalVerifier(""));
+ doc.entries.emplace_back("UnequalBool", new BoolUnequalVerifier(false), Optional::No);
+ doc.entries.emplace_back("UnequalDouble", new DoubleUnequalVerifier(0.0), Optional::No);
+ doc.entries.emplace_back("UnequalInt", new IntUnequalVerifier(0), Optional::No);
+ doc.entries.emplace_back("UnequalString", new StringUnequalVerifier(""), Optional::No);
// List Verifiers
- doc.entries.emplace_back("InListBool", new BoolInListVerifier({ true, false }));
- doc.entries.emplace_back("InListDouble", new DoubleInListVerifier({ 0.0, 1.0}));
- doc.entries.emplace_back("InListInt", new IntInListVerifier({ 0, 1 }));
- doc.entries.emplace_back("InListString", new StringInListVerifier({ "", "a" }));
+ doc.entries.emplace_back("InListBool", new BoolInListVerifier({ true, false }), Optional::No);
+ doc.entries.emplace_back("InListDouble", new DoubleInListVerifier({ 0.0, 1.0}), Optional::No);
+ doc.entries.emplace_back("InListInt", new IntInListVerifier({ 0, 1 }), Optional::No);
+ doc.entries.emplace_back("InListString", new StringInListVerifier({ "", "a" }), Optional::No);
- doc.entries.emplace_back("NotInListBool", new BoolNotInListVerifier({ true, false }));
- doc.entries.emplace_back("NotInListDouble", new DoubleNotInListVerifier({ 0.0, 1.0 }));
- doc.entries.emplace_back("NotInListInt", new IntNotInListVerifier({ 0, 1 }));
- doc.entries.emplace_back("NotInListString", new StringNotInListVerifier({ "", "a" }));
+ doc.entries.emplace_back("NotInListBool", new BoolNotInListVerifier({ true, false }), Optional::No);
+ doc.entries.emplace_back("NotInListDouble", new DoubleNotInListVerifier({ 0.0, 1.0 }), Optional::No);
+ doc.entries.emplace_back("NotInListInt", new IntNotInListVerifier({ 0, 1 }), Optional::No);
+ doc.entries.emplace_back("NotInListString", new StringNotInListVerifier({ "", "a" }), Optional::No);
- doc.entries.emplace_back("StringListVerifier", new StringListVerifier);
- doc.entries.emplace_back("IntListVerifier", new IntListVerifier);
+ doc.entries.emplace_back("StringListVerifier", new StringListVerifier, Optional::No);
+ doc.entries.emplace_back("IntListVerifier", new IntListVerifier, Optional::No);
// Range Verifiers
- doc.entries.emplace_back("InListDouble", new DoubleInRangeVerifier({ 0.0, 1.0 }));
- doc.entries.emplace_back("InListInt", new IntInRangeVerifier({ 0, 1 }));
+ doc.entries.emplace_back("InListDouble", new DoubleInRangeVerifier({ 0.0, 1.0 }), Optional::No);
+ doc.entries.emplace_back("InListInt", new IntInRangeVerifier({ 0, 1 }), Optional::No);
- doc.entries.emplace_back("NotInListDouble", new DoubleNotInRangeVerifier({ 0.0, 1.0 }));
- doc.entries.emplace_back("NotInListInt", new IntNotInRangeVerifier({ 0, 1 }));
+ doc.entries.emplace_back("NotInListDouble", new DoubleNotInRangeVerifier({ 0.0, 1.0 }), Optional::No);
+ doc.entries.emplace_back("NotInListInt", new IntNotInRangeVerifier({ 0, 1 }), Optional::No);
// Misc Verifiers
- doc.entries.emplace_back("AnnotationBool", new BoolAnnotationVerifier("Bool"));
- doc.entries.emplace_back("AnnotationDouble", new DoubleAnnotationVerifier("Double"));
- doc.entries.emplace_back("AnnotationInt", new IntAnnotationVerifier("Int"));
- doc.entries.emplace_back("AnnotationString", new StringAnnotationVerifier("String"));
- doc.entries.emplace_back("AnnotationTable", new TableAnnotationVerifier("Table"));
+ doc.entries.emplace_back("AnnotationBool", new BoolAnnotationVerifier("Bool"), Optional::No);
+ doc.entries.emplace_back("AnnotationDouble", new DoubleAnnotationVerifier("Double"), Optional::No);
+ doc.entries.emplace_back("AnnotationInt", new IntAnnotationVerifier("Int"), Optional::No);
+ doc.entries.emplace_back("AnnotationString", new StringAnnotationVerifier("String"), Optional::No);
+ doc.entries.emplace_back("AnnotationTable", new TableAnnotationVerifier("Table"), Optional::No);
}
TEST_F(DocumentationTest, InitializerConstructor) {
@@ -104,59 +104,59 @@ TEST_F(DocumentationTest, InitializerConstructor) {
Documentation doc {
{
// Basic Verifiers
- {"BoolVerifier", new BoolVerifier },
- {"DoubleVerifier", new DoubleVerifier},
- {"IntVerifier", new IntVerifier},
- {"StringVerifier", new StringVerifier},
- {"TableVerifier", new TableVerifier},
+ {"BoolVerifier", new BoolVerifier, Optional::No },
+ {"DoubleVerifier", new DoubleVerifier, Optional::No },
+ {"IntVerifier", new IntVerifier, Optional::No },
+ {"StringVerifier", new StringVerifier, Optional::No },
+ {"TableVerifier", new TableVerifier, Optional::No },
// Operator Verifiers
- { "LessDouble", new DoubleLessVerifier(0.0)},
- { "LessInt", new IntLessVerifier(0)},
+ { "LessDouble", new DoubleLessVerifier(0.0), Optional::No },
+ { "LessInt", new IntLessVerifier(0), Optional::No },
- {"LessEqualDouble", new DoubleLessEqualVerifier(0.0)},
- {"LessEqualInt", new IntLessEqualVerifier(0)},
+ {"LessEqualDouble", new DoubleLessEqualVerifier(0.0), Optional::No },
+ {"LessEqualInt", new IntLessEqualVerifier(0), Optional::No },
- {"GreaterDouble", new DoubleGreaterVerifier(0.0)},
- {"GreaterInt", new IntGreaterVerifier(0)},
+ {"GreaterDouble", new DoubleGreaterVerifier(0.0), Optional::No },
+ {"GreaterInt", new IntGreaterVerifier(0), Optional::No },
- {"GreaterEqualDouble", new DoubleGreaterEqualVerifier(0.0)},
- {"GreaterEqualInt", new IntGreaterEqualVerifier(0)},
+ {"GreaterEqualDouble", new DoubleGreaterEqualVerifier(0.0), Optional::No },
+ {"GreaterEqualInt", new IntGreaterEqualVerifier(0), Optional::No },
- {"EqualBool", new BoolEqualVerifier(false)},
- {"EqualDouble", new DoubleEqualVerifier(0.0)},
- {"EqualInt", new IntEqualVerifier(0)},
- {"EqualString", new StringEqualVerifier("")},
+ {"EqualBool", new BoolEqualVerifier(false), Optional::No },
+ {"EqualDouble", new DoubleEqualVerifier(0.0), Optional::No },
+ {"EqualInt", new IntEqualVerifier(0), Optional::No },
+ {"EqualString", new StringEqualVerifier(""), Optional::No },
- {"UnequalBool", new BoolUnequalVerifier(false)},
- {"UnequalDouble", new DoubleUnequalVerifier(0.0)},
- {"UnequalInt", new IntUnequalVerifier(0)},
- {"UnequalString", new StringUnequalVerifier("")},
+ {"UnequalBool", new BoolUnequalVerifier(false), Optional::No },
+ {"UnequalDouble", new DoubleUnequalVerifier(0.0), Optional::No },
+ {"UnequalInt", new IntUnequalVerifier(0), Optional::No },
+ {"UnequalString", new StringUnequalVerifier(""), Optional::No },
// List Verifiers
- {"InListBool", new BoolInListVerifier({ true, false })},
- {"InListDouble", new DoubleInListVerifier({ 0.0, 1.0 })},
- {"InListInt", new IntInListVerifier({ 0, 1 })},
- {"InListString", new StringInListVerifier({ "", "a" })},
+ {"InListBool", new BoolInListVerifier({ true, false }), Optional::No },
+ {"InListDouble", new DoubleInListVerifier({ 0.0, 1.0 }), Optional::No },
+ {"InListInt", new IntInListVerifier({ 0, 1 }), Optional::No },
+ {"InListString", new StringInListVerifier({ "", "a" }), Optional::No },
- {"NotInListBool", new BoolNotInListVerifier({ true, false })},
- {"NotInListDouble", new DoubleNotInListVerifier({ 0.0, 1.0 })},
- {"NotInListInt", new IntNotInListVerifier({ 0, 1 })},
- {"NotInListString", new StringNotInListVerifier({ "", "a" })},
+ {"NotInListBool", new BoolNotInListVerifier({ true, false }), Optional::No },
+ {"NotInListDouble", new DoubleNotInListVerifier({ 0.0, 1.0 }), Optional::No },
+ {"NotInListInt", new IntNotInListVerifier({ 0, 1 }), Optional::No },
+ {"NotInListString", new StringNotInListVerifier({ "", "a" }), Optional::No },
// Range Verifiers
- {"InRangeDouble", new DoubleInRangeVerifier(0.0, 1.0)},
- {"InRangeInt", new IntInRangeVerifier(0, 1)},
+ {"InRangeDouble", new DoubleInRangeVerifier(0.0, 1.0), Optional::No },
+ {"InRangeInt", new IntInRangeVerifier(0, 1), Optional::No },
- {"InRangeDouble", new DoubleNotInRangeVerifier(0.0, 1.0)},
- {"InRangeInt", new IntNotInRangeVerifier(0, 1)},
+ {"InRangeDouble", new DoubleNotInRangeVerifier(0.0, 1.0), Optional::No },
+ {"InRangeInt", new IntNotInRangeVerifier(0, 1), Optional::No },
// Misc Verifiers
- {"AnnotationBool", new BoolAnnotationVerifier("Bool")},
- {"AnnotationDouble", new DoubleAnnotationVerifier("Double")},
- {"AnnotationInt", new IntAnnotationVerifier("Int")},
- {"AnnotationString", new StringAnnotationVerifier("String")},
- {"AnnotationTable", new TableAnnotationVerifier("Table")}
+ {"AnnotationBool", new BoolAnnotationVerifier("Bool"), Optional::No },
+ {"AnnotationDouble", new DoubleAnnotationVerifier("Double"), Optional::No },
+ {"AnnotationInt", new IntAnnotationVerifier("Int"), Optional::No },
+ {"AnnotationString", new StringAnnotationVerifier("String"), Optional::No },
+ {"AnnotationTable", new TableAnnotationVerifier("Table"), Optional::No }
}
};
}
@@ -165,7 +165,7 @@ TEST_F(DocumentationTest, BoolVerifier) {
using namespace openspace::documentation;
Documentation doc {
- {{ "Bool", new BoolVerifier }}
+ {{ "Bool", new BoolVerifier, Optional::No }}
};
ghoul::Dictionary positive {
@@ -200,7 +200,7 @@ TEST_F(DocumentationTest, DoubleVerifier) {
using namespace openspace::documentation;
Documentation doc {
- {{ "Double", new DoubleVerifier }}
+ {{ "Double", new DoubleVerifier, Optional::No }}
};
ghoul::Dictionary positive {
@@ -235,7 +235,7 @@ TEST_F(DocumentationTest, IntVerifier) {
using namespace openspace::documentation;
Documentation doc {
- {{ "Int", new IntVerifier }}
+ {{ "Int", new IntVerifier, Optional::No }}
};
ghoul::Dictionary positive {
@@ -277,7 +277,7 @@ TEST_F(DocumentationTest, StringVerifier) {
using namespace std::string_literals;
Documentation doc {
- {{ "String", new StringVerifier }}
+ {{ "String", new StringVerifier, Optional::No }}
};
ghoul::Dictionary positive {
@@ -310,7 +310,7 @@ TEST_F(DocumentationTest, TableVerifierType) {
using namespace openspace::documentation;
Documentation doc {
- {{ "Table", new TableVerifier }}
+ {{ "Table", new TableVerifier, Optional::No }}
};
ghoul::Dictionary positive {
@@ -344,7 +344,7 @@ TEST_F(DocumentationTest, StringListVerifierType) {
using namespace std::string_literals;
Documentation doc {
- { { "StringList", new StringListVerifier } }
+ { { "StringList", new StringListVerifier, Optional::No } }
};
ghoul::Dictionary positive {
@@ -401,7 +401,7 @@ TEST_F(DocumentationTest, IntListVerifierType) {
using namespace std::string_literals;
Documentation doc {
- { { "IntList", new IntListVerifier } }
+ { { "IntList", new IntListVerifier, Optional::No } }
};
ghoul::Dictionary positive {
@@ -459,11 +459,11 @@ TEST_F(DocumentationTest, MixedVerifiers) {
Documentation doc {
{
- { "Bool", new BoolVerifier },
- { "Double", new DoubleVerifier },
- { "Int", new IntVerifier },
- { "String", new StringVerifier },
- { "Table", new TableVerifier }
+ { "Bool", new BoolVerifier, Optional::No },
+ { "Double", new DoubleVerifier, Optional::No },
+ { "Int", new IntVerifier, Optional::No },
+ { "String", new StringVerifier, Optional::No },
+ { "Table", new TableVerifier, Optional::No }
}
};
@@ -513,19 +513,19 @@ TEST_F(DocumentationTest, NestedTables) {
Documentation doc {
{
- { "Outer_Int", new IntVerifier },
+ { "Outer_Int", new IntVerifier, Optional::No },
{ "Outer_Table", new TableVerifier({
- { "Inner_Double", new DoubleVerifier },
- { "Inner_String", new StringVerifier }
- })},
- { "Outer_Double", new DoubleVerifier },
+ { "Inner_Double", new DoubleVerifier, Optional::No },
+ { "Inner_String", new StringVerifier, Optional::No }
+ }), Optional::No },
+ { "Outer_Double", new DoubleVerifier, Optional::No },
{ "Outer_Table2" , new TableVerifier({
- { "Inner_Double2", new DoubleVerifier },
- { "Inner_String2", new StringVerifier },
+ { "Inner_Double2", new DoubleVerifier, Optional::No },
+ { "Inner_String2", new StringVerifier, Optional::No },
{ "Inner_Table" , new TableVerifier({
- { "Inner_Inner_Int", new IntVerifier }
- })}
- })}
+ { "Inner_Inner_Int", new IntVerifier, Optional::No }
+ }), Optional::No }
+ }), Optional::No}
}
};
@@ -664,8 +664,8 @@ TEST_F(DocumentationTest, Optional) {
Documentation doc {
{
- { "Bool_Force", new BoolVerifier, "", Optional::No },
- { "Bool_Optional", new BoolVerifier, "", Optional::Yes }
+ { "Bool_Force", new BoolVerifier, Optional::No },
+ { "Bool_Optional", new BoolVerifier, Optional::Yes }
}
};
@@ -721,16 +721,15 @@ TEST_F(DocumentationTest, RequiredInOptional) {
new TableVerifier({
{
"b",
- new IntVerifier
+ new IntVerifier,
+ Optional::No
},
{
"c",
new IntVerifier,
- "",
Optional::Yes
}
}),
- "",
Optional::Yes
}}
};
@@ -777,8 +776,7 @@ TEST_F(DocumentationTest, Exhaustive) {
using namespace openspace::documentation;
Documentation doc {
- {{ "Int", new IntVerifier }},
- Exhaustive::Yes
+ {{ "Int", new IntVerifier, Optional::No }}
};
ghoul::Dictionary positive {
@@ -816,9 +814,8 @@ TEST_F(DocumentationTest, NestedExhaustive) {
Documentation doc {
{{ "Table", new TableVerifier(
- { { "a", new IntVerifier } },
- Exhaustive::Yes
- )
+ { { "a", new IntVerifier, Optional::No } }
+ ), Optional::No
}}
};
@@ -859,40 +856,14 @@ TEST_F(DocumentationTest, EmptyEntriesNonExhaustive) {
EXPECT_EQ(0, positiveRes.offenses.size());
}
-TEST_F(DocumentationTest, EmptyEntriesExhaustive) {
- using namespace openspace::documentation;
-
- Documentation doc {
- {},
- Exhaustive::Yes
- };
-
- ghoul::Dictionary positive {};
- TestResult positiveRes = testSpecification(doc, positive);
- EXPECT_TRUE(positiveRes.success);
- EXPECT_EQ(0, positiveRes.offenses.size());
-
- ghoul::Dictionary negative {
- { "a", 1 }
- };
- TestResult negativeRes = testSpecification(doc, negative);
- EXPECT_FALSE(negativeRes.success);
- ASSERT_EQ(1, negativeRes.offenses.size());
- EXPECT_EQ("a", negativeRes.offenses[0].offender);
- EXPECT_EQ(TestResult::Offense::Reason::ExtraKey, negativeRes.offenses[0].reason);
-}
-
TEST_F(DocumentationTest, EmptyNestedExhaustive) {
using namespace openspace::documentation;
Documentation doc {
{{
"Table",
- new TableVerifier(
- {
- },
- Exhaustive::Yes
- )
+ new TableVerifier(),
+ Optional::No,
}}
};
@@ -919,7 +890,7 @@ TEST_F(DocumentationTest, LessInt) {
using namespace openspace::documentation;
Documentation doc {
- {{ "Int", new IntLessVerifier(5) }}
+ {{ "Int", new IntLessVerifier(5), Optional::No }}
};
ghoul::Dictionary positive {
@@ -943,7 +914,7 @@ TEST_F(DocumentationTest, LessDouble) {
using namespace openspace::documentation;
Documentation doc {
- {{ "Double", new DoubleLessVerifier(5.0) }}
+ {{ "Double", new DoubleLessVerifier(5.0), Optional::No }}
};
ghoul::Dictionary positive {
@@ -967,7 +938,7 @@ TEST_F(DocumentationTest, LessEqualInt) {
using namespace openspace::documentation;
Documentation doc {
- {{ "Int", new IntLessEqualVerifier(5) }}
+ {{ "Int", new IntLessEqualVerifier(5), Optional::No }}
};
ghoul::Dictionary positive {
@@ -998,7 +969,7 @@ TEST_F(DocumentationTest, LessEqualDouble) {
using namespace openspace::documentation;
Documentation doc {
- {{ "Double", new DoubleLessEqualVerifier(5.0) }}
+ {{ "Double", new DoubleLessEqualVerifier(5.0), Optional::No }}
};
ghoul::Dictionary positive {
@@ -1029,7 +1000,7 @@ TEST_F(DocumentationTest, GreaterInt) {
using namespace openspace::documentation;
Documentation doc {
- {{ "Int", new IntGreaterVerifier(5) }}
+ {{ "Int", new IntGreaterVerifier(5), Optional::No }}
};
ghoul::Dictionary positive {
@@ -1053,7 +1024,7 @@ TEST_F(DocumentationTest, GreaterDouble) {
using namespace openspace::documentation;
Documentation doc {
- {{ "Double", new DoubleGreaterVerifier(5.0) }}
+ {{ "Double", new DoubleGreaterVerifier(5.0), Optional::No }}
};
ghoul::Dictionary positive {
@@ -1077,7 +1048,7 @@ TEST_F(DocumentationTest, GreaterEqualInt) {
using namespace openspace::documentation;
Documentation doc {
- {{ "Int", new IntGreaterEqualVerifier(5) }}
+ {{ "Int", new IntGreaterEqualVerifier(5), Optional::No }}
};
ghoul::Dictionary positive {
@@ -1108,7 +1079,7 @@ TEST_F(DocumentationTest, GreaterEqualDouble) {
using namespace openspace::documentation;
Documentation doc {
- {{ "Double", new DoubleGreaterEqualVerifier(5.0) }}
+ {{ "Double", new DoubleGreaterEqualVerifier(5.0), Optional::No }}
};
ghoul::Dictionary positive {
@@ -1139,7 +1110,7 @@ TEST_F(DocumentationTest, EqualBool) {
using namespace openspace::documentation;
Documentation doc {
- {{ "Bool", new BoolEqualVerifier(true) }}
+ {{ "Bool", new BoolEqualVerifier(true), Optional::No }}
};
ghoul::Dictionary positive {
@@ -1163,7 +1134,7 @@ TEST_F(DocumentationTest, EqualInt) {
using namespace openspace::documentation;
Documentation doc {
- {{ "Int", new IntEqualVerifier(1) }}
+ {{ "Int", new IntEqualVerifier(1), Optional::No }}
};
ghoul::Dictionary positive {
@@ -1187,7 +1158,7 @@ TEST_F(DocumentationTest, EqualDouble) {
using namespace openspace::documentation;
Documentation doc {
- {{ "Double", new DoubleEqualVerifier(1.0) }}
+ {{ "Double", new DoubleEqualVerifier(1.0), Optional::No }}
};
ghoul::Dictionary positive {
@@ -1212,7 +1183,7 @@ TEST_F(DocumentationTest, EqualString) {
using namespace std::string_literals;
Documentation doc {
- {{ "String", new StringEqualVerifier("string"s) }}
+ {{ "String", new StringEqualVerifier("string"s), Optional::No }}
};
ghoul::Dictionary positive {
@@ -1236,7 +1207,7 @@ TEST_F(DocumentationTest, UnequalBool) {
using namespace openspace::documentation;
Documentation doc {
- {{ "Bool", new BoolUnequalVerifier(true) }}
+ {{ "Bool", new BoolUnequalVerifier(true), Optional::No }}
};
ghoul::Dictionary positive {
@@ -1260,7 +1231,7 @@ TEST_F(DocumentationTest, UnequalInt) {
using namespace openspace::documentation;
Documentation doc {
- {{ "Int", new IntUnequalVerifier(1) }}
+ {{ "Int", new IntUnequalVerifier(1), Optional::No }}
};
ghoul::Dictionary positive {
@@ -1284,7 +1255,7 @@ TEST_F(DocumentationTest, UnequalDouble) {
using namespace openspace::documentation;
Documentation doc {
- {{ "Double", new DoubleUnequalVerifier(1.0) }}
+ {{ "Double", new DoubleUnequalVerifier(1.0), Optional::No }}
};
ghoul::Dictionary positive {
@@ -1309,7 +1280,7 @@ TEST_F(DocumentationTest, UnequalString) {
using namespace std::string_literals;
Documentation doc {
- {{ "String", new StringUnequalVerifier("string"s) }}
+ {{ "String", new StringUnequalVerifier("string"s), Optional::No }}
};
ghoul::Dictionary positive {
@@ -1333,7 +1304,7 @@ TEST_F(DocumentationTest, ListBool) {
using namespace openspace::documentation;
Documentation doc {
- {{ "Bool" , new BoolInListVerifier({ true }) }}
+ {{ "Bool" , new BoolInListVerifier({ true }), Optional::No }}
};
ghoul::Dictionary positive {
@@ -1357,7 +1328,7 @@ TEST_F(DocumentationTest, ListInt) {
using namespace openspace::documentation;
Documentation doc {
- {{ "Int" , new IntInListVerifier({ 0, 1, 2 }) }}
+ {{ "Int" , new IntInListVerifier({ 0, 1, 2 }), Optional::No }}
};
ghoul::Dictionary positive {
@@ -1388,7 +1359,7 @@ TEST_F(DocumentationTest, ListDouble) {
using namespace openspace::documentation;
Documentation doc {
- {{ "Double" , new DoubleInListVerifier({ 0.0, 1.0, 2.0 }) }}
+ {{ "Double" , new DoubleInListVerifier({ 0.0, 1.0, 2.0 }), Optional::No }}
};
ghoul::Dictionary positive {
@@ -1420,7 +1391,7 @@ TEST_F(DocumentationTest, ListString) {
using namespace std::string_literals;
Documentation doc {
- {{ "String" , new StringInListVerifier({ "0"s, "1"s, "2"s }) }}
+ {{ "String" , new StringInListVerifier({ "0"s, "1"s, "2"s }), Optional::No }}
};
ghoul::Dictionary positive {
@@ -1451,7 +1422,7 @@ TEST_F(DocumentationTest, NotListBool) {
using namespace openspace::documentation;
Documentation doc {
- {{ "Bool" , new BoolNotInListVerifier({ true }) }}
+ {{ "Bool" , new BoolNotInListVerifier({ true }), Optional::No }}
};
ghoul::Dictionary positive {
@@ -1475,7 +1446,7 @@ TEST_F(DocumentationTest, NotListInt) {
using namespace openspace::documentation;
Documentation doc {
- {{ "Int" , new IntNotInListVerifier({ 0, 1, 2 }) }}
+ {{ "Int" , new IntNotInListVerifier({ 0, 1, 2 }), Optional::No }}
};
ghoul::Dictionary positive {
@@ -1506,7 +1477,7 @@ TEST_F(DocumentationTest, NotListDouble) {
using namespace openspace::documentation;
Documentation doc {
- {{ "Double" , new DoubleNotInListVerifier({ 0.0, 1.0, 2.0 }) }}
+ {{ "Double" , new DoubleNotInListVerifier({ 0.0, 1.0, 2.0 }), Optional::No }}
};
ghoul::Dictionary positive {
@@ -1538,7 +1509,7 @@ TEST_F(DocumentationTest, NotListString) {
using namespace std::string_literals;
Documentation doc {
- {{ "String" , new StringNotInListVerifier({ "0"s, "1"s, "2"s }) }}
+ {{ "String" , new StringNotInListVerifier({ "0"s, "1"s, "2"s }), Optional::No }}
};
ghoul::Dictionary positive {
@@ -1569,7 +1540,7 @@ TEST_F(DocumentationTest, AnnotationBool) {
using namespace openspace::documentation;
Documentation doc {
- {{ "Bool", new BoolAnnotationVerifier("Bool") }}
+ {{ "Bool", new BoolAnnotationVerifier("Bool"), Optional::No }}
};
ghoul::Dictionary positive {
@@ -1593,7 +1564,7 @@ TEST_F(DocumentationTest, AnnotationInt) {
using namespace openspace::documentation;
Documentation doc {
- {{ "Int", new IntAnnotationVerifier("Int") }}
+ {{ "Int", new IntAnnotationVerifier("Int"), Optional::No }}
};
ghoul::Dictionary positive {
@@ -1617,7 +1588,7 @@ TEST_F(DocumentationTest, AnnotationDouble) {
using namespace openspace::documentation;
Documentation doc {
- {{ "Double", new DoubleAnnotationVerifier("Double") }}
+ {{ "Double", new DoubleAnnotationVerifier("Double"), Optional::No }}
};
ghoul::Dictionary positive {
@@ -1642,7 +1613,7 @@ TEST_F(DocumentationTest, AnnotationString) {
using namespace std::string_literals;
Documentation doc {
- {{ "String", new StringAnnotationVerifier("String") }}
+ {{ "String", new StringAnnotationVerifier("String"), Optional::No }}
};
ghoul::Dictionary positive {
@@ -1666,7 +1637,7 @@ TEST_F(DocumentationTest, AnnotationTable) {
using namespace openspace::documentation;
Documentation doc {
- {{ "Table", new TableAnnotationVerifier("Table") }}
+ {{ "Table", new TableAnnotationVerifier("Table"), Optional::No }}
};
ghoul::Dictionary positive {
@@ -1690,7 +1661,7 @@ TEST_F(DocumentationTest, InRangeInt) {
using namespace openspace::documentation;
Documentation doc {
- {{ "Int", new InRangeVerifier(0, 5) }}
+ {{ "Int", new InRangeVerifier(0, 5), Optional::No }}
};
ghoul::Dictionary positive {
@@ -1728,7 +1699,7 @@ TEST_F(DocumentationTest, InRangeDouble) {
using namespace openspace::documentation;
Documentation doc {
- {{ "Double", new InRangeVerifier(0.0, 5.0) }}
+ {{ "Double", new InRangeVerifier(0.0, 5.0), Optional::No }}
};
ghoul::Dictionary positive {
@@ -1773,7 +1744,7 @@ TEST_F(DocumentationTest, NotInRangeInt) {
using namespace openspace::documentation;
Documentation doc {
- {{ "Int", new NotInRangeVerifier(0, 5) }}
+ {{ "Int", new NotInRangeVerifier(0, 5), Optional::No }}
};
ghoul::Dictionary positive {
@@ -1822,7 +1793,7 @@ TEST_F(DocumentationTest, NotInRangeDouble) {
using namespace openspace::documentation;
Documentation doc {
- {{ "Double", new NotInRangeVerifier(0.0, 5.0) }}
+ {{ "Double", new NotInRangeVerifier(0.0, 5.0), Optional::No }}
};
ghoul::Dictionary positive {
@@ -1871,7 +1842,7 @@ TEST_F(DocumentationTest, Wildcard) {
using namespace openspace::documentation;
Documentation doc {
- {{ DocumentationEntry::Wildcard, new IntVerifier }}
+ {{ DocumentationEntry::Wildcard, new IntVerifier, Optional::No }}
};
ghoul::Dictionary positive {
@@ -1928,8 +1899,8 @@ TEST_F(DocumentationTest, WildcardMixed) {
Documentation doc {
{
- { DocumentationEntry::Wildcard, new IntVerifier },
- { "b", new IntGreaterVerifier(5) }
+ { DocumentationEntry::Wildcard, new IntVerifier , Optional::No},
+ { "b", new IntGreaterVerifier(5), Optional::No }
}
};
@@ -2004,14 +1975,14 @@ TEST_F(DocumentationTest, Referencing) {
"Referenced Name",
"referenced_id",
{
- { "a", new IntVerifier },
- { "b", new DoubleVerifier }
+ { "a", new IntVerifier, Optional::No },
+ { "b", new DoubleVerifier, Optional::No }
},
};
DocEng.addDocumentation(referenced);
Documentation doc {{
- { "Table", new ReferencingVerifier("referenced_id") }
+ { "Table", new ReferencingVerifier("referenced_id"), Optional::No }
}};
ghoul::Dictionary positive {
@@ -2042,7 +2013,7 @@ TEST_F(DocumentationTest, Referencing) {
Documentation wrongDoc {{
- { "Table", new ReferencingVerifier("WRONG") }
+ { "Table", new ReferencingVerifier("WRONG"), Optional::No }
} };
ghoul::Dictionary wrongNegative {
{ "Table", ghoul::Dictionary{ { "a", 1 },{ "b", 2.0 } } }
@@ -2065,7 +2036,7 @@ TEST_F(DocumentationTest, AndOperator) {
{
{ "a", new AndVerifier(
new IntGreaterEqualVerifier(2), new IntLessEqualVerifier(5)
- )
+ ), Optional::No
}
}
};
@@ -2101,7 +2072,7 @@ TEST_F(DocumentationTest, OrOperator) {
using namespace std::string_literals;
Documentation doc {
- {{ "a", new OrVerifier(new StringVerifier, new IntVerifier)}}
+ {{ "a", new OrVerifier(new StringVerifier, new IntVerifier), Optional::No}}
};
ghoul::Dictionary positive {
@@ -2132,7 +2103,7 @@ TEST_F(DocumentationTest, BoolVector2Verifier) {
using namespace openspace::documentation;
Documentation doc {
- {{ "a", new BoolVector2Verifier }}
+ {{ "a", new BoolVector2Verifier, Optional::No }}
};
ghoul::Dictionary positive {
@@ -2165,7 +2136,7 @@ TEST_F(DocumentationTest, IntVector2Verifier) {
using namespace openspace::documentation;
Documentation doc {
- { { "a", new IntVector2Verifier } }
+ { { "a", new IntVector2Verifier, Optional::No } }
};
ghoul::Dictionary positive {
@@ -2198,7 +2169,7 @@ TEST_F(DocumentationTest, DoubleVector2Verifier) {
using namespace openspace::documentation;
Documentation doc {
- { { "a", new DoubleVector2Verifier } }
+ { { "a", new DoubleVector2Verifier, Optional::No } }
};
ghoul::Dictionary positive {
@@ -2231,7 +2202,7 @@ TEST_F(DocumentationTest, BoolVector3Verifier) {
using namespace openspace::documentation;
Documentation doc {
- { { "a", new BoolVector3Verifier } }
+ { { "a", new BoolVector3Verifier, Optional::No } }
};
ghoul::Dictionary positive {
@@ -2264,7 +2235,7 @@ TEST_F(DocumentationTest, IntVector3Verifier) {
using namespace openspace::documentation;
Documentation doc {
- { { "a", new IntVector3Verifier } }
+ { { "a", new IntVector3Verifier, Optional::No } }
};
ghoul::Dictionary positive {
@@ -2297,7 +2268,7 @@ TEST_F(DocumentationTest, DoubleVector3Verifier) {
using namespace openspace::documentation;
Documentation doc {
- { { "a", new DoubleVector3Verifier } }
+ { { "a", new DoubleVector3Verifier, Optional::No } }
};
ghoul::Dictionary positive {
@@ -2330,7 +2301,7 @@ TEST_F(DocumentationTest, BoolVector4Verifier) {
using namespace openspace::documentation;
Documentation doc {
- { { "a", new BoolVector4Verifier } }
+ { { "a", new BoolVector4Verifier, Optional::No } }
};
ghoul::Dictionary positive {
@@ -2363,7 +2334,7 @@ TEST_F(DocumentationTest, IntVector4Verifier) {
using namespace openspace::documentation;
Documentation doc {
- { { "a", new IntVector4Verifier } }
+ { { "a", new IntVector4Verifier, Optional::No } }
};
ghoul::Dictionary positive {
@@ -2396,7 +2367,7 @@ TEST_F(DocumentationTest, DoubleVector4Verifier) {
using namespace openspace::documentation;
Documentation doc {
- { { "a", new DoubleVector4Verifier } }
+ { { "a", new DoubleVector4Verifier, Optional::No } }
};
ghoul::Dictionary positive {
@@ -2429,7 +2400,7 @@ TEST_F(DocumentationTest, DoubleMatrix2x2Verifier) {
using namespace openspace::documentation;
Documentation doc {
- { { "a", new DoubleMatrix2x2Verifier } }
+ { { "a", new DoubleMatrix2x2Verifier, Optional::No } }
};
ghoul::Dictionary positive {
@@ -2462,7 +2433,7 @@ TEST_F(DocumentationTest, DoubleMatrix2x3Verifier) {
using namespace openspace::documentation;
Documentation doc {
- { { "a", new DoubleMatrix2x3Verifier } }
+ { { "a", new DoubleMatrix2x3Verifier, Optional::No } }
};
ghoul::Dictionary positive {
@@ -2495,7 +2466,7 @@ TEST_F(DocumentationTest, DoubleMatrix2x4Verifier) {
using namespace openspace::documentation;
Documentation doc {
- { { "a", new DoubleMatrix2x4Verifier } }
+ { { "a", new DoubleMatrix2x4Verifier, Optional::No } }
};
ghoul::Dictionary positive {
@@ -2528,7 +2499,7 @@ TEST_F(DocumentationTest, DoubleMatrix3x2Verifier) {
using namespace openspace::documentation;
Documentation doc {
- { { "a", new DoubleMatrix3x2Verifier } }
+ { { "a", new DoubleMatrix3x2Verifier, Optional::No } }
};
ghoul::Dictionary positive {
@@ -2561,7 +2532,7 @@ TEST_F(DocumentationTest, DoubleMatrix3x3Verifier) {
using namespace openspace::documentation;
Documentation doc {
- { { "a", new DoubleMatrix3x3Verifier } }
+ { { "a", new DoubleMatrix3x3Verifier, Optional::No } }
};
ghoul::Dictionary positive {
@@ -2594,7 +2565,7 @@ TEST_F(DocumentationTest, DoubleMatrix3x4Verifier) {
using namespace openspace::documentation;
Documentation doc {
- { { "a", new DoubleMatrix3x4Verifier } }
+ { { "a", new DoubleMatrix3x4Verifier, Optional::No } }
};
ghoul::Dictionary positive {
@@ -2627,7 +2598,7 @@ TEST_F(DocumentationTest, DoubleMatrix4x2Verifier) {
using namespace openspace::documentation;
Documentation doc {
- { { "a", new DoubleMatrix4x2Verifier } }
+ { { "a", new DoubleMatrix4x2Verifier, Optional::No } }
};
ghoul::Dictionary positive {
@@ -2660,7 +2631,7 @@ TEST_F(DocumentationTest, DoubleMatrix4x3Verifier) {
using namespace openspace::documentation;
Documentation doc {
- { { "a", new DoubleMatrix4x3Verifier } }
+ { { "a", new DoubleMatrix4x3Verifier, Optional::No } }
};
ghoul::Dictionary positive {
@@ -2693,7 +2664,7 @@ TEST_F(DocumentationTest, DoubleMatrix4x4Verifier) {
using namespace openspace::documentation;
Documentation doc {
- { { "a", new DoubleMatrix4x4Verifier } }
+ { { "a", new DoubleMatrix4x4Verifier, Optional::No } }
};
ghoul::Dictionary positive {
@@ -2727,19 +2698,19 @@ TEST_F(DocumentationTest, DeprecatedVerifier) {
using namespace std::string_literals;
Documentation doc { {
- { "bool", new BoolDeprecatedVerifier },
- { "int" , new IntDeprecatedVerifier },
- { "double", new DoubleDeprecatedVerifier },
- { "string" , new StringDeprecatedVerifier },
- { "boolvec2", new DeprecatedVerifier },
- { "intvec2", new DeprecatedVerifier },
- { "doublevec2", new DeprecatedVerifier },
- { "boolvec3", new DeprecatedVerifier },
- { "intvec3", new DeprecatedVerifier },
- { "doublevec3", new DeprecatedVerifier },
- { "boolvec4", new DeprecatedVerifier },
- { "intvec4", new DeprecatedVerifier },
- { "doublevec4", new DeprecatedVerifier }
+ { "bool", new BoolDeprecatedVerifier, Optional::No },
+ { "int" , new IntDeprecatedVerifier, Optional::No },
+ { "double", new DoubleDeprecatedVerifier, Optional::No },
+ { "string" , new StringDeprecatedVerifier, Optional::No },
+ { "boolvec2", new DeprecatedVerifier, Optional::No },
+ { "intvec2", new DeprecatedVerifier, Optional::No },
+ { "doublevec2", new DeprecatedVerifier, Optional::No },
+ { "boolvec3", new DeprecatedVerifier, Optional::No },
+ { "intvec3", new DeprecatedVerifier, Optional::No },
+ { "doublevec3", new DeprecatedVerifier, Optional::No },
+ { "boolvec4", new DeprecatedVerifier, Optional::No },
+ { "intvec4", new DeprecatedVerifier, Optional::No },
+ { "doublevec4", new DeprecatedVerifier, Optional::No }
}};
ghoul::Dictionary positive {