Merged Master.

This commit is contained in:
Jonathas Costa
2018-04-20 10:18:46 -04:00
266 changed files with 2454 additions and 1577 deletions

View File

@@ -655,7 +655,7 @@ int main_main(int argc, char** argv) {
"Unknown OpenGL version. Missing statement in version mapping map"
);
using IsInitialized = ghoul::Boolean;
BooleanType(IsInitialized);
auto cleanup = [&](IsInitialized isInitialized){
if (isInitialized) {
OsEng.deinitialize();

View File

@@ -62,7 +62,7 @@ int main(int argc, char** argv) {
);
std::stringstream defaultPassword;
defaultPassword << std::hex << std::setfill('0') << std::setw(6) <<
defaultPassword << std::hex << std::setfill('0') << std::setw(6) <<
(std::hash<size_t>{}(
std::chrono::system_clock::now().time_since_epoch().count()
) % 0xffffff);

View File

@@ -2,6 +2,8 @@
-- example:
-- asset.require('../scene/solarsystem/planets/mars/mars')
local CreateFocusNodes = false
-- Add folders to this list that contain .info files describing patches
-- OBS: Even on Windows, you have to use forward slashes (/) or double backslashes (\\)
-- rather than single backslashes (\) as they are otherwise interpreted as escape
@@ -34,6 +36,10 @@ asset.onInitialize(function ()
for obj, list in pairs(vrt_folders) do
for _, dir in pairs(list) do
openspace.globebrowsing.addBlendingLayersFromDirectory(dir, obj)
if CreateFocusNodes then
openspace.globebrowsing.addFocusNodesFromDirectory(dir, obj)
end
end
end
end)

View File

@@ -13,13 +13,14 @@ asset.require('scene/solarsystem/missions/dawn/vesta')
-- Load default key bindings applicable to most scenes
asset.require('util/default_keybindings')
asset.require('util/default_dashboard')
local DawnAsset = asset.require('scene/solarsystem/missions/dawn/dawn')
asset.onInitialize(function ()
openspace.time.setTime("2011 AUG 06 00:00:00")
openspace.setDefaultDashboard()
openspace.setDefaultGuiSorting()
openspace.markInterestingNodes({

View File

@@ -11,6 +11,7 @@ asset.require('scene/solarsystem/planets/mars/moons/deimos')
assetHelper.requestAll(asset, 'scene/digitaluniverse')
-- Load default key bindings applicable to most scenes
asset.require('util/default_keybindings')
asset.require('util/default_dashboard')
asset.request('customization/globebrowsing')
@@ -59,7 +60,6 @@ asset.onInitialize(function ()
openspace.time.setTime(openspace.time.currentWallTime())
sceneHelper.bindKeys(Keybindings)
openspace.setDefaultDashboard()
openspace.setDefaultGuiSorting()
openspace.globebrowsing.loadWMSServersFromFile(

View File

@@ -11,13 +11,13 @@ assetHelper.requireAll(asset, 'scene/solarsystem/missions/juno')
-- Load default key bindings applicable to most scenes
asset.require('util/default_keybindings')
asset.require('util/default_dashboard')
local junoAsset = asset.require('scene/solarsystem/missions/juno/juno')
asset.onInitialize(function ()
openspace.time.setTime("2016-07-01T10:05:00.00")
openspace.setDefaultDashboard()
openspace.setDefaultGuiSorting()
sceneHelper.setDeltaTimeKeys({

View File

@@ -13,6 +13,7 @@ asset.require('scene/solarsystem/missions/newhorizons/newhorizons')
-- Load default key bindings applicable to most scenes
asset.require('util/default_keybindings')
asset.require('util/default_dashboard')
-- Custom Keybindings
local Keybindings = {
@@ -131,27 +132,32 @@ local Keybindings = {
local NewHorizonsAsset = asset.require('scene/solarsystem/missions/newhorizons/model')
asset.onInitialize(function ()
openspace.time.setTime("2015-07-14T08:00:00.00")
sceneHelper.bindKeys(Keybindings)
openspace.setDefaultDashboard()
openspace.dashboard.addDashboardItem({
assetHelper.registerDashboardItems(asset, {
{
Type = "DashboardItemSpacing",
Identifier = "NewHorizonsSpacing",
GuiName = "New Horizons Spacing",
Spacing = 25
})
openspace.dashboard.addDashboardItem({
},
{
Type = "DashboardItemDistance",
Identifier = "NewHorizonsPlutoDistance",
GuiName = "New Horizons Pluto Distance",
SourceType = "Node",
SourceNodeName = "NewHorizons",
DestinationType = "Node Surface",
DestinationNodeName = "Pluto"
})
},
{
Type = "DashboardItemInstruments",
Identifier = "NewHorizonsInstruments",
GuiName = "NewHorizons Instruments",
}
})
openspace.dashboard.addDashboardItem({
Type = "DashboardItemInstruments"
})
asset.onInitialize(function ()
openspace.time.setTime("2015-07-14T08:00:00.00")
sceneHelper.bindKeys(Keybindings)
openspace.setDefaultGuiSorting()

View File

@@ -12,6 +12,7 @@ asset.require('scene/solarsystem/missions/osirisrex/osirisrex')
-- Load default key bindings applicable to most scenes
asset.require('util/default_keybindings')
asset.require('util/default_dashboard')
-- Custom Keybindings
local Keybindings = {
@@ -79,28 +80,33 @@ local Keybindings = {
local OsirisRexAsset = asset.require('scene/solarsystem/missions/osirisrex/model')
asset.onInitialize(function ()
-- openspace.time.setTime("2019 APR 16 12:03:00.00")
openspace.time.setTime("2016 SEP 8 23:00:00.500")
sceneHelper.bindKeys(Keybindings)
openspace.setDefaultDashboard()
openspace.dashboard.addDashboardItem({
assetHelper.registerDashboardItems(asset, {
{
Type = "DashboardItemSpacing",
Identifier = "OsirisRexSpacing",
GuiName = "OSIRIS-REx Spacing",
Spacing = 25
})
openspace.dashboard.addDashboardItem({
},
{
Type = "DashboardItemDistance",
Identifier = "OsirisRexBennuDistance",
GuiName = "OSIRIS-REx Bennu Distance",
SourceType = "Node",
SourceNodeName = "OsirisRex",
DestinationType = "Node",
DestinationNodeName = "BennuBarycenter"
})
},
{
Type = "DashboardItemInstruments",
Identifier = "OsirisRexInstruments",
GuiName = "OSIRIS-REx Instruments",
}
})
openspace.dashboard.addDashboardItem({
Type = "DashboardItemInstruments"
})
asset.onInitialize(function ()
-- openspace.time.setTime("2019 APR 16 12:03:00.00")
openspace.time.setTime("2016 SEP 8 23:00:00.500")
sceneHelper.bindKeys(Keybindings)
openspace.setDefaultGuiSorting()

View File

@@ -14,6 +14,7 @@ asset.require('scene/solarsystem/missions/rosetta/rosetta')
-- Load default key bindings applicable to most scenes
asset.require('util/default_keybindings')
asset.require('util/default_dashboard')
-- Custom Keybindings
local Keybindings = {
@@ -82,27 +83,32 @@ local Keybindings = {
local Comet67PAsset = asset.require('scene/solarsystem/missions/rosetta/67p')
asset.onInitialize(function ()
openspace.time.setTime("2014-08-01T03:05:00.000")
sceneHelper.bindKeys(Keybindings)
openspace.setDefaultDashboard()
openspace.dashboard.addDashboardItem({
assetHelper.registerDashboardItems(asset, {
{
Type = "DashboardItemSpacing",
Identifier = "RosettaSpacing",
GuiName = "Rosetta Spacing",
Spacing = 25
})
openspace.dashboard.addDashboardItem({
},
{
Type = "DashboardItemDistance",
Identifier = "Rosetta67PDistance",
GuiName = "Rosetta 67P Distance",
SourceType = "Node",
SourceNodeName = "Rosetta",
DestinationType = "Node",
DestinationNodeName = "67P"
})
},
{
Type = "DashboardItemInstruments",
Identifier = "RosettaInstruments",
GuiName = "Rosetta Instruments",
}
})
openspace.dashboard.addDashboardItem({
Type = "DashboardItemInstruments"
})
asset.onInitialize(function ()
openspace.time.setTime("2014-08-01T03:05:00.000")
sceneHelper.bindKeys(Keybindings)
openspace.setDefaultGuiSorting()

View File

@@ -1,18 +1,22 @@
<GDAL_WMS>
<Service name="TiledWMS">
<ServerUrl>http://wms.itn.liu.se/OnMars/wms.cgi?</ServerUrl>
<TiledGroupName>CTX Mosaic</TiledGroupName>
<Transparent>TRUE</Transparent>
<Service name="TMS">
<ServerURL>http://wms.itn.liu.se/Mars/CTX/tile/${z}/${y}/${x}</ServerURL>
</Service>
<DataWindow>
<UpperLeftX>-180.0</UpperLeftX>
<UpperLeftY>90.0</UpperLeftY>
<LowerRightX>180.0</LowerRightX>
<LowerRightY>-90.0</LowerRightY>
<BlockSizeX>256</BlockSizeX>
<BlockSizeY>256</BlockSizeY>
<SizeX>4194304</SizeX>
<SizeY>2097152</SizeY>
<TileLevel>13</TileLevel>
<YOrigin>top</YOrigin>
</DataWindow>
<ZeroBlockHttpCodes>400,204,404</ZeroBlockHttpCodes>
<ZeroBlockOnServerException>true</ZeroBlockOnServerException>
<Projection>GEOGCS["Mars 2000", DATUM["D_Mars_2000", SPHEROID["MARS_2000_IAU_IAG",3396190.0,169.894447222361179]],PRIMEM["Greenwich"0], UNIT["Decimal_Degree",0.0174532925199433]]</Projection>
<BlockSizeX>256</BlockSizeX>
<BlockSizeY>256</BlockSizeY>
<BandsCount>2</BandsCount>
<OfflineMode>false</OfflineMode>
<Path>./gdal-cache/ctx</Path>
<Timeout>5</Timeout>
</GDAL_WMS>

View File

@@ -1,15 +1,48 @@
<GDAL_WMS>
<Service name="TiledWMS">
<ServerUrl>http://wms.itn.liu.se/OnMars/wms.cgi?</ServerUrl>
<TiledGroupName>Mola Elevation</TiledGroupName>
<Service name="TMS">
<ServerUrl>http://wms.itn.liu.se/Mars/Mola_Elevation/tile/${z}/${y}/${x}</ServerUrl>
</Service>
<DataWindow>
<UpperLeftX>-180.0</UpperLeftX>
<UpperLeftY>90.0</UpperLeftY>
<LowerRightX>180.0</LowerRightX>
<LowerRightY>-90.0</LowerRightY>
<SizeX>46080</SizeX>
<SizeY>23040</SizeY>
<TileLevel>6</TileLevel>
<YOrigin>bottom</YOrigin>
</DataWindow>
<DataType>Int16</DataType>
<Projection>GEOGCS["GCS_Mars_2000_Sphere",DATUM["D_Mars_2000_Sphere",SPHEROID["Mars_2000_Sphere_IAU_IAG",3396190.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]]</Projection>
<BlockSizeX>256</BlockSizeX>
<BlockSizeY>256</BlockSizeY>
<BandsCount>1</BandsCount>
<OfflineMode>false</OfflineMode>
<Path>./gdal-cache/mola_elevation</Path>
<Timeout>5</Timeout>
</GDAL_WMS>
<!-- <GDAL_WMS>
<Service name="TMS">
<ServerUrl>http://wms.itn.liu.se/Mars/Mola_Elevation/tile/${z}/${y}/${x}</ServerUrl>
</Service>
<DataWindow>
<UpperLeftX>-180.0</UpperLeftX>
<UpperLeftY>90.0</UpperLeftY>
<LowerRightX>180.0</LowerRightX>
<LowerRightY>-90.0</LowerRightY>
<SizeX>46080</SizeX>
<SizeY>23040</SizeY>
<TileLevel>6</TileLevel>
<YOrigin>top</YOrigin>
</DataWindow>
<DataType>Int16</DataType>
<Projection>GEOGCS["GCS_Mars_2000_Sphere",DATUM["D_Mars_2000_Sphere",SPHEROID["Mars_2000_Sphere_IAU_IAG",3396190.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]]</Projection>
<BlockSizeX>360</BlockSizeX>
<BlockSizeY>360</BlockSizeY>
<BandsCount>1</BandsCount>
<MaxConnections>10</MaxConnections>
<Timeout>5</Timeout>
</GDAL_WMS>
-->

View File

@@ -55,7 +55,7 @@ local SaturnRings = {
Name = "Saturn Rings",
Path = "/Solar System/Planets/Saturn"
}
},
}

View File

@@ -42,6 +42,20 @@ local registerSceneGraphNodes = function (sceneAsset, nodes, override)
end)
end
local registerDashboardItems = function (dashboardAsset, items)
dashboardAsset.onInitialize(function ()
for i, item in ipairs(items) do
openspace.dashboard.addDashboardItem(item)
end
end)
dashboardAsset.onDeinitialize(function ()
for i = #items, 1, -1 do
item = items[i]
openspace.dashboard.removeDashboardItem(item.Identifier)
end
end)
end
local registerSceneGraphNodesAndExport = function (sceneAsset, nodes, override)
override = override or false
if not override then
@@ -110,5 +124,6 @@ end
asset.export("registerSceneGraphNodes", registerSceneGraphNodes)
asset.export("registerSceneGraphNodesAndExport", registerSceneGraphNodesAndExport)
asset.export("registerSpiceKernels", registerSpiceKernels)
asset.export("registerDashboardItems", registerDashboardItems)
asset.export("requireAll", requireAll)
asset.export("requestAll", requestAll)

View File

@@ -0,0 +1,29 @@
local assetHelper = asset.require('util/asset_helper')
assetHelper.registerDashboardItems(asset, {
{
Identifier = "Date",
GuiName = "Date",
Type = "DashboardItemDate"
},
{
Identifier = "SimulationIncrement",
GuiName = "Simulation Increment",
Type = "DashboardItemSimulationIncrement"
},
{
Identifier = "Distance",
GuiName = "Distance",
Type = "DashboardItemDistance"
},
{
Identifier = "Framerate",
GuiName = "Framerate",
Type = "DashboardItemFramerate"
},
{
Identifier = "ParallelConnection",
GuiName = "Parallel Connection",
Type = "DashboardItemParallelConnection"
}
})

View File

@@ -18,13 +18,13 @@ asset.require('scene/solarsystem/missions/voyager/voyager2')
-- Load default key bindings applicable to most scenes
asset.require('util/default_keybindings')
asset.require('util/default_dashboard')
local VoyagerAsset = asset.require('scene/solarsystem/missions/voyager/voyager1')
asset.onInitialize(function ()
openspace.time.setTime("1977 SEP 10 12:00:00")
openspace.setDefaultDashboard()
openspace.setDefaultGuiSorting()
sceneHelper.setDeltaTimeKeys({

View File

@@ -36,7 +36,7 @@ namespace ghoul { class Dictionary; }
namespace openspace::documentation {
using Optional = ghoul::Boolean;
BooleanType(Optional);
/**
* The TestResult structure returns the information from the #testSpecification method. It

View File

@@ -86,9 +86,10 @@ public:
/// The key that stores the factory documentation values
static constexpr const char* KeyFactoryDocumentation = "FactoryDocumentation";
/// The key that decides whether or not we should require incoming web socket connections
/// to authorize or not
static constexpr const char* KeyRequireSocketAuthentication = "RequireSocketAuthentication";
/// The key that decides whether or not we should require incoming web socket
/// connections to authorize or not
static constexpr const char* KeyRequireSocketAuthentication =
"RequireSocketAuthentication";
/// The key that stores the location of the asset file that is initially loaded
static constexpr const char* KeyConfigAsset = "Asset";

View File

@@ -61,12 +61,22 @@ public:
*/
void initialize(const ghoul::Dictionary& moduleConfigurations);
/**
* Calls the initializeGL functions of all registered OpenSpaceModule%s.
*/
void initializeGL();
/**
* Deinitializes all of the contained OpenSpaceModule%s by calling the
* OpenSpaceModule::deinitialize methods.
*/
void deinitialize();
/**
* Calls the deinitializeGL functions of all registered OpenSpaceModule%s.
*/
void deinitializeGL();
/**
* Registers the passed \p module with this ModuleEngine. The OpenSpaceModule::create
* method will be called on the \p module in the process.

View File

@@ -42,7 +42,7 @@ class Syncable;
*/
class SyncEngine {
public:
using IsMaster = ghoul::Boolean;
BooleanType(IsMaster);
/**
* Creates a new SyncEngine which a buffer size of \p syncBufferSize

View File

@@ -40,8 +40,8 @@ namespace openspace::interaction {
class KeyBindingManager : public DocumentationGenerator {
public:
using IsLocalBind = ghoul::Boolean;
using IsSynchronized = ghoul::Boolean;
BooleanType(IsLocalBind);
BooleanType(IsSynchronized);
struct KeyInformation {
std::string command;

View File

@@ -218,7 +218,7 @@ struct TimeKeyframe {
// Timestamp
size = sizeof(_timestamp);
memcpy(&_timestamp, buffer.data() + offset, size);
offset += size;
// offset += size;
};
};

View File

@@ -1,26 +1,26 @@
/*****************************************************************************************
* *
* 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. *
****************************************************************************************/
* *
* OpenSpace *
* *
* Copyright (c) 2014-2018 *
* *
* 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___BINARYPROPERTY___H__
#define __OPENSPACE_CORE___BINARYPROPERTY___H__

View File

@@ -70,7 +70,7 @@ public:
void setInterpolationTarget(ghoul::any value) override;
void setLuaInterpolationTarget(lua_State* state) override;
void setStringInterpolationTarget(std::string value) override;
void interpolateValue(float t,
ghoul::EasingFunc<float> easingFunc = nullptr) override;

View File

@@ -388,10 +388,14 @@ void NumericalProperty<T>::setExponent(float exponent) {
template <typename T>
std::string NumericalProperty<T>::generateAdditionalJsonDescription() const {
std::string result = "{ ";
result += "\"" + MinimumValueKey + "\": " + luaToJson(std::to_string(_minimumValue)) + ",";
result += "\"" + MaximumValueKey + "\": " + luaToJson(std::to_string(_maximumValue)) + ",";
result += "\"" + SteppingValueKey + "\": " + luaToJson(std::to_string(_stepping)) + ",";
result += "\"" + ExponentValueKey + "\": " + luaToJson(std::to_string(_exponent));
result +=
"\"" + MinimumValueKey + "\": " + luaToJson(std::to_string(_minimumValue)) + ",";
result +=
"\"" + MaximumValueKey + "\": " + luaToJson(std::to_string(_maximumValue)) + ",";
result +=
"\"" + SteppingValueKey + "\": " + luaToJson(std::to_string(_stepping)) + ",";
result +=
"\"" + ExponentValueKey + "\": " + luaToJson(std::to_string(_exponent));
result += " }";
return result;
}

View File

@@ -396,8 +396,8 @@ public:
const ghoul::Dictionary& metaData() const;
/**
* Convert the Property into a string containing a JSON representation of the Property.
* Includes description of the object.
* Convert the Property into a string containing a JSON representation of the
* Property. Includes description of the object.
* @return the JSON string
*/
virtual std::string toJson() const;
@@ -412,7 +412,7 @@ public:
virtual void setInterpolationTarget(ghoul::any value);
virtual void setLuaInterpolationTarget(lua_State* state);
virtual void setStringInterpolationTarget(std::string value);
virtual void interpolateValue(float t,
ghoul::EasingFunc<float> easingFunction = nullptr);

View File

@@ -83,8 +83,8 @@ public:
/**
* Sets the identifier for this PropertyOwner. If the PropertyOwner does not have an
* owner itself, the identifier must be globally unique. If the PropertyOwner has an
* owner, the identifier must be unique to the owner (including the owner's
* properties). No uniqueness check will be preformed here, but rather in the
* owner, the identifier must be unique to the owner (including the owner's
* properties). No uniqueness check will be preformed here, but rather in the
* PropertyOwner::addProperty and PropertyOwner::addPropertySubOwner methods).
*
* \param identifier The identifier of this PropertyOwner. It must not contain any
@@ -102,7 +102,7 @@ public:
std::string identifier() const;
/**
* Sets the user-facing name of this PropertyOwner. This name does not have to be
* Sets the user-facing name of this PropertyOwner. This name does not have to be
* unique, but it is recommended to be.
*
* \param guiName The new user-facing name for this PropertyOwner

View File

@@ -48,8 +48,9 @@ public:
void addDashboardItem(std::unique_ptr<DashboardItem> item);
bool hasItem(int index) const;
const DashboardItem& item(int index) const;
void removeDashboardItem(const std::string& identifier);
void removeDashboardItem(int index);
void removeDashboardItems();
void clearDashboardItems();
/**
* Returns the Lua library that contains all Lua functions available to affect the

View File

@@ -36,13 +36,17 @@
namespace openspace {
namespace documentation { struct Documentation; }
class DashboardItem : public properties::PropertyOwner {
public:
static documentation::Documentation Documentation();
static std::unique_ptr<DashboardItem> createFromDictionary(
ghoul::Dictionary dictionary
);
DashboardItem(std::string identifier, std::string guiName = "");
DashboardItem(ghoul::Dictionary dictionary);
bool isEnabled() const;
virtual void render(glm::vec2& penPosition) = 0;

View File

@@ -33,7 +33,8 @@ class Deferredcaster;
class DeferredcasterListener {
public:
using isAttached = ghoul::Boolean;
BooleanType(isAttached);
virtual ~DeferredcasterListener() = default;
virtual void deferredcastersChanged(Deferredcaster& deferredcaster,

View File

@@ -93,7 +93,7 @@ public:
virtual void raycastersChanged(VolumeRaycaster& raycaster, bool attached) override;
virtual void deferredcastersChanged(Deferredcaster& deferredcaster,
ghoul::Boolean isAttached) override;
isAttached isAttached) override;
private:
std::map<VolumeRaycaster*, RaycastData> _raycastData;

View File

@@ -49,10 +49,10 @@ namespace openspace {
class LoadingScreen {
public:
using ShowMessage = ghoul::Boolean;
using ShowNodeNames = ghoul::Boolean;
using ShowProgressbar = ghoul::Boolean;
using CatastrophicError = ghoul::Boolean;
BooleanType(ShowMessage);
BooleanType(ShowNodeNames);
BooleanType(ShowProgressbar);
BooleanType(CatastrophicError);
LoadingScreen(ShowMessage showMessage, ShowNodeNames showNodeNames,
ShowProgressbar showProgressbar);

View File

@@ -101,7 +101,7 @@ public:
protected:
properties::BoolProperty _enabled;
properties::FloatProperty _opacity;
void registerUpdateRenderBinFromOpacity();
private:

View File

@@ -120,8 +120,7 @@ public:
std::string csPath,
const ghoul::Dictionary& dictionary = ghoul::Dictionary());
void removeRenderProgram(
const std::unique_ptr<ghoul::opengl::ProgramObject>& program);
void removeRenderProgram(ghoul::opengl::ProgramObject* program);
/**
* Set raycasting uniforms on the program object, and setup raycasting.

View File

@@ -54,7 +54,7 @@ class Scene
: public properties::PropertyOwner
{
public:
using UpdateDependencies = ghoul::Boolean;
BooleanType(UpdateDependencies);
struct InvalidSceneError : ghoul::RuntimeError {
/**
@@ -176,7 +176,7 @@ public:
* Adds an interpolation request for the passed \p prop that will run for
* \p durationSeconds seconds. Every time the #updateInterpolations method is called
* the Property will be notified that it has to update itself using the stored
* interpolation values. If an interpolation record already exists for the passed
* interpolation values. If an interpolation record already exists for the passed
* \p prop, the previous record will be overwritten and the remaining time of the old
* interpolation is ignored.
*
@@ -186,7 +186,7 @@ public:
*
* \pre \p prop must not be \c nullptr
* \pre \p durationSeconds must be positive and not 0
* \post A new interpolation record exists for \p that is not expired
* \post A new interpolation record exists for \p that is not expired
*/
void addInterpolation(properties::Property* prop, float durationSeconds,
ghoul::EasingFunction easingFunction = ghoul::EasingFunction::Linear);

View File

@@ -61,7 +61,7 @@ public:
GLInitialized
};
using UpdateScene = ghoul::Boolean;
BooleanType(UpdateScene);
struct PerformanceRecord {
long long renderTime; // time in ns
@@ -173,7 +173,7 @@ private:
// Cached transform data
glm::dvec3 _worldPositionCached;
glm::dmat3 _worldRotationCached;
double _worldScaleCached;
double _worldScaleCached = 1.0;
glm::dmat4 _modelTransformCached;
glm::dmat4 _inverseModelTransformCached;

View File

@@ -52,7 +52,7 @@ namespace openspace::scripting {
*/
class ScriptEngine : public Syncable, public DocumentationGenerator {
public:
using RemoteScripting = ghoul::Boolean;
BooleanType(RemoteScripting);
ScriptEngine();

View File

@@ -222,7 +222,7 @@ private:
class HttpFileDownload : public virtual HttpDownload {
public:
using Overwrite = ghoul::Boolean;
BooleanType(Overwrite);
HttpFileDownload() = default;
HttpFileDownload(std::string destination, Overwrite = Overwrite::No);

View File

@@ -66,7 +66,13 @@ public:
* internalInitialize method for further customization for each subclass.
*/
void initialize(const ModuleEngine* moduleEngine,
const ghoul::Dictionary& configuration);
const ghoul::Dictionary& configuration);
/**
* This method calls the internalInitializeGL method for further customization for
* each subclass.
*/
void initializeGL();
/**
* Empty deinitialization method that will call the internalDeinitialize method for
@@ -74,6 +80,11 @@ public:
*/
void deinitialize();
/**
* This method will call the internalDeinitializeGL method for each subclass.
*/
void deinitializeGL();
/**
* Returns a list of Documentation classes that are valid for this OpenSpaceModule.
* \return A list of Documentation classes that are valid for this OpenSapceModule
@@ -112,12 +123,26 @@ protected:
*/
virtual void internalInitialize(const ghoul::Dictionary& configuration);
/**
* Customization point for each derived class. The internalInitializeGL method is
* called by the initializeGL method at a time when a valid OpenGL state is
* guaranteed.
*/
virtual void internalInitializeGL();
/**
* Customization point for each derived class. The internalDeinitialize method is
* called by the deinitialize method.
*/
virtual void internalDeinitialize();
/**
* Customization point for each derived class. The internalDeinitializeGL method is
* called by the deinitializeGL method at a time when a valid OpenGL state is
* guaranteed.
*/
virtual void internalDeinitializeGL();
/**
* Returns the path for this module, possibly containing ghoul::filesystem::FileSystem
* path tokens.

View File

@@ -45,7 +45,7 @@ class SpiceManager : public ghoul::Singleton<SpiceManager> {
friend class ghoul::Singleton<SpiceManager>;
public:
using TransformMatrix = std::array<double, 36>;
using UseException = ghoul::Boolean;
BooleanType(UseException);
using KernelHandle = unsigned int;
struct SpiceException : public ghoul::RuntimeError {

View File

@@ -23,16 +23,15 @@
****************************************************************************************/
#include <modules/atmosphere/atmospheremodule.h>
#include <modules/atmosphere/rendering/renderableatmosphere.h>
#include <openspace/rendering/renderable.h>
#include <openspace/util/factorymanager.h>
#include <ghoul/misc/assert.h>
#include <openspace/rendering/renderable.h>
#include <modules/atmosphere/rendering/renderableatmosphere.h>
namespace openspace {
AtmosphereModule::AtmosphereModule() : OpenSpaceModule("Atmosphere") {}
AtmosphereModule::AtmosphereModule() : OpenSpaceModule(Name) {}
void AtmosphereModule::internalInitialize(const ghoul::Dictionary&) {
auto fRenderable = FactoryManager::ref().factory<Renderable>();

View File

@@ -26,12 +26,13 @@
#define __OPENSPACE_MODULE_ATMOSPHERE___ATMOSPHERE_MODULE___H__
#include <openspace/util/openspacemodule.h>
#include <openspace/properties/scalar/floatproperty.h>
namespace openspace {
class AtmosphereModule : public OpenSpaceModule {
public:
constexpr static const char* Name = "Atmosphere";
AtmosphereModule();
private:

View File

@@ -59,14 +59,8 @@
*/
#include <modules/atmosphere/rendering/atmospheredeferredcaster.h>
#include <modules/atmosphere/rendering/renderableatmosphere.h>
#include <ghoul/glm.h>
#include <ghoul/opengl/ghoul_gl.h>
#include <ghoul/opengl/texture.h>
#include <ghoul/opengl/textureunit.h>
#include <ghoul/opengl/programobject.h>
#include <ghoul/filesystem/filesystem.h>
#include <modules/atmosphere/rendering/renderableatmosphere.h>
#include <openspace/engine/openspaceengine.h>
#include <openspace/util/powerscaledcoordinate.h>
#include <openspace/util/updatestructures.h>
@@ -74,12 +68,17 @@
#include <openspace/rendering/renderable.h>
#include <openspace/rendering/renderengine.h>
#include <openspace/rendering/renderer.h>
#include <ghoul/glm.h>
#include <ghoul/filesystem/filesystem.h>
#include <ghoul/opengl/ghoul_gl.h>
#include <ghoul/opengl/programobject.h>
#include <ghoul/opengl/texture.h>
#include <ghoul/opengl/textureunit.h>
#include <glm/gtx/string_cast.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtx/transform.hpp>
#include <glm/gtx/vector_angle.hpp>
#include <glm/gtc/quaternion.hpp>
#include <sstream>
#include <fstream>
@@ -93,13 +92,13 @@ namespace {
const char* _loggerCat = "AtmosphereDeferredcaster";
const char* GlslDeferredcastPath =
"${MODULES}/atmosphere/shaders/atmosphere_deferred_fs.glsl";
const char* GlslDeferredcastFSPath =
constexpr const char* GlslDeferredcastFSPath =
"${MODULES}/atmosphere/shaders/atmosphere_deferred_fs.glsl";
const char* GlslDeferredcastVsPath =
constexpr const char* GlslDeferredcastVsPath =
"${MODULES}/atmosphere/shaders/atmosphere_deferred_vs.glsl";
const float ATM_EPS = 2.0;
const double KM_TO_M = 1000.0;
constexpr const float ATM_EPS = 2.f;
constexpr const float KM_TO_M = 1000.f;
} // namespace
namespace openspace {

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2016 *
* Copyright (c) 2014-2018 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2016 *
* Copyright (c) 2014-2018 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2016 *
* Copyright (c) 2014-2018 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2016 *
* Copyright (c) 2014-2018 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2016 *
* Copyright (c) 2014-2018 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2016 *
* Copyright (c) 2014-2018 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2016 *
* Copyright (c) 2014-2018 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
@@ -21,7 +21,7 @@
* 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 "atmosphere_common.glsl"

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2016 *
* Copyright (c) 2014-2018 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2016 *
* Copyright (c) 2014-2018 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2016 *
* Copyright (c) 2014-2018 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2016 *
* Copyright (c) 2014-2018 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2016 *
* Copyright (c) 2014-2018 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2016 *
* Copyright (c) 2014-2018 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2016 *
* Copyright (c) 2014-2018 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2016 *
* Copyright (c) 2014-2018 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2016 *
* Copyright (c) 2014-2018 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2016 *
* Copyright (c) 2014-2018 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2016 *
* Copyright (c) 2014-2018 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2016 *
* Copyright (c) 2014-2018 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2016 *
* Copyright (c) 2014-2018 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2016 *
* Copyright (c) 2014-2018 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
@@ -21,6 +21,7 @@
* 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 "atmosphere_common.glsl"

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2016 *
* Copyright (c) 2014-2018 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2016 *
* Copyright (c) 2014-2018 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2016 *
* Copyright (c) 2014-2018 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2016 *
* Copyright (c) 2014-2018 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2016 *
* Copyright (c) 2014-2018 *
* *
* 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 *

View File

@@ -66,6 +66,8 @@
namespace openspace {
ghoul::opengl::ProgramObjectManager BaseModule::ProgramObjectManager;
BaseModule::BaseModule() : OpenSpaceModule(BaseModule::Name) {}
void BaseModule::internalInitialize(const ghoul::Dictionary&) {
@@ -137,6 +139,10 @@ void BaseModule::internalInitialize(const ghoul::Dictionary&) {
fGeometry->registerClass<modelgeometry::MultiModelGeometry>("MultiModelGeometry");
}
void BaseModule::internalDeinitializeGL() {
ProgramObjectManager.releaseAll(ghoul::opengl::ProgramObjectManager::Warnings::Yes);
}
std::vector<documentation::Documentation> BaseModule::documentations() const {
return {
DashboardItemDate::Documentation(),

View File

@@ -27,6 +27,8 @@
#include <openspace/util/openspacemodule.h>
#include <ghoul/opengl/programobjectmanager.h>
namespace openspace {
class BaseModule : public OpenSpaceModule {
@@ -39,8 +41,11 @@ public:
std::vector<documentation::Documentation> documentations() const override;
std::vector<scripting::LuaLibrary> luaLibraries() const override;
static ghoul::opengl::ProgramObjectManager ProgramObjectManager;
protected:
void internalInitialize(const ghoul::Dictionary&) override;
void internalDeinitializeGL() override;
};
} // namespace openspace

View File

@@ -32,15 +32,14 @@
#include <openspace/scene/scene.h>
#include <openspace/scene/scenegraphnode.h>
#include <openspace/util/camera.h>
#include <ghoul/font/font.h>
#include <ghoul/font/fontmanager.h>
#include <ghoul/font/fontrenderer.h>
namespace {
const char* KeyFontMono = "Mono";
constexpr const char* KeyFontMono = "Mono";
const float DefaultFontSize = 10.f;
constexpr const float DefaultFontSize = 10.f;
static const openspace::properties::Property::PropertyInfo FontNameInfo = {
"FontName",
@@ -106,6 +105,7 @@ namespace openspace {
documentation::Documentation DashboardItemAngle::Documentation() {
using namespace documentation;
return {
"DashboardItem Angle",
"base_dashboarditem_angle",
@@ -174,7 +174,7 @@ documentation::Documentation DashboardItemAngle::Documentation() {
}
DashboardItemAngle::DashboardItemAngle(ghoul::Dictionary dictionary)
: DashboardItem("Angle")
: DashboardItem(dictionary)
, _fontName(FontNameInfo, KeyFontMono)
, _fontSize(FontSizeInfo, DefaultFontSize, 6.f, 144.f, 1.f)
, _source{

View File

@@ -30,7 +30,6 @@
#include <openspace/properties/optionproperty.h>
#include <openspace/properties/stringproperty.h>
#include <openspace/properties/scalar/floatproperty.h>
#include <utility>
namespace ghoul::fontrendering { class Font; }

View File

@@ -81,7 +81,7 @@ documentation::Documentation DashboardItemDate::Documentation() {
}
DashboardItemDate::DashboardItemDate(ghoul::Dictionary dictionary)
: DashboardItem("Date")
: DashboardItem(dictionary)
, _fontName(FontNameInfo, KeyFontMono)
, _fontSize(FontSizeInfo, DefaultFontSize, 6.f, 144.f, 1.f)
{

View File

@@ -30,9 +30,7 @@
#include <openspace/properties/stringproperty.h>
#include <openspace/properties/scalar/floatproperty.h>
namespace ghoul::fontrendering {
class Font;
} // namespace ghoul::fontrendering
namespace ghoul::fontrendering { class Font; }
namespace openspace {

View File

@@ -183,7 +183,7 @@ documentation::Documentation DashboardItemDistance::Documentation() {
}
DashboardItemDistance::DashboardItemDistance(ghoul::Dictionary dictionary)
: DashboardItem("Distance")
: DashboardItem(dictionary)
, _fontName(FontNameInfo, KeyFontMono)
, _fontSize(FontSizeInfo, DefaultFontSize, 6.f, 144.f, 1.f)
, _doSimplification(SimplificationInfo, true)

View File

@@ -96,7 +96,7 @@ documentation::Documentation DashboardItemFramerate::Documentation() {
}
DashboardItemFramerate::DashboardItemFramerate(ghoul::Dictionary dictionary)
: DashboardItem("Framerate")
: DashboardItem(dictionary)
, _fontName(FontNameInfo, KeyFontMono)
, _fontSize(FontSizeInfo, DefaultFontSize, 6.f, 144.f, 1.f)
, _frametimeType(FrametimeInfo, properties::OptionProperty::DisplayType::Dropdown)

View File

@@ -101,7 +101,7 @@ documentation::Documentation DashboardItemMission::Documentation() {
}
DashboardItemMission::DashboardItemMission(ghoul::Dictionary dictionary)
: DashboardItem("Mission")
: DashboardItem(dictionary)
, _fontName(FontNameInfo, KeyFontMono)
, _fontSize(FontSizeInfo, DefaultFontSize, 6.f, 144.f, 1.f)
{

View File

@@ -86,7 +86,7 @@ documentation::Documentation DashboardItemParallelConnection::Documentation() {
DashboardItemParallelConnection::DashboardItemParallelConnection(
ghoul::Dictionary dictionary)
: DashboardItem("ParallelConnection", "Parallel Connection")
: DashboardItem(dictionary)
, _fontName(FontNameInfo, KeyFontMono)
, _fontSize(FontSizeInfo, DefaultFontSize, 6.f, 144.f, 1.f)
{

View File

@@ -123,7 +123,7 @@ documentation::Documentation DashboardItemSimulationIncrement::Documentation() {
DashboardItemSimulationIncrement::DashboardItemSimulationIncrement(
ghoul::Dictionary dictionary)
: DashboardItem("SimulationIncrement", "Simulation Increment")
: DashboardItem(dictionary)
, _fontName(FontNameInfo, KeyFontMono)
, _fontSize(FontSizeInfo, DefaultFontSize, 6.f, 144.f, 1.f)
, _doSimplification(SimplificationInfo, true)

View File

@@ -60,7 +60,7 @@ documentation::Documentation DashboardItemSpacing::Documentation() {
}
DashboardItemSpacing::DashboardItemSpacing(ghoul::Dictionary dictionary)
: DashboardItem("Spacing")
: DashboardItem(dictionary)
, _spacing(SpacingInfo, 15.f, 0.f, 2048.f)
{
documentation::testSpecificationAndThrow(

View File

@@ -24,8 +24,8 @@
#include <modules/base/rendering/renderablemodel.h>
#include <modules/base/basemodule.h>
#include <modules/base/rendering/modelgeometry.h>
#include <openspace/documentation/documentation.h>
#include <openspace/documentation/verifier.h>
#include <openspace/engine/configurationmanager.h>
@@ -43,7 +43,8 @@
#include <ghoul/opengl/textureunit.h>
namespace {
const char* KeyGeometry = "Geometry";
constexpr const char* ProgramName = "ModelProgram";
constexpr const char* KeyGeometry = "Geometry";
static const openspace::properties::Property::PropertyInfo TextureInfo = {
"ColorTexture",
@@ -154,10 +155,15 @@ bool RenderableModel::isReady() const {
}
void RenderableModel::initializeGL() {
_programObject = OsEng.renderEngine().buildRenderProgram(
"ModelProgram",
absPath("${MODULE_BASE}/shaders/model_vs.glsl"),
absPath("${MODULE_BASE}/shaders/model_fs.glsl")
_programObject = BaseModule::ProgramObjectManager.requestProgramObject(
ProgramName,
[]() -> std::unique_ptr<ghoul::opengl::ProgramObject> {
return OsEng.renderEngine().buildRenderProgram(
ProgramName,
absPath("${MODULE_BASE}/shaders/model_vs.glsl"),
absPath("${MODULE_BASE}/shaders/model_fs.glsl")
);
}
);
_uniformCache.opacity = _programObject->uniformLocation("opacity");
@@ -188,10 +194,13 @@ void RenderableModel::deinitializeGL() {
}
_texture = nullptr;
if (_programObject) {
OsEng.renderEngine().removeRenderProgram(_programObject);
_programObject = nullptr;
}
BaseModule::ProgramObjectManager.releaseProgramObject(
ProgramName,
[](ghoul::opengl::ProgramObject* p) {
OsEng.renderEngine().removeRenderProgram(p);
}
);
_programObject = nullptr;
}
void RenderableModel::render(const RenderData& data, RendererTasks&) {

View File

@@ -73,7 +73,7 @@ private:
properties::BoolProperty _performShading;
properties::Mat3Property _modelTransform;
std::unique_ptr<ghoul::opengl::ProgramObject> _programObject;
ghoul::opengl::ProgramObject* _programObject;
UniformCache(opacity, directionToSunViewSpace, modelViewTransform,
projectionTransform, performShading, texture) _uniformCache;

View File

@@ -24,6 +24,7 @@
#include <modules/base/rendering/renderableplane.h>
#include <modules/base/basemodule.h>
#include <openspace/documentation/documentation.h>
#include <openspace/documentation/verifier.h>
#include <openspace/engine/openspaceengine.h>
@@ -39,6 +40,8 @@
#include <ghoul/opengl/textureunit.h>
namespace {
constexpr const char* ProgramName = "Plane";
enum BlendMode {
BlendModeNormal = 0,
BlendModeAdditive
@@ -164,10 +167,15 @@ void RenderablePlane::initializeGL() {
glGenBuffers(1, &_vertexPositionBuffer); // generate buffer
createPlane();
_shader = OsEng.renderEngine().buildRenderProgram(
"PlaneProgram",
absPath("${MODULE_BASE}/shaders/plane_vs.glsl"),
absPath("${MODULE_BASE}/shaders/plane_fs.glsl")
_shader = BaseModule::ProgramObjectManager.requestProgramObject(
ProgramName,
[]() -> std::unique_ptr<ghoul::opengl::ProgramObject> {
return OsEng.renderEngine().buildRenderProgram(
ProgramName,
absPath("${MODULE_BASE}/shaders/plane_vs.glsl"),
absPath("${MODULE_BASE}/shaders/plane_fs.glsl")
);
}
);
}
@@ -178,11 +186,13 @@ void RenderablePlane::deinitializeGL() {
glDeleteBuffers(1, &_vertexPositionBuffer);
_vertexPositionBuffer = 0;
RenderEngine& renderEngine = OsEng.renderEngine();
if (_shader) {
renderEngine.removeRenderProgram(_shader);
_shader = nullptr;
}
BaseModule::ProgramObjectManager.releaseProgramObject(
ProgramName,
[](ghoul::opengl::ProgramObject* p) {
OsEng.renderEngine().removeRenderProgram(p);
}
);
_shader = nullptr;
}
void RenderablePlane::render(const RenderData& data, RendererTasks&) {

View File

@@ -73,7 +73,7 @@ private:
properties::FloatProperty _size;
properties::OptionProperty _blendMode;
std::unique_ptr<ghoul::opengl::ProgramObject> _shader;
ghoul::opengl::ProgramObject* _shader;
GLuint _quad;
GLuint _vertexPositionBuffer;

View File

@@ -24,6 +24,7 @@
#include <modules/base/rendering/renderablesphere.h>
#include <modules/base/basemodule.h>
#include <openspace/documentation/documentation.h>
#include <openspace/documentation/verifier.h>
#include <openspace/engine/openspaceengine.h>
@@ -39,6 +40,8 @@
#include <ghoul/opengl/programobject.h>
namespace {
constexpr const char* ProgramName = "Sphere";
enum Orientation {
Outside = 1,
Inside = 2
@@ -238,11 +241,15 @@ void RenderableSphere::initializeGL() {
);
_sphere->initialize();
// pscstandard
_shader = OsEng.renderEngine().buildRenderProgram(
"Sphere",
absPath("${MODULE_BASE}/shaders/sphere_vs.glsl"),
absPath("${MODULE_BASE}/shaders/sphere_fs.glsl")
_shader = BaseModule::ProgramObjectManager.requestProgramObject(
ProgramName,
[]() -> std::unique_ptr<ghoul::opengl::ProgramObject> {
return OsEng.renderEngine().buildRenderProgram(
ProgramName,
absPath("${MODULE_BASE}/shaders/sphere_vs.glsl"),
absPath("${MODULE_BASE}/shaders/sphere_fs.glsl")
);
}
);
_uniformCache.opacity = _shader->uniformLocation("opacity");
@@ -256,10 +263,13 @@ void RenderableSphere::initializeGL() {
void RenderableSphere::deinitializeGL() {
_texture = nullptr;
if (_shader) {
OsEng.renderEngine().removeRenderProgram(_shader);
_shader = nullptr;
}
BaseModule::ProgramObjectManager.releaseProgramObject(
ProgramName,
[](ghoul::opengl::ProgramObject* p) {
OsEng.renderEngine().removeRenderProgram(p);
}
);
_shader = nullptr;
}
void RenderableSphere::render(const RenderData& data, RendererTasks&) {
@@ -275,7 +285,7 @@ void RenderableSphere::render(const RenderData& data, RendererTasks&) {
_shader->setUniform(_uniformCache.viewProjection, data.camera.viewProjectionMatrix());
_shader->setUniform(_uniformCache.modelTransform, transform);
setPscUniforms(*_shader.get(), data.camera, data.position);
setPscUniforms(*_shader, data.camera, data.position);
float adjustedTransparency = _opacity;

View File

@@ -74,7 +74,7 @@ private:
float _fadeOutThreshold;
float _fadeInThreshold;
std::unique_ptr<ghoul::opengl::ProgramObject> _shader;
ghoul::opengl::ProgramObject* _shader;
std::unique_ptr<ghoul::opengl::Texture> _texture;
std::unique_ptr<PowerScaledSphere> _sphere;

View File

@@ -24,6 +24,7 @@
#include <modules/base/rendering/renderablesphericalgrid.h>
#include <modules/base/basemodule.h>
#include <openspace/engine/configurationmanager.h>
#include <openspace/engine/openspaceengine.h>
#include <openspace/rendering/renderengine.h>
@@ -36,6 +37,8 @@
#include <ghoul/opengl/programobject.h>
namespace {
constexpr const char* ProgramName = "GridProgram";
static const openspace::properties::Property::PropertyInfo GridColorInfo = {
"GridColor",
"Grid Color",
@@ -182,10 +185,15 @@ bool RenderableSphericalGrid::isReady() const {
}
void RenderableSphericalGrid::initializeGL() {
_gridProgram = OsEng.renderEngine().buildRenderProgram(
"GridProgram",
absPath("${MODULE_BASE}/shaders/grid_vs.glsl"),
absPath("${MODULE_BASE}/shaders/grid_fs.glsl")
_gridProgram = BaseModule::ProgramObjectManager.requestProgramObject(
ProgramName,
[]() -> std::unique_ptr<ghoul::opengl::ProgramObject> {
return OsEng.renderEngine().buildRenderProgram(
ProgramName,
absPath("${MODULE_BASE}/shaders/grid_vs.glsl"),
absPath("${MODULE_BASE}/shaders/grid_fs.glsl")
);
}
);
glGenVertexArrays(1, &_vaoID);
@@ -208,6 +216,14 @@ void RenderableSphericalGrid::deinitializeGL() {
glDeleteBuffers(1, &_iBufferID);
_iBufferID = 0;
BaseModule::ProgramObjectManager.releaseProgramObject(
ProgramName,
[](ghoul::opengl::ProgramObject* p) {
OsEng.renderEngine().removeRenderProgram(p);
}
);
_gridProgram = nullptr;
}
void RenderableSphericalGrid::render(const RenderData& data, RendererTasks&){

View File

@@ -63,7 +63,7 @@ protected:
float location[3];
};
std::unique_ptr<ghoul::opengl::ProgramObject> _gridProgram;
ghoul::opengl::ProgramObject* _gridProgram;
properties::DMat4Property _gridMatrix;
properties::Vec4Property _gridColor;

View File

@@ -24,6 +24,7 @@
#include <modules/base/rendering/renderabletrail.h>
#include <modules/base/basemodule.h>
#include <openspace/documentation/documentation.h>
#include <openspace/documentation/verifier.h>
#include <openspace/engine/openspaceengine.h>
@@ -35,7 +36,8 @@
#include <ghoul/opengl/programobject.h>
namespace {
const char* KeyTranslation = "Translation";
constexpr const char* ProgramName = "EphemerisProgram";
constexpr const char* KeyTranslation = "Translation";
// The possible values for the _renderingModes property
enum RenderingMode {
@@ -222,11 +224,15 @@ RenderableTrail::RenderableTrail(const ghoul::Dictionary& dictionary)
}
void RenderableTrail::initializeGL() {
RenderEngine& renderEngine = OsEng.renderEngine();
_programObject = renderEngine.buildRenderProgram(
"EphemerisProgram",
absPath("${MODULE_BASE}/shaders/renderabletrail_vs.glsl"),
absPath("${MODULE_BASE}/shaders/renderabletrail_fs.glsl")
_programObject = BaseModule::ProgramObjectManager.requestProgramObject(
ProgramName,
[]() -> std::unique_ptr<ghoul::opengl::ProgramObject> {
return OsEng.renderEngine().buildRenderProgram(
ProgramName,
absPath("${MODULE_BASE}/shaders/renderabletrail_vs.glsl"),
absPath("${MODULE_BASE}/shaders/renderabletrail_fs.glsl")
);
}
);
_uniformCache.opacity = _programObject->uniformLocation("opacity");
@@ -246,11 +252,13 @@ void RenderableTrail::initializeGL() {
}
void RenderableTrail::deinitializeGL() {
RenderEngine& renderEngine = OsEng.renderEngine();
if (_programObject) {
renderEngine.removeRenderProgram(_programObject);
_programObject = nullptr;
}
BaseModule::ProgramObjectManager.releaseProgramObject(
ProgramName,
[](ghoul::opengl::ProgramObject* p) {
OsEng.renderEngine().removeRenderProgram(p);
}
);
_programObject = nullptr;
}
bool RenderableTrail::isReady() const {
@@ -305,7 +313,7 @@ void RenderableTrail::render(const RenderData& data, RendererTasks&) {
glEnable(GL_PROGRAM_POINT_SIZE);
}
auto render = [renderLines, renderPoints, p = _programObject.get(), &data,
auto render = [renderLines, renderPoints, p = _programObject, &data,
&modelTransform, pointSize = _pointSize.value(), c = _uniformCache]
(RenderInformation& info, int nVertices, int offset)
{

View File

@@ -158,7 +158,7 @@ private:
properties::OptionProperty _renderingModes;
/// Program object used to render the data stored in RenderInformation
std::unique_ptr<ghoul::opengl::ProgramObject> _programObject;
ghoul::opengl::ProgramObject* _programObject;
UniformCache(opacity, modelView, projection, color, useLineFade, lineFade,
vertexSorting, idOffset, nVertices, stride, pointSize, renderPhase) _uniformCache;

View File

@@ -42,8 +42,6 @@
#include <ghoul/font/fontrenderer.h>
namespace {
const char* KeyName = "Name";
static const openspace::properties::Property::PropertyInfo UseMainInfo = {
"UseMainDashboard",
"Use main dashboard",
@@ -120,7 +118,7 @@ int removeDashboardItemsFromScreenSpace(lua_State* L) {
return luaL_error(L, "Provided name is a ScreenSpace item but not a dashboard");
}
dash->dashboard().removeDashboardItems();
dash->dashboard().clearDashboardItems();
return 0;
}

View File

@@ -37,8 +37,6 @@
#include <ghoul/opengl/textureconversion.h>
namespace {
const char* KeyName = "Name";
static const openspace::properties::Property::PropertyInfo TexturePathInfo = {
"TexturePath",
"Texture path",

View File

@@ -36,8 +36,6 @@
#include <ghoul/opengl/programobject.h>
namespace {
constexpr const char* KeyName = "Name";
static const openspace::properties::Property::PropertyInfo TextureInfo = {
"URL",
"Image URL",

View File

@@ -335,7 +335,7 @@ FixedRotation::FixedRotation(const ghoul::Dictionary& dictionary)
_attachedNode = sceneGraphNode(_attachedObject);
});
auto setPropertyVisibility = [this](Axis& axis) {
auto setPropertyVisibility = [](Axis& axis) {
using Visibility = properties::Property::Visibility;
switch (axis.type) {
case Axis::Type::Object:

View File

@@ -2,7 +2,7 @@
# #
# OpenSpace #
# #
# Copyright (c) 2014-2017 #
# Copyright (c) 2014-2018 #
# #
# 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 #

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2017 *
* Copyright (c) 2014-2018 *
* *
* 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 *

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2017 *
* Copyright (c) 2014-2018 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
@@ -22,8 +22,8 @@
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#ifndef OPENSPACE_CEFWEBGUIMODULE_H
#define OPENSPACE_CEFWEBGUIMODULE_H
#ifndef __OPENSPACE_MODULE_CEFWEBGUI___CEFWEBGUIMODULE___H__
#define __OPENSPACE_MODULE_CEFWEBGUI___CEFWEBGUIMODULE___H__
#include <openspace/util/openspacemodule.h>
#include <include/openspace/engine/configurationmanager.h>
@@ -45,4 +45,4 @@ private:
}
#endif //OPENSPACE_WEBGUIMODULE_H
#endif // __OPENSPACE_MODULE_CEFWEBGUI___CEFWEBGUIMODULE___H__

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2017 *
* Copyright (c) 2014-2018 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
@@ -22,8 +22,8 @@
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#ifndef __OPENSPACE_MODULE_WEBBROWSER___GUI_RENDER_HANDLER___H__
#define __OPENSPACE_MODULE_WEBBROWSER___GUI_RENDER_HANDLER___H__
#ifndef __OPENSPACE_MODULE_CEFWEBGUI___GUI_RENDER_HANDLER___H__
#define __OPENSPACE_MODULE_CEFWEBGUI___GUI_RENDER_HANDLER___H__
#include <memory>
#include <include/openspace/engine/openspaceengine.h>
@@ -41,14 +41,16 @@ public:
GUIRenderHandler();
void initializeGL();
void draw(void);
void draw();
void render() {};
private:
std::unique_ptr<ghoul::opengl::ProgramObject> _programObject;
GLuint _program, _vao, _vbo;
GLuint _program;
GLuint _vao;
GLuint _vbo;
};
} // namespace openspace
#endif // __OPENSPACE_MODULE_WEBBROWSER___GUI_RENDER_HANDLER___H__
#endif // __OPENSPACE_MODULE_CEFWEBGUI___GUI_RENDER_HANDLER___H__

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