osgEarth 2.1.1

/home/cube/sources/osgearth/src/osgEarthDrivers/agglite/AGGLiteOptions

Go to the documentation of this file.
00001 /* -*-c++-*- */
00002 /* osgEarth - Dynamic map generation toolkit for OpenSceneGraph
00003  * Copyright 2008-2010 Pelican Mapping
00004  * http://osgearth.org
00005  *
00006  * osgEarth is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU Lesser General Public License as published by
00008  * the Free Software Foundation; either version 2 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public License
00017  * along with this program.  If not, see <http://www.gnu.org/licenses/>
00018  */
00019 #ifndef OSGEARTH_DRIVER_AGGLITE_DRIVEROPTIONS
00020 #define OSGEARTH_DRIVER_AGGLITE_DRIVEROPTIONS 1
00021 
00022 #include <osgEarth/Common>
00023 #include <osgEarthFeatures/FeatureTileSource>
00024 
00025 namespace osgEarth { namespace Drivers
00026 {
00027     using namespace osgEarth;
00028     using namespace osgEarth::Features;
00029 
00030     class AGGLiteOptions : public FeatureTileSourceOptions // NO EXPORT; header only
00031     {
00032     public:
00038         optional<bool>& relativeLineSize() { return _relativeLineSize; }
00039         const optional<bool>& relativeLineSize() const { return _relativeLineSize; }
00040 
00047         optional<bool>& optimizeLineSampling() { return _optimizeLineSampling; }
00048         const optional<bool>& optimizeLineSampling() const { return _optimizeLineSampling; }
00049 
00050     public:
00051         AGGLiteOptions( const TileSourceOptions& options =TileSourceOptions() )
00052             : FeatureTileSourceOptions( options ),
00053               _relativeLineSize(true), 
00054               _optimizeLineSampling(true)
00055         {
00056             setDriver( "agglite" );
00057             fromConfig( _conf );
00058         }
00059 
00060     public:
00061         Config getConfig() const {
00062             Config conf = FeatureTileSourceOptions::getConfig();
00063             conf.updateIfSet("relative_line_size", _relativeLineSize);
00064             conf.updateIfSet("optimize_line_sampling", _optimizeLineSampling);
00065             return conf;
00066         }
00067 
00068     protected:
00069         void mergeConfig( const Config& conf ) {
00070             FeatureTileSourceOptions::mergeConfig( conf );
00071             fromConfig(conf);
00072         }
00073 
00074     private:
00075         void fromConfig( const Config& conf ) {
00076             conf.getIfSet( "relative_line_size", _relativeLineSize );
00077             conf.getIfSet( "optimize_line_sampling", _optimizeLineSampling );
00078         }
00079 
00080         optional<bool> _relativeLineSize;
00081         optional<bool> _optimizeLineSampling;
00082     };
00083 
00084 } } // namespace osgEarth::Drivers
00085 
00086 #endif // OSGEARTH_DRIVER_AGGLITE_DRIVEROPTIONS
00087 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines