Compare commits

..

4 Commits

Author SHA1 Message Date
curt
27f98d24eb Various 0.3.3 last minute tweaks. 2003-06-03 18:48:49 +00:00
curt
51ef4568dd Various documentation tweaks and additions. 2003-06-03 18:32:51 +00:00
curt
4c731de8b7 Tweaks to doxygen comments. 2003-06-03 18:22:10 +00:00
ehofman
fc692cb540 compiler fixes 2003-06-03 13:30:07 +00:00
17 changed files with 250 additions and 112 deletions

View File

@@ -22,7 +22,7 @@ PROJECT_NAME = SimGear
# This could be handy for archiving the generated documentation or
# if some version control system is used.
PROJECT_NUMBER = 0.3.2
PROJECT_NUMBER = 0.3.3
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.
@@ -308,12 +308,14 @@ INPUT = \
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

View File

@@ -18,31 +18,61 @@
* 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.
* - A threading abstraction.
*
* - 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. (SGThread)
*
* - A simple but highly functional XML parser that interfaces nicely
* with the property manager.
* with the property manager. (easyxml.hxx)
* \section supports Supported Platforms
* SimGear has been built on the following platforms:
@@ -69,10 +99,5 @@
*
* SimGear is licensed under the terms of the LGPL
* \section install Installation
*
* \subsection step1 Step 1: Opening the box
*
* etc...
*/

View File

@@ -11,7 +11,7 @@ EXTRA_DIST = \
SUBDIRS = src-libs simgear
dist-hook:
(cd $(top_srcdir); $(HOME)/projects/FlightGear-0.7/admin/am2dsp.pl)
(cd $(top_srcdir); $(HOME)/projects/FlightGear-0.9/admin/am2dsp.pl)
#
# Rule to build RPM distribution package

7
NEWS
View File

@@ -1,3 +1,10 @@
New in 0.3.3
* June 3, 2003
* Fix a compile problem for cygwin
* Updated/tweaked doxygen documentation in several areas
New in 0.3.2
* June 2, 2003

View File

@@ -10,7 +10,7 @@ dnl Require at least automake 2.52
AC_PREREQ(2.52)
dnl Initialize the automake stuff
AM_INIT_AUTOMAKE(SimGear, 0.3.2)
AM_INIT_AUTOMAKE(SimGear, 0.3.3)
dnl Specify KAI C++ compiler and flags.
dnl Borrowed with slight modification from blitz distribution.

View File

