Permalink
Browse files

Merge branch 'master' into feature/NewAtmosphere

# Conflicts:
#	src/rendering/renderengine.cpp
  • Loading branch information...
alexanderbock committed Oct 24, 2017
2 parents a5bcae6 + a599516 commit 50fd9309ba9dc9e5d73bf4bde3b0d6014bb75287
Showing with 1,646 additions and 795 deletions.
  1. +0 −1 apps/OpenSpace/main.cpp
  2. +21 −0 data/scene/examples/luatransforms/luatransforms.mod
  3. +6 −0 data/scene/examples/luatransforms/rotation.lua
  4. +6 −0 data/scene/examples/luatransforms/scale.lua
  5. +6 −0 data/scene/examples/luatransforms/translate.lua
  6. +9 −0 data/web/scenelicense/main.hbs
  7. +16 −0 data/web/scenelicense/scenelicense.hbs
  8. +28 −0 data/web/scenelicense/script.js
  9. +2 −0 include/openspace/engine/configurationmanager.h
  10. +0 −8 include/openspace/engine/openspaceengine.h
  11. +1 −0 include/openspace/engine/wrapper/sgctwindowwrapper.h
  12. +7 −0 include/openspace/engine/wrapper/windowwrapper.h
  13. +1 −1 include/openspace/interaction/luaconsole.h
  14. +3 −1 include/openspace/performance/performancemanager.h
  15. +10 −2 include/openspace/properties/propertyowner.h
  16. +6 −7 include/openspace/rendering/renderengine.h
  17. +4 −1 include/openspace/scene/scale.h
  18. +16 −1 include/openspace/scene/scene.h
  19. +58 −0 include/openspace/scene/scenelicense.h
  20. +22 −14 modules/base/shaders/path_fs.glsl → include/openspace/scene/scenelicensewriter.h
  21. +11 −2 include/openspace/scene/sceneloader.h
  22. +3 −1 include/openspace/scene/translation.h
  23. +2 −2 include/openspace/util/transformationmanager.h
  24. +6 −5 modules/base/CMakeLists.txt
  25. +9 −0 modules/base/basemodule.cpp
  26. +0 −1 modules/base/rendering/screenspaceimagelocal.cpp
  27. +133 −0 modules/base/rotation/luarotation.cpp
  28. +24 −23 modules/base/{shaders/pscstandard_vs.glsl → rotation/luarotation.h}
  29. +119 −0 modules/base/scale/luascale.cpp
  30. +24 −34 modules/base/{shaders/path_gs.glsl → scale/luascale.h}
  31. +2 −4 modules/base/scale/staticscale.cpp
  32. +0 −2 modules/base/scale/staticscale.h
  33. +0 −1 modules/base/shaders/imageplane_fs.glsl
  34. +141 −0 modules/base/translation/luatranslation.cpp
  35. +26 −30 modules/base/{shaders/path_vs.glsl → translation/luatranslation.h}
  36. +2 −4 modules/base/translation/statictranslation.cpp
  37. +0 −2 modules/base/translation/statictranslation.h
  38. +3 −4 modules/digitaluniverse/rendering/renderablebillboardscloud.cpp
  39. +9 −10 modules/digitaluniverse/rendering/renderabledumeshes.cpp
  40. +1 −1 modules/digitaluniverse/rendering/renderabledumeshes.h
  41. +5 −6 modules/digitaluniverse/rendering/renderableplanescloud.cpp
  42. +1 −0 modules/globebrowsing/CMakeLists.txt
  43. +2 −0 modules/globebrowsing/globebrowsingmodule_lua.inl
  44. +38 −44 modules/{base/shaders/pscstandard_fs.glsl → globebrowsing/rendering/layer/layergroupid.cpp}
  45. +9 −39 modules/globebrowsing/rendering/layer/layergroupid.h
  46. +24 −14 modules/globebrowsing/scripts/layer_support.lua
  47. +1 −1 modules/globebrowsing/tile/rawtiledatareader/gdalwrapper.h
  48. +0 −1 modules/imgui/src/guiglobebrowsingcomponent.cpp
  49. +1 −1 modules/imgui/src/guimissioncomponent.cpp
  50. +1 −1 modules/imgui/src/guipropertycomponent.cpp
  51. +23 −10 modules/imgui/src/guispacetimecomponent.cpp
  52. +3 −1 modules/space/rendering/renderableconstellationbounds.cpp
  53. +0 −1 modules/space/shaders/rings_vs.glsl
  54. +1 −0 openspace.cfg
  55. +3 −1 scripts/scene_helper.lua
  56. +0 −1 shaders/framebuffer/exitframebuffer.frag
  57. +0 −1 shaders/framebuffer/inside.glsl
  58. +1 −1 shaders/luaconsole.vert
  59. +4 −0 src/CMakeLists.txt
  60. +8 −0 src/documentation/documentationgenerator.cpp
  61. +1 −0 src/engine/configurationmanager.cpp
  62. +8 −0 src/engine/configurationmanager_doc.inl
  63. +35 −48 src/engine/openspaceengine.cpp
  64. +25 −1 src/engine/openspaceengine_lua.inl
  65. +24 −26 src/engine/wrapper/sgctwindowwrapper.cpp
  66. +16 −12 src/engine/wrapper/windowwrapper.cpp
  67. +1 −1 src/interaction/keybindingmanager.cpp
  68. +2 −1 src/interaction/keyframenavigator.cpp
  69. +4 −4 src/network/parallelconnection.cpp
  70. +3 −3 src/performance/performancemanager.cpp
  71. +7 −8 src/properties/propertyowner.cpp
  72. +355 −372 src/rendering/renderengine.cpp
  73. +0 −2 src/rendering/screenspacerenderable.cpp
  74. +6 −1 src/scene/scale.cpp
  75. +16 −0 src/scene/scene.cpp
  76. +12 −0 src/scene/scene_lua.inl
  77. +94 −0 src/scene/scenelicense.cpp
  78. +82 −0 src/scene/scenelicensewriter.cpp
  79. +66 −12 src/scene/sceneloader.cpp
  80. +5 −0 src/scene/translation.cpp
  81. +2 −2 src/util/taskloader.cpp
  82. +5 −3 src/util/timemanager.cpp
  83. +8 −9 src/util/transformationmanager.cpp
  84. +7 −5 support/cmake/handle_applications.cmake
