Skip to content

Commit

Permalink
Merge branch 'main' into stable-branch
Browse files Browse the repository at this point in the history
  • Loading branch information
SIMDIS Build Machine committed Sep 6, 2024
2 parents d6f9193 + 5bca86d commit 26ef4f9
Show file tree
Hide file tree
Showing 97 changed files with 1,626 additions and 433 deletions.
6 changes: 6 additions & 0 deletions CMakeImport/ImportOSGEarth.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ elseif(EXISTS "${${LIBRARYNAME}_LIBRARY_INCLUDE_PATH}/osgEarthTriton/TritonOptio
list(APPEND SUBLIBRARY_NAMES Triton)
endif()

# osgEarthImGui added in osgEarth SOVERSION 159
if(EXISTS "${${LIBRARYNAME}_LIBRARY_INCLUDE_PATH}/osgEarthImGui/ImGuiPanel")
set(HAVE_OSGEARTH_IMGUI_NODEKIT TRUE)
list(APPEND SUBLIBRARY_NAMES ImGui)
endif()

# Internal macro to import osgEarth libraries. NAME can be empty string, Util, Symbology, etc.
macro(import_osgearth_lib NAMEVAL)
if("${NAMEVAL}" STREQUAL "")
Expand Down
2 changes: 1 addition & 1 deletion CMakeImport/ImportSWIG.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Helper script for VSI to find SWIG executable.

initialize_ENV(SWIG_DIR)
set(SWIG_VERSION 4.1.1)
set(SWIG_VERSION 4.2.1)
find_program(SWIG_EXECUTABLE
NAMES swig
HINTS
Expand Down
10 changes: 4 additions & 6 deletions CMakeUtilities/valgrind.supp
Original file line number Diff line number Diff line change
Expand Up @@ -463,14 +463,12 @@
}

{
osgEarth suppressed for Globals on startup
Ignore osgEarth globals in ref_ptr
Memcheck:Leak
match-leak-kinds: reachable
fun:_Znwm
fun:_GLOBAL__sub_I_HTTPClient.cpp
fun:call_init.part.0
fun:call_init
...
fun:_GLOBAL__sub_*
...
fun:_dl_init
obj:/usr/lib*/ld-2*
...
}
2 changes: 1 addition & 1 deletion Examples/ASIViewer/ASIViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ class ControlPanel : public simExamples::SimExamplesGui

ImGui::TableNextColumn();
ImGui::TableNextColumn();
ImGui::Text(app_.nowTimeStr_.c_str());
ImGui::Text("%s", app_.nowTimeStr_.c_str());

bool playing = app_.playing_;
IMGUI_ADD_ROW(ImGui::Checkbox, "Playing", &app_.playing_);
Expand Down
8 changes: 4 additions & 4 deletions Examples/AsyncModelLoading/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,10 @@ class ControlPanel : public simExamples::SimExamplesGui
ImGui::Text("Timing"); ImGui::TableNextColumn(); ImGui::TableNextColumn();
popLargeFont_();

ImGui::Text("Platform:"); ImGui::TableNextColumn(); ImGui::Text(app_.entityTimerStr.c_str()); ImGui::TableNextColumn();
ImGui::Text("Asynchronous:"); ImGui::TableNextColumn(); ImGui::Text(app_.asyncTimerStr.c_str()); ImGui::TableNextColumn();
ImGui::Text("Async Round-Trip:"); ImGui::TableNextColumn(); ImGui::Text(app_.asyncRoundTripStr.c_str()); ImGui::TableNextColumn();
ImGui::Text("Synchronous:"); ImGui::TableNextColumn(); ImGui::Text(app_.syncTimerStr.c_str()); ImGui::TableNextColumn();
ImGui::Text("Platform:"); ImGui::TableNextColumn(); ImGui::Text("%s", app_.entityTimerStr.c_str()); ImGui::TableNextColumn();
ImGui::Text("Asynchronous:"); ImGui::TableNextColumn(); ImGui::Text("%s", app_.asyncTimerStr.c_str()); ImGui::TableNextColumn();
ImGui::Text("Async Round-Trip:"); ImGui::TableNextColumn(); ImGui::Text("%s", app_.asyncRoundTripStr.c_str()); ImGui::TableNextColumn();
ImGui::Text("Synchronous:"); ImGui::TableNextColumn(); ImGui::Text("%s", app_.syncTimerStr.c_str()); ImGui::TableNextColumn();

ImGui::EndTable();
}
Expand Down
2 changes: 1 addition & 1 deletion Examples/BeamTest/BeamTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class ControlPanel : public simExamples::SimExamplesGui
std::string type = (props->type() == simData::BeamProperties_BeamType_ABSOLUTE_POSITION ? "ABSOLUTE" : "BODY RELATIVE");
xaction.complete(&props);

