diff --git a/include/openspace/engine/settingsengine.h b/include/openspace/engine/settingsengine.h index e040192928..4c90b10832 100644 --- a/include/openspace/engine/settingsengine.h +++ b/include/openspace/engine/settingsengine.h @@ -45,16 +45,8 @@ public: void setModules(const std::vector& modules); - bool busyWaitForDecode(); - bool logSGCTOutOfOrderErrors(); - bool useDoubleBuffering(); - private: properties::OptionProperty _scenes; - properties::BoolProperty _busyWaitForDecode; - properties::BoolProperty _logSGCTOutOfOrderErrors; - properties::BoolProperty _useDoubleBuffering; - properties::BoolProperty _spiceUseExceptions; }; } // namespace openspace diff --git a/include/openspace/interaction/orbitalnavigator.h b/include/openspace/interaction/orbitalnavigator.h index 92832f214f..eaf3c6277c 100644 --- a/include/openspace/interaction/orbitalnavigator.h +++ b/include/openspace/interaction/orbitalnavigator.h @@ -65,9 +65,9 @@ private: }; // Properties + properties::BoolProperty _rollFriction; properties::BoolProperty _rotationalFriction; - properties::BoolProperty _horizontalFriction; - properties::BoolProperty _verticalFriction; + properties::BoolProperty _zoomFriction; properties::FloatProperty _followFocusNodeRotationDistance; properties::FloatProperty _minimumAllowedDistance; properties::FloatProperty _sensitivity; diff --git a/include/openspace/rendering/renderable.h b/include/openspace/rendering/renderable.h index 56ddd157a2..1baf5639e1 100644 --- a/include/openspace/rendering/renderable.h +++ b/include/openspace/rendering/renderable.h @@ -61,7 +61,7 @@ public: static std::unique_ptr createFromDictionary(const ghoul::Dictionary& dictionary); // constructors & destructor - Renderable(); + //Renderable(); Renderable(const ghoul::Dictionary& dictionary); virtual ~Renderable(); diff --git a/modules/globebrowsing/globes/chunkedlodglobe.cpp b/modules/globebrowsing/globes/chunkedlodglobe.cpp index 91c4e92ad0..7317939c2e 100644 --- a/modules/globebrowsing/globes/chunkedlodglobe.cpp +++ b/modules/globebrowsing/globes/chunkedlodglobe.cpp @@ -57,7 +57,8 @@ const GeodeticPatch ChunkedLodGlobe::COVERAGE = GeodeticPatch(0, 0, 90, 180); ChunkedLodGlobe::ChunkedLodGlobe(const RenderableGlobe& owner, size_t segmentsPerPatch, std::shared_ptr layerManager) - : minSplitDepth(2) + : Renderable({ { "Name", owner.name() } }) + , minSplitDepth(2) , maxSplitDepth(22) , stats(StatsCollector(absPath("test_stats"), 1, StatsCollector::Enabled::No)) , _owner(owner) diff --git a/modules/globebrowsing/globes/pointglobe.cpp b/modules/globebrowsing/globes/pointglobe.cpp index 1539bc27bb..04c474c306 100644 --- a/modules/globebrowsing/globes/pointglobe.cpp +++ b/modules/globebrowsing/globes/pointglobe.cpp @@ -36,7 +36,8 @@ namespace openspace::globebrowsing { PointGlobe::PointGlobe(const RenderableGlobe& owner) - : _owner(owner) + : Renderable({ { "Name", owner.name() } }) + , _owner(owner) , _intensityClamp( { "IntensityClamp", "Intensity clamp", ""}, // @TODO Missing documentation 1, 0, 1 diff --git a/modules/globebrowsing/globes/renderableglobe.cpp b/modules/globebrowsing/globes/renderableglobe.cpp index c5eb3b9f12..e11286978d 100644 --- a/modules/globebrowsing/globes/renderableglobe.cpp +++ b/modules/globebrowsing/globes/renderableglobe.cpp @@ -41,7 +41,8 @@ using namespace openspace::properties; namespace openspace::globebrowsing { RenderableGlobe::RenderableGlobe(const ghoul::Dictionary& dictionary) - : _debugProperties({ + : Renderable(dictionary) + , _debugProperties({ BoolProperty({ "SaveOrThrowCamera", "save or throw camera", "" }, false), // @TODO Missing documentation BoolProperty({ "ShowChunkEdges", "show chunk edges", "" }, false), // @TODO Missing documentation BoolProperty({ "ShowChunkBounds", "show chunk bounds", "" }, false), // @TODO Missing documentation @@ -52,13 +53,11 @@ RenderableGlobe::RenderableGlobe(const ghoul::Dictionary& dictionary) BoolProperty({ "PerformHorizonCulling", "perform horizon culling", "" }, true), // @TODO Missing documentation BoolProperty({ "LevelByProjectedAreaElseDistance", "level by projected area (else distance)", "" }, true), // @TODO Missing documentation BoolProperty({ "ResetTileProviders", "reset tile providers", "" }, false), // @TODO Missing documentation - BoolProperty({ "ToggleEnabledEveryFrame", "toggle enabled every frame", "" }, false), // @TODO Missing documentation BoolProperty({ "CollectStats", "collect stats", "" }, false), // @TODO Missing documentation BoolProperty({ "LimitLevelByAvailableData", "Limit level by available data", "" }, true), // @TODO Missing documentation IntProperty({ "ModelSpaceRenderingCutoffLevel", "Model Space Rendering Cutoff Level", "" }, 10, 1, 22) // @TODO Missing documentation }) , _generalProperties({ - BoolProperty({ "Enabled", "Enabled", "" }, true), // @TODO Missing documentation BoolProperty({ "PerformShading", "perform shading", "" }, true), // @TODO Missing documentation BoolProperty({ "Atmosphere", "atmosphere", "" }, false), // @TODO Missing documentation BoolProperty({ "UseAccurateNormals", "useAccurateNormals", "" }, false), // @TODO Missing documentation @@ -102,7 +101,6 @@ RenderableGlobe::RenderableGlobe(const ghoul::Dictionary& dictionary) _distanceSwitch.addSwitchValue(_chunkedLodGlobe); //_distanceSwitch.addSwitchValue(_pointGlobe); - addProperty(_generalProperties.isEnabled); addProperty(_generalProperties.atmosphereEnabled); addProperty(_generalProperties.performShading); addProperty(_generalProperties.useAccurateNormals); @@ -122,7 +120,6 @@ RenderableGlobe::RenderableGlobe(const ghoul::Dictionary& dictionary) _debugProperties.levelByProjectedAreaElseDistance ); _debugPropertyOwner.addProperty(_debugProperties.resetTileProviders); - _debugPropertyOwner.addProperty(_debugProperties.toggleEnabledEveryFrame); _debugPropertyOwner.addProperty(_debugProperties.collectStats); _debugPropertyOwner.addProperty(_debugProperties.limitLevelByAvailableData); _debugPropertyOwner.addProperty(_debugProperties.modelSpaceRenderingCutoffLevel); @@ -160,12 +157,7 @@ void RenderableGlobe::render(const RenderData& data, RendererTasks& tasks) { bool statsEnabled = _debugProperties.collectStats.value(); _chunkedLodGlobe->stats.setEnabled(statsEnabled); - if (_debugProperties.toggleEnabledEveryFrame.value()) { - _generalProperties.isEnabled.setValue( - !_generalProperties.isEnabled.value() - ); - } - if (_generalProperties.isEnabled.value()) { + if (_enabled) { if (_debugProperties.saveOrThrowCamera.value()) { _debugProperties.saveOrThrowCamera.setValue(false); diff --git a/modules/globebrowsing/globes/renderableglobe.h b/modules/globebrowsing/globes/renderableglobe.h index 8c0fa506cc..54a4ecde10 100644 --- a/modules/globebrowsing/globes/renderableglobe.h +++ b/modules/globebrowsing/globes/renderableglobe.h @@ -64,14 +64,12 @@ public: properties::BoolProperty performHorizonCulling; properties::BoolProperty levelByProjectedAreaElseDistance; properties::BoolProperty resetTileProviders; - properties::BoolProperty toggleEnabledEveryFrame; properties::BoolProperty collectStats; properties::BoolProperty limitLevelByAvailableData; properties::IntProperty modelSpaceRenderingCutoffLevel; }; struct GeneralProperties { - properties::BoolProperty isEnabled; properties::BoolProperty performShading; properties::BoolProperty atmosphereEnabled; properties::BoolProperty useAccurateNormals; diff --git a/scripts/common.lua b/scripts/common.lua index 4ada7ea37d..b80c4fdc1a 100644 --- a/scripts/common.lua +++ b/scripts/common.lua @@ -52,19 +52,19 @@ helper.setCommonKeys = function() openspace.bindKey( "f", - helper.property.invert('NavigationHandler.OrbitalNavigator.HorizontalFriction'), - "Toggles the horizontal friction of the camera. If it is disabled, the camera rotates around the focus object indefinitely." + helper.property.invert('NavigationHandler.OrbitalNavigator.RotationalFriction'), + "Toggles the rotational friction of the camera. If it is disabled, the camera rotates around the focus object indefinitely." ) openspace.bindKey( "Shift+f", - helper.property.invert('NavigationHandler.OrbitalNavigator.VerticalFriction'), - "Toggles the vertical friction of the camera. If it is disabled, the camera rises up from or closes in towards the focus object indefinitely." + helper.property.invert('NavigationHandler.OrbitalNavigator.ZoomFriction'), + "Toggles the zoom friction of the camera. If it is disabled, the camera rises up from or closes in towards the focus object indefinitely." ) openspace.bindKey( "Ctrl+f", - helper.property.invert('NavigationHandler.OrbitalNavigator.RotationalFriction'), - "Toggles the rotational friction of the camera. If it is disabled, the camera rotates around its own axis indefinitely." + helper.property.invert('NavigationHandler.OrbitalNavigator.RollFriction'), + "Toggles the roll friction of the camera. If it is disabled, the camera rolls around its own axis indefinitely." ) openspace.bindKey( diff --git a/src/engine/settingsengine.cpp b/src/engine/settingsengine.cpp index f2be574d63..ee3b397e64 100644 --- a/src/engine/settingsengine.cpp +++ b/src/engine/settingsengine.cpp @@ -38,25 +38,22 @@ #include +namespace { + static const openspace::properties::Property::PropertyInfo SceneInfo = { + "Scenes", + "Current Scene", + "Specifies the currently loaded scene. If this value is changed it will cause " + "the current scene to be unloaded and the newly selected scene to be loaded" + }; + +} // namespace + namespace openspace { SettingsEngine::SettingsEngine() : properties::PropertyOwner("Global Properties") - , _scenes({ "Scenes", "Scene", "" }, properties::OptionProperty::DisplayType::Dropdown) // @TODO Missing documentation - , _busyWaitForDecode({ "BusyWaitForDecode", "Busy Wait for decode", "" }, false) // @TODO Missing documentation - , _logSGCTOutOfOrderErrors({ "LogSGCTOutOfOrderErrors", "Log SGCT out-of-order", "" }, false) // @TODO Missing documentation - , _useDoubleBuffering({ "UseDoubleBuffering", "Use double buffering", "" }, false) // @TODO Missing documentation - , _spiceUseExceptions({ "EnableSpiceExceptions", "Enable Spice Exceptions", "" }, false) // @TODO Missing documentation + , _scenes(SceneInfo, properties::OptionProperty::DisplayType::Dropdown) { - _spiceUseExceptions.onChange([this] { - SpiceManager::ref().setExceptionHandling( - SpiceManager::UseException(_spiceUseExceptions) - ); - }); - addProperty(_spiceUseExceptions); - addProperty(_busyWaitForDecode); - addProperty(_logSGCTOutOfOrderErrors); - addProperty(_useDoubleBuffering); addProperty(_scenes); } @@ -87,16 +84,4 @@ void SettingsEngine::setModules(const std::vector& modules) { } } -bool SettingsEngine::busyWaitForDecode() { - return _busyWaitForDecode; -} - -bool SettingsEngine::logSGCTOutOfOrderErrors() { - return _logSGCTOutOfOrderErrors; -} - -bool SettingsEngine::useDoubleBuffering() { - return _useDoubleBuffering; -} - } // namespace openspace diff --git a/src/engine/wrapper/sgctwindowwrapper.cpp b/src/engine/wrapper/sgctwindowwrapper.cpp index 416937a8db..dc19d46551 100644 --- a/src/engine/wrapper/sgctwindowwrapper.cpp +++ b/src/engine/wrapper/sgctwindowwrapper.cpp @@ -31,13 +31,28 @@ namespace { const char* GuiWindowTag = "GUI"; + + static const openspace::properties::Property::PropertyInfo EyeSeparationInfo = { + "EyeSeparation", + "Eye Separation", + "Sets a static eye separation for use in stereoscopic rendering. If no " + "stereoscopic rendering is performed, this value is unused." + }; + + static const openspace::properties::Property::PropertyInfo ShowStatsGraphInfo = { + "ShowStatsGraph", + "Show Statistics Graph", + "Toggles the rendering of the SGCT statistics graph that is rendered on top of " + "every image. The statistics show the frame time, synchronization time, and many " + "other timings as reported by SGCT." + }; } // namespace namespace openspace { SGCTWindowWrapper::SGCTWindowWrapper() - : _eyeSeparation({ "EyeSeparation", "Eye Separation", "" }, 0.f, 0.f, 10.f) // @TODO Missing documentation - , _showStatsGraph({ "ShowStatsGraph", "Show Stats Graph", "" }, false) // @TODO Missing documentation + : _eyeSeparation(EyeSeparationInfo, 0.f, 0.f, 10.f) + , _showStatsGraph(ShowStatsGraphInfo, false) { _showStatsGraph.onChange([this](){ sgct::Engine::instance()->setStatsGraphVisibility(_showStatsGraph); diff --git a/src/interaction/luaconsole.cpp b/src/interaction/luaconsole.cpp index d2b0e3a028..dba135d8fc 100644 --- a/src/interaction/luaconsole.cpp +++ b/src/interaction/luaconsole.cpp @@ -69,45 +69,96 @@ namespace { // The number of characters to display after the cursor // when horizontal scrolling is required. const int NVisibleCharsAfterCursor = 5; + + const static openspace::properties::Property::PropertyInfo VisibleInfo = { + "IsVisible", + "Is Visible", + "Determines whether the Lua console is shown on the screen or not. Toggling it " + "will fade the console in and out." + }; + + const static openspace::properties::Property::PropertyInfo RemoveScriptingInfo = { + "RemoteScripting", + "Remote scripting", + "Determines whether the entered commands will only be executed locally (if this " + "is disabled), or whether they will be send to connected remove instances." + }; + + const static openspace::properties::Property::PropertyInfo BackgroundColorInfo = { + "BackgroundColor", + "Background Color", + "Sets the background color of the console." + }; + + const static openspace::properties::Property::PropertyInfo HighlightColorInfo = { + "HighlightColor", + "Highlight Color", + "Sets the color of the lines below the console." + }; + + const static openspace::properties::Property::PropertyInfo SeparatorColorInfo = { + "SeparatorColor", + "Separator Color", + "Sets the color of the separator between the history part and the entry part of " + "the console." + }; + + const static openspace::properties::Property::PropertyInfo EntryTextColorInfo = { + "EntryTextColor", + "Entry Text Color", + "Sets the text color of the entry area of the console." + }; + + const static openspace::properties::Property::PropertyInfo HistoryTextColorInfo = { + "HistoryTextColor", + "History Text Color", + "Sets the text color of the history area of the console." + }; + + const static openspace::properties::Property::PropertyInfo HistoryLengthInfo = { + "HistoryLength", + "History Length", + "Determines the length of the history in number of lines." + }; } // namespace namespace openspace { LuaConsole::LuaConsole() : properties::PropertyOwner("LuaConsole") - , _isVisible({ "IsVisible", "Is Visible", "" }, false) // @TODO Missing documentation - , _remoteScripting({ "RemoteScripting", "Remote scripting", "" }, false) // @TODO Missing documentation + , _isVisible(VisibleInfo, false) + , _remoteScripting(RemoveScriptingInfo, false) , _backgroundColor( - { "BackgroundColor", "Background Color", "" }, // @TODO Missing documentation + BackgroundColorInfo, glm::vec4(21.f / 255.f, 23.f / 255.f, 28.f / 255.f, 0.8f), glm::vec4(0.f), glm::vec4(1.f) ) , _highlightColor( - { "HighlightColor", "Highlight Color", "" }, // @TODO Missing documentation + HighlightColorInfo, glm::vec4(1.f, 1.f, 1.f, 0.f), glm::vec4(0.f), glm::vec4(1.f) ) , _separatorColor( - { "SeparatorColor", "Separator Color", "" }, // @TODO Missing documentation + SeparatorColorInfo, glm::vec4(0.4f, 0.4f, 0.4f, 0.f), glm::vec4(0.f), glm::vec4(1.f) ) , _entryTextColor( - { "EntryTextColor", "Entry Text Color", "" }, // @TODO Missing documentation + EntryTextColorInfo, glm::vec4(1.f, 1.f, 1.f, 1.f), glm::vec4(0.f), glm::vec4(1.f) ) , _historyTextColor( - { "HistoryTextColor", "History Text Color", "" }, // @TODO Missing documentation + HistoryTextColorInfo, glm::vec4(1.0f, 1.0f, 1.0f, 0.65f), glm::vec4(0.f), glm::vec4(1.f) ) - , _historyLength({ "HistoryLength", "History Length", "" }, 13, 0, 100) // @TODO Missing documentation + , _historyLength(HistoryLengthInfo, 13, 0, 100) , _inputPosition(0) , _activeCommand(0) , _autoCompleteInfo({NoAutoComplete, false, ""}) @@ -117,7 +168,6 @@ LuaConsole::LuaConsole() { addProperty(_isVisible); addProperty(_remoteScripting); - addProperty(_historyLength); _backgroundColor.setViewOption(properties::Property::ViewOptions::Color); @@ -219,7 +269,6 @@ void LuaConsole::initialize() { ghoul::fontrendering::Font::Outline::No ); - OsEng.parallelConnection().connectionEvent()->subscribe( "luaConsole", "statusChanged", @@ -576,7 +625,10 @@ void LuaConsole::update() { // Compute the height by simulating _historyFont number of lines and checking // what the bounding box for that text would be. using namespace ghoul::fontrendering; - size_t nLines = std::min(static_cast(_historyLength), _commandsHistory.size()); + const size_t nLines = std::min( + static_cast(_historyLength), + _commandsHistory.size() + ); const auto bbox = FontRenderer::defaultRenderer().boundingBox( *_historyFont, std::string(nLines, '\n').c_str() @@ -601,7 +653,6 @@ void LuaConsole::update() { _currentHeight = std::min(static_cast(res.y), _currentHeight); } - void LuaConsole::render() { using namespace ghoul::fontrendering; @@ -663,16 +714,17 @@ void LuaConsole::render() { // Render the current command std::string currentCommand = _commands.at(_activeCommand); - // We chop off the beginning and end of the string until it fits on the screen (with a margin) - // this should be replaced as soon as the mono-spaced fonts work properly. Right now, - // every third character is a bit wider than the others + // We chop off the beginning and end of the string until it fits on the screen (with + // a margin) this should be replaced as soon as the mono-spaced fonts work properly. + // Right now, every third character is a bit wider than the others size_t nChoppedCharsBeginning = 0, nChoppedCharsEnd = 0; const size_t inputPositionFromEnd = currentCommand.size() - _inputPosition; while (true) { + using namespace ghoul::fontrendering; // Compute the current width of the string and console prefix. - const float currentWidth = ghoul::fontrendering::FontRenderer::defaultRenderer().boundingBox( + const float currentWidth = FontRenderer::defaultRenderer().boundingBox( *_font, "> %s", currentCommand.c_str() @@ -690,7 +742,7 @@ void LuaConsole::render() { static_cast(currentCommand.size()) )); - // Do not hide the cursor and `NVisibleCharsAfterCursor` more characters in the end. + // Do not hide the cursor and `NVisibleCharsAfterCursor` characters in the end. const size_t maxAdditionalCharsToChopEnd = std::max( 0, static_cast(inputPositionFromEnd) - @@ -701,11 +753,15 @@ void LuaConsole::render() { // Do not hide the cursor in the beginning. const size_t maxAdditionalCharsToChopBeginning = std::max( 0, - static_cast(_inputPosition) - 1 - static_cast(nChoppedCharsBeginning) + static_cast(_inputPosition) - 1 - + static_cast(nChoppedCharsBeginning) ); // Prioritize chopping in the end of the string. - const size_t nCharsToChopEnd = std::min(nCharsOverflow, maxAdditionalCharsToChopEnd); + const size_t nCharsToChopEnd = std::min( + nCharsOverflow, + maxAdditionalCharsToChopEnd + ); const size_t nCharsToChopBeginning = std::min( nCharsOverflow - nCharsToChopEnd, maxAdditionalCharsToChopBeginning @@ -718,7 +774,10 @@ void LuaConsole::render() { _commands.at(_activeCommand).size() - nChoppedCharsBeginning - nChoppedCharsEnd; - currentCommand = _commands.at(_activeCommand).substr(nChoppedCharsBeginning, displayLength); + currentCommand = _commands.at(_activeCommand).substr( + nChoppedCharsBeginning, + displayLength + ); } RenderFontCr( diff --git a/src/interaction/navigationhandler.cpp b/src/interaction/navigationhandler.cpp index 835d19f1f7..29b722a239 100644 --- a/src/interaction/navigationhandler.cpp +++ b/src/interaction/navigationhandler.cpp @@ -46,6 +46,21 @@ namespace { const char* KeyFocus = "Focus"; const char* KeyPosition = "Position"; const char* KeyRotation = "Rotation"; + + static const openspace::properties::Property::PropertyInfo OriginInfo = { + "Origin", + "Origin", + "The name of the scene graph node that is the origin of the camera interaction. " + "The camera is always focussed on this object and every interaction is relative " + "towards this object. Any scene graph node can be the origin node." + }; + + static const openspace::properties::Property::PropertyInfo KeyFrameInfo = { + "UseKeyFrameInteraction", + "Use keyframe interaction", + "If this is set to 'true' the entire interaction is based off key frames rather " + "than using the mouse interaction." + }; } // namespace #include "navigationhandler_lua.inl" @@ -54,8 +69,8 @@ namespace openspace::interaction { NavigationHandler::NavigationHandler() : properties::PropertyOwner("NavigationHandler") - , _origin({ "Origin", "Origin", "" }) // @TODO Missing documentation - , _useKeyFrameInteraction({ "UseKeyFrameInteraction", "Use keyframe interaction", "" }, false) // @TODO Missing documentation + , _origin(OriginInfo) + , _useKeyFrameInteraction(KeyFrameInfo, false) { _origin.onChange([this]() { SceneGraphNode* node = sceneGraphNode(_origin.value()); @@ -77,15 +92,20 @@ NavigationHandler::NavigationHandler() addPropertySubOwner(*_orbitalNavigator); } -NavigationHandler::~NavigationHandler() -{ } +NavigationHandler::~NavigationHandler() {} void NavigationHandler::initialize() { - OsEng.parallelConnection().connectionEvent()->subscribe("NavigationHandler", "statusChanged", [this]() { - if (OsEng.parallelConnection().status() == ParallelConnection::Status::ClientWithHost) { - _useKeyFrameInteraction = true; + OsEng.parallelConnection().connectionEvent()->subscribe( + "NavigationHandler", + "statusChanged", + [this]() { + if (OsEng.parallelConnection().status() == + ParallelConnection::Status::ClientWithHost) + { + _useKeyFrameInteraction = true; + } } - }); + ); } void NavigationHandler::deinitialize() { diff --git a/src/interaction/orbitalnavigator.cpp b/src/interaction/orbitalnavigator.cpp index ca9ccb32d0..008c4c0a47 100644 --- a/src/interaction/orbitalnavigator.cpp +++ b/src/interaction/orbitalnavigator.cpp @@ -35,15 +35,54 @@ namespace { const char* _loggerCat = "OrbitalNavigator"; + + static const openspace::properties::Property::PropertyInfo RollFrictionInfo = { + "RollFriction", + "Roll Friction", + "If this is enabled, a small friction is applied to the rolling part of the " + "camera motion, thus slowing it down within a small time period. If this value " + "is disabled, the camera will roll forever." + }; + + static const openspace::properties::Property::PropertyInfo RotationalFrictionInfo = { + "RotationalFriction", + "Rotational Friction", + "If this is enabled, a small friction is applied to the rotational part of the " + "camera motion, thus slowing it down within a small time period. If this value " + "is disabled, the camera will rotate forever." + }; + + static const openspace::properties::Property::PropertyInfo ZoomFrictionInfo = { + "ZoomFriction", + "Zoom Friction", + "If this is enabled, a small friction is applied to the zoom part of the camera " + "motion, thus slowing it down within a small time period. If this value is " + "disabled, the camera will zoom in or out forever." + }; + + static const openspace::properties::Property::PropertyInfo SensitivityInfo = { + "Sensitivity", + "Sensitivity", + "Determines the sensitivity of the camera motion. The lower the sensitivity is " + "the less impact a mouse mothion will have." + }; + + static const openspace::properties::Property::PropertyInfo FrictionInfo = { + "Friction", + "Friction Factor", + "Determines the factor that is applied if the 'Roll Friction', 'Rotational " + "Friction', and 'Zoom Friction' values are enabled. The lower this value is, the " + "faster the camera movements will stop." + }; } // namespace namespace openspace::interaction { OrbitalNavigator::OrbitalNavigator() : properties::PropertyOwner("OrbitalNavigator") - , _rotationalFriction({ "RotationalFriction", "Rotational friction", "" }, true) // @TODO Missing documentation - , _horizontalFriction({ "HorizontalFriction", "Horizontal friction", "" }, true) // @TODO Missing documentation - , _verticalFriction({ "VerticalFriction", "Vertical friction", "" }, true) // @TODO Missing documentation + , _rollFriction(RollFrictionInfo, true) + , _rotationalFriction(RotationalFrictionInfo, true) + , _zoomFriction(ZoomFrictionInfo, true) , _followFocusNodeRotationDistance( { "FollowFocusNodeRotationDistance", "Follow focus node rotation distance", "" }, // @TODO Missing documentation 2.0f, 0.0f, 10.f @@ -51,8 +90,8 @@ OrbitalNavigator::OrbitalNavigator() , _minimumAllowedDistance( {"MinimumAllowedDistance", "Minimum allowed distance", "" }, // @TODO Missing documentation 10.0f, 0.0f, 10000.f) - , _sensitivity({ "Sensitivity", "Sensitivity", "" }, 20.0f, 1.0f, 50.f) // @TODO Missing documentation - , _motionLag({ "MotionLag", "Motion lag", "" }, 0.5f, 0.f, 1.f) // @TODO Missing documentation + , _sensitivity(SensitivityInfo, 20.0f, 1.0f, 50.f) + , _motionLag(FrictionInfo, 0.5f, 0.f, 1.f) , _mouseStates(_sensitivity * pow(10.0,-4), 1 / (_motionLag + 0.0000001)) { auto smoothStep = @@ -84,14 +123,14 @@ OrbitalNavigator::OrbitalNavigator() _rotateToFocusNodeInterpolator.setTransferFunction(smoothStepDerivedTranferFunction); // Define callback functions for changed properties + _rollFriction.onChange([&]() { + _mouseStates.setRotationalFriction(_rollFriction); + }); _rotationalFriction.onChange([&]() { - _mouseStates.setRotationalFriction(_rotationalFriction); + _mouseStates.setHorizontalFriction(_rotationalFriction); }); - _horizontalFriction.onChange([&]() { - _mouseStates.setHorizontalFriction(_horizontalFriction); - }); - _verticalFriction.onChange([&]() { - _mouseStates.setVerticalFriction(_verticalFriction); + _zoomFriction.onChange([&]() { + _mouseStates.setVerticalFriction(_zoomFriction); }); _sensitivity.onChange([&]() { _mouseStates.setSensitivity(_sensitivity * pow(10.0,-4)); @@ -101,9 +140,9 @@ OrbitalNavigator::OrbitalNavigator() }); // Add the properties + addProperty(_rollFriction); addProperty(_rotationalFriction); - addProperty(_horizontalFriction); - addProperty(_verticalFriction); + addProperty(_zoomFriction); addProperty(_followFocusNodeRotationDistance); addProperty(_minimumAllowedDistance); addProperty(_sensitivity); diff --git a/src/network/parallelconnection.cpp b/src/network/parallelconnection.cpp index 45ac3c0f9c..aa12b3ddfb 100644 --- a/src/network/parallelconnection.cpp +++ b/src/network/parallelconnection.cpp @@ -81,17 +81,51 @@ namespace { const uint32_t ProtocolVersion = 2; const size_t MaxLatencyDiffs = 64; const char* _loggerCat = "ParallelConnection"; + + static const openspace::properties::Property::PropertyInfo PasswordInfo = { + "Password", + "Password", + "The general password that allows this OpenSpace instance access to the Wormhole " + "server." + }; + + static const openspace::properties::Property::PropertyInfo HostPasswordInfo = { + "HostPassword", + "Host Password", + "The password that is required to take control of the joint session and thus " + "send all commands to connected clients." + }; + + static const openspace::properties::Property::PropertyInfo PortInfo = { + "Port", + "Port", + "The port on which the Wormhole server is listening to connections from " + "OpenSpace." + }; + + static const openspace::properties::Property::PropertyInfo AddressInfo = { + "Address", + "Address", + "The address of the Wormhole server either as a DNS name or an IP address." + }; + + static const openspace::properties::Property::PropertyInfo NameInfo = { + "Name", + "Connection Name", + "The name of this OpenSpace instance that will be potentially broadcast to other " + "connected instances." + }; } // namespace namespace openspace { ParallelConnection::ParallelConnection() : properties::PropertyOwner("ParallelConnection") - , _password({ "Password", "Password", "" }) // @TODO Missing documentation - , _hostPassword({ "HostPassword", "Host Password", "" }) // @TODO Missing documentation - , _port({ "Port", "Port", "" }, "20501") // @TODO Missing documentation - , _address({ "Address", "Address", "" }, "localhost") // @TODO Missing documentation - , _name({ "Name", "Connection name", "" }, "Anonymous") // @TODO Missing documentation + , _password(PasswordInfo) + , _hostPassword(HostPasswordInfo) + , _port(PortInfo, "20501") + , _address(AddressInfo, "localhost") + , _name(NameInfo, "Anonymous") , _bufferTime({ "BufferTime", "Buffer Time", "" }, 1, 0.5, 10) // @TODO Missing documentation , _timeKeyframeInterval( { "TimeKeyframeInterval", "Time keyframe interval", ""}, // @TODO Missing documentation diff --git a/src/rendering/renderable.cpp b/src/rendering/renderable.cpp index dd2c012c99..75c3a27bc9 100644 --- a/src/rendering/renderable.cpp +++ b/src/rendering/renderable.cpp @@ -42,6 +42,12 @@ namespace { const char* keyEnd = "EndTime"; const char* KeyType = "Type"; const char* KeyTag = "Tag"; + + static const openspace::properties::Property::PropertyInfo EnabledInfo = { + "Enabled", + "Is Enabled", + "This setting determines whether this object will be visible or not." + }; } // namespace namespace openspace { @@ -91,18 +97,18 @@ std::unique_ptr Renderable::createFromDictionary( return result; } -Renderable::Renderable() - : properties::PropertyOwner("renderable") - , _enabled({ "Enabled", "Is Enabled", "" }, true) // @TODO Missing documentation - , _renderBin(RenderBin::Opaque) - , _startTime("") - , _endTime("") - , _hasTimeInterval(false) -{} +//Renderable::Renderable() +// : properties::PropertyOwner("renderable") +// , _enabled(EnabledInfo, true) +// , _renderBin(RenderBin::Opaque) +// , _startTime("") +// , _endTime("") +// , _hasTimeInterval(false) +//{} Renderable::Renderable(const ghoul::Dictionary& dictionary) : properties::PropertyOwner("renderable") - , _enabled({ "Enabled", "Is Enabled", "" }, true) // @TODO Missing documentation + , _enabled(EnabledInfo, true) , _renderBin(RenderBin::Opaque) , _startTime("") , _endTime("")