merge + codegen doc return

This commit is contained in:
ElonOlsson
2021-05-26 11:00:50 -04:00
340 changed files with 5907 additions and 6890 deletions

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -203,13 +203,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;
@@ -242,9 +242,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)
@@ -262,8 +260,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
@@ -385,7 +383,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();

View File

@@ -88,7 +88,6 @@ private:
properties::BoolProperty _enableAnimation;
properties::FloatProperty _ambientIntensity;
properties::FloatProperty _diffuseIntensity;
properties::FloatProperty _specularIntensity;

View File

@@ -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)

View File

@@ -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 = {
@@ -111,9 +111,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)
@@ -134,15 +132,15 @@ RenderablePlane::RenderablePlane(const ghoul::Dictionary& dictionary)
_mirrorBackside = p.mirrorBackside.value_or(_mirrorBackside);
_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:
@@ -151,17 +149,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);
}
}
@@ -279,10 +277,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);

View File

@@ -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

View File

@@ -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

View File

@@ -88,11 +88,7 @@ namespace {
namespace openspace {
documentation::Documentation RenderablePlaneTimeVaryingImage::Documentation() {
documentation::Documentation doc = codegen::doc<Parameters>();
doc.id = "base_renderable_plane_time_varying_image";
return doc;
//return codegen::doc<Parameters>("base_renderable_plane_time_varying_image");
return codegen::doc<Parameters>("base_renderable_plane_time_varying_image");
}
RenderablePlaneTimeVaryingImage::RenderablePlaneTimeVaryingImage(

View File

@@ -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)

View File

@@ -163,9 +163,7 @@ namespace {
namespace openspace {
documentation::Documentation RenderableTimeVaryingSphere::Documentation() {
documentation::Documentation doc = codegen::doc<Parameters>();
doc.id = "base_renderable_time_varying_sphere";
return doc;
return codegen::doc<Parameters>("base_renderable_time_varying_sphere");
}
RenderableTimeVaryingSphere::RenderableTimeVaryingSphere(

View File

@@ -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) {

View File

@@ -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

View File

@@ -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

View File

@@ -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)

View File

@@ -58,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)

View File

@@ -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)