ImGui::TableNextColumn(); ImGui::Text("Type"); ImGui::TableNextColumn(); ImGui::Text(type.c_str());
ImGui::TableNextColumn(); ImGui::Text("Type"); ImGui::TableNextColumn(); ImGui::Text("%s", type.c_str());

// Draw mode combo box
ImGui::TableNextColumn(); ImGui::Text("Draw Mode"); ImGui::TableNextColumn();
Expand Down
2 changes: 1 addition & 1 deletion Examples/GOGAttachments/ExampleGOGAttachments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ struct ControlPanel : public simExamples::SimExamplesGui
ImGui::Text("g : cycle through the various GOG types");

if (!nowViewing_.empty())
ImGui::Text(nowViewing_.c_str());
ImGui::Text("%s", nowViewing_.c_str());

ImGui::End();

Expand Down
4 changes: 2 additions & 2 deletions Examples/GOGReader/GOGReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -468,8 +468,8 @@ struct ControlPanel : public simExamples::SimExamplesGui
ImGui::SetNextWindowBgAlpha(.6f);
ImGui::Begin(name(), visible(), ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_AlwaysAutoResize);

ImGui::Text(s_help.c_str());
ImGui::Text(handler_.statusText().c_str());
ImGui::Text("%s", s_help.c_str());
ImGui::Text("%s", handler_.statusText().c_str());

float opacity = opacity_;
ImGui::Text("Opacity: "); ImGui::SameLine();
Expand Down
2 changes: 1 addition & 1 deletion Examples/GateTest/GateTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class ControlPanel : public simExamples::SimExamplesGui
const simData::GateProperties* props = ds_.gateProperties(gateId_, &xaction);
std::string type = (props->type() == simData::GateProperties_GateType_ABSOLUTE_POSITION ? "ABSOLUTE" : "BODY RELATIVE");
xaction.complete(&props);
ImGui::TableNextColumn(); ImGui::Text("Type"); ImGui::TableNextColumn(); ImGui::Text(type.c_str());
ImGui::TableNextColumn(); ImGui::Text("Type"); ImGui::TableNextColumn(); ImGui::Text("%s", type.c_str());

// Draw mode combo box
ImGui::TableNextColumn(); ImGui::Text("Draw Mode"); ImGui::TableNextColumn();
Expand Down
2 changes: 1 addition & 1 deletion Examples/GeoFencing/ExampleGeoFencing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ struct ControlPanel : public simExamples::SimExamplesGui
ImGui::TextColored(ImVec4(1.f, 1.f, 0.f, 1.f), "The yellow areas are geo-fences.");
ImGui::Text("Move mouse to test whether inside/outside");
if (!app_.feedbackText.empty())
ImGui::Text(app_.feedbackText.c_str());
ImGui::Text("%s", app_.feedbackText.c_str());

ImGui::End();
}
Expand Down
2 changes: 1 addition & 1 deletion Examples/ImageIcons/ImageIcons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ struct ControlPanel : public simExamples::SimExamplesGui

std::stringstream ss;
ss << "Currently viewing: " << IconRotation_Name(s_iconRotation);
ImGui::TextColored(ImVec4(1.f, 1.f, 0.f, 1.f), ss.str().c_str());
ImGui::TextColored(ImVec4(1.f, 1.f, 0.f, 1.f), "%s", ss.str().c_str());

ImGui::End();

Expand Down
2 changes: 1 addition & 1 deletion Examples/LoadEarthFile/LoadEarthFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ struct ControlPanel : public simExamples::SimExamplesGui
ImGui::Text("r : remove all insets");

if (!llaLabel_.empty())
ImGui::Text(llaLabel_.c_str());
ImGui::Text("%s", llaLabel_.c_str());

ImGui::End();
handlePressedKeys_();
Expand Down
4 changes: 4 additions & 0 deletions Examples/Ocean/Ocean.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1110,6 +1110,10 @@ namespace
rv->setMaxAltitude(30000.0f);
rv->setRenderBinNumber(simVis::BIN_OCEAN);
rv->setOpacity(0.8f);
#if OSGEARTH_SOVERSION >= 154
// render Triton on the ellipsoid (old default)
rv->setVerticalDatum("");
#endif
simVis::OverheadMode::configureOceanLayer(rv);
return rv;
}
Expand Down
10 changes: 5 additions & 5 deletions Examples/Overhead/OverheadExample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,11 +269,11 @@ struct ControlPanel : public simExamples::SimExamplesGui

