General pass for coding style

This commit is contained in:
Alexander Bock
2020-11-28 22:31:06 +01:00
parent ab78132607
commit 60e3ed2170
56 changed files with 377 additions and 278 deletions

View File

@@ -582,10 +582,10 @@ void mainPostDrawFunc() {
}
if (w.right.initialized) {
const GLuint texId = window.frameBufferTexture(Window::TextureIndex::RightEye);
glBindTexture(GL_TEXTURE_2D, texId);
const GLuint tId = window.frameBufferTexture(Window::TextureIndex::RightEye);
glBindTexture(GL_TEXTURE_2D, tId);
w.right.handle->SendTexture(
texId,
tId,
GL_TEXTURE_2D,
window.framebufferResolution().x,
window.framebufferResolution().y
@@ -1205,7 +1205,7 @@ int main(int argc, char** argv) {
arguments.insert(arguments.begin() + 2, absPath(windowConfiguration));
// Need to set this before the creation of the sgct::Engine
Log::instance().setLogToConsole(false);
Log::instance().setShowTime(false);
Log::instance().setShowLogLevel(false);

View File

@@ -593,8 +593,8 @@ protected:
DataMode mode, int lineNum, std::ofstream& outFile);
virtual bool convertCamera(std::stringstream& inStream, DataMode mode, int lineNum,
std::string& inputLine, std::ofstream& outFile, unsigned char* buff);
virtual bool convertTimeChange(std::stringstream& inStream, DataMode mode, int lineNum,
std::string& inputLine, std::ofstream& outFile, unsigned char* buff);
virtual bool convertTimeChange(std::stringstream& inStream, DataMode mode,
int lineNum, std::string& inputLine, std::ofstream& outFile, unsigned char* buff);
virtual bool convertScript(std::stringstream& inStream, DataMode mode, int lineNum,
std::string& inputLine, std::ofstream& outFile, unsigned char* buff);
DataMode readModeFromHeader(std::string filename);

View File

@@ -54,4 +54,4 @@ private:
} // namespace openspace::interaction
#endif //__OPENSPACE_CORE___CONVERTRECFILEVERSIONTASK___H__
#endif // __OPENSPACE_CORE___CONVERTRECFILEVERSIONTASK___H__

View File

@@ -32,8 +32,6 @@
#include <string>
namespace openspace::interaction {
class ConvertRecFormatTask : public Task {
@@ -67,4 +65,4 @@ private:
} // namespace openspace::interaction
#endif //__OPENSPACE_CORE___CONVERTRECFORMATTASK___H__
#endif // __OPENSPACE_CORE___CONVERTRECFORMATTASK___H__

View File

@@ -105,7 +105,8 @@ VertexXYZ convertToXYZ(const Vertex& v);
std::vector<VertexXYZ> convert(std::vector<Vertex> v);
std::vector<Vertex> createRing(int nSegments, float radius, glm::vec4 colors = glm::vec4(1.f));
std::vector<Vertex> createRing(int nSegments, float radius,
glm::vec4 colors = glm::vec4(1.f));
} // namespace openspace::rendering::helper

View File

@@ -215,7 +215,7 @@ private:
_onDependencyInitializationFunctionRefs;
std::unordered_map<Asset*, std::map<Asset*, std::vector<int>>>
_onDependencyDeinitializationFunctionRefs;
int _assetsTableRef = 0;
};

View File

@@ -127,7 +127,7 @@ public:
* and all of the property & asset changes that were made since startup.
*/
void saveCurrentSettingsToProfile(const properties::PropertyOwner& rootOwner,
std::string currentTime,
std::string currentTime,
interaction::NavigationHandler::NavigationState navState);
/// If the value passed to this function is 'true', the addAsset and removeAsset

View File

@@ -160,7 +160,8 @@ private:
std::vector<std::pair<CallbackHandle, TimeChangeCallback>> _timeChangeCallbacks;
std::vector<std::pair<CallbackHandle, TimeChangeCallback>> _deltaTimeChangeCallbacks;
std::vector<std::pair<CallbackHandle, TimeChangeCallback>> _deltaTimeStepsChangeCallbacks;
std::vector<std::pair<CallbackHandle, TimeChangeCallback>>
_deltaTimeStepsChangeCallbacks;
std::vector<std::pair<CallbackHandle, TimeChangeCallback>> _timeJumpCallbacks;
std::vector<std::pair<CallbackHandle, TimeChangeCallback>> _timelineChangeCallbacks;

View File

@@ -384,13 +384,14 @@ RenderableAtmosphere::RenderableAtmosphere(const ghoul::Dictionary& dictionary)
"Atmosphere Effects. Disabling atmosphere effects for this planet."
);
}
if (atmosphereDictionary.hasKey(SunIntensityInfo.identifier)) {
_sunRadianceIntensity =
atmosphereDictionary.value<float>(SunIntensityInfo.identifier);
}
if (atmosphereDictionary.hasKey(MieScatteringExtinctionPropCoeffInfo.identifier)) {
if (atmosphereDictionary.hasKey(MieScatteringExtinctionPropCoeffInfo.identifier))
{
_mieScattExtPropCoefProp = atmosphereDictionary.value<float>(
MieScatteringExtinctionPropCoeffInfo.identifier
);
@@ -621,7 +622,7 @@ RenderableAtmosphere::RenderableAtmosphere(const ghoul::Dictionary& dictionary)
_mieScatteringCoeffZP.onChange(updateAtmosphere);
addProperty(_mieScatteringCoeffZP);
_mieScatteringExtinctionPropCoefficientP =
_mieScatteringExtinctionPropCoefficientP =
_mieScattExtPropCoefProp != 1.f ? _mieScattExtPropCoefProp :
_mieScatteringCoeff.x / _mieExtinctionCoeff.x;

View File

@@ -272,14 +272,7 @@ void RenderableBoxGrid::update(const UpdateData&) {
GL_STATIC_DRAW
);
glVertexAttribPointer(
0,
3,
GL_FLOAT,
GL_FALSE,
sizeof(Vertex),
nullptr
);
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex), nullptr);
glBindVertexArray(0);

View File

