X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Ftiming%2Fgeocoord.h;h=536cf0f95ca2fe7707d631d05636eb24e09d94bd;hb=a25e859fa773c9463e4bec042b8d0b39041c29ad;hp=9d65b4c6ee32153888b42372751465fef9361f81;hpb=1b07b25ad2eb26be45f7df744efa332a230d2baf;p=simgear.git diff --git a/simgear/timing/geocoord.h b/simgear/timing/geocoord.h index 9d65b4c6..536cf0f9 100644 --- a/simgear/timing/geocoord.h +++ b/simgear/timing/geocoord.h @@ -2,19 +2,19 @@ * geocoord.h * Written by Durk Talsma. Started July 1999. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library 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 + * 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 GNU - * General Public License for more details. + * Library General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * **************************************************************************/ @@ -36,62 +36,54 @@ #include -#include -#include STL_IOSTREAM -//#include // looks like streambuf does not exist on linux. -// But it looks like it isn't used anyways -:) #include -FG_USING_NAMESPACE(std); - #include -class GeoCoord +class SGGeoCoord { protected: float lat; float lon; public: - GeoCoord() { lat = 0.0; lon = 0.0;}; - GeoCoord(float la, float lo) { lat = la; lon = lo;}; - GeoCoord(const GeoCoord& other); - virtual ~GeoCoord() {}; + SGGeoCoord() { lat = 0.0; lon = 0.0;}; + SGGeoCoord(float la, float lo) { lat = la; lon = lo;}; + SGGeoCoord(const SGGeoCoord& other); + virtual ~SGGeoCoord() {}; void set(float la, float lo) { lat = la; lon = lo; }; float getLat() const { return lat; }; float getLon() const { return lon; }; - float getX() const { return cos(DEG_TO_RAD*lat) * cos(DEG_TO_RAD*lon); }; - float getY() const { return cos(DEG_TO_RAD*lat) * sin(DEG_TO_RAD*lon); }; - float getZ() const { return sin(DEG_TO_RAD*lat); }; + float getX() const { return cos(SGD_DEGREES_TO_RADIANS*lat) * cos(SGD_DEGREES_TO_RADIANS*lon); }; + float getY() const { return cos(SGD_DEGREES_TO_RADIANS*lat) * sin(SGD_DEGREES_TO_RADIANS*lon); }; + float getZ() const { return sin(SGD_DEGREES_TO_RADIANS*lat); }; - //double getAngle(const GeoCoord& other) const; - virtual void print() {} ; - virtual char *getDescription() {return 0;}; + virtual const char * getDescription() {return 0;}; }; -typedef vector GeoCoordVector; -typedef vector::iterator GeoCoordVectorIterator; -typedef vector::const_iterator GeoCoordVectorConstIterator; +typedef std::vector SGGeoCoordVector; +typedef std::vector::iterator SGGeoCoordVectorIterator; +typedef std::vector::const_iterator SGGeoCoordVectorConstIterator; /************************************************************************ - * GeoCoordContainer is a simple container class, that stores objects - * derived from GeoCoord. Basically, it is a wrapper around an STL vector, + * SGGeoCoordContainer is a simple container class, that stores objects + * derived from SGGeoCoord. Basically, it is a wrapper around an STL vector, * with some added functionality ***********************************************************************/ -class GeoCoordContainer +class SGGeoCoordContainer { protected: - GeoCoordVector data; + SGGeoCoordVector data; public: - GeoCoordContainer() {}; - virtual ~GeoCoordContainer(); + SGGeoCoordContainer() {}; + virtual ~SGGeoCoordContainer(); - const GeoCoordVector& getData() const { return data; }; - GeoCoord* getNearest(const GeoCoord& ref) const; + const SGGeoCoordVector& getData() const { return data; }; + SGGeoCoord* getNearest(const SGGeoCoord& ref) const; };