Skip to content

Commit

Permalink
Remove old controls code from sky extensions to build with LEGACY Con…
Browse files Browse the repository at this point in the history
…trols API flag
  • Loading branch information
gwaldron committed Mar 11, 2024
1 parent 0681acc commit 1fb4bcd
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 81 deletions.
43 changes: 0 additions & 43 deletions src/osgEarthDrivers/sky_gl/GLSkyExtension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,34 +27,19 @@
#include <osgEarth/Sky>
#include <osgEarth/ExampleResources>

#ifdef OSGEARTH_HAVE_CONTROLS_API
#include <osgEarth/Controls>
namespace ui = osgEarth::Util::Controls;
#endif

#define LC "[GLSkyDriver] "

using namespace osgEarth;
using namespace osgEarth::Util;

namespace osgEarth { namespace GLSky
{
#ifdef OSGEARTH_HAVE_CONTROLS_API
class GLSkyExtension :
public Extension,
public ExtensionInterface<MapNode>,
public ExtensionInterface<osg::View>,
public ExtensionInterface<ui::Control>,
public SkyNodeFactory,
public GLSkyOptions
#else
class GLSkyExtension :
public Extension,
public ExtensionInterface<MapNode>,
public ExtensionInterface<osg::View>,
public SkyNodeFactory,
public GLSkyOptions
#endif
{
public:
META_OE_Extension( osgEarth, GLSkyExtension, sky_gl );
Expand All @@ -74,14 +59,6 @@ namespace osgEarth { namespace GLSky
bool connect( osg::View* );
bool disconnect( osg::View* ) { return true; }

#ifdef OSGEARTH_HAVE_CONTROLS_API
public: // ExtensionInterface<ui::Control>

bool connect( ui::Control* );
bool disconnect( ui::Control* );
osg::ref_ptr<ui::Control> _ui;
#endif

public: // SkyNodeFactory

SkyNode* createSkyNode();
Expand Down Expand Up @@ -144,26 +121,6 @@ GLSkyExtension::connect(osg::View* view)
return true;
}

#ifdef OSGEARTH_HAVE_CONTROLS_API
bool
GLSkyExtension::connect(ui::Control* control)
{
ui::Container* container = dynamic_cast<ui::Container*>(control);
if (container && _skyNode.valid())
container->addControl(SkyControlFactory::create(_skyNode.get()));
return true;
}

bool
GLSkyExtension::disconnect(ui::Control* control)
{
ui::Container* container = dynamic_cast<ui::Container*>(control);
if (container && _ui.valid())
container->removeChild(_ui.get());
return true;
}
#endif

SkyNode*
GLSkyExtension::createSkyNode()
{
Expand Down
38 changes: 0 additions & 38 deletions src/osgEarthDrivers/sky_simple/SimpleSkyExtension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,32 +24,17 @@
#include <osgEarth/NodeUtils>
#include <osgEarth/ExampleResources>

#ifdef OSGEARTH_HAVE_CONTROLS_API
#include <osgEarth/Controls>
namespace ui = osgEarth::Util::Controls;
#endif

#define LC "[SimpleSkyDriver] "

using namespace osgEarth::Util;

namespace osgEarth { namespace SimpleSky
{
#ifdef OSGEARTH_HAVE_CONTROLS_API
class SimpleSkyExtension :
public Extension,
public ExtensionInterface<MapNode>,
public ExtensionInterface<osg::View>,
public ExtensionInterface<ui::Control>,
public SimpleSkyOptions,
public SkyNodeFactory
#else
class SimpleSkyExtension : public Extension,
public ExtensionInterface<MapNode>,
public ExtensionInterface<osg::View>,
public SimpleSkyOptions,
public SkyNodeFactory
#endif
{
public:
META_OE_Extension(osgEarth, SimpleSkyExtension, simple_sky);
Expand Down Expand Up @@ -104,29 +89,6 @@ namespace osgEarth { namespace SimpleSky
return true;
}


#ifdef OSGEARTH_HAVE_CONTROLS_API
public: // ExtensionInterface<Control>

bool connect(ui::Control* control) override
{
ui::Container* container = dynamic_cast<ui::Container*>(control);
if (container)
_ui = container->addControl(SkyControlFactory::create(_skynode.get()));
return true;
}

bool disconnect(ui::Control* control) override
{
ui::Container* container = dynamic_cast<ui::Container*>(control);
if (container && _ui.valid())
container->removeChild(_ui.get());
return true;
}

osg::ref_ptr<ui::Control> _ui;
#endif

public: // SkyNodeFactory

SkyNode* createSkyNode() override {
Expand Down

0 comments on commit 1fb4bcd

Please sign in to comment.