From 7cb38b6c9cb0adae26c63abec466a097e30c3394 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Wed, 23 Feb 2022 13:20:36 +0100 Subject: [PATCH] Update codegen and make use of the new parenting method --- .../base/dashboard/dashboarditemdistance.cpp | 16 +++------------- .../base/dashboard/dashboarditemframerate.cpp | 16 +++------------- .../dashboard/dashboarditempropertyvalue.cpp | 16 +++------------- .../dashboarditemsimulationincrement.cpp | 16 +++------------- modules/base/dashboard/dashboarditemtext.cpp | 16 +++------------- .../base/dashboard/dashboarditemvelocity.cpp | 16 +++------------- .../rendering/renderableplaneimagelocal.cpp | 16 +++------------- .../rendering/renderableplaneimageonline.cpp | 16 +++------------- .../renderableplanetimevaryingimage.cpp | 16 +++------------- modules/base/rendering/renderabletrailorbit.cpp | 16 +++------------- .../rendering/renderabletrailtrajectory.cpp | 17 +++-------------- .../space/rendering/renderablehabitablezone.cpp | 17 +++-------------- .../space/rendering/renderablesatellites.cpp | 16 +++------------- modules/space/rendering/renderablesmallbody.cpp | 15 +++------------ .../dashboard/dashboarditeminstruments.cpp | 16 +++------------- support/coding/codegen | 2 +- 16 files changed, 46 insertions(+), 197 deletions(-) diff --git a/modules/base/dashboard/dashboarditemdistance.cpp b/modules/base/dashboard/dashboarditemdistance.cpp index 353577cdb5..8f738e1b24 100644 --- a/modules/base/dashboard/dashboarditemdistance.cpp +++ b/modules/base/dashboard/dashboarditemdistance.cpp @@ -147,20 +147,10 @@ namespace { namespace openspace { documentation::Documentation DashboardItemDistance::Documentation() { - documentation::Documentation doc = - codegen::doc("base_dashboarditem_distance"); - - // @TODO cleanup - // Insert the parent's documentation entries until we have a verifier that can deal - // with class hierarchy - documentation::Documentation parentDoc = DashboardTextItem::Documentation(); - doc.entries.insert( - doc.entries.end(), - parentDoc.entries.begin(), - parentDoc.entries.end() + return codegen::doc( + "base_dashboarditem_distance", + DashboardTextItem::Documentation() ); - - return doc; } DashboardItemDistance::DashboardItemDistance(const ghoul::Dictionary& dictionary) diff --git a/modules/base/dashboard/dashboarditemframerate.cpp b/modules/base/dashboard/dashboarditemframerate.cpp index 5a08e4556d..62df3ba45f 100644 --- a/modules/base/dashboard/dashboarditemframerate.cpp +++ b/modules/base/dashboard/dashboarditemframerate.cpp @@ -157,20 +157,10 @@ namespace { namespace openspace { documentation::Documentation DashboardItemFramerate::Documentation() { - documentation::Documentation doc = - codegen::doc("base_dashboarditem_framerate"); - - // @TODO cleanup - // Insert the parent's documentation entries until we have a verifier that can deal - // with class hierarchy - documentation::Documentation parentDoc = DashboardTextItem::Documentation(); - doc.entries.insert( - doc.entries.end(), - parentDoc.entries.begin(), - parentDoc.entries.end() + return codegen::doc( + "base_dashboarditem_framerate", + DashboardTextItem::Documentation() ); - - return doc; } DashboardItemFramerate::DashboardItemFramerate(const ghoul::Dictionary& dictionary) diff --git a/modules/base/dashboard/dashboarditempropertyvalue.cpp b/modules/base/dashboard/dashboarditempropertyvalue.cpp index c630692d96..ac28a1b5c9 100644 --- a/modules/base/dashboard/dashboarditempropertyvalue.cpp +++ b/modules/base/dashboard/dashboarditempropertyvalue.cpp @@ -62,20 +62,10 @@ namespace { namespace openspace { documentation::Documentation DashboardItemPropertyValue::Documentation() { - documentation::Documentation doc = - codegen::doc("base_dashboarditem_propertyvalue"); - - // @TODO cleanup - // Insert the parent's documentation entries until we have a verifier that can deal - // with class hierarchy - documentation::Documentation parentDoc = DashboardTextItem::Documentation(); - doc.entries.insert( - doc.entries.end(), - parentDoc.entries.begin(), - parentDoc.entries.end() + return codegen::doc( + "base_dashboarditem_propertyvalue", + DashboardTextItem::Documentation() ); - - return doc; } DashboardItemPropertyValue::DashboardItemPropertyValue( diff --git a/modules/base/dashboard/dashboarditemsimulationincrement.cpp b/modules/base/dashboard/dashboarditemsimulationincrement.cpp index f55d41d02d..0b6ffcb951 100644 --- a/modules/base/dashboard/dashboarditemsimulationincrement.cpp +++ b/modules/base/dashboard/dashboarditemsimulationincrement.cpp @@ -101,20 +101,10 @@ namespace { namespace openspace { documentation::Documentation DashboardItemSimulationIncrement::Documentation() { - documentation::Documentation doc = - codegen::doc("base_dashboarditem_simulationincrement"); - - // @TODO cleanup - // Insert the parent's documentation entries until we have a verifier that can deal - // with class hierarchy - documentation::Documentation parentDoc = DashboardTextItem::Documentation(); - doc.entries.insert( - doc.entries.end(), - parentDoc.entries.begin(), - parentDoc.entries.end() + return codegen::doc( + "base_dashboarditem_simulationincrement", + DashboardTextItem::Documentation() ); - - return doc; } DashboardItemSimulationIncrement::DashboardItemSimulationIncrement( diff --git a/modules/base/dashboard/dashboarditemtext.cpp b/modules/base/dashboard/dashboarditemtext.cpp index 8bc450aa87..6a8ba5f22f 100644 --- a/modules/base/dashboard/dashboarditemtext.cpp +++ b/modules/base/dashboard/dashboarditemtext.cpp @@ -50,20 +50,10 @@ namespace { namespace openspace { documentation::Documentation DashboardItemText::Documentation() { - documentation::Documentation doc = - codegen::doc("base_dashboarditem_text"); - - // @TODO cleanup - // Insert the parent's documentation entries until we have a verifier that can deal - // with class hierarchy - documentation::Documentation parentDoc = DashboardTextItem::Documentation(); - doc.entries.insert( - doc.entries.end(), - parentDoc.entries.begin(), - parentDoc.entries.end() + return codegen::doc( + "base_dashboarditem_text", + DashboardTextItem::Documentation() ); - - return doc; } DashboardItemText::DashboardItemText(const ghoul::Dictionary& dictionary) diff --git a/modules/base/dashboard/dashboarditemvelocity.cpp b/modules/base/dashboard/dashboarditemvelocity.cpp index ed0f1bcd11..dcea43fdd8 100644 --- a/modules/base/dashboard/dashboarditemvelocity.cpp +++ b/modules/base/dashboard/dashboarditemvelocity.cpp @@ -82,20 +82,10 @@ namespace { namespace openspace { documentation::Documentation DashboardItemVelocity::Documentation() { - documentation::Documentation doc = - codegen::doc("base_dashboarditem_velocity"); - - // @TODO cleanup - // Insert the parent's documentation entries until we have a verifier that can deal - // with class hierarchy - documentation::Documentation parentDoc = DashboardTextItem::Documentation(); - doc.entries.insert( - doc.entries.end(), - parentDoc.entries.begin(), - parentDoc.entries.end() + return codegen::doc( + "base_dashboarditem_velocity", + DashboardTextItem::Documentation() ); - - return doc; } DashboardItemVelocity::DashboardItemVelocity(const ghoul::Dictionary& dictionary) diff --git a/modules/base/rendering/renderableplaneimagelocal.cpp b/modules/base/rendering/renderableplaneimagelocal.cpp index 1cc3d4c937..5269ba77a3 100644 --- a/modules/base/rendering/renderableplaneimagelocal.cpp +++ b/modules/base/rendering/renderableplaneimagelocal.cpp @@ -60,20 +60,10 @@ namespace { namespace openspace { documentation::Documentation RenderablePlaneImageLocal::Documentation() { - documentation::Documentation doc = codegen::doc( - "base_renderable_plane_image_local" + return codegen::doc( + "base_renderable_plane_image_local", + RenderablePlane::Documentation() ); - - // @TODO cleanup - // Insert the parents documentation entries until we have a verifier that can deal - // with class hierarchy - documentation::Documentation parentDoc = RenderablePlane::Documentation(); - doc.entries.insert( - doc.entries.end(), - parentDoc.entries.begin(), - parentDoc.entries.end() - ); - return doc; } RenderablePlaneImageLocal::RenderablePlaneImageLocal(const ghoul::Dictionary& dictionary) diff --git a/modules/base/rendering/renderableplaneimageonline.cpp b/modules/base/rendering/renderableplaneimageonline.cpp index c07753bdb1..bbbe18d4b1 100644 --- a/modules/base/rendering/renderableplaneimageonline.cpp +++ b/modules/base/rendering/renderableplaneimageonline.cpp @@ -52,20 +52,10 @@ namespace { namespace openspace { documentation::Documentation RenderablePlaneImageOnline::Documentation() { - documentation::Documentation doc = codegen::doc( - "base_renderable_plane_image_online" + return codegen::doc( + "base_renderable_plane_image_online", + RenderablePlane::Documentation() ); - - // @TODO cleanup - // Insert the parents documentation entries until we have a verifier that can deal - // with class hierarchy - documentation::Documentation parentDoc = RenderablePlane::Documentation(); - doc.entries.insert( - doc.entries.end(), - parentDoc.entries.begin(), - parentDoc.entries.end() - ); - return doc; } RenderablePlaneImageOnline::RenderablePlaneImageOnline( diff --git a/modules/base/rendering/renderableplanetimevaryingimage.cpp b/modules/base/rendering/renderableplanetimevaryingimage.cpp index c3e3a50993..d957708bce 100644 --- a/modules/base/rendering/renderableplanetimevaryingimage.cpp +++ b/modules/base/rendering/renderableplanetimevaryingimage.cpp @@ -76,20 +76,10 @@ namespace { namespace openspace { documentation::Documentation RenderablePlaneTimeVaryingImage::Documentation() { - documentation::Documentation doc = codegen::doc( - "base_renderable_plane_time_varying_image" + return codegen::doc( + "base_renderable_plane_time_varying_image", + RenderablePlane::Documentation() ); - - // Insert the parents documentation entries until we have a verifier that can deal - // with class hierarchy - documentation::Documentation parentDoc = RenderablePlane::Documentation(); - doc.entries.insert( - doc.entries.end(), - parentDoc.entries.begin(), - parentDoc.entries.end() - ); - - return doc; } RenderablePlaneTimeVaryingImage::RenderablePlaneTimeVaryingImage( diff --git a/modules/base/rendering/renderabletrailorbit.cpp b/modules/base/rendering/renderabletrailorbit.cpp index 1f3a0e6005..129a14041a 100644 --- a/modules/base/rendering/renderabletrailorbit.cpp +++ b/modules/base/rendering/renderabletrailorbit.cpp @@ -136,20 +136,10 @@ namespace { namespace openspace { documentation::Documentation RenderableTrailOrbit::Documentation() { - documentation::Documentation doc = codegen::doc( - "base_renderable_renderabletrailorbit" + return codegen::doc( + "base_renderable_renderabletrailorbit", + RenderableTrail::Documentation() ); - - // Insert the parents documentation entries until we have a verifier that can deal - // with class hierarchy - documentation::Documentation parentDoc = RenderableTrail::Documentation(); - doc.entries.insert( - doc.entries.end(), - parentDoc.entries.begin(), - parentDoc.entries.end() - ); - - return doc; } RenderableTrailOrbit::RenderableTrailOrbit(const ghoul::Dictionary& dictionary) diff --git a/modules/base/rendering/renderabletrailtrajectory.cpp b/modules/base/rendering/renderabletrailtrajectory.cpp index 14e4be317a..1f38c38d7f 100644 --- a/modules/base/rendering/renderabletrailtrajectory.cpp +++ b/modules/base/rendering/renderabletrailtrajectory.cpp @@ -105,21 +105,10 @@ namespace { namespace openspace { documentation::Documentation RenderableTrailTrajectory::Documentation() { - documentation::Documentation doc = codegen::doc( - "base_renderable_renderabletrailtrajectory" + return codegen::doc( + "base_renderable_renderabletrailtrajectory", + RenderableTrail::Documentation() ); - - // @TODO cleanup - // Insert the parents documentation entries until we have a verifier that can deal - // with class hierarchy - documentation::Documentation parentDoc = RenderableTrail::Documentation(); - doc.entries.insert( - doc.entries.end(), - parentDoc.entries.begin(), - parentDoc.entries.end() - ); - - return doc; } RenderableTrailTrajectory::RenderableTrailTrajectory(const ghoul::Dictionary& dictionary) diff --git a/modules/space/rendering/renderablehabitablezone.cpp b/modules/space/rendering/renderablehabitablezone.cpp index e17643090b..51b3e6fd7f 100644 --- a/modules/space/rendering/renderablehabitablezone.cpp +++ b/modules/space/rendering/renderablehabitablezone.cpp @@ -94,21 +94,10 @@ namespace { namespace openspace { documentation::Documentation RenderableHabitableZone::Documentation() { - documentation::Documentation doc = codegen::doc( - "space_renderablehabitablezone" + return codegen::doc( + "space_renderablehabitablezone", + RenderableDisc::Documentation() ); - - // @TODO cleanup - // Insert the parents documentation entries until we have a verifier that can deal - // with class hierarchy - documentation::Documentation parentDoc = RenderableDisc::Documentation(); - doc.entries.insert( - doc.entries.end(), - parentDoc.entries.begin(), - parentDoc.entries.end() - ); - - return doc; } RenderableHabitableZone::RenderableHabitableZone(const ghoul::Dictionary& dictionary) diff --git a/modules/space/rendering/renderablesatellites.cpp b/modules/space/rendering/renderablesatellites.cpp index d7b14a048b..8428e875c6 100644 --- a/modules/space/rendering/renderablesatellites.cpp +++ b/modules/space/rendering/renderablesatellites.cpp @@ -64,20 +64,10 @@ namespace { namespace openspace { documentation::Documentation RenderableSatellites::Documentation() { - documentation::Documentation doc = codegen::doc( - "space_renderablesatellites" + return codegen::doc( + "space_renderablesatellites", + RenderableOrbitalKepler::Documentation() ); - - // Insert the parents documentation entries until we have a verifier that can deal - // with class hierarchy - documentation::Documentation parentDoc = RenderableOrbitalKepler::Documentation(); - doc.entries.insert( - doc.entries.end(), - parentDoc.entries.begin(), - parentDoc.entries.end() - ); - - return doc; } RenderableSatellites::RenderableSatellites(const ghoul::Dictionary& dictionary) diff --git a/modules/space/rendering/renderablesmallbody.cpp b/modules/space/rendering/renderablesmallbody.cpp index fb3531a9d0..61e0626a6b 100644 --- a/modules/space/rendering/renderablesmallbody.cpp +++ b/modules/space/rendering/renderablesmallbody.cpp @@ -98,19 +98,10 @@ namespace { namespace openspace { documentation::Documentation RenderableSmallBody::Documentation() { - documentation::Documentation doc = codegen::doc( - "space_renderablesmallbody" + return codegen::doc( + "space_renderablesmallbody", + RenderableOrbitalKepler::Documentation() ); - - // Insert the parents documentation entries until we have a verifier that can deal - // with class hierarchy - documentation::Documentation parentDoc = RenderableOrbitalKepler::Documentation(); - doc.entries.insert( - doc.entries.end(), - parentDoc.entries.begin(), - parentDoc.entries.end() - ); - return doc; } RenderableSmallBody::RenderableSmallBody(const ghoul::Dictionary& dictionary) diff --git a/modules/spacecraftinstruments/dashboard/dashboarditeminstruments.cpp b/modules/spacecraftinstruments/dashboard/dashboarditeminstruments.cpp index 5d420fd47b..87f549dd7b 100644 --- a/modules/spacecraftinstruments/dashboard/dashboarditeminstruments.cpp +++ b/modules/spacecraftinstruments/dashboard/dashboarditeminstruments.cpp @@ -85,20 +85,10 @@ namespace { namespace openspace { documentation::Documentation DashboardItemInstruments::Documentation() { - documentation::Documentation doc = - codegen::doc("spacecraftinstruments_dashboarditem_instuments"); - - // @TODO cleanup - // Insert the parent's documentation entries until we have a verifier that can deal - // with class hierarchy - documentation::Documentation parentDoc = DashboardTextItem::Documentation(); - doc.entries.insert( - doc.entries.end(), - parentDoc.entries.begin(), - parentDoc.entries.end() + return codegen::doc( + "spacecraftinstruments_dashboarditem_instuments", + DashboardTextItem::Documentation() ); - - return doc; } DashboardItemInstruments::DashboardItemInstruments(const ghoul::Dictionary& dictionary) diff --git a/support/coding/codegen b/support/coding/codegen index ad3aa1e5e1..f511a93fdd 160000 --- a/support/coding/codegen +++ b/support/coding/codegen @@ -1 +1 @@ -Subproject commit ad3aa1e5e1a3656316f2fc94bf60f31090872e4a +Subproject commit f511a93fddee9dda92d87408d2c7587bb63746b9