@@ -81,7 +81,8 @@ documentation::Documentation RenderableGrid::Documentation() {
},
{
SegmentsInfo.identifier,
new DoubleVector2Verifier, // @TODO (emmbr 2020-07-07): should be Int, but specification test fails...
// @TODO (emmbr 2020-07-07): should be Int, but specification test fails..
new DoubleVector2Verifier,
Optional::Yes,
SegmentsInfo.description
},
@@ -230,13 +231,13 @@ void RenderableGrid::update(const UpdateData&) {
const glm::vec2 halfSize = _size.value() / 2.f;
const glm::uvec2 nSegments = _segments.value();
const glm::vec2 step = _size.value() / static_cast<glm::vec2>(nSegments);
const glm::vec2 step = _size.value() / static_cast<glm::vec2>(nSegments);
const int nLines = (2 * nSegments.x * nSegments.y) + nSegments.x + nSegments.y;
const int nVertices = 2 * nLines;
_varray.resize(nVertices);
// OBS! Could be optimized further by removing duplicate vertices
int nr = 0;
for (unsigned int i = 0; i < nSegments.x; ++i) {
for (unsigned int j = 0; j < nSegments.y; ++j) {

View File

@@ -35,7 +35,7 @@
#include <openspace/properties/vector/vec3property.h>
#include <ghoul/opengl/ghoul_gl.h>
namespace ghoul::opengl { class ProgramObject; }
namespace ghoul::opengl { class ProgramObject; }
namespace openspace::documentation { struct Documentation; }
namespace openspace {

View File

@@ -131,8 +131,8 @@ RenderableRadialGrid::RenderableRadialGrid(const ghoul::Dictionary& dictionary)
: Renderable(dictionary)
, _gridColor(GridColorInfo, glm::vec3(0.5f), glm::vec3(0.f), glm::vec3(1.f))
, _gridSegments(
GridSegmentsInfo,
glm::ivec2(1, 1),
GridSegmentsInfo,
glm::ivec2(1, 1),
glm::ivec2(1),
glm::ivec2(200)
)
@@ -258,7 +258,7 @@ void RenderableRadialGrid::render(const RenderData& data, RendererTasks&) {
"MVPTransform",
glm::dmat4(data.camera.projectionMatrix()) * modelViewTransform
);
_gridProgram->setUniform("gridColor", _gridColor);
float adjustedLineWidth = 1.f;
@@ -272,7 +272,7 @@ void RenderableRadialGrid::render(const RenderData& data, RendererTasks&) {
glEnablei(GL_BLEND, 0);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_LINE_SMOOTH);
for (GeometryData& c : _circles) {
c.render();
}
@@ -337,9 +337,9 @@ void RenderableRadialGrid::update(const UpdateData&) {
rendering::helper::createRing(nLines, _minRadius);
for (int i = 0; i < nLines; ++i) {
const rendering::helper::VertexXYZ vOut =
const rendering::helper::VertexXYZ vOut =
rendering::helper::convertToXYZ(outerVertices[i]);
const rendering::helper::VertexXYZ vIn =
rendering::helper::convertToXYZ(innerVertices[i]);
@@ -352,7 +352,7 @@ void RenderableRadialGrid::update(const UpdateData&) {
_gridIsDirty = false;
}
RenderableRadialGrid::GeometryData::GeometryData(GLenum renderMode)
RenderableRadialGrid::GeometryData::GeometryData(GLenum renderMode)
: mode(renderMode)
{
glGenVertexArrays(1, &vao);
@@ -375,8 +375,8 @@ RenderableRadialGrid::GeometryData::GeometryData(GeometryData&& other) noexcept
other.vbo = 0;
}
RenderableRadialGrid::GeometryData&
RenderableRadialGrid::GeometryData::operator=(GeometryData&& other) noexcept
RenderableRadialGrid::GeometryData&
RenderableRadialGrid::GeometryData::operator=(GeometryData&& other) noexcept
{
if (this != &other) {
vao = other.vao;
@@ -409,11 +409,11 @@ void RenderableRadialGrid::GeometryData::update() {
);
glVertexAttribPointer(
0,
3,
GL_FLOAT,
GL_FALSE,
sizeof(rendering::helper::VertexXYZ),
0,
3,
GL_FLOAT,
GL_FALSE,
sizeof(rendering::helper::VertexXYZ),
nullptr
);
}

View File

@@ -201,7 +201,7 @@ void RenderableSphericalGrid::render(const RenderData& data, RendererTasks&){
"MVPTransform",
glm::dmat4(data.camera.projectionMatrix()) * modelViewTransform
);
_gridProgram->setUniform("gridColor", _gridColor);
float adjustedLineWidth = 1.f;
@@ -215,7 +215,7 @@ void RenderableSphericalGrid::render(const RenderData& data, RendererTasks&){
glEnablei(GL_BLEND, 0);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_LINE_SMOOTH);
glBindVertexArray(_vaoID);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _iBufferID);
glDrawElements(_mode, _isize, GL_UNSIGNED_INT, nullptr);

View File

@@ -82,7 +82,6 @@ documentation:: Documentation ModelGeometry::Documentation() {
};
}
// Create with ghoul::mm_unique_ptr
ghoul::mm_unique_ptr<ModelGeometry> ModelGeometry::createFromDictionary(
const ghoul::Dictionary& dictionary)
{

View File

@@ -62,8 +62,8 @@ namespace {
constexpr const std::array<const char*, 13> UniformNames = {
"opacity", "nLightSources", "lightDirectionsViewSpace", "lightIntensities",
"modelViewTransform", "normalTransform", "projectionTransform",
"performShading", "texture1", "ambientIntensity", "diffuseIntensity",
"modelViewTransform", "normalTransform", "projectionTransform",
"performShading", "texture1", "ambientIntensity", "diffuseIntensity",
"specularIntensity", "opacityBlending"
};

View File

@@ -86,8 +86,8 @@ private:
ghoul::opengl::ProgramObject* _program = nullptr;
UniformCache(opacity, nLightSources, lightDirectionsViewSpace, lightIntensities,
modelViewTransform, normalTransform, projectionTransform,
performShading, texture, ambientIntensity, diffuseIntensity,
modelViewTransform, normalTransform, projectionTransform,
performShading, texture, ambientIntensity, diffuseIntensity,
specularIntensity, opacityBlending) _uniformCache;
std::vector<std::unique_ptr<LightSource>> _lightSources;

View File

@@ -370,7 +370,9 @@ void RenderableSphere::render(const RenderData& data, RendererTasks&) {
const float startLogFadeDistance = glm::log(_size * _fadeInThreshold);
const float stopLogFadeDistance = startLogFadeDistance + 1.f;
if (logDistCamera > startLogFadeDistance && logDistCamera < stopLogFadeDistance) {
if (logDistCamera > startLogFadeDistance && logDistCamera <
stopLogFadeDistance)
{
const float fadeFactor = glm::clamp(
(logDistCamera - startLogFadeDistance) /
(stopLogFadeDistance - startLogFadeDistance),
@@ -391,7 +393,9 @@ void RenderableSphere::render(const RenderData& data, RendererTasks&) {
const float startLogFadeDistance = glm::log(_size * _fadeOutThreshold);
const float stopLogFadeDistance = startLogFadeDistance + 1.f;
if (logDistCamera > startLogFadeDistance && logDistCamera < stopLogFadeDistance) {
if (logDistCamera > startLogFadeDistance && logDistCamera <
stopLogFadeDistance)
{
const float fadeFactor = glm::clamp(
(logDistCamera - startLogFadeDistance) /
(stopLogFadeDistance - startLogFadeDistance),

View File

@@ -71,11 +71,17 @@ namespace {
};
// Fragile! Keep in sync with documentation
const std::map<std::string, openspace::Renderable::RenderBin> RenderBinModeConversion = {
const std::map<std::string, openspace::Renderable::RenderBin> RenderBinConversion = {
{ "Background", openspace::Renderable::RenderBin::Background },
{ "Opaque", openspace::Renderable::RenderBin::Opaque },
{ "PreDeferredTransparent", openspace::Renderable::RenderBin::PreDeferredTransparent},
{ "PostDeferredTransparent", openspace::Renderable::RenderBin::PostDeferredTransparent}
{
"PreDeferredTransparent",
openspace::Renderable::RenderBin::PreDeferredTransparent
},
{
"PostDeferredTransparent",
openspace::Renderable::RenderBin::PostDeferredTransparent
}
};
static const openspace::properties::PropertyOwner::PropertyOwnerInfo
@@ -274,7 +280,7 @@ RenderableTrail::RenderableTrail(const ghoul::Dictionary& dictionary)
addPropertySubOwner(_appearance);
if (dictionary.hasKeyAndValue<std::string>(RenderBinModeInfo.identifier)) {
openspace::Renderable::RenderBin cfgRenderBin = RenderBinModeConversion.at(
openspace::Renderable::RenderBin cfgRenderBin = RenderBinConversion.at(
dictionary.value<std::string>(RenderBinModeInfo.identifier)
);
setRenderBin(cfgRenderBin);
@@ -327,7 +333,7 @@ bool RenderableTrail::isReady() const {
void RenderableTrail::internalRender(bool renderLines, bool renderPoints,
const RenderData& data,
const glm::dmat4& modelTransform,
const glm::dmat4& modelTransform,
RenderInformation& info, int nVertices, int offset)
{
ZoneScoped

View File

@@ -94,9 +94,9 @@ StaticRotation::StaticRotation()
)
{
addProperty(_eulerRotation);
_eulerRotation.onChange([this]() {
_eulerRotation.onChange([this]() {
_matrixIsDirty = true;
requireUpdate();
requireUpdate();
});
}

View File

@@ -485,7 +485,7 @@ void RenderableDUMeshes::renderLabels(const RenderData& data,
labelInfo.scale = pow(10.f, _textSize);
labelInfo.enableDepth = true;
labelInfo.enableFalseDepth = false;
glm::vec4 textColor = glm::vec4(glm::vec3(_textColor), _textOpacity);
for (const std::pair<glm::vec3, std::string>& pair : _labelData) {

View File

@@ -628,7 +628,7 @@ void RenderablePlanesCloud::renderLabels(const RenderData& data,
}
glm::vec4 textColor = glm::vec4(
glm::vec3(_textColor),
glm::vec3(_textColor),
_textOpacity * fadeInVariable
);

View File

@@ -22,8 +22,8 @@
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#ifndef __OPENSPACE_MODULE_EXOPLANETS___EXOPLANET_HELPER___H__
#define __OPENSPACE_MODULE_EXOPLANETS___EXOPLANET_HELPER___H__
#ifndef __OPENSPACE_MODULE_EXOPLANETS___EXOPLANETSHELPER___H__
#define __OPENSPACE_MODULE_EXOPLANETS___EXOPLANETSHELPER___H__
#include <ghoul/glm.h>
#include <string>
@@ -91,4 +91,4 @@ void sanitizeNameString(std::string& s);
} // namespace openspace::exoplanets
#endif // __OPENSPACE_MODULE_EXOPLANETS___EXOPLANETSMODULE___H__
#endif // __OPENSPACE_MODULE_EXOPLANETS___EXOPLANETSHELPER___H__

View File

@@ -54,14 +54,14 @@ scripting::LuaLibrary ExoplanetsModule::luaLibrary() const {
{},
"string or list of strings",
"Add one or multiple exoplanet systems to the scene, as specified by the "
"input. An input string should be the name of the system host star."
"input. An input string should be the name of the system host star"
},
{
"removeExoplanetSystem",
&exoplanets::luascriptfunctions::removeExoplanetSystem,
{},
"string",
"Removes the nodes of the specified exoplanet system from the scene graph."
"Removes the nodes of the specified exoplanet system from the scene graph"
},
{
"listAvailableExoplanetSystems",
@@ -69,14 +69,14 @@ scripting::LuaLibrary ExoplanetsModule::luaLibrary() const {
{},
"",
"Prints a list with the names of all exoplanet systems that can be added to "
"the scene graph to the OpenSpace Log. "
"the scene graph to the OpenSpace Log"
},
{
"getListOfExoplanets",
&exoplanets::luascriptfunctions::getListOfExoplanets,
{},
"",
"Gets a list with the names of all exoplanet systems, that can be used by a GUI."
"Gets a list with the names of all exoplanet systems"
}
};

View File

@@ -1,26 +1,26 @@
/*****************************************************************************************
* *
* OpenSpace *
* *
* Copyright (c) 2014-2020 *
* *
* 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-2020 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
* without restriction, including without limitation the rights to use, copy, modify, *
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *
* permit persons to whom the Software is furnished to do so, subject to the following *
* conditions: *
* *
* The above copyright notice and this permission notice shall be included in all copies *
* or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#include <modules/exoplanets/exoplanetshelper.h>
#include <openspace/engine/globals.h>
@@ -51,7 +51,8 @@ constexpr const char* ExoplanetsDataPath =
"${SYNC}/http/exoplanets_data/1/exoplanets_data.bin";
constexpr const char* StarTextureFile = "${SYNC}/http/exoplanets_textures/1/sun.jpg";
constexpr const char* NoDataTextureFile = "${SYNC}/http/exoplanets_textures/1/grid-32.png";
constexpr const char* NoDataTextureFile =
"${SYNC}/http/exoplanets_textures/1/grid-32.png";
constexpr const char* DiscTextureFile =
"${SYNC}/http/exoplanets_textures/1/disc_texture.png";
@@ -122,7 +123,7 @@ void createExoplanetSystem(std::string_view starName) {
if (!hasSufficientData(p)) {
LERROR(fmt::format(
"Insufficient data available for visualizion of exoplanet system: '{}'",
"Insufficient data available for exoplanet system: '{}'",
starName
));
return;
@@ -174,16 +175,18 @@ void createExoplanetSystem(std::string_view starName) {
"},"
"{"
"Identifier = 'StarTexture',"
"FilePath = " + fmt::format("openspace.absPath('{}')", StarTextureFile) + ","
"FilePath = " +
fmt::format("openspace.absPath('{}')", StarTextureFile) + ","
"BlendMode = 'Color',"
"Enabled = true"
"}";
}
else {
colorLayers =
colorLayers =
"{"
"Identifier = 'NoDataStarTexture',"
"FilePath = " + fmt::format("openspace.absPath('{}')", NoDataTextureFile) + ","
"FilePath = " +
fmt::format("openspace.absPath('{}')", NoDataTextureFile) + ","
"BlendMode = 'Color',"
"Enabled = true"
"}";
@@ -194,7 +197,7 @@ void createExoplanetSystem(std::string_view starName) {
"Radii = " + std::to_string(radiusInMeter) + ","
"SegmentsPerPatch = 64,"
"PerformShading = false,"
"Layers = {"
"Layers = {"
"ColorLayers = { " + colorLayers + "}"
"}"
"},";
@@ -259,7 +262,8 @@ void createExoplanetSystem(std::string_view starName) {
float planetRadius;
std::string enabled;
const float astronomicalUnit = static_cast<float>(distanceconstants::AstronomicalUnit);
const float astronomicalUnit =
static_cast<float>(distanceconstants::AstronomicalUnit);
const float solarRadius = static_cast<float>(distanceconstants::SolarRadius);
const float jupiterRadius = static_cast<float>(distanceconstants::JupiterRadius);
@@ -285,7 +289,7 @@ void createExoplanetSystem(std::string_view starName) {
const std::string planetKeplerTranslation = "{"
"Type = 'KeplerTranslation',"
"Eccentricity = " + std::to_string(planet.ecc) + ","
"Eccentricity = " + std::to_string(planet.ecc) + ","
"SemiMajorAxis = " + std::to_string(semiMajorAxisInKm) + ","
"Inclination = " + std::to_string(planet.i) + ","
"AscendingNode = " + std::to_string(planet.bigOmega) + ","

View File

@@ -48,7 +48,9 @@ namespace {
namespace openspace::exoplanets {
ExoplanetsDataPreparationTask::ExoplanetsDataPreparationTask(const ghoul::Dictionary& dictionary) {
ExoplanetsDataPreparationTask::ExoplanetsDataPreparationTask(
const ghoul::Dictionary& dictionary)
{
openspace::documentation::testSpecificationAndThrow(
documentation(),
dictionary,
@@ -71,7 +73,9 @@ std::string ExoplanetsDataPreparationTask::description() {
);
}
void ExoplanetsDataPreparationTask::perform(const Task::ProgressCallback& progressCallback) {
void ExoplanetsDataPreparationTask::perform(
const Task::ProgressCallback& progressCallback)
{
std::ifstream inputDataFile(_inputDataPath);
if (!inputDataFile.good()) {
LERROR(fmt::format("Failed to open input file '{}'", _inputDataPath));

View File

@@ -692,7 +692,7 @@ void GlobeLabelsComponent::renderLabels(const RenderData& data,
float fadeInVariable
) {
glm::vec4 textColor = glm::vec4(
glm::vec3(_labelsColor),
glm::vec3(_labelsColor),
_labelsOpacity * fadeInVariable
);

View File

@@ -140,7 +140,8 @@ constexpr openspace::globebrowsing::layergroupid::GroupID from_string(
std::string_view string)
{
for (int i = 0; i < openspace::globebrowsing::layergroupid::NUM_LAYER_GROUPS; ++i) {
if (string == openspace::globebrowsing::layergroupid::LAYER_GROUP_IDENTIFIERS[i]) {
if (string == openspace::globebrowsing::layergroupid::LAYER_GROUP_IDENTIFIERS[i])
{
return static_cast<openspace::globebrowsing::layergroupid::GroupID>(i);
}
}
@@ -151,9 +152,11 @@ template <>
constexpr openspace::globebrowsing::layergroupid::AdjustmentTypeID from_string(
std::string_view string)
{
for (int i = 0; i < openspace::globebrowsing::layergroupid::NUM_ADJUSTMENT_TYPES; ++i) {
for (int i = 0; i < openspace::globebrowsing::layergroupid::NUM_ADJUSTMENT_TYPES; ++i)
{
if (string == openspace::globebrowsing::layergroupid::ADJUSTMENT_TYPE_NAMES[i]) {
return static_cast<openspace::globebrowsing::layergroupid::AdjustmentTypeID>(i);
return
static_cast<openspace::globebrowsing::layergroupid::AdjustmentTypeID>(i);
}
}
return openspace::globebrowsing::layergroupid::AdjustmentTypeID::None;

View File

@@ -273,7 +273,8 @@ const Chunk& findChunkNode(const Chunk& node, const Geodetic2& location) {
#if defined(__APPLE__) || (defined(__linux__) && defined(__clang__))
using ChunkTileVector = std::vector<std::pair<ChunkTile, const LayerRenderSettings*>>;
#else
using ChunkTileVector = std::pmr::vector<std::pair<ChunkTile, const LayerRenderSettings*>>;
using ChunkTileVector =
std::pmr::vector<std::pair<ChunkTile, const LayerRenderSettings*>>;
#endif
ChunkTileVector tilesAndSettingsUnsorted(const LayerGroup& layerGroup,

View File

@@ -222,7 +222,8 @@ private:
void debugRenderChunk(const Chunk& chunk, const glm::dmat4& mvp,
bool renderBounds, bool renderAABB) const;
bool isCullableByFrustum(const Chunk& chunk, const RenderData& renderData, const glm::dmat4& mvp) const;
bool isCullableByFrustum(const Chunk& chunk, const RenderData& renderData,
const glm::dmat4& mvp) const;
bool isCullableByHorizon(const Chunk& chunk, const RenderData& renderData,
const BoundingHeights& heights) const;

View File

@@ -170,7 +170,7 @@ void TimeTopic::sendDeltaTimeSteps() {
const std::vector<double>& steps = global::timeManager->deltaTimeSteps();
json deltaTimeStepsJson = {
{ "deltaTimeSteps", steps }
{ "deltaTimeSteps", steps }
};
const json nextPrevJson = getNextPrevDeltaTimeStepJson();

View File

@@ -51,11 +51,17 @@ namespace {
constexpr const char* KeyLineNum = "LineNumber";
// Fragile! Keep in sync with documentation
const std::map<std::string, openspace::Renderable::RenderBin> RenderBinModeConversion = {
const std::map<std::string, openspace::Renderable::RenderBin> RenderBinConversion = {
{ "Background", openspace::Renderable::RenderBin::Background },
{ "Opaque", openspace::Renderable::RenderBin::Opaque },
{ "PreDeferredTransparent", openspace::Renderable::RenderBin::PreDeferredTransparent},
{ "PostDeferredTransparent", openspace::Renderable::RenderBin::PostDeferredTransparent}
{
"PreDeferredTransparent",
openspace::Renderable::RenderBin::PreDeferredTransparent
},
{
"PostDeferredTransparent",
openspace::Renderable::RenderBin::PostDeferredTransparent
}
};
constexpr const std::array<int, 36> LeapYears = {
@@ -416,7 +422,7 @@ RenderableOrbitalKepler::RenderableOrbitalKepler(const ghoul::Dictionary& dict)
_sizeRenderCallbackHandle = _sizeRender.onChange(_updateRenderSizeSelect);
if (dict.hasKeyAndValue<std::string>(RenderBinModeInfo.identifier)) {
openspace::Renderable::RenderBin cfgRenderBin = RenderBinModeConversion.at(
openspace::Renderable::RenderBin cfgRenderBin = RenderBinConversion.at(
dict.value<std::string>(RenderBinModeInfo.identifier)
);
setRenderBin(cfgRenderBin);

View File

@@ -39,8 +39,8 @@
namespace {
constexpr const std::array<const char*, 6> UniformNames = {
"modelViewProjectionTransform", "textureOffset", "colorFilterValue", "_nightFactor",
"sunPosition", "texture1"
"modelViewProjectionTransform", "textureOffset", "colorFilterValue",
"_nightFactor", "sunPosition", "texture1"
};
constexpr openspace::properties::Property::PropertyInfo TextureInfo = {

View File

@@ -483,7 +483,9 @@ float getMaxApogee(std::vector<KeplerParameters> inData){
return static_cast<float>(maxApogee*1000); // * 1000 for meters
}
int getIndexFromPosition(glm::dvec3 position, glm::uvec3 dim, float maxApogee, std::string gridType){
int getIndexFromPosition(glm::dvec3 position, glm::uvec3 dim, float maxApogee,
std::string gridType)
{
// epsilon is to make sure that for example if newPosition.x/maxApogee = 1,
// then the index for that dimension will not exceed the range of the grid.
float epsilon = static_cast<float>(0.000000001);
@@ -492,12 +494,15 @@ int getIndexFromPosition(glm::dvec3 position, glm::uvec3 dim, float maxApogee, s
,position.y + maxApogee
,position.z + maxApogee);
glm::uvec3 coordinateIndex = glm::uvec3(static_cast<int>(newPosition.x * dim.x / (2 * (maxApogee + epsilon)))
,static_cast<int>(newPosition.y * dim.y / (2 * (maxApogee + epsilon)))
,static_cast<int>(newPosition.z * dim.z / (2 * (maxApogee + epsilon))));
glm::uvec3 coordinateIndex = glm::uvec3(
static_cast<int>(newPosition.x * dim.x / (2 * (maxApogee + epsilon))),
static_cast<int>(newPosition.y * dim.y / (2 * (maxApogee + epsilon))),
static_cast<int>(newPosition.z * dim.z / (2 * (maxApogee + epsilon)))
);
return coordinateIndex.z * (dim.x * dim.y) + coordinateIndex.y * dim.x + coordinateIndex.x;
return coordinateIndex.z * (dim.x * dim.y) +
coordinateIndex.y * dim.x + coordinateIndex.x;
}
else if(gridType == "Spherical"){
@@ -508,16 +513,13 @@ int getIndexFromPosition(glm::dvec3 position, glm::uvec3 dim, float maxApogee, s
position.z = 0;
}
glm::uvec3 coordinateIndex = glm::uvec3(static_cast<int>(position.x * dim.x / (maxApogee))
,static_cast<int>(position.y * dim.y / (3.14159265358979323846264338327950288))
,static_cast<int>(position.z * dim.z / (2*3.14159265358979323846264338327950288)));
glm::uvec3 coordinateIndex = glm::uvec3(
static_cast<int>(position.x * dim.x / (maxApogee)),
static_cast<int>(position.y * dim.y / glm::pi<double>()),
static_cast<int>(position.z * dim.z / glm::two_pi<double>()));
// LINFO(fmt::format("index coords: {} ", coordinateIndex));
// LINFO(fmt::format("index dim: {} ", dim));
// LINFO(fmt::format("index va: {} ", coordinateIndex.y * (dim.x * dim.y) + coordinateIndex.z * dim.x + coordinateIndex.x));
return coordinateIndex.z * (dim.x * dim.y) + coordinateIndex.y * dim.x + coordinateIndex.x;
return coordinateIndex.z * (dim.x * dim.y) +
coordinateIndex.y * dim.x + coordinateIndex.x;
}
return -1;
@@ -541,9 +543,12 @@ double getVoxelVolume(int index, RawVolume<float>& raw, glm::uvec3 dim, float ma
}
double* mapDensityToVoxels(double* densityArray, std::vector<glm::dvec3> positions, glm::uvec3 dim, float maxApogee, std::string gridType, RawVolume<float>& raw) {
double* mapDensityToVoxels(double* densityArray, std::vector<glm::dvec3> positions,
glm::uvec3 dim, float maxApogee, std::string gridType,
RawVolume<float>& raw)
{
for(const glm::dvec3& position : positions) {
for (const glm::dvec3& position : positions) {
//LINFO(fmt::format("pos: {} ", position));
int index = getIndexFromPosition(position, dim, maxApogee, gridType);
//LINFO(fmt::format("index: {} ", index));
@@ -551,7 +556,8 @@ double* mapDensityToVoxels(double* densityArray, std::vector<glm::dvec3> positio
++densityArray[index];
}
else if(gridType == "Spherical"){
double voxelVolume = getVoxelVolume(index, raw, dim, maxApogee); //something like this
// something like this
double voxelVolume = getVoxelVolume(index, raw, dim, maxApogee);
densityArray[index] += 1/voxelVolume;
}
}
@@ -569,9 +575,11 @@ GenerateDebrisVolumeTask::GenerateDebrisVolumeTask(const ghoul::Dictionary& dict
_rawVolumeOutputPath = absPath(dictionary.value<std::string>(KeyRawVolumeOutput));
_dictionaryOutputPath = absPath(dictionary.value<std::string>(KeyDictionaryOutput));
_dimensions = dictionary.value<glm::vec3>(KeyDimensions); // must not be <glm::uvec3> for some reason.
// must not be <glm::uvec3> for some reason.
_dimensions = dictionary.value<glm::vec3>(KeyDimensions);
_startTime = dictionary.value<std::string>(KeyStartTime);
_timeStep = dictionary.value<std::string>(KeyTimeStep); // Todo: send KeyTimeStep in as a int or float correctly.
// Todo: send KeyTimeStep in as a int or float correctly.
_timeStep = dictionary.value<std::string>(KeyTimeStep);
_endTime = dictionary.value<std::string>(KeyEndTime);
// since _inputPath is past from task,
// there will have to be either one task per dataset,
@@ -605,12 +613,35 @@ void GenerateDebrisVolumeTask::perform(const Task::ProgressCallback& progressCal
// std::vector<KeplerParameters>TLEDataVector3 = readTLEFile(_inputPath3);
// std::vector<KeplerParameters>TLEDataVector4 = readTLEFile(_inputPath4);
// _TLEDataVector.reserve( TLEDataVector.size() + TLEDataVector1.size() + TLEDataVector2.size() + TLEDataVector3.size() + TLEDataVector4.size());
// _TLEDataVector.insert(_TLEDataVector.end(), TLEDataVector.begin(), TLEDataVector.end());
// _TLEDataVector.insert(_TLEDataVector.end(), TLEDataVector1.begin(), TLEDataVector1.end());
// _TLEDataVector.insert(_TLEDataVector.end(), TLEDataVector2.begin(), TLEDataVector2.end());
// _TLEDataVector.insert(_TLEDataVector.end(), TLEDataVector3.begin(), TLEDataVector3.end());
// _TLEDataVector.insert(_TLEDataVector.end(), TLEDataVector4.begin(), TLEDataVector4.end());
// _TLEDataVector.reserve(
// TLEDataVector.size() + TLEDataVector1.size() + TLEDataVector2.size() +
// TLEDataVector3.size() + TLEDataVector4.size()
// );
// _TLEDataVector.insert(
// _TLEDataVector.end(),
// TLEDataVector.begin(),
// TLEDataVector.end()
// );
//_TLEDataVector.insert(
// _TLEDataVector.end(),
// TLEDataVector1.begin(),
// TLEDataVector1.end()
//);
//_TLEDataVector.insert(
// _TLEDataVector.end(),
// TLEDataVector2.begin(),
// TLEDataVector2.end()
//);
//_TLEDataVector.insert(
// _TLEDataVector.end(),
// TLEDataVector3.begin(),
// TLEDataVector3.end()
//);
//_TLEDataVector.insert(
// _TLEDataVector.end(),
// TLEDataVector4.begin(),
// TLEDataVector4.end()
//);
// ----- or ----- if only one
// _TLEDataVector = readTLEFile(_inputPath);
@@ -651,16 +682,31 @@ void GenerateDebrisVolumeTask::perform(const Task::ProgressCallback& progressCal
float minVal = std::numeric_limits<float>::max();
float maxVal = std::numeric_limits<float>::min();
// 2.
for(int i=0 ; i<=numberOfIterations ; ++i) {
std::vector<glm::dvec3> startPositionBuffer = getPositionBuffer(_TLEDataVector, startTimeInSeconds+(i*timeStep), _gridType); //+(i*timeStep)
for (int i=0 ; i<=numberOfIterations ; ++i) {
std::vector<glm::dvec3> startPositionBuffer = getPositionBuffer(
_TLEDataVector,
startTimeInSeconds + (i * timeStep),
_gridType
); //+(i*timeStep)
//LINFO(fmt::format("pos: {} ", startPositionBuffer[4]));
double *densityArrayp = new double[size]();
//densityArrayp = mapDensityToVoxels(densityArrayp, generatedPositions, _dimensions, maxApogee);
//densityArrayp = mapDensityToVoxels(
// densityArrayp,
// generatedPositions,
// _dimensions,
// maxApogee
//);
volume::RawVolume<float> rawVolume(_dimensions);
densityArrayp = mapDensityToVoxels(densityArrayp, startPositionBuffer, _dimensions, _maxApogee, _gridType, rawVolume);
densityArrayp = mapDensityToVoxels(
densityArrayp,
startPositionBuffer,
_dimensions,
_maxApogee,
_gridType,
rawVolume
);
/*std::vector<glm::dvec3> testBuffer;
testBuffer.push_back(glm::dvec3(0,0,0));
testBuffer.push_back(glm::dvec3(1,1.5,1.5));
@@ -669,14 +715,20 @@ void GenerateDebrisVolumeTask::perform(const Task::ProgressCallback& progressCal
//testBuffer.push_back(glm::dvec3(10000,1000000000,1000000000));
densityArrayp = mapDensityToVoxels(densityArrayp, testBuffer, _dimensions, _maxApogee, _gridType);
densityArrayp = mapDensityToVoxels(
densityArrayp,
testBuffer,
_dimensions,
_maxApogee,
_gridType
);
*/
// create object rawVolume
//glm::vec3 domainSize = _upperDomainBound - _lowerDomainBound;
// TODO: Create a forEachSatallite and set(cell, value) to combine mapDensityToVoxel
// and forEachVoxel for less time complexity.
// TODO: Create a forEachSatallite and set(cell, value) to combine
// mapDensityToVoxel and forEachVoxel for less time complexity.
rawVolume.forEachVoxel([&](glm::uvec3 cell, float) {
// glm::vec3 coord = _lowerDomainBound +
// glm::vec3(cell) / glm::vec3(_dimensions) * domainSize;
@@ -708,7 +760,10 @@ void GenerateDebrisVolumeTask::perform(const Task::ProgressCallback& progressCal
ghoul::filesystem::File file(rawOutputName);
const std::string directory = file.directoryName();
if (!FileSys.directoryExists(directory)) {
FileSys.createDirectory(directory, ghoul::filesystem::FileSystem::Recursive::Yes);
FileSys.createDirectory(
directory,
ghoul::filesystem::FileSystem::Recursive::Yes
);
}
volume::RawVolumeWriter<float> writer(rawOutputName);

View File

@@ -141,7 +141,9 @@ void HorizonsTranslation::loadData() {
bool hasCachedFile = FileSys.fileExists(cachedFile);
if (hasCachedFile) {
LINFO(fmt::format("Cached file '{}' used for Horizon file '{}'", cachedFile, file));
LINFO(fmt::format(
"Cached file '{}' used for Horizon file '{}'", cachedFile, file
));
bool success = loadCachedFile(cachedFile);
if (success) {

View File

@@ -256,46 +256,46 @@ RenderableFov::RenderableFov(const ghoul::Dictionary& dictionary)
, _drawSolid(DrawSolidInfo, false)
, _standOffDistance(StandoffDistanceInfo, 0.9999, 0.99, 1.0, 0.000001)
, _colors({
{
DefaultStartColorInfo,
glm::vec3(0.4f),
glm::vec3(0.f),
glm::vec3(1.f)
},
{
DefaultEndColorInfo,
glm::vec3(0.85f),
glm::vec3(0.f),
glm::vec3(1.f)
},
{
ActiveColorInfo,
glm::vec3(0.f, 1.f, 0.f),
glm::vec3(0.f),
glm::vec3(1.f)
},
{
TargetInFovInfo,
glm::vec3(0.f, 0.5f, 0.7f),
glm::vec3(0.f),
glm::vec3(1.f)
},
{
IntersectionStartInfo,
glm::vec3(1.f, 0.89f, 0.f),
{
DefaultStartColorInfo,
glm::vec3(0.4f),
glm::vec3(0.f),
glm::vec3(1.f)
},
{
IntersectionEndInfo,
glm::vec3(1.f, 0.29f, 0.f),
glm::vec3(0.f),
glm::vec3(1.f)
},
{
SquareColorInfo,
glm::vec3(0.85f),
glm::vec3(0.f),
{
DefaultEndColorInfo,
glm::vec3(0.85f),
glm::vec3(0.f),
glm::vec3(1.f)
},
{
ActiveColorInfo,
glm::vec3(0.f, 1.f, 0.f),
glm::vec3(0.f),
glm::vec3(1.f)
},
{
TargetInFovInfo,
glm::vec3(0.f, 0.5f, 0.7f),
glm::vec3(0.f),
glm::vec3(1.f)
},
{
IntersectionStartInfo,
glm::vec3(1.f, 0.89f, 0.f),
glm::vec3(0.f),
glm::vec3(1.f)
},
{
IntersectionEndInfo,
glm::vec3(1.f, 0.29f, 0.f),
glm::vec3(0.f),
glm::vec3(1.f)
},
{
SquareColorInfo,
glm::vec3(0.85f),
glm::vec3(0.f),
glm::vec3(1.f)
}
})

View File

@@ -235,9 +235,9 @@ Win32TouchHook::Win32TouchHook(void* nativeWindow) {
// This mouse hook prevents injected mouse events (touch-to-mouse),
// since we cannot catch it in our messageloop.
// Since this is attached to windows global thread, this will block lowlevel mouse
// access to all running applications if we stall in this thread.
// Debug breakpoints typically freeze our application, in which case we simply don't
// create this if a debugger is attached.
// access to all running applications if we stall in this thread.
// Debug breakpoints typically freeze our application, in which case we simply
// don't create this if a debugger is attached.
if (!IsDebuggerPresent()) {
gMouseHookThread = new std::thread([](){
gMouseHook = SetWindowsHookExW(
@@ -246,7 +246,7 @@ Win32TouchHook::Win32TouchHook(void* nativeWindow) {
GetModuleHandleW(NULL),
0 //<- Global thread id (low-level mouse is global only)
);
if (!gMouseHook) {
if (!gMouseHook) {
LINFO("Could not setup mousehook!");
}
@@ -278,12 +278,12 @@ Win32TouchHook::~Win32TouchHook() {
}
}
// Low-level mouse hook is "needed" if we want to stop mousecursor from moving
// when we get a touch-input on our window.
// A negative effect is that this function is for global threads, meaning our
// application will cause Windows to stall the mouse cursor when this
// function can't be scheduled (i.e. when debugger hits a breakpoint).
// This is not yet fail-proof...might be a race-condition on message pumping?
// Low-level mouse hook is "needed" if we want to stop mousecursor from moving when we get
// a touch-input on our window.
// A negative effect is that this function is for global threads, meaning our application
// will cause Windows to stall the mouse cursor when this function can't be scheduled
// (i.e. when debugger hits a breakpoint). This is not yet fail-proof...might be a
// race-condition on message pumping?
// - Seems to move the cursor when we get two fingers as input..
// - If we ourselves would pump windows for events, we can handle this.
LRESULT CALLBACK LowLevelMouseProc(int nCode, WPARAM wParam, LPARAM lParam) {

View File

@@ -123,7 +123,8 @@ glm::vec4 Envelope::valueAtPosition(float pos) const {
beforeIter->color * (std::fabs(pos - afterIter->position.first) / dist) +
afterIter->color * (std::fabs(pos - beforeIter->position.first) / dist)
),
beforeIter->position.second * (std::fabs(pos - afterIter->position.first) / dist) +
beforeIter->position.second *
(std::fabs(pos - afterIter->position.first) / dist) +
afterIter->position.second *
(std::fabs(pos - beforeIter->position.first) / dist)
};

View File

@@ -41,7 +41,7 @@ documentation::Documentation Configuration::Documentation = {
},
{
KeySgctConfigNameInitialized,
new StringAnnotationVerifier("The type of SGCT auto-gen function (if called)"),
new StringAnnotationVerifier("The type of SGCT autogen function (if called)"),
Optional::Yes,
"The SGCT configuration can be defined from an .xml file, or auto-generated "
"by an sgct.config.* lua function. If a lua function is used to generate the "

View File

@@ -53,6 +53,7 @@
#include <openspace/util/memorymanager.h>
#include <openspace/util/timemanager.h>
#include <openspace/util/versionchecker.h>
#include <ghoul/misc/assert.h>
#include <ghoul/glm.h>
#include <ghoul/font/fontmanager.h>
#include <ghoul/misc/profiling.h>
@@ -106,127 +107,129 @@ void create() {
std::byte* currentPos = DataStorage.data();
fontManager = new (currentPos) ghoul::fontrendering::FontManager({ 1536, 1536, 1 });
assert(fontManager);
ghoul_assert(fontManager, "No fontManager");
currentPos += sizeof(ghoul::fontrendering::FontManager);
dashboard = new (currentPos) Dashboard;
assert(dashboard);
ghoul_assert(dashboard, "No dashboard");
currentPos += sizeof(Dashboard);
deferredcasterManager = new (currentPos) DeferredcasterManager;
assert(deferredcasterManager);
ghoul_assert(deferredcasterManager, "No deferredcasterManager");
currentPos += sizeof(DeferredcasterManager);
downloadManager = new (currentPos) DownloadManager;
assert(downloadManager);
ghoul_assert(downloadManager, "No downloadManager");
currentPos += sizeof(DownloadManager);
luaConsole = new (currentPos) LuaConsole;
assert(luaConsole);
ghoul_assert(luaConsole, "No luaConsole");
currentPos += sizeof(LuaConsole);
memoryManager = new (currentPos) MemoryManager;
assert(memoryManager);
ghoul_assert(memoryManager, "No memoryManager");
currentPos += sizeof(MemoryManager);
missionManager = new (currentPos) MissionManager;
assert(missionManager);
ghoul_assert(missionManager, "No missionManager");
currentPos += sizeof(MissionManager);
moduleEngine = new (currentPos) ModuleEngine;
assert(moduleEngine);
ghoul_assert(moduleEngine, "No moduleEngine");
currentPos += sizeof(ModuleEngine);
openSpaceEngine = new (currentPos) OpenSpaceEngine;
assert(openSpaceEngine);
ghoul_assert(openSpaceEngine, "No openSpaceEngine");
currentPos += sizeof(OpenSpaceEngine);
parallelPeer = new (currentPos) ParallelPeer;
assert(parallelPeer);
ghoul_assert(parallelPeer, "No parallelPeer");
currentPos += sizeof(ParallelPeer);
raycasterManager = new (currentPos) RaycasterManager;
assert(raycasterManager);
ghoul_assert(raycasterManager, "No raycasterManager");
currentPos += sizeof(RaycasterManager);
renderEngine = new (currentPos) RenderEngine;
assert(renderEngine);
ghoul_assert(renderEngine, "No renderEngine");
currentPos += sizeof(RenderEngine);
screenSpaceRenderables = new (currentPos) std::vector<std::unique_ptr<ScreenSpaceRenderable>>;
assert(screenSpaceRenderables);
screenSpaceRenderables =
new (currentPos) std::vector<std::unique_ptr<ScreenSpaceRenderable>>;
ghoul_assert(screenSpaceRenderables, "No screenSpaceRenderables");
currentPos += sizeof(std::vector<std::unique_ptr<ScreenSpaceRenderable>>);
syncEngine = new (currentPos) SyncEngine(4096);
assert(syncEngine);
ghoul_assert(syncEngine, "No syncEngine");
currentPos += sizeof(SyncEngine);
timeManager = new (currentPos) TimeManager;
assert(timeManager);
ghoul_assert(timeManager, "No timeManager");
currentPos += sizeof(TimeManager);
versionChecker = new (currentPos) VersionChecker;
assert(versionChecker);
ghoul_assert(versionChecker, "No versionChecker");
currentPos += sizeof(VersionChecker);
virtualPropertyManager = new (currentPos) VirtualPropertyManager;
assert(virtualPropertyManager);
ghoul_assert(virtualPropertyManager, "No virtualPropertyManager");
currentPos += sizeof(VirtualPropertyManager);
windowDelegate = new (currentPos) WindowDelegate;
assert(windowDelegate);
ghoul_assert(windowDelegate, "No windowDelegate");
currentPos += sizeof(WindowDelegate);
configuration = new (currentPos) configuration::Configuration;
assert(configuration);
ghoul_assert(configuration, "No configuration");
currentPos += sizeof(configuration::Configuration);
interactionMonitor = new (currentPos) interaction::InteractionMonitor;
assert(interactionMonitor);
ghoul_assert(interactionMonitor, "No interactionMonitor");
currentPos += sizeof(interaction::InteractionMonitor);
joystickInputStates = new (currentPos) interaction::JoystickInputStates;
assert(joystickInputStates);
ghoul_assert(joystickInputStates, "No joystickInputStates");
currentPos += sizeof(interaction::JoystickInputStates);
websocketInputStates = new (currentPos) interaction::WebsocketInputStates;
assert(websocketInputStates);
ghoul_assert(websocketInputStates, "No websocketInputStates");
currentPos += sizeof(interaction::WebsocketInputStates);
keybindingManager = new (currentPos) interaction::KeybindingManager;
assert(keybindingManager);
ghoul_assert(keybindingManager, "No keybindingManager");
currentPos += sizeof(interaction::KeybindingManager);
navigationHandler = new (currentPos) interaction::NavigationHandler;
assert(navigationHandler);
ghoul_assert(navigationHandler, "No navigationHandler");
currentPos += sizeof(interaction::NavigationHandler);
sessionRecording = new (currentPos) interaction::SessionRecording(true);
assert(sessionRecording);
ghoul_assert(sessionRecording, "No sessionRecording");
currentPos += sizeof(interaction::SessionRecording);
shortcutManager = new (currentPos) interaction::ShortcutManager;
assert(shortcutManager);
ghoul_assert(shortcutManager, "No shortcutManager");
currentPos += sizeof(interaction::ShortcutManager);
rootPropertyOwner = new (currentPos) properties::PropertyOwner({ "" });
assert(rootPropertyOwner);
ghoul_assert(rootPropertyOwner, "No rootPropertyOwner");
currentPos += sizeof(properties::PropertyOwner);
screenSpaceRootPropertyOwner = new (currentPos) properties::PropertyOwner({ "ScreenSpace" });
assert(screenSpaceRootPropertyOwner);
screenSpaceRootPropertyOwner =
new (currentPos) properties::PropertyOwner({ "ScreenSpace" });
ghoul_assert(screenSpaceRootPropertyOwner, "No screenSpaceRootPropertyOwner");
currentPos += sizeof(properties::PropertyOwner);
scriptEngine = new (currentPos) scripting::ScriptEngine;
assert(scriptEngine);
ghoul_assert(scriptEngine, "No scriptEngine");
currentPos += sizeof(scripting::ScriptEngine);
scriptScheduler = new (currentPos) scripting::ScriptScheduler;
assert(scriptScheduler);
ghoul_assert(scriptScheduler, "No scriptScheduler");
currentPos += sizeof(scripting::ScriptScheduler);
profile = new (currentPos) Profile;
assert(profile);
ghoul_assert(profile, "No profile");
currentPos += sizeof(Profile);
}

View File

@@ -1017,7 +1017,7 @@ void OpenSpaceEngine::writeSceneDocumentation() {
&properties::PropertyOwner::generateJson,
global::rootPropertyOwner
);
std::future<std::string> scene = std::async(
&properties::PropertyOwner::generateJson,
_scene.get()

View File

@@ -256,7 +256,7 @@ OrbitalNavigator::OrbitalNavigator()
, _flightDestinationDistance(FlightDestinationDistInfo, 2e8f, 0.0f, 1e10f)
, _flightDestinationFactor(FlightDestinationFactorInfo, 1E-4, 1E-6, 0.5)
, _applyLinearFlight(ApplyLinearFlightInfo, false)
, _velocitySensitivity(VelocityZoomControlInfo, 3.5f, 0.001f, 20.f)
, _velocitySensitivity(VelocityZoomControlInfo, 3.5f, 0.001f, 20.f)
, _mouseSensitivity(MouseSensitivityInfo, 15.f, 1.f, 50.f)
, _joystickSensitivity(JoystickSensitivityInfo, 10.f, 1.0f, 50.f)
, _websocketSensitivity(WebsocketSensitivityInfo, 5.f, 1.0f, 50.f)
@@ -476,7 +476,9 @@ void OrbitalNavigator::updateCameraStateFromStates(double deltaTime) {
// Fly towards the flight destination distance. When getting closer than
// arrivalThreshold terminate the flight
if (std::fabs(distFromCameraToFocus - _flightDestinationDistance) > arrivalThreshold) {
if (std::fabs(distFromCameraToFocus - _flightDestinationDistance) >
arrivalThreshold)
{
pose.position = moveCameraAlongVector(
pose.position,
distFromCameraToFocus,

View File

@@ -976,7 +976,8 @@ bool SessionRecording::readSingleKeyframeCamera(datamessagestructures::CameraKey
void SessionRecording::saveSingleKeyframeCamera(datamessagestructures::CameraKeyframe& kf,
Timestamps& times, DataMode mode,
std::ofstream& file, unsigned char* buffer)
std::ofstream& file,
unsigned char* buffer)
{
if (mode == DataMode::Binary) {
saveCameraKeyframeBinary(times, kf, buffer, file);
@@ -1068,9 +1069,9 @@ bool SessionRecording::playbackTimeChange() {
return success;
}
bool SessionRecording::convertTimeChange(std::stringstream& inStream, DataMode mode, int lineNum,
std::string& inputLine, std::ofstream& outFile,
unsigned char* buffer)
bool SessionRecording::convertTimeChange(std::stringstream& inStream, DataMode mode,
int lineNum, std::string& inputLine,
std::ofstream& outFile, unsigned char* buffer)
{
Timestamps times;
datamessagestructures::TimeKeyframe kf;
@@ -1210,9 +1211,9 @@ bool SessionRecording::playbackScript() {
return success;
}
bool SessionRecording::convertScript(std::stringstream& inStream, DataMode mode, int lineNum,
std::string& inputLine, std::ofstream& outFile,
unsigned char* buffer)
bool SessionRecording::convertScript(std::stringstream& inStream, DataMode mode,
int lineNum, std::string& inputLine,
std::ofstream& outFile, unsigned char* buffer)
{
Timestamps times;
datamessagestructures::ScriptMessage kf;
@@ -1252,7 +1253,8 @@ bool SessionRecording::readSingleKeyframeScript(datamessagestructures::ScriptMes
void SessionRecording::saveSingleKeyframeScript(datamessagestructures::ScriptMessage& kf,
Timestamps& times, DataMode mode,
std::ofstream& file, unsigned char* buffer)
std::ofstream& file,
unsigned char* buffer)
{
if (mode == DataMode::Binary) {
saveScriptKeyframeBinary(times, kf, buffer, file);
@@ -1300,8 +1302,7 @@ bool SessionRecording::readScriptKeyframeBinary(Timestamps& times,
bool SessionRecording::readScriptKeyframeAscii(Timestamps& times,
datamessagestructures::ScriptMessage& kf,
std::string currentParsingLine,
int lineN)
std::string currentParsingLine, int lineN)
{
std::string entryType;
std::istringstream iss(currentParsingLine);
@@ -1366,8 +1367,7 @@ bool SessionRecording::addKeyframe(double timestamp,
bool SessionRecording::addKeyframeToTimeline(RecordedType type,
size_t indexIntoTypeKeyframes,
double timestamp,
int lineNum)
double timestamp, int lineNum)
{
try {
_timeline.push_back({

View File

@@ -117,7 +117,8 @@ void ConvertRecFormatTask::convert() {
);
return;
}
else if (!SessionRecording::hasFileExtension(_outFilePath, expectedFileExtension_out)) {
else if (!SessionRecording::hasFileExtension(_outFilePath, expectedFileExtension_out))
{
_outFilePath += expectedFileExtension_out;
}

View File

@@ -121,9 +121,12 @@ namespace {
buf.push_back(',');
constexpr const char propertyOwnersText[] = "\"propertyOwners\": [";
//constexpr const std::array<char, 20> propertyOwnersText = { "\"propertyOwners\": [" };
//json << "\"propertyOwners\": [";
buf.insert(buf.end(), std::begin(propertyOwnersText), std::end(propertyOwnersText) - 1);
buf.insert(
buf.end(),
std::begin(propertyOwnersText),
std::end(propertyOwnersText) - 1
);
auto propertyOwners = owner->propertySubOwners();
for (properties::PropertyOwner* o : propertyOwners) {
createJson(o, buf);

View File

@@ -176,27 +176,27 @@ void FramebufferRenderer::initialize() {
glGenTextures(1, &_gBuffers.positionTexture);
glGenTextures(1, &_gBuffers.normalTexture);
glGenFramebuffers(1, &_gBuffers.framebuffer);
// PingPong Buffers
// The first pingpong buffer shares the color texture with the renderbuffer:
_pingPongBuffers.colorTexture[0] = _gBuffers.colorTexture;
glGenTextures(1, &_pingPongBuffers.colorTexture[1]);
glGenFramebuffers(1, &_pingPongBuffers.framebuffer);
// Exit framebuffer
glGenTextures(1, &_exitColorTexture);
glGenTextures(1, &_exitDepthTexture);
glGenTextures(1, &_exitDepthTexture);
glGenFramebuffers(1, &_exitFramebuffer);
// HDR / Filtering Buffers
glGenFramebuffers(1, &_hdrBuffers.hdrFilteringFramebuffer);
glGenTextures(1, &_hdrBuffers.hdrFilteringTexture);
// FXAA Buffers
glGenFramebuffers(1, &_fxaaBuffers.fxaaFramebuffer);
glGenTextures(1, &_fxaaBuffers.fxaaTexture);
// DownscaleVolumeRendering
glGenFramebuffers(1, &_downscaleVolumeRendering.framebuffer);
glGenTextures(1, &_downscaleVolumeRendering.colorTexture);
@@ -318,7 +318,12 @@ void FramebufferRenderer::initialize() {
0
);
if (glbinding::Binding::ObjectLabel.isResolved()) {
glObjectLabel(GL_FRAMEBUFFER, _hdrBuffers.hdrFilteringFramebuffer, -1, "HDR filtering");
glObjectLabel(
GL_FRAMEBUFFER,
_hdrBuffers.hdrFilteringFramebuffer,
-1,
"HDR filtering"
);
}
status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
@@ -1134,8 +1139,8 @@ void FramebufferRenderer::updateFXAA() {
void FramebufferRenderer::updateDownscaledVolume() {
ZoneScoped
_downscaledVolumeProgram = ghoul::opengl::ProgramObject::Build(
_downscaledVolumeProgram = ghoul::opengl::ProgramObject::Build(
"Write Downscaled Volume Program",
absPath("${SHADERS}/framebuffer/mergeDownscaledVolume.vert"),
absPath("${SHADERS}/framebuffer/mergeDownscaledVolume.frag")
@@ -1225,7 +1230,7 @@ void FramebufferRenderer::render(Scene* scene, Camera* camera, float blackoutFac
performDeferredTasks(tasks.deferredcasterTasks);
}
glDrawBuffers(1, &ColorAttachmentArray[_pingPongIndex]);
glEnablei(GL_BLEND, 0);
@@ -1283,7 +1288,7 @@ void FramebufferRenderer::performRaycasterTasks(const std::vector<RaycasterTask>
for (const RaycasterTask& raycasterTask : tasks) {
TracyGpuZone("Raycaster")
VolumeRaycaster* raycaster = raycasterTask.raycaster;
glBindFramebuffer(GL_FRAMEBUFFER, _exitFramebuffer);
@@ -1418,7 +1423,7 @@ void FramebufferRenderer::performDeferredTasks(
for (const DeferredcasterTask& deferredcasterTask : tasks) {
TracyGpuZone("Deferredcaster")
Deferredcaster* deferredcaster = deferredcasterTask.deferredcaster;
ghoul::opengl::ProgramObject* deferredcastProgram = nullptr;

View File

@@ -1314,7 +1314,7 @@ void RenderEngine::renderCameraInformation() {
global::navigationHandler->orbitalNavigator();
using FR = ghoul::fontrendering::FontRenderer;
_cameraButtonLocations.rotation = {
fontResolution().x - rotationBox.x - XSeparation,
fontResolution().y - penPosY,

View File

@@ -306,7 +306,8 @@ bool AssetLoader::loadAsset(Asset* asset) {
metaDict.getValue(MetaInformationURL, meta.url);
metaDict.getValue(MetaInformationLicense, meta.license);
if (metaDict.hasKey(MetaInformationIdentifiers)) {
ghoul::Dictionary iddict = metaDict.value<ghoul::Dictionary>(MetaInformationIdentifiers);
ghoul::Dictionary iddict =
metaDict.value<ghoul::Dictionary>(MetaInformationIdentifiers);
for (int i = 1; i <= iddict.size(); ++i) {
std::string key = std::to_string(i);
std::string identifier = iddict.value<std::string>(key);

View File

@@ -92,7 +92,7 @@ std::unique_ptr<LightSource> LightSource::createFromDictionary(
auto factory = FactoryManager::ref().factory<LightSource>();
LightSource* source = factory->create(timeFrameType, dictionary);
const std::string identifier = dictionary.value<std::string>(KeyIdentifier);
source->setIdentifier(identifier);

View File

@@ -792,7 +792,7 @@ std::string Profile::convertToScene() const {
);
if (camera.up.has_value()) {
result += fmt::format(
"Up = {{ {}, {}, {} }}, ",
"Up = {{ {}, {}, {} }}, ",
camera.up->x, camera.up->y, camera.up->z
);
}
@@ -809,7 +809,8 @@ std::string Profile::convertToScene() const {
if (camera.altitude.has_value()) {
return fmt::format(
"openspace.globebrowsing.goToGeo([[{}]], {}, {}, {});\n",
camera.anchor, camera.latitude, camera.longitude, *camera.altitude
camera.anchor,
camera.latitude, camera.longitude, *camera.altitude
);
}
else {

View File

@@ -105,7 +105,7 @@ int saveSettingsToProfile(lua_State* L) {
if (FileSys.fileExists(absFilename) && !overwrite) {
return luaL_error(
L,
L,
fmt::format(
"Unable to save profile '{}'. File of same name already exists",
absFilename

View File

@@ -60,7 +60,9 @@ documentation::Documentation Scale::Documentation() {
};
}
ghoul::mm_unique_ptr<Scale> Scale::createFromDictionary(const ghoul::Dictionary& dictionary) {
ghoul::mm_unique_ptr<Scale> Scale::createFromDictionary(
const ghoul::Dictionary& dictionary)
{
documentation::testSpecificationAndThrow(Documentation(), dictionary, "Scale");
std::string scaleType = dictionary.value<std::string>(KeyType);

View File

@@ -65,7 +65,7 @@ std::string SceneLicenseWriter::generateJson() const {
int metaCount = 0;
for (const Asset* asset : assets) {
std::optional<Asset::MetaInformation> meta = asset->metaInformation();
if (!meta.has_value()) {
continue;
}

View File

@@ -108,7 +108,7 @@ int time_setDeltaTimeSteps(lua_State* L) {
/**
* \ingroup LuaScripts
* setNextDeltaTimeStep():
* Immediately set the simulation speed to the first delta time step in the list that is
* Immediately set the simulation speed to the first delta time step in the list that is
* larger than the current choice of simulation speed, if any.
*/
int time_setNextDeltaTimeStep(lua_State* L) {
@@ -147,12 +147,12 @@ int time_setPreviousDeltaTimeStep(lua_State* L) {
*/
int time_interpolateNextDeltaTimeStep(lua_State* L) {
ghoul::lua::checkArgumentsAndThrow(
L,
{ 0, 1 },
L,
{ 0, 1 },
"lua::time_interpolateNextDeltaTimeStep"
);
double interpolationDuration =
double interpolationDuration =
global::timeManager->defaultDeltaTimeInterpolationDuration();
const int nArguments = lua_gettop(L);
@@ -181,19 +181,19 @@ int time_interpolateNextDeltaTimeStep(lua_State* L) {
/**
* \ingroup LuaScripts
* interpolatePreviousDeltaTimeStep([interpolationDuration]):
* Interpolate the simulation speed to the previous delta time step in the list. If an
* Interpolate the simulation speed to the previous delta time step in the list. If an
* input value is given, the interpolation is done over the specified number of seconds.
* If interpolationDuration is not provided, the interpolation time will be based on the
* `defaultDeltaTimeInterpolationDuration` property of the TimeManager.
*/
int time_interpolatePreviousDeltaTimeStep(lua_State* L) {
ghoul::lua::checkArgumentsAndThrow(
L,
{ 0, 1 },
L,
{ 0, 1 },
"lua::time_interpolatePreviousDeltaTimeStep"
);
double interpolationDuration =
double interpolationDuration =
global::timeManager->defaultDeltaTimeInterpolationDuration();
const int nArguments = lua_gettop(L);