View
@@ -313,7 +313,6 @@ void mainInitFunc() {
void mainPreSyncFunc() {
LTRACE("main::mainPreSyncFunc(begin)");
OsEng.setRunTime(sgct::Engine::getTime());
OsEng.preSynchronization();
LTRACE("main::mainPreSyncFunc(end)");
}
@@ -0,0 +1,21 @@
return {
-- Earth barycenter module
{
Name = "Lua Transformation",
Parent = "SolarSystemBarycenter",
Transform = {
Rotation = {
Type = "LuaRotation",
Script = "rotation.lua"
},
Scale = {
Type = "LuaScale",
Script = "scale.lua"
},
Translation = {
Type = "LuaTranslation",
Script = "translate.lua"
}
}
}
}
@@ -0,0 +1,6 @@
-- t1: Ingame seconds past the J2000 epoch
-- t2: Wallclock milliseconds past the J2000 epoch
function rotation(t1, t2)
return 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0
end
@@ -0,0 +1,6 @@
-- t1: Ingame seconds past the J2000 epoch
-- t2: Wallclock milliseconds past the J2000 epoch
function scale(t1, t2)
return 1.0;
end
@@ -0,0 +1,6 @@
-- t1: Ingame seconds past the J2000 epoch
-- t2: Wallclock milliseconds past the J2000 epoch
function translation(t1, t2)
return 0.0, 0.0, 0.0
end
@@ -0,0 +1,9 @@
<div id="page-content-wrapper">
<div class="container-fluid documentation-container">
<h1>OpenSpace Scene License Information</h1>
<p>Version: {{version.[0]}}.{{version.[1]}}.{{version.[2]}}</p>
{{#each sceneLicenses}}
{{> scenelicense}}
{{/each}}
</div>
</div>
@@ -0,0 +1,16 @@
<div class="documentation-item">
<div class="row">
<div class="col-lg-12">
<p>
<a href="#{{urlify module}}" name="{{urlify module}}">
<span class="documentation-key">{{module}}</span>
</a>
<p>{{name}}</p>
<br />
<p>{{attribution}}</p>
<p>{{url}}</p>
<p>{{licenseText}}</p>
</p>
</div>
</div>
</div>
@@ -0,0 +1,28 @@
window.onload = function () {
var mainTemplateElement = document.getElementById('mainTemplate');
var mainTemplate = Handlebars.compile(mainTemplateElement.innerHTML);
var sceneLicenseTemplate = document.getElementById('sceneLicenseTemplate');
Handlebars.registerPartial('scenelicense', sceneLicenseTemplate.innerHTML);
Handlebars.registerHelper('urlify', function(options, context) {
var data = context.data;
var identifier = options.replace(" ", "-").toLowerCase();
while (data = data._parent) {
if (data.key !== undefined) {
identifier = data.key + "-" + identifier;
}
}
return identifier;
});
var data = {
sceneLicenses: sceneLicenses,
version: version
}
var contents = mainTemplate(data);
document.body.innerHTML = contents;
}
@@ -67,6 +67,8 @@ class ConfigurationManager : public ghoul::Dictionary {
static const std::string KeyDocumentation;
/// The key that stores the factory documentation values
static const std::string KeyFactoryDocumentation;
/// The key that stores the scene license documentation values
static const std::string KeySceneLicenseDocumentation;
/// The key that stores the location of the scene file that is initially loaded
static const std::string KeyConfigScene;
/// The key that stores the location of the tasks files
@@ -79,9 +79,6 @@ class OpenSpaceEngine {
static OpenSpaceEngine& ref();
static bool isCreated();
double runTime();
void setRunTime(double t);
// callbacks
void initialize();
void initializeGL();
@@ -101,9 +98,6 @@ class OpenSpaceEngine {
void decode();
void scheduleLoadScene(std::string scenePath);
void enableBarrier();
void disableBarrier();
void writeDocumentation();
void toggleShutdownMode();
@@ -234,8 +228,6 @@ class OpenSpaceEngine {
std::vector<std::function<bool (double, double)>> mouseScrollWheel;
} _moduleCallbacks;
double _runTime;
// Structure that is responsible for the delayed shutdown of the application
struct {
// Whether the application is currently in shutdown mode (i.e. counting down the
@@ -49,6 +49,7 @@ class SGCTWindowWrapper : public WindowWrapper {
double averageDeltaTime() const override;
double deltaTime() const override;
double applicationTime() const override;
glm::vec2 mousePosition() const override;
uint32_t mouseButtons(int maxNumber) const override;
glm::ivec2 currentWindowSize() const override;
@@ -106,6 +106,13 @@ class WindowWrapper : public properties::PropertyOwner {
*/
virtual double deltaTime() const;
/**
* Returns the time that has passed (in seconds) since application start
* \return The time that has passed (in seconds) since application start
* @return [description]
*/
virtual double applicationTime() const;
/**
* Returns the location of the mouse cursor in pixel screen coordinates. On default,
* this method returns <code>0,0</code>.
@@ -55,6 +55,7 @@ class LuaConsole : public properties::PropertyOwner {
private:
void parallelConnectionChanged(const ParallelConnection::Status& status);
void addToCommand(std::string c);
std::string sanitizeInput(std::string str);
@@ -68,7 +69,6 @@ class LuaConsole : public properties::PropertyOwner {
properties::Vec4Property _historyTextColor;
properties::IntProperty _historyLength;
size_t _inputPosition;
std::vector<std::string> _commandsHistory;
size_t _activeCommand;
@@ -44,7 +44,9 @@ class PerformanceManager {
static void createGlobalSharedMemory();
static void destroyGlobalSharedMemory();
PerformanceManager();
PerformanceManager(std::string loggingDirectory = "${BASE_PATH}",
std::string prefix = "PM-");
~PerformanceManager();
void resetPerformanceMeasurements();
@@ -224,12 +224,20 @@ class PropertyOwner {
std::vector<std::string> tags() const;
/**
* Adds a tag to the Property's list of assigned tags. Tags are useful for creating
* groups of Properties that can be used in batch operations.
* Adds a tag to the PropertyOwner's list of assigned tags. Tags are useful for
* creating oups of Properties that can be used in batch operations or to mark up
* PropertyOwners for other usages (such signalling to GUI applications).
* \param tag The string that is to be assigned to the Property
*/
void addTag(std::string tag);
/**
* Removes a tag from this PropertyOwner. No error is reported if the tag does not
* exist
* @param tag The tag is that is to be removed from this PropertyOwner
*/
void removeTag(const std::string& tag);
private:
/// The name of this PropertyOwner
std::string _name;
@@ -67,7 +67,8 @@ class RenderEngine : public properties::PropertyOwner {
enum class FrametimeType {
DtTimeAvg = 0,
FPS,
FPSAvg
FPSAvg,
None
};
RenderEngine();
@@ -111,8 +112,8 @@ class RenderEngine : public properties::PropertyOwner {
void registerScreenSpaceRenderable(std::shared_ptr<ScreenSpaceRenderable> s);
void unregisterScreenSpaceRenderable(std::shared_ptr<ScreenSpaceRenderable> s);
void unregisterScreenSpaceRenderable(std::string name);
std::shared_ptr<ScreenSpaceRenderable> screenSpaceRenderable(std::string name);
void unregisterScreenSpaceRenderable(const std::string& name);
std::shared_ptr<ScreenSpaceRenderable> screenSpaceRenderable(const std::string& name);
std::vector<ScreenSpaceRenderable*> screenSpaceRenderables() const;
std::unique_ptr<ghoul::opengl::ProgramObject> buildRenderProgram(
@@ -171,16 +172,14 @@ class RenderEngine : public properties::PropertyOwner {
// Temporary fade functionality
void startFading(int direction, float fadeDuration);
void sortScreenspaceRenderables();
glm::ivec2 renderingResolution() const;
glm::ivec2 fontResolution() const;
std::vector<Syncable*> getSyncables();
private:
void setRenderer(std::unique_ptr<Renderer> renderer);
RendererImplementation rendererFromString(const std::string& method);
RendererImplementation rendererFromString(const std::string& method) const;
void renderInformation();
@@ -189,7 +188,7 @@ class RenderEngine : public properties::PropertyOwner {
std::unique_ptr<RaycasterManager> _raycasterManager;
std::unique_ptr<DeferredcasterManager> _deferredcasterManager;
properties::BoolProperty _performanceMeasurements;
properties::BoolProperty _doPerformanceMeasurements;
std::unique_ptr<performance::PerformanceManager> _performanceManager;
std::unique_ptr<Renderer> _renderer;
@@ -47,10 +47,13 @@ class Scale : public properties::PropertyOwner {
virtual ~Scale() = default;
virtual bool initialize();
virtual double scaleValue() const = 0;
virtual double scaleValue() const;
virtual void update(const UpdateData& data);
static documentation::Documentation Documentation();
protected:
double _scale;
};
} // namespace openspace
@@ -32,9 +32,12 @@
#include <set>
#include <mutex>
#include <openspace/scene/scenelicense.h>
#include <openspace/scene/scenelicensewriter.h>
#include <openspace/scripting/scriptengine.h>
#include <openspace/util/camera.h>
#include <openspace/util/updatestructures.h>
#include <openspace/scripting/scriptengine.h>
#include <ghoul/opengl/programobject.h>
namespace ghoul { class Dictionary; }
@@ -122,6 +125,8 @@ class Scene : public DocumentationGenerator {
*/
void removeNode(SceneGraphNode* node, UpdateDependencies updateDeps = UpdateDependencies::Yes);
void addSceneLicense(SceneLicense license);
/**
* Update dependencies.
*/
@@ -132,6 +137,14 @@ class Scene : public DocumentationGenerator {
*/
const std::vector<SceneGraphNode*>& allSceneGraphNodes() const;
/**
* Write information about the license information for the scenegraph nodes that are
* contained in this scene
* \param path The file path that will contain the documentation about the licenses
* used in this scene
*/
void writeSceneLicenseDocumentation(const std::string& path) const;
/**
* Return a a map from name to scene graph node.
*/
@@ -160,6 +173,8 @@ class Scene : public DocumentationGenerator {
std::vector<SceneGraphNode*> _circularNodes;
std::map<std::string, SceneGraphNode*> _nodesByName;
std::vector<SceneLicense> _licenses;
std::mutex _programUpdateLock;
std::set<ghoul::opengl::ProgramObject*> _programsToUpdate;
std::vector<std::unique_ptr<ghoul::opengl::ProgramObject>> _programs;
@@ -0,0 +1,58 @@
/*****************************************************************************************
* *
* OpenSpace *
* *
* Copyright (c) 2014-2017 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
* without restriction, including without limitation the rights to use, copy, modify, *
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *
* permit persons to whom the Software is furnished to do so, subject to the following *
* conditions: *
* *
* The above copyright notice and this permission notice shall be included in all copies *
* or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#ifndef __OPENSPACE_CORE___SCENELICENSE___H__
#define __OPENSPACE_CORE___SCENELICENSE___H__
#include <openspace/documentation/documentation.h>
#include <string>
#include <vector>
namespace ghoul {
class Dictionary;
} // namespace ghoul
namespace openspace {
struct SceneLicense {
// module must not be empty
SceneLicense(const ghoul::Dictionary& dictionary, std::string module);
std::string module;
std::string name;
std::string attribution;
std::string url;
std::string licenseText;
static documentation::Documentation Documentation();
};
void writeSceneLicenseDocumentation(const std::vector<SceneLicense>& licenses,
const std::string& file, const std::string& type);
} // namespace openspace
#endif // __OPENSPACE_CORE___SCENELICENSE___H__
Oops, something went wrong.

0 comments on commit 50fd930

Please sign in to comment.