Skip to content

Commit

Permalink
Work on integrating procedural nodes into osgEarth.
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonbeverage committed Jan 30, 2025
1 parent 7501ae1 commit c891a82
Show file tree
Hide file tree
Showing 14 changed files with 7,081 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/applications/osgearth_imgui/osgearth_imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#include <osgEarthImGui/TerrainEditGUI>
#include <osgEarthImGui/TextureSplattingLayerGUI>
#include <osgEarthImGui/VegetationLayerGUI>
#include <osgEarthImGui/NodeGraphGUI>
#endif

#ifdef OSGEARTH_HAVE_CESIUM_NODEKIT
Expand Down Expand Up @@ -132,6 +133,7 @@ main(int argc, char** argv)
ui->add("Procedural", new osgEarth::Procedural::TerrainEditGUI);
ui->add("Procedural", new osgEarth::Procedural::TextureSplattingLayerGUI());
ui->add("Procedural", new osgEarth::Procedural::VegetationLayerGUI());
ui->add("Procedural", new osgEarth::Procedural::NodeGraphGUI());
#endif

ui->onStartup = []()
Expand Down
2 changes: 1 addition & 1 deletion src/osgEarth/TiledModelLayer
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ namespace osgEarth
mutable std::vector<Texture::WeakPtr> _texturesCache;
mutable std::mutex _texturesCacheMutex;

private:
protected:
osg::observer_ptr< const Map > _map;
osg::ref_ptr< osg::Group > _root;
bool _graphDirty;
Expand Down
5 changes: 3 additions & 2 deletions src/osgEarthImGui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ set(LIB_NAME osgEarthImGui)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)

# embedded ImGui source code:
set(IMGUI_HEADERS imgui.h imgui_internal.h imgui_impl_opengl3.h imconfig.h)
set(IMGUI_SOURCES imgui.cpp imgui_demo.cpp imgui_draw.cpp imgui_tables.cpp imgui_widgets.cpp imgui_impl_opengl3.cpp)
set(IMGUI_HEADERS imgui.h imgui_internal.h imgui_impl_opengl3.h imconfig.h imnodes.h)
set(IMGUI_SOURCES imgui.cpp imgui_demo.cpp imgui_draw.cpp imgui_tables.cpp imgui_widgets.cpp imgui_impl_opengl3.cpp imnodes.cpp)

set(STOCK_PANELS
AnnotationsGUI
Expand All @@ -25,6 +25,7 @@ set(STOCK_PANELS
NotifyGUI
OpenEarthFileGUI
LiveCamerasGUI
NodeGraphGUI
PickerGUI
RenderingGUI
SceneGraphGUI
Expand Down
1 change: 1 addition & 0 deletions src/osgEarthImGui/Common
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@
#ifndef IMGUI_VERSION
#include <GL/glew.h>
#include <osgEarthImGui/imgui.h>
#include <osgEarthImGui/imnodes.h>
#endif
6 changes: 6 additions & 0 deletions src/osgEarthImGui/ImGuiEventHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ ImGuiEventHandler::newFrame(osg::RenderInfo& renderInfo)
if (_firstFrame)
{
ImGui::CreateContext();
ImNodes::CreateContext();
ImNodes::PushAttributeFlag(ImNodesAttributeFlags_EnableLinkDetachWithDragClick);
ImNodesIO& imNodesio = ImNodes::GetIO();
imNodesio.LinkDetachWithModifierClick.Modifier = &ImGui::GetIO().KeyCtrl;
imNodesio.MultipleSelectModifier.Modifier = &ImGui::GetIO().KeyCtrl;

ImGui_ImplOpenGL3_Init();
auto& io = ImGui::GetIO();
#ifdef IMGUI_HAS_DOCK
Expand Down
646 changes: 646 additions & 0 deletions src/osgEarthImGui/NodeGraphGUI

Large diffs are not rendered by default.

Loading

0 comments on commit c891a82

Please sign in to comment.