From 135e137921db5d87ed9c5f2aef7dc9ead00fdfda Mon Sep 17 00:00:00 2001 From: curt Date: Fri, 22 Sep 2000 19:24:41 +0000 Subject: [PATCH] Initial revision. --- simgear/route/Makefile.am | 10 ++++++ simgear/route/waypoint.cxx | 48 +++++++++++++++++++++++++++ simgear/route/waypoint.hxx | 67 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 125 insertions(+) create mode 100644 simgear/route/Makefile.am create mode 100644 simgear/route/waypoint.cxx create mode 100644 simgear/route/waypoint.hxx diff --git a/simgear/route/Makefile.am b/simgear/route/Makefile.am new file mode 100644 index 00000000..c45639e5 --- /dev/null +++ b/simgear/route/Makefile.am @@ -0,0 +1,10 @@ +includedir = @includedir@/route + +lib_LIBRARIES = libsgroute.a + +include_HEADERS = waypoint.hxx + +libsgroute_a_SOURCES = \ + waypoint.cxx + +INCLUDES += -I$(top_srcdir) diff --git a/simgear/route/waypoint.cxx b/simgear/route/waypoint.cxx new file mode 100644 index 00000000..231b862c --- /dev/null +++ b/simgear/route/waypoint.cxx @@ -0,0 +1,48 @@ +// waypoint.cxx -- Class to hold data and return info relating to a waypoint +// +// Written by Curtis Olson, started September 2000. +// +// Copyright (C) 2000 Curtis L. Olson - curt@hfrl.umn.edu +// +// 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 program 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. +// +// 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. +// +// $Id$ + + +#include "waypoint.hxx" + + +// Constructor +SGWayPoint::SGWayPoint( const double _lon, const double _lat, + const modetype _mode ) { + lon = _lon; + lat = _lat; + mode = _mode; +} + + +SGWayPoint::SGWayPoint( const double _lon, const double _lat ) { + SGWayPoint( _lon, _lat, LATLON ); +} + + +SGWayPoint::SGWayPoint() { + SGWayPoint( 0.0, 0.0, LATLON ); +} + + +// Destructor +SGWayPoint::~SGWayPoint() { +} diff --git a/simgear/route/waypoint.hxx b/simgear/route/waypoint.hxx new file mode 100644 index 00000000..174e38ba --- /dev/null +++ b/simgear/route/waypoint.hxx @@ -0,0 +1,67 @@ +// waypoint.hxx -- Class to hold data and return info relating to a waypoint +// +// Written by Curtis Olson, started September 2000. +// +// Copyright (C) 2000 Curtis L. Olson - curt@hfrl.umn.edu +// +// 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 program 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. +// +// 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. +// +// $Id$ + + +#ifndef _WAYPOINT_HXX +#define _WAYPOINT_HXX + + +#ifndef __cplusplus +# error This library requires C++ +#endif + + +#ifdef HAVE_CONFIG_H +# include +#endif + + +class SGWayPoint { + +public: + + enum modetype { + LATLON = 0, + XY = 1, + }; + +private: + + modetype mode; + + double lon; + double lat; + +public: + + SGWayPoint(); + SGWayPoint( const double _lon, const double _lat ); + SGWayPoint( const double _lon, const double _lat, const modetype _mode ); + ~SGWayPoint(); + + inline modetype get_mode() const { return mode; } + inline double get_lon() const { return lon; } + inline double get_lat() const { return lat; } +}; + + +#endif // _WAYPOINT_HXX -- 2.39.5