1/* -*-c++-*- */ 2/* osgEarth - Geospatial SDK for OpenSceneGraph 3 * Copyright 2019 Pelican Mapping 4 * http://osgearth.org 5 * 6 * osgEarth is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU Lesser General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU Lesser General Public License for more details. 15 * 16 * You should have received a copy of the GNU Lesser General Public License 17 * along with this program. If not, see <http://www.gnu.org/licenses/> 18 */ 19#ifndef OSGEARTH_UTIL_FORMATTER_H 20#define OSGEARTH_UTIL_FORMATTER_H 21 22#include <osgEarthUtil/Common> 23#include <osgEarth/GeoData> 24 25namespace osgEarth { namespace Util 26{ 27 using namespace osgEarth; 28 29 /** 30 * Interface class for coordinate formatters. 31 */ 32 class Formatter : public osg::Referenced 33 { 34 public: 35 virtual std::string format( const GeoPoint& mapCoords ) const =0; 36 std::string operator()(const GeoPoint& p) const { return format(p); } 37 38 /** dtor */ 39 virtual ~Formatter() { } 40 }; 41 42} } // namespace osgEarth::Util 43 44#endif // OSGEARTH_UTIL_FORMATTER_H 45