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* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
16* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
17* IN THE SOFTWARE.
18*
19* You should have received a copy of the GNU Lesser General Public License
20* along with this program.  If not, see <http://www.gnu.org/licenses/>
21*/
22#ifndef OSGEARTH_UTIL_UTM_LABELING_ENGINE_H
23#define OSGEARTH_UTIL_UTM_LABELING_ENGINE_H 1
24
25#include <osgEarthUtil/Common>
26#include <osgEarthUtil/GraticuleLabelingEngine>
27#include <osgEarth/GeoData>
28#include <osgEarth/MapNode>
29#include <osgEarth/Containers>
30#include <osgEarthAnnotation/LabelNode>
31
32namespace osgEarth { namespace Util
33{
34    using namespace osgEarth;
35    using namespace osgEarth::Annotation;
36
37    /**
38     * Node that plots UTM coordinats labels along the edge of the
39     * viewport when you are looking straight down on a zoomed-in area.
40     */
41    class UTMLabelingEngine : public GraticuleLabelingEngine
42    {
43    public:
44        //! Construct a new labeling engine with the map's SRS
45        UTMLabelingEngine(const SpatialReference* srs);
46
47        //! Sets the maximum resolution (meters) at which to render labels
48        void setMaxResolution(double value);
49
50        virtual bool updateLabels(const osg::Vec3d& LL_world, osg::Vec3d& UL_world, osg::Vec3d& LR_world, ClipSpace& window, CameraData& data);
51
52    protected:
53
54        double _maxRes;
55    };
56
57} } // namespace osgEarth::Util
58
59#endif // OSGEARTH_UTIL_UTM_LABELING_ENGINE_H
60