Skip to content

Commit

Permalink
Merge branch 'master' of github.com:gwaldron/osgearth
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonbeverage committed Mar 12, 2024
2 parents f3dae8a + 278f62c commit a0c6d96
Show file tree
Hide file tree
Showing 134 changed files with 5,196 additions and 3,562 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ option(OSGEARTH_BUILD_EXAMPLES "Build the osgEarth example applications" ON)
option(OSGEARTH_BUILD_TESTS "Build the osgEarth unit tests" OFF)
option(OSGEARTH_BUILD_PROCEDURAL_NODEKIT "Build the procedural terrain nodekit (osgEarthProcedural)" OFF)
option(OSGEARTH_BUILD_LEGACY_SPLAT_NODEKIT "Build the legacy procedural nodekit (osgEarthSplat)" OFF)
option(OSGERATH_BUILD_LEGACY_CONTROLS_API "Build the legacy Controls UI API" OFF)
option(OSGEARTH_BUILD_CESIUM_NODEKIT "Build the Cesium nodekit (osgEarthCesium)" OFF)
option(OSGEARTH_BUILD_TRITON_NODEKIT "Build support for SunDog Triton SDK" OFF)
option(OSGEARTH_BUILD_SILVERLINING_NODEKIT "Build support for SunDog SilverLining SDK" OFF)
Expand Down Expand Up @@ -209,6 +210,11 @@ if(OSGEARTH_ASSUME_SINGLE_THREADED_OSG)
add_definitions(-DOSGEARTH_SINGLE_THREADED_OSG)
endif()

# support for the old Controls API (superceded by imgui)
if(OSGEARTH_BUILD_LEGACY_CONTROLS_API)
add_definitions(-DOSGEARTH_HAVE_CONTROLS_API)
endif()

# Protobuf enables the MVT (Mapnik Vector Tiles) format
set(PROTOBUF_USE_DLLS FALSE CACHE BOOL "Set this to true if Protobuf is compiled as dll")

Expand Down
138 changes: 74 additions & 64 deletions src/applications/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,93 +26,103 @@ IF(NOT OSGEARTH_BUILD_PLATFORM_IPHONE)

# Tools:
IF(OSGEARTH_BUILD_TOOLS)
SET(TARGET_DEFAULT_LABEL_PREFIX "Tool")
SET(TARGET_DEFAULT_APPLICATION_FOLDER "Tools")
ADD_SUBDIRECTORY(osgearth_viewer)
ADD_SUBDIRECTORY(osgearth_imgui)
ADD_SUBDIRECTORY(osgearth_tfs)
ADD_SUBDIRECTORY(osgearth_boundarygen)
ADD_SUBDIRECTORY(osgearth_version)
ADD_SUBDIRECTORY(osgearth_atlas)
ADD_SUBDIRECTORY(osgearth_bakefeaturetiles)
ADD_SUBDIRECTORY(osgearth_conv)
ADD_SUBDIRECTORY(osgearth_3pv)
ADD_SUBDIRECTORY(osgearth_clamp)
ADD_SUBDIRECTORY(osgearth_createtile)
set(TARGET_DEFAULT_LABEL_PREFIX "Tool")
set(TARGET_DEFAULT_APPLICATION_FOLDER "Tools")
add_subdirectory(osgearth_viewer)
add_subdirectory(osgearth_imgui)
add_subdirectory(osgearth_tfs)
add_subdirectory(osgearth_boundarygen)
add_subdirectory(osgearth_version)
add_subdirectory(osgearth_atlas)
add_subdirectory(osgearth_bakefeaturetiles)
add_subdirectory(osgearth_conv)
add_subdirectory(osgearth_3pv)
add_subdirectory(osgearth_clamp)

if(OSGEARTH_BUILD_PROCEDURAL_NODEKIT)
add_subdirectory(osgearth_exportvegetation)
add_subdirectory(osgearth_biome)
add_subdirectory(osgearth_imposterbaker)
endif()

if(OSGEARTH_BUILD_LEGACY_SPLAT_NODEKIT)
ADD_SUBDIRECTORY(osgearth_exportgroundcover_splat)
endif()

IF (Protobuf_FOUND AND SQLITE3_FOUND)
ADD_SUBDIRECTORY(osgearth_mvtindex)
ENDIF()
add_subdirectory(osgearth_mvtindex)
ENDIF()

