/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2004 Robert Osfield * * This library is open source and may be redistributed and/or modified under * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or * (at your option) any later version. The full license is in LICENSE file * included with this distribution, and on the openscenegraph.org website. * * This library 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 * OpenSceneGraph Public License for more details. */ #ifndef OSGSIM_GEOGRAPHICLOCATION #define OSGSIM_GEOGRAPHICLOCATION 1 #include #include #include namespace osgSim { /** Stores a double precision geographic location, latitude and longitude. Derived from Referenced so it can be used as an osg::Object userData. */ class GeographicLocation : public osg::Referenced { public: GeographicLocation() { _v[0]=0.; _v[1]=0.; } GeographicLocation( double lat, double lon ) { _v[0]=lat; _v[1]=lon; } inline bool operator == ( const GeographicLocation& v) const { return _v[0]==v._v[0] && _v[1]==v._v[1]; } inline bool operator != ( const GeographicLocation& v) const { return _v[0]!=v._v[0] || _v[1]!=v._v[1]; } inline bool operator < ( const GeographicLocation& v) const { if (_v[0]v._v[0]) return false; else if (_v[1]