/* -*-c++-*- */ /* osgEarth - Geospatial SDK for OpenSceneGraph * Copyright 2020 Pelican Mapping * http://osgearth.org * * osgEarth is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see */ #ifndef OSGEARTH_VIEWPOINTS_EXTENSION #define OSGEARTH_VIEWPOINTS_EXTENSION 1 #include #include #include #include #include #include #ifdef OSGEARTH_HAVE_CONTROLS_API #include using namespace osgEarth::Util::Controls; #endif namespace osgEarth { namespace Viewpoints { using namespace osgEarth; /** * Loads a collection of viewpoints and makes them available * through a Controls UI. */ #ifdef OSGEARTH_HAVE_CONTROLS_API class ViewpointsExtension : public Extension, public ExtensionInterface, public ExtensionInterface, public ConfigOptions #else class ViewpointsExtension : public Extension, public ExtensionInterface, public ConfigOptions #endif { public: META_OE_Extension(osgEarth, ViewpointsExtension, viewpoints); // CTORs ViewpointsExtension(); ViewpointsExtension(const ConfigOptions& options); // DTOR virtual ~ViewpointsExtension(); public: // Extension void setDBOptions(const osgDB::Options* dbOptions); // Use "this" since this class derives from ConfigOptions. const ConfigOptions& getConfigOptions() const { return *this; } public: // ExtensionInterface bool connect(osg::View* view); bool disconnect(osg::View* view); #ifdef OSGEARTH_HAVE_CONTROLS_API public: // ExtensionInterface bool connect(Control* control); bool disconnect(Control* control); #endif private: osg::ref_ptr _dbOptions; osg::ref_ptr _handler; }; } } // namespace osgEarth::Viewpoints #endif // OSGEARTH_VIEWPOINTS_EXTENSION