mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-25 05:48:59 -05:00
Properly disable appropriate code when compiled without globebrowsing support (closes #3146)
This commit is contained in:
@@ -24,8 +24,10 @@
|
||||
|
||||
#include <modules/imgui/include/guiglobebrowsingcomponent.h>
|
||||
|
||||
#ifdef OPENSPACE_MODULE_SPACE_ENABLED
|
||||
#include <modules/globebrowsing/globebrowsingmodule.h>
|
||||
#include <modules/globebrowsing/src/renderableglobe.h>
|
||||
#endif // OPENSPACE_MODULE_SPACE_ENABLED
|
||||
#include <modules/imgui/include/imgui_include.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/engine/moduleengine.h>
|
||||
@@ -50,6 +52,7 @@ GuiGlobeBrowsingComponent::GuiGlobeBrowsingComponent()
|
||||
{}
|
||||
|
||||
void GuiGlobeBrowsingComponent::render() {
|
||||
#ifdef OPENSPACE_MODULE_SPACE_ENABLED
|
||||
GlobeBrowsingModule* module = global::moduleEngine->module<GlobeBrowsingModule>();
|
||||
using UrlInfo = GlobeBrowsingModule::UrlInfo;
|
||||
using Capabilities = GlobeBrowsingModule::Capabilities;
|
||||
@@ -368,6 +371,9 @@ void GuiGlobeBrowsingComponent::render() {
|
||||
ImGui::PopID();
|
||||
}
|
||||
ImGui::Columns(1);
|
||||
#else // ^^^ OPENSPACE_MODULE_SPACE_ENABLED ||| !OPENSPACE_MODULE_SPACE_ENABLED vvv
|
||||
ImGui::Text("%s", "OpenSpace compiled without GlobeBrowsing support");
|
||||
#endif // OPENSPACE_MODULE_SPACE_ENABLED
|
||||
}
|
||||
|
||||
} // namespace openspace::gui
|
||||
|
||||
@@ -24,7 +24,9 @@
|
||||
|
||||
#include <modules/server/include/topics/cameratopic.h>
|
||||
|
||||
#ifdef OPENSPACE_MODULE_SPACE_ENABLED
|
||||
#include <modules/globebrowsing/globebrowsingmodule.h>
|
||||
#endif // OPENSPACE_MODULE_SPACE_ENABLED
|
||||
#include <modules/server/include/connection.h>
|
||||
#include <modules/server/servermodule.h>
|
||||
#include <openspace/engine/moduleengine.h>
|
||||
@@ -79,6 +81,7 @@ void CameraTopic::handleJson(const nlohmann::json& json) {
|
||||
}
|
||||
|
||||
void CameraTopic::sendCameraData() {
|
||||
#ifdef OPENSPACE_MODULE_SPACE_ENABLED
|
||||
GlobeBrowsingModule* module = global::moduleEngine->module<GlobeBrowsingModule>();
|
||||
glm::dvec3 position = module->geoPosition();
|
||||
std::pair<double, std::string_view> altSimplified = simplifyDistance(position.z);
|
||||
@@ -91,6 +94,12 @@ void CameraTopic::sendCameraData() {
|
||||
};
|
||||
|
||||
_connection->sendJson(wrappedPayload(jsonData));
|
||||
#else // ^^^ OPENSPACE_MODULE_SPACE_ENABLED ||| !OPENSPACE_MODULE_SPACE_ENABLED vvv
|
||||
LWARNINGC(
|
||||
"CameraTopic",
|
||||
"Cannot send camera data, compiled without globebrowsing support"
|
||||
);
|
||||
#endif // OPENSPACE_MODULE_SPACE_ENABLED
|
||||
}
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
Reference in New Issue
Block a user