std::stringstream ss;
ss << "Dynamic Scale: " << (dynamicScaleOn_ ? "ON" : "OFF");
ImGui::Text(ss.str().c_str()); ss.str(""); ss.clear();
ImGui::Text("%s", ss.str().c_str()); ss.str(""); ss.clear();

const simVis::View* focusedView = viewer_->getMainView()->getFocusManager()->getFocusedView();
ss << std::fixed << std::setprecision(2) << "Camera Distance: " << focusedView->getViewpoint().range().value().getValue() << " m";
ImGui::Text(ss.str().c_str()); ss.str(""); ss.clear();
ImGui::Text("%s", ss.str().c_str()); ss.str(""); ss.clear();

ss << "Centered: ";
centeredPlat_ = getCenteredPlatformId(focusedView);
Expand All @@ -287,10 +287,10 @@ struct ControlPanel : public simExamples::SimExamplesGui
if (prefs)
ss << prefs->commonprefs().name();
}
ImGui::Text(ss.str().c_str()); ss.str(""); ss.clear();
ImGui::Text("%s", ss.str().c_str()); ss.str(""); ss.clear();

ss << "Focused View: " << focusedView->getName() << (focusedView->isOverheadEnabled() ? " OVERHEAD" : " PERSPECTIVE");
ImGui::Text(ss.str().c_str()); ss.str(""); ss.clear();
ImGui::Text("%s", ss.str().c_str()); ss.str(""); ss.clear();

// Avoid showing the sentinel value for off-map
if (latLonElevListener_->lat() == simUtil::MousePositionManipulator::INVALID_POSITION_VALUE)
Expand All @@ -305,7 +305,7 @@ struct ControlPanel : public simExamples::SimExamplesGui
if (showElevation_)
ss << ", elev: " << latLonElevListener_->elev();
}
ImGui::Text(ss.str().c_str());
ImGui::Text("%s", ss.str().c_str());
ImGui::End();
handlePressedKeys_();
}
Expand Down
4 changes: 4 additions & 0 deletions Examples/Periscope/PeriscopeExample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,10 @@ int main(int argc, char** argv)
layer->setUseHeightMap(false);
layer->setMaxAltitude(30000.0f);
layer->setRenderBinNumber(simVis::BIN_OCEAN);
#if OSGEARTH_SOVERSION >= 154
// render Triton on the ellipsoid (old default)
layer->setVerticalDatum("");
#endif
scene->getMap()->addLayer(layer);
}
else
Expand Down
2 changes: 1 addition & 1 deletion Examples/Picking/ExamplePicking.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ struct ControlPanel : public simExamples::SimExamplesGui
ImGui::Text("2 : Toggle RTT 2 display");
}
ImGui::Text("Picked: "); ImGui::SameLine();
ImGui::TextColored(ImVec4(0.f, 1.f, 0.f, 1.f), app_.pickLabel.c_str());
ImGui::TextColored(ImVec4(0.f, 1.f, 0.f, 1.f), "%s", app_.pickLabel.c_str());

ImGui::End();
}
Expand Down
2 changes: 1 addition & 1 deletion Examples/PlatformSymbology/PlatformSymbology.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ struct ControlPanel : public simExamples::SimExamplesGui
ImGui::Begin(name(), visible(), ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_AlwaysAutoResize);
ImGui::TextUnformatted(s_help.c_str());
if (!text_.empty())
ImGui::TextColored(ImVec4(0.f, 1.f, 0.f, 1.f), text_.c_str());
ImGui::TextColored(ImVec4(0.f, 1.f, 0.f, 1.f), "%s", text_.c_str());
ImGui::End();
}

