mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-02 08:49:20 -05:00
Merge branch 'master' into feature/jwst
* Resolve conflicts
This commit is contained in:
@@ -72,9 +72,7 @@ namespace {
|
||||
namespace openspace {
|
||||
|
||||
documentation::Documentation RenderableBoxGrid::Documentation() {
|
||||
documentation::Documentation doc = codegen::doc<Parameters>();
|
||||
doc.id = "base_renderable_boxgrid";
|
||||
return doc;
|
||||
return codegen::doc<Parameters>("base_renderable_boxgrid");
|
||||
}
|
||||
|
||||
RenderableBoxGrid::RenderableBoxGrid(const ghoul::Dictionary& dictionary)
|
||||
|
||||
@@ -82,9 +82,7 @@ namespace {
|
||||
namespace openspace {
|
||||
|
||||
documentation::Documentation RenderableGrid::Documentation() {
|
||||
documentation::Documentation doc = codegen::doc<Parameters>();
|
||||
doc.id = "base_renderable_grid";
|
||||
return doc;
|
||||
return codegen::doc<Parameters>("base_renderable_grid");
|
||||
}
|
||||
|
||||
RenderableGrid::RenderableGrid(const ghoul::Dictionary& dictionary)
|
||||
|
||||
@@ -103,9 +103,7 @@ namespace {
|
||||
namespace openspace {
|
||||
|
||||
documentation::Documentation RenderableRadialGrid::Documentation() {
|
||||
documentation::Documentation doc = codegen::doc<Parameters>();
|
||||
doc.id = "base_renderable_radialgrid";
|
||||
return doc;
|
||||
return codegen::doc<Parameters>("base_renderable_radialgrid");
|
||||
}
|
||||
|
||||
RenderableRadialGrid::RenderableRadialGrid(const ghoul::Dictionary& dictionary)
|
||||
|
||||
@@ -73,9 +73,7 @@ namespace {
|
||||
namespace openspace {
|
||||
|
||||
documentation::Documentation RenderableSphericalGrid::Documentation() {
|
||||
documentation::Documentation doc = codegen::doc<Parameters>();
|
||||
doc.id = "base_renderable_sphericalgrid";
|
||||
return doc;
|
||||
return codegen::doc<Parameters>("base_renderable_sphericalgrid");
|
||||
}
|
||||
|
||||
RenderableSphericalGrid::RenderableSphericalGrid(const ghoul::Dictionary& dictionary)
|
||||
|
||||
@@ -75,9 +75,7 @@ namespace {
|
||||
namespace openspace {
|
||||
|
||||
documentation::Documentation RenderableCartesianAxes::Documentation() {
|
||||
documentation::Documentation doc = codegen::doc<Parameters>();
|
||||
doc.id = "base_renderable_cartesianaxes";
|
||||
return doc;
|
||||
return codegen::doc<Parameters>("base_renderable_cartesianaxes");
|
||||
}
|
||||
|
||||
RenderableCartesianAxes::RenderableCartesianAxes(const ghoul::Dictionary& dictionary)
|
||||
|
||||
@@ -82,9 +82,7 @@ namespace {
|
||||
namespace openspace {
|
||||
|
||||
documentation::Documentation RenderableDisc::Documentation() {
|
||||
documentation::Documentation doc = codegen::doc<Parameters>();
|
||||
doc.id = "base_renderable_disc";
|
||||
return doc;
|
||||
return codegen::doc<Parameters>("base_renderable_disc");
|
||||
}
|
||||
|
||||
RenderableDisc::RenderableDisc(const ghoul::Dictionary& dictionary)
|
||||
@@ -96,7 +94,7 @@ RenderableDisc::RenderableDisc(const ghoul::Dictionary& dictionary)
|
||||
const Parameters p = codegen::bake<Parameters>(dictionary);
|
||||
|
||||
_texturePath = p.texture.string();
|
||||
_texturePath.onChange([&]() { _texture->loadFromFile(_texturePath); });
|
||||
_texturePath.onChange([&]() { _texture->loadFromFile(_texturePath.value()); });
|
||||
addProperty(_texturePath);
|
||||
|
||||
_size.setViewOption(properties::Property::ViewOptions::Logarithmic);
|
||||
@@ -129,7 +127,7 @@ void RenderableDisc::initialize() {
|
||||
void RenderableDisc::initializeGL() {
|
||||
initializeShader();
|
||||
|
||||
_texture->loadFromFile(_texturePath);
|
||||
_texture->loadFromFile(_texturePath.value());
|
||||
_texture->uploadToGpu();
|
||||
|
||||
_plane->initialize();
|
||||
|
||||
@@ -259,7 +259,7 @@ namespace {
|
||||
namespace openspace {
|
||||
|
||||
documentation::Documentation RenderableLabels::Documentation() {
|
||||
return codegen::doc<Parameters>();
|
||||
return codegen::doc<Parameters>("base_renderable_labels");
|
||||
}
|
||||
|
||||
RenderableLabels::RenderableLabels(const ghoul::Dictionary& dictionary)
|
||||
|
||||
@@ -123,7 +123,6 @@ private:
|
||||
|
||||
std::shared_ptr<ghoul::fontrendering::Font> _font;
|
||||
|
||||
std::string _speckFile;
|
||||
std::string _colorMapFile;
|
||||
std::string _labelFile;
|
||||
std::string _colorOptionString;
|
||||
|
||||
@@ -217,13 +217,13 @@ namespace {
|
||||
std::optional<AnimationMode> animationMode;
|
||||
|
||||
// [[codegen::verbatim(AmbientIntensityInfo.description)]]
|
||||
std::optional<double> ambientIntensity;
|
||||
std::optional<float> ambientIntensity;
|
||||
|
||||
// [[codegen::verbatim(DiffuseIntensityInfo.description)]]
|
||||
std::optional<double> diffuseIntensity;
|
||||
std::optional<float> diffuseIntensity;
|
||||
|
||||
// [[codegen::verbatim(SpecularIntensityInfo.description)]]
|
||||
std::optional<double> specularIntensity;
|
||||
std::optional<float> specularIntensity;
|
||||
|
||||
// [[codegen::verbatim(ShadingInfo.description)]]
|
||||
std::optional<bool> performShading;
|
||||
@@ -256,9 +256,7 @@ namespace {
|
||||
namespace openspace {
|
||||
|
||||
documentation::Documentation RenderableModel::Documentation() {
|
||||
documentation::Documentation doc = codegen::doc<Parameters>();
|
||||
doc.id = "base_renderable_model";
|
||||
return doc;
|
||||
return codegen::doc<Parameters>("base_renderable_model");
|
||||
}
|
||||
|
||||
RenderableModel::RenderableModel(const ghoul::Dictionary& dictionary)
|
||||
@@ -276,8 +274,8 @@ RenderableModel::RenderableModel(const ghoul::Dictionary& dictionary)
|
||||
glm::dmat3(1.0)
|
||||
)
|
||||
, _rotationVec(RotationVecInfo, glm::dvec3(0.0), glm::dvec3(0.0), glm::dvec3(360.0))
|
||||
, _enableOpacityBlending(EnableOpacityBlendingInfo, false)
|
||||
, _disableDepthTest(DisableDepthTestInfo, false)
|
||||
, _enableOpacityBlending(EnableOpacityBlendingInfo, false)
|
||||
, _blendingFuncOption(
|
||||
BlendingOptionInfo,
|
||||
properties::OptionProperty::DisplayType::Dropdown
|
||||
@@ -299,7 +297,7 @@ RenderableModel::RenderableModel(const ghoul::Dictionary& dictionary)
|
||||
}
|
||||
}
|
||||
|
||||
std::string file = absPath(p.geometryFile.string());
|
||||
std::string file = absPath(p.geometryFile.string()).string();
|
||||
_geometry = ghoul::io::ModelReader::ref().loadModel(
|
||||
file,
|
||||
ghoul::io::ModelReader::ForceRenderInvisible(_forceRenderInvisible),
|
||||
@@ -428,7 +426,9 @@ RenderableModel::RenderableModel(const ghoul::Dictionary& dictionary)
|
||||
throw ghoul::MissingCaseException();
|
||||
}
|
||||
|
||||
_geometry->setTimeScale(convertTime(1.0, timeUnit, TimeUnit::Second));
|
||||
_geometry->setTimeScale(static_cast<float>(
|
||||
convertTime(1.0, timeUnit, TimeUnit::Second))
|
||||
);
|
||||
}
|
||||
else {
|
||||
throw ghoul::MissingCaseException();
|
||||
|
||||
@@ -89,7 +89,6 @@ private:
|
||||
properties::BoolProperty _enableAnimation;
|
||||
|
||||
properties::FloatProperty _ambientIntensity;
|
||||
|
||||
properties::FloatProperty _diffuseIntensity;
|
||||
properties::FloatProperty _specularIntensity;
|
||||
|
||||
|
||||
@@ -104,9 +104,7 @@ namespace {
|
||||
namespace openspace {
|
||||
|
||||
documentation::Documentation RenderableNodeLine::Documentation() {
|
||||
documentation::Documentation doc = codegen::doc<Parameters>();
|
||||
doc.id = "base_renderable_renderablenodeline";
|
||||
return doc;
|
||||
return codegen::doc<Parameters>("base_renderable_renderablenodeline");
|
||||
}
|
||||
|
||||
RenderableNodeLine::RenderableNodeLine(const ghoul::Dictionary& dictionary)
|
||||
|
||||
@@ -45,9 +45,9 @@
|
||||
namespace {
|
||||
constexpr const char* ProgramName = "Plane";
|
||||
|
||||
enum BlendMode {
|
||||
BlendModeNormal = 0,
|
||||
BlendModeAdditive
|
||||
enum class BlendMode {
|
||||
Normal = 0,
|
||||
Additive
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo BillboardInfo = {
|
||||
@@ -100,9 +100,7 @@ namespace {
|
||||
namespace openspace {
|
||||
|
||||
documentation::Documentation RenderablePlane::Documentation() {
|
||||
documentation::Documentation doc = codegen::doc<Parameters>();
|
||||
doc.id = "base_renderable_plane";
|
||||
return doc;
|
||||
return codegen::doc<Parameters>("base_renderable_plane");
|
||||
}
|
||||
|
||||
RenderablePlane::RenderablePlane(const ghoul::Dictionary& dictionary)
|
||||
@@ -121,15 +119,15 @@ RenderablePlane::RenderablePlane(const ghoul::Dictionary& dictionary)
|
||||
_billboard = p.billboard.value_or(_billboard);
|
||||
|
||||
_blendMode.addOptions({
|
||||
{ BlendModeNormal, "Normal" },
|
||||
{ BlendModeAdditive, "Additive"}
|
||||
{ static_cast<int>(BlendMode::Normal), "Normal" },
|
||||
{ static_cast<int>(BlendMode::Additive), "Additive"}
|
||||
});
|
||||
_blendMode.onChange([&]() {
|
||||
switch (_blendMode) {
|
||||
case BlendModeNormal:
|
||||
case static_cast<int>(BlendMode::Normal):
|
||||
setRenderBinFromOpacity();
|
||||
break;
|
||||
case BlendModeAdditive:
|
||||
case static_cast<int>(BlendMode::Additive):
|
||||
setRenderBin(Renderable::RenderBin::PreDeferredTransparent);
|
||||
break;
|
||||
default:
|
||||
@@ -138,17 +136,17 @@ RenderablePlane::RenderablePlane(const ghoul::Dictionary& dictionary)
|
||||
});
|
||||
|
||||
_opacity.onChange([&]() {
|
||||
if (_blendMode == BlendModeNormal) {
|
||||
if (_blendMode == static_cast<int>(BlendMode::Normal)) {
|
||||
setRenderBinFromOpacity();
|
||||
}
|
||||
});
|
||||
|
||||
if (p.blendMode.has_value()) {
|
||||
if (*p.blendMode == Parameters::BlendMode::Normal) {
|
||||
_blendMode = BlendModeNormal;
|
||||
_blendMode = static_cast<int>(BlendMode::Normal);
|
||||
}
|
||||
else if (*p.blendMode == Parameters::BlendMode::Additive) {
|
||||
_blendMode = BlendModeAdditive;
|
||||
_blendMode = static_cast<int>(BlendMode::Additive);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -264,10 +262,14 @@ void RenderablePlane::render(const RenderData& data, RendererTasks&) {
|
||||
RenderEngine::RendererImplementation::ABuffer;
|
||||
|
||||
if (usingABufferRenderer) {
|
||||
_shader->setUniform("additiveBlending", _blendMode == BlendModeAdditive);
|
||||
_shader->setUniform(
|
||||
"additiveBlending",
|
||||
_blendMode == static_cast<int>(BlendMode::Additive)
|
||||
);
|
||||
}
|
||||
|
||||
bool additiveBlending = (_blendMode == BlendModeAdditive) && usingFramebufferRenderer;
|
||||
bool additiveBlending =
|
||||
(_blendMode == static_cast<int>(BlendMode::Additive)) && usingFramebufferRenderer;
|
||||
if (additiveBlending) {
|
||||
glDepthMask(false);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
|
||||
|
||||
@@ -78,8 +78,9 @@ namespace {
|
||||
namespace openspace {
|
||||
|
||||
documentation::Documentation RenderablePlaneImageLocal::Documentation() {
|
||||
documentation::Documentation doc = codegen::doc<Parameters>();
|
||||
doc.id = "base_renderable_plane_image_local";
|
||||
documentation::Documentation doc = codegen::doc<Parameters>(
|
||||
"base_renderable_plane_image_local"
|
||||
);
|
||||
|
||||
// @TODO cleanup
|
||||
// Insert the parents documentation entries until we have a verifier that can deal
|
||||
@@ -101,14 +102,12 @@ RenderablePlaneImageLocal::RenderablePlaneImageLocal(const ghoul::Dictionary& di
|
||||
|
||||
addProperty(_blendMode);
|
||||
|
||||
_texturePath = absPath(p.texture);
|
||||
_textureFile = std::make_unique<ghoul::filesystem::File>(_texturePath);
|
||||
_texturePath = absPath(p.texture).string();
|
||||
_textureFile = std::make_unique<ghoul::filesystem::File>(_texturePath.value());
|
||||
|
||||
addProperty(_texturePath);
|
||||
_texturePath.onChange([this]() { loadTexture(); });
|
||||
_textureFile->setCallback(
|
||||
[this](const ghoul::filesystem::File&) { _textureIsDirty = true; }
|
||||
);
|
||||
_textureFile->setCallback([this]() { _textureIsDirty = true; });
|
||||
|
||||
if (p.renderType.has_value()) {
|
||||
switch (*p.renderType) {
|
||||
@@ -193,7 +192,7 @@ void RenderablePlaneImageLocal::loadTexture() {
|
||||
std::to_string(hash),
|
||||
[path = _texturePath]() -> std::unique_ptr<ghoul::opengl::Texture> {
|
||||
std::unique_ptr<ghoul::opengl::Texture> texture =
|
||||
ghoul::io::TextureReader::ref().loadTexture(absPath(path));
|
||||
ghoul::io::TextureReader::ref().loadTexture(absPath(path).string());
|
||||
|
||||
LDEBUGC(
|
||||
"RenderablePlaneImageLocal",
|
||||
@@ -209,10 +208,8 @@ void RenderablePlaneImageLocal::loadTexture() {
|
||||
|
||||
BaseModule::TextureManager.release(t);
|
||||
|
||||
_textureFile = std::make_unique<ghoul::filesystem::File>(_texturePath);
|
||||
_textureFile->setCallback(
|
||||
[&](const ghoul::filesystem::File&) { _textureIsDirty = true; }
|
||||
);
|
||||
_textureFile = std::make_unique<ghoul::filesystem::File>(_texturePath.value());
|
||||
_textureFile->setCallback([this]() { _textureIsDirty = true; });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -52,8 +52,9 @@ namespace {
|
||||
namespace openspace {
|
||||
|
||||
documentation::Documentation RenderablePlaneImageOnline::Documentation() {
|
||||
documentation::Documentation doc = codegen::doc<Parameters>();
|
||||
doc.id = "base_renderable_plane_image_online";
|
||||
documentation::Documentation doc = codegen::doc<Parameters>(
|
||||
"base_renderable_plane_image_online"
|
||||
);
|
||||
|
||||
// @TODO cleanup
|
||||
// Insert the parents documentation entries until we have a verifier that can deal
|
||||
|
||||
@@ -162,9 +162,7 @@ namespace {
|
||||
namespace openspace {
|
||||
|
||||
documentation::Documentation RenderableSphere::Documentation() {
|
||||
documentation::Documentation doc = codegen::doc<Parameters>();
|
||||
doc.id = "base_renderable_sphere";
|
||||
return doc;
|
||||
return codegen::doc<Parameters>("base_renderable_sphere");
|
||||
}
|
||||
|
||||
RenderableSphere::RenderableSphere(const ghoul::Dictionary& dictionary)
|
||||
|
||||
@@ -181,9 +181,7 @@ namespace {
|
||||
namespace openspace {
|
||||
|
||||
documentation::Documentation RenderableTrail::Documentation() {
|
||||
documentation::Documentation doc = codegen::doc<Parameters>();
|
||||
doc.id = "base_renderable_renderabletrail";
|
||||
return doc;
|
||||
return codegen::doc<Parameters>("base_renderable_renderabletrail");
|
||||
}
|
||||
|
||||
RenderableTrail::Appearance::Appearance()
|
||||
@@ -432,10 +430,10 @@ void RenderableTrail::render(const RenderData& data, RendererTasks&) {
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
|
||||
}
|
||||
|
||||
const bool renderLines = (_appearance.renderingModes == RenderingModeLines) |
|
||||
const bool renderLines = (_appearance.renderingModes == RenderingModeLines) ||
|
||||
(_appearance.renderingModes == RenderingModeLinesPoints);
|
||||
|
||||
const bool renderPoints = (_appearance.renderingModes == RenderingModePoints) |
|
||||
const bool renderPoints = (_appearance.renderingModes == RenderingModePoints) ||
|
||||
(_appearance.renderingModes == RenderingModeLinesPoints);
|
||||
|
||||
if (renderLines) {
|
||||
|
||||
@@ -129,8 +129,9 @@ namespace {
|
||||
namespace openspace {
|
||||
|
||||
documentation::Documentation RenderableTrailOrbit::Documentation() {
|
||||
documentation::Documentation doc = codegen::doc<Parameters>();
|
||||
doc.id = "base_renderable_renderabletrailorbit";
|
||||
documentation::Documentation doc = codegen::doc<Parameters>(
|
||||
"base_renderable_renderabletrailorbit"
|
||||
);
|
||||
|
||||
// Insert the parents documentation entries until we have a verifier that can deal
|
||||
// with class hierarchy
|
||||
|
||||
@@ -105,8 +105,9 @@ namespace {
|
||||
namespace openspace {
|
||||
|
||||
documentation::Documentation RenderableTrailTrajectory::Documentation() {
|
||||
documentation::Documentation doc = codegen::doc<Parameters>();
|
||||
doc.id = "base_renderable_renderabletrailtrajectory";
|
||||
documentation::Documentation doc = codegen::doc<Parameters>(
|
||||
"base_renderable_renderabletrailtrajectory"
|
||||
);
|
||||
|
||||
// @TODO cleanup
|
||||
// Insert the parents documentation entries until we have a verifier that can deal
|
||||
|
||||
@@ -128,9 +128,7 @@ int removeDashboardItemsFromScreenSpace(lua_State* L) {
|
||||
} // namespace luascriptfunctions
|
||||
|
||||
documentation::Documentation ScreenSpaceDashboard::Documentation() {
|
||||
documentation::Documentation doc = codegen::doc<Parameters>();
|
||||
doc.id = "base_screenspace_dashboard";
|
||||
return doc;
|
||||
return codegen::doc<Parameters>("base_screenspace_dashboard");
|
||||
}
|
||||
|
||||
ScreenSpaceDashboard::ScreenSpaceDashboard(const ghoul::Dictionary& dictionary)
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include <ghoul/opengl/programobject.h>
|
||||
#include <ghoul/opengl/texture.h>
|
||||
#include <ghoul/opengl/textureconversion.h>
|
||||
#include <filesystem>
|
||||
#include <optional>
|
||||
|
||||
namespace {
|
||||
@@ -57,9 +58,7 @@ namespace {
|
||||
namespace openspace {
|
||||
|
||||
documentation::Documentation ScreenSpaceImageLocal::Documentation() {
|
||||
documentation::Documentation doc = codegen::doc<Parameters>();
|
||||
doc.id = "base_screenspace_image_local";
|
||||
return doc;
|
||||
return codegen::doc<Parameters>("base_screenspace_image_local");
|
||||
}
|
||||
|
||||
ScreenSpaceImageLocal::ScreenSpaceImageLocal(const ghoul::Dictionary& dictionary)
|
||||
@@ -81,7 +80,7 @@ ScreenSpaceImageLocal::ScreenSpaceImageLocal(const ghoul::Dictionary& dictionary
|
||||
setIdentifier(identifier);
|
||||
|
||||
_texturePath.onChange([this]() {
|
||||
if (!FileSys.fileExists(FileSys.absolutePath(_texturePath))) {
|
||||
if (!std::filesystem::is_regular_file(absPath(_texturePath))) {
|
||||
LWARNINGC(
|
||||
"ScreenSpaceImageLocal",
|
||||
fmt::format("Image {} did not exist for {}", _texturePath, _identifier)
|
||||
@@ -94,8 +93,8 @@ ScreenSpaceImageLocal::ScreenSpaceImageLocal(const ghoul::Dictionary& dictionary
|
||||
addProperty(_texturePath);
|
||||
|
||||
if (p.texturePath.has_value()) {
|
||||
if (FileSys.fileExists(FileSys.absolutePath(*p.texturePath))) {
|
||||
_texturePath = FileSys.absolutePath(*p.texturePath);
|
||||
if (std::filesystem::is_regular_file(absPath(*p.texturePath))) {
|
||||
_texturePath = absPath(*p.texturePath).string();
|
||||
}
|
||||
else {
|
||||
LWARNINGC(
|
||||
@@ -115,7 +114,7 @@ bool ScreenSpaceImageLocal::deinitializeGL() {
|
||||
void ScreenSpaceImageLocal::update() {
|
||||
if (_textureIsDirty && !_texturePath.value().empty()) {
|
||||
std::unique_ptr<ghoul::opengl::Texture> texture =
|
||||
ghoul::io::TextureReader::ref().loadTexture(absPath(_texturePath));
|
||||
ghoul::io::TextureReader::ref().loadTexture(absPath(_texturePath).string());
|
||||
|
||||
if (texture) {
|
||||
// Images don't need to start on 4-byte boundaries, for example if the
|
||||
|
||||
@@ -58,9 +58,7 @@ namespace {
|
||||
namespace openspace {
|
||||
|
||||
documentation::Documentation ScreenSpaceImageOnline::Documentation() {
|
||||
documentation::Documentation doc = codegen::doc<Parameters>();
|
||||
doc.id = "base_screenspace_image_online";
|
||||
return doc;
|
||||
return codegen::doc<Parameters>("base_screenspace_image_online");
|
||||
}
|
||||
|
||||
ScreenSpaceImageOnline::ScreenSpaceImageOnline(const ghoul::Dictionary& dictionary)
|
||||
|
||||
Reference in New Issue
Block a user