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-04-11 23:43:08
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim In directory sc8-pr-cvs1:/tmp/cvs-serv5133 Modified Files: CHANGES.current Log Message: see CHANGES.current Index: CHANGES.current =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/CHANGES.current,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** CHANGES.current 11 Apr 2003 19:33:03 -0000 1.15 --- CHANGES.current 11 Apr 2003 23:43:05 -0000 1.16 *************** *** 2,8 **** =========================== ! ALL USERS: you will need to remake your aircraft.hid file. ! Go to Tools/HID, and run map2hid aicraft.map, then copy the ! resulting aicraft.hid file to your Data/Input directory. 2003-04-10: onsight --- 2,30 ---- =========================== ! 2003-04-11: onsight ! Fixed two coordinate system bugs in the impact code during ! hard crashes that could cause numerical overflows and lead ! to segfaults. There's still somewhat odd behaviour at ! times, but only under conditions where the plane would ! break into pieces anyway (which of course isn't modelled ! yet). ! ! Reordered member initializers in NumericalMethod ctors to ! silence gcc warnigns. ! ! Made DynamicalSystem dtor virtual. ! ! Added global try/catch block around CSPSim::Init. ! ! Added trilinear filtering option to ObjectModel. ! ! Added #! shell escape to the python scripts in Bin ! so they can be run directly from the commandd line ! under linux (assuming your python path is the same ! as mine ;-). ! ! *********** ALL USERS: you will need to remake your aircraft.hid file. ! Go to Tools/HID, and run map2hid aicraft.map, then copy the ! resulting aicraft.hid file to your Data/Input directory. 2003-04-10: onsight *************** *** 17,21 **** when binding to the m2k and other aircraft. ! LINUX USERS: you need to add NumericalMethod.cpp to your Makefile. 2003-04-09: delta updated .net project. --- 39,45 ---- when binding to the m2k and other aircraft. ! *********** LINUX USERS: you need to add NumericalMethod.cpp to your ! Makefile. ! 2003-04-09: delta updated .net project. *************** *** 24,46 **** updated .net project; debug and release are maintained. ! Rewritten DynamicalSystem interface; you need now, to define a ! vector field as a method of DynamicalSystem (which inherites from ! VectorField). You need to furnish the NumericalMethod used to approximate ! the exact solution of your ODE (use setNumericalMethod). AeroDynamics is ! now a DynamicalSystem. ! Merging Onsight code on airflow, collision and landing gear; this code is not ! yet enabled. ! Cleaning code in CSPSim.cpp, AeroDynamics.cpp and .h; added NumericalMethod.cpp ! and NumericalMethod.h. 2003-03-28: delta ! .net project updated: CSPSimDLL (release mode is maintained) ! You can run python scripts from commandline without invoking python ! interpreter. For example, to rebuild data: "RebuildData.py <CR>" or ! to run CSP, "CSPSim.py <CR>". ! Removed CSPWin.py, CompileData.py and RebuildData.py from /VisualStudio. 2003-03-27: onsight --- 48,71 ---- updated .net project; debug and release are maintained. ! Rewritten DynamicalSystem interface; you need now, to define a ! vector field as a method of DynamicalSystem (which inherites ! from VectorField). You need to furnish the NumericalMethod used ! to approximate the exact solution of your ODE (use ! setNumericalMethod). AeroDynamics is now a DynamicalSystem. ! Merging Onsight code on airflow, collision and landing gear; ! this code is not yet enabled. ! Cleaning code in CSPSim.cpp, AeroDynamics.cpp and .h; added ! NumericalMethod.cpp and NumericalMethod.h. 2003-03-28: delta ! .net project updated: CSPSimDLL (release mode is maintained) You ! can run python scripts from commandline without invoking python ! interpreter. For example, to rebuild data: "RebuildData.py <CR>" ! or to run CSP, "CSPSim.py <CR>". ! Removed CSPWin.py, CompileData.py and RebuildData.py from ! /VisualStudio. 2003-03-27: onsight |
|
From: <de...@us...> - 2003-04-11 20:01:02
|
Update of /cvsroot/csp/APPLICATIONS/SimData
In directory sc8-pr-cvs1:/tmp/cvs-serv29904
Modified Files:
CHANGES.current
Log Message:
no message
Index: CHANGES.current
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/SimData/CHANGES.current,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** CHANGES.current 11 Apr 2003 18:12:31 -0000 1.19
--- CHANGES.current 11 Apr 2003 20:00:58 -0000 1.20
***************
*** 2,5 ****
--- 2,8 ----
===========================
+ 2003-04-11: delta
+ Finally got the changes from Onsight compile on .net ;-)
+
2003-03-29: onsight
Added a DataManager class to combine access to multiple data
***************
*** 19,23 ****
updated .net project (release mode is maintained)
! Once SimData is compiled, in command line, write:
setup.py make_install_win
from APPLICATIONS/SimData to copy all headers and binaries needed
--- 22,26 ----
updated .net project (release mode is maintained)
! Once SimData is compiled, in command line, type:
setup.py make_install_win
from APPLICATIONS/SimData to copy all headers and binaries needed
|
|
From: <de...@us...> - 2003-04-11 20:00:34
|
Update of /cvsroot/csp/APPLICATIONS/SimData/VisualStudio In directory sc8-pr-cvs1:/tmp/cvs-serv29748 Modified Files: SimData.vcproj Log Message: no message Index: SimData.vcproj =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/VisualStudio/SimData.vcproj,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SimData.vcproj 28 Mar 2003 19:06:34 -0000 1.4 --- SimData.vcproj 11 Apr 2003 20:00:27 -0000 1.5 *************** *** 140,143 **** --- 140,146 ---- </File> <File + RelativePath="..\Source\DataManager.cpp"> + </File> + <File RelativePath="..\Source\Date.cpp"> </File> *************** *** 150,153 **** --- 153,159 ---- <File RelativePath="..\Source\External.cpp"> + </File> + <File + RelativePath="..\Source\FileUtility.cpp"> </File> <File |
|
From: <mk...@us...> - 2003-04-11 19:33:07
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim
In directory sc8-pr-cvs1:/tmp/cvs-serv18692
Modified Files:
CHANGES.current
Log Message:
Index: CHANGES.current
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/CHANGES.current,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** CHANGES.current 11 Apr 2003 18:59:20 -0000 1.14
--- CHANGES.current 11 Apr 2003 19:33:03 -0000 1.15
***************
*** 2,5 ****
--- 2,9 ----
===========================
+ ALL USERS: you will need to remake your aircraft.hid file.
+ Go to Tools/HID, and run map2hid aicraft.map, then copy the
+ resulting aicraft.hid file to your Data/Input directory.
+
2003-04-10: onsight
NumericalMethods.cpp added.
***************
*** 9,12 ****
--- 13,19 ----
Data archive paths now use the new 'sim:' prefix. See
SimData CHANGES.current for details.
+
+ Updates to aircraft-core to use the new 'sim:' prefix
+ when binding to the m2k and other aircraft.
LINUX USERS: you need to add NumericalMethod.cpp to your Makefile.
|
|
From: <mk...@us...> - 2003-04-11 19:07:47
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Tools/HID/Maps In directory sc8-pr-cvs1:/tmp/cvs-serv5690/Tools/HID/Maps Modified Files: aircraft-core.map Log Message: adjusted for new dar paths Index: aircraft-core.map =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Tools/HID/Maps/aircraft-core.map,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** aircraft-core.map 27 Mar 2003 03:15:32 -0000 1.1 --- aircraft-core.map 11 Apr 2003 19:07:44 -0000 1.2 *************** *** 5,10 **** device mouse 0 mouse standard_mouse ! bind vehicles.aircraft.m2k ! bind vehicles.aircraft.f16 mode base --- 5,10 ---- device mouse 0 mouse standard_mouse ! bind sim:vehicles.aircraft.m2k ! bind sim:vehicles.aircraft.f16 mode base |
|
From: <mk...@us...> - 2003-04-11 18:59:26
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim In directory sc8-pr-cvs1:/tmp/cvs-serv2330 Modified Files: CHANGES.current Log Message: see CHANGES.current Index: CHANGES.current =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/CHANGES.current,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** CHANGES.current 9 Apr 2003 19:59:18 -0000 1.13 --- CHANGES.current 11 Apr 2003 18:59:20 -0000 1.14 *************** *** 2,5 **** --- 2,13 ---- =========================== + 2003-04-10: onsight + NumericalMethods.cpp added. + + Sim.dar renamed to sim.dar. + + Data archive paths now use the new 'sim:' prefix. See + SimData CHANGES.current for details. + LINUX USERS: you need to add NumericalMethod.cpp to your Makefile. 2003-04-09: delta |
|
From: <mk...@us...> - 2003-04-11 18:59:26
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Source
In directory sc8-pr-cvs1:/tmp/cvs-serv2330/Source
Modified Files:
Sky.cpp CSPSim.cpp
Log Message:
see CHANGES.current
Index: Sky.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/Sky.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** Sky.cpp 21 Mar 2003 20:07:57 -0000 1.8
--- Sky.cpp 11 Apr 2003 18:59:20 -0000 1.9
***************
*** 184,188 ****
simdata::DataArchive *archive = CSPSim::theSim->getDataArchive();
assert(archive);
! _catalog = archive->getObject("environment.stars");
assert(_catalog.valid());
int n = _catalog->_stars.size();
--- 184,188 ----
simdata::DataArchive *archive = CSPSim::theSim->getDataArchive();
assert(archive);
! _catalog = archive->getObject("sim:environment.stars");
assert(_catalog.valid());
int n = _catalog->_stars.size();
Index: CSPSim.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/CSPSim.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** CSPSim.cpp 3 Apr 2003 10:40:42 -0000 1.17
--- CSPSim.cpp 11 Apr 2003 18:59:20 -0000 1.18
***************
*** 185,189 ****
std::string data_path = g_Config.getPath("Paths", "DataPath", ".", true);
! std::string archive_file = ospath::join(data_path, "Sim.dar");
// open the primary data archive
--- 185,189 ----
std::string data_path = g_Config.getPath("Paths", "DataPath", ".", true);
! std::string archive_file = ospath::join(data_path, "sim.dar");
// open the primary data archive
***************
*** 225,229 ****
// eventually this will be set in an entirely different way...
! m_ActiveTerrain = m_DataArchive->getObject("terrain.balkan");
m_ActiveTerrain->activate(m_Battlefield);
--- 225,229 ----
// eventually this will be set in an entirely different way...
! m_ActiveTerrain = m_DataArchive->getObject("sim:terrain.balkan");
m_ActiveTerrain->activate(m_Battlefield);
***************
*** 242,246 ****
// create a couple test objects
! simdata::Pointer<AircraftObject> ao = m_DataArchive->getObject("vehicles.aircraft.m2k");
assert(ao.valid());
//ao->setGlobalPosition(483000, 499000, 2000);
--- 242,246 ----
// create a couple test objects
! simdata::Pointer<AircraftObject> ao = m_DataArchive->getObject("sim:vehicles.aircraft.m2k");
assert(ao.valid());
//ao->setGlobalPosition(483000, 499000, 2000);
***************
*** 253,257 ****
/*
! simdata::Pointer<DynamicObject> to = m_DataArchive->getObject("vehicles.aircraft.m2k");
assert(to.valid());
to->setGlobalPosition(483000, 501000, 0);
--- 253,257 ----
/*
! simdata::Pointer<DynamicObject> to = m_DataArchive->getObject("sim:vehicles.aircraft.m2k");
assert(to.valid());
to->setGlobalPosition(483000, 501000, 0);
|
|
From: <mk...@us...> - 2003-04-11 18:59:23
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Bin In directory sc8-pr-cvs1:/tmp/cvs-serv2330/Bin Modified Files: CSPSim.py Log Message: see CHANGES.current Index: CSPSim.py =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Bin/CSPSim.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CSPSim.py 27 Mar 2003 22:59:39 -0000 1.1 --- CSPSim.py 11 Apr 2003 18:59:18 -0000 1.2 *************** *** 28,32 **** sys.exit(1) datapath = CSP.getDataPath() ! dar = os.path.join(datapath, "Sim.dar") if not os.path.exists(dar): print --- 28,32 ---- sys.exit(1) datapath = CSP.getDataPath() ! dar = os.path.join(datapath, "sim.dar") if not os.path.exists(dar): print *************** *** 44,48 **** def compileData(args): datapath = CSP.getDataPath() ! dar = os.path.join(datapath, "Sim.dar") XML = os.path.join(datapath, "XML") #print "compile %s %s" % (XML, dar) --- 44,48 ---- def compileData(args): datapath = CSP.getDataPath() ! dar = os.path.join(datapath, "sim.dar") XML = os.path.join(datapath, "XML") #print "compile %s %s" % (XML, dar) |
|
From: <mk...@us...> - 2003-04-11 18:46:32
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Bin In directory sc8-pr-cvs1:/tmp/cvs-serv30166 Modified Files: CompileData.py RebuildData.py Log Message: added python shell escape Index: CompileData.py =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Bin/CompileData.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CompileData.py 28 Mar 2003 18:48:59 -0000 1.2 --- CompileData.py 11 Apr 2003 18:46:29 -0000 1.3 *************** *** 1,2 **** --- 1,4 ---- + #!/usr/bin/python + import sys Index: RebuildData.py =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Bin/RebuildData.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RebuildData.py 28 Mar 2003 18:39:48 -0000 1.2 --- RebuildData.py 11 Apr 2003 18:46:29 -0000 1.3 *************** *** 1,2 **** --- 1,4 ---- + #!/usr/bin/python + import sys |
|
From: <mk...@us...> - 2003-04-11 18:28:40
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Include/SimData
In directory sc8-pr-cvs1:/tmp/cvs-serv20956/Include/SimData
Modified Files:
Interpolate.h
Log Message:
fixed missing template fubar
Index: Interpolate.h
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Interpolate.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Interpolate.h 11 Apr 2003 18:06:35 -0000 1.5
--- Interpolate.h 11 Apr 2003 18:28:36 -0000 1.6
***************
*** 59,62 ****
--- 59,63 ----
* @author Mark Rose <mr...@st...>
*/
+ template <typename T>
class SIMDATA_EXPORT InterpolatedData: public BaseType {
***************
*** 113,117 ****
* @author Mark Rose <mr...@st...>
*/
! class Curve: public InterpolatedData<float> {
vector_t _breaks, _data, _table, _sd;
--- 114,118 ----
* @author Mark Rose <mr...@st...>
*/
! class SIMDATA_EXPORT Curve: public InterpolatedData<float> {
vector_t _breaks, _data, _table, _sd;
***************
*** 213,217 ****
* @author Mark Rose <mr...@st...>
*/
! class SIMDATA_EXPORT Table: public InterpolatedData {
public:
--- 214,218 ----
* @author Mark Rose <mr...@st...>
*/
! class SIMDATA_EXPORT Table: public InterpolatedData<float> {
public:
|
|
From: <mk...@us...> - 2003-04-11 18:16:26
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Source
In directory sc8-pr-cvs1:/tmp/cvs-serv14969/Source
Added Files:
DataManager.cpp FileUtility.cpp
Log Message:
--- NEW FILE: DataManager.cpp ---
/* SimDataCSP: Data Infrastructure for Simulations
* Copyright (C) 2002 Mark Rose <tm...@st...>
*
* This file is part of SimDataCSP.
*
* 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.
*/
#include <SimData/DataArchive.h>
#include <SimData/DataManager.h>
#include <SimData/Log.h>
#include <SimData/Exception.h>
NAMESPACE_SIMDATA
DataManager::DataManager() {
}
DataManager::~DataManager() {
std::vector<DataArchive*>::iterator i;
for (i = archives.begin(); i != archives.end(); i++) {
if (*i) {
(*i)->setManager(0);
delete *i;
}
}
}
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);
}
}
const PointerBase DataManager::getObject(const char* path) {
return getObject(Path(path), path, 0);
}
const PointerBase DataManager::getObject(Path const& path, const char* path_str) {
return getObject(path, path_str, 0);
}
const PointerBase DataManager::getObject(Path const& path, const char* path_str, DataArchive *d) {
hasht key = (hasht) path.getPath();
hasht_map::iterator idx = archive_map.find(key);
DataArchive *archive = 0;
if (idx != archive_map.end()) {
archive = archives[idx->second];
}
if (archive == 0 || archive == d) {
std::string msg;
if (path_str==0 || *path_str==0) {
msg = "human-readable path unavailable";
} else {
msg = path_str;
}
msg = "path not found (" + msg + ")" + key.str() + "\n";
SIMDATA_LOG(LOG_ARCHIVE, LOG_ERROR, "DataManager::getObject() : " << msg);
throw IndexError(msg.c_str());
}
return archive->getObject(path, path_str);
}
NAMESPACE_END // namespace simdata
--- NEW FILE: FileUtility.cpp ---
/* SimDataCSP: Data Infrastructure for Simulations
* Copyright (C) 2002 Mark Rose <tm...@st...>
*
* This file is part of SimDataCSP.
*
* 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 FileUtility.cpp
*
* Platform independent file utilities.
*
*/
#include <SimData/FileUtility.h>
#include <cstdlib>
#include <cstdio>
#ifdef _WIN32
# define STRICT /* Strict typing, please */
# include <windows.h>
# include <direct.h>
# include <ctype.h>
# ifdef _MSC_VER
# include <io.h>
# endif /* _MSC_VER */
#else /* _WIN32 */
# include <unistd.h>
#endif
NAMESPACE_SIMDATA
#ifdef _WIN32
const char ospath::DIR_SEPARATOR = '\\';
const char ospath::PATH_SEPARATOR = ';';
#else
const char ospath::DIR_SEPARATOR = '/';
const char ospath::PATH_SEPARATOR = ':';
#endif
std::string ospath::basename(const std::string &path)
{
std::string::size_type base;
base = path.rfind(DIR_SEPARATOR);
if (base != std::string::npos) {
return path.substr(base+1);
}
#ifdef _WIN32
if (path.length() > 1 && isalpha(path[0]) && path[1] == ':') {
return path.substr(2);
}
#endif // _WIN32
return path;
}
bool ospath::isabs(const std::string &path)
{
int n = path.length();
if (n==0) {
return false;
}
if (path[0] == DIR_SEPARATOR) {
return true;
}
#ifdef _WIN32
if (n > 2 && isalpha(path[0]) && path[1] == ':' && path[2] == DIR_SEPARATOR) {
return TRUE;
}
#endif // _WIN32
return false;
}
std::string ospath::skiproot(const std::string &path) {
int n = path.length();
if (n > 0 && path[0] == DIR_SEPARATOR) {
return path.substr(1);
}
#ifdef _WIN32
if (n > 2 && isalpha(path[0]) && path[1] == ':' && path[2] == DIR_SEPARATOR) {
return path.substr(3);
}
#endif // _WIN32
return path;
}
std::string ospath::dirname(const std::string &path) {
std::string::size_type base;
base = path.rfind(DIR_SEPARATOR);
if (base == std::string::npos) {
return ".";
}
return path.substr(0, base-1);
}
std::string ospath::currentdir() {
std::string dir;
dir = DIR_SEPARATOR;
char *buffer = getcwd(0, 0);
if (buffer) {
dir = buffer;
free(buffer);
}
return dir;
}
std::string ospath::ext(const std::string &path) {
std::string::size_type ext;
ext = path.find_last_of("."+DIR_SEPARATOR);
if (ext != std::string::npos && path[ext]=='.') {
return path.substr(ext);
}
return "";
}
std::string ospath::join(const std::string &a, const std::string &b) {
std::string result;
std::string::size_type idx;
idx = a.length();
if (idx > 0 && (a[idx-1] == '/' || a[idx-1] == '\\')) idx--;
result = a.substr(0, idx);
return result + DIR_SEPARATOR + skiproot(b);
}
std::string ospath::stringreplace(const std::string &path, char search, char replace) {
if (search == replace) return path;
std::string result;
char *str = strdup(path.c_str());
char *idx = str;
for (; *idx; idx++) {
if (*idx == search) *idx = replace;
}
result = str;
free(str);
return result;
}
std::string const &ospath::addpath(std::string &pathlist, const std::string &path) {
if (pathlist.size() > 0) pathlist = pathlist + PATH_SEPARATOR;
pathlist = pathlist + path;
return pathlist;
}
std::string ospath::normalize(const std::string &path) {
return stringreplace(path, '\\', '/');
}
std::string ospath::denormalize(const std::string &path) {
return stringreplace(path, '/', DIR_SEPARATOR);
}
std::string ospath::filter(const std::string &path) {
return denormalize(normalize(path));
}
NAMESPACE_END // namespace simdata
|
|
From: <mk...@us...> - 2003-04-11 18:16:25
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Include/SimData
In directory sc8-pr-cvs1:/tmp/cvs-serv14969/Include/SimData
Added Files:
DataManager.h FileUtility.h Quaternion.i
Log Message:
--- NEW FILE: DataManager.h ---
/* SimDataCSP: Data Infrastructure for Simulations
* Copyright (C) 2002 Mark Rose <tm...@st...>
*
* This file is part of SimDataCSP.
*
* 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 DataManager.h
* @author Mark Rose <mr...@st...>
*/
#ifndef __DATAMANAGER_H__
#define __DATAMANAGER_H__
# if defined(_MSC_VER) && (_MSC_VER <= 1200)
#pragma warning(disable : 4786)
# endif
#include <string>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <SimData/Path.h>
#include <SimData/HashUtility.h>
#include <SimData/ns-simdata.h>
NAMESPACE_SIMDATA
class DataArchive;
/**
* Class for managing read access to multiple data archives.
*
* @author Mark Rose <mr...@st...>
*/
class SIMDATA_EXPORT DataManager {
friend class DataArchive;
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.
*
* @path_str the path identifier string.
* @returns a smart-pointer to the new object.
*/
const PointerBase getObject(const char* path_str);
/**
* Create a new object from a Path instance.
*
* @path the Path instance.
* @path_str the path identifier string (if available). This is
* only used for error logging.
*/
const PointerBase getObject(Path const& path, const char* path_str=0);
/**
* 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 *);
private:
/**
* 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.
*
* @path the Path instance.
* @path_str the path identifier string (if available). This is
* only used for error logging.
* @d the data archive that is requesting the object.
*/
const PointerBase getObject(Path const& path, const char* path_str, DataArchive* d);
std::vector<DataArchive*> archives;
hasht_map archive_map;
};
NAMESPACE_END // namespace simdata
#endif //__DATAMANAGER_H__
--- NEW FILE: FileUtility.h ---
/* SimDataCSP: Data Infrastructure for Simulations
* Copyright (C) 2002 Mark Rose <tm...@st...>
*
* This file is part of SimDataCSP.
*
* 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 FileUtility.h
*
* Platform independent file utilities.
*/
#ifndef __FILEUTILITY_H__
#define __FILEUTILITY_H__
#include <string>
#include <SimData/Export.h>
#include <SimData/ns-simdata.h>
NAMESPACE_SIMDATA
namespace ospath {
extern SIMDATA_EXPORT const char DIR_SEPARATOR;
extern SIMDATA_EXPORT const char PATH_SEPARATOR;
/**
* Return the basename of pathname path.
*
* Example: basename("/usr/local/csp") returns "csp"
*/
extern SIMDATA_EXPORT std::string basename(const std::string &path);
/**
* Returns true if path is an absolute pathname.
*/
extern SIMDATA_EXPORT bool isabs(const std::string &path);
/**
* Strips leading drive specifier and root directory marker.
*
* Examples:
* skiproot("c:\\windows") == "windows"
* skiproot("/linux/csp") == "linux/csp"
*/
extern SIMDATA_EXPORT std::string skiproot(const std::string &path);
/**
* Returns the directory name of pathname path.
*
* Example: dirname("/usr/local/csp") returns "/usr/local"
*/
extern SIMDATA_EXPORT std::string dirname(const std::string &path);
/**
* Returns the current working directory.
*/
extern SIMDATA_EXPORT std::string currentdir();
/**
* Returns the (last) extension of pathname path.
*
* Example: ext("/usr/local/script.csp") returns ".csp"
*/
extern SIMDATA_EXPORT std::string ext(const std::string &path);
/**
* Intelligently joins two path components into a pathname.
*
* Examples:
* join("/usr/local", "lib") returns "/usr/local/lib"
* join("c:\\windows\\", "system") returns "c:\\windows\\system"
*/
extern SIMDATA_EXPORT std::string join(const std::string &a, const std::string &b);
/**
* Substitute characters in a string.
*
* This routine is slightly out of place. Can we find a substitute or better
* home for it?
*
* @param path The path to modify.
* @param search The character to replace.
* @param replace The replacement character.
*/
extern SIMDATA_EXPORT std::string stringreplace(const std::string &path, char search, char replace);
/**
* Convert a native path to a standard format (uses '/' instead of '\')
*
* Note: does *not* handle directory names under windows.
*/
extern SIMDATA_EXPORT std::string normalize(const std::string &path);
/**
* Convert a normalized path to the native format.
*/
extern SIMDATA_EXPORT std::string denormalize(const std::string &path);
/**
* Filter an input path to use the native directory separation character.
*/
extern SIMDATA_EXPORT std::string filter(const std::string &path);
/**
* Add a path to a list of paths using the platform path separator.
*/
extern SIMDATA_EXPORT std::string const &addpath(std::string &pathlist, const std::string &path);
} // namespace ospath
NAMESPACE_END // namespace simdata
#endif // __FILEUTILITY_H__
--- NEW FILE: Quaternion.i ---
%module Quaternion
%{
#include "SimData/Quaternion.h"
%}
%include "std_string.i"
%include "std_vector.i"
%include "SimData/ns-simdata.h"
%rename(__repr__) SIMDATA(Quaternion)::asString() const;
%include "SimData/Quaternion.h"
|
|
From: <mk...@us...> - 2003-04-11 18:12:35
|
Update of /cvsroot/csp/APPLICATIONS/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv13081 Modified Files: CHANGES.current Log Message: Index: CHANGES.current =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/CHANGES.current,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** CHANGES.current 11 Apr 2003 18:06:33 -0000 1.18 --- CHANGES.current 11 Apr 2003 18:12:31 -0000 1.19 *************** *** 13,16 **** --- 13,19 ---- or the 4 quaternion parameters. The XML tag is <Quat> + Moved the ospath routines from CSPSim's Platform.h to + SimData. They are now in FileUtility.h. + 2003-03-28: delta updated .net project (release mode is maintained) |
|
From: <mk...@us...> - 2003-04-11 18:07:10
|
Update of /cvsroot/csp/APPLICATIONS/SimData/SimData
In directory sc8-pr-cvs1:/tmp/cvs-serv9567/SimData
Modified Files:
Compile.py Parse.py
Log Message:
see CHANGES.current
Index: Compile.py
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/SimData/SimData/Compile.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Compile.py 18 Mar 2003 10:04:04 -0000 1.1
--- Compile.py 11 Apr 2003 18:06:37 -0000 1.2
***************
*** 129,133 ****
print "Compiling '%s' from '%s'" % (self.outfile, self.infile)
DEBUG(1, "Opening input archive")
! master = ObjectXMLArchive(self.infile);
DEBUG(1, "Loading all objects")
resetWarnings()
--- 129,134 ----
print "Compiling '%s' from '%s'" % (self.outfile, self.infile)
DEBUG(1, "Opening input archive")
! prefix = os.path.splitext(os.path.basename(self.outfile))[0]
! master = ObjectXMLArchive(prefix, self.infile);
DEBUG(1, "Loading all objects")
resetWarnings()
***************
*** 160,163 ****
--- 161,165 ----
compiled.addObject(object, id)
self.dumpBadPaths(all, paths)
+ print "Finished."
def dumpBadPaths(self, all, paths):
Index: Parse.py
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/SimData/SimData/Parse.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Parse.py 26 Mar 2003 22:10:01 -0000 1.2
--- Parse.py 11 Apr 2003 18:06:37 -0000 1.3
***************
*** 60,64 ****
sys.exit(1)
! def path_to_id(path):
if path.endswith('.gz'): path = path[:-3]
if path.endswith('.xml'): path = path[:-4]
--- 60,64 ----
sys.exit(1)
! def path_to_id(prefix, path):
if path.endswith('.gz'): path = path[:-3]
if path.endswith('.xml'): path = path[:-4]
***************
*** 70,79 ****
else:
break;
! return '.'.join(parts)
def id_to_path(id):
return apply(os.path.join, id.split('.'))
class ElementHandler(ContentHandler):
--- 70,94 ----
else:
break;
! return prefix + ":" + '.'.join(parts)
def id_to_path(id):
+ parts = id.split(':')
+ if len(parts) == 2:
+ id = parts[1]
return apply(os.path.join, id.split('.'))
+ # convert to absolute path id
+ def adjust_path(base, id):
+ if ':' in id:
+ return id
+ if not id.startswith("."):
+ return base + "." + id
+ parts = base.split(':')
+ if len(parts) == 2:
+ prefix, base = parts
+ else:
+ prefix, base = "", base
+ return prefix + ":" + id[1:]
class ElementHandler(ContentHandler):
***************
*** 194,198 ****
return name in ('List', 'Enum', 'Path', 'Int', 'Bool', 'Number', 'Float',
'String', 'Date', 'Vector', 'Matrix', 'External',
! 'Object')
def end(self):
--- 209,213 ----
return name in ('List', 'Enum', 'Path', 'Int', 'Bool', 'Number', 'Float',
'String', 'Date', 'Vector', 'Matrix', 'External',
! 'Object', 'Quat')
def end(self):
***************
*** 210,215 ****
f = spread
elif self._type == "path":
! def path(x):
y = SimData.Path()
y.setPath(x)
return y
--- 225,231 ----
f = spread
elif self._type == "path":
! def path(x, base = self._base):
y = SimData.Path()
+ x = adjust_path(base, x)
y.setPath(x)
return y
***************
*** 313,316 ****
--- 329,340 ----
self._element.parseXML(self._c)
+ class QuatHandler(SimpleHandler):
+
+ def __init__(self, id, base, name, attrs):
+ SimpleHandler.__init__(self, id, base, name, attrs)
+
+ def end(self):
+ self._element = SimData.Quaternion()
+ self._element.parseXML(self._c)
class DateHandler(SimpleHandler):
***************
*** 384,391 ****
else:
source = self._c.strip()
! if not source.startswith("."):
! source = self._base + "." + source
! else:
! source = source[1:]
self._element = source
self._paths.append(source)
--- 408,412 ----
else:
source = self._c.strip()
! source = adjust_path(self._base, source)
self._element = source
self._paths.append(source)
***************
*** 541,547 ****
class FileHandler(ElementHandler):
! def __init__(self, path=None, id=None):
if path is not None:
! id = path_to_id(path)
self._id = id
id = id.split('.')
--- 562,568 ----
class FileHandler(ElementHandler):
! def __init__(self, prefix="", path=None, id=None):
if path is not None:
! id = path_to_id(prefix, path)
self._id = id
id = id.split('.')
***************
*** 632,636 ****
MASTER = None
! def __init__(self, path):
if ObjectXMLArchive.MASTER is not None:
raise "Can only create one ObjectXMLArchive object"
--- 653,657 ----
MASTER = None
! def __init__(self, prefix, path):
if ObjectXMLArchive.MASTER is not None:
raise "Can only create one ObjectXMLArchive object"
***************
*** 641,654 ****
self._externals = {}
self._cache = None
! def getObject(self, id):
! if not self._objects.has_key(id):
! self._objects[id] = self.loadObject(id)
! return self._objects[id]
!
! def loadObject(self, id):
! path = id_to_path(id)
! path = os.path.join(self._basepath, path);
! return self.loadPath(path, id)
def loadPath(self, path, id):
--- 662,676 ----
self._externals = {}
self._cache = None
+ self._prefix = prefix
! # def getObject(self, id):
! # if not self._objects.has_key(id):
! # self._objects[id] = self.loadObject(id)
! # return self._objects[id]
! #
! # def loadObject(self, id):
! # path = id_to_path(id)
! # path = os.path.join(self._basepath, path);
! # return self.loadPath(path, id)
def loadPath(self, path, id):
***************
*** 722,726 ****
if filename.endswith('.xml') \
or filename.endswith('.xml.gz'):
! id = path_to_id(filepath)
DEBUG(2, "Loading object '%s' from '%s'" % (id, fullpath))
self._objects[id] = self.loadPath(fullpath, id)
--- 744,748 ----
if filename.endswith('.xml') \
or filename.endswith('.xml.gz'):
! id = path_to_id(self._prefix, filepath)
DEBUG(2, "Loading object '%s' from '%s'" % (id, fullpath))
self._objects[id] = self.loadPath(fullpath, id)
|
|
From: <mk...@us...> - 2003-04-11 18:07:07
|
Update of /cvsroot/csp/APPLICATIONS/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv9567 Modified Files: CHANGES.current setup.py Log Message: see CHANGES.current Index: CHANGES.current =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/CHANGES.current,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** CHANGES.current 28 Mar 2003 19:04:28 -0000 1.17 --- CHANGES.current 11 Apr 2003 18:06:33 -0000 1.18 *************** *** 2,5 **** --- 2,16 ---- =========================== + 2003-03-29: onsight + Added a DataManager class to combine access to multiple data + archives simultaneously and transparently. + + *** ANY MSVC USERS: PLEASE UPDATE THE PROJECT FILE TO INCLUDE *** + *** DATAMANAGER.CPP *** + + Added Quaternion as a base type. It now has Python bindings + and an XML interface that can specify either a 3x3 matrix + or the 4 quaternion parameters. The XML tag is <Quat> + 2003-03-28: delta updated .net project (release mode is maintained) Index: setup.py =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/setup.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** setup.py 28 Mar 2003 19:04:57 -0000 1.13 --- setup.py 11 Apr 2003 18:06:33 -0000 1.14 *************** *** 268,298 **** interfaces = [ ! "cSimData.i", ! "BaseType.i", ! "Conversions.i", ! "DataArchive.i", ! "Date.i", ! "Enum.i", ! "Exception.i", ! "External.i", ! "filemap.i", ! "GeoPos.i", ! "HashUtility.i", ! "InterfaceRegistry.i", ! "Interpolate.i", ! "List.i", ! "Log.i", ! "Math.i", ! "Matrix3.i", ! "Noise.i", ! "Object.i", ! "Pack.i", ! "Path.i", ! "Random.i", ! "Real.i", ! "String.i", ! "Types.i", ! "vector.i", ! "Vector3.i", ] --- 268,299 ---- interfaces = [ ! "cSimData.i", ! "BaseType.i", ! "Conversions.i", ! "DataArchive.i", ! "Date.i", ! "Enum.i", ! "Exception.i", ! "External.i", ! "filemap.i", ! "GeoPos.i", ! "HashUtility.i", ! "InterfaceRegistry.i", ! "Interpolate.i", ! "List.i", ! "Log.i", ! "Math.i", ! "Matrix3.i", ! "Noise.i", ! "Object.i", ! "Pack.i", ! "Path.i", ! "Quaternion.i", ! "Random.i", ! "Real.i", ! "String.i", ! "Types.i", ! "vector.i", ! "Vector3.i", ] |
|
From: <mk...@us...> - 2003-04-11 02:24:01
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim In directory sc8-pr-cvs1:/tmp/cvs-serv25829 Added Files: TODO Log Message: --- NEW FILE: TODO --- //////////////////////////////////////////////////////// // CODE RELATED Send useful error messages to stderr for missing files (especially during startup!) and make sure these are also logged to CSPSim.log no matter what logging level is set. The error messages should detail what file is missing, where it belongs, and where to download it. Catch exceptions / assertion from the mainloop and print more useful error messages. Some CSP exception classes probably need to be written. //////////////////////////////////////////////////////// // DATA RELATED Change Models/m2kg2.3DS to Models/m2kg2.3ds Add Images/moon.png to a supplemental data distribution Change the root path in the BalkanTerrain distribution so it can be unpacked in the main CSPSim directory (right now you have to unpack it in CSPSim/Data) |
|
From: <mk...@us...> - 2003-04-11 00:15:23
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Source In directory sc8-pr-cvs1:/tmp/cvs-serv17150 Modified Files: Makefile.in Log Message: Added NumericalMethod.cpp Index: Makefile.in =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/Makefile.in,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Makefile.in 28 Mar 2003 18:03:34 -0000 1.8 --- Makefile.in 11 Apr 2003 00:15:19 -0000 1.9 *************** *** 43,46 **** --- 43,47 ---- Message.cpp \ mmgr.cpp \ + NumericalMethod.cpp \ ObjectModel.cpp \ ObjectRangeInfo.cpp \ |
|
From: <mk...@us...> - 2003-04-10 01:32:20
|
Update of /cvsroot/csp/THIRDPARTYLIBS/demeter In directory sc8-pr-cvs1:/tmp/cvs-serv11778 Modified Files: Terrain.h Log Message: added GLAPIENTRY definition Index: Terrain.h =================================================================== RCS file: /cvsroot/csp/THIRDPARTYLIBS/demeter/Terrain.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Terrain.h 6 Apr 2003 10:39:18 -0000 1.4 --- Terrain.h 10 Apr 2003 01:32:17 -0000 1.5 *************** *** 51,54 **** --- 51,55 ---- #endif + typedef unsigned char Uint8; typedef signed char Sint8; *************** *** 82,85 **** --- 83,90 ---- #endif + // not all gl implementations seem to know about this + #ifndef GLAPIENTRY + #define GLAPIENTRY + #endif #define MAX_VERTICES_PER_FAN 10 |
|
From: <de...@us...> - 2003-04-09 19:59:53
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/VisualStudio/CSPSimAppli In directory sc8-pr-cvs1:/tmp/cvs-serv12820 Modified Files: CSPSimAppli.vcproj Log Message: no message Index: CSPSimAppli.vcproj =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/VisualStudio/CSPSimAppli/CSPSimAppli.vcproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CSPSimAppli.vcproj 3 Apr 2003 10:40:58 -0000 1.2 --- CSPSimAppli.vcproj 9 Apr 2003 19:59:49 -0000 1.3 *************** *** 23,27 **** InlineFunctionExpansion="1" AdditionalIncludeDirectories="../../Include,../../../../THIRDPARTYLIBS/include,../../../../THIRDPARTYLIBS/Demeter,C:/Python22/include" ! PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS,__CSPSIM_EXE__" StringPooling="TRUE" RuntimeLibrary="2" --- 23,27 ---- InlineFunctionExpansion="1" AdditionalIncludeDirectories="../../Include,../../../../THIRDPARTYLIBS/include,../../../../THIRDPARTYLIBS/Demeter,C:/Python22/include" ! PreprocessorDefinitions="CSP_NDEBUG;WIN32,NDEBUG,_WINDOWS,__CSPSIM_EXE__" StringPooling="TRUE" RuntimeLibrary="2" *************** *** 79,83 **** Name="VCCLCompilerTool" Optimization="0" ! AdditionalIncludeDirectories="../../Include,../../../SimData/Include,../../../../THIRDPARTYLIBS/include,../../../../THIRDPARTYLIBS/Demeter,C:/Python22/include,../../SimData/include,../../../THIRDPARTYLIBS/demeter" PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS,__CSPSIM_EXE__" BasicRuntimeChecks="3" --- 79,83 ---- Name="VCCLCompilerTool" Optimization="0" ! AdditionalIncludeDirectories="../../Include,../../../../THIRDPARTYLIBS/include,../../../../THIRDPARTYLIBS/Demeter,C:/Python22/include" PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS,__CSPSIM_EXE__" BasicRuntimeChecks="3" *************** *** 417,422 **** <Tool Name="VCCustomBuildTool" ! CommandLine="C:\progra~1\SWIG-1.3.17\swig -c++ -python -noexcept -DWIN32 -I..\..\Include -IC:\Python22\include -o ..\..\Source\$(InputName)_wrap.cpp ..\..\Source\$(InputName).i" Outputs="..\..\Source\$(InputName)_wrap.cpp ..\..\Bin\$(InputName).py"/> </FileConfiguration> </File> --- 417,431 ---- <Tool Name="VCCustomBuildTool" ! CommandLine="C:\progra~1\SWIG-1.3.17\swig -c++ -python -noexcept -DWIN32 -I..\..\Include -IC:\Python22\include -o ..\..\Source\$(InputName)_wrap.cpp ..\..\Source\$(InputName).i ! " Outputs="..\..\Source\$(InputName)_wrap.cpp ..\..\Bin\$(InputName).py"/> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32"> + <Tool + Name="VCCustomBuildTool" + CommandLine="C:\progra~1\SWIG-1.3.17\swig -c++ -python -noexcept -DWIN32 -I..\..\Include -IC:\Python22\include -o ..\..\Source\$(InputName)_wrap.cpp ..\..\Source\$(InputName).i + " + Outputs="..\..\Source\$(InputName)_wrap.cpp"/> </FileConfiguration> </File> |
|
From: <de...@us...> - 2003-04-09 19:59:39
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/VisualStudio/CSPSimDLL In directory sc8-pr-cvs1:/tmp/cvs-serv12740 Modified Files: CSPSimDLL.vcproj Log Message: no message Index: CSPSimDLL.vcproj =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/VisualStudio/CSPSimDLL/CSPSimDLL.vcproj,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CSPSimDLL.vcproj 3 Apr 2003 10:41:10 -0000 1.4 --- CSPSimDLL.vcproj 9 Apr 2003 19:59:35 -0000 1.5 *************** *** 23,27 **** Optimization="0" AdditionalIncludeDirectories="C:/Python22/include,../../../SimData/Include,../../Include,../../../../THIRDPARTYLIBS/include,../../../../THIRDPARTYLIBS/demeter" ! PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;CSPSIMDLL_EXPORTS;_STLP_USE_OWN_NAMESPACE" BasicRuntimeChecks="3" RuntimeLibrary="3" --- 23,27 ---- Optimization="0" AdditionalIncludeDirectories="C:/Python22/include,../../../SimData/Include,../../Include,../../../../THIRDPARTYLIBS/include,../../../../THIRDPARTYLIBS/demeter" ! PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;CSPSIMDLL_EXPORTS" BasicRuntimeChecks="3" RuntimeLibrary="3" |
|
From: <de...@us...> - 2003-04-09 19:59:22
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim In directory sc8-pr-cvs1:/tmp/cvs-serv12662a Modified Files: CHANGES.current Log Message: no message Index: CHANGES.current =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/CHANGES.current,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** CHANGES.current 3 Apr 2003 10:41:32 -0000 1.12 --- CHANGES.current 9 Apr 2003 19:59:18 -0000 1.13 *************** *** 3,9 **** LINUX USERS: you need to add NumericalMethod.cpp to your Makefile. 2003-04-03: delta ! .net project updated; debug and release are maintained. Rewritten DynamicalSystem interface; you need now, to define a --- 3,11 ---- LINUX USERS: you need to add NumericalMethod.cpp to your Makefile. + 2003-04-09: delta + updated .net project. 2003-04-03: delta ! updated .net project; debug and release are maintained. Rewritten DynamicalSystem interface; you need now, to define a |
|
From: <de...@us...> - 2003-04-06 10:39:22
|
Update of /cvsroot/csp/THIRDPARTYLIBS/demeter
In directory sc8-pr-cvs1:/tmp/cvs-serv2729
Modified Files:
Terrain.h Terrain.cpp CHANGES.current
Added Files:
DemeterVisualC6.vcproj DemeterVisualC6.sln
Log Message:
no message
--- NEW FILE: DemeterVisualC6.vcproj ---
<?xml version="1.0" encoding = "Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.00"
Name="DemeterVisualC6"
SccProjectName=""
SccLocalPath="">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\Debug"
IntermediateDirectory=".\Debug"
ConfigurationType="2"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\Include,..\Include\SDL"
PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;_USRDLL;DEMETERVISUALC6_EXPORTS;TERRAIN_EXPORTS;_PROTECT_ACCESS_;_STLP_USE_OWN_NAMESPACE"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
RuntimeTypeInfo="TRUE"
PrecompiledHeaderFile=".\Debug/DemeterVisualC6.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="4"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="SDL_imaged.lib SDLd.lib osgd.lib opengl32.lib glu32.lib"
OutputFile="Debug/DemeterVisualC6d.dll"
LinkIncremental="2"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="..\lib"
IgnoreDefaultLibraryNames="libcmt.lib"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\Debug/DemeterVisualC6d.pdb"
ImportLibrary=".\Debug/DemeterVisualC6d.lib"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\Debug/DemeterVisualC6.tlb"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="2"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\include"
PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;_USRDLL;DEMETERVISUALC6_EXPORTS;TERRAIN_EXPORTS;_STLP_USE_OWN_NAMESPACE"
StringPooling="TRUE"
RuntimeLibrary="0"
EnableFunctionLevelLinking="TRUE"
RuntimeTypeInfo="TRUE"
PrecompiledHeaderFile=".\Release/DemeterVisualC6.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="osg.lib opengl32.lib glu32.lib SDL.lib SDL_image.lib"
OutputFile=".\Release/DemeterVisualC6.dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="..\lib"
ProgramDatabaseFile=".\Release/DemeterVisualC6.pdb"
ImportLibrary=".\Release/DemeterVisualC6.lib"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\Release/DemeterVisualC6.tlb"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
</Configuration>
</Configurations>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
<File
RelativePath=".\DemeterDrawable.cpp">
</File>
<File
RelativePath=".\Terrain.cpp">
</File>
<File
RelativePath=".\TerrainTextureFactory.cpp">
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl">
<File
RelativePath=".\DemeterDrawable.h">
</File>
<File
RelativePath=".\DemeterException.h">
</File>
<File
RelativePath=".\Terrain.h">
</File>
<File
RelativePath=".\TerrainTextureFactory.h">
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
--- NEW FILE: DemeterVisualC6.sln ---
Microsoft Visual Studio Solution File, Format Version 7.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DemeterVisualC6", "DemeterVisualC6.vcproj", "{3DB95589-1C58-48C4-A62B-10443581A35F}"
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
ConfigName.0 = Debug
ConfigName.1 = Release
EndGlobalSection
GlobalSection(ProjectDependencies) = postSolution
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{3DB95589-1C58-48C4-A62B-10443581A35F}.Debug.ActiveCfg = Release|Win32
{3DB95589-1C58-48C4-A62B-10443581A35F}.Debug.Build.0 = Release|Win32
{3DB95589-1C58-48C4-A62B-10443581A35F}.Release.ActiveCfg = Release|Win32
{3DB95589-1C58-48C4-A62B-10443581A35F}.Release.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution
EndGlobalSection
EndGlobal
Index: Terrain.h
===================================================================
RCS file: /cvsroot/csp/THIRDPARTYLIBS/demeter/Terrain.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Terrain.h 8 Feb 2003 15:57:28 -0000 1.3
--- Terrain.h 6 Apr 2003 10:39:18 -0000 1.4
***************
*** 24,28 ****
#define _TERRAIN_DEMETER_H_
! #define _USE_GDAL_
//_USE_GDAL_ tells Demeter to support the GDAL data loading library. This allows Demeter to directly
//read DEM and SDTS files. Turn this option on only if you have installed the GDAL library on
--- 24,28 ----
#define _TERRAIN_DEMETER_H_
! //#define _USE_GDAL_
//_USE_GDAL_ tells Demeter to support the GDAL data loading library. This allows Demeter to directly
//read DEM and SDTS files. Turn this option on only if you have installed the GDAL library on
***************
*** 34,38 ****
//line-of-sight tests, etc. If you enable this option, then be aware that MUCH more memory will be needed.
! //#define _PROTECT_ACCESS_
// _PROTECT_ACCESS_ turns on extra checks to validate parameters passed to various terrain methods to make sure
// the parameters are within range. Turn this option on when you want the Terrain to clamp
--- 34,38 ----
//line-of-sight tests, etc. If you enable this option, then be aware that MUCH more memory will be needed.
! #define _PROTECT_ACCESS_
// _PROTECT_ACCESS_ turns on extra checks to validate parameters passed to various terrain methods to make sure
// the parameters are within range. Turn this option on when you want the Terrain to clamp
***************
*** 660,664 ****
inline void ref() const { ++m_refCount; }
/// Decrement the reference count by one, indicating that a pointer to this object is referencing it. If the reference count goes to zero, it is assumed that this object is no longer referenced and is automatically deleted.
! inline void unref() const { --m_refCount; if (m_refCount<=0) delete this; }
private:
--- 660,664 ----
inline void ref() const { ++m_refCount; }
/// Decrement the reference count by one, indicating that a pointer to this object is referencing it. If the reference count goes to zero, it is assumed that this object is no longer referenced and is automatically deleted.
! inline void unref() const { /*assert(m_refCount > 0);*/ if (m_refCount > 0) {--m_refCount; if (m_refCount==0 && this) delete this;} }
private:
Index: Terrain.cpp
===================================================================
RCS file: /cvsroot/csp/THIRDPARTYLIBS/demeter/Terrain.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Terrain.cpp 15 Feb 2003 20:56:18 -0000 1.3
--- Terrain.cpp 6 Apr 2003 10:39:18 -0000 1.4
***************
*** 40,44 ****
#include "sys/stat.h"
! #include "SDL_image.h"
#ifndef _WIN32
--- 40,44 ----
#include "sys/stat.h"
! #include "SDL/SDL_image.h"
#ifndef _WIN32
***************
*** 718,722 ****
// Load the texture data.
! int texWidth,texHeight;
Uint8* pTextureImage = NULL;
if (szTextureFilename != NULL)
--- 718,722 ----
// Load the texture data.
! int texWidth = 0,texHeight = 0;
Uint8* pTextureImage = NULL;
if (szTextureFilename != NULL)
***************
*** 756,760 ****
Terrain::~Terrain()
{
! for (unsigned int i = 0; i < m_TextureCells.size(); i++)
{
delete m_TextureCells[i];
--- 756,760 ----
Terrain::~Terrain()
{
! for (unsigned int i = 0; i < m_TextureCells.size(); i++)
{
delete m_TextureCells[i];
Index: CHANGES.current
===================================================================
RCS file: /cvsroot/csp/THIRDPARTYLIBS/demeter/CHANGES.current,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** CHANGES.current 15 Mar 2003 22:30:45 -0000 1.2
--- CHANGES.current 6 Apr 2003 10:39:18 -0000 1.3
***************
*** 1,4 ****
--- 1,8 ----
Version 0.3.1 (in progress)
===========================
+
+ 2003-04-06: delta
+ Committed .net project
+
2003-03-14: onsight
First log entry: this is the format.
|
|
From: <de...@us...> - 2003-04-04 15:49:36
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Include In directory sc8-pr-cvs1:/tmp/cvs-serv28682 Added Files: NumericalMethod.h Log Message: no message --- NEW FILE: NumericalMethod.h --- // Combat Simulator Project - FlightSim Demo // Copyright (C) 2002 The Combat Simulator Project // http://csp.sourceforge.net // // 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 NumericalMethod.h * **/ #ifndef __NUMERICALMETHOD_H__ #define __NUMERICALMETHOD_H__ #include <limits> #include <vector> class VectorField { unsigned short const m_dimension; public: VectorField(unsigned short dimension): m_dimension(dimension) { } unsigned short getDimension() const { return m_dimension; } virtual std::vector<double> const& _f(double t, std::vector<double>& y) = 0; }; class NumericalMethod { bool m_bdeleteVF; protected: unsigned short m_dimension; VectorField* vectorField; bool m_bfailed; public: NumericalMethod(bool deleteVF = true): vectorField(0), m_bfailed(false), m_bdeleteVF(deleteVF) { } NumericalMethod(VectorField* pf, bool deleteVF = true): vectorField(pf), m_bfailed(false), m_bdeleteVF(deleteVF) { if (vectorField) m_dimension = vectorField->getDimension(); else std::cout << "ODE dimension undefined!\n"; } void setVectorField(VectorField* pf) { vectorField = pf; m_dimension = vectorField->getDimension(); } virtual std::vector<double> const& quickSolve(std::vector<double>& y0, double t0, double dt)const = 0; virtual std::vector<double> const& enhancedSolve(std::vector<double>& y0, double t0, double dt) = 0; virtual ~NumericalMethod(){ if (m_bdeleteVF && vectorField) { delete vectorField; vectorField = 0; } } virtual bool failed() const; }; class RungeKutta: public NumericalMethod { std::vector<double> const & rk4(std::vector<double> const & y, std::vector<double> const & dyx, double x, double h) const; std::vector<double> const & rkqc(std::vector<double> &y, std::vector<double> &dyx, double &x, double htry, double eps, std::vector<double> const &yscal, double &hdid, double &hnext) const; std::vector<double> const &odeint(std::vector<double> const & ystart, double x1, double x2, double eps, double h1, double hmin, unsigned int &nok, unsigned int &nbad); static double const PGROW ; static double const PSHRNK; static double const FCOR; static double const SAFETY; static double const ERRCON; static unsigned int const MAXSTP; static double const TINY; double m_precision, m_hmin, m_hestimate; public: std::vector<double> const& quickSolve(std::vector<double>& y0, double t0, double dt) const; std::vector<double> const& enhancedSolve(std::vector<double>& y0, double t0, double dt); RungeKutta( VectorField* vectorField = 0, bool deleteVF = true, double Precision = 1.e-3, //1.e-4 double Hmin = 0.0, double Hestimate = 1.e-2): NumericalMethod(vectorField, deleteVF), m_precision(Precision), m_hmin(Hmin), m_hestimate(Hestimate) {} }; #endif // __NUMERICALMETHOD_H__ |
|
From: <de...@us...> - 2003-04-04 15:49:11
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Source In directory sc8-pr-cvs1:/tmp/cvs-serv28518 Added Files: NumericalMethod.cpp Log Message: no message --- NEW FILE: NumericalMethod.cpp --- // Combat Simulator Project - FlightSim Demo // Copyright (C) 2002 The Combat Simulator Project // http://csp.sourceforge.net // // 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 NumericalMethod.cpp * **/ #include <cmath> #include <iostream> #include "NumericalMethod.h" bool NumericalMethod::failed() const { return m_bfailed; } double const RungeKutta::PGROW = -0.20; double const RungeKutta::PSHRNK = -0.25; double const RungeKutta::FCOR = 0.06666666; // 1.0/15.0 double const RungeKutta::SAFETY = 0.9; double const RungeKutta::ERRCON = 6.0e-4; unsigned int const RungeKutta::MAXSTP = 8; double const RungeKutta::TINY = std::numeric_limits<float>::epsilon();//1.0e-30; //=========================================================================== std::vector<double> const &RungeKutta::rk4(std::vector<double> const &y, std::vector<double> const &dydx, double x, double h) const { static std::vector<double> yout(m_dimension), yt(m_dimension); double hh = h * 0.5; unsigned short i = 0; for (; i < m_dimension; ++i) yt[i] = y[i] + hh * dydx[i]; double xh = x + hh; std::vector<double> dyt = vectorField->_f(xh, yt); for (i = 0; i < m_dimension; ++i) yt[i] = y[i] + hh * dyt[i]; std::vector<double> dym = vectorField->_f(xh, yt); for (i = 0; i < m_dimension; ++i) { yt[i] = y[i] + h * dym[i]; dym[i] += dyt[i]; } dyt = vectorField->_f(x + h, yt); double h6 = h / 6.0; for (i = 0; i < m_dimension; ++i) yout[i] = y[i] + h6 * (dydx[i] + dyt[i] + 2.0 * dym[i]); return yout; } //=========================================================================== std::vector<double> const &RungeKutta::rkqc(std::vector<double> &y, std::vector<double> &dydx, double &x, double htry, double eps, std::vector<double> const &yscal, double &hdid, double &hnext) const { double xsav = x; std::vector<double> ysav = y; std::vector<double> dysav = dydx; double h = htry; unsigned short i; bool loop = true; std::vector<double> ytemp; do { double hh = 0.5 * h; ytemp = rk4(ysav, dysav, xsav, hh); x = xsav + hh; dydx = vectorField->_f(x, ytemp); y = rk4(ytemp, dydx, x, hh); x = xsav + h; if (x == xsav) { std::cout << "Step size too small in routine RKQC\n" << std::endl; loop = false; } else { ytemp = rk4(ysav, dysav, xsav, h); double errmax = 0.0; for (i = 0; i < m_dimension; ++i) { ytemp[i] -= y[i]; double temp = fabs(ytemp[i] / yscal[i]); if (errmax < temp) errmax = temp; } errmax /= eps; if (errmax <= 1.0) { hdid = h; hnext = (errmax > ERRCON ? SAFETY * h * exp(PGROW * log(errmax)) : 4.0 * h); loop = false; } else h *= SAFETY * exp(PSHRNK * log(errmax)); } } while ( loop ); for (i = 0; i < m_dimension; ++i) y[i] += ytemp[i] * FCOR; return y; } //=========================================================================== std::vector<double> const &RungeKutta::odeint( std::vector<double> const & ystart, double x1, double x2, double eps, double h1, double hmin, unsigned int &nok, unsigned int &nbad) { static std::vector<double> yscal(m_dimension), y; double hnext, hdid; double x = x1; double h = (x2 > x1) ? fabs(h1) : -fabs(h1); nok = nbad = 0; y = ystart; unsigned int nstp = 0; do { ++nstp; std::vector<double> dydx = vectorField->_f(x, y); for (unsigned short i = 0;i < m_dimension; ++i) yscal[i] = fabs(y[i]) + fabs(dydx[i] * h) + TINY; if ((x+h-x2)*(x+h-x1) > 0.0) h = x2 - x; y = rkqc(y, dydx, x, h, eps, yscal, hdid, hnext); if ( hdid == h ) ++nok; else ++nbad; if ( (x-x2) * (x2-x1) >= 0.0 ) return y; else { if (fabs(hnext) <= hmin) { m_bfailed = true; std::cout << "Step size too small in ODEINT\n" << std::endl; nstp = MAXSTP; } h = hnext; } } while ( nstp < MAXSTP ); //std::cout << "Too many steps in routine ODEINT\n" << std::endl; m_bfailed = true; return ystart; } //================================================================= std::vector<double> const& RungeKutta::quickSolve(std::vector<double>& y0, double t0, double dt) const { static std::vector<double> y; y = rk4(y0, vectorField->_f(t0,y0), t0, dt); return y; } //================================================================= std::vector<double> const& RungeKutta::enhancedSolve(std::vector<double>& y0, double t0, double dt) { static std::vector<double> result; unsigned int nok,nbad; m_bfailed = false; result = odeint(y0, t0, t0+dt, m_precision, m_hestimate, m_hmin, nok, nbad); //std::cout << "nok =" << nok << "; nbad = " << nbad << "\n"; return result; } |
|
From: <mk...@us...> - 2003-04-04 11:44:42
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Source
In directory sc8-pr-cvs1:/tmp/cvs-serv14737
Modified Files:
LandingGear.cpp
Log Message:
more comments
Index: LandingGear.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/LandingGear.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** LandingGear.cpp 26 Mar 2003 10:21:37 -0000 1.4
--- LandingGear.cpp 4 Apr 2003 11:44:39 -0000 1.5
***************
*** 69,72 ****
--- 69,73 ----
m_CompressionLimit = 0.0;
m_WOW = false;
+ m_Extended = true;
m_Touchdown = false;
m_Skidding = 0.0;
***************
*** 164,179 ****
--- 165,189 ----
double compression = - (Dot(extension, normal) + h) / mn;
// TODO: add in air drag
+
+ // at (or past) max extension?
if (compression <= 0.0) {
+ // limit travel and clear weight-on-wheels (WOW)
m_Compression = 0.0;
m_Position = m_MaxPosition;
m_WOW = false;
if (n>1000 && j++ > 10) n = 0;
+ // no ground reaction force (XXX should include air drag)
return Vector3::ZERO;
}
+
+ // first contact? if so, flag the touchdown
if (!m_WOW) {
// TODO should also store global position, but this isn't currently available
m_Touchdown = true;
}
+ // weight-on-wheels
m_WOW = true;
+
+ // are we overcompressed?
if (compression >= m_CompressionLimit) {
m_Compression = m_CompressionLimit;
***************
*** 187,202 ****
// FIXME only normal force is taken into account, but other components
// can matter if m_Motion isn't vertical. (e.g. when brakes are applied)
// calculate strut compression speed
Vector3 v_normal_local = Dot(v_local, normal) * normal;
Vector3 v_normal_body = QVRotate(q.Bar(), v_normal_local);
double v = - Dot(v_normal_body, m_Motion);
! // restrict v to reasonable limits
if (v > 10.0) v = 10.0;
if (v < -10.0) v = -10.0;
! Vector3 v_tangent_local = v_local - v_normal_local;
! Vector3 v_tangent_body = QVRotate(q.Bar(), v_tangent_local);
!
! // ground support
double normal_force = (m_K * m_Compression + m_Beta * v) * mn;
if (normal_force < 0.0) normal_force = 0.0; // wheel hop
--- 197,211 ----
// FIXME only normal force is taken into account, but other components
// can matter if m_Motion isn't vertical. (e.g. when brakes are applied)
+
// calculate strut compression speed
Vector3 v_normal_local = Dot(v_local, normal) * normal;
Vector3 v_normal_body = QVRotate(q.Bar(), v_normal_local);
double v = - Dot(v_normal_body, m_Motion);
! // restrict v to reasonable limits (faster than this means the gear will
! // probably break in a moment anyway)
if (v > 10.0) v = 10.0;
if (v < -10.0) v = -10.0;
! // ground support (in response to strut compression + damping)
double normal_force = (m_K * m_Compression + m_Beta * v) * mn;
if (normal_force < 0.0) normal_force = 0.0; // wheel hop
***************
*** 204,208 ****
--- 213,223 ----
Vector3 normal_body = QVRotate(q.Bar(), normal_local);
+ // now get motion along the ground
+ Vector3 v_tangent_local = v_local - v_normal_local;
+ Vector3 v_tangent_body = QVRotate(q.Bar(), v_tangent_local);
+
// wheel direction in local coordinates projected to ground
+ // 'y' is along the wheel rolling direction
+ // 'x' is along the wheel rotation axis
Vector3 y_local = QVRotate(q, m_Steer);
Vector3 y_tangent_local = y_local - Dot(y_local, normal)*normal;
***************
*** 214,248 ****
Vector3 v_x_local = v_tangent_local - v_y_local;
! // drag
Vector3 drag_body = QVRotate(q.Bar(), y_tangent_local);
double abs_forward_speed = fabs(forward_speed);
! // update brake setting
double f = dt*5.0;
if (f > 1.0) f = 1.0;
m_Brake = m_Brake * (1.0-f) + (m_BrakeSetting - m_Brake) * f;
! double brake_limit = m_Brake * 25000.0; // arbitrary... move to xml
double brake_force = m_TireShiftY * m_TireK;
if (fabs(brake_force) > brake_limit) {
! // arbitrary reduced slip friction (FIXME move to XML)
double slip_factor = 0.8;
if (brake_force < 0.0) slip_factor = -slip_factor;
brake_force = brake_limit * slip_factor;
if (m_TireShiftY * forward_speed < 0.0) {
m_TireShiftY += forward_speed * dt;
}
} else {
m_TireShiftY += forward_speed * dt;
}
double base_drag = 1000.0 / (1.0 + abs_forward_speed);
double drag_force = brake_force + (base_drag + abs_forward_speed)*forward_speed;
drag_body *= -drag_force;
!
! // side
Vector3 side_body = QVRotate(q.Bar(), x_tangent_local);
double side_speed = v_x_local.Length();
--- 229,282 ----
Vector3 v_x_local = v_tangent_local - v_y_local;
! // drag and braking unit vector in body coordinates
Vector3 drag_body = QVRotate(q.Bar(), y_tangent_local);
double abs_forward_speed = fabs(forward_speed);
! // update actual brake power from the input brake setting (low pass
! // filtered XXX ad-hoc time constant)
double f = dt*5.0;
if (f > 1.0) f = 1.0;
m_Brake = m_Brake * (1.0-f) + (m_BrakeSetting - m_Brake) * f;
! // maximum static braking force
! double brake_limit = m_Brake * 25000.0; // XXX arbitrary... move to xml
! // wheel reaction force (from deformation of the tire)
double brake_force = m_TireShiftY * m_TireK;
+ // we assume for the moment that the brakes will always slip before
+ // the tire skids. skidding is modelled further below once we have both
+ // the on and off axis forces acting on the wheel, so that we can compute
+ // the total force and compare it to the max friction force.
+
+ // can the brakes lock or are they slipping?
if (fabs(brake_force) > brake_limit) {
! // arbitrary reduced slip friction (XXX move to XML)
double slip_factor = 0.8;
+ // maintain the correct sign if we are moving backwards
if (brake_force < 0.0) slip_factor = -slip_factor;
brake_force = brake_limit * slip_factor;
+ // don't let the tire deform any further (the wheel is
+ // already slipping), only allow it to relax (which
+ // should happen initially since the sliding brake
+ // friction is lower than the static value).
if (m_TireShiftY * forward_speed < 0.0) {
m_TireShiftY += forward_speed * dt;
}
} else {
+ // brakes are locked, deform the tire.
m_TireShiftY += forward_speed * dt;
}
+ // XXX ad-hoc drag model for rolling friction added to braking force.
+ // drag has a constant term and a v^2 term. both are forced to zero
+ // linearly at low speed to prevent artificial rebound.
double base_drag = 1000.0 / (1.0 + abs_forward_speed);
double drag_force = brake_force + (base_drag + abs_forward_speed)*forward_speed;
+ // scale the drag unit vector to give the drag force vector
drag_body *= -drag_force;
! // lastly, side forces (along the wheel axis)
!
Vector3 side_body = QVRotate(q.Bar(), x_tangent_local);
double side_speed = v_x_local.Length();
***************
*** 252,261 ****
if (Dot(v_x_local, x_tangent_local) < 0.0) side_speed = -side_speed;
double side_damping = 0.0;
! // don't keep deforming past the point we lose traction
if (!m_Skidding || m_TireShiftX*side_speed > 0.0 || m_TireShiftX == 0.0) {
m_TireShiftX += - side_speed * dt;
side_damping = - side_speed * m_TireBeta;
}
! // limit deformation to a reasonable amount
if (m_TireShiftX > 0.1) {
m_TireShiftX = 0.1;
--- 286,296 ----
if (Dot(v_x_local, x_tangent_local) < 0.0) side_speed = -side_speed;
double side_damping = 0.0;
! // don't keep deforming the tire past the point we lose traction
if (!m_Skidding || m_TireShiftX*side_speed > 0.0 || m_TireShiftX == 0.0) {
m_TireShiftX += - side_speed * dt;
side_damping = - side_speed * m_TireBeta;
}
! // limit deformation to a reasonable amount (we should be skidding at this
! // point anyway)
if (m_TireShiftX > 0.1) {
m_TireShiftX = 0.1;
***************
*** 267,291 ****
}
double side_force = (m_TireK * m_TireShiftX) + side_damping;
if (m_SteeringLimit > 0.0) {
// partial (approx) castering of steerable wheels to reduce instability
side_force *= (0.1 + 0.9 * fabs(m_SteerAngle/m_SteeringLimit));
}
side_body *= side_force;
! // skid test
double mu = m_StaticFriction;
if (m_Skidding > 0.0) mu = m_DynamicFriction;
double total_force = side_force*side_force + drag_force*drag_force;
double friction = normal_force * mu;
if (total_force > friction * friction) {
double scale = friction / sqrt(total_force + 0.001);
side_body *= scale;
drag_body *= scale;
if (m_ABS) {
m_Brake *= scale;
m_TireShiftY *= scale;
}
m_Skidding = 1.0 - scale;
} else {
m_Skidding = 0.0;
}
--- 302,343 ----
}
double side_force = (m_TireK * m_TireShiftX) + side_damping;
+ // is this wheel steerable?
if (m_SteeringLimit > 0.0) {
// partial (approx) castering of steerable wheels to reduce instability
side_force *= (0.1 + 0.9 * fabs(m_SteerAngle/m_SteeringLimit));
}
+
+ // scale side unit vector to get side force
side_body *= side_force;
! // now that we have both components of the force in the ground plane,
! // it's time for the skid test
double mu = m_StaticFriction;
+ // if we are already skidding, use the dynamic friction coefficient.
if (m_Skidding > 0.0) mu = m_DynamicFriction;
+ // get the total force in the ground plane
double total_force = side_force*side_force + drag_force*drag_force;
+ // get the maximum friction force
double friction = normal_force * mu;
+ // are we skidding?
if (total_force > friction * friction) {
+ // scale both components of the force equally to limit
+ // to the max friction force
double scale = friction / sqrt(total_force + 0.001);
side_body *= scale;
drag_body *= scale;
+ // if we have antilock braking, reduce the brake force as
+ // well and the tire deformation so that we come out of
+ // the skid (temporarily since the brake_setting will remain
+ // too high)
if (m_ABS) {
m_Brake *= scale;
m_TireShiftY *= scale;
}
+ // a rough measure of the severity of the skid (can be used
+ // for sound effects or smoke).
m_Skidding = 1.0 - scale;
} else {
+ // no, reset so we use the static friction coefficient again
m_Skidding = 0.0;
}
***************
*** 305,308 ****
--- 357,362 ----
// sum forces
Vector3 F = normal_body + drag_body + side_body;
+
+ // get the new wheel position
m_Position = m_MaxPosition + m_Motion * m_Compression;
***************
*** 318,321 ****
--- 372,376 ----
}
+ // return the total force
return F;
}
|