if(OSGEARTH_BUILD_LEGACY_CONTROLS_API)
add_subdirectory(osgearth_createtile)
endif()

if(OSGEARTH_BUILD_LEGACY_SPLAT_NODEKIT)
add_subdirectory(osgearth_exportgroundcover_splat)
endif()
ENDIF()

# Examples:
IF(OSGEARTH_BUILD_EXAMPLES)
SET(TARGET_DEFAULT_LABEL_PREFIX "Example")
SET(TARGET_DEFAULT_APPLICATION_FOLDER "Examples")
ADD_SUBDIRECTORY(osgearth_simple)
ADD_SUBDIRECTORY(osgearth_manip)
ADD_SUBDIRECTORY(osgearth_cluster)
ADD_SUBDIRECTORY(osgearth_features)
ADD_SUBDIRECTORY(osgearth_featurefilter)
ADD_SUBDIRECTORY(osgearth_los)
ADD_SUBDIRECTORY(osgearth_terrainprofile)
ADD_SUBDIRECTORY(osgearth_map)
ADD_SUBDIRECTORY(osgearth_annotation)
ADD_SUBDIRECTORY(osgearth_tracks)
ADD_SUBDIRECTORY(osgearth_transform)
ADD_SUBDIRECTORY(osgearth_graticule)
ADD_SUBDIRECTORY(osgearth_occlusionculling)
ADD_SUBDIRECTORY(osgearth_minimap)
ADD_SUBDIRECTORY(osgearth_mrt)
ADD_SUBDIRECTORY(osgearth_pick)
ADD_SUBDIRECTORY(osgearth_ephemeris)
ADD_SUBDIRECTORY(osgearth_skyview)
ADD_SUBDIRECTORY(osgearth_lights)
ADD_SUBDIRECTORY(osgearth_infinitescroll)
ADD_SUBDIRECTORY(osgearth_video)
ADD_SUBDIRECTORY(osgearth_magnify)
ADD_SUBDIRECTORY(osgearth_eci)
ADD_SUBDIRECTORY(osgearth_heatmap)
ADD_SUBDIRECTORY(osgearth_collecttriangles)
set(TARGET_DEFAULT_LABEL_PREFIX "Example")
set(TARGET_DEFAULT_APPLICATION_FOLDER "Examples")
add_subdirectory(osgearth_simple)
add_subdirectory(osgearth_features)
add_subdirectory(osgearth_featurefilter)
add_subdirectory(osgearth_los)
add_subdirectory(osgearth_terrainprofile)
add_subdirectory(osgearth_map)
add_subdirectory(osgearth_annotation)
add_subdirectory(osgearth_occlusionculling)
add_subdirectory(osgearth_minimap)
add_subdirectory(osgearth_mrt)
add_subdirectory(osgearth_pick)
add_subdirectory(osgearth_skyview)
add_subdirectory(osgearth_lights)
add_subdirectory(osgearth_infinitescroll)
add_subdirectory(osgearth_video)
add_subdirectory(osgearth_heatmap)
add_subdirectory(osgearth_collecttriangles)
add_subdirectory(osgearth_roads)

if(OSGEARTH_BUILD_LEGACY_CONTROLS_API)
add_subdirectory(osgearth_cluster)
add_subdirectory(osgearth_eci)
add_subdirectory(osgearth_ephemeris)
add_subdirectory(osgearth_graticule)
add_subdirectory(osgearth_magnify)
add_subdirectory(osgearth_manip)
add_subdirectory(osgearth_tracks)
add_subdirectory(osgearth_transform)
endif()

ENDIF(OSGEARTH_BUILD_EXAMPLES)

IF(OSGEARTH_BUILD_TESTS)
SET(TARGET_DEFAULT_LABEL_PREFIX "Test")
SET(TARGET_DEFAULT_APPLICATION_FOLDER "Tests")
if(OSGEARTH_BUILD_TESTS)
set(TARGET_DEFAULT_LABEL_PREFIX "Test")
set(TARGET_DEFAULT_APPLICATION_FOLDER "Tests")
add_subdirectory(osgearth_bindless)
ADD_SUBDIRECTORY(osgearth_drawables)
ADD_SUBDIRECTORY(osgearth_horizon)
ADD_SUBDIRECTORY(osgearth_overlayviewer)
ADD_SUBDIRECTORY(osgearth_shadercomp)
ADD_SUBDIRECTORY(osgearth_windows)

