From 7ec6c247cc864087f109eab65f2e203e9128b1c0 Mon Sep 17 00:00:00 2001 From: Ylva Selling Date: Thu, 21 Jul 2022 12:38:59 -0400 Subject: [PATCH] Fix comments on PR --- modules/globebrowsing/globebrowsingmodule.cpp | 4 ++-- modules/server/include/topics/cameratopic.h | 6 +++--- modules/server/servermodule.cpp | 1 + modules/server/src/topics/cameratopic.cpp | 13 +++++-------- 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/modules/globebrowsing/globebrowsingmodule.cpp b/modules/globebrowsing/globebrowsingmodule.cpp index 3454f2d394..8ddd928cb3 100644 --- a/modules/globebrowsing/globebrowsingmodule.cpp +++ b/modules/globebrowsing/globebrowsingmodule.cpp @@ -426,11 +426,11 @@ glm::dvec3 GlobeBrowsingModule::geoPosition() const { const SceneGraphNode* n = global::navigationHandler->orbitalNavigator().anchorNode(); if (!n) { - return glm::dvec3(0); + return glm::dvec3(0.0); } const RenderableGlobe* globe = dynamic_cast(n->renderable()); if (!globe) { - return glm::dvec3(0); + return glm::dvec3(0.0); } const glm::dvec3 cameraPosition = global::navigationHandler->camera()->positionVec3(); diff --git a/modules/server/include/topics/cameratopic.h b/modules/server/include/topics/cameratopic.h index e06778a1ea..0a96378fb5 100644 --- a/modules/server/include/topics/cameratopic.h +++ b/modules/server/include/topics/cameratopic.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_SERVER___CAMERA_TOPIC___H__ -#define __OPENSPACE_MODULE_SERVER___CAMERA_TOPIC___H__ +#ifndef __OPENSPACE_MODULE_SERVER___CAMERATOPIC___H__ +#define __OPENSPACE_MODULE_SERVER___CAMERATOPIC___H__ #include #include @@ -53,4 +53,4 @@ private: } // namespace openspace -#endif // __OPENSPACE_MODULE_SERVER___CAMERA_TOPIC___H__ +#endif // __OPENSPACE_MODULE_SERVER___CAMERATOPIC___H__ diff --git a/modules/server/servermodule.cpp b/modules/server/servermodule.cpp index 142cc91360..e050d98776 100644 --- a/modules/server/servermodule.cpp +++ b/modules/server/servermodule.cpp @@ -24,6 +24,7 @@ #include +#include #include #include #include diff --git a/modules/server/src/topics/cameratopic.cpp b/modules/server/src/topics/cameratopic.cpp index 13c8914c60..cf1a7fe8df 100644 --- a/modules/server/src/topics/cameratopic.cpp +++ b/modules/server/src/topics/cameratopic.cpp @@ -46,7 +46,8 @@ using nlohmann::json; namespace openspace { CameraTopic::CameraTopic() - : _lastUpdateTime(std::chrono::system_clock::now()) {} + : _lastUpdateTime(std::chrono::system_clock::now()) +{} CameraTopic::~CameraTopic() { if (_dataCallbackHandle != UnsetOnChangeHandle) { @@ -63,10 +64,6 @@ bool CameraTopic::isDone() const { void CameraTopic::handleJson(const nlohmann::json& json) { std::string event = json.at(EventKey).get(); - if (event == UnsubscribeEvent) { - _isDone = true; - return; - } if (event != SubscribeEvent) { _isDone = true; @@ -90,13 +87,13 @@ void CameraTopic::sendCameraData() { GlobeBrowsingModule* module = global::moduleEngine->module(); glm::dvec3 position = module->geoPosition(); - std::pair altSimplified = simplifyDistance(position.z); + std::pair altSimplified = simplifyDistance(position.z); nlohmann::json jsonData = { - { "latitude", position.x}, + { "latitude", position.x }, { "longitude", position.y }, { "altitude", altSimplified.first }, - { "altitudeUnit", altSimplified.second} + { "altitudeUnit", altSimplified.second } }; _connection->sendJson(wrappedPayload(jsonData));