mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-06 19:39:56 -05:00
Add the ability to scale th statistics graphs
This commit is contained in:
+1
-1
Submodule apps/OpenSpace/ext/sgct updated: e8392b5d27...c68e7cf398
@@ -992,6 +992,9 @@ void setSgctDelegateFunctions() {
|
||||
|
||||
return mousePosition;
|
||||
};
|
||||
sgctDelegate.setStatisticsGraphScale = [](float scale) {
|
||||
sgct::Engine::instance().setStatsGraphScale(scale);
|
||||
};
|
||||
}
|
||||
|
||||
std::string setWindowConfigPresetForGui(const std::string& labelFromCfgFile,
|
||||
|
||||
@@ -124,6 +124,8 @@ struct WindowDelegate {
|
||||
|
||||
glm::vec2 (*mousePositionViewportRelative)(const glm::vec2& mousePosition) =
|
||||
[](const glm::vec2&) { return glm::vec2(0); };
|
||||
|
||||
void (*setStatisticsGraphScale)(float scale) = [](float) {};
|
||||
};
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
@@ -187,6 +187,7 @@ private:
|
||||
properties::IntListProperty _screenshotWindowIds;
|
||||
properties::BoolProperty _applyWarping;
|
||||
properties::BoolProperty _showStatistics;
|
||||
properties::FloatProperty _statisticsScale;
|
||||
properties::BoolProperty _screenshotUseDate;
|
||||
properties::BoolProperty _showFrameInformation;
|
||||
properties::BoolProperty _disableMasterRendering;
|
||||
|
||||
@@ -146,6 +146,15 @@ namespace {
|
||||
openspace::properties::Property::Visibility::AdvancedUser
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo StatisticsScaleInfo = {
|
||||
"StatisticsScale",
|
||||
"Statistics Scale",
|
||||
"This value is scaling the statatistics window by the provided amount. For flat "
|
||||
"projections this is rarely necessary, but it is important when using a setup "
|
||||
"where the cornders of the image are masked out.",
|
||||
openspace::properties::Property::Visibility::AdvancedUser
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo ScreenshotUseDateInfo = {
|
||||
"ScreenshotUseDate",
|
||||
"Screenshot Folder uses Date",
|
||||
@@ -313,6 +322,7 @@ RenderEngine::RenderEngine()
|
||||
, _screenshotWindowIds(ScreenshotWindowIdsInfo)
|
||||
, _applyWarping(ApplyWarpingInfo, false)
|
||||
, _showStatistics(ShowStatisticsInfo, false)
|
||||
, _statisticsScale(StatisticsScaleInfo, 1.f, 0.f, 1.f)
|
||||
, _screenshotUseDate(ScreenshotUseDateInfo, false)
|
||||
, _showFrameInformation(ShowFrameNumberInfo, false)
|
||||
, _disableMasterRendering(DisableMasterInfo, false)
|
||||
@@ -387,9 +397,17 @@ RenderEngine::RenderEngine()
|
||||
|
||||
_showStatistics.onChange([this]() {
|
||||
global::windowDelegate->showStatistics(_showStatistics);
|
||||
// We need to reset the scale as it is not updated when the statistics window is
|
||||
// not currently shown
|
||||
global::windowDelegate->setStatisticsGraphScale(_statisticsScale);
|
||||
});
|
||||
addProperty(_showStatistics);
|
||||
|
||||
_statisticsScale.onChange([this]() {
|
||||
global::windowDelegate->setStatisticsGraphScale(_statisticsScale);
|
||||
});
|
||||
addProperty(_statisticsScale);
|
||||
|
||||
_screenshotUseDate.onChange([this]() {
|
||||
// If there is no screenshot folder, don't bother with handling the change
|
||||
if (!FileSys.hasRegisteredToken("${STARTUP_SCREENSHOT}")) {
|
||||
|
||||
Reference in New Issue
Block a user