This commit is contained in:
curt 2001-03-25 12:45:13 +00:00
parent 7781498181
commit 5348f4eafe
5 changed files with 115 additions and 68 deletions

View File

@ -1,10 +1,13 @@
// props.hxx - interface definition for a property list. /**
// Started Fall 2000 by David Megginson, david@megginson.com * \file props.hxx
// This code is released into the Public Domain. * Interface definition for a property list.
// * Started Fall 2000 by David Megginson, david@megginson.com
// See props.html for documentation [replace with URL when available]. * This code is released into the Public Domain.
// *
// $Id$ * See props.html for documentation [replace with URL when available].
*
* $Id$
*/
#ifndef __PROPS_HXX #ifndef __PROPS_HXX
#define __PROPS_HXX #define __PROPS_HXX
@ -288,16 +291,15 @@ private:
//////////////////////////////////////////////////////////////////////// /**
// A cooked value. * A cooked value.
// *
// This is the value that property-list clients see. It is a * This is the value that property-list clients see. It is a
// persistent layer over the possibly-changing raw value; once a * persistent layer over the possibly-changing raw value; once a
// client gets an SGValue from the property manager, the pointer * client gets an SGValue from the property manager, the pointer
// will be good for the life of the property manager itself, no * will be good for the life of the property manager itself, no
// matter how often the pointer is tied or untied. * matter how often the pointer is tied or untied.
//////////////////////////////////////////////////////////////////////// */
class SGValue class SGValue
{ {
public: public:
@ -374,10 +376,9 @@ private:
//////////////////////////////////////////////////////////////////////// /**
// A node in a property tree. * A node in a property tree.
//////////////////////////////////////////////////////////////////////// */
class SGPropertyNode class SGPropertyNode
{ {

View File

@ -1,12 +1,20 @@
/*************************************************************************** /**
* stopwatch.hxx Timer class, for use in benchmarking * \file stopwatch.hxx
* * Timer class, for use in benchmarking
* Based on blitz/Timer.h * Based on blitz/Timer.h
* *
* $Id$
*
* Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca> * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
* *
* Suggestions: blitz-suggest@cybervision.com
* Bugs: blitz-bugs@cybervision.com
*
* For more information, please see the Blitz++ Home Page:
* http://seurat.uwaterloo.ca/blitz/
*/
/*
* $Id$
*
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
@ -22,12 +30,6 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA. * Boston, MA 02111-1307, USA.
* *
* Suggestions: blitz-suggest@cybervision.com
* Bugs: blitz-bugs@cybervision.com
*
* For more information, please see the Blitz++ Home Page:
* http://seurat.uwaterloo.ca/blitz/
*
*/ */
// This class is not portable to non System V platforms. // This class is not portable to non System V platforms.
@ -66,30 +68,34 @@
# include <time.h> # include <time.h>
#endif #endif
/**
* A high resolutions timing class
*/
class StopWatch { class StopWatch {
public: public:
StopWatch() /** Constructor */
{ StopWatch() {
// state_ = uninitialized; // state_ = uninitialized;
} }
void start() /** Start counting time */
{ void start() {
// state_ = running; // state_ = running;
t1_ = systemTime(); t1_ = systemTime();
} }
void stop() /** Stop counting time */
{ void stop() {
t2_ = systemTime(); t2_ = systemTime();
// BZPRECONDITION(state_ == running); // BZPRECONDITION(state_ == running);
// state_ = stopped; // state_ = stopped;
} }
/** @return the elapsed time between start and stop */
double elapsedSeconds() double elapsedSeconds()
{ {
// BZPRECONDITION(state_ == stopped); // BZPRECONDITION(state_ == stopped);
return t2_ - t1_; return t2_ - t1_;
} }

View File

@ -1,5 +1,8 @@
// String utilities. /**
// * \file strutils.hxx
* String utilities.
*/
// Written by Bernie Bright, 1998 // Written by Bernie Bright, 1998
// //
// Copyright (C) 1998 Bernie Bright - bbright@c031.aone.net.au // Copyright (C) 1998 Bernie Bright - bbright@c031.aone.net.au
@ -21,6 +24,7 @@
// //
// $Id$ // $Id$
#ifndef STRUTILS_H #ifndef STRUTILS_H
#define STRUTILS_H #define STRUTILS_H
@ -36,26 +40,27 @@
SG_USING_STD(string); SG_USING_STD(string);
// Default characters to remove.
/** Default characters to remove. */
extern const string whitespace; extern const string whitespace;
// Returns a string with trailing characters removed. /** Returns a string with trailing characters removed. */
string trimleft( const string& s, const string& trimmings = whitespace ); string trimleft( const string& s, const string& trimmings = whitespace );
// Returns a string with leading characters removed. /** Returns a string with leading characters removed. */
string trimright( const string& s, const string& trimmings = whitespace ); string trimright( const string& s, const string& trimmings = whitespace );
// Returns a string with leading and trailing characters removed. /** Returns a string with leading and trailing characters removed. */
string trim( const string& s, const string& trimmings = whitespace ); string trim( const string& s, const string& trimmings = whitespace );
//----------------------------------------------------------------------------- /** atof() wrapper for "string" type */
inline double inline double
atof( const string& str ) atof( const string& str )
{ {
return ::atof( str.c_str() ); return ::atof( str.c_str() );
} }
/** atoi() wrapper for "string" type */
inline int inline int
atoi( const string& str ) atoi( const string& str )
{ {

View File

@ -1,5 +1,8 @@
// texcoord.hxx -- routine(s) to handle texture coordinate generation /**
// * \file texcoord.hxx
* Routine to handle texture coordinate generation.
*/
// Written by Curtis Olson, started March 1999. // Written by Curtis Olson, started March 1999.
// //
// Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org // Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org
@ -35,8 +38,15 @@
#include <simgear/math/sg_types.hxx> #include <simgear/math/sg_types.hxx>
// traverse the specified fan/strip/list of vertices and attempt to /**
// calculate "none stretching" texture coordinates * Traverse the specified fan/strip/list of vertices and attempt to
* calculate "none stretching" texture coordinates.
* @param b the bucket containing the structure
* @param geod_nodes vertices in geodetic coordinates
* @param fan integer list of indices pointing into the vertex list
* @param scale (default = 1.0) scaling factor
* @return list of texture coordinates
*/
point_list calc_tex_coords( const SGBucket& b, const point_list& geod_nodes, point_list calc_tex_coords( const SGBucket& b, const point_list& geod_nodes,
const int_list& fan, double scale = 1.0 ); const int_list& fan, double scale = 1.0 );

View File

@ -1,5 +1,8 @@
// A C++ I/O streams interface to the zlib gz* functions /**
// * \file zfstream.hxx
* A C++ I/O streams interface to the zlib gz* functions.
*/
// Written by Bernie Bright, 1998 // Written by Bernie Bright, 1998
// Based on zlib/contrib/iostream/ by Kevin Ruland <kevin@rodin.wustl.edu> // Based on zlib/contrib/iostream/ by Kevin Ruland <kevin@rodin.wustl.edu>
// //
@ -96,10 +99,9 @@ SG_USING_STD(streamoff);
#endif // SG_HAVE_STD_INCLUDES #endif // SG_HAVE_STD_INCLUDES
//----------------------------------------------------------------------------- /**
// * A C++ I/O streams interface to the zlib gz* functions.
// */
//
class gzfilebuf : public streambuf class gzfilebuf : public streambuf
{ {
public: public:
@ -111,17 +113,41 @@ public:
// typedef char_traits<char>::off_type off_type; // typedef char_traits<char>::off_type off_type;
#endif #endif
/** Constructor */
gzfilebuf(); gzfilebuf();
/** Destructor */
virtual ~gzfilebuf(); virtual ~gzfilebuf();
/**
* Open a stream
* @param name file name
* @param io_mode mdoe flags
* @return file stream
*/
gzfilebuf* open( const char* name, ios_openmode io_mode ); gzfilebuf* open( const char* name, ios_openmode io_mode );
/**
* Attach to an existing file descriptor
* @param file_descriptor file descriptor
* @param io_mode mode flags
* @return file stream
*/
gzfilebuf* attach( int file_descriptor, ios_openmode io_mode ); gzfilebuf* attach( int file_descriptor, ios_openmode io_mode );
/** Close stream */
gzfilebuf* close(); gzfilebuf* close();
// int setcompressionlevel( int comp_level ); // int setcompressionlevel( int comp_level );
// int setcompressionstrategy( int comp_strategy ); // int setcompressionstrategy( int comp_strategy );
/** @return true if open, false otherwise */
bool is_open() const { return (file != NULL); } bool is_open() const { return (file != NULL); }
/** @return stream position */
virtual streampos seekoff( streamoff off, ios_seekdir way, int which ); virtual streampos seekoff( streamoff off, ios_seekdir way, int which );
/** sync the stream */
virtual int sync(); virtual int sync();
protected: protected:
@ -155,15 +181,14 @@ private:
void operator= ( const gzfilebuf& ); void operator= ( const gzfilebuf& );
}; };
//----------------------------------------------------------------------------- /**
// * document me
// */
//
struct gzifstream_base struct gzifstream_base
{ {
gzifstream_base() {} gzifstream_base() {}
gzfilebuf gzbuf; Gzfilebuf gzbuf;
}; };
#endif // _zfstream_hxx #endif // _zfstream_hxx