Expose the SGCT statistics information through a property in the RenderEngine (closes #2195)

This commit is contained in:
Alexander Bock
2022-08-01 15:27:05 +02:00
parent a4e3af700c
commit 41a4171aeb
5 changed files with 19 additions and 1 deletions
+3
View File
@@ -942,6 +942,9 @@ void setSgctDelegateFunctions() {
sgctDelegate.setScreenshotFolder = [](std::string path) {
Settings::instance().setCapturePath(std::move(path));
};
sgctDelegate.showStatistics = [](bool enabled) {
Engine::instance().setStatsGraphVisibility(enabled);
};
}
void checkCommandLineForSettings(int& argc, char** argv, bool& hasSGCT, bool& hasProfile,
@@ -105,6 +105,8 @@ struct WindowDelegate {
uint64_t (*swapGroupFrameNumber)() = []() { return uint64_t(0); };
void (*setScreenshotFolder)(std::string) = [](std::string) {};
void (*showStatistics)(bool) = [](bool) {};
};
} // namespace openspace
@@ -180,6 +180,7 @@ private:
properties::IntListProperty _screenshotWindowIds;
properties::BoolProperty _applyWarping;
properties::BoolProperty _showStatistics;
properties::BoolProperty _screenshotUseDate;
properties::BoolProperty _showFrameInformation;
properties::BoolProperty _disableMasterRendering;
+12
View File
@@ -131,6 +131,12 @@ namespace {
"interface"
};
constexpr openspace::properties::Property::PropertyInfo ShowStatisticsInfo = {
"ShowStatistics",
"Show Statistics",
"Show updating, rendering, and network statistics on all rendering nodes"
};
constexpr openspace::properties::Property::PropertyInfo ScreenshotUseDateInfo = {
"ScreenshotUseDate",
"Screenshot Folder uses Date",
@@ -271,6 +277,7 @@ RenderEngine::RenderEngine()
, _showCameraInfo(ShowCameraInfo, true)
, _screenshotWindowIds(ScreenshotWindowIdsInfo)
, _applyWarping(ApplyWarpingInfo, false)
, _showStatistics(ShowStatisticsInfo, false)
, _screenshotUseDate(ScreenshotUseDateInfo, false)
, _showFrameInformation(ShowFrameNumberInfo, false)
, _disableMasterRendering(DisableMasterInfo, false)
@@ -338,6 +345,11 @@ RenderEngine::RenderEngine()
addProperty(_screenshotWindowIds);
addProperty(_applyWarping);
_showStatistics.onChange([this]() {
global::windowDelegate->showStatistics(_showStatistics);
});
addProperty(_showStatistics);
_screenshotUseDate.onChange([this]() {
// If there is no screenshot folder, don't bother with handling the change
if (!FileSys.hasRegisteredToken("${STARTUP_SCREENSHOT}")) {