Expand Down
20 changes: 10 additions & 10 deletions Examples/Projectors/Projectors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,16 @@ struct ControlPanel : public simExamples::SimExamplesGui
}
ImGui::SetNextWindowBgAlpha(.6f);
ImGui::Begin(name(), visible(), ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_AlwaysAutoResize);
ImGui::Text(s_rotate.c_str());
ImGui::Text(s_interpolate.c_str());
ImGui::Text(s_viewPlatformOne.c_str());
ImGui::Text(s_viewPlatformTwo.c_str());
ImGui::Text(s_viewPlatformThree.c_str());
ImGui::Text(s_viewPlatformFour.c_str());
ImGui::Text(s_viewPlatformFive.c_str());
ImGui::Text(s_togglePlatformFiveShadowMap.c_str());
ImGui::Text(s_togglePlatformFiveMaxDrawRange.c_str());
ImGui::Text(s_reloadMap.c_str());
ImGui::Text("%s", s_rotate.c_str());
ImGui::Text("%s", s_interpolate.c_str());
ImGui::Text("%s", s_viewPlatformOne.c_str());
ImGui::Text("%s", s_viewPlatformTwo.c_str());
ImGui::Text("%s", s_viewPlatformThree.c_str());
ImGui::Text("%s", s_viewPlatformFour.c_str());
ImGui::Text("%s", s_viewPlatformFive.c_str());
ImGui::Text("%s", s_togglePlatformFiveShadowMap.c_str());
ImGui::Text("%s", s_togglePlatformFiveMaxDrawRange.c_str());
ImGui::Text("%s", s_reloadMap.c_str());
ImGui::End();
}
};
Expand Down
2 changes: 1 addition & 1 deletion Examples/RadialLOS/ExampleRadialLOS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ class ControlPanel : public simExamples::SimExamplesGui
{
std::stringstream ss;
ss << "P2P Result: " << app_.p2pResult;
ImGui::Text(ss.str().c_str());
ImGui::Text("%s", ss.str().c_str());
}

if (needUpdate)
Expand Down
4 changes: 2 additions & 2 deletions Examples/RangeTool/ExampleRangeTool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ struct ControlPanel : public simExamples::SimExamplesGui
ImGui::SetNextWindowBgAlpha(.6f);
ImGui::Begin(name(), visible(), ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_AlwaysAutoResize);
ImGui::Text("1: cycle through line calculations");
ImGui::TextColored(yellow, lineCalcText.c_str());
ImGui::TextColored(yellow, "%s", lineCalcText.c_str());
ImGui::Text("2: cycle through angle calculations");
ImGui::TextColored(yellow, angleCalcText.c_str());
ImGui::TextColored(yellow, "%s", angleCalcText.c_str());
ImGui::Text("3: zoom in");
ImGui::Text("4: rotate zoomed in view");
ImGui::Text("5: reset to main view");
Expand Down
4 changes: 4 additions & 0 deletions Examples/SimpleServer/InstallOcean.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ void InstallOcean::install(simVis::SceneManager& scene)
layer->setUseHeightMap(false);
layer->setMaxAltitude(30000.0f);
layer->setRenderBinNumber(simVis::BIN_OCEAN);
#if OSGEARTH_SOVERSION >= 154
// render Triton on the ellipsoid (old default)
layer->setVerticalDatum("");
#endif

// Configure it to work in overhead mode
simVis::OverheadMode::configureOceanLayer(layer.get());
Expand Down
2 changes: 1 addition & 1 deletion Examples/TimestampedLayer/ExampleTimestampedLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class ControlPanel : public simExamples::SimExamplesGui

ImGui::TableNextColumn(); ImGui::Text("Clock:"); ImGui::TableNextColumn();
if (!app_.timeLabel_.empty())
ImGui::Text(app_.timeLabel_.c_str());
ImGui::Text("%s", app_.timeLabel_.c_str());

ImGui::EndTable();
}
Expand Down
1 change: 0 additions & 1 deletion Examples/imgui/BaseGui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
*
*/
#include "imgui.h"
#include "osgEarth/ImGui/ImGui"
#include "BaseGui.h"

namespace GUI {
Expand Down
1 change: 0 additions & 1 deletion Examples/imgui/BaseGui.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

#include "imgui.h"
#include "imgui_internal.h"
#include "osgEarth/ImGui/ImGui"
#include <string>

struct ImFont;
Expand Down
3 changes: 3 additions & 0 deletions Examples/imgui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ add_library(ImGuiLib ${SOURCE_FILES})
target_include_directories(ImGuiLib PUBLIC . )
target_link_libraries(ImGuiLib PUBLIC VSI::GL GLEW OSGEARTH PRIVATE simVis simCore simNotify)
target_compile_definitions(ImGuiLib PRIVATE IMGUI_IMPL_OPENGL_LOADER_GLEW)
if(CMAKE_COMPILER_IS_GNUCXX)
target_compile_options(ImGuiLib PRIVATE -fno-strict-aliasing)
endif()
set_target_properties(ImGuiLib PROPERTIES
FOLDER "ImGui Library"
PROJECT_LABEL "ImGui"
Expand Down
Loading

0 comments on commit 26ef4f9

Please sign in to comment.