IF(SILVERLINING_FOUND)
ADD_SUBDIRECTORY(osgearth_silverlining)
ENDIF(SILVERLINING_FOUND)

IF(TRITON_FOUND)
ADD_SUBDIRECTORY(osgearth_triton)
ENDIF(TRITON_FOUND)
ENDIF(OSGEARTH_BUILD_TESTS)
add_subdirectory(osgearth_drawables)
add_subdirectory(osgearth_horizon)
add_subdirectory(osgearth_overlayviewer)
add_subdirectory(osgearth_windows)

if(OSGEARTH_BUILD_LEGACY_CONTROLS_API)
add_subdirectory(osgearth_shadercomp)

if(SILVERLINING_FOUND)
add_subdirectory(osgearth_silverlining)
endif(SILVERLINING_FOUND)

if(TRITON_FOUND)
add_subdirectory(osgearth_triton)
endif(TRITON_FOUND)
endif()
endif(OSGEARTH_BUILD_TESTS)

ELSE()

# ios
IF(OSGEARTH_BUILD_EXAMPLES)
SET(TARGET_DEFAULT_LABEL_PREFIX "Example")
SET(TARGET_DEFAULT_APPLICATION_FOLDER "Examples")
ADD_SUBDIRECTORY(osgearth_viewerIOS)
add_subdirectory(osgearth_viewerIOS)
ENDIF()

ENDIF()
6 changes: 4 additions & 2 deletions src/applications/osgearth_3pv/osgearth_3pv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include <osgViewer/Viewer>
#include <osgEarth/EarthManipulator>
#include <osgEarth/ExampleResources>
#include <osgEarth/MouseCoordsTool>
#include <osgEarth/Utils>

#include <osgEarth/Horizon>
Expand All @@ -36,7 +35,6 @@
#define LC "[viewer] "

using namespace osgEarth;
using namespace osgEarth::Contrib;

#include <osg/Geometry>
#include <osg/Depth>
Expand All @@ -49,6 +47,7 @@ using namespace osgEarth::Contrib;
#include <osgGA/TrackballManipulator>
#include <cstdlib> // for putenv

#if 0
struct PlacerCallback : public MouseCoordsTool::Callback
{
PlaceNode* _place;
Expand All @@ -75,6 +74,7 @@ struct PlacerCallback : public MouseCoordsTool::Callback
_place->setNodeMask(0);
}
};
#endif

