From 694c883418bc69f707433cd59ffc2a462d4d4636 Mon Sep 17 00:00:00 2001 From: Emma Broman Date: Tue, 26 Apr 2022 09:44:13 +0200 Subject: [PATCH] Whitespace cleanup --- modules/skybrowser/include/utility.h | 10 ++-- modules/skybrowser/skybrowsermodule_lua.inl | 52 +++++++++---------- modules/skybrowser/src/browser.cpp | 2 +- .../skybrowser/src/screenspaceskybrowser.cpp | 4 +- modules/skybrowser/src/utility.cpp | 2 +- modules/skybrowser/src/wwtcommunicator.cpp | 14 ++--- 6 files changed, 42 insertions(+), 42 deletions(-) diff --git a/modules/skybrowser/include/utility.h b/modules/skybrowser/include/utility.h index 07e42c811a..56529a8837 100644 --- a/modules/skybrowser/include/utility.h +++ b/modules/skybrowser/include/utility.h @@ -207,21 +207,21 @@ public: { _animationTime = std::chrono::milliseconds(static_cast(time * 1000)); } - + void start() { _isStarted = true; _startTime = std::chrono::system_clock::now(); } - + void stop() { _isStarted = false; } - + bool isAnimating() const { bool timeLeft = timeSpent().count() < _animationTime.count() ? true : false; return timeLeft && _isStarted; } - + T getNewValue(); glm::dmat4 getRotationMatrix(); @@ -231,7 +231,7 @@ private: std::chrono::duration timeSpent = now - _startTime; return timeSpent; } - + double percentageSpent() const { return timeSpent().count() / _animationTime.count(); } diff --git a/modules/skybrowser/skybrowsermodule_lua.inl b/modules/skybrowser/skybrowsermodule_lua.inl index 3ec1462d7c..ce32f45c82 100644 --- a/modules/skybrowser/skybrowsermodule_lua.inl +++ b/modules/skybrowser/skybrowsermodule_lua.inl @@ -44,7 +44,7 @@ namespace { */ [[codegen::luawrap]] void selectImage(int imageIndex) { using namespace openspace; - + // Load image SkyBrowserModule* module = global::moduleEngine->module(); @@ -88,7 +88,7 @@ namespace { */ [[codegen::luawrap]] void setHoverCircle(std::string identifier) { using namespace openspace; - + SceneGraphNode* circle = global::renderEngine->scene()->sceneGraphNode(identifier); global::moduleEngine->module()->setHoverCircle(circle); } @@ -98,7 +98,7 @@ namespace { */ [[codegen::luawrap]] void moveCircleToHoverImage(int imageIndex) { using namespace openspace; - + global::moduleEngine->module()->moveHoverCircle(imageIndex); } @@ -107,7 +107,7 @@ namespace { */ [[codegen::luawrap]] void disableHoverCircle() { using namespace openspace; - + global::moduleEngine->module()->disableHoverCircle(); } @@ -137,7 +137,7 @@ namespace { */ [[codegen::luawrap]] void loadImagesToWWT(std::string identifier) { using namespace openspace; - + // Load images from url LINFO("Connection established to WorldWide Telescope application in " + identifier); LINFO("Loading image collections to " + identifier); @@ -160,7 +160,7 @@ namespace { */ [[codegen::luawrap]] void startSetup() { using namespace openspace; - + // This is called when the sky_browser website is connected to OpenSpace // Set all border colors to the border color in the master node if (global::windowDelegate->isMaster()) { @@ -193,7 +193,7 @@ namespace { */ [[codegen::luawrap]] void sendOutIdsToBrowsers() { using namespace openspace; - + // This is called when the sky_browser website is connected to OpenSpace // Send out identifiers to the browsers SkyBrowserModule* module = global::moduleEngine->module(); @@ -211,7 +211,7 @@ namespace { */ [[codegen::luawrap]] void initializeBrowser(std::string identifier) { using namespace openspace; - + // Initialize browser with ID and its corresponding target LINFO("Initializing sky browser " + identifier); SkyBrowserModule* module = global::moduleEngine->module(); @@ -245,7 +245,7 @@ namespace { */ [[codegen::luawrap]] ghoul::Dictionary getListOfImages() { using namespace openspace; - + // Send image list to GUI SkyBrowserModule* module = global::moduleEngine->module(); @@ -292,7 +292,7 @@ namespace { */ [[codegen::luawrap]] ghoul::Dictionary getTargetData() { using namespace openspace; - + SkyBrowserModule* module = global::moduleEngine->module(); ghoul::Dictionary data; @@ -372,7 +372,7 @@ namespace { */ [[codegen::luawrap]] void adjustCamera(std::string id) { using namespace openspace; - + SkyBrowserModule* module = global::moduleEngine->module(); if (module->isCameraInSolarSystem()) { module->lookAtTarget(id); @@ -387,7 +387,7 @@ namespace { float opacity) { using namespace openspace; - + SkyBrowserModule* module = global::moduleEngine->module(); TargetBrowserPair* pair = module->getPair(identifier); if (pair) { @@ -401,7 +401,7 @@ namespace { */ [[codegen::luawrap]] void centerTargetOnScreen(std::string identifier) { using namespace openspace; - + SkyBrowserModule* module = global::moduleEngine->module(); TargetBrowserPair* pair = module->getPair(identifier); if (pair) { @@ -415,7 +415,7 @@ namespace { */ [[codegen::luawrap]] void setSelectedBrowser(std::string identifier) { using namespace openspace; - + global::moduleEngine->module()->setSelectedBrowser(identifier); } @@ -424,7 +424,7 @@ namespace { */ [[codegen::luawrap]] void createTargetBrowserPair() { using namespace openspace; - + SkyBrowserModule* module = global::moduleEngine->module(); int noOfPairs = module->nPairs(); @@ -510,7 +510,7 @@ namespace { */ [[codegen::luawrap]] void removeTargetBrowserPair(std::string identifier) { using namespace openspace; - + SkyBrowserModule* module = global::moduleEngine->module(); TargetBrowserPair* found = module->getPair(identifier); if (found) { @@ -543,7 +543,7 @@ namespace { float translationY) { using namespace openspace; - + ScreenSpaceRenderable* renderable = global::renderEngine->screenSpaceRenderable(identifier); @@ -562,7 +562,7 @@ namespace { int imageIndex) { using namespace openspace; - + SkyBrowserModule* module = global::moduleEngine->module(); const ImageData& image = module->getWwtDataHandler()->getImage(imageIndex); @@ -581,7 +581,7 @@ namespace { double declination) { using namespace openspace; - + SkyBrowserModule* module = global::moduleEngine->module(); TargetBrowserPair* pair = module->getPair(identifier); if (pair) { @@ -597,7 +597,7 @@ namespace { float verticalFieldOfView) { using namespace openspace; - + SkyBrowserModule* module = global::moduleEngine->module(); TargetBrowserPair* pair = module->getPair(identifier); if (pair) { @@ -611,7 +611,7 @@ namespace { */ [[codegen::luawrap]] void scrollOverBrowser(std::string identifier, float scroll) { using namespace openspace; - + SkyBrowserModule* module = global::moduleEngine->module(); TargetBrowserPair* pair = module->getPair(identifier); if (pair) { @@ -627,7 +627,7 @@ namespace { int blue) { using namespace openspace; - + SkyBrowserModule* module = global::moduleEngine->module(); TargetBrowserPair* pair = module->getPair(identifier); if (pair) { @@ -643,7 +643,7 @@ namespace { float sizeY) { using namespace openspace; - + SkyBrowserModule* module = global::moduleEngine->module(); TargetBrowserPair* pair = module->getPair(identifier); if (pair) { @@ -661,7 +661,7 @@ namespace { glm::vec3 radiusAzimuthElevationPosition = glm::vec3(2.1f, 0.f, 0.f)) { using namespace openspace; - + SkyBrowserModule* module = global::moduleEngine->module(); TargetBrowserPair* pair = module->getPair(identifier); if (pair) { @@ -674,7 +674,7 @@ namespace { */ [[codegen::luawrap]] void removeRenderCopy(std::string identifier) { using namespace openspace; - + SkyBrowserModule* module = global::moduleEngine->module(); TargetBrowserPair* pair = module->getPair(identifier); if (pair) { @@ -687,7 +687,7 @@ namespace { */ [[codegen::luawrap]] void startFinetuningTarget(std::string identifier) { using namespace openspace; - + SkyBrowserModule* module = global::moduleEngine->module(); TargetBrowserPair* pair = module->getPair(identifier); if (pair) { diff --git a/modules/skybrowser/src/browser.cpp b/modules/skybrowser/src/browser.cpp index ebe2782450..2a5e70566b 100644 --- a/modules/skybrowser/src/browser.cpp +++ b/modules/skybrowser/src/browser.cpp @@ -92,7 +92,7 @@ Browser::Browser(const ghoul::Dictionary& dictionary) if (dictionary.hasValue(UrlInfo.identifier)) { _url = dictionary.value(UrlInfo.identifier); } - + // Handle target dimension property const Parameters p = codegen::bake(dictionary); _url = p.url.value_or(_url); diff --git a/modules/skybrowser/src/screenspaceskybrowser.cpp b/modules/skybrowser/src/screenspaceskybrowser.cpp index 8c64b2af82..1480f4c222 100644 --- a/modules/skybrowser/src/screenspaceskybrowser.cpp +++ b/modules/skybrowser/src/screenspaceskybrowser.cpp @@ -125,8 +125,8 @@ ScreenSpaceSkyBrowser::ScreenSpaceSkyBrowser(const ghoul::Dictionary& dictionary _useRadiusAzimuthElevation.onChange([this]() { std::for_each( - _renderCopies.begin(), - _renderCopies.end(), + _renderCopies.begin(), + _renderCopies.end(), [this](std::unique_ptr& copy) { if (_useRadiusAzimuthElevation) { *copy = sphericalToRae(cartesianToSpherical(copy.get()->value())); diff --git a/modules/skybrowser/src/utility.cpp b/modules/skybrowser/src/utility.cpp index 0f1bea8397..906a484eb9 100644 --- a/modules/skybrowser/src/utility.cpp +++ b/modules/skybrowser/src/utility.cpp @@ -236,7 +236,7 @@ glm::dmat4 Animation::getRotationMatrix() { if (!isAnimating()) { return glm::dmat4(1.0); } - + double percentage = easeInOutSine(percentageSpent()); double increment = percentage - _lastPercentage; _lastPercentage = percentage; diff --git a/modules/skybrowser/src/wwtcommunicator.cpp b/modules/skybrowser/src/wwtcommunicator.cpp index 227600c9e1..c334b8aec5 100644 --- a/modules/skybrowser/src/wwtcommunicator.cpp +++ b/modules/skybrowser/src/wwtcommunicator.cpp @@ -211,7 +211,7 @@ ghoul::Dictionary WwtCommunicator::moveCameraMessage(const glm::dvec2& celestCoo bool shouldMoveInstantly) const { using namespace std::string_literals; - + ghoul::Dictionary msg; msg.setValue("event", "center_on_coordinates"s); msg.setValue("ra", celestCoords.x); @@ -224,7 +224,7 @@ ghoul::Dictionary WwtCommunicator::moveCameraMessage(const glm::dvec2& celestCoo ghoul::Dictionary WwtCommunicator::loadCollectionMessage(const std::string& url) const { using namespace std::string_literals; - + ghoul::Dictionary msg; msg.setValue("event", "load_image_collection"s); msg.setValue("url", url); @@ -234,7 +234,7 @@ ghoul::Dictionary WwtCommunicator::loadCollectionMessage(const std::string& url) ghoul::Dictionary WwtCommunicator::setForegroundMessage(const std::string& name) const { using namespace std::string_literals; - + ghoul::Dictionary msg; msg.setValue("event", "set_foreground_by_name"s); msg.setValue("name", name); @@ -245,7 +245,7 @@ ghoul::Dictionary WwtCommunicator::addImageMessage(const std::string& id, const std::string& url) const { using namespace std::string_literals; - + ghoul::Dictionary msg; msg.setValue("event", "image_layer_create"s); msg.setValue("id", id); @@ -257,7 +257,7 @@ ghoul::Dictionary WwtCommunicator::addImageMessage(const std::string& id, ghoul::Dictionary WwtCommunicator::removeImageMessage(const std::string& imageId) const { using namespace std::string_literals; - + ghoul::Dictionary msg; msg.setValue("event", "image_layer_remove"s); msg.setValue("id", imageId); @@ -268,7 +268,7 @@ ghoul::Dictionary WwtCommunicator::setImageOpacityMessage(const std::string& ima double opacity) const { using namespace std::string_literals; - + ghoul::Dictionary msg; msg.setValue("event", "image_layer_set"s); msg.setValue("id", imageId); @@ -282,7 +282,7 @@ ghoul::Dictionary WwtCommunicator::setLayerOrderMessage(const std::string& id, i // The lower the layer order, the more towards the back the image is placed // 0 is the background using namespace std::string_literals; - + ghoul::Dictionary msg; msg.setValue("event", "image_layer_order"s); msg.setValue("id", id);