@@ -88,9 +88,18 @@ int geo_direct_wgs_84 ( const double& alt, const double& lat1,
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,

View File

@@ -22,9 +22,9 @@
// $Id$
// #ifdef HAVE_CONFIG_H
// # include <config.h>
// #endif
#ifdef HAVE_CONFIG_H
# include <simgear_config.h>
#endif
#include <simgear/compiler.h>

View File

@@ -1,5 +1,4 @@
/**
* \file texture.cxx
/*
* Texture manipulation routines
*
* Copyright (c) Mark J. Kilgard, 1997.

View File

@@ -1,3 +1,14 @@
/**
* \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
@@ -7,6 +18,10 @@
#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:

View File

@@ -20,6 +20,12 @@
//
// $Id$
/**
* \file sound.hxx
* Provides a class to manage a single sound event including things
* like looping, volume and pitch changes.
*/
#ifndef _SG_SOUND_HXX
#define _SG_SOUND_HXX 1

View File

@@ -23,6 +23,12 @@
//
// $Id$
/**
* \file soundmgr.hxx
* Provides a sound manager class to keep track of
* multiple sounds and manage playing them with different effects and
* timings.
*/
#ifndef _SG_SOUNDMGR_HXX
#define _SG_SOUNDMGR_HXX 1
@@ -44,7 +50,9 @@ SG_USING_STD(map);
SG_USING_STD(string);
// manages everything we need to know for an individual sound sample
/**
* manages everything we need to know for an individual sound sample
*/
class SGSimpleSound {
private:
@@ -101,6 +109,9 @@ typedef sound_map::iterator sound_map_iterator;
typedef sound_map::const_iterator const_sound_map_iterator;
/**
* Manage a collection of SGSimpleSound instances
*/
class SGSoundMgr
{
@@ -154,43 +165,67 @@ public:
void resume ();
// is audio working?
/**
* is audio working?
*/
inline bool is_working() const { return !audio_sched->notWorking(); }
// reinitialize the sound manager
/**
* reinitialize the sound manager
*/
inline void reinit() { init(); }
// add a sound effect, return true if successful
/**
* add a sound effect, return true if successful
*/
bool add( SGSimpleSound *sound, const string& refname);
// add a sound file, return the sample if successful, else return NULL
/**
* add a sound file, return the sample if successful, else return NULL
*/
SGSimpleSound *add( const string& refname,
const char *path, const char *file = NULL );
// remove a sound effect, return true if successful
/**
* remove a sound effect, return true if successful
*/
bool remove( const string& refname );
// return true of the specified sound exists in the sound manager system
/**
* return true of the specified sound exists in the sound manager system
*/
bool exists( const string& refname );
// return a pointer to the SGSimpleSound if the specified sound
// exists in the sound manager system, otherwise return NULL
SGSimpleSound *find( const string& refname );
/**
* return a pointer to the SGSimpleSound if the specified sound
* exists in the sound manager system, otherwise return NULL
*/
SGSimpleSound *find( const string& refname );
// tell the scheduler to play the indexed sample in a continuous
// loop
/**
* tell the scheduler to play the indexed sample in a continuous
* loop
*/
bool play_looped( const string& refname );
// tell the scheduler to play the indexed sample once
/**
* tell the scheduler to play the indexed sample once
*/
bool play_once( const string& refname );
// return true of the specified sound is currently being played
/**
* return true of the specified sound is currently being played
*/
bool is_playing( const string& refname );
// immediate stop playing the sound
/**
* immediate stop playing the sound
*/
bool stop( const string& refname );
// return the audio scheduler
/**
* return the audio scheduler
*/
inline slScheduler *get_scheduler( ) { return audio_sched; };
};

View File

@@ -22,7 +22,7 @@
/*************************************************************************
*
* 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.
@@ -31,13 +31,13 @@
#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());
@@ -57,11 +57,11 @@ GeoCoord::GeoCoord(const GeoCoord& other)
// 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);
@@ -75,12 +75,12 @@ GeoCoord::GeoCoord(const GeoCoord& other)
// }
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());
@@ -95,9 +95,9 @@ GeoCoord* GeoCoordContainer::getNearest(const GeoCoord& ref) const
}
GeoCoordContainer::~GeoCoordContainer()
SGGeoCoordContainer::~SGGeoCoordContainer()
{
GeoCoordVectorIterator i = data.begin();
SGGeoCoordVectorIterator i = data.begin();
while (i != data.end())
delete *i++;
}

View File

@@ -47,17 +47,17 @@ 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; };
@@ -67,32 +67,32 @@ public:
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;
};

View File

@@ -94,10 +94,10 @@ void SGTime::init( double lon, double lat,
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() );
@@ -129,7 +129,7 @@ SGTime::SGTime() {
SGTime::~SGTime()
{
if ( tzContainer != NULL ) {
TimezoneContainer *tmp = tzContainer;
SGTimeZoneContainer *tmp = tzContainer;
tzContainer = NULL;
delete tmp;
}
@@ -290,8 +290,8 @@ void SGTime::updateLocal( double lon, double lat, const string& root ) {
}
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();

View File

@@ -69,7 +69,7 @@ class SGTime {
private:
// tzContainer stores all the current Timezone control points/
TimezoneContainer* tzContainer;
SGTimeZoneContainer* tzContainer;
// Points to the current local timezone name;
string zonename;

View File

@@ -21,7 +21,7 @@
/*************************************************************************
*
* 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.
*
@@ -32,16 +32,16 @@
#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')
@@ -111,7 +111,7 @@ Timezone::Timezone(const char *infoString) :
}
/* the copy constructor */
Timezone::Timezone(const Timezone& other)
SGTimeZone::SGTimeZone(const SGTimeZone& other)
{
lat = other.getLat();
lon = other.getLon();
@@ -120,9 +120,9 @@ Timezone::Timezone(const Timezone& other)
}
/********* 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");
@@ -144,16 +144,16 @@ TimezoneContainer::TimezoneContainer(const char *filename)
}
}
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()
{
}

View File

@@ -19,13 +19,11 @@
*
**************************************************************************/
/*************************************************************************
/** \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_
@@ -34,39 +32,81 @@
#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();
};
Timezone(float la, float lo, char* cc, char* desc);
Timezone(const char *infoString);
Timezone(const Timezone &other);
virtual ~Timezone() { };
virtual void print() { printf("%s", descriptor.c_str());};
virtual const char * getDescription() { return descriptor.c_str(); };
/**
* Default constructor.
*/
SGTimeZone() : SGGeoCoord()
{
countryCode.erase();
descriptor.erase();
};
/**
* 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()); }
/**
* 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();
};