struct CaptureFrustum : public osg::NodeCallback
{
Expand Down Expand Up @@ -257,9 +257,11 @@ main( int argc, char** argv )
place->setNodeMask(0);
viewer.getView(0)->getCamera()->addChild( place );

#if 0
MouseCoordsTool* mct = new MouseCoordsTool(mapNode);
mct->addCallback( new PlacerCallback(place, viewer.getView(0)) );
viewer.getView(1)->addEventHandler( mct );
#endif

mapNode->addChild(new HorizonNode());

Expand Down
2 changes: 1 addition & 1 deletion src/applications/osgearth_clamp/osgearth_clamp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ struct App

GeoPoint point(input->getFeatureProfile()->getSRS(),0,0,0);

osg::ref_ptr<FeatureCursor> cursor = input->createFeatureCursor(Query(), NULL);
osg::ref_ptr<FeatureCursor> cursor = input->createFeatureCursor();
while(cursor->hasMore())
{
Feature* f = cursor->nextFeature();
Expand Down
2 changes: 2 additions & 0 deletions src/applications/osgearth_cluster/osgearth_cluster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <osgEarth/MapNode>
#include <osgEarth/Threading>
#include <osgEarth/Registry>
#include <osgEarth/Controls>
#include <osgDB/ReadFile>
#include <iostream>

Expand All @@ -38,6 +39,7 @@

using namespace osgEarth;
using namespace osgEarth::Util;
using namespace osgEarth::Util::Controls;
using namespace osgEarth::Contrib;

int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1311,7 +1311,7 @@ main(int argc, char** argv)

// load an earth file, and support all or our example command-line options
// and earth file <external> tags
auto node = MapNodeHelper().loadWithoutControls(arguments, &viewer);
auto node = MapNodeHelper().load(arguments, &viewer);
if (node.valid())
{
MapNode* mapNode = MapNode::get(node);
Expand Down
2 changes: 1 addition & 1 deletion src/applications/osgearth_conv/osgearth_conv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ main(int argc, char** argv)
return -1;
}

osg::ref_ptr< FeatureCursor > cursor = indexFeatures->createFeatureCursor(0);
osg::ref_ptr< FeatureCursor > cursor = indexFeatures->createFeatureCursor();
while (cursor.valid() && cursor->hasMore())
{
osg::ref_ptr< Feature > feature = cursor->nextFeature();
Expand Down
16 changes: 11 additions & 5 deletions src/applications/osgearth_eci/osgearth_eci.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <osgEarth/Sky>
#include <osgEarth/Color>
#include <osgEarth/LabelNode>
#include <osgEarth/Controls>
#include <osgViewer/Viewer>
#include <iostream>

Expand Down Expand Up @@ -274,8 +275,8 @@ osg::Node* createECIAxes()
struct App
{
DateTime start, end;
HSliderControl* time;
LabelControl* timeLabel;
ui::HSliderControl* time;
ui::LabelControl* timeLabel;
SkyNode* sky;
J2000ToECEFTransform* ecef;
osg::Group* eci;
Expand Down Expand Up @@ -347,14 +348,17 @@ main(int argc, char** argv)
// UI control to modify the time of day.
ui::HBox* h = container->addControl(new ui::HBox());
h->addControl(new ui::LabelControl("Time:"));
app.time = h->addControl(new HSliderControl(
app.time = h->addControl(new ui::HSliderControl(
app.start.asTimeStamp(), app.end.asTimeStamp(), app.start.asTimeStamp(),
new setTime(app)));
app.time->setWidth(500);
app.timeLabel = container->addControl(new LabelControl());
app.timeLabel = container->addControl(new ui::LabelControl());

ui::ControlCanvas* canvas = new ui::ControlCanvas();
canvas->addChild(container);

// Load an earth file
auto earth = MapNodeHelper().load(arguments, &viewer, container);
auto earth = MapNodeHelper().load(arguments, &viewer);
if (earth.valid() && MapNode::get(earth))
{
// New scene graph root
Expand Down Expand Up @@ -398,6 +402,8 @@ main(int argc, char** argv)
}
}

root->addChild(canvas);

viewer.realize();
app.time->setWidth(viewer.getCamera()->getViewport()->width()-40);

Expand Down
2 changes: 1 addition & 1 deletion src/applications/osgearth_imgui/osgearth_imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ main(int argc, char** argv)
// If you use the MapNodeHelper, call this first.
viewer.setRealizeOperation(new GUI::ApplicationGUI::RealizeOperation);

osg::ref_ptr<osg::Node> node = MapNodeHelper().loadWithoutControls(arguments, &viewer);
osg::ref_ptr<osg::Node> node = MapNodeHelper().load(arguments, &viewer);
if (node.valid())
{
// Call this to add the GUI.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
#include <osgEarth/ExampleResources>
#include <osgEarth/MapNode>
#include <osgEarth/Threading>

#include <osg/MatrixTransform>

#include <iostream>

#define LC "[viewer] "
Expand Down Expand Up @@ -58,8 +61,6 @@ main(int argc, char** argv)
float vfov = -1.0f;
arguments.read("--vfov", vfov);



// create a viewer:
osgViewer::Viewer viewer(arguments);

Expand Down
1 change: 1 addition & 0 deletions src/applications/osgearth_magnify/osgearth_magnify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#include <osgViewer/Viewer>
#include <osgViewer/CompositeViewer>
#include <osgEarth/Controls>
#include <osgEarth/ExampleResources>
#include <osgEarth/EarthManipulator>
#include <osgEarth/MapNode>
Expand Down
5 changes: 4 additions & 1 deletion src/applications/osgearth_manip/osgearth_manip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -786,8 +786,10 @@ int main(int argc, char** argv)

// UI:
Container* help = createHelp(&viewer);
auto canvas = new ControlCanvas();
canvas->addChild(help);

auto earthNode = MapNodeHelper().load( arguments, &viewer, help );
auto earthNode = MapNodeHelper().load(arguments, &viewer);
if (!earthNode.valid())
{
OE_WARN << "Unable to load earth model." << std::endl;
Expand All @@ -796,6 +798,7 @@ int main(int argc, char** argv)

osg::Group* root = new osg::Group();
root->addChild( earthNode );
root->addChild(canvas);

osgEarth::MapNode* mapNode = osgEarth::MapNode::get( earthNode );
if (!mapNode)
Expand Down

0 comments on commit a0c6d96

Please sign in to comment.