* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
**************************************************************************/
#include <math.h>
-#include <string>
-#include STL_IOSTREAM
-//#include <streambuf> // looks like streambuf does not exist on linux.
-// But it looks like it isn't used anyways -:)
#include <vector>
-SG_USING_NAMESPACE(std);
-
#include <simgear/constants.h>
-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<GeoCoord*> GeoCoordVector;
-typedef vector<GeoCoord*>::iterator GeoCoordVectorIterator;
-typedef vector<GeoCoord*>::const_iterator GeoCoordVectorConstIterator;
+typedef std::vector<SGGeoCoord*> SGGeoCoordVector;
+typedef std::vector<SGGeoCoord*>::iterator SGGeoCoordVectorIterator;
+typedef std::vector<SGGeoCoord*>::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;
};