simgear/magvar \
simgear/math \
simgear/misc \
+ simgear/props \
simgear/route \
simgear/scene \
simgear/screen \
simgear/serial \
simgear/sg_inlines.h \
simgear/sg_traits.hxx \
+ simgear/sound \
simgear/threads \
simgear/timing \
simgear/xml
* Some of the functionality provide includes
*
* - Compiler and platform abstractions for many tricky differences.
- * - A whole earth tiling/indexing scheme.
+ * (compiler.h)
+ *
+ * - A whole earth tiling/indexing scheme. (SGBucket)
+ *
* - A console debugging output scheme that tracks severity and
* category that can be completely compiled out for a final build release.
- * - Code to manage "real" time and time zones.
+ * (logstream.hxx)
+ *
+ * - Code to manage "real" time (SGTime), time zones (SGTimeZone), and
+ * millesecond time differences (SGTimeStamp).
+ *
* - Code to calculate accurate positions of sun, moon, stars, and
* planets for a given time, date, season, earth location, etc.
- * - Simple serial, file, and network I/O abstractions
- * - Code to calculate magnetic variation.
- * - A variety of coordinate conversion, vector, matrix type math routines.
- * - An abstraction to hide platform dependent path naming schemes.
+ * (SGEphemeris)
+ *
+ * - Simple serial (SGSerial), file (SGFile), socket (SGSocket), and
+ * UDP socket (SGSocketUDP) I/O abstractions.
+ *
+ * - Code to calculate magnetic variation. (SGMagVar)
+ *
+ * - A variety of classes and functions for interpolation tables
+ * (SGInterpTable), least squares computation (leastsqs.hxx), 3D
+ * point/vectors (Point3D), 3D polar math and conversions (polar3d.hxx),
+ * WGS-84 math and conversions (sg_geodesy.hxx), random number abstraction
+ * (sg_random.h), STL conglomerates for common list types (sg_types.hxx),
+ * and other vector and linear algebra routines (vector.hxx)
+ *
+ * - An abstraction to hide platform dependent path naming schemes. (SGPath)
+ *
* - A C++ streams wrapper to handle compress input/output streams.
+ * (sg_gzifstream)
+ *
* - An optimized "property manager" which associates ascii property
* names with their corresponding value. This can be a great way to build
* loose linkages between modules, or build linkages/connections that can
- * be determined from config files or at runtime.
+ * be determined from config files or at runtime. (SGPropertyNode)
+ * Also included is a set of functions to dump the property tree into a
+ * standard xml file and subsequently read/parse a standard xml file and
+ * rebuild the associated property tree. (props_io.hxx)
+ *
* - Scene management and drawing routines:
* - material property management
* - object management
* - terrain tile management and paging
* - sky dome rendering (with ephemeral objects)
- * - Code to handle screen dumps (and ultra-hires tile rendered screen dumps)
- * - A sound effects manager.
+ *
+ * - Code to handle screen dumps (screen-dump.hxx) and ultra-hires
+ * tile rendered screen dumps (tr.h)
+ *
+ * - A sound effects manager. (SGSoundMgr, SGSimpleSound, SGSound)
+ *
* - A threading abstraction.
+ *
* - A simple but highly functional XML parser that interfaces nicely
* with the property manager.
*
* SimGear is licensed under the terms of the LGPL
- * \section install Installation
- *
- * \subsection step1 Step 1: Opening the box
- *
- * etc...
*/
double *az2 );
-// given alt, lat1, lon1, lat2, lon2, calculate starting and ending
-// az1, az2 and distance (s). Lat, lon, and azimuth are in degrees.
-// distance in meters
+/**
+ * Given an altitude and two sets of (lat, lon) calculate great circle
+ * distance between them as well as the starting and ending azimuths.
+ * @param alt (in) meters
+ * @param lat1 (in) degrees
+ * @param lon1 (in) degrees
+ * @param lat2 (in) degrees
+ * @param lon2 (in) degrees
+ * @param az1 (out) start heading degrees
+ * @param az2 (out) end heading degrees
+ * @param s (out) distance meters
+ */
int geo_inverse_wgs_84( const double& alt, const double& lat1,
const double& lon1, const double& lat2,
const double& lon2, double *az1, double *az2,
-/**
- * \file texture.cxx
+/*
* Texture manipulation routines
*
* Copyright (c) Mark J. Kilgard, 1997.
+/**
+ * \file texture.hxx
+ * Texture manipulation routines
+ *
+ * Copyright (c) Mark J. Kilgard, 1997.
+ * Code added in april 2003 by Erik Hofman
+ *
+ * This program is freely distributable without licensing fees
+ * and is provided without guarantee or warrantee expressed or
+ * implied. This program is -not- in the public domain.
+ */
#ifndef __SG_TEXTURE_HXX
#define __SG_TEXTURE_HXX 1
#include <plib/sg.h>
+/**
+ * A class to encapsulate all the info surrounding an OpenGL texture
+ * and also query various info and load various file formats
+ */
class SGTexture {
private:
/*************************************************************************
*
* This file defines a small and simple class to store geocentric
- * coordinates. Basically, class GeoCoord is intended as a base class for
+ * coordinates. Basically, class SGGeoCoord is intended as a base class for
* any kind of of object, that can be categorized according to its
* location on earth, be it navaids, or aircraft. This class for originally
* written for FlightGear, in order to store Timezone control points.
#include "geocoord.h"
#include <plib/sg.h>
-GeoCoord::GeoCoord(const GeoCoord& other)
+SGGeoCoord::SGGeoCoord(const SGGeoCoord& other)
{
lat = other.lat;
lon = other.lon;
}
-// double GeoCoord::getAngle(const GeoCoord& other) const
+// double SGGeoCoord::getAngle(const SGGeoCoord& other) const
// {
// Vector first( getX(), getY(), getZ());
// Vector secnd(other.getX(), other.getY(), other.getZ());
// return angle;
// }
-// GeoCoord* GeoCoordContainer::getNearest(const GeoCoord& ref) const
+// SGGeoCoord* SGGeoCoordContainer::getNearest(const SGGeoCoord& ref) const
// {
// float angle, maxAngle = 180;
-// GeoCoordVectorConstIterator i, nearest;
+// SGGeoCoordVectorConstIterator i, nearest;
// for (i = data.begin(); i != data.end(); i++)
// {
// angle = SGD_RADIANS_TO_DEGREES * (*i)->getAngle(ref);
// }
-GeoCoord* GeoCoordContainer::getNearest(const GeoCoord& ref) const
+SGGeoCoord* SGGeoCoordContainer::getNearest(const SGGeoCoord& ref) const
{
sgVec3 first, secnd;
float dist, maxDist=SG_MAX;
sgSetVec3( first, ref.getX(), ref.getY(), ref.getZ());
- GeoCoordVectorConstIterator i, nearest;
+ SGGeoCoordVectorConstIterator i, nearest;
for (i = data.begin(); i != data.end(); i++)
{
sgSetVec3(secnd, (*i)->getX(), (*i)->getY(), (*i)->getZ());
}
-GeoCoordContainer::~GeoCoordContainer()
+SGGeoCoordContainer::~SGGeoCoordContainer()
{
- GeoCoordVectorIterator i = data.begin();
+ SGGeoCoordVectorIterator i = data.begin();
while (i != data.end())
delete *i++;
}
#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 getZ() const { return sin(SGD_DEGREES_TO_RADIANS*lat); };
- //double getAngle(const GeoCoord& other) const;
+ //double getAngle(const SGGeoCoord& other) const;
virtual void print() {} ;
virtual const char * getDescription() {return 0;};
};
-typedef vector<GeoCoord*> GeoCoordVector;
-typedef vector<GeoCoord*>::iterator GeoCoordVectorIterator;
-typedef vector<GeoCoord*>::const_iterator GeoCoordVectorConstIterator;
+typedef vector<SGGeoCoord*> SGGeoCoordVector;
+typedef vector<SGGeoCoord*>::iterator SGGeoCoordVectorIterator;
+typedef 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;
};
zone.append( "zone.tab" );
SG_LOG( SG_EVENT, SG_INFO, "Reading timezone info from: "
<< zone.str() );
- tzContainer = new TimezoneContainer( zone.c_str() );
+ tzContainer = new SGTimeZoneContainer( zone.c_str() );
- GeoCoord location( SGD_RADIANS_TO_DEGREES * lat, SGD_RADIANS_TO_DEGREES * lon );
- GeoCoord* nearestTz = tzContainer->getNearest(location);
+ SGGeoCoord location( SGD_RADIANS_TO_DEGREES * lat, SGD_RADIANS_TO_DEGREES * lon );
+ SGGeoCoord* nearestTz = tzContainer->getNearest(location);
SGPath name( root );
name.append( nearestTz->getDescription() );
SGTime::~SGTime()
{
if ( tzContainer != NULL ) {
- TimezoneContainer *tmp = tzContainer;
+ SGTimeZoneContainer *tmp = tzContainer;
tzContainer = NULL;
delete tmp;
}
}
time_t currGMT;
time_t aircraftLocalTime;
- GeoCoord location( SGD_RADIANS_TO_DEGREES * lat, SGD_RADIANS_TO_DEGREES * lon );
- GeoCoord* nearestTz = tzContainer->getNearest(location);
+ SGGeoCoord location( SGD_RADIANS_TO_DEGREES * lat, SGD_RADIANS_TO_DEGREES * lon );
+ SGGeoCoord* nearestTz = tzContainer->getNearest(location);
SGPath zone( root );
zone.append ( nearestTz->getDescription() );
zonename = zone.str();
private:
// tzContainer stores all the current Timezone control points/
- TimezoneContainer* tzContainer;
+ SGTimeZoneContainer* tzContainer;
// Points to the current local timezone name;
string zonename;
/*************************************************************************
*
- * Timezone is derived from geocoord, and stores the timezone centerpoint,
+ * SGTimeZone is derived from geocoord, and stores the timezone centerpoint,
* as well as the countrycode and the timezone descriptor. The latter is
* used in order to get the local time.
*
#include <stdio.h>
#include "timezone.h"
-Timezone::Timezone(float la, float lo, char* cc, char* desc) :
- GeoCoord(la, lo)
+SGTimeZone::SGTimeZone(float la, float lo, char* cc, char* desc) :
+ SGGeoCoord(la, lo)
{
countryCode = cc;
descriptor = desc;
}
/* Build a timezone object from a textline in zone.tab */
-Timezone::Timezone(const char *infoString) :
- GeoCoord()
+SGTimeZone::SGTimeZone(const char *infoString) :
+ SGGeoCoord()
{
int i = 0;
while (infoString[i] != '\t')
}
/* the copy constructor */
-Timezone::Timezone(const Timezone& other)
+SGTimeZone::SGTimeZone(const SGTimeZone& other)
{
lat = other.getLat();
lon = other.getLon();
}
-/********* Member functions for TimezoneContainer class ********/
+/********* Member functions for SGTimeZoneContainer class ********/
-TimezoneContainer::TimezoneContainer(const char *filename)
+SGTimeZoneContainer::SGTimeZoneContainer(const char *filename)
{
char buffer[256];
FILE* infile = fopen(filename, "rb");
}
}
if (buffer[0]) {
- data.push_back(new Timezone(buffer));
+ data.push_back(new SGTimeZone(buffer));
}
}
if ( errno ) {
- perror( "TimezoneContainer()" );
+ perror( "SGTimeZoneContainer()" );
errno = 0;
}
}
}
-TimezoneContainer::~TimezoneContainer()
+SGTimeZoneContainer::~SGTimeZoneContainer()
{
}
*
**************************************************************************/
-/*************************************************************************
+/** \file timezone.h
*
- * Timezone is derived from geocoord, and stores the timezone centerpoint,
- * as well as the countrycode and the timezone descriptor. The latter is
- * used in order to get the local time.
+ * Provides SGTimeZone and SGTimeZoneContainer
*
- ************************************************************************/
+ */
#ifndef _TIMEZONE_H_
#define _TIMEZONE_H_
#include <simgear/timing/geocoord.h>
-class Timezone : public GeoCoord
+/**
+ * SGTimeZone is derived from geocoord, and stores the timezone centerpoint,
+ * as well as the countrycode and the timezone descriptor. The latter is
+ * used in order to get the local time.
+ *
+ */
+
+class SGTimeZone : public SGGeoCoord
{
+
private:
+
string countryCode;
string descriptor;
public:
- Timezone() :
- GeoCoord()
- {
- countryCode.erase();
- descriptor.erase();
+
+ /**
+ * Default constructor.
+ */
+ SGTimeZone() : SGGeoCoord()
+ {
+ countryCode.erase();
+ descriptor.erase();
};
- Timezone(float la, float lo, char* cc, char* desc);
- Timezone(const char *infoString);
- Timezone(const Timezone &other);
- virtual ~Timezone() { };
+
+ /**
+ * Build a timezone object with a specifed latitude, longitude, country
+ * code, and descriptor
+ * @param la latitude
+ * @param lo longitude
+ * @param cc country code
+ * @param desc descriptor
+ */
+ SGTimeZone(float la, float lo, char* cc, char* desc);
+
+ /**
+ * Build a timezone object from a textline in zone.tab
+ * @param infoString the textline from zone.tab
+ */
+ SGTimeZone(const char *infoString);
+
+ /**
+ * The copy constructor
+ * @param other the source object
+ */
+ SGTimeZone(const SGTimeZone &other);
+
+ /**
+ * Virutal destructor
+ */
+ virtual ~SGTimeZone() { };
+ /**
+ * Print the descriptor string
+ */
+ virtual void print() { printf("%s", descriptor.c_str()); }
- virtual void print() { printf("%s", descriptor.c_str());};
- virtual const char * getDescription() { return descriptor.c_str(); };
+ /**
+ * Return the descriptor string
+ * @return descriptor string (char array)
+ */
+ virtual const char * getDescription() { return descriptor.c_str(); };
};
-/************************************************************************
- * Timezone container is derived from GeoCoordContainer, and has some
+/**
+ * SGTimeZoneContainer is derived from SGGeoCoordContainer, and has some
* added functionality.
- ************************************************************************/
+ */
-class TimezoneContainer : public GeoCoordContainer
+class SGTimeZoneContainer : public SGGeoCoordContainer
{
public:
- TimezoneContainer(const char *filename);
- virtual ~TimezoneContainer();
+ SGTimeZoneContainer(const char *filename);
+ virtual ~SGTimeZoneContainer();
};