You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(47) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(140) |
Feb
(98) |
Mar
(152) |
Apr
(104) |
May
(71) |
Jun
(94) |
Jul
(169) |
Aug
(83) |
Sep
(47) |
Oct
(134) |
Nov
(7) |
Dec
(20) |
2004 |
Jan
(41) |
Feb
(14) |
Mar
(42) |
Apr
(47) |
May
(68) |
Jun
(143) |
Jul
(65) |
Aug
(29) |
Sep
(40) |
Oct
(34) |
Nov
(33) |
Dec
(97) |
2005 |
Jan
(29) |
Feb
(30) |
Mar
(9) |
Apr
(37) |
May
(13) |
Jun
(31) |
Jul
(22) |
Aug
(23) |
Sep
|
Oct
(37) |
Nov
(34) |
Dec
(117) |
2006 |
Jan
(48) |
Feb
(6) |
Mar
(2) |
Apr
(71) |
May
(10) |
Jun
(16) |
Jul
(7) |
Aug
(1) |
Sep
(14) |
Oct
(17) |
Nov
(25) |
Dec
(26) |
2007 |
Jan
(8) |
Feb
(2) |
Mar
(7) |
Apr
(26) |
May
|
Jun
(12) |
Jul
(30) |
Aug
(14) |
Sep
(9) |
Oct
(4) |
Nov
(7) |
Dec
(6) |
2008 |
Jan
(10) |
Feb
(10) |
Mar
(6) |
Apr
(8) |
May
|
Jun
(10) |
Jul
(18) |
Aug
(15) |
Sep
(16) |
Oct
(5) |
Nov
(3) |
Dec
(10) |
2009 |
Jan
(11) |
Feb
(2) |
Mar
|
Apr
(15) |
May
(31) |
Jun
(18) |
Jul
(11) |
Aug
(26) |
Sep
(52) |
Oct
(17) |
Nov
(4) |
Dec
|
2010 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <mk...@us...> - 2003-08-18 03:47:13
|
Update of /cvsroot/csp/APPLICATIONS/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv11553 Modified Files: CHANGES.current Log Message: Index: CHANGES.current =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/CHANGES.current,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** CHANGES.current 17 Aug 2003 18:40:57 -0000 1.69 --- CHANGES.current 18 Aug 2003 03:47:10 -0000 1.70 *************** *** 5,8 **** --- 5,24 ---- Fixed assertion range errors in Matrix3.h + Moved template metaprogramming structs into the + 'meta' namespace in PTS.h. + + Removed GlibCsp.h includes in GeoPos.cpp and + DataArchive.cpp, with associated fixups. + + Added byte-order tests to Uniform.h. + + Tried adding template-meta-programming-style fixed + integer size typedef mappings (e.g. uint32), but + SWIG chokes on these so it's back to hard-coded + typedefs. For now these should work on most systems + that SimData is likely to run on. Autoconf is the + obvious alternative, but I'd rather not use it at + this point. + 2003-08-16: onsight Replaced several old-school buffer allocations with |
From: <mk...@us...> - 2003-08-17 18:40:59
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Include/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv11214/Include/SimData Modified Files: Matrix3.h Log Message: Index: Matrix3.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Matrix3.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Matrix3.h 16 Aug 2003 10:29:43 -0000 1.11 --- Matrix3.h 17 Aug 2003 18:40:57 -0000 1.12 *************** *** 136,150 **** Vector3 getRow(int i) { ! assert(i>0 && i<3); return Vector3(_mat[i][0], _mat[i][1], _mat[i][2]); } Vector3 getCol(int i) { ! assert(i>0 && i<3); return Vector3(_mat[0][i], _mat[1][i], _mat[2][i]); } void setRow(int i, const Vector3& v) { ! assert(i>0 && i<3); _mat[i][0] = v.x(); _mat[i][1] = v.y(); --- 136,150 ---- Vector3 getRow(int i) { ! assert(i>=0 && i<3); return Vector3(_mat[i][0], _mat[i][1], _mat[i][2]); } Vector3 getCol(int i) { ! assert(i>=0 && i<3); return Vector3(_mat[0][i], _mat[1][i], _mat[2][i]); } void setRow(int i, const Vector3& v) { ! assert(i>=0 && i<3); _mat[i][0] = v.x(); _mat[i][1] = v.y(); *************** *** 153,157 **** void setCol(int i, const Vector3& v) { ! assert(i>0 && i<3); _mat[0][i] = v.x(); _mat[1][i] = v.y(); --- 153,157 ---- void setCol(int i, const Vector3& v) { ! assert(i>=0 && i<3); _mat[0][i] = v.x(); _mat[1][i] = v.y(); *************** *** 159,163 **** } ! double * row(int i) { assert(i>0 && i<3); return (double*)(_mat[i]); } double * ptr() { return (double *)_mat; } double * ptr() const { return (double *)_mat; } --- 159,163 ---- } ! double * row(int i) { assert(i>=0 && i<3); return (double*)(_mat[i]); } double * ptr() { return (double *)_mat; } double * ptr() const { return (double *)_mat; } |
From: <mk...@us...> - 2003-08-17 18:40:59
|
Update of /cvsroot/csp/APPLICATIONS/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv11214 Modified Files: CHANGES.current Log Message: Index: CHANGES.current =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/CHANGES.current,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** CHANGES.current 17 Aug 2003 08:03:44 -0000 1.68 --- CHANGES.current 17 Aug 2003 18:40:57 -0000 1.69 *************** *** 2,5 **** --- 2,8 ---- =========================== + 2003-08-17: onsight + Fixed assertion range errors in Matrix3.h + 2003-08-16: onsight Replaced several old-school buffer allocations with |
From: <mk...@us...> - 2003-08-17 18:39:55
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Tools/Terrain/tile In directory sc8-pr-cvs1:/tmp/cvs-serv10975/Tools/Terrain/tile Modified Files: Makefile tile.cpp Log Message: Index: Makefile =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Tools/Terrain/tile/Makefile,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Makefile 13 Aug 2003 11:47:07 -0000 1.4 --- Makefile 17 Aug 2003 18:39:51 -0000 1.5 *************** *** 5,9 **** csptile: tile.cpp ! g++ -O2 -g $^ -o $@ -I$(PYTHONINC) -L$(PYTHONLIB)/SimData -lSimData -lz --- 5,9 ---- csptile: tile.cpp ! g++ -W -Wall -O2 -g $^ -o $@ -I$(PYTHONINC) -L$(PYTHONLIB)/SimData -lSimData -lz Index: tile.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Tools/Terrain/tile/tile.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tile.cpp 13 Aug 2003 11:47:08 -0000 1.4 --- tile.cpp 17 Aug 2003 18:39:51 -0000 1.5 *************** *** 36,39 **** --- 36,40 ---- #include <list> #include <map> + #include <cassert> #include <zlib.h> *************** *** 81,89 **** ! /** ! * ElevationFinder compiles multiple elevation samples to produce ! * a local average elevation. This is primarily intended to deal ! * with grid irregularities at quad edges, but can be extended to ! * do subsampling. */ class ElevationFinder { --- 82,90 ---- ! /** ElevationFinder compiles multiple elevation samples to produce ! * a local average elevation. ! * ! * This is primarily intended to deal with grid irregularities at ! * quad edges, but can be extended to do subsampling. */ class ElevationFinder { *************** *** 97,105 **** UTM utm, adjusted; public: ! /** ! * Construct a new ElevationFinder. * ! * @param utm_ the UTM coordinates of the point of interest. ! * @param length the range of influence for each elevation sample. */ ElevationFinder(UTM const &utm_, double length) { --- 98,105 ---- UTM utm, adjusted; public: ! /** Construct a new ElevationFinder. * ! * @param utm_ the UTM coordinates of the point of interest. ! * @param length the range of influence for each elevation sample. */ ElevationFinder(UTM const &utm_, double length) { *************** *** 111,119 **** } ! /** ! * Get the UTM coordinate of the finder, adapted to the UTM ! * zone of the current quad. The resulting coordinates may ! * not be strictly valid, but are useful in dealing with ! * quad edges at zone boundaries. */ UTM const &getUTM(int zone) { --- 111,119 ---- } ! /** Get the UTM coordinate of the finder, adapted to the UTM ! * zone of the current quad. ! * ! * The resulting coordinates may not be strictly valid, but ! * are useful in dealing with quad edges at zone boundaries. */ UTM const &getUTM(int zone) { *************** *** 127,133 **** } ! /** ! * Returns true if this quad contains the point. Returns ! * false during calls to neighboring (hinted) quads. */ bool isPrimary() const { --- 127,134 ---- } ! /** Test if the quad contains the point. ! * ! * @returns true if this quad contains the point, and ! * false during calls to neighboring (hinted) quads. */ bool isPrimary() const { *************** *** 135,141 **** } ! /** ! * Get the elevation by computing a weighted sum of elevation ! * samples from surrounding points. */ double getElevation() { --- 136,141 ---- } ! /** Get the elevation by computing a weighted sum of elevation ! * samples from surrounding points. */ double getElevation() { *************** *** 171,184 **** } ! /** ! * Add an elevation sample. * ! * @param e the elevation in meters ! * @praam d2 the squared distance from the elevation sample to the ! * point. */ void setPartialElevation(double e, double d2) { //std::cout << "setE " << e << ", " << d2 << "\n"; ! assert(e_part.size() == n_parts); e_part.push_back(e); d2_part.push_back(d2); --- 171,183 ---- } ! /** Add an elevation sample. * ! * @param e the elevation in meters ! * @praam d2 the squared distance from the elevation sample to the ! * point. */ void setPartialElevation(double e, double d2) { //std::cout << "setE " << e << ", " << d2 << "\n"; ! assert(int(e_part.size()) == n_parts); e_part.push_back(e); d2_part.push_back(d2); *************** *** 186,193 **** } ! /** ! * Suggest neighhboring quads to check for elevation samples. This ! * is called by the primary quad when the point is near an edge and ! * may be close to samples in neighboring quads. */ void setHint(int dx, int dy) { --- 185,192 ---- } ! /** Suggest neighhboring quads to check for elevation samples. ! * ! * This is called by the primary quad when the point is near an edge ! * and may be close to samples in neighboring quads. */ void setHint(int dx, int dy) { *************** *** 197,208 **** } ! /** ! * Gets the next hint of other quads to check for elevation samples. * ! * @param dx the eastward position of the next hinted quad relative ! * to the primary quad. ! * @param dy the northward position of the next hinted quad relative ! * to the primary quad. ! * @returns true if no more hints remain. */ bool getHint(int &dx, int &dy) { --- 196,206 ---- } ! /** Gets the next hint of other quads to check for elevation samples. * ! * @param dx the eastward position of the next hinted quad relative ! * to the primary quad. ! * @param dy the northward position of the next hinted quad relative ! * to the primary quad. ! * @returns true if no more hints remain. */ bool getHint(int &dx, int &dy) { *************** *** 221,229 **** }; ! /** ! * Digital Elevation Model class. * ! * Reads DEM data from a DAT file and provides elevation sampling and edge ! * matching methods. */ class DEM { --- 219,226 ---- }; ! /** Digital Elevation Model class. * ! * Reads DEM data from a DAT file and provides elevation sampling and edge ! * matching methods. */ class DEM { *************** *** 279,287 **** #define READD(a) gzread(fp, &(a), sizeof(double)); #define READI(a) gzread(fp, &(a), sizeof(int)); ! /** ! * Construct a new DEM, loading data from the appropriate DAT file. * ! * @la latitude contained in the quad (in degrees) ! * @lo longitude contained in the quad (in degrees) */ DEM(double la, double lo, std::string const &datpath): zero(true) { --- 276,284 ---- #define READD(a) gzread(fp, &(a), sizeof(double)); #define READI(a) gzread(fp, &(a), sizeof(int)); ! ! /** Construct a new DEM, loading data from the appropriate DAT file. * ! * @la latitude contained in the quad (in degrees) ! * @lo longitude contained in the quad (in degrees) */ DEM(double la, double lo, std::string const &datpath): zero(true) { *************** *** 396,402 **** inline double getLongitude() const { return lon; } ! /** ! * Find the nearest elevation samples within a column and add them to ! * the finder (along with hints for neighboring quads to check). */ int addNearest(std::vector<DEMcol>::iterator &i, UTM const &utm, ElevationFinder &finder) { --- 393,401 ---- inline double getLongitude() const { return lon; } ! /** Find and add the nearest elevation samples in a column. ! * ! * Finds the nearest elevation samples within a column and adds ! * them to the finder (along with hints for neighboring quads to ! * check). */ int addNearest(std::vector<DEMcol>::iterator &i, UTM const &utm, ElevationFinder &finder) { *************** *** 441,446 **** } ! /** ! * Scale an elevation sample to meters above mean sea level. */ inline double _scale(double elevation) { --- 440,444 ---- } ! /** Scale an elevation sample to meters above mean sea level. */ inline double _scale(double elevation) { *************** *** 450,458 **** } ! /** ! * Get elevation samples for the finder. Currently this just searches ! * the two nearest columns for at most 4 elevation samples (2 per column). ! * Near the edges of a quad, fewer samples may be found but hints will be ! * provided of other nearby quads to check for additional samples. */ void getElevation(ElevationFinder &finder) { --- 448,457 ---- } ! /** Get elevation samples for the finder. ! * ! * Currently this just searches the two nearest columns for at most ! * 4 elevation samples (2 per column). Near the edges of a quad, ! * fewer samples may be found but hints will be provided of other ! * nearby quads to check for additional samples. */ void getElevation(ElevationFinder &finder) { *************** *** 495,499 **** //std::cout << E << " REL " << cols.begin()->E << " TIDX=" << t_idx << " OF " << cols.size() << "\n"; //std::cout << cols.begin()->E << " " << filename << utm.asString() << "\n"; ! int side = (col_idx > cols.size()/2) ? +1 : -1; int edge; edge = addNearest(i, utm, finder); --- 494,498 ---- //std::cout << E << " REL " << cols.begin()->E << " TIDX=" << t_idx << " OF " << cols.size() << "\n"; //std::cout << cols.begin()->E << " " << filename << utm.asString() << "\n"; ! int side = (col_idx > int(cols.size())/2) ? +1 : -1; int edge; edge = addNearest(i, utm, finder); *************** *** 818,827 **** }; ! /** ! * Tiler generates images of digital elevation data. * ! * The source data is projected onto a plane using a secant ! * gnomonic projection, and the resulting map is subdivided into ! * a grid of smaller elevation maps saved in 16-bit PGM format. */ class Tiler { --- 817,825 ---- }; ! /** Tiler generates images of digital elevation data. * ! * The source data is projected onto a plane using a secant ! * gnomonic projection, and the resulting map is subdivided into ! * a grid of smaller elevation maps saved in 16-bit PGM format. */ class Tiler { *************** *** 853,858 **** } ! /** ! * Read configuration setting from an ini file. */ bool initialize(char const *fn, char const *datpath, bool quiet=true) { --- 851,855 ---- } ! /** Read configuration setting from an ini file. */ bool initialize(char const *fn, char const *datpath, bool quiet=true) { *************** *** 1018,1023 **** } ! /** ! * Generate the tiles. */ void run() { --- 1015,1019 ---- } ! /** Generate the tiles. */ void run() { *************** *** 1058,1062 **** output->start(prefix, i, j); //output->setExtent(); ! generateTile(i, j, output, verbose); output->finish(); /* --- 1054,1058 ---- output->start(prefix, i, j); //output->setExtent(); ! generateTile(output, verbose); output->finish(); /* *************** *** 1085,1090 **** private: ! /** ! * Save a tile as a 16-bit portable graymap (PGM) image. */ void writeTilePGM(int i, int j, double scale, int offset, char const *id="") { --- 1081,1085 ---- private: ! /** Save a tile as a 16-bit portable graymap (PGM) image. */ void writeTilePGM(int i, int j, double scale, int offset, char const *id="") { *************** *** 1104,1113 **** } ! /** ! * Save a tile as a 24-bit portable pixmap (PPM) image, where ! * elevations are represented as RED << 16 | GREEN << 8 | BLUE. ! * Currently Demeter doesn't seem to support negative elevations, ! * so make sure the offset is large enough to prevent these from ! * occuring. */ void writeTilePPM(int i, int j, double scale, int offset, char const *id="") { --- 1099,1108 ---- } ! /** Save a tile as a 24-bit portable pixmap (PPM) image, where ! * elevations are represented as RED << 16 | GREEN << 8 | BLUE. ! * ! * Currently Demeter doesn't seem to support negative elevations, ! * so make sure the offset is large enough to prevent these from ! * occuring. */ void writeTilePPM(int i, int j, double scale, int offset, char const *id="") { *************** *** 1139,1148 **** } ! /** ! * Generate a relief map (in-place) from the 16-bit elevation data */ void relief(double depth) { int n = tile_x_size*tile_y_size; - int nl = 0; short *d = tile; short *e = d++; --- 1134,1141 ---- } ! /** Generate a relief map (in-place) from the 16-bit elevation data */ void relief(double depth) { int n = tile_x_size*tile_y_size; short *d = tile; short *e = d++; *************** *** 1152,1158 **** } ! /** ! * Secant gnomonic (inverse) projection from the (x, y) plane ! * to latitude and longitude. */ void project(double x, double y, double &lat, double &lon) { --- 1145,1150 ---- } ! /** Secant gnomonic (inverse) projection from the (x, y) plane ! * to latitude and longitude. */ void project(double x, double y, double &lat, double &lon) { *************** *** 1163,1170 **** } ! /** ! * Get the DEM quad that contains a given latitude and longitude. ! * Quads are cached to minimize uncompressing and loading of the ! * data. */ DEM* getDEM(double lat, double lon) { --- 1155,1162 ---- } ! /** Get the DEM quad that contains a given latitude and longitude. ! * ! * Quads are cached to minimize uncompressing and loading of the ! * data. */ DEM* getDEM(double lat, double lon) { *************** *** 1203,1209 **** } ! /** ! * Get the elevation above sea level (in meters) for a given ! * point on the (x,y) plane. */ double getElevation(double x, double y) { --- 1195,1200 ---- } ! /** Get the elevation above sea level (in meters) for a given ! * point on the (x,y) plane. */ double getElevation(double x, double y) { *************** *** 1237,1245 **** } ! /** ! * Generate the projected elevation data for one tile. */ ! void generateTile(int tx, int ty, OutputHeightMap *output, bool verbose) { ! int i, j; double x, y, z; double x0, y0; --- 1228,1234 ---- } ! /** Generate the projected elevation data for one tile. */ ! void generateTile(OutputHeightMap *output, bool verbose) { double x, y, z; double x0, y0; |
From: <mk...@us...> - 2003-08-17 18:39:54
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Tools/Terrain/dem2dat In directory sc8-pr-cvs1:/tmp/cvs-serv10975/Tools/Terrain/dem2dat Modified Files: Makefile dem2dat.h Log Message: Index: Makefile =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Tools/Terrain/dem2dat/Makefile,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Makefile 13 Aug 2003 11:34:30 -0000 1.3 --- Makefile 17 Aug 2003 18:39:51 -0000 1.4 *************** *** 2,17 **** PYTHONINC = /usr/include/python2.2 all: dem2dat dem2dat: dem2dat.cpp dem2dat.h ! g++ -O2 -g dem2dat.cpp -o dem2dat -I$(PYTHONINC) -L$(PYTHONLIB)/SimData -lSimData -lz python: dem2dat_wrap.o ! g++ -shared -lswigpy -ldl -o _dem2dat.so dem2dat_wrap.o -L$(PYTHONLIB)/SimData -lSimData -lz dem2dat_wrap.o: dem2dat_wrap.cxx ! g++ -c -fPIC -O2 -g dem2dat_wrap.cxx -I$(PYTHONINC) dem2dat_wrap.cxx: dem2dat.i dem2dat.h ! swig -c -c++ -python -noexcept -I$(PYTHONINC) dem2dat.i --- 2,21 ---- PYTHONINC = /usr/include/python2.2 + CXX = g++ + CXXFLAGS = -O2 -g -W -Wall + SWIG = swig + all: dem2dat dem2dat: dem2dat.cpp dem2dat.h ! $(CXX) $(CXXFLAGS) dem2dat.cpp -o dem2dat -I$(PYTHONINC) -L$(PYTHONLIB)/SimData -lSimData -lz python: dem2dat_wrap.o ! $(CXX) -shared -lswigpy -ldl -o _dem2dat.so dem2dat_wrap.o -L$(PYTHONLIB)/SimData -lSimData -lz dem2dat_wrap.o: dem2dat_wrap.cxx ! $(CXX) -c -fPIC $(CXXFLAGS) dem2dat_wrap.cxx -I$(PYTHONINC) dem2dat_wrap.cxx: dem2dat.i dem2dat.h ! $(SWIG) -c -c++ -python -noexcept -I$(PYTHONINC) dem2dat.i Index: dem2dat.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Tools/Terrain/dem2dat/dem2dat.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** dem2dat.h 13 Aug 2003 11:34:30 -0000 1.3 --- dem2dat.h 17 Aug 2003 18:39:51 -0000 1.4 *************** *** 466,470 **** #define SET(x, y, v) { int index=int(sx*(x-x0))+512*int(sy*(y-y0)); if (index>=0 && index < 512*512) image[index] = v;} void dumpPGM() { ! int i, j, k; unsigned char *image; image = new unsigned char[512*512]; --- 466,470 ---- #define SET(x, y, v) { int index=int(sx*(x-x0))+512*int(sy*(y-y0)); if (index>=0 && index < 512*512) image[index] = v;} void dumpPGM() { ! int i, j; unsigned char *image; image = new unsigned char[512*512]; *************** *** 614,618 **** bool read(double lat, double lon) { ! read(DATname(simdata::toRadians(lat), simdata::toRadians(lon))); } --- 614,618 ---- bool read(double lat, double lon) { ! return read(DATname(simdata::toRadians(lat), simdata::toRadians(lon))); } |
From: <mk...@us...> - 2003-08-17 18:39:54
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim In directory sc8-pr-cvs1:/tmp/cvs-serv10975 Modified Files: CHANGES.current Makefile.in Log Message: Index: CHANGES.current =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/CHANGES.current,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** CHANGES.current 16 Aug 2003 10:25:14 -0000 1.65 --- CHANGES.current 17 Aug 2003 18:39:51 -0000 1.66 *************** *** 2,5 **** --- 2,13 ---- =========================== + 2003-08-16: onsight + Applied patches by VI to add Tools/Terrain/* to the + build and fix some minor errors in tile.cpp and + Tools/Recorder/graph. + + Added -W -Wall to the build for Tools/Terrain/*, + and fixed a few small errors that uncovered. + 2003-08-15: onsight Updates related to SimData API changes (mostly use Index: Makefile.in =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Makefile.in,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Makefile.in 2 Jul 2003 21:46:02 -0000 1.6 --- Makefile.in 17 Aug 2003 18:39:51 -0000 1.7 *************** *** 1,3 **** ! SUBDIRS = Source export DEMETER_RELATIVE = ../../THIRDPARTYLIBS/demeter --- 1,3 ---- ! SUBDIRS = Source Tools/Terrain/dem2dat Tools/Terrain/tile export DEMETER_RELATIVE = ../../THIRDPARTYLIBS/demeter *************** *** 36,40 **** @test -e Data/Input/$@ || \ ( cd Tools/HID && \ ! python map2hid Examples/$(@:%.hid=%.map) ../../Data/Input/$@ && \ echo "Default input map created for $@; see Tools/HID/README for details." \ ) --- 36,40 ---- @test -e Data/Input/$@ || \ ( cd Tools/HID && \ ! python cspinput Examples/$(@:%.hid=%.map) ../../Data/Input/$@ && \ echo "Default input map created for $@; see Tools/HID/README for details." \ ) |
From: <mk...@us...> - 2003-08-17 18:39:54
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Tools/Recorder In directory sc8-pr-cvs1:/tmp/cvs-serv10975/Tools/Recorder Modified Files: graph Log Message: Index: graph =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Tools/Recorder/graph,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** graph 24 Jul 2003 04:58:24 -0000 1.1 --- graph 17 Aug 2003 18:39:51 -0000 1.2 *************** *** 9,13 **** ! ./RecCSP --jgraph $1 | jgraph -P > .out.ps~ make --- 9,13 ---- ! ./csprec --jgraph $1 | jgraph -P > .out.ps~ make |
From: <mk...@us...> - 2003-08-17 10:50:24
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Include/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv30918/Include/SimData Modified Files: DataArchive.h DataManager.h Path.h Log Message: Index: DataArchive.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/DataArchive.h,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** DataArchive.h 17 Aug 2003 08:03:45 -0000 1.20 --- DataArchive.h 17 Aug 2003 10:50:21 -0000 1.21 *************** *** 101,107 **** struct TableEntry { /// the object path identifier hash ! hasht pathhash; /// the class identifier hash ! hasht classhash; /// the file offset of the serialized object uint32 offset; --- 101,107 ---- struct TableEntry { /// the object path identifier hash ! ObjectID pathhash; /// the class identifier hash ! ObjectID classhash; /// the file offset of the serialized object uint32 offset; *************** *** 151,167 **** ! typedef HASH_MAPS<hasht, std::vector<hasht>, hasht_hash, hasht_eq>::Type ChildMap; /// A map of all parent-child relationships in the archive. ChildMap _children; ! typedef HASH_MAPS<hasht, std::string, hasht_hash, hasht_eq>::Type PathMap; /// A map for accessing the path string of any object id in the archive. PathMap _pathmap; ! typedef HASH_MAPS<hasht, std::size_t, hasht_hash, hasht_eq>::Type TableMap; /// A map for finding the table index of an object id in the archive. TableMap _table_map; ! typedef HASH_MAPS<hasht, LinkBase, hasht_hash, hasht_eq>::Type CacheMap; /// A map of all cached objects indexed by object id. CacheMap _static_map; --- 151,167 ---- ! typedef HASH_MAPS<ObjectID, std::vector<ObjectID>, ObjectID_hash, ObjectID_eq>::Type ChildMap; /// A map of all parent-child relationships in the archive. ChildMap _children; ! typedef HASH_MAPS<ObjectID, std::string, ObjectID_hash, ObjectID_eq>::Type PathMap; /// A map for accessing the path string of any object id in the archive. PathMap _pathmap; ! typedef HASH_MAPS<ObjectID, std::size_t, ObjectID_hash, ObjectID_eq>::Type TableMap; /// A map for finding the table index of an object id in the archive. TableMap _table_map; ! typedef HASH_MAPS<ObjectID, LinkBase, ObjectID_hash, ObjectID_eq>::Type CacheMap; /// A map of all cached objects indexed by object id. CacheMap _static_map; *************** *** 376,385 **** * @param path the path string of the object */ ! void _addEntry(int offset, int length, hasht hash, std::string const &path); /* Object* getObject(const Object &a, const char* path); ! Object* getObject(const Object &a, hasht path, const char* path=""); ! Object* getObject(hasht path); */ --- 376,385 ---- * @param path the path string of the object */ ! void _addEntry(int offset, int length, ObjectID hash, std::string const &path); /* Object* getObject(const Object &a, const char* path); ! Object* getObject(const Object &a, ObjectID path, const char* path=""); ! Object* getObject(ObjectID path); */ *************** *** 390,394 **** * @param key the object identifier hash (path hash) */ ! void _addStatic(Object* ptr, std::string const &path_str, hasht key=0); /** Get an object from the static object cache. --- 390,394 ---- * @param key the object identifier hash (path hash) */ ! void _addStatic(Object* ptr, std::string const &path_str, ObjectID key=0); /** Get an object from the static object cache. *************** *** 396,400 **** * @returns the object if found, otherwise NULL. */ ! LinkBase const * _getStatic(hasht key); /** Create an a new instance using a class identifier hash. --- 396,400 ---- * @returns the object if found, otherwise NULL. */ ! LinkBase const * _getStatic(ObjectID key); /** Create an a new instance using a class identifier hash. *************** *** 403,407 **** * @returns the newly created object. */ ! Object* _createObject(hasht classhash); /** Find the table entry corresponding to a given object path. --- 403,407 ---- * @returns the newly created object. */ ! Object* _createObject(ObjectID classhash); /** Find the table entry corresponding to a given object path. *************** *** 421,426 **** const TableEntry* _lookupPath(ObjectID const &id, std::string const &path_str="") const; private: ! void setManager(DataManager *m) { _manager = m; } ChildMap const &getChildMap() const { return _children; } }; --- 421,432 ---- const TableEntry* _lookupPath(ObjectID const &id, std::string const &path_str="") const; + /** Get the associated data manager instance, if any. + */ + DataManager *getManager() const { return _manager; } + private: ! /** Called by DataManager to bind the archive. ! */ ! void setManager(DataManager *m); ChildMap const &getChildMap() const { return _children; } }; Index: DataManager.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/DataManager.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** DataManager.h 16 Aug 2003 10:29:43 -0000 1.10 --- DataManager.h 17 Aug 2003 10:50:21 -0000 1.11 *************** *** 1,4 **** /* SimData: Data Infrastructure for Simulations ! * Copyright (C) 2002 Mark Rose <tm...@st...> * * This file is part of SimData. --- 1,4 ---- /* SimData: Data Infrastructure for Simulations ! * Copyright (C) 2002, 2003 Mark Rose <tm...@st...> * * This file is part of SimData. *************** *** 28,34 **** #include <SimData/Export.h> #include <SimData/Path.h> #include <SimData/HashUtility.h> ! #include <SimData/Namespace.h> #include <string> --- 28,35 ---- #include <SimData/Export.h> + #include <SimData/Namespace.h> #include <SimData/Path.h> #include <SimData/HashUtility.h> ! #include <SimData/Ref.h> #include <string> *************** *** 47,54 **** ! /** ! * @brief Class for managing read access to multiple data archives. * ! * @author Mark Rose <mr...@st...> */ class SIMDATA_EXPORT DataManager { --- 48,54 ---- ! /** Class for managing read access to multiple data archives. * ! * @author Mark Rose <mr...@st...> */ class SIMDATA_EXPORT DataManager { *************** *** 56,201 **** public: ! /** ! * Construct a new (empty) data manager. */ DataManager(); ! /** ! * Destroy the data manager and all the archives it contains. */ virtual ~DataManager(); ! /** ! * Create a new object from a path identifier string. * ! * @param path_str the path identifier string. ! * @returns a smart-pointer to the new object. */ const LinkBase getObject(std::string const &path_str); ! /** ! * Create a new object from a Path instance. * ! * @param path the Path instance. ! * @param path_str the path identifier string (if available). This is ! * only used for error logging. */ const LinkBase getObject(Path const& path, std::string const &path_str=""); ! /** ! * Add a new data archive to the manager. * ! * All objects in the archive will subsequently be available from the ! * manager. The manager "owns" the pointer and will delete it when the ! * manager is destroyed. */ void addArchive(DataArchive *); ! /** ! * Get all children of a given object id. * ! * For id "A:X.Y", returns all object id's "A:X.Y.*". The id's ! * can be converted to human-readable form by getPathString(). * ! * @param id the object id to search for children ! * @returns a list of object id's immediately below the given path. */ std::vector<ObjectID> getChildren(ObjectID const &id) const; ! /** ! * Get all children of a given path. * ! * For path "A:X.Y", returns all object id's "A:X.Y.*". The id's ! * can be converted to human-readable form by getPathString(). * ! * @param path the path to search for children ! * @returns a list of object id's immediately below the given path. */ std::vector<ObjectID> getChildren(std::string const & path) const; ! /** ! * Check for the existance of an object in the archives. * ! * @returns true if the object id exists. */ bool hasObject(ObjectID const &id) const; ! /** ! * Check for the existance of an object in the archives. * ! * @returns true if the object id exists. */ bool hasObject(std::string const & path) const; ! /** ! * Get the path string corresponding to a give object id. * ! * This provides a human-readable path string that is useful ! * for error and debugging messages. * ! * @returns the path string if found, otherwise an empty string. */ std::string getPathString(ObjectID const &id) const; ! /** ! * Remove unused static objects from the cache. * ! * Call this method after many objects have been deleted ! * to free any unused cache entries. */ void cleanStatic(); ! /** ! * Return the interface proxy corresponding to the specified ! * object in the archive. */ InterfaceProxy *getObjectInterface(ObjectID const &id) const; ! /** ! * Return the interface proxy corresponding to the specified ! * object in the archive. */ InterfaceProxy *getObjectInterface(std::string const &path) const; private: ! /** ! * Find the archive that holds the specified object. * ! * Throws an exception if the object isn't found. */ DataArchive *findArchive(ObjectID const &id, std::string const &path_str, DataArchive const *d) const; ! /** ! * Create a new object from a Path instance. * ! * For internal use by the DataArchive class. When a particular ! * DataArchive class fails to find an object, it asks the associated ! * Manager to create the object. The last parameter is used to ! * prevent unwanted recursion if an object isn't found. * ! * @param path the Path instance. ! * @param path_str the path identifier string (if available). This is ! * only used for error logging. ! * @param d the data archive that is requesting the object. */ const LinkBase getObject(Path const& path, std::string const &path_str, DataArchive const *d) const; ! /** ! * Return the interface proxy corresponding to the specified ! * object in the archive. * ! * For internal use by the DataArchive class. When a particular ! * DataArchive class fails to find an object, it asks the associated ! * Manager to create the object. The last parameter is used to ! * prevent unwanted recursion if an object isn't found. */ InterfaceProxy *getObjectInterface(ObjectID const &id, std::string const &path_str, DataArchive const *d) const; ! std::vector<DataArchive*> _archives; ! hasht_map _archive_map; ! typedef HASH_MAPS<hasht, std::vector<hasht>, hasht_hash, hasht_eq>::Type child_map; ! child_map _children; }; --- 56,194 ---- public: ! /** Construct a new (empty) data manager. */ DataManager(); ! /** Destroy the data manager and all the archives it contains. */ virtual ~DataManager(); ! /** Create a new object from a path identifier string. * ! * @param path_str the path identifier string. ! * @returns a smart-pointer to the new object. */ const LinkBase getObject(std::string const &path_str); ! /** Create a new object from a Path instance. * ! * @param path the Path instance. ! * @param path_str the path identifier string (if available). This is ! * only used for error logging. */ const LinkBase getObject(Path const& path, std::string const &path_str=""); ! /** Add a new data archive to the manager. * ! * All objects in the archive will subsequently be available from the ! * manager. The manager "owns" the pointer and will delete it when the ! * manager is destroyed. */ void addArchive(DataArchive *); ! /** Get all children of a given object id. * ! * For id "A:X.Y", returns all object id's "A:X.Y.*". The id's ! * can be converted to human-readable form by getPathString(). * ! * @param id the object id to search for children ! * @returns a list of object id's immediately below the given path. */ std::vector<ObjectID> getChildren(ObjectID const &id) const; ! /** Get all children of a given path. * ! * For path "A:X.Y", returns all object id's "A:X.Y.*". The id's ! * can be converted to human-readable form by getPathString(). * ! * @param path the path to search for children ! * @returns a list of object id's immediately below the given path. */ std::vector<ObjectID> getChildren(std::string const & path) const; ! /** Check for the existance of an object in the archives. * ! * @returns true if the object id exists. */ bool hasObject(ObjectID const &id) const; ! /** Check for the existance of an object in the archives. * ! * @returns true if the object id exists. */ bool hasObject(std::string const & path) const; ! /** Get the path string corresponding to a give object id. * ! * This provides a human-readable path string that is useful ! * for error and debugging messages. * ! * @returns the path string if found, otherwise an empty string. */ std::string getPathString(ObjectID const &id) const; ! /** Remove unused static objects from the cache. * ! * Call this method after many objects have been deleted ! * to free any unused cache entries. */ void cleanStatic(); ! /** Return the interface proxy corresponding to the specified ! * object in the archive. */ InterfaceProxy *getObjectInterface(ObjectID const &id) const; ! /** Return the interface proxy corresponding to the specified ! * object in the archive. */ InterfaceProxy *getObjectInterface(std::string const &path) const; + /** Close all managed archives. + */ + void closeAll(); private: ! /** Find the archive that holds the specified object. * ! * Throws an exception if the object isn't found. */ DataArchive *findArchive(ObjectID const &id, std::string const &path_str, DataArchive const *d) const; ! /** Create a new object from a Path instance. * ! * For internal use by the DataArchive class. When a particular ! * DataArchive class fails to find an object, it asks the associated ! * Manager to create the object. The last parameter is used to ! * prevent unwanted recursion if an object isn't found. * ! * @param path the Path instance. ! * @param path_str the path identifier string (if available). This is ! * only used for error logging. ! * @param d the data archive that is requesting the object. */ const LinkBase getObject(Path const& path, std::string const &path_str, DataArchive const *d) const; ! /** Return the interface proxy corresponding to the specified ! * object in the archive. * ! * For internal use by the DataArchive class. When a particular ! * DataArchive class fails to find an object, it asks the associated ! * Manager to create the object. The last parameter is used to ! * prevent unwanted recursion if an object isn't found. */ InterfaceProxy *getObjectInterface(ObjectID const &id, std::string const &path_str, DataArchive const *d) const; ! typedef std::vector<DataArchive *> Archives; ! /// The collection of managed archives. ! Archives _archives; ! typedef HASH_MAPS<ObjectID, std::size_t, ObjectID_hash, ObjectID_eq>::Type ArchiveMap; ! /// A map for finding the index of an archive. ! ArchiveMap _archive_map; ! ! typedef HASH_MAPS<ObjectID, std::vector<hasht>, ObjectID_hash, ObjectID_eq>::Type ChildMap; ! /// A map of all parent-child relationships in the managed archives. ! ChildMap _children; }; Index: Path.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Path.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Path.h 15 Aug 2003 01:17:06 -0000 1.13 --- Path.h 17 Aug 2003 10:50:21 -0000 1.14 *************** *** 53,56 **** --- 53,58 ---- typedef hasht ObjectID; + typedef hasht_eq ObjectID_eq; + typedef hasht_hash ObjectID_hash; |
From: <mk...@us...> - 2003-08-17 10:50:24
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Source In directory sc8-pr-cvs1:/tmp/cvs-serv30918/Source Modified Files: DataArchive.cpp DataManager.cpp Log Message: Index: DataArchive.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/DataArchive.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** DataArchive.cpp 17 Aug 2003 08:03:45 -0000 1.13 --- DataArchive.cpp 17 Aug 2003 10:50:21 -0000 1.14 *************** *** 51,55 **** ! void DataArchive::_addEntry(int offset, int length, hasht hash, std::string const &path) { TableEntry t; t.offset = offset; --- 51,55 ---- ! void DataArchive::_addEntry(int offset, int length, ObjectID hash, std::string const &path) { TableEntry t; t.offset = offset; *************** *** 59,63 **** _table_map[t.pathhash] = _table.size(); _table.push_back(t); ! hasht parent = hash_string(base_path(path)); _children[parent].push_back(t.pathhash); _paths.push_back(path); --- 59,63 ---- _table_map[t.pathhash] = _table.size(); _table.push_back(t); ! ObjectID parent = hash_string(base_path(path)); _children[parent].push_back(t.pathhash); _paths.push_back(path); *************** *** 126,132 **** uint32 n_directories = *iptr++; _paths.reserve(n_paths); ! hasht *hptr = reinterpret_cast<hasht *>(iptr); while (n_directories-- > 0) { ! hasht node = *hptr++; uint32 n = hptr->a; ++hptr; --- 126,132 ---- uint32 n_directories = *iptr++; _paths.reserve(n_paths); ! ObjectID *hptr = reinterpret_cast<ObjectID *>(iptr); while (n_directories-- > 0) { ! ObjectID node = *hptr++; uint32 n = hptr->a; ++hptr; *************** *** 134,138 **** throw CorruptArchive("Path table of contents."); } ! std::vector<hasht> &childlist = _children[node]; childlist.reserve(n); while (n-- > 0) { --- 134,138 ---- throw CorruptArchive("Path table of contents."); } ! std::vector<ObjectID> &childlist = _children[node]; childlist.reserve(n); while (n-- > 0) { *************** *** 179,189 **** fwrite(&size, sizeof(size), 1, _f); for (iter = _children.begin(); iter != _children.end(); iter++) { ! hasht size = iter->second.size(); ! fwrite(&(iter->first), sizeof(hasht), 1, _f); fwrite(&size, sizeof(size), 1, _f); ! std::vector<hasht>::const_iterator child = iter->second.begin(); ! std::vector<hasht>::const_iterator last_child = iter->second.end(); while (child != last_child) { ! fwrite(&(*child++), sizeof(hasht), 1, _f); } } --- 179,189 ---- fwrite(&size, sizeof(size), 1, _f); for (iter = _children.begin(); iter != _children.end(); iter++) { ! ObjectID size = iter->second.size(); ! fwrite(&(iter->first), sizeof(ObjectID), 1, _f); fwrite(&size, sizeof(size), 1, _f); ! std::vector<ObjectID>::const_iterator child = iter->second.begin(); ! std::vector<ObjectID>::const_iterator last_child = iter->second.end(); while (child != last_child) { ! fwrite(&(*child++), sizeof(ObjectID), 1, _f); } } *************** *** 292,296 **** const DataArchive::TableEntry* DataArchive::_lookupPath(Path const &path, std::string const &path_str) const { ! hasht id = (hasht) path.getPath(); return _lookupPath(id, path_str); } --- 292,296 ---- const DataArchive::TableEntry* DataArchive::_lookupPath(Path const &path, std::string const &path_str) const { ! ObjectID id = (ObjectID) path.getPath(); return _lookupPath(id, path_str); } *************** *** 313,317 **** } ! Object *DataArchive::_createObject(hasht classhash) { InterfaceProxy *proxy = InterfaceRegistry::getInterfaceRegistry().getInterface(classhash); if (!proxy) { --- 313,317 ---- } ! Object *DataArchive::_createObject(ObjectID classhash) { InterfaceProxy *proxy = InterfaceRegistry::getInterfaceRegistry().getInterface(classhash); if (!proxy) { *************** *** 331,335 **** const LinkBase DataArchive::getObject(const Path& path, std::string const &path_str) { ! hasht id = (hasht) path.getPath(); // look among previously created static objects LinkBase const *cached = _getStatic(id); --- 331,335 ---- const LinkBase DataArchive::getObject(const Path& path, std::string const &path_str) { ! ObjectID id = (ObjectID) path.getPath(); // look among previously created static objects LinkBase const *cached = _getStatic(id); *************** *** 340,347 **** } catch (IndexError) { ! if (_manager) { ! return _manager->getObject(path, path_str, this); ! } ! throw; } SIMDATA_LOG(LOG_ARCHIVE, LOG_DEBUG, "getObject using interface registry @ 0x" << std::hex << int(&(InterfaceRegistry::getInterfaceRegistry()))); --- 340,345 ---- } catch (IndexError) { ! if (_manager == 0) throw; ! return _manager->getObject(path, path_str, this); } SIMDATA_LOG(LOG_ARCHIVE, LOG_DEBUG, "getObject using interface registry @ 0x" << std::hex << int(&(InterfaceRegistry::getInterfaceRegistry()))); *************** *** 406,415 **** ! void DataArchive::_addStatic(Object* ptr, std::string const &path, hasht id) { if (id == 0) id = hash_string(path); _static_map[id] = LinkBase(Path(path), ptr); } ! LinkBase const* DataArchive::_getStatic(hasht id=0) { CacheMap::const_iterator i = _static_map.find(id); if (i == _static_map.end()) return 0; --- 404,413 ---- ! void DataArchive::_addStatic(Object* ptr, std::string const &path, ObjectID id) { if (id == 0) id = hash_string(path); _static_map[id] = LinkBase(Path(path), ptr); } ! LinkBase const* DataArchive::_getStatic(ObjectID id=0) { CacheMap::const_iterator i = _static_map.find(id); if (i == _static_map.end()) return 0; *************** *** 471,478 **** } catch (IndexError) { ! if (_manager) { ! return _manager->getObjectInterface(id, path, this); ! } ! throw; } return InterfaceRegistry::getInterfaceRegistry().getInterface(t->classhash); --- 469,474 ---- } catch (IndexError) { ! if (_manager == 0) throw; ! return _manager->getObjectInterface(id, path, this); } return InterfaceRegistry::getInterfaceRegistry().getInterface(t->classhash); *************** *** 482,485 **** --- 478,487 ---- return getObjectInterface(hash_string(path), path); } + + void DataArchive::setManager(DataManager *m) { + assert(_manager == 0 || m == 0); + _manager = m; + } + NAMESPACE_SIMDATA_END Index: DataManager.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/DataManager.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** DataManager.cpp 17 Aug 2003 08:03:45 -0000 1.7 --- DataManager.cpp 17 Aug 2003 10:50:21 -0000 1.8 *************** *** 34,42 **** DataManager::~DataManager() { ! std::vector<DataArchive*>::iterator i; for (i = _archives.begin(); i != _archives.end(); i++) { ! if (*i) { (*i)->setManager(0); delete *i; } } --- 34,47 ---- DataManager::~DataManager() { ! closeAll(); ! } ! ! void DataManager::closeAll() { ! Archives::iterator i; for (i = _archives.begin(); i != _archives.end(); i++) { ! if (*i != 0) { (*i)->setManager(0); delete *i; + *i = 0; } } *************** *** 45,57 **** void DataManager::addArchive(DataArchive *d) { if (d) { ! int n = _archives.size(); ! _archives.push_back(d); std::vector<ObjectID> ids = d->getAllObjects(); ! std::vector<ObjectID>::iterator i; ! for (i = ids.begin(); i != ids.end(); i++) { ! if (_archive_map.find(*i) != _archive_map.end()) { ! SIMDATA_LOG(LOG_ARCHIVE, LOG_ERROR, "Duplicate object ID [" << (*i) << "] adding data archive '" << d->getFileName() << "' to data manager."); } ! _archive_map[*i] = n; } d->setManager(this); --- 50,71 ---- void DataManager::addArchive(DataArchive *d) { if (d) { ! bool added = false; ! std::size_t idx = 0; ! for (idx = 0; idx < _archives.size(); idx++) { ! if (_archives[idx] == 0) { ! _archives[idx] = d; ! added = true; ! } ! } ! if (!added) { ! _archives.push_back(d); ! } std::vector<ObjectID> ids = d->getAllObjects(); ! std::vector<ObjectID>::iterator id; ! for (id = ids.begin(); id != ids.end(); id++) { ! if (_archive_map.find(*id) != _archive_map.end()) { ! SIMDATA_LOG(LOG_ARCHIVE, LOG_ERROR, "Duplicate object ID [" << (*id) << "] adding data archive '" << d->getFileName() << "' to data manager."); } ! _archive_map[*id] = idx; } d->setManager(this); *************** *** 66,70 **** std::vector<ObjectID> DataManager::getChildren(ObjectID const &id) const { ! DataArchive::ChildMap::const_iterator idx = _children.find(id); if (idx == _children.end()) { return std::vector<ObjectID>(); } return idx->second; --- 80,84 ---- std::vector<ObjectID> DataManager::getChildren(ObjectID const &id) const { ! ChildMap::const_iterator idx = _children.find(id); if (idx == _children.end()) { return std::vector<ObjectID>(); } return idx->second; *************** *** 76,80 **** bool DataManager::hasObject(ObjectID const &id) const { ! hasht_map::const_iterator idx = _archive_map.find(id); return (idx != _archive_map.end()); } --- 90,94 ---- bool DataManager::hasObject(ObjectID const &id) const { ! ArchiveMap::const_iterator idx = _archive_map.find(id); return (idx != _archive_map.end()); } *************** *** 85,89 **** std::string DataManager::getPathString(ObjectID const &id) const { ! hasht_map::const_iterator idx = _archive_map.find(id); if (idx == _archive_map.end()) return ""; return _archives[idx->second]->getPathString(id); --- 99,103 ---- std::string DataManager::getPathString(ObjectID const &id) const { ! ArchiveMap::const_iterator idx = _archive_map.find(id); if (idx == _archive_map.end()) return ""; return _archives[idx->second]->getPathString(id); *************** *** 105,111 **** void DataManager::cleanStatic() { ! std::vector<DataArchive*>::iterator i; ! for (i = _archives.begin(); i != _archives.end(); i++) { ! if (*i) { (*i)->cleanStatic(); } --- 119,124 ---- void DataManager::cleanStatic() { ! for (Archives::iterator i = _archives.begin(); i != _archives.end(); i++) { ! if (*i != 0) { (*i)->cleanStatic(); } *************** *** 127,134 **** DataArchive *DataManager::findArchive(ObjectID const &id, std::string const &path_str, DataArchive const *d) const { ! hasht_map::const_iterator idx = _archive_map.find(id); DataArchive *archive = 0; if (idx != _archive_map.end()) { ! assert(idx->second >= 0 && idx->second < int(_archives.size())); archive = _archives[idx->second]; } --- 140,147 ---- DataArchive *DataManager::findArchive(ObjectID const &id, std::string const &path_str, DataArchive const *d) const { ! ArchiveMap::const_iterator idx = _archive_map.find(id); DataArchive *archive = 0; if (idx != _archive_map.end()) { ! assert(idx->second < _archives.size()); archive = _archives[idx->second]; } |
From: <mk...@us...> - 2003-08-17 08:08:27
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Include/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv9667/Include/SimData Modified Files: DataArchive.h Log Message: Index: DataArchive.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/DataArchive.h,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** DataArchive.h 16 Aug 2003 10:29:43 -0000 1.19 --- DataArchive.h 17 Aug 2003 08:03:45 -0000 1.20 *************** *** 91,94 **** --- 91,96 ---- private: + typedef std::vector<char> Buffer; + /** An entry in the data archive lookup table. * *************** *** 103,109 **** hasht classhash; /// the file offset of the serialized object ! int32 offset; /// the size of the serialized object data (in bytes) ! int32 length; }; --- 105,111 ---- hasht classhash; /// the file offset of the serialized object ! uint32 offset; /// the size of the serialized object data (in bytes) ! uint32 length; }; *************** *** 133,196 **** /** A table that indexes all objects in the archive. */ ! TableEntry* table; ! int n_objects, allocation; ! /** ! * BUFFERS default buffers of size BUFFERSIZE. * ! * An additional buffer is required for every subobject deserialized ! * by Link<>. If more than BUFFER objects must be deserialized ! * concurrently, or any object exceeds BUFFERSIZE, additional storage ! * will be allocated dynamically. The use of these fixed buffers ! * reduces the need for repeated buffer allocation and deallocation ! * when deserializing many small to medium sized objects. */ - char* object_buffer[BUFFERS]; // vector<string> here? - int n_buffer; - - /////////// - - /* TODO: explore using C++ constructs for data archive storage - - enum { - DEFAULT_BUFFERSIZE = 4096, - DEFAULT_BUFFERS = 10, - }; - - struct Buffer { - char *cbuf; - Buffer(int size=DEFAULT_BUFFERSIZE) { cbuf = new char[size]; } - ~Buffer() { delete[] cbuf; } - }; - - std::vector<TableEntry> _table; std::vector<Buffer> _buffers; ! */ - /////////// ! typedef HASH_MAPS<hasht, std::vector<hasht>, hasht_hash, hasht_eq>::Type child_map; /// A map of all parent-child relationships in the archive. ! child_map _children; ! typedef HASH_MAPS<hasht, std::string, hasht_hash, hasht_eq>::Type path_map; /// A map for accessing the path string of any object id in the archive. ! path_map _pathmap; std::vector<std::string> _paths; ! FILE *f; ! int is_read; ! long table_offset; ! int bytes; ! int finalized; ! hasht_map table_map; std::string _fn; ! bool chain; ! DataManager *manager; ! ! typedef HASH_MAPS<hasht, LinkBase, hasht_hash, hasht_eq>::Type cache_map; ! /// A map of all cached objects indexed by object id. ! cache_map static_map; /** Write a "magic" string to the start of the file to --- 135,179 ---- /** A table that indexes all objects in the archive. */ ! std::vector<TableEntry> _table; ! /** Object read buffers. * ! * An additional buffer is required for every subobject deserialized ! * by Link<>. If more than BUFFER objects must be deserialized ! * concurrently, or any object exceeds BUFFERSIZE, additional storage ! * will be allocated dynamically. The use of these fixed buffers ! * reduces the need for repeated buffer allocation and deallocation ! * when deserializing many small to medium sized objects. */ std::vector<Buffer> _buffers; ! /// The number of buffers currently in use. ! unsigned int _buffer; ! typedef HASH_MAPS<hasht, std::vector<hasht>, hasht_hash, hasht_eq>::Type ChildMap; /// A map of all parent-child relationships in the archive. ! ChildMap _children; ! typedef HASH_MAPS<hasht, std::string, hasht_hash, hasht_eq>::Type PathMap; /// A map for accessing the path string of any object id in the archive. ! PathMap _pathmap; ! ! typedef HASH_MAPS<hasht, std::size_t, hasht_hash, hasht_eq>::Type TableMap; ! /// A map for finding the table index of an object id in the archive. ! TableMap _table_map; ! ! typedef HASH_MAPS<hasht, LinkBase, hasht_hash, hasht_eq>::Type CacheMap; ! /// A map of all cached objects indexed by object id. ! CacheMap _static_map; std::vector<std::string> _paths; ! FILE *_f; ! bool _is_read; ! uint32 _table_offset; ! bool _finalized; std::string _fn; ! bool _chain; ! DataManager *_manager; /** Write a "magic" string to the start of the file to *************** *** 237,244 **** * * @param fn the full path to the archive file ! * @param read nonzero for read mode. * @param chain this is for internal use only. */ ! DataArchive(std::string const &fn, int read, bool chain=true); /** Close the data archive and cleanup. --- 220,227 ---- * * @param fn the full path to the archive file ! * @param read true for read mode, false for write mode. * @param chain this is for internal use only. */ ! DataArchive(std::string const &fn, bool read, bool chain=true); /** Close the data archive and cleanup. *************** *** 439,444 **** private: ! void setManager(DataManager *m) { manager = m; } ! child_map const &getChildMap() const { return _children; } }; --- 422,427 ---- private: ! void setManager(DataManager *m) { _manager = m; } ! ChildMap const &getChildMap() const { return _children; } }; |
From: <mk...@us...> - 2003-08-17 08:08:18
|
Update of /cvsroot/csp/APPLICATIONS/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv9667 Modified Files: CHANGES.current Log Message: Index: CHANGES.current =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/CHANGES.current,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** CHANGES.current 16 Aug 2003 10:28:51 -0000 1.67 --- CHANGES.current 17 Aug 2003 08:03:44 -0000 1.68 *************** *** 2,5 **** --- 2,9 ---- =========================== + 2003-08-16: onsight + Replaced several old-school buffer allocations with + std::vector equivalents in DataArchive. + 2003-08-15: onsight More Doxygen work. |
From: <mk...@us...> - 2003-08-16 10:38:43
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Bin In directory sc8-pr-cvs1:/tmp/cvs-serv6742 Modified Files: CSPSim.py Log Message: Index: CSPSim.py =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Bin/CSPSim.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** CSPSim.py 24 Jul 2003 08:10:55 -0000 1.10 --- CSPSim.py 16 Aug 2003 10:23:12 -0000 1.11 *************** *** 45,48 **** --- 45,49 ---- print " --config=path path to config (.ini) file" print " --log=classes set the logging classes" + print " --slog=level set the simdata logging level" print " --help help message" *************** *** 212,215 **** --- 213,217 ---- log_classes = [] other_args = [] + simdata_loglevel = "ALERT" config = findConfig() *************** *** 230,233 **** --- 232,237 ---- elif arg.startswith("--log="): log_classes.extend(arg[6:].split(':')) + elif arg.startswith("--slog="): + simdata_loglevel = arg[7:] else: other_args.append(arg) *************** *** 241,245 **** loadCSP() ! SimData.log().setLogLevels(SimData.LOG_ALL, SimData.LOG_ALERT) print "Loading configuration from '%s'." % config --- 245,256 ---- loadCSP() ! ! try: ! simdata_loglevel = eval("SimData.LOG_%s" % simdata_loglevel.upper()) ! except: ! print "Invalid SimData logging level, defaulting to 'ALERT'" ! simdata_loglevel = SimData.LOG_ALERT ! ! SimData.log().setLogLevels(SimData.LOG_ALL, simdata_loglevel) print "Loading configuration from '%s'." % config |
From: <mk...@us...> - 2003-08-16 10:37:09
|
Update of /cvsroot/csp/APPLICATIONS/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv7554 Modified Files: CHANGES.current Log Message: Index: CHANGES.current =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/CHANGES.current,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** CHANGES.current 16 Aug 2003 07:56:39 -0000 1.66 --- CHANGES.current 16 Aug 2003 10:28:51 -0000 1.67 *************** *** 17,20 **** --- 17,27 ---- in the simdata namespace. + Added Utility.h, removed GlibCSP.h from the setup.py + installation. + + Minor improvements to the DataArchive internal structures. + There more to do here, such as using std::vector instead + of hand-rolled allocations. + 2003-08-14: onsight Doxygen comment fixes. |
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Source In directory sc8-pr-cvs1:/tmp/cvs-serv6764 Modified Files: Animation.cpp CSPSim.cpp FlightModel.cpp GameScreen.cpp ObjectModel.cpp PrimaryAeroDynamics.cpp Sky.cpp Log Message: Index: Animation.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/Animation.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Animation.cpp 18 Jul 2003 20:55:11 -0000 1.1 --- Animation.cpp 16 Aug 2003 10:23:26 -0000 1.2 *************** *** 28,31 **** --- 28,34 ---- #include "Config.h" + #include <SimData/Math.h> + + SIMDATA_REGISTER_INTERFACE(DrivenRotation) *************** *** 61,66 **** DrivenRotation::DrivenRotation(): m_Axis(0.0f, 0.0f, 0.0f), ! m_Limit0(-G_PI), ! m_Limit1(G_PI), m_Gain(1.0f), m_Offset(0.0f) --- 64,69 ---- DrivenRotation::DrivenRotation(): m_Axis(0.0f, 0.0f, 0.0f), ! m_Limit0(-simdata::PI), ! m_Limit1(simdata::PI), m_Gain(1.0f), m_Offset(0.0f) Index: CSPSim.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/CSPSim.cpp,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** CSPSim.cpp 23 Jul 2003 07:11:57 -0000 1.35 --- CSPSim.cpp 16 Aug 2003 10:23:26 -0000 1.36 *************** *** 378,384 **** --- 378,386 ---- csp::SimDataFatalException(pEx, "initialization"); } + /* catch (...) { csp::OtherFatalException("initialization"); } + */ } Index: FlightModel.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/FlightModel.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** FlightModel.cpp 6 Aug 2003 06:25:18 -0000 1.5 --- FlightModel.cpp 16 Aug 2003 10:23:27 -0000 1.6 *************** *** 153,157 **** Object::postCreate(); m_AspectRatio = m_WingSpan * m_WingSpan / m_WingArea; ! m_CD_i = 1.0 / (0.9 * G_PI * m_AspectRatio); m_HalfWingArea = 0.5 * m_WingArea; } --- 153,157 ---- Object::postCreate(); m_AspectRatio = m_WingSpan * m_WingSpan / m_WingArea; ! m_CD_i = 1.0 / (0.9 * simdata::PI * m_AspectRatio); m_HalfWingArea = 0.5 * m_WingArea; } Index: GameScreen.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/GameScreen.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** GameScreen.cpp 6 Aug 2003 06:25:18 -0000 1.26 --- GameScreen.cpp 16 Aug 2003 10:23:27 -0000 1.27 *************** *** 53,57 **** */ ! double const GameScreen::OffsetRate = 30.0 * (G_PI / 180.0); // x deg / s, even if it is used for Zoom also ... --- 53,57 ---- */ ! double const GameScreen::OffsetRate = 30.0 * (simdata::PI / 180.0); // x deg / s, even if it is used for Zoom also ... *************** *** 61,65 **** m_AngleRotZ = 0.0; m_NeckPhi = 0.0; ! m_NeckTheta = 0.5*G_PI; m_PanRateX = 0.0; m_PanRateZ = 0.0; --- 61,65 ---- m_AngleRotZ = 0.0; m_NeckPhi = 0.0; ! m_NeckTheta = 0.5*simdata::PI; m_PanRateX = 0.0; m_PanRateZ = 0.0; *************** *** 326,330 **** m_LookRelative = false; if (m_ViewMode == 9) { ! m_AngleRotX = 0.5*G_PI-m_NeckTheta; m_AngleRotZ = m_NeckPhi; } --- 326,330 ---- m_LookRelative = false; if (m_ViewMode == 9) { ! m_AngleRotX = 0.5*simdata::PI-m_NeckTheta; m_AngleRotZ = m_NeckPhi; } *************** *** 400,404 **** if (m_Padlock != m_ActiveObject) { if (m_ViewMode == 1) { ! m_NeckTheta = m_AngleRotX-0.5*G_PI; m_NeckPhi = m_AngleRotZ; } --- 400,404 ---- if (m_Padlock != m_ActiveObject) { if (m_ViewMode == 1) { ! m_NeckTheta = m_AngleRotX-0.5*simdata::PI; m_NeckPhi = m_AngleRotZ; } *************** *** 650,655 **** case 1: // view_mode one is normal inside the cockpit view { ! turnViewAboutX(dt,G_PI / 3); ! turnViewAboutZ(dt,G_PI / 3); simdata::Vector3 planePos = m_ActiveObject->getGlobalPosition(); simdata::Vector3 planeDir = m_ActiveObject->getDirection(); --- 650,655 ---- case 1: // view_mode one is normal inside the cockpit view { ! turnViewAboutX(dt,simdata::PI / 3); ! turnViewAboutZ(dt,simdata::PI / 3); simdata::Vector3 planePos = m_ActiveObject->getGlobalPosition(); simdata::Vector3 planeDir = m_ActiveObject->getDirection(); Index: ObjectModel.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/ObjectModel.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** ObjectModel.cpp 6 Aug 2003 06:25:18 -0000 1.21 --- ObjectModel.cpp 16 Aug 2003 10:23:27 -0000 1.22 *************** *** 362,366 **** adjust->addChild(m_Model.get()); m_Model = adjust; ! simdata::Matrix3 sd_adjust = simdata::fromOSG(model_orientation).getInverse(); for (unsigned i = 0; i < m_Contacts.size(); i++) { m_Contacts[i] = sd_adjust * m_Contacts[i] + m_Offset; --- 362,366 ---- adjust->addChild(m_Model.get()); m_Model = adjust; ! simdata::Matrix3 sd_adjust = simdata::fromOSG(model_orientation); //.getInverse(); for (unsigned i = 0; i < m_Contacts.size(); i++) { m_Contacts[i] = sd_adjust * m_Contacts[i] + m_Offset; Index: PrimaryAeroDynamics.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/PrimaryAeroDynamics.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PrimaryAeroDynamics.cpp 6 Aug 2003 06:25:18 -0000 1.7 --- PrimaryAeroDynamics.cpp 16 Aug 2003 10:23:27 -0000 1.8 *************** *** 181,185 **** Object::postCreate(); m_AspectRatio = m_WingSpan * m_WingSpan / m_WingArea; ! m_CD_i = 1.0 / (0.9 * G_PI * m_AspectRatio); m_HalfWingArea = 0.5 * m_WingArea; m_depsilon = 0.5 * std::min(m_GMax,fabs(m_GMin)); --- 181,185 ---- Object::postCreate(); m_AspectRatio = m_WingSpan * m_WingSpan / m_WingArea; ! m_CD_i = 1.0 / (0.9 * simdata::PI * m_AspectRatio); m_HalfWingArea = 0.5 * m_WingArea; m_depsilon = 0.5 * std::min(m_GMax,fabs(m_GMin)); *************** *** 199,203 **** void PrimaryAeroDynamics::initializeSimulationStep(double dt) { BaseDynamics::initializeSimulationStep(dt); ! //double u = (0.034 + dt)/(1.0 - atan(m_AirSpeed) / G_PI); double u = 0.05 + dt; m_ElevatorScale = (1.0 - u) * m_ElevatorScale + u * controlInputValue( m_gForce ); --- 199,203 ---- void PrimaryAeroDynamics::initializeSimulationStep(double dt) { BaseDynamics::initializeSimulationStep(dt); ! //double u = (0.034 + dt)/(1.0 - atan(m_AirSpeed) / simdata::PI); double u = 0.05 + dt; m_ElevatorScale = (1.0 - u) * m_ElevatorScale + u * controlInputValue( m_gForce ); Index: Sky.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/Sky.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Sky.cpp 6 Aug 2003 06:25:18 -0000 1.20 --- Sky.cpp 16 Aug 2003 10:23:27 -0000 1.21 *************** *** 40,43 **** --- 40,44 ---- #include <SimData/InterfaceRegistry.h> #include <SimData/DataManager.h> + #include <SimData/Math.h> #include <osg/BlendFunc> *************** *** 59,62 **** --- 60,65 ---- using namespace osg; + using simdata::toRadians; + using simdata::toDegrees; const float TURBIDITY = 3.0f; *************** *** 281,286 **** void setObserver(double lat, double lmst, float ambient) { ! rz = 270.0 - lmst * R2D; ! rx = - 90.0 + lat * R2D; if (ambient < 0.0) ambient = 0.0; if (ambient > 1.0) ambient = 1.0; --- 284,289 ---- void setObserver(double lat, double lmst, float ambient) { ! rz = 270.0 - toDegrees(lmst); ! rx = - 90.0 + toDegrees(lat); if (ambient < 0.0) ambient = 0.0; if (ambient > 1.0) ambient = 1.0; *************** *** 304,308 **** const double AstronomicalBody::_earth_radius = 6370000.0; ! const double AstronomicalBody::_earth_tilt = 23.4397 * D2R; const double AstronomicalBody::_cos_earth_tilt = cos(_earth_tilt); const double AstronomicalBody::_sin_earth_tilt = sin(_earth_tilt); --- 307,311 ---- const double AstronomicalBody::_earth_radius = 6370000.0; ! const double AstronomicalBody::_earth_tilt = toRadians(23.4397); const double AstronomicalBody::_cos_earth_tilt = cos(_earth_tilt); const double AstronomicalBody::_sin_earth_tilt = sin(_earth_tilt); *************** *** 317,321 **** double AstronomicalBody::refract(double h) const { double f = 0.000305 / (0.000305 + h * h); // localize effect at horizon (semi-arbitrary approx) ! return h + 0.57 * f * D2R; } --- 320,324 ---- double AstronomicalBody::refract(double h) const { double f = 0.000305 / (0.000305 + h * h); // localize effect at horizon (semi-arbitrary approx) ! return h + toRadians(0.57 * f); } *************** *** 451,460 **** double M = -3.18 + 0.98560 * dt; double L = M - 77.11; ! M = M * D2R; double C = 1.915 * sin(M) + 0.0201 * sin(2*M); // in AU = 1.496x10^11 m (23455 R_earth) // double R = 1.00140 - 0.016708*cos(M) - 0.000141*cos(2*M) _beta = 0.0; ! _lambda = (L + C) * D2R; _pi = 0.00004263; // just taking an average orbital radius of the earth _stale = true; --- 454,463 ---- double M = -3.18 + 0.98560 * dt; double L = M - 77.11; ! M = toRadians(M); double C = 1.915 * sin(M) + 0.0201 * sin(2*M); // in AU = 1.496x10^11 m (23455 R_earth) // double R = 1.00140 - 0.016708*cos(M) - 0.000141*cos(2*M) _beta = 0.0; ! _lambda = toRadians(L + C); _pi = 0.00004263; // just taking an average orbital radius of the earth _stale = true; *************** *** 516,520 **** Vec3 to_eye_projection = to_eye^_axis; if (to_eye_projection.normalize() > 0.0) { ! float rotation_angle = G_PI+acos(to_eye_projection*_onormal); Vec3 pivot = _onormal^to_eye_projection; matrix.makeRotate(rotation_angle, pivot); --- 519,523 ---- Vec3 to_eye_projection = to_eye^_axis; if (to_eye_projection.normalize() > 0.0) { ! float rotation_angle = simdata::PI+acos(to_eye_projection*_onormal); Vec3 pivot = _onormal^to_eye_projection; matrix.makeRotate(rotation_angle, pivot); *************** *** 714,718 **** float sun_angle = getBeta() * 0.38/159.6; // (distance ratio moon:sun) float a0 = 0.5 * m_Phase; ! float a1 = 0.5 * (G_PI - m_Phase); float f0 = fabs(tan(0.5*a0)); float f1 = fabs(tan(0.5*a1)); --- 717,721 ---- float sun_angle = getBeta() * 0.38/159.6; // (distance ratio moon:sun) float a0 = 0.5 * m_Phase; ! float a1 = 0.5 * (simdata::PI - m_Phase); float f0 = fabs(tan(0.5*a0)); float f1 = fabs(tan(0.5*a1)); *************** *** 742,747 **** void Moon::_maskPhase(float phi, float beta) { { ! int n = (int) (phi / (2.0*G_PI)); ! phi -= n * 2.0 * G_PI; //cout << "MOON PHASE = " << phi << endl; } --- 745,750 ---- void Moon::_maskPhase(float phi, float beta) { { ! int n = (int) (phi / (2.0*simdata::PI)); ! phi -= n * 2.0 * simdata::PI; //cout << "MOON PHASE = " << phi << endl; } *************** *** 901,905 **** float yc = 0.15346 * s3 - 0.26756 * s2 + 0.06670 * s + 0.26688; float yz = ya * t2 + yb * t + yc; ! float chi = (0.4444444 - T * 0.008333333) * (G_PI - 2.0*s); float Yz = (4.0453 * T - 4.9710) * tan(chi) - 0.2155 * T + 2.4192; // Yz is in units of kcd/m^2 --- 904,908 ---- float yc = 0.15346 * s3 - 0.26756 * s2 + 0.06670 * s + 0.26688; float yz = ya * t2 + yb * t + yc; ! float chi = (0.4444444 - T * 0.008333333) * (simdata::PI - 2.0*s); float Yz = (4.0453 * T - 4.9710) * tan(chi) - 0.2155 * T + 2.4192; // Yz is in units of kcd/m^2 *************** *** 923,939 **** void SkyShader::setSunElevation(float h) { m_AzimuthCorrection = 0.0; ! if (h < -G_PI) { ! h += 2.0 * G_PI * int((G_PI - h) / (2.0 * G_PI)); } else ! if (h > G_PI) { ! h -= 2.0 * G_PI * int((G_PI + h) / (2.0 * G_PI)); } ! if (h > 0.5 *G_PI) { ! h = G_PI - h; ! m_AzimuthCorrection = G_PI; } else ! if (h < -0.5*G_PI) { ! h = -G_PI - h; ! m_AzimuthCorrection = -G_PI; } m_SunElevation = h; --- 926,942 ---- void SkyShader::setSunElevation(float h) { m_AzimuthCorrection = 0.0; ! if (h < -simdata::PI) { ! h += 2.0 * simdata::PI * int((simdata::PI - h) / (2.0 * simdata::PI)); } else ! if (h > simdata::PI) { ! h -= 2.0 * simdata::PI * int((simdata::PI + h) / (2.0 * simdata::PI)); } ! if (h > 0.5 *simdata::PI) { ! h = simdata::PI - h; ! m_AzimuthCorrection = simdata::PI; } else ! if (h < -0.5*simdata::PI) { ! h = -simdata::PI - h; ! m_AzimuthCorrection = -simdata::PI; } m_SunElevation = h; *************** *** 944,948 **** m_Dirty = false; ! m_SunTheta = 0.5*G_PI - m_SunElevation; m_SunVector[0] = 0.0; m_SunVector[1] = sin(m_SunTheta); --- 947,951 ---- m_Dirty = false; ! m_SunTheta = 0.5*simdata::PI - m_SunElevation; m_SunVector[0] = 0.0; m_SunVector[1] = sin(m_SunTheta); *************** *** 969,974 **** #ifdef CUSTOM // only rescale down to the horizon, bad things happen if we go further ! if (m_SunTheta >= 0.5*G_PI) { ! m_MaxY = Perez(0.5*G_PI, 0.0, 0.5*G_PI, m_Zenith.getC(), m_Coefficients.Y); } else { m_MaxY = Perez(m_SunTheta, 0.0, m_SunTheta, m_Zenith.getC(), m_Coefficients.Y); --- 972,977 ---- #ifdef CUSTOM // only rescale down to the horizon, bad things happen if we go further ! if (m_SunTheta >= 0.5*simdata::PI) { ! m_MaxY = Perez(0.5*simdata::PI, 0.0, 0.5*simdata::PI, m_Zenith.getC(), m_Coefficients.Y); } else { m_MaxY = Perez(m_SunTheta, 0.0, m_SunTheta, m_Zenith.getC(), m_Coefficients.Y); *************** *** 981,985 **** // the drop at the horizon. NightBase is scaling with the sun 90 // degrees below the horizon. ! m_F =(atan(m_SunElevation*m_SunsetSharpness)/G_PI+0.5)*(1.0-m_NightBase) + m_NightBase; #endif --- 984,988 ---- // the drop at the horizon. NightBase is scaling with the sun 90 // degrees below the horizon. ! m_F =(atan(m_SunElevation*m_SunsetSharpness)/simdata::PI+0.5)*(1.0-m_NightBase) + m_NightBase; #endif *************** *** 988,992 **** Color SkyShader::SkyColor(float elevation, float azimuth, float dark, float &intensity) { if (m_Dirty) _computeBase(); ! float theta = 0.5*G_PI - elevation; float A = azimuth + m_AzimuthCorrection; float v[3] = {sin(A)*sin(theta), cos(A)*sin(theta), cos(theta)}; --- 991,995 ---- Color SkyShader::SkyColor(float elevation, float azimuth, float dark, float &intensity) { if (m_Dirty) _computeBase(); ! float theta = 0.5*simdata::PI - elevation; float A = azimuth + m_AzimuthCorrection; float v[3] = {sin(A)*sin(theta), cos(A)*sin(theta), cos(theta)}; *************** *** 1098,1102 **** void updateHorizon(float altitude, float clip) { float a = 0.0; ! float da = 2.0 * G_PI / m_Segments; float radius = std::min(1000000.0, std::max(1.5*clip, sqrt(2.0 * 6370000.0 * altitude))); // variation less than 2 pixels under most conditions: --- 1101,1105 ---- void updateHorizon(float altitude, float clip) { float a = 0.0; ! float da = 2.0 * simdata::PI / m_Segments; float radius = std::min(1000000.0, std::max(1.5*clip, sqrt(2.0 * 6370000.0 * altitude))); // variation less than 2 pixels under most conditions: *************** *** 1355,1359 **** void Sky::_updateShading(double sun_h, double sun_A) { Vec4Array& colors = *(dynamic_cast<Vec4Array*>(m_SkyDome->getColorArray())); ! double da = 2.0 * G_PI / (m_nseg); double min_a = 0.5*da; double jitter = 0.0; --- 1358,1362 ---- void Sky::_updateShading(double sun_h, double sun_A) { Vec4Array& colors = *(dynamic_cast<Vec4Array*>(m_SkyDome->getColorArray())); ! double da = 2.0 * simdata::PI / (m_nseg); double min_a = 0.5*da; double jitter = 0.0; *************** *** 1363,1369 **** osg::Vec4 horizon_average; for (i = 0; i < m_nlev; ++i) { ! double elev = m_lev[i] * D2R; if (elev < 0.0) elev = 0.0; // sub horizon colors aren't correct ! double azimuth = -sun_A - 0.5 * G_PI; bool at_vertex = fabs(elev - sun_h) < min_a; // this is only a rough measure for (j = 0; j < m_nseg; ++j) { --- 1366,1372 ---- osg::Vec4 horizon_average; for (i = 0; i < m_nlev; ++i) { ! double elev = toRadians(m_lev[i]); if (elev < 0.0) elev = 0.0; // sub horizon colors aren't correct ! double azimuth = -sun_A - 0.5 * simdata::PI; bool at_vertex = fabs(elev - sun_h) < min_a; // this is only a rough measure for (j = 0; j < m_nseg; ++j) { *************** *** 1416,1420 **** for (i = 0; i < 32; ++i) { double x = i / 30.0; ! double elevation = (1.0 - sqrt(x*x+y*y)) * 0.5 * G_PI; if (elevation >= -0.15) { if (elevation < 0.0) elevation = 0.0; --- 1419,1423 ---- for (i = 0; i < 32; ++i) { double x = i / 30.0; ! double elevation = (1.0 - sqrt(x*x+y*y)) * 0.5 * simdata::PI; if (elevation >= -0.15) { if (elevation < 0.0) elevation = 0.0; *************** *** 1437,1442 **** { // separate evaluation for horizon colors int n = m_HorizonColors->size(); ! double da = 2.0 * G_PI / n; ! double azimuth = -sun_A - 0.5 * G_PI; for (i = 0; i < n; ++i) { float intensity; --- 1440,1445 ---- { // separate evaluation for horizon colors int n = m_HorizonColors->size(); ! double da = 2.0 * simdata::PI / n; ! double azimuth = -sun_A - 0.5 * simdata::PI; for (i = 0; i < n; ++i) { float intensity; *************** *** 1450,1459 **** { // update texture coordinates int ci = 0; ! double da = 2.0 * G_PI / (m_nseg); for (i = 0; i < m_nlev; ++i) { ! double elev = m_lev[i] * D2R; if (elev < 0.0) elev = 0.0; // sub horizon colors aren't correct ! double azimuth = -sun_A - 0.5 * G_PI; ! float factor = (1.0 - 2.0 * elev / G_PI) * 30.0 / 32.0; for (j = 0; j < m_nseg; ++j) { float x = 0.5 * (1.0 + sin(azimuth) * factor) + 0.5 / 64.0; --- 1453,1462 ---- { // update texture coordinates int ci = 0; ! double da = 2.0 * simdata::PI / (m_nseg); for (i = 0; i < m_nlev; ++i) { ! double elev = toRadians(m_lev[i]); if (elev < 0.0) elev = 0.0; // sub horizon colors aren't correct ! double azimuth = -sun_A - 0.5 * simdata::PI; ! float factor = (1.0 - 2.0 * elev / simdata::PI) * 30.0 / 32.0; for (j = 0; j < m_nseg; ++j) { float x = 0.5 * (1.0 + sin(azimuth) * factor) + 0.5 / 64.0; *************** *** 1492,1496 **** void Sky::update(double lat, double lon, simdata::SimDate const &t) { ! m_LMST = t.getMST(lon) + m_SpinTheWorld * 2.0 * G_PI; m_JD = t.getJulianDate() + m_SpinTheWorld; m_Latitude = lat; --- 1495,1499 ---- void Sky::update(double lat, double lon, simdata::SimDate const &t) { ! m_LMST = t.getMST(lon) + m_SpinTheWorld * 2.0 * simdata::PI; m_JD = t.getJulianDate() + m_SpinTheWorld; m_Latitude = lat; |
From: <mk...@us...> - 2003-08-16 10:35:09
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Doc In directory sc8-pr-cvs1:/tmp/cvs-serv7728/Doc Modified Files: footer.html Log Message: Index: footer.html =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Doc/footer.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** footer.html 26 Mar 2003 06:38:02 -0000 1.1 --- footer.html 16 Aug 2003 10:29:43 -0000 1.2 *************** *** 1,2 **** <hr> ! For more information on SimData, visit the <a href='http://csp.sourceforge.net/forum'>CSP Forums</a>. --- 1,12 ---- <hr> ! <table width="100%"> ! <tr><td> ! For more information on SimData, visit the <a href='http://simdata-csp.sourceforge.net'>SimData Homepage</a>.<br><br> ! <i>Generated on $datetime, using Doxygen $doxygenversion.</i> ! <td> ! <p align="right"> ! <a href="http://sourceforge.net"><img src="http://sourceforge.net/sflogo.php?group_id=17780&type=2" border="0" alt="[SF.net]" /></a></p> ! </tr></table> ! </body> ! </html> ! |
From: <mk...@us...> - 2003-08-16 10:34:29
|
Update of /cvsroot/csp/APPLICATIONS/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv7728 Modified Files: setup.py Log Message: Index: setup.py =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/setup.py,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** setup.py 6 Aug 2003 16:15:25 -0000 1.29 --- setup.py 16 Aug 2003 10:29:43 -0000 1.30 *************** *** 267,271 **** "FileUtility.h", "GeoPos.h", - "GlibCsp.h", "hash_map.h", "HashUtility.h", --- 267,270 ---- *************** *** 296,299 **** --- 295,299 ---- "TypeAdapter.h", "Types.h", + "Uniform.h", "Vector3.h", "Version.h", |
From: <mk...@us...> - 2003-08-16 10:34:28
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Source In directory sc8-pr-cvs1:/tmp/cvs-serv7728/Source Modified Files: DataArchive.cpp HashUtility.cpp Matrix3.cpp Object.cpp Quat.cpp Vector3.cpp Log Message: Index: DataArchive.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/DataArchive.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** DataArchive.cpp 14 Aug 2003 12:19:12 -0000 1.11 --- DataArchive.cpp 16 Aug 2003 10:29:44 -0000 1.12 *************** *** 29,36 **** NAMESPACE_SIMDATA - const int DataArchive::AS = 1024; - const int DataArchive::BUFFERSIZE = 4096; - const int DataArchive::BUFFERS = 10; - DataArchive* DataArchive::defaultArchive = 0; --- 29,32 ---- Index: HashUtility.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/HashUtility.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** HashUtility.cpp 15 Aug 2003 06:59:16 -0000 1.8 --- HashUtility.cpp 16 Aug 2003 10:29:44 -0000 1.9 *************** *** 22,25 **** --- 22,27 ---- * @file HashUtility.cpp * + * Hash functions utilities + * * The hash functions coded here are from "Hash Functions for Hash * Table Lookup" by Robert J. Jenokins Jr., and are Public Domain. Index: Matrix3.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Matrix3.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Matrix3.cpp 14 Aug 2003 12:19:13 -0000 1.8 --- Matrix3.cpp 16 Aug 2003 10:29:44 -0000 1.9 *************** *** 23,26 **** --- 23,28 ---- * @file Matrix3.cpp * + * A three-by-three matrix class. + * * This source code was originally based on the Matrix class of * the OpenSceneGraph library, Copyright 1998-2003 Robert Osfield. Index: Object.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Object.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Object.cpp 6 Aug 2003 06:36:25 -0000 1.5 --- Object.cpp 16 Aug 2003 10:29:44 -0000 1.6 *************** *** 29,41 **** - /* - void releaseObject(Object* ptr, int force) { - if (!ptr) return; - if (!force && ptr->isStatic()) return; - printf("delete %p\n", ptr); - delete ptr; - } - */ - // archive serializaiton void Object::pack(Packer& p) const { --- 29,32 ---- Index: Quat.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Quat.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Quat.cpp 6 Aug 2003 07:52:41 -0000 1.2 --- Quat.cpp 16 Aug 2003 10:29:44 -0000 1.3 *************** *** 23,26 **** --- 23,28 ---- * @file Quat.cpp * + * A quaternion class. + * * This source code was originally based on the Quat class of * the OpenSceneGraph library, Copyright 1998-2003 Robert Osfield. Index: Vector3.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Vector3.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Vector3.cpp 6 Aug 2003 06:36:25 -0000 1.7 --- Vector3.cpp 16 Aug 2003 10:29:44 -0000 1.8 *************** *** 22,25 **** --- 22,27 ---- * @file Vector3.cpp * + * A three-dimensional vector class. + * * This source code was originally based on the Vec3 class of * the OpenSceneGraph library, Copyright 1998-2003 Robert Osfield. |
From: <mk...@us...> - 2003-08-16 10:33:10
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Include In directory sc8-pr-cvs1:/tmp/cvs-serv6793 Modified Files: GameScreen.h VirtualScene.i Log Message: Index: GameScreen.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/GameScreen.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** GameScreen.h 24 Jul 2003 07:32:39 -0000 1.12 --- GameScreen.h 16 Aug 2003 10:23:34 -0000 1.13 *************** *** 117,122 **** void normalView(); ! void turnViewAboutX(double dt, double AngleMax = G_PI / 2.0); ! void turnViewAboutZ(double dt, double AngleMax = G_PI); void scaleView(double dt); simdata::Vector3 getNewFixedCamPos(SimObject * const target) const; --- 117,122 ---- void normalView(); ! void turnViewAboutX(double dt, double AngleMax = simdata::PI / 2.0); ! void turnViewAboutZ(double dt, double AngleMax = simdata::PI); void scaleView(double dt); simdata::Vector3 getNewFixedCamPos(SimObject * const target) const; Index: VirtualScene.i =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/VirtualScene.i,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** VirtualScene.i 23 Apr 2003 10:02:12 -0000 1.2 --- VirtualScene.i 16 Aug 2003 10:23:34 -0000 1.3 *************** *** 26,31 **** { public: ! void addObject(simdata::Ref<SimObject> object); ! void removeObject(simdata::Ref<SimObject> object); void spinTheWorld(bool spin); --- 26,31 ---- { public: ! void addObject(simdata::Ref<DynamicObject> object); ! void removeObject(simdata::Ref<DynamicObject> object); void spinTheWorld(bool spin); |
From: <mk...@us...> - 2003-08-16 10:32:12
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim In directory sc8-pr-cvs1:/tmp/cvs-serv7027 Modified Files: CHANGES.current Log Message: Index: CHANGES.current =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/CHANGES.current,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** CHANGES.current 13 Aug 2003 11:48:02 -0000 1.64 --- CHANGES.current 16 Aug 2003 10:25:14 -0000 1.65 *************** *** 2,5 **** --- 2,13 ---- =========================== + 2003-08-15: onsight + Updates related to SimData API changes (mostly use + of simdata::PI, toRadians, and toDegrees instead of + the G_PI, D2R, and R2D macros). + + Added a CSPSim.py option to set the SimData logging + level from the command line. + 2003-08-12: onsight Minor updates to Terrain/dem2dat and Terrain/tile to |
From: <mk...@us...> - 2003-08-16 07:56:43
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Source In directory sc8-pr-cvs1:/tmp/cvs-serv22313/Source Modified Files: BaseType.cpp GeoPos.cpp InterfaceRegistry.cpp Version.cpp Log Message: Index: BaseType.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/BaseType.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** BaseType.cpp 14 Aug 2003 12:19:12 -0000 1.5 --- BaseType.cpp 16 Aug 2003 07:56:40 -0000 1.6 *************** *** 22,28 **** --- 22,60 ---- #include <SimData/BaseType.h> + #include <SimData/Version.h> NAMESPACE_SIMDATA + + + #ifndef SIMDATA_NOLOADCHECK + + /** Print a startup message to verify proper loading of SimData. + * + * Only one copy of SimData should be active so that all object + * interface proxies will be stored in a single object registry. + * Unless you explicitly want distinct object registries, multiple + * "SimData XX loaded @ XX" messages are an indication of improper + * linking. + * + * This message may be disabled by defining SIMDATA_NOLOADCHECK + * when building SimData. + * + * This instance is created in BaseType, as opposed to some other + * object file, since BaseType must be loaded for all but the most + * basic SimData functionality. + */ + class load_check { + public: + load_check() { + std::cout << "SimData " << getVersion(); + std::cout.setf(std::ios_base::hex | std::ios_base::basefield | std::ios_base::showbase); + std::cout << " loaded @ " << this; + std::cout.unsetf(std::ios_base::hex | std::ios_base::basefield | std::ios_base::showbase); + std::cout << std::endl; + } + } check_basetype; + + #endif // SIMDATA_NOLOADCHECK Index: GeoPos.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/GeoPos.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** GeoPos.cpp 6 Aug 2003 06:36:25 -0000 1.4 --- GeoPos.cpp 16 Aug 2003 07:56:40 -0000 1.5 *************** *** 33,36 **** --- 33,38 ---- #include <cmath> + #include <sstream> + #include <iomanip> *************** *** 899,905 **** std::string UTM::asString() const { ! char buff[128]; ! sprintf(buff, "[%.0lfE %.0lfN %d%c, %.3lf]", _E, _N, int(_zone), _designator, _alt); ! return buff; } --- 901,912 ---- std::string UTM::asString() const { ! std::stringstream ss; ! ss << std::fixed; ! ss << "["; ! ss << ss.precision(0) << _E << " " << _N; ! ss << " " << int(_zone) << _designator << ", "; ! ss << std::setprecision(3) << _alt; ! ss << "]"; ! return ss.str(); } Index: InterfaceRegistry.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/InterfaceRegistry.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** InterfaceRegistry.cpp 14 Aug 2003 12:19:12 -0000 1.9 --- InterfaceRegistry.cpp 16 Aug 2003 07:56:40 -0000 1.10 *************** *** 35,38 **** --- 35,39 ---- #include <SimData/Enum.h> #include <SimData/Path.h> + #include <SimData/Version.h> #include <string> *************** *** 45,76 **** /////////////////////////////////////////////////////////////////////////// // InterfaceProxy - - /** - * The master interface registry. - */ - - /* - #ifdef _WIN32 - #pragma comment(linker, "/SECTION:.shared,RWS") - #pragma data_seg(".shared") - #endif - - InterfaceRegistry g_InterfaceRegistry; - */ - - //InterfaceRegistry::proxy_map *InterfaceRegistry::__map = 0; - //InterfaceRegistry::proxy_id_map *InterfaceRegistry::__id_map = 0; - //InterfaceRegistry::interface_list *InterfaceRegistry::__list = 0; - - /* - #ifdef _WIN32 - #pragma data_seg() - #endif - */ - InterfaceProxy::InterfaceProxy(const char *cname, hasht (*chash)()) { --- 46,54 ---- + /////////////////////////////////////////////////////////////////////////// // InterfaceProxy InterfaceProxy::InterfaceProxy(const char *cname, hasht (*chash)()) { *************** *** 90,94 **** } - //MemberAccessorBase * InterfaceProxy::getAccessor(const char *name, const char *cname = 0) const throw(InterfaceError) { MemberAccessorBase * InterfaceProxy::getAccessor(const char *name, const char *cname) const { if (!cname) cname = "?"; --- 68,71 ---- *************** *** 171,174 **** --- 148,152 ---- /////////////////////////////////////////////////////////////////////////// // InterfaceRegistry + InterfaceRegistry::InterfaceRegistry() { Index: Version.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Version.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Version.cpp 15 Aug 2003 06:59:16 -0000 1.6 --- Version.cpp 16 Aug 2003 07:56:40 -0000 1.7 *************** *** 22,25 **** --- 22,27 ---- #include <SimData/Version.h> #include <cstdio> + #include <iostream> + #include <iomanip> #ifndef SIMDATA_VERSION *************** *** 29,46 **** NAMESPACE_SIMDATA const char *getVersion() { return SIMDATA_VERSION; } - - - /** - * @brief Print a startup message to verify proper loading of SimData - */ - class load_check { - public: - load_check() { - printf("SimData %s loaded @ %p\n", getVersion(), this); - } - } check_interpolate; --- 31,39 ---- NAMESPACE_SIMDATA + /** Get the SimData version number. + */ const char *getVersion() { return SIMDATA_VERSION; } |
From: <mk...@us...> - 2003-08-16 07:56:42
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Include/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv22313/Include/SimData Modified Files: HashUtility.h InterfaceRegistry.h Object.h Log Message: Index: HashUtility.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/HashUtility.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** HashUtility.h 15 Aug 2003 06:59:16 -0000 1.16 --- HashUtility.h 16 Aug 2003 07:56:40 -0000 1.17 *************** *** 46,51 **** - #define hash_string newhasht_cstring - /** --- 46,49 ---- *************** *** 61,67 **** ! /** ! * @brief A 64-bit hash value. ! * */ struct SIMDATA_EXPORT HashT { --- 59,63 ---- ! /** A 64-bit hash value. */ struct SIMDATA_EXPORT HashT { *************** *** 110,113 **** --- 106,113 ---- typedef HashT hasht; + + //#define hash_string newhasht_cstring + inline HashT hash_string(std::string const &key) { return newhasht_cstring(key); } + Index: InterfaceRegistry.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/InterfaceRegistry.h,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** InterfaceRegistry.h 15 Aug 2003 01:17:06 -0000 1.19 --- InterfaceRegistry.h 16 Aug 2003 07:56:40 -0000 1.20 *************** *** 139,144 **** ! /** ! * @brief Creates a single, static instance of the templated class. */ template <class C> --- 139,143 ---- ! /** Creates a single, static instance of the templated class. */ template <class C> *************** *** 154,165 **** }; ! /** ! * @brief Singleton class to store and access all ObjectInterfaces in the application. * ! * ObjectInterfaces automatically register themselves with the global instance of this ! * class at startup. Interfaces can be accessed by name to provide dynamic object ! * creation and variable assignment. * ! * @author Mark Rose <mr...@st...> */ class InterfaceRegistry { --- 153,163 ---- }; ! /** Singleton class to store and access all ObjectInterfaces in the application. * ! * ObjectInterfaces automatically register themselves with the global instance of this ! * class at startup. Interfaces can be accessed by name to provide dynamic object ! * creation and variable assignment. * ! * @author Mark Rose <mr...@st...> */ class InterfaceRegistry { *************** *** 189,193 **** #if defined(_MSC_VER ) && (_MSC_VER <= 1200) ! virtual ~InterfaceRegistry(); #endif --- 187,191 ---- #if defined(_MSC_VER ) && (_MSC_VER <= 1200) ! virtual ~InterfaceRegistry(); #endif *************** *** 195,199 **** #if !defined(_MSC_VER ) || (_MSC_VER > 1200) ! virtual ~InterfaceRegistry(); #endif --- 193,197 ---- #if !defined(_MSC_VER ) || (_MSC_VER > 1200) ! virtual ~InterfaceRegistry(); #endif *************** *** 213,225 **** - // #define g_InterfaceRegistry Singleton<InterfaceRegistry>::getInstance() - - /** - * The master interface registry. - */ - /* - extern InterfaceRegistry g_InterfaceRegistry; - */ - //------------------------------------------------------- --- 211,214 ---- *************** *** 262,270 **** virtual bool isVirtual() const { return true; } - #ifdef _MSC_VER - #define CTOR_INIT(a, b) b - #else - #define CTOR_INIT(a, b) a::b - #endif // interface macro 2 --- 251,254 ---- Index: Object.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Object.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Object.h 15 Aug 2003 01:17:06 -0000 1.12 --- Object.h 16 Aug 2003 07:56:40 -0000 1.13 *************** *** 44,60 **** // Various object macros for internal use only. ! #define __LEAKCHECK(a) \ a() { printf(#a " %p\n", this); } \ ~a() { printf("~" #a " %p\n", this); } ! #define __GETCLASSNAME(a) \ static const char* _getClassName() { return #a; } \ virtual const char* getClassName() const { return _getClassName(); } ! #define __GETCLASSVERSION(major, minor) \ static const char* _getClassVersion() { return #major "." #minor; } \ virtual const char* getClassVersion() const { return _getClassVersion(); } ! #define __GETCLASSHASH(a, major) \ static SIMDATA(hasht) _getClassHash() { \ static SIMDATA(hasht) hash = 0; \ --- 44,60 ---- // Various object macros for internal use only. ! #define __SIMDATA_LEAKCHECK(a) \ a() { printf(#a " %p\n", this); } \ ~a() { printf("~" #a " %p\n", this); } ! #define __SIMDATA_GETCLASSNAME(a) \ static const char* _getClassName() { return #a; } \ virtual const char* getClassName() const { return _getClassName(); } ! #define __SIMDATA_GETCLASSVERSION(major, minor) \ static const char* _getClassVersion() { return #major "." #minor; } \ virtual const char* getClassVersion() const { return _getClassVersion(); } ! #define __SIMDATA_GETCLASSHASH(a, major) \ static SIMDATA(hasht) _getClassHash() { \ static SIMDATA(hasht) hash = 0; \ *************** *** 64,73 **** virtual SIMDATA(hasht) getClassHash() const { return _getClassHash(); } ! #define __CLASSDEF(a, major, minor) \ ! __GETCLASSNAME(a) \ ! __GETCLASSHASH(a, major) \ ! __GETCLASSVERSION(major, minor) ! #define __NEW(a) virtual SIMDATA(Object)* _new() const { return new a(); } // Macro to add standard boilerplate code to object classes. The --- 64,73 ---- virtual SIMDATA(hasht) getClassHash() const { return _getClassHash(); } ! #define __SIMDATA_CLASSDEF(a, major, minor) \ ! __SIMDATA_GETCLASSNAME(a) \ ! __SIMDATA_GETCLASSHASH(a, major) \ ! __SIMDATA_GETCLASSVERSION(major, minor) ! #define __SIMDATA_NEW(a) virtual SIMDATA(Object)* _new() const { return new a(); } // Macro to add standard boilerplate code to object classes. The *************** *** 77,82 **** // deserialization. #define SIMDATA_OBJECT(a, major, minor) \ ! __CLASSDEF(a, major, minor) \ ! __NEW(a) // Macro to automatically register an object class with the --- 77,82 ---- // deserialization. #define SIMDATA_OBJECT(a, major, minor) \ ! __SIMDATA_CLASSDEF(a, major, minor) \ ! __SIMDATA_NEW(a) // Macro to automatically register an object class with the *************** *** 90,117 **** NAMESPACE_SIMDATA ! /** ! * @brief Base class for all classes representing packable data objects. * ! * Derived classes must include the SIMDATA_OBJECT(classname, major, minor) ! * macro in their class definition and the SIMDATA_REGISTER(classname) macro ! * in their implementation. * ! * The following methods must be extended in derived classes: ! * pack serialize object to archive (call superclass method first) ! * unpack unserialize object from archive (call superclass method ! * first) ! * parseXML parse loose XML cdata if present ! * convertXML post-process XML data ! * postCreate additional processing after deserialization * ! * Objects should never be copied or handled directly by user code. Use ! * Ref<> handles to manipulate them by reference, and Link<> member variables ! * to load them from data archives. Objects set as 'static' are singletons ! * managed by the DataArchive. * ! * @author Mark Rose <mr...@st...> ! * @ingroup BaseTypes */ - class SIMDATA_EXPORT Object: public Referenced, public BaseType { friend class DataArchive; --- 90,115 ---- NAMESPACE_SIMDATA ! /** Base class for all classes representing packable data objects. * ! * Derived classes must include the SIMDATA_OBJECT(classname, major, minor) ! * macro in their class definition and the SIMDATA_REGISTER(classname) macro ! * in their implementation. * ! * The following methods must be extended in derived classes: ! * @li pack serialize object to archive (call superclass method first) ! * @li unpack unserialize object from archive (call superclass method ! * first) ! * @li parseXML parse loose XML cdata if present ! * @li convertXML post-process XML data ! * @li postCreate additional processing after deserialization * ! * Objects should never be copied or handled directly by user code. Use ! * Ref<> handles to manipulate them by reference, and Link<> member variables ! * to load them from data archives. Objects set as 'static' are singletons ! * managed by the DataArchive. * ! * @author Mark Rose <mr...@st...> ! * @ingroup BaseTypes */ class SIMDATA_EXPORT Object: public Referenced, public BaseType { friend class DataArchive; *************** *** 153,157 **** } ! __CLASSDEF(Object, 0, 0) /** --- 151,155 ---- } ! __SIMDATA_CLASSDEF(Object, 0, 0) /** |
From: <mk...@us...> - 2003-08-16 07:56:42
|
Update of /cvsroot/csp/APPLICATIONS/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv22313 Modified Files: CHANGES.current Makefile Log Message: Index: CHANGES.current =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/CHANGES.current,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** CHANGES.current 15 Aug 2003 06:59:15 -0000 1.65 --- CHANGES.current 16 Aug 2003 07:56:39 -0000 1.66 *************** *** 2,5 **** --- 2,20 ---- =========================== + 2003-08-15: onsight + More Doxygen work. + + Move loadcheck to BaseType.cpp, which is much more + likely to be linked to any application using SimData. + The load message can be disabled by building with + SIMDATA_NOLOADCHECK defined. + + Changed a couple sprintf/printf's to iostreams. + + Prefixed internal macro names in Object.h with 'SIMDATA'. + + Changed hash_string from a macro to an inline function + in the simdata namespace. + 2003-08-14: onsight Doxygen comment fixes. Index: Makefile =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Makefile,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Makefile 15 Aug 2003 06:59:15 -0000 1.19 --- Makefile 16 Aug 2003 07:56:39 -0000 1.20 *************** *** 3,7 **** export PYTHON_INCLUDE := $(shell python setup.py python_include_path) ! export GDEBUGF = -g -W -Wall -Werror -pedantic export GCFLAGS = -fPIC -O2 # -march=athlon-tbird export GLDOPTS = -shared -lswigpy -ldl --- 3,7 ---- export PYTHON_INCLUDE := $(shell python setup.py python_include_path) ! export GDEBUGF = -g -W -Wall -Werror -pedantic #-DSIMDATA_NOLOADCHECK export GCFLAGS = -fPIC -O2 # -march=athlon-tbird export GLDOPTS = -shared -lswigpy -ldl |
From: <mk...@us...> - 2003-08-15 08:19:09
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Source In directory sc8-pr-cvs1:/tmp/cvs-serv30151 Modified Files: Date.cpp Log Message: Index: Date.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Date.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Date.cpp 15 Aug 2003 06:59:16 -0000 1.6 --- Date.cpp 15 Aug 2003 08:05:10 -0000 1.7 *************** *** 427,439 **** double DateZulu::getAccurateMST(radian_t longitude) const { ! double JD = getJulianDate(); ! double T = (JD - EPOCH) * SIMDATA_F1p0_36525p0; ! double F = DAYSEC * (JD - (int) JD); ! double GMST = COEFF0 - DAYSEC/2.0L ! + ((COEFF1 + (COEFF2 + COEFF3 * T) * T) * T) + F; ! GMST = GMST * SEC2RAD; ! int n = (int) (GMST * (0.5/PI)); ! if (n < 0) n--; ! return GMST - n*(2.0*PI) + longitude; } --- 427,431 ---- double DateZulu::getAccurateMST(radian_t longitude) const { ! return getMST(longitude); } *************** *** 443,447 **** double F = DAYSEC * (JD - (int) JD); double GMST = COEFF0 - DAYSEC/2.0L ! + COEFF1 * T + F; GMST = GMST * SEC2RAD; int n = (int) (GMST * (0.5/PI)); --- 435,439 ---- double F = DAYSEC * (JD - (int) JD); double GMST = COEFF0 - DAYSEC/2.0L ! + ((COEFF1 + (COEFF2 + COEFF3 * T) * T) * T) + F; GMST = GMST * SEC2RAD; int n = (int) (GMST * (0.5/PI)); |
Update of /cvsroot/csp/APPLICATIONS/SimData/Include/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv18849/Include/SimData Modified Files: DataArchive.h Date.h HashUtility.h HashUtility.i Key.h cSimData.i Added Files: Uniform.h Removed Files: GlibCsp.h Log Message: --- NEW FILE: Uniform.h --- /* SimData: Data Infrastructure for Simulations * Copyright (C) 2002, 2003 Mark Rose <tm...@st...> * * This file is part of SimData. * * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /** * @file Uniform.h * @author Mark Rose <mr...@st...> */ #ifndef __SIMDATA_UNIFORM_H__ #define __SIMDATA_UNIFORM_H__ #include <SimData/Namespace.h> NAMESPACE_SIMDATA typedef signed char int8; typedef unsigned char uint8; typedef signed short int16; typedef unsigned short uint16; typedef signed int int32; typedef unsigned int uint32; NAMESPACE_SIMDATA_END #endif // __SIMDATA_UNIFORM_H__ Index: DataArchive.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/DataArchive.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** DataArchive.h 15 Aug 2003 01:17:06 -0000 1.17 --- DataArchive.h 15 Aug 2003 06:59:16 -0000 1.18 *************** *** 28,31 **** --- 28,32 ---- #include <SimData/Export.h> + #include <SimData/Uniform.h> #include <SimData/Link.h> #include <SimData/Exception.h> *************** *** 81,86 **** hasht pathhash; hasht classhash; ! gint32 offset; ! gint32 length; }; --- 82,87 ---- hasht pathhash; hasht classhash; ! int32 offset; ! int32 length; }; Index: Date.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Date.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Date.h 15 Aug 2003 04:52:05 -0000 1.14 --- Date.h 15 Aug 2003 06:59:16 -0000 1.15 *************** *** 35,39 **** * * DateZulu: - * * This class simply combines Date and Zulu, implementing * date/time rollover. Some astronical time routines, such --- 35,38 ---- *************** *** 41,50 **** * * SimTime: [...1564 lines suppressed...] --- 942,960 ---- } + /** Serialize the date and time to a data archive. + */ virtual void pack(Packer &p) const; + /** Deserialize the date and time from a data archive. + */ virtual void unpack(UnPacker &p); ! /** Parse date/time string from XML cdata. * ! * The format is either: * <Date name='...'>yyyy-mm-dd hh-mm-ss.ms</Date> ! * where '.ms' is optional, or: * <Date name='...'>yyyy-mm-dd</Date> ! * in which case the time is set to zero. */ virtual void parseXML(const char* cdata); Index: HashUtility.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/HashUtility.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** HashUtility.h 15 Aug 2003 01:17:06 -0000 1.15 --- HashUtility.h 15 Aug 2003 06:59:16 -0000 1.16 *************** *** 33,68 **** # endif - #include <iostream> - #include <string> #include <SimData/Export.h> ! #include <SimData/GlibCsp.h> #include <SimData/hash_map.h> #include <SimData/Namespace.h> ! //typedef int int32; ! //typedef char* cstring; ! ! //typedef hash<const char*> hashstr; ! //#define hashstr4 newhash4_cstring ! //#define hashstr8 newhash8_cstring - // use 64-bit hash values - //#define hasht u8 #define hash_string newhasht_cstring - //#define hash_string hashstr8 - //#define hasht_hash hashu8 - //#define hasht_eq equ8 - - typedef guint32 u4; /* unsigned 4-byte type */ - typedef guint8 u1; /* unsigned 1-byte type */ - typedef guint64 u8; /* unsigned 8-byte type */ - //typedef u8 hasht; - - NAMESPACE_SIMDATA /** --- 33,51 ---- # endif #include <SimData/Export.h> ! #include <SimData/Uniform.h> #include <SimData/hash_map.h> #include <SimData/Namespace.h> ! #include <iostream> ! #include <string> ! NAMESPACE_SIMDATA #define hash_string newhasht_cstring /** *************** *** 74,82 **** struct HashT; ! extern SIMDATA_EXPORT u4 newhash4_cstring(std::string const &); ! extern HashT newhasht_cstring(std::string const &); ! //extern u8 newhash8_cstring(std::string const &); - //typedef u8 hasht; /** --- 57,63 ---- struct HashT; ! extern SIMDATA_EXPORT uint32 newhash4_cstring(std::string const &); ! extern SIMDATA_EXPORT HashT newhasht_cstring(std::string const &); /** *************** *** 85,96 **** */ struct SIMDATA_EXPORT HashT { ! guint32 a, b; HashT() { a = b = 0; } ! HashT(guint32 x) { a = x; b = 0; } ! HashT(guint32 b_, guint32 a_) { a = a_; b = b_; } --- 66,77 ---- */ struct SIMDATA_EXPORT HashT { ! uint32 a, b; HashT() { a = b = 0; } ! HashT(uint32 x) { a = x; b = 0; } ! HashT(uint32 b_, uint32 a_) { a = a_; b = b_; } *************** *** 101,108 **** *this = newhasht_cstring(x); } ! bool operator ==(guint32 x) const { return (b == 0 && a == x); } ! bool operator !=(guint32 x) const { return (b != 0 || a != x); } --- 82,89 ---- *this = newhasht_cstring(x); } ! bool operator ==(uint32 x) const { return (b == 0 && a == x); } ! bool operator !=(uint32 x) const { return (b != 0 || a != x); } *************** *** 117,121 **** return *this; } ! HashT & operator =(guint32 x) { a = x; b = 0; return *this; --- 98,102 ---- return *this; } ! HashT & operator =(uint32 x) { a = x; b = 0; return *this; *************** *** 131,136 **** ! /** ! * @brief Integer equality functor for hash_map. */ #if defined(_MSC_VER) && (_MSC_VER >= 1300) --- 112,116 ---- ! /** Integer equality functor for hash_map. */ #if defined(_MSC_VER) && (_MSC_VER >= 1300) *************** *** 151,156 **** #endif ! /** ! * @brief Integer hash functor for hash_map. */ struct hashint { --- 131,135 ---- #endif ! /** Integer hash functor for hash_map. */ struct hashint { *************** *** 161,166 **** ! /** ! * @brief const char* equality functor for hash_map. */ #if defined(_MSC_VER) && (_MSC_VER >= 1300) --- 140,144 ---- ! /** const char* equality functor for hash_map. */ #if defined(_MSC_VER) && (_MSC_VER >= 1300) *************** *** 183,197 **** #endif ! /** ! * @brief hasht hash functor for hash_map. */ struct hasht_hash { ! guint32 operator()(hasht i1) const { return i1.a; } }; ! /** ! * @brief hasht equality functor for hash_map. */ #if defined(_MSC_VER) && (_MSC_VER >= 1300) --- 161,173 ---- #endif ! /** hasht hash functor for hash_map. */ struct hasht_hash { ! uint32 operator()(hasht i1) const { return i1.a; } }; ! /** hasht equality functor for hash_map. */ #if defined(_MSC_VER) && (_MSC_VER >= 1300) *************** *** 213,218 **** ! /** ! * @brief String hash functor for hash_map. */ struct SIMDATA_EXPORT hashstring { --- 189,193 ---- ! /** String hash functor for hash_map. */ struct SIMDATA_EXPORT hashstring { *************** *** 223,228 **** }; ! /** ! * @brief String equality functor for hash_map. */ #if defined(_MSC_VER) && (_MSC_VER >= 1300) --- 198,202 ---- }; ! /** String equality functor for hash_map. */ #if defined(_MSC_VER) && (_MSC_VER >= 1300) *************** *** 246,251 **** class ObjectProxyBase; ! /** ! * @brief hash_map specialization type for hasht to T maps. */ template <class T> --- 220,224 ---- class ObjectProxyBase; ! /** hash_map specialization type for hasht to T maps. */ template <class T> *************** *** 254,264 **** }; ! /** ! * @brief A hasht to int map. */ typedef HASH_MAPS<hasht, int, hasht_hash, hasht_eq>::Type hasht_map; ! /** ! * @brief A hasht to ObjectProxyBase* map. */ typedef HASH_MAPS<hasht, ObjectProxyBase*, hasht_hash, hasht_eq>::Type proxy_map; --- 227,235 ---- }; ! /** A hasht to int map. */ typedef HASH_MAPS<hasht, int, hasht_hash, hasht_eq>::Type hasht_map; ! /** A hasht to ObjectProxyBase* map. */ typedef HASH_MAPS<hasht, ObjectProxyBase*, hasht_hash, hasht_eq>::Type proxy_map; Index: HashUtility.i =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/HashUtility.i,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** HashUtility.i 6 Aug 2003 06:36:24 -0000 1.4 --- HashUtility.i 15 Aug 2003 06:59:16 -0000 1.5 *************** *** 26,32 **** #include "SimData/Namespace.h" - typedef unsigned long int u4; /* unsigned 4-byte type */ - typedef unsigned char u1; /* unsigned 1-byte type */ - %rename(hash_string) SIMDATA(newhasht_cstring)(const char*); --- 26,29 ---- *************** *** 35,43 **** struct HashT { HashT(); ! HashT(guint32 x); ! HashT(guint32 b_, guint32 a_); HashT(const HashT &x); ! bool operator ==(guint32 x) const; ! bool operator !=(guint32 x) const; bool operator ==(HashT const &x) const; bool operator !=(HashT const &x) const; --- 32,40 ---- struct HashT { HashT(); ! HashT(uint32 x); ! HashT(uint32 b_, uint32 a_); HashT(const HashT &x); ! bool operator ==(uint32 x) const; ! bool operator !=(uint32 x) const; bool operator ==(HashT const &x) const; bool operator !=(HashT const &x) const; Index: Key.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Key.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Key.h 15 Aug 2003 01:17:06 -0000 1.4 --- Key.h 15 Aug 2003 06:59:16 -0000 1.5 *************** *** 44,48 **** class SIMDATA_EXPORT Key: public BaseType { protected: ! u4 _key; public: --- 44,48 ---- class SIMDATA_EXPORT Key: public BaseType { protected: ! uint32 _key; public: Index: cSimData.i =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/cSimData.i,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** cSimData.i 10 Aug 2003 17:52:08 -0000 1.11 --- cSimData.i 15 Aug 2003 06:59:16 -0000 1.12 *************** *** 38,41 **** --- 38,42 ---- %include "SimData/Export.h" %include "SimData/Version.h" + %include "SimData/Uniform.h" %include "SimData/Log.i" --- GlibCsp.h DELETED --- |
From: <mk...@us...> - 2003-08-15 07:36:21
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Source In directory sc8-pr-cvs1:/tmp/cvs-serv18849/Source Modified Files: Date.cpp HashUtility.cpp Key.cpp Version.cpp Log Message: Index: Date.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Date.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Date.cpp 14 Aug 2003 12:19:12 -0000 1.5 --- Date.cpp 15 Aug 2003 06:59:16 -0000 1.6 *************** *** 22,106 **** #include <SimData/Date.h> ///////////////////////////////////////////////////////////// - // // 'fast' timing routines (1-2 msec accuracy) - // - ///////////////////////////////////////////////////////////// - #ifdef _WIN32 ! #include <Windows.h> ! #include <ctime> ! static LARGE_INTEGER _tstart, _tend; ! static LARGE_INTEGER freq; ! void tstart(void) ! { ! static int first = 1; ! if(first) { ! QueryPerformanceFrequency(&freq); ! first = 0; ! } ! QueryPerformanceCounter(&_tstart); ! } ! void tend(void) ! { ! QueryPerformanceCounter(&_tend); ! } ! double tval() ! { ! return ((double)_tend.QuadPart - ! (double)_tstart.QuadPart)/((double)freq.QuadPart); ! } ! timing_t get_realtime() { ! static double scale; ! static int first = 1; ! LARGE_INTEGER x; ! double now; ! if (first) { ! QueryPerformanceFrequency(&x); ! first = 0; ! scale = 1.0 / (double)x.QuadPart; } - QueryPerformanceCounter(&x); - now = (double)x.QuadPart; - return (timing_t) (now * scale); - } #else ! #include <sys/time.h> ! #include <unistd.h> ! static struct timeval _tstart, _tend; ! static struct timezone tz; ! void tstart(void) ! { ! gettimeofday(&_tstart, &tz); ! } ! void tend(void) ! { ! gettimeofday(&_tend,&tz); ! } ! double tval() ! { ! double t1, t2; ! t1 = (double)_tstart.tv_sec + (double)_tstart.tv_usec/(1000*1000); ! t2 = (double)_tend.tv_sec + (double)_tend.tv_usec/(1000*1000); ! return t2-t1; ! } ! timing_t get_realtime() { ! struct timezone tz; ! struct timeval now; ! gettimeofday(&now, &tz); ! return (timing_t) ((double)now.tv_sec + (double)now.tv_usec*1.0e-6); ! } #endif --- 22,101 ---- #include <SimData/Date.h> + + + NAMESPACE_SIMDATA + + ///////////////////////////////////////////////////////////// // 'fast' timing routines (1-2 msec accuracy) #ifdef _WIN32 ! #include <Windows.h> ! #include <ctime> ! static LARGE_INTEGER _tstart, _tend; ! static LARGE_INTEGER freq; ! void tstart(void) { ! static int first = 1; ! if (first) { ! QueryPerformanceFrequency(&freq); ! first = 0; ! } ! QueryPerformanceCounter(&_tstart); ! } ! void tend(void) { ! QueryPerformanceCounter(&_tend); ! } ! double tval() { ! return ((double)_tend.QuadPart - ! (double)_tstart.QuadPart)/((double)freq.QuadPart); ! } ! timing_t get_realtime() { ! static double scale; ! static int first = 1; ! LARGE_INTEGER x; ! double now; ! if (first) { ! QueryPerformanceFrequency(&x); ! first = 0; ! scale = 1.0 / (double)x.QuadPart; ! } ! QueryPerformanceCounter(&x); ! now = (double)x.QuadPart; ! return (timing_t) (now * scale); } #else ! #include <sys/time.h> ! #include <unistd.h> ! static struct timeval _tstart, _tend; ! static struct timezone tz; ! void tstart(void) { ! gettimeofday(&_tstart, &tz); ! } ! void tend(void) { ! gettimeofday(&_tend,&tz); ! } ! double tval() { ! double t1, t2; ! t1 = (double)_tstart.tv_sec + (double)_tstart.tv_usec/(1000*1000); ! t2 = (double)_tend.tv_sec + (double)_tend.tv_usec/(1000*1000); ! return t2-t1; ! } ! timing_t get_realtime() { ! struct timezone tz; ! struct timeval now; ! gettimeofday(&now, &tz); ! return (timing_t) ((double)now.tv_sec + (double)now.tv_usec*1.0e-6); ! } #endif *************** *** 108,114 **** ///////////////////////////////////////////////////////////// // end of timing routines - ///////////////////////////////////////////////////////////// - - NAMESPACE_SIMDATA --- 103,106 ---- *************** *** 436,440 **** double DateZulu::getAccurateMST(radian_t longitude) const { double JD = getJulianDate(); ! double T = (JD - EPOCH) * F1p0_36525p0; double F = DAYSEC * (JD - (int) JD); double GMST = COEFF0 - DAYSEC/2.0L --- 428,432 ---- double DateZulu::getAccurateMST(radian_t longitude) const { double JD = getJulianDate(); ! double T = (JD - EPOCH) * SIMDATA_F1p0_36525p0; double F = DAYSEC * (JD - (int) JD); double GMST = COEFF0 - DAYSEC/2.0L *************** *** 448,452 **** double DateZulu::getMST(radian_t longitude) const { double JD = getJulianDate(); ! double T = (JD - EPOCH) * F1p0_36525p0; double F = DAYSEC * (JD - (int) JD); double GMST = COEFF0 - DAYSEC/2.0L --- 440,444 ---- double DateZulu::getMST(radian_t longitude) const { double JD = getJulianDate(); ! double T = (JD - EPOCH) * SIMDATA_F1p0_36525p0; double F = DAYSEC * (JD - (int) JD); double GMST = COEFF0 - DAYSEC/2.0L Index: HashUtility.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/HashUtility.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** HashUtility.cpp 14 Aug 2003 12:19:12 -0000 1.7 --- HashUtility.cpp 15 Aug 2003 06:59:16 -0000 1.8 *************** *** 22,28 **** * @file HashUtility.cpp * ! * Hash routines coded here are from "Hash Functions for Hash Table Lookup" ! * by Robert J. Jenkins Jr., <http://burtleburtle.net/bob/hash/evahash.html> ! * */ #include <sstream> --- 22,28 ---- * @file HashUtility.cpp * ! * The hash functions coded here are from "Hash Functions for Hash ! * Table Lookup" by Robert J. Jenokins Jr., and are Public Domain. ! * See <http://burtleburtle.net/bob/hash/evahash.html> */ #include <sstream> *************** *** 36,40 **** HASH<const char*> hashstring::h; ! /* The mixing step */ #define mix(a,b,c) \ { \ --- 36,40 ---- HASH<const char*> hashstring::h; ! // The mixing step #define mix(a,b,c) \ { \ *************** *** 50,122 **** } ! /* The whole new hash function */ ! u4 newhash( register u1 const *k, u4 length, u4 initval) ! //register u1 *k; /* the key */ ! //u4 length; /* the length of the key in bytes */ ! //u4 initval; /* the previous hash, or an arbitrary value */ { ! register u4 a,b,c; /* the internal state */ ! u4 len; /* how many key bytes still need mixing */ ! /* Set up the internal state */ len = length; ! a = b = 0x9e3779b9; /* the golden ratio; an arbitrary value */ ! c = initval; /* variable initialization of internal state */ ! /*---------------------------------------- handle most of the key */ while (len >= 12) { ! a=a+(k[0]+((u4)k[1]<<8)+((u4)k[2]<<16) +((u4)k[3]<<24)); ! b=b+(k[4]+((u4)k[5]<<8)+((u4)k[6]<<16) +((u4)k[7]<<24)); ! c=c+(k[8]+((u4)k[9]<<8)+((u4)k[10]<<16)+((u4)k[11]<<24)); mix(a,b,c); k = k+12; len = len-12; } ! /*------------------------------------- handle the last 11 bytes */ c = c+length; ! switch(len) /* all the case statements fall through */ ! { ! case 11: c=c+((u4)k[10]<<24); ! case 10: c=c+((u4)k[9]<<16); ! case 9 : c=c+((u4)k[8]<<8); ! /* the first byte of c is reserved for the length */ ! case 8 : b=b+((u4)k[7]<<24); ! case 7 : b=b+((u4)k[6]<<16); ! case 6 : b=b+((u4)k[5]<<8); ! case 5 : b=b+k[4]; ! case 4 : a=a+((u4)k[3]<<24); ! case 3 : a=a+((u4)k[2]<<16); ! case 2 : a=a+((u4)k[1]<<8); ! case 1 : a=a+k[0]; ! /* case 0: nothing left to add */ } mix(a,b,c); ! /*-------------------------------------------- report the result */ return c; } ! /** ! * Generate a 32-bit hash from a string */ ! u4 newhash4_cstring(std::string const &str) { ! return newhash((u1 const*)str.c_str(), str.size(), 0); } ! /** ! * Generate a 64-bit hash from a string */ - u8 newhash8_cstring(std::string const &str) { - u8 h0, h1; - h0 = newhash((u1 const*)str.c_str(), str.size(), 0); - h1 = newhash((u1 const*)str.c_str(), str.size(), 1); - return ((h1 << 32) | h0); - } - HashT newhasht_cstring(std::string const &str) { ! u4 h0, h1; ! h0 = newhash((u1 const*)str.c_str(), str.size(), 0); ! h1 = newhash((u1 const*)str.c_str(), str.size(), 1); return HashT(h1, h0); } --- 50,116 ---- } ! /** A character string to 32-bit hash function. ! * ! * @author Bob Jenkins, December 1996, Public Domain. ! * ! * @param k the string to hash ! * @param length the length of the string in bytes. ! * @param initval the previous hash, or an arbitrary value ! */ ! uint32 newhash(register uint8 const *k, uint32 length, uint32 initval) { ! register uint32 a,b,c; // the internal state ! uint32 len; // how many key bytes still need mixing ! // Set up the internal state len = length; ! a = b = 0x9e3779b9; // the golden ratio; an arbitrary value ! c = initval; // variable initialization of internal state ! // handle most of the key while (len >= 12) { ! a=a+(k[0]+((uint32)k[1]<<8)+((uint32)k[2]<<16) +((uint32)k[3]<<24)); ! b=b+(k[4]+((uint32)k[5]<<8)+((uint32)k[6]<<16) +((uint32)k[7]<<24)); ! c=c+(k[8]+((uint32)k[9]<<8)+((uint32)k[10]<<16)+((uint32)k[11]<<24)); mix(a,b,c); k = k+12; len = len-12; } ! // handle the last 11 bytes c = c+length; ! switch(len) { // all the case statements fall through ! case 11: c=c+((uint32)k[10]<<24); ! case 10: c=c+((uint32)k[9]<<16); ! case 9 : c=c+((uint32)k[8]<<8); ! // the first byte of c is reserved for the length ! case 8 : b=b+((uint32)k[7]<<24); ! case 7 : b=b+((uint32)k[6]<<16); ! case 6 : b=b+((uint32)k[5]<<8); ! case 5 : b=b+k[4]; ! case 4 : a=a+((uint32)k[3]<<24); ! case 3 : a=a+((uint32)k[2]<<16); ! case 2 : a=a+((uint32)k[1]<<8); ! case 1 : a=a+k[0]; ! // case 0: nothing left to add } mix(a,b,c); ! // report the result return c; } ! /** Generate a 32-bit hash from a string */ ! uint32 newhash4_cstring(std::string const &str) { ! return newhash((uint8 const*)str.c_str(), str.size(), 0); } ! /** Generate a 64-bit hash (HashT) from a string */ HashT newhasht_cstring(std::string const &str) { ! uint32 h0, h1; ! h0 = newhash((uint8 const*)str.c_str(), str.size(), 0); ! h1 = newhash((uint8 const*)str.c_str(), str.size(), 1); return HashT(h1, h0); } Index: Key.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Key.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Key.cpp 6 Aug 2003 06:36:25 -0000 1.2 --- Key.cpp 15 Aug 2003 06:59:16 -0000 1.3 *************** *** 42,46 **** int k; p.unpack(k); ! _key = static_cast<u4>(k); } --- 42,46 ---- int k; p.unpack(k); ! _key = static_cast<uint32>(k); } Index: Version.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Version.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Version.cpp 15 Aug 2003 01:17:06 -0000 1.5 --- Version.cpp 15 Aug 2003 06:59:16 -0000 1.6 *************** *** 21,24 **** --- 21,25 ---- #include <SimData/Version.h> + #include <cstdio> #ifndef SIMDATA_VERSION |