diff --git a/modules/skybrowser/include/renderableskytarget.h b/modules/skybrowser/include/renderableskytarget.h index cf11909c90..1cc6972253 100644 --- a/modules/skybrowser/include/renderableskytarget.h +++ b/modules/skybrowser/include/renderableskytarget.h @@ -55,6 +55,8 @@ public: void highlight(const glm::ivec3& addition); void removeHighlight(const glm::ivec3& removal); + static documentation::Documentation Documentation(); + private: // Properties properties::FloatProperty _crossHairSize; diff --git a/modules/skybrowser/include/screenspaceskybrowser.h b/modules/skybrowser/include/screenspaceskybrowser.h index 55bf41a163..3156fb2022 100644 --- a/modules/skybrowser/include/screenspaceskybrowser.h +++ b/modules/skybrowser/include/screenspaceskybrowser.h @@ -64,6 +64,8 @@ public: std::vector> displayCopies() const; std::vector> showDisplayCopies() const; + static documentation::Documentation Documentation(); + private: properties::FloatProperty _textureQuality; properties::BoolProperty _isHidden; diff --git a/modules/skybrowser/include/targetbrowserpair.h b/modules/skybrowser/include/targetbrowserpair.h index 8b8e374822..1dffd0b3ac 100644 --- a/modules/skybrowser/include/targetbrowserpair.h +++ b/modules/skybrowser/include/targetbrowserpair.h @@ -104,7 +104,7 @@ public: void removeSelectedImage(int i); void loadImageCollection(const std::string& collection); void setImageOpacity(int i, float opacity); - void hideChromeInterface(bool shouldHide); + void hideChromeInterface(); friend bool operator==(const TargetBrowserPair& lhs, const TargetBrowserPair& rhs); friend bool operator!=(const TargetBrowserPair& lhs, const TargetBrowserPair& rhs); diff --git a/modules/skybrowser/include/wwtcommunicator.h b/modules/skybrowser/include/wwtcommunicator.h index 9966b09a68..cc31569cf6 100644 --- a/modules/skybrowser/include/wwtcommunicator.h +++ b/modules/skybrowser/include/wwtcommunicator.h @@ -50,7 +50,7 @@ public: void setImageOrder(int i, int order); void loadImageCollection(const std::string& collection); void setImageOpacity(int i, float opacity); - void hideChromeInterface(bool shouldHide) const; + void hideChromeInterface() const; bool isImageCollectionLoaded() const; diff --git a/modules/skybrowser/skybrowsermodule.cpp b/modules/skybrowser/skybrowsermodule.cpp index d1baf9f3dc..a3e6f05eef 100644 --- a/modules/skybrowser/skybrowsermodule.cpp +++ b/modules/skybrowser/skybrowsermodule.cpp @@ -509,6 +509,13 @@ void SkyBrowserModule::removePreSyncCallback(CallbackHandle handle) { _preSyncCallbacks.erase(it); } +std::vector SkyBrowserModule::documentations() const { + return { + RenderableSkyTarget::Documentation(), + ScreenSpaceSkyBrowser::Documentation() + }; +} + scripting::LuaLibrary SkyBrowserModule::luaLibrary() const { return { "skybrowser", diff --git a/modules/skybrowser/skybrowsermodule.h b/modules/skybrowser/skybrowsermodule.h index 05d8d4def6..938ead2185 100644 --- a/modules/skybrowser/skybrowsermodule.h +++ b/modules/skybrowser/skybrowsermodule.h @@ -93,7 +93,7 @@ public: void removePreSyncCallback(CallbackHandle handle); scripting::LuaLibrary luaLibrary() const override; - //std::vector documentations() const override; + std::vector documentations() const override; protected: void internalInitialize(const ghoul::Dictionary& dict) override; diff --git a/modules/skybrowser/skybrowsermodule_lua.inl b/modules/skybrowser/skybrowsermodule_lua.inl index 74e50ed8a8..811bc881a8 100644 --- a/modules/skybrowser/skybrowsermodule_lua.inl +++ b/modules/skybrowser/skybrowsermodule_lua.inl @@ -140,7 +140,7 @@ namespace { SkyBrowserModule* module = global::moduleEngine->module(); TargetBrowserPair* pair = module->pair(identifier); if (pair) { - pair->hideChromeInterface(true); + pair->hideChromeInterface(); pair->loadImageCollection(module->wwtImageCollectionUrl()); } } @@ -640,12 +640,12 @@ namespace { /** * Takes an identifier to a sky browser and adds a rendered copy to it. The first argument - * is the position of the first copy. The position is in RAE or Cartesian coordinates, - * depending on if 'Use Radius Azimuth Elevation' is checked. The second argument is the - * number of copies. If RAE is used, they will be evenly spread out on the azimuth. + * is the position of the first copy. The position is in RAE or Cartesian coordinates, + * depending on if 'Use Radius Azimuth Elevation' is checked. The second argument is the + * number of copies. If RAE is used, they will be evenly spread out on the azimuth. */ [[codegen::luawrap]] void addDisplayCopy(std::string identifier, int numberOfCopies = 1, - glm::vec3 position = glm::vec3(2.1f, 0.f, 0.f)) + glm::vec3 position = glm::vec3(2.1f, 0.f, 0.f)) { using namespace openspace; @@ -704,7 +704,7 @@ namespace { } /** - * Sets the image collection as loaded in the sky browser. Takes an identifier to the sky + * Sets the image collection as loaded in the sky browser. Takes an identifier to the sky * browser. */ [[codegen::luawrap]] void loadingImageCollectionComplete(std::string identifier) { @@ -742,7 +742,7 @@ namespace { } /** - * Point spacecraft to the equatorial coordinates the target points to. Takes an + * Point spacecraft to the equatorial coordinates the target points to. Takes an * identifier to a sky browser. */ [[codegen::luawrap]] void pointSpaceCraft(std::string identifier) { diff --git a/modules/skybrowser/src/renderableskytarget.cpp b/modules/skybrowser/src/renderableskytarget.cpp index bef23e70bd..0250b2b819 100644 --- a/modules/skybrowser/src/renderableskytarget.cpp +++ b/modules/skybrowser/src/renderableskytarget.cpp @@ -85,6 +85,10 @@ namespace { namespace openspace { +documentation::Documentation RenderableSkyTarget::Documentation() { + return codegen::doc("skybrowser_renderableskytarget"); +} + RenderableSkyTarget::RenderableSkyTarget(const ghoul::Dictionary& dictionary) : RenderablePlane(dictionary) , _crossHairSize(crossHairSizeInfo, 2.f, 1.f, 10.f) diff --git a/modules/skybrowser/src/screenspaceskybrowser.cpp b/modules/skybrowser/src/screenspaceskybrowser.cpp index 144730e82d..6ec25e6b7c 100644 --- a/modules/skybrowser/src/screenspaceskybrowser.cpp +++ b/modules/skybrowser/src/screenspaceskybrowser.cpp @@ -97,6 +97,10 @@ namespace { namespace openspace { +documentation::Documentation ScreenSpaceSkyBrowser::Documentation() { + return codegen::doc("skybrowser_screenspaceskybrowser"); +} + ScreenSpaceSkyBrowser::ScreenSpaceSkyBrowser(const ghoul::Dictionary& dictionary) : ScreenSpaceRenderable(dictionary) , WwtCommunicator(dictionary) diff --git a/modules/skybrowser/src/targetbrowserpair.cpp b/modules/skybrowser/src/targetbrowserpair.cpp index 80acc1f137..31af265375 100644 --- a/modules/skybrowser/src/targetbrowserpair.cpp +++ b/modules/skybrowser/src/targetbrowserpair.cpp @@ -130,7 +130,7 @@ void TargetBrowserPair::initialize() { glm::vec2 dim = _browser->screenSpaceDimensions(); _targetRenderable->setRatio(dim.x / dim.y); _browser->updateBorderColor(); - _browser->hideChromeInterface(true); + _browser->hideChromeInterface(); _browser->setIsInitialized(true); } @@ -196,7 +196,7 @@ ghoul::Dictionary TargetBrowserPair::dataAsDictionary() const { res.setValue("selectedImages", selectedImages()); res.setValue("scale", static_cast(_browser->scale())); res.setValue("opacities", _browser->opacities()); - + std::vector> copies = displayCopies(); std::vector> showCopies = _browser->showDisplayCopies(); ghoul::Dictionary copiesData; @@ -241,8 +241,8 @@ void TargetBrowserPair::setImageOpacity(int i, float opacity) { _browser->setImageOpacity(i, opacity); } -void TargetBrowserPair::hideChromeInterface(bool shouldHide) { - _browser->hideChromeInterface(shouldHide); +void TargetBrowserPair::hideChromeInterface() { + _browser->hideChromeInterface(); } void TargetBrowserPair::sendIdToBrowser() const { diff --git a/modules/skybrowser/src/wwtcommunicator.cpp b/modules/skybrowser/src/wwtcommunicator.cpp index 20f52730d3..a854f6f2d7 100644 --- a/modules/skybrowser/src/wwtcommunicator.cpp +++ b/modules/skybrowser/src/wwtcommunicator.cpp @@ -180,7 +180,7 @@ void WwtCommunicator::setImageOpacity(int i, float opacity) { sendMessageToWwt(msg); } -void WwtCommunicator::hideChromeInterface(bool shouldHide) const { +void WwtCommunicator::hideChromeInterface() const { std::string script = "sendMessageToWWT({event : \"modify_settings\", " "settings : [[\"hideAllChrome\", true]], target: \"app\"});"; executeJavascript(script);