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: <de...@us...> - 2003-01-20 18:23:00
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Source In directory sc8-pr-cvs1:/tmp/cvs-serv32349 Modified Files: Tag: simdata TypeAdapter.cpp Log Message: no message Index: TypeAdapter.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Attic/TypeAdapter.cpp,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** TypeAdapter.cpp 20 Jan 2003 04:56:49 -0000 1.1.2.2 --- TypeAdapter.cpp 20 Jan 2003 18:22:56 -0000 1.1.2.3 *************** *** 39,45 **** */ std::ostream &operator <<(std::ostream &o, TypeAdapter const &t) { ! if (t.isType(TypeAdapter::INT)) return o << (int const) t; ! if (t.isType(TypeAdapter::DOUBLE)) return o << (double const) t; ! if (t.isType(TypeAdapter::STRING)) return o << (std::string const) t; if (t.isType(TypeAdapter::BASE)) return o << "TypeAdapter<Base>"; return o << "TypeAdapter<UNKNOWN>"; --- 39,45 ---- */ std::ostream &operator <<(std::ostream &o, TypeAdapter const &t) { ! if (t.isType(TypeAdapter::INT)) return o << t.getInteger(); ! if (t.isType(TypeAdapter::DOUBLE)) return o << t.getFloatingPoint(); ! if (t.isType(TypeAdapter::STRING)) return o << t.getString(); if (t.isType(TypeAdapter::BASE)) return o << "TypeAdapter<Base>"; return o << "TypeAdapter<UNKNOWN>"; *************** *** 47,51 **** void TypeAdapter::set(int &x) const { IntCheck(); x = (int) var.i; } ! void TypeAdapter::set(bool &x) const { IntCheck(); x = (bool) var.i; } void TypeAdapter::set(float &x) const { DoubleCheck(); x = (float) var.d; } void TypeAdapter::set(double &x) const { DoubleCheck(); x = (double) var.d; } --- 47,51 ---- void TypeAdapter::set(int &x) const { IntCheck(); x = (int) var.i; } ! void TypeAdapter::set(bool &x) const { IntCheck(); x = (var.i != 0); } void TypeAdapter::set(float &x) const { DoubleCheck(); x = (float) var.d; } void TypeAdapter::set(double &x) const { DoubleCheck(); x = (double) var.d; } |
From: <mk...@us...> - 2003-01-20 08:16:14
|
Update of /cvsroot/csp/APPLICATIONS/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv4472 Modified Files: Tag: simdata Makefile Log Message: Index: Makefile =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Attic/Makefile,v retrieving revision 1.1.2.5 retrieving revision 1.1.2.6 diff -C2 -d -r1.1.2.5 -r1.1.2.6 *** Makefile 20 Jan 2003 08:13:31 -0000 1.1.2.5 --- Makefile 20 Jan 2003 08:16:00 -0000 1.1.2.6 *************** *** 2,6 **** export GDEBUGF = -g -Wall ! export GCFLAGS = -I/usr/local/include/python2.2 -fPIC -DSWIG_GLOBAL -DUSE_NAMESPACE_SIMDATA -D__PTS_SIM__# -O2 export GLDOPTS = -shared -lswigpy -ldl export GSWOPTS = -c -c++ -python -DUSE_NAMESPACE_SIMDATA -noexcept --- 2,6 ---- export GDEBUGF = -g -Wall ! export GCFLAGS = -I/usr/local/include/python2.2 -fPIC -DSWIG_GLOBAL -DUSE_NAMESPACE_SIMDATA # -O2 export GLDOPTS = -shared -lswigpy -ldl export GSWOPTS = -c -c++ -python -DUSE_NAMESPACE_SIMDATA -noexcept |
From: <mk...@us...> - 2003-01-20 08:13:34
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Include/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv2859/Include/SimData Modified Files: Tag: simdata ObjectInterface.h Log Message: pts tweaks Index: ObjectInterface.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Attic/ObjectInterface.h,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -C2 -d -r1.1.2.4 -r1.1.2.5 *** ObjectInterface.h 20 Jan 2003 06:46:35 -0000 1.1.2.4 --- ObjectInterface.h 20 Jan 2003 08:13:32 -0000 1.1.2.5 *************** *** 76,80 **** char IsVector(std::vector<T> const); // no implementation is required ! int IsVector(...); // no implementation is required template <class T> --- 76,81 ---- char IsVector(std::vector<T> const); // no implementation is required ! int IsVector(const TypeAdapter &); // no implementation is required ! //int IsVector(...); // no implementation is required template <class T> |
From: <mk...@us...> - 2003-01-20 08:13:34
|
Update of /cvsroot/csp/APPLICATIONS/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv2859 Modified Files: Tag: simdata Makefile Log Message: pts tweaks Index: Makefile =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Attic/Makefile,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -C2 -d -r1.1.2.4 -r1.1.2.5 *** Makefile 20 Jan 2003 06:46:34 -0000 1.1.2.4 --- Makefile 20 Jan 2003 08:13:31 -0000 1.1.2.5 *************** *** 2,6 **** export GDEBUGF = -g -Wall ! export GCFLAGS = -I/usr/local/include/python2.2 -fPIC -DSWIG_GLOBAL -DUSE_NAMESPACE_SIMDATA # -O2 export GLDOPTS = -shared -lswigpy -ldl export GSWOPTS = -c -c++ -python -DUSE_NAMESPACE_SIMDATA -noexcept --- 2,6 ---- export GDEBUGF = -g -Wall ! export GCFLAGS = -I/usr/local/include/python2.2 -fPIC -DSWIG_GLOBAL -DUSE_NAMESPACE_SIMDATA -D__PTS_SIM__# -O2 export GLDOPTS = -shared -lswigpy -ldl export GSWOPTS = -c -c++ -python -DUSE_NAMESPACE_SIMDATA -noexcept |
From: <mk...@us...> - 2003-01-20 06:46:38
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Include/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv20520/Include/SimData Modified Files: Tag: simdata ObjectInterface.h Log Message: added (experimental) simulated partial template specialization for win32 (vc++) Index: ObjectInterface.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Attic/ObjectInterface.h,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** ObjectInterface.h 20 Jan 2003 05:53:12 -0000 1.1.2.3 --- ObjectInterface.h 20 Jan 2003 06:46:35 -0000 1.1.2.4 *************** *** 47,50 **** --- 47,122 ---- + /* + * Simulated Partial Template Specialization + * + * Adapted from: metactrl.h + * by Krzysztof Czarnecki & Ulrich Eisenecker + */ + + /* The following functions come from chapter 10 of the indispensable book + * Generative Programming by Krzysztof Czarnecki & Ulrich Eisenecker + * (C) Copyright Krzysztof Czarnecki & Ulrich Eisenecker 1998-2000. + * Permission to copy, use, modify, sell and distribute this software is + * granted provided this copyright notice appears in all copies. In case of + * modification, the modified files should carry a notice stating that + * you changed the files. + * This software is provided "as is" without express or implied + * warranty, and with no claim as to its suitability for any purpose. + */ + + #ifdef WIN32 + #define __PTS_SIM__ + #endif + + #ifdef __PTS_SIM__ + + namespace PTS { + + template <typename T> + char IsVector(std::vector<T> const); // no implementation is required + + int IsVector(...); // no implementation is required + + template <class T> + struct ISVECTOR { + enum { RET = (sizeof(IsVector(*(T*)0)) == 1) }; + }; + + struct SelectThen + { template<class Then, class Else> + struct Result + { typedef Then RET; + }; + }; // end SelectThen + + struct SelectElse + { template<class Then, class Else> + struct Result + { typedef Else RET; + }; + }; // end SelectElse + + template<bool Condition> + struct Selector { + }; // end Selector + + template<> + struct Selector<true> + { typedef SelectThen RET; + }; // end Selector<false> + + template<> + struct Selector<false> + { typedef SelectElse RET; + }; // end Selector<false> + } + + #define MEMBERACCESSOR(C, T) \ + (typename PTS::Selector<PTS::ISVECTOR<T>::RET>::RET\ + ::Result<VectorMemberAccessor<C, T>, MemberAccessor<C, T> >::RET) + + #endif // __PTS_SIM__ + + /** * class MemberAccessorBase - Base class for storing and accessing member *************** *** 133,136 **** --- 205,259 ---- * @author Mark Rose <mr...@st...> */ + #ifdef __PTS_SIM__ + template <class C, typename T> + class VectorMemberAccessor: public MemberAccessorBase + { + T C::* member; + public: + VectorMemberAccessor(T C::*pm, std::string name_, bool required_) { + member = pm; + name = name_; + required = required_; + } + virtual void push_back(Object *o, TypeAdapter const &v) throw(TypeMismatch) { + C * object = dynamic_cast<C *>(o); + if (object == NULL) { + throw TypeMismatch("push_back(\"" + name + "\"): Object class does not match interface."); + } + typename T::value_type value; + v.set(value); + (object->*member).push_back(value); + } + virtual void clear(Object *o) throw(TypeMismatch) { + C * object = dynamic_cast<C *>(o); + if (object == NULL) { + throw TypeMismatch("push_back(\"" + name + "\"): Object class does not match interface."); + } + (object->*member).clear(); + } + virtual void pack(Object *o, Packer &p) const { + C * object = dynamic_cast<C *>(o); + T &m = object->*member; + p.pack(m.size()); + typename T::iterator idx; + for (idx = m.begin(); idx != m.end(); idx++) { + p.pack(*idx); + } + } + virtual void unpack(Object *, UnPacker &p) { + C * object = dynamic_cast<C *>(o); + T &m = object->*member; + typename T::value_type temp; + int n; + p.unpack(n); + while (n-- > 0) { + p.unpack(temp); + m.push_back(temp); + } + } + }; + + #else + template <class C, typename T> class MemberAccessor< C, std::vector<T> >: public MemberAccessorBase *************** *** 181,184 **** --- 304,308 ---- } }; + #endif *************** *** 244,248 **** --- 368,376 ---- Self& def(const char *name, T C::*pm, bool required) throw(InterfaceError) { if (variableExists(name)) throw InterfaceError("interface variable \"" + std::string(name) + "\" multiply defined."); + #ifdef __PTS_SIM__ + table[name] = new MEMBERACCESSOR(C, T)(pm, name, required); + #else table[name] = new MemberAccessor<C, T>(pm, name, required); + #endif return *this; } |
From: <mk...@us...> - 2003-01-20 06:46:37
|
Update of /cvsroot/csp/APPLICATIONS/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv20520 Modified Files: Tag: simdata Makefile Log Message: added (experimental) simulated partial template specialization for win32 (vc++) Index: Makefile =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Attic/Makefile,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** Makefile 20 Jan 2003 05:53:12 -0000 1.1.2.3 --- Makefile 20 Jan 2003 06:46:34 -0000 1.1.2.4 *************** *** 5,9 **** export GLDOPTS = -shared -lswigpy -ldl export GSWOPTS = -c -c++ -python -DUSE_NAMESPACE_SIMDATA -noexcept ! export CXX = g++-2.95 export SWIG = swig --- 5,9 ---- export GLDOPTS = -shared -lswigpy -ldl export GSWOPTS = -c -c++ -python -DUSE_NAMESPACE_SIMDATA -noexcept ! export CXX = g++ export SWIG = swig |
Update of /cvsroot/csp/APPLICATIONS/SimData/Source In directory sc8-pr-cvs1:/tmp/cvs-serv2741/Source Modified Files: Tag: simdata DataArchive.cpp Enum.cpp Exception.cpp InterfaceRegistry.cpp Path.cpp Spread.cpp Log Message: more gcc 3.2 compatibility fixes Index: DataArchive.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Attic/DataArchive.cpp,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** DataArchive.cpp 20 Jan 2003 04:29:38 -0000 1.1.2.2 --- DataArchive.cpp 20 Jan 2003 05:53:12 -0000 1.1.2.3 *************** *** 340,344 **** ! void DataArchive::_addStatic(Object* ptr, const char* path, hasht key=0) { if (key == 0) key = hash_string(path); static_map[key] = ptr; --- 340,344 ---- ! void DataArchive::_addStatic(Object* ptr, const char* path, hasht key) { if (key == 0) key = hash_string(path); static_map[key] = ptr; Index: Enum.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Attic/Enum.cpp,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** Enum.cpp 19 Jan 2003 20:31:41 -0000 1.1.2.1 --- Enum.cpp 20 Jan 2003 05:53:12 -0000 1.1.2.2 *************** *** 22,26 **** } ! Enum::Enum(const Enumeration& parent, int idx=0): _parent(&parent) { _id = idx; _name = parent[idx].asString(); --- 22,26 ---- } ! Enum::Enum(const Enumeration& parent, int idx): _parent(&parent) { _id = idx; _name = parent[idx].asString(); Index: Exception.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Attic/Exception.cpp,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** Exception.cpp 19 Jan 2003 20:31:41 -0000 1.1.2.1 --- Exception.cpp 20 Jan 2003 05:53:12 -0000 1.1.2.2 *************** *** 26,30 **** ! Exception::Exception(std::string type="Exception", std::string msg="") { //: std::runtime_error(type+": "+msg) { _type = type; --- 26,30 ---- ! Exception::Exception(std::string type, std::string msg) { //: std::runtime_error(type+": "+msg) { _type = type; Index: InterfaceRegistry.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Attic/InterfaceRegistry.cpp,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** InterfaceRegistry.cpp 20 Jan 2003 04:56:49 -0000 1.1.2.2 --- InterfaceRegistry.cpp 20 Jan 2003 05:53:12 -0000 1.1.2.3 *************** *** 72,76 **** //MemberAccessorBase * InterfaceProxy::getAccessor(const char *name, const char *cname = 0) const throw(InterfaceError) { ! MemberAccessorBase * InterfaceProxy::getAccessor(const char *name, const char *cname = 0) const { if (!cname) cname = "?"; throw InterfaceError("variable \"" + std::string(name) + "\" not defined in interface to class " + cname); --- 72,76 ---- //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 = "?"; throw InterfaceError("variable \"" + std::string(name) + "\" not defined in interface to class " + cname); Index: Path.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Attic/Path.cpp,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** Path.cpp 20 Jan 2003 04:56:49 -0000 1.1.2.2 --- Path.cpp 20 Jan 2003 05:53:12 -0000 1.1.2.3 *************** *** 147,151 **** } ! void PathPointerBase::_load(DataArchive* archive, ObjectID path=0) { assert(archive != 0); if (path == 0) path = _path; --- 147,151 ---- } ! void PathPointerBase::_load(DataArchive* archive, ObjectID path) { assert(archive != 0); if (path == 0) path = _path; Index: Spread.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Attic/Spread.cpp,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** Spread.cpp 19 Jan 2003 20:31:41 -0000 1.1.2.1 --- Spread.cpp 20 Jan 2003 05:53:12 -0000 1.1.2.2 *************** *** 56,60 **** } ! Spread::Spread(float mean=0.0, float sigma=0.0) { set(mean, sigma); regen(); --- 56,60 ---- } ! Spread::Spread(float mean, float sigma) { set(mean, sigma); regen(); |
Update of /cvsroot/csp/APPLICATIONS/SimData/Include/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv2741/Include/SimData Modified Files: Tag: simdata Enum.h HashUtility.h InterfaceRegistry.h List.h ObjectInterface.h Pack.h hash_map.h Log Message: more gcc 3.2 compatibility fixes Index: Enum.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Attic/Enum.h,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** Enum.h 20 Jan 2003 04:56:49 -0000 1.1.2.3 --- Enum.h 20 Jan 2003 05:53:12 -0000 1.1.2.4 *************** *** 68,72 **** struct hashstring { ! static std::hash<const char*> h; int operator()(const std::string &s) const { return h(s.c_str()); --- 68,72 ---- struct hashstring { ! static HASH<const char*> h; int operator()(const std::string &s) const { return h(s.c_str()); *************** *** 74,82 **** }; ! std::hash<const char*> hashstring::h; } // namespace ! typedef std::hash_map<const std::string, int, hashstring, eqstring> string_map; --- 74,82 ---- }; ! HASH<const char*> hashstring::h; } // namespace ! typedef HASH_MAP<const std::string, int, hashstring, eqstring> string_map; Index: HashUtility.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Attic/HashUtility.h,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** HashUtility.h 20 Jan 2003 04:56:49 -0000 1.1.2.3 --- HashUtility.h 20 Jan 2003 05:53:12 -0000 1.1.2.4 *************** *** 92,103 **** }; ! ! typedef std::hash_map<hasht, int, hasht_hash, hasht_eq> hasht_map; class Object; class ObjectProxyBase; ! typedef std::hash_map<hasht, Object*, hasht_hash, hasht_eq> cache_map; ! typedef std::hash_map<hasht, ObjectProxyBase*, hasht_hash, hasht_eq> proxy_map; --- 92,102 ---- }; ! typedef HASH_MAP<hasht, int, hasht_hash, hasht_eq> hasht_map; class Object; class ObjectProxyBase; ! typedef HASH_MAP<hasht, Object*, hasht_hash, hasht_eq> cache_map; ! typedef HASH_MAP<hasht, ObjectProxyBase*, hasht_hash, hasht_eq> proxy_map; Index: InterfaceRegistry.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Attic/InterfaceRegistry.h,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** InterfaceRegistry.h 19 Jan 2003 20:28:30 -0000 1.1.2.1 --- InterfaceRegistry.h 20 Jan 2003 05:53:12 -0000 1.1.2.2 *************** *** 160,165 **** private: ! typedef std::hash_map<const char *, InterfaceProxy *, std::hash<const char *>, eqstr> proxy_map; ! typedef std::hash_map<hasht, InterfaceProxy *, hasht_hash, hasht_eq> proxy_id_map; proxy_map *map; proxy_id_map *id_map; --- 160,165 ---- private: ! typedef HASH_MAP<const char *, InterfaceProxy *, HASH<const char *>, eqstr> proxy_map; ! typedef HASH_MAP<hasht, InterfaceProxy *, hasht_hash, hasht_eq> proxy_id_map; proxy_map *map; proxy_id_map *id_map; Index: List.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Attic/List.h,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** List.h 19 Jan 2003 20:28:30 -0000 1.1.2.1 --- List.h 20 Jan 2003 05:53:12 -0000 1.1.2.2 *************** *** 86,90 **** template<typename T> void List<T>::pack(Packer& p) const { ! std::vector<T>::const_iterator a; p.pack((int)(this->size())); for (a=this->begin(); a!=this->end(); a++) --- 86,90 ---- template<typename T> void List<T>::pack(Packer& p) const { ! typename std::vector<T>::const_iterator a; p.pack((int)(this->size())); for (a=this->begin(); a!=this->end(); a++) Index: ObjectInterface.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Attic/ObjectInterface.h,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** ObjectInterface.h 20 Jan 2003 04:14:42 -0000 1.1.2.2 --- ObjectInterface.h 20 Jan 2003 05:53:12 -0000 1.1.2.3 *************** *** 57,61 **** public: virtual ~MemberAccessorBase() {} ! typedef std::hash_map<const char *, MemberAccessorBase *, std::hash<const char*>, eqstr> map; virtual void set(Object *, TypeAdapter const &) throw(TypeMismatch) { throw TypeMismatch("Cannot set vector<> '" + name + "' directly, use push_back() instead."); --- 57,61 ---- public: virtual ~MemberAccessorBase() {} ! typedef HASH_MAP<const char *, MemberAccessorBase *, HASH<const char*>, eqstr> map; virtual void set(Object *, TypeAdapter const &) throw(TypeMismatch) { throw TypeMismatch("Cannot set vector<> '" + name + "' directly, use push_back() instead."); *************** *** 164,168 **** std::vector<T> &m = object->*member; p.pack(m.size()); ! std::vector<T>::iterator idx; for (idx = m.begin(); idx != m.end(); idx++) { p.pack(*idx); --- 164,168 ---- std::vector<T> &m = object->*member; p.pack(m.size()); ! typename std::vector<T>::iterator idx; for (idx = m.begin(); idx != m.end(); idx++) { p.pack(*idx); Index: Pack.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Attic/Pack.h,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** Pack.h 19 Jan 2003 20:28:30 -0000 1.1.2.1 --- Pack.h 20 Jan 2003 05:53:12 -0000 1.1.2.2 *************** *** 110,114 **** void pack(const std::vector<T>& x) { pack((int)x.size()); ! std::vector<T>::const_iterator i = x.begin(); while (i != x.end()) pack(*i++); } --- 110,114 ---- void pack(const std::vector<T>& x) { pack((int)x.size()); ! typename std::vector<T>::const_iterator i = x.begin(); while (i != x.end()) pack(*i++); } *************** *** 220,224 **** unpack(n); y.resize(n, 0.0); ! std::vector<T>::iterator i = y.begin(); while (n-- > 0) unpack(*i++); } --- 220,224 ---- unpack(n); y.resize(n, 0.0); ! typename std::vector<T>::iterator i = y.begin(); while (n-- > 0) unpack(*i++); } Index: hash_map.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Attic/hash_map.h,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** hash_map.h 20 Jan 2003 04:56:49 -0000 1.1.2.3 --- hash_map.h 20 Jan 2003 05:53:12 -0000 1.1.2.4 *************** *** 2,13 **** --- 2,25 ---- #if __GNUC__ == 3 #include <ext/hash_map> + #if __GNUC_MINOR__ > 0 + #define HASH_MAP __gnu_cxx::hash_map + #define HASH __gnu_cxx::hash + #else + #define HASH_MAP std::hash_map + #define HASH std::hash + #endif #else #include <hash_map> + #define HASH_MAP std::hash_map + #define HASH std::hash #endif #else #ifdef WIN32 #include <hash_map.h> + #define HASH_MAP std::hash_map + #define HASH std::hash #else #error "PLEASE PROVIDE CORRECT #INCLUDE<HASH_MAP> STATEMENT FOR YOUR PLATFORM!" #endif #endif + |
From: <mk...@us...> - 2003-01-20 05:53:15
|
Update of /cvsroot/csp/APPLICATIONS/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv2741 Modified Files: Tag: simdata Makefile Log Message: more gcc 3.2 compatibility fixes Index: Makefile =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Attic/Makefile,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** Makefile 20 Jan 2003 04:29:38 -0000 1.1.2.2 --- Makefile 20 Jan 2003 05:53:12 -0000 1.1.2.3 *************** *** 5,9 **** export GLDOPTS = -shared -lswigpy -ldl export GSWOPTS = -c -c++ -python -DUSE_NAMESPACE_SIMDATA -noexcept ! export CXX = g++-3.0 export SWIG = swig --- 5,9 ---- export GLDOPTS = -shared -lswigpy -ldl export GSWOPTS = -c -c++ -python -DUSE_NAMESPACE_SIMDATA -noexcept ! export CXX = g++-2.95 export SWIG = swig |
Update of /cvsroot/csp/APPLICATIONS/SimData/Source In directory sc8-pr-cvs1:/tmp/cvs-serv18665/Source Modified Files: Tag: simdata InterfaceRegistry.cpp Interpolate.cpp Path.cpp TypeAdapter.cpp cSimData_wrap.cpp Log Message: wide range of small fixes Index: InterfaceRegistry.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Attic/InterfaceRegistry.cpp,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** InterfaceRegistry.cpp 19 Jan 2003 20:31:41 -0000 1.1.2.1 --- InterfaceRegistry.cpp 20 Jan 2003 04:56:49 -0000 1.1.2.2 *************** *** 38,41 **** --- 38,43 ---- #include <SimData/Path.h> + using std::cout; + using std::endl; NAMESPACE_SIMDATA Index: Interpolate.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Attic/Interpolate.cpp,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** Interpolate.cpp 19 Jan 2003 20:31:41 -0000 1.1.2.1 --- Interpolate.cpp 20 Jan 2003 04:56:49 -0000 1.1.2.2 *************** *** 26,29 **** --- 26,32 ---- + #define min(a, b) (((a)<(b)) ? (a) : (b)) + #define max(a, b) (((a)>(b)) ? (a) : (b)) + const Enumeration InterpolatedData::Method("LINEAR SPLINE"); Index: Path.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Attic/Path.cpp,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** Path.cpp 19 Jan 2003 20:31:41 -0000 1.1.2.1 --- Path.cpp 20 Jan 2003 04:56:49 -0000 1.1.2.2 *************** *** 23,26 **** --- 23,28 ---- #include <SimData/ns-simdata.h> + using std::cout; + using std::endl; NAMESPACE_SIMDATA Index: TypeAdapter.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Attic/TypeAdapter.cpp,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** TypeAdapter.cpp 19 Jan 2003 20:31:41 -0000 1.1.2.1 --- TypeAdapter.cpp 20 Jan 2003 04:56:49 -0000 1.1.2.2 *************** *** 38,42 **** * Convenience function for dumping object member variables. */ ! ostream &operator <<(ostream &o, TypeAdapter const &t) { if (t.isType(TypeAdapter::INT)) return o << (int const) t; if (t.isType(TypeAdapter::DOUBLE)) return o << (double const) t; --- 38,42 ---- * Convenience function for dumping object member variables. */ ! std::ostream &operator <<(std::ostream &o, TypeAdapter const &t) { if (t.isType(TypeAdapter::INT)) return o << (int const) t; if (t.isType(TypeAdapter::DOUBLE)) return o << (double const) t; Index: cSimData_wrap.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Attic/cSimData_wrap.cpp,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** cSimData_wrap.cpp 19 Jan 2003 20:31:40 -0000 1.1.2.1 --- cSimData_wrap.cpp 20 Jan 2003 04:56:49 -0000 1.1.2.2 *************** *** 692,719 **** #define SWIGTYPE_p_simdata__PythonException swig_types[43] #define SWIGTYPE_p_simdata__Exception swig_types[44] ! #define SWIGTYPE_p_std__ostream swig_types[45] ! #define SWIGTYPE_p_a_3__simdata__Matrix3__M_t swig_types[46] ! #define SWIGTYPE_p_simdata__Object swig_types[47] ! #define SWIGTYPE_p_simdata__Packer swig_types[48] ! #define SWIGTYPE_p_simdata__Zulu swig_types[49] ! #define SWIGTYPE_p_std__vectorTfloat_t swig_types[50] ! #define SWIGTYPE_p_simdata__Curve swig_types[51] ! #define SWIGTYPE_p_std__vectorTsimdata__Enum_t swig_types[52] ! #define SWIGTYPE_p_tm swig_types[53] ! #define SWIGTYPE_p_FILE swig_types[54] ! #define SWIGTYPE_p_int swig_types[55] ! #define SWIGTYPE_p_std__vectorTsimdata__Table_t swig_types[56] ! #define SWIGTYPE_p_std__vectorTsimdata__Curve_t swig_types[57] ! #define SWIGTYPE_p_simdata__BaseType swig_types[58] ! #define SWIGTYPE_p_simdata__ListTsimdata__Curve_t swig_types[59] ! #define SWIGTYPE_p_simdata__ListTsimdata__Table_t swig_types[60] ! #define SWIGTYPE_p_simdata__IOError swig_types[61] ! #define SWIGTYPE_p_std__vectorTsimdata__InterfaceProxy_p_t swig_types[62] ! #define SWIGTYPE_p_simdata__SimDate swig_types[63] ! #define SWIGTYPE_p_simdata__InterpolatedData swig_types[64] ! #define SWIGTYPE_p_std__vectorTstd__string_t swig_types[65] ! #define SWIGTYPE_p_simdata__Matrix3 swig_types[66] ! #define SWIGTYPE_p_simdata__InterfaceProxy swig_types[67] ! static swig_type_info *swig_types[69]; /* -------- TYPES TABLE (END) -------- */ --- 692,720 ---- #define SWIGTYPE_p_simdata__PythonException swig_types[43] #define SWIGTYPE_p_simdata__Exception swig_types[44] ! #define SWIGTYPE_p_gint32 swig_types[45] ! #define SWIGTYPE_p_std__ostream swig_types[46] ! #define SWIGTYPE_p_a_3__simdata__Matrix3__M_t swig_types[47] ! #define SWIGTYPE_p_simdata__Object swig_types[48] ! #define SWIGTYPE_p_simdata__Packer swig_types[49] ! #define SWIGTYPE_p_simdata__Zulu swig_types[50] ! #define SWIGTYPE_p_std__vectorTfloat_t swig_types[51] ! #define SWIGTYPE_p_simdata__Curve swig_types[52] ! #define SWIGTYPE_p_std__vectorTsimdata__Enum_t swig_types[53] ! #define SWIGTYPE_p_tm swig_types[54] ! #define SWIGTYPE_p_FILE swig_types[55] ! #define SWIGTYPE_p_int swig_types[56] ! #define SWIGTYPE_p_std__vectorTsimdata__Table_t swig_types[57] ! #define SWIGTYPE_p_std__vectorTsimdata__Curve_t swig_types[58] ! #define SWIGTYPE_p_simdata__BaseType swig_types[59] ! #define SWIGTYPE_p_simdata__ListTsimdata__Curve_t swig_types[60] ! #define SWIGTYPE_p_simdata__ListTsimdata__Table_t swig_types[61] ! #define SWIGTYPE_p_simdata__IOError swig_types[62] ! #define SWIGTYPE_p_std__vectorTsimdata__InterfaceProxy_p_t swig_types[63] ! #define SWIGTYPE_p_simdata__SimDate swig_types[64] ! #define SWIGTYPE_p_simdata__InterpolatedData swig_types[65] ! #define SWIGTYPE_p_std__vectorTstd__string_t swig_types[66] ! #define SWIGTYPE_p_simdata__Matrix3 swig_types[67] ! #define SWIGTYPE_p_simdata__InterfaceProxy swig_types[68] ! static swig_type_info *swig_types[70]; /* -------- TYPES TABLE (END) -------- */ *************** *** 19444,19452 **** PyObject *resultobj; simdata::TableEntry *arg1 = (simdata::TableEntry *) 0 ; ! int32 arg2 ; PyObject * obj0 = 0 ; ! if(!PyArg_ParseTuple(args,(char *)"Oi:TableEntry_offset_set",&obj0,&arg2)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_simdata__TableEntry,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; if (arg1) (arg1)->offset = arg2; --- 19445,19457 ---- PyObject *resultobj; simdata::TableEntry *arg1 = (simdata::TableEntry *) 0 ; ! gint32 arg2 ; ! gint32 *argp2 ; PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; ! if(!PyArg_ParseTuple(args,(char *)"OO:TableEntry_offset_set",&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_simdata__TableEntry,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; + if ((SWIG_ConvertPtr(obj1,(void **) &argp2, SWIGTYPE_p_gint32,SWIG_POINTER_EXCEPTION) == -1)) SWIG_fail; + arg2 = *argp2; if (arg1) (arg1)->offset = arg2; *************** *** 19461,19472 **** PyObject *resultobj; simdata::TableEntry *arg1 = (simdata::TableEntry *) 0 ; ! int32 result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:TableEntry_offset_get",&obj0)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_simdata__TableEntry,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; ! result = (int32) ((arg1)->offset); ! resultobj = PyInt_FromLong((long)result); return resultobj; fail: --- 19466,19481 ---- PyObject *resultobj; simdata::TableEntry *arg1 = (simdata::TableEntry *) 0 ; ! gint32 result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:TableEntry_offset_get",&obj0)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_simdata__TableEntry,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; ! result = ((arg1)->offset); ! { ! gint32 * resultptr; ! resultptr = new gint32((gint32 &) result); ! resultobj = SWIG_NewPointerObj((void *) resultptr, SWIGTYPE_p_gint32, 1); ! } return resultobj; fail: *************** *** 19478,19486 **** PyObject *resultobj; simdata::TableEntry *arg1 = (simdata::TableEntry *) 0 ; ! int32 arg2 ; PyObject * obj0 = 0 ; ! if(!PyArg_ParseTuple(args,(char *)"Oi:TableEntry_length_set",&obj0,&arg2)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_simdata__TableEntry,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; if (arg1) (arg1)->length = arg2; --- 19487,19499 ---- PyObject *resultobj; simdata::TableEntry *arg1 = (simdata::TableEntry *) 0 ; ! gint32 arg2 ; ! gint32 *argp2 ; PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; ! if(!PyArg_ParseTuple(args,(char *)"OO:TableEntry_length_set",&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_simdata__TableEntry,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; + if ((SWIG_ConvertPtr(obj1,(void **) &argp2, SWIGTYPE_p_gint32,SWIG_POINTER_EXCEPTION) == -1)) SWIG_fail; + arg2 = *argp2; if (arg1) (arg1)->length = arg2; *************** *** 19495,19506 **** PyObject *resultobj; simdata::TableEntry *arg1 = (simdata::TableEntry *) 0 ; ! int32 result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:TableEntry_length_get",&obj0)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_simdata__TableEntry,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; ! result = (int32) ((arg1)->length); ! resultobj = PyInt_FromLong((long)result); return resultobj; fail: --- 19508,19523 ---- PyObject *resultobj; simdata::TableEntry *arg1 = (simdata::TableEntry *) 0 ; ! gint32 result; PyObject * obj0 = 0 ; if(!PyArg_ParseTuple(args,(char *)"O:TableEntry_length_get",&obj0)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_simdata__TableEntry,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; ! result = ((arg1)->length); ! { ! gint32 * resultptr; ! resultptr = new gint32((gint32 &) result); ! resultobj = SWIG_NewPointerObj((void *) resultptr, SWIGTYPE_p_gint32, 1); ! } return resultobj; fail: *************** *** 22265,22268 **** --- 22282,22286 ---- static swig_type_info _swigt__p_simdata__PythonException[] = {{"_p_simdata__PythonException", 0, "simdata::PythonException *", 0},{"_p_simdata__PythonException"},{0}}; static swig_type_info _swigt__p_simdata__Exception[] = {{"_p_simdata__Exception", 0, "simdata::Exception *", 0},{"_p_simdata__Exception"},{"_p_simdata__ParseException", _p_simdata__ParseExceptionTo_p_simdata__Exception},{"_p_simdata__ObjectTypeMismatch", _p_simdata__ObjectTypeMismatchTo_p_simdata__Exception},{"_p_simdata__ObjectMismatch", _p_simdata__ObjectMismatchTo_p_simdata__Exception},{"_p_simdata__CorruptArchive", _p_simdata__CorruptArchiveTo_p_simdata__Exception},{"_p_simdata__IOError", _p_simdata__IOErrorTo_p_simdata__Exception},{"_p_simdata__BadMagic", _p_simdata__BadMagicTo_p_simdata__Exception},{"_p_simdata__BadByteOrder", _p_simdata__BadByteOrderTo_p_simdata__Exception},{"_p_simdata__IndexError", _p_simdata__IndexErrorTo_p_simdata__Exception},{0}}; + static swig_type_info _swigt__p_gint32[] = {{"_p_gint32", 0, "gint32 *", 0},{"_p_gint32"},{0}}; static swig_type_info _swigt__p_std__ostream[] = {{"_p_std__ostream", 0, "std::ostream *", 0},{"_p_std__ostream"},{0}}; static swig_type_info _swigt__p_a_3__simdata__Matrix3__M_t[] = {{"_p_a_3__simdata__Matrix3__M_t", 0, "simdata::Matrix3::M_t [3][3]", 0},{"_p_a_3__simdata__Matrix3__M_t"},{"_p_a_3__double"},{0}}; *************** *** 22335,22338 **** --- 22353,22357 ---- _swigt__p_simdata__PythonException, _swigt__p_simdata__Exception, + _swigt__p_gint32, _swigt__p_std__ostream, _swigt__p_a_3__simdata__Matrix3__M_t, |
From: <mk...@us...> - 2003-01-20 04:56:52
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Include/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv18665/Include/SimData Modified Files: Tag: simdata DataArchive.h Enum.h HashUtility.h hash_map.h Log Message: wide range of small fixes Index: DataArchive.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Attic/DataArchive.h,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** DataArchive.h 20 Jan 2003 04:29:38 -0000 1.1.2.2 --- DataArchive.h 20 Jan 2003 04:56:49 -0000 1.1.2.3 *************** *** 70,75 **** hasht pathhash; hasht classhash; ! int32 offset; ! int32 length; }; --- 70,75 ---- hasht pathhash; hasht classhash; ! gint32 offset; ! gint32 length; }; Index: Enum.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Attic/Enum.h,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** Enum.h 20 Jan 2003 04:29:38 -0000 1.1.2.2 --- Enum.h 20 Jan 2003 04:56:49 -0000 1.1.2.3 *************** *** 30,33 **** --- 30,35 ---- #include <string> #include <vector> + #include <cstdio> + #include <iostream> #include <SimData/hash_map.h> #include <SimData/BaseType.h> *************** *** 66,75 **** struct hashstring { ! static hash<const char*> h; int operator()(const std::string &s) const { return h(s.c_str()); } }; ! hash<const char*> hashstring::h; } // namespace --- 68,78 ---- struct hashstring { ! static std::hash<const char*> h; int operator()(const std::string &s) const { return h(s.c_str()); } }; ! ! std::hash<const char*> hashstring::h; } // namespace *************** *** 88,92 **** EnumError(const std::string s=""): _msg(s), _armed(1) {} void disarm() { _armed = 0; } ! ~EnumError() { if (_armed) cerr << _msg << endl; } const std::string& getError() { return _msg; } }; --- 91,95 ---- EnumError(const std::string s=""): _msg(s), _armed(1) {} void disarm() { _armed = 0; } ! ~EnumError() { if (_armed) std::cerr << _msg << std::endl; } const std::string& getError() { return _msg; } }; Index: HashUtility.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Attic/HashUtility.h,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** HashUtility.h 20 Jan 2003 04:14:42 -0000 1.1.2.2 --- HashUtility.h 20 Jan 2003 04:56:49 -0000 1.1.2.3 *************** *** 33,44 **** #include <SimData/ns-simdata.h> ! typedef int int32; ! typedef char* cstring; //typedef hash<const char*> hashstr; - typedef guint32 u4; /* unsigned 4-byte type */ - typedef guint8 u1; /* unsigned 1-byte type */ - typedef guint64 u8; /* unsigned 8-byte type */ #define hashstr4 newhash4_cstring --- 33,41 ---- #include <SimData/ns-simdata.h> ! //typedef int int32; ! //typedef char* cstring; //typedef hash<const char*> hashstr; #define hashstr4 newhash4_cstring *************** *** 52,65 **** #define hasht_eq equ8 ! typedef u8 hasht; NAMESPACE_SIMDATA ! typedef u8 hasht; extern u4 newhash4_cstring(const char*); extern u8 newhash8_cstring(const char*); - namespace { struct eqstr { --- 49,64 ---- #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 ! typedef u8 hasht; extern u4 newhash4_cstring(const char*); extern u8 newhash8_cstring(const char*); struct eqstr { *************** *** 93,97 **** }; - } // anonymous namespace typedef std::hash_map<hasht, int, hasht_hash, hasht_eq> hasht_map; --- 92,95 ---- Index: hash_map.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Attic/hash_map.h,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** hash_map.h 20 Jan 2003 04:36:58 -0000 1.1.2.2 --- hash_map.h 20 Jan 2003 04:56:49 -0000 1.1.2.3 *************** *** 1,5 **** #ifdef __GNUC__ #if __GNUC__ == 3 ! #include <backward/hash_map.h> #else #include <hash_map> --- 1,5 ---- #ifdef __GNUC__ #if __GNUC__ == 3 ! #include <ext/hash_map> #else #include <hash_map> |
From: <mk...@us...> - 2003-01-20 04:37:01
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Source In directory sc8-pr-cvs1:/tmp/cvs-serv13051/Source Modified Files: Tag: simdata Matrix3.cpp Quaternion.cpp Log Message: M_PI defined now as G_PI, fixed hash_map path again for win32 Index: Matrix3.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Attic/Matrix3.cpp,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** Matrix3.cpp 19 Jan 2003 20:31:41 -0000 1.1.2.1 --- Matrix3.cpp 20 Jan 2003 04:36:58 -0000 1.1.2.2 *************** *** 31,35 **** #include <cmath> ! #define HALF_PI (M_PI*0.5) #include <SimData/Matrix3.h> --- 31,35 ---- #include <cmath> ! #define HALF_PI (G_PI*0.5) #include <SimData/Matrix3.h> *************** *** 389,393 **** if ( rfRadians > 0.0 ) { ! if ( rfRadians < M_PI ) { rkAxis.x = rowcol[2][1]-rowcol[1][2]; rkAxis.y = rowcol[0][2]-rowcol[2][0]; --- 389,393 ---- if ( rfRadians > 0.0 ) { ! if ( rfRadians < G_PI ) { rkAxis.x = rowcol[2][1]-rowcol[1][2]; rkAxis.y = rowcol[0][2]-rowcol[2][0]; Index: Quaternion.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Attic/Quaternion.cpp,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** Quaternion.cpp 19 Jan 2003 20:31:41 -0000 1.1.2.1 --- Quaternion.cpp 20 Jan 2003 04:36:58 -0000 1.1.2.2 *************** *** 443,447 **** double fSin = sin(fAngle); ! double fPhase = M_PI*iExtraSpins*fT; double fInvSin = 1.0f/fSin; double fCoeff0 = sin((1.0f-fT)*fAngle - fPhase)*fInvSin; --- 443,447 ---- double fSin = sin(fAngle); ! double fPhase = G_PI*iExtraSpins*fT; double fInvSin = 1.0f/fSin; double fCoeff0 = sin((1.0f-fT)*fAngle - fPhase)*fInvSin; *************** *** 539,543 **** u.x = RadiansToDegrees(0.0f); //roll ! u.y = RadiansToDegrees((double) (-(M_PI/2) * r31/tmp)); // pitch u.z = RadiansToDegrees((double) atan2(-r12, -r31*r13)); // yaw return u; --- 539,543 ---- u.x = RadiansToDegrees(0.0f); //roll ! u.y = RadiansToDegrees((double) (-(G_PI/2) * r31/tmp)); // pitch u.z = RadiansToDegrees((double) atan2(-r12, -r31*r13)); // yaw return u; |
From: <mk...@us...> - 2003-01-20 04:37:01
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Include/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv13051/Include/SimData Modified Files: Tag: simdata GlibCsp.h Math.h hash_map.h Log Message: M_PI defined now as G_PI, fixed hash_map path again for win32 Index: GlibCsp.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Attic/GlibCsp.h,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** GlibCsp.h 20 Jan 2003 04:29:38 -0000 1.1.2.3 --- GlibCsp.h 20 Jan 2003 04:36:58 -0000 1.1.2.4 *************** *** 37,40 **** --- 37,41 ---- #define __GLIB_CSP_H__ + #define G_PI 3.14159265358979323846 /* pi */ // this needs to be generated by the configure script: Index: Math.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Attic/Math.h,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** Math.h 19 Jan 2003 20:28:30 -0000 1.1.2.1 --- Math.h 20 Jan 2003 04:36:58 -0000 1.1.2.2 *************** *** 25,28 **** --- 25,29 ---- #include <cmath> #include <SimData/ns-simdata.h> + #include <SimData/GlibCsp.h> *************** *** 34,43 **** inline double DegreesToRadians(double deg) { ! return deg * M_PI / 180.0f; } inline double RadiansToDegrees(double rad) { ! return rad * 180.0f / M_PI; } --- 35,44 ---- inline double DegreesToRadians(double deg) { ! return deg * G_PI / 180.0f; } inline double RadiansToDegrees(double rad) { ! return rad * 180.0f / G_PI; } Index: hash_map.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Attic/hash_map.h,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** hash_map.h 20 Jan 2003 04:14:42 -0000 1.1.2.1 --- hash_map.h 20 Jan 2003 04:36:58 -0000 1.1.2.2 *************** *** 7,11 **** #else #ifdef WIN32 ! #include <backward/hash_map.h> #else #error "PLEASE PROVIDE CORRECT #INCLUDE<HASH_MAP> STATEMENT FOR YOUR PLATFORM!" --- 7,11 ---- #else #ifdef WIN32 ! #include <hash_map.h> #else #error "PLEASE PROVIDE CORRECT #INCLUDE<HASH_MAP> STATEMENT FOR YOUR PLATFORM!" |
From: <mk...@us...> - 2003-01-20 04:30:51
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Source In directory sc8-pr-cvs1:/tmp/cvs-serv10736 Added Files: Tag: simdata cSimData.py Log Message: you should regenerate this with swig... just for testing purposes. --- NEW FILE: cSimData.py --- # This file was created automatically by SWIG. # Don't modify this file, modify the SWIG interface instead. # This file is compatible with both classic and new-style classes. import _cSimData def _swig_setattr(self,class_type,name,value): if (name == "this"): if isinstance(value, class_type): self.__dict__[name] = value.this if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown del value.thisown return method = class_type.__swig_setmethods__.get(name,None) if method: return method(self,value) self.__dict__[name] = value def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name [...1865 lines suppressed...] def __del__(self, destroy= _cSimData.delete_InterfaceRegistry): try: if self.thisown: destroy(self) except: pass def getInterface(*args): return apply(_cSimData.InterfaceRegistry_getInterface,args) def hasInterface(*args): return apply(_cSimData.InterfaceRegistry_hasInterface,args) def getInterfaceNames(*args): return apply(_cSimData.InterfaceRegistry_getInterfaceNames,args) def getInterfaces(*args): return apply(_cSimData.InterfaceRegistry_getInterfaces,args) def addInterface(*args): return apply(_cSimData.InterfaceRegistry_addInterface,args) def __repr__(self): return "<C InterfaceRegistry instance at %s>" % (self.this,) class InterfaceRegistryPtr(InterfaceRegistry): def __init__(self,this): self.this = this if not hasattr(self,"thisown"): self.thisown = 0 self.__class__ = InterfaceRegistry _cSimData.InterfaceRegistry_swigregister(InterfaceRegistryPtr) |
From: <mk...@us...> - 2003-01-20 04:29:41
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Source In directory sc8-pr-cvs1:/tmp/cvs-serv9831/Source Modified Files: Tag: simdata DataArchive.cpp Log Message: more hash_map and endian (temp) fix for win32 Index: DataArchive.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Attic/DataArchive.cpp,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** DataArchive.cpp 19 Jan 2003 20:31:41 -0000 1.1.2.1 --- DataArchive.cpp 20 Jan 2003 04:29:38 -0000 1.1.2.2 *************** *** 21,24 **** --- 21,25 ---- #include <SimData/DataArchive.h> #include <SimData/InterfaceRegistry.h> + #include <SimData/GlibCsp.h> *************** *** 54,58 **** void DataArchive::writeMagic() { ! fprintf(f, "RAWDAT-%c", (BYTE_ORDER == LITTLE_ENDIAN) ? 'L' : 'B'); } --- 55,59 ---- void DataArchive::writeMagic() { ! fprintf(f, "RAWDAT-%c", (G_BYTE_ORDER == G_LITTLE_ENDIAN) ? 'L' : 'B'); } *************** *** 67,71 **** } bool data_little = (magic[7] == 'L'); ! bool machine_little = (BYTE_ORDER == LITTLE_ENDIAN); if (data_little != machine_little) { char msg[128]; --- 68,72 ---- } bool data_little = (magic[7] == 'L'); ! bool machine_little = (G_BYTE_ORDER == G_LITTLE_ENDIAN); if (data_little != machine_little) { char msg[128]; |
From: <mk...@us...> - 2003-01-20 04:29:41
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Include/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv9831/Include/SimData Modified Files: Tag: simdata DataArchive.h Enum.h GlibCsp.h Log Message: more hash_map and endian (temp) fix for win32 Index: DataArchive.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Attic/DataArchive.h,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** DataArchive.h 19 Jan 2003 20:28:29 -0000 1.1.2.1 --- DataArchive.h 20 Jan 2003 04:29:38 -0000 1.1.2.2 *************** *** 30,35 **** #include <stdio.h> #include <stdlib.h> - #include <endian.h> - #include <hash_map.h> #include <SimData/Object.h> #include <SimData/Path.h> --- 30,33 ---- Index: Enum.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Attic/Enum.h,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** Enum.h 19 Jan 2003 20:28:30 -0000 1.1.2.1 --- Enum.h 20 Jan 2003 04:29:38 -0000 1.1.2.2 *************** *** 30,34 **** #include <string> #include <vector> ! #include <hash_map.h> #include <SimData/BaseType.h> --- 30,34 ---- #include <string> #include <vector> ! #include <SimData/hash_map.h> #include <SimData/BaseType.h> *************** *** 75,79 **** } // namespace ! typedef hash_map<const std::string, int, hashstring, eqstring> string_map; --- 75,79 ---- } // namespace ! typedef std::hash_map<const std::string, int, hashstring, eqstring> string_map; Index: GlibCsp.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Attic/GlibCsp.h,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** GlibCsp.h 20 Jan 2003 04:10:47 -0000 1.1.2.2 --- GlibCsp.h 20 Jan 2003 04:29:38 -0000 1.1.2.3 *************** *** 177,180 **** --- 177,187 ---- #define G_PDP_ENDIAN 3412 /* unused, need specific PDP check */ + /* FIXME */ + #ifdef NATIVE_WIN32 + #define G_BYTE_ORDER G_LITTLE_ENDIAN + #else + #define G_BYTE_ORDER G_LITTLE_ENDIAN + #endif + /* Basic bit swapping functions |
From: <mk...@us...> - 2003-01-20 04:29:40
|
Update of /cvsroot/csp/APPLICATIONS/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv9831 Modified Files: Tag: simdata Makefile Log Message: more hash_map and endian (temp) fix for win32 Index: Makefile =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Attic/Makefile,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** Makefile 19 Jan 2003 20:25:44 -0000 1.1.2.1 --- Makefile 20 Jan 2003 04:29:38 -0000 1.1.2.2 *************** *** 5,9 **** export GLDOPTS = -shared -lswigpy -ldl export GSWOPTS = -c -c++ -python -DUSE_NAMESPACE_SIMDATA -noexcept ! export CXX = g++ export SWIG = swig --- 5,9 ---- export GLDOPTS = -shared -lswigpy -ldl export GSWOPTS = -c -c++ -python -DUSE_NAMESPACE_SIMDATA -noexcept ! export CXX = g++-3.0 export SWIG = swig |
From: <mk...@us...> - 2003-01-20 04:14:45
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Include/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv4815 Modified Files: Tag: simdata HashUtility.h ObjectInterface.h Added Files: Tag: simdata hash_map.h Log Message: hash_map.h win32 fix --- NEW FILE: hash_map.h --- #ifdef __GNUC__ #if __GNUC__ == 3 #include <backward/hash_map.h> #else #include <hash_map> #endif #else #ifdef WIN32 #include <backward/hash_map.h> #else #error "PLEASE PROVIDE CORRECT #INCLUDE<HASH_MAP> STATEMENT FOR YOUR PLATFORM!" #endif #endif Index: HashUtility.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Attic/HashUtility.h,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** HashUtility.h 19 Jan 2003 20:28:30 -0000 1.1.2.1 --- HashUtility.h 20 Jan 2003 04:14:42 -0000 1.1.2.2 *************** *** 29,33 **** #define __HASHUTILITY_H__ ! #include <hash_map.h> #include <SimData/GlibCsp.h> #include <SimData/ns-simdata.h> --- 29,33 ---- #define __HASHUTILITY_H__ ! #include <SimData/hash_map.h> #include <SimData/GlibCsp.h> #include <SimData/ns-simdata.h> *************** *** 95,105 **** } // anonymous namespace ! typedef hash_map<hasht, int, hasht_hash, hasht_eq> hasht_map; class Object; class ObjectProxyBase; ! typedef hash_map<hasht, Object*, hasht_hash, hasht_eq> cache_map; ! typedef hash_map<hasht, ObjectProxyBase*, hasht_hash, hasht_eq> proxy_map; --- 95,105 ---- } // anonymous namespace ! typedef std::hash_map<hasht, int, hasht_hash, hasht_eq> hasht_map; class Object; class ObjectProxyBase; ! typedef std::hash_map<hasht, Object*, hasht_hash, hasht_eq> cache_map; ! typedef std::hash_map<hasht, ObjectProxyBase*, hasht_hash, hasht_eq> proxy_map; Index: ObjectInterface.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Attic/ObjectInterface.h,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** ObjectInterface.h 19 Jan 2003 20:28:30 -0000 1.1.2.1 --- ObjectInterface.h 20 Jan 2003 04:14:42 -0000 1.1.2.2 *************** *** 32,45 **** #include <vector> ! #ifdef __GNUC__ ! #if __GNUC__ == 3 ! #include <backward/hash_map.h> ! #else ! #include <hash_map> ! #endif ! #else ! #error "PLEASE PROVIDE CORRECT #INCLUDE<HASH_MAP> STATEMENT FOR YOUR PLATFORM!" ! #endif ! #include <SimData/TypeAdapter.h> #include <SimData/ns-simdata.h> --- 32,36 ---- #include <vector> ! #include <SimData/hash_map.h> #include <SimData/TypeAdapter.h> #include <SimData/ns-simdata.h> |
From: <mk...@us...> - 2003-01-20 04:10:50
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Include/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv3376 Modified Files: Tag: simdata GlibCsp.h Log Message: win32 fixes for long long and snprintf Index: GlibCsp.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Attic/GlibCsp.h,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** GlibCsp.h 19 Jan 2003 20:28:30 -0000 1.1.2.1 --- GlibCsp.h 20 Jan 2003 04:10:47 -0000 1.1.2.2 *************** *** 55,72 **** #define G_HAVE_GINT64 1 G_GNUC_EXTENSION typedef signed long long gint64; G_GNUC_EXTENSION typedef unsigned long long guint64; ! ! ! ! // ! ! ! ! #ifdef WIN32 #define NATIVE_WIN32 ! #endif // WIN32 #ifdef NATIVE_WIN32 --- 55,73 ---- #define G_HAVE_GINT64 1 + #ifdef WIN32 + typedef __int64 gint64; + typedef unsigned __int64 guint64; + #else // WIN32 G_GNUC_EXTENSION typedef signed long long gint64; G_GNUC_EXTENSION typedef unsigned long long guint64; ! #endif #ifdef WIN32 #define NATIVE_WIN32 ! #endif ! ! #ifdef NATIVE_WIN32 ! #define snprintf _snprintf ! #endif #ifdef NATIVE_WIN32 |
From: <mk...@us...> - 2003-01-20 04:06:56
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Source In directory sc8-pr-cvs1:/tmp/cvs-serv2094 Modified Files: Tag: simdata Date.cpp Log Message: fix for windows timing routines Index: Date.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Attic/Date.cpp,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** Date.cpp 19 Jan 2003 20:31:41 -0000 1.1.2.1 --- Date.cpp 20 Jan 2003 04:06:53 -0000 1.1.2.2 *************** *** 30,33 **** --- 30,34 ---- #ifdef _WIN32 + #include <Windows.h> static LARGE_INTEGER _tstart, _tend; static LARGE_INTEGER freq; *************** *** 57,67 **** static double scale; static int first = 1; double now; if (first) { ! QueryPerformanceFrequency(&scale); first = 0; ! scale = 1.0 / scale; } ! QueryPerformanceCounter(&now); return (timing_t) (now * scale); } --- 58,70 ---- 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); } |
From: <mk...@us...> - 2003-01-19 20:35:29
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Include/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv2097 Added Files: Tag: simdata Vector3.inl Log Message: initial --- NEW FILE: Vector3.inl --- // 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 Vector3.inl * * Initial CSP version by Wolverine69 * Code based on libraries from magic-software.com and Game Programming Gems. **/ #ifndef __VECTOR3_INL__ #define __VECTOR3_INL__ //namespace Math //{ //////////////////////////////////////////////////////// // Vector3 //////////////////////////////////////////////////////// /** * Vector3() * Default constructor */ inline Vector3::Vector3() { // don't initialize } /** * Vector3(double x, double y, double z) * Constructor from doubles */ inline Vector3::Vector3(double _x, double _y, double _z) { x = _x; y = _y; z = _z; } /** * Vector3(Vector3 &v) * Copy constructor */ inline Vector3::Vector3(const Vector3 &v) { x = v.x; y = v.y; z = v.z; } /** * Array Indexing */ inline double & Vector3::operator[] (int i) { return ((double*)&x)[i]; } inline const double & Vector3::operator[] (int i) const { return ((double*)&x)[i]; } inline Vector3::operator double * () { return (double *)&x; } /* Arithmatic assignment operators */ /** * Set this vector equal to another one. */ inline Vector3 & Vector3::operator=(const Vector3 &v) { x = v.x; y = v.y; z = v.z; return *this; } /** * Add another vector to this one. */ inline Vector3 & Vector3::operator+=(const Vector3 & v) { x += v.x; y += v.y; z += v.z; return *this; } /** * Subtract another vector from this one. */ inline Vector3 & Vector3::operator-=(const Vector3 & v) { x -= v.x; y -= v.y; z -= v.z; return *this; } /** * Multiply this vector by a double */ inline Vector3 & Vector3::operator*=(double f) { x *= f; y *= f; z *= f; return *this; } /** * Equality operator */ inline bool operator==(const Vector3 &a, const Vector3 &b) { return ((a.x == b.x) && (a.y == b.y) && (a.z == b.z)); } /** * Inequality operator */ inline bool operator!=(const Vector3 &a, const Vector3 &b) { return ((a.x != b.x) || (a.y != b.y) || (a.z != b.z)); } /** * Negation operator */ inline Vector3 Vector3::operator-() const { return Vector3(-x,-y,-z); } /** * Add two vectors */ //inline Vector3 operator+(const Vector3 &a, const Vector3 &b) //{ // return Vector3(a.x+b.x, a.y+b.y, a.z+b.z); //} /** * Subtract one vector from another. */ inline Vector3 Vector3::operator-(const Vector3 &b) const { Vector3 aVector3 = *this; aVector3 -= b; return aVector3; } /** * Multiply a scalar by a vector. */ inline Vector3 operator*(double f, const Vector3 &a) { return Vector3(f*a.x, f*a.y, f*a.z); } inline Vector3 operator*(double f, Vector3 &a) { return Vector3(f*a.x, f*a.y, f*a.z); } /** * Set the values of the vector */ inline void Vector3::Set(double _x, double _y, double _z) { x = _x; y = _y; z = _z; } /** * Calculate the length of the Vector3 */ inline double Vector3::Length() const // Checked (delta) { return (double)(sqrt(x*x + y*y + z*z)); } /** * Calculate the length of the vector squared. * * This routine is faster then the normal length * one because the sqrt does not need to be calculated. */ inline double Vector3::LengthSquared() const { return (x*x+y*y+z*z); } /** * Determine if all the components of the vector are zero. */ inline bool Vector3::IsNull() { return ((x == 0.0f) && (y == 0.0f) && (z == 0.0f)); } /** * Compute the dot product of two Vector3's */ inline double Dot (const Vector3& aVector, const Vector3& bVector) { return aVector.x*bVector.x + aVector.y*bVector.y + aVector.z*bVector.z; } /** * Compute the cross product of two vectors */ inline Vector3 Cross (const Vector3& aVector, const Vector3& bVector) { return Vector3( aVector.y*bVector.z-aVector.z*bVector.y, aVector.z*bVector.x-aVector.x*bVector.z, aVector.x*bVector.y-aVector.y*bVector.x); } /** * Return a normalized vector of the input vector. */ inline Vector3 Normalized(const Vector3 &a) { Vector3 ret(a); return ret.Normalize(); } /** * Vector cross product (u cross v) */ inline Vector3 operator^(const Vector3 & u, const Vector3 & v) { return Vector3( u.y*v.z - u.z*v.y, -u.x*v.z + u.z*v.x, u.x*v.y - u.y*v.x ); } //} // namespace Math #endif // __VECTOR3_INL__ |
From: <mk...@us...> - 2003-01-19 20:33:22
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Tools/DataCompiler In directory sc8-pr-cvs1:/tmp/cvs-serv1314 Added Files: Tag: simdata Compile.py Parse.py Debug.py make_simdar Log Message: initial --- NEW FILE: Compile.py --- #!/usr/bin/python # 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. import sys if __name__ == "__main__": sys.path.append("../../Source"); try: import SimData except: print "Unable to find the SimData python module. This file" print "should be located in ../../Source. Make sure you" print "have compiled SimData before using this program. See" print "the README file in the main SimData directory for" print "more information or ask for help on the forums at" print "http://csp.sourcforge.net/forum" sys.exit(1) original_path = sys.path[:] new_path = "" try: f = open(".csp_path", "rt"); path = f.readline().strip() sys.path.append(path) except: pass while 1: try: import CSP break except: print print "Unable to find the CSP python module. Assuming you" print "have compiled a recent version of CSPSim, please" print "provide a path (relative or absolute) to the CSP.py" print "module. This file is usually located in the Source" print "directory of CSPSim." print "==> ", new_path = sys.stdin.readline().strip() print if not new_path: sys.exit(1) sys.path = original_path[:] sys.path.append(new_path) #"../../../CSPFlightSim/Source"); if new_path: f = open(".csp_path", "wt") print >>f, new_path from Parse import ObjectXMLArchive, XMLSyntax from SimData import DataArchive, hash_string from Debug import * import os.path, time class Compiler: def compileAll(self): print print "Compiling '%s' from '%s'" % (self.outfile, self.infile) print "Opening output archive" compiled = DataArchive(self.outfile, 0) print "Opening input archive" master = ObjectXMLArchive(self.infile); print "Loading all objects" resetWarnings() all = master.loadAll() warnings, level = getWarnings() print "XML parse completed." if warnings > 0: print "%d warnings (severity=%d)." % (warnings, level) if level > 0: print "Please fix these warnings and recompile." print "Compiled data archive NOT written!" sys.exit(1) paths = master.getPaths() print "Compiling all objects" for id in all.keys(): object = all[id] DEBUG(2, "Compiling object '%s' [%d] %s" % (id, hash_string(id), str(object))) compiled.addObject(object, id) self.dumpBadPaths(all, paths) def dumpBadPaths(self, all, paths): if getWarningLevel() < 1: return badpaths = filter(lambda x, a=all: not a.has_key(x), paths.keys()) if len(badpaths) > 0 and getWarningLevel() >= 1: print print "Found %d broken path(s):" % len(badpaths) idx = 0 for path in badpaths: idx = idx + 1 print "%03d: Path '%s'" % (idx, path) objects = {} for obj in paths[path]: objects[obj] = 1 print " : defined in '" + "'\n defined in '".join(objects.keys()) + "'" print def usage(self, msg=None): print if msg is not None: print "Usage error:", msg print "SimData XML Compiler" print self._name, "[--warn=level] [--debug=level] sourcepath output" sys.exit(1) def parse(self, args): args = args[1:] for arg in args: if arg.startswith('--'): try: if arg.startswith('--warn='): setWarningLevel(int(arg[7:])) elif arg.startswith('--debug='): setDebugLevel(int(arg[8:])) else: self.usage("unknown option '%s'" % arg) except: self.usage("invalid option '%s'" % arg) else: if self.infile is None: self.infile = arg elif self.outfile is None: self.outfile = arg else: self.usage("invalid argument '%s'" % arg) if self.infile is None or self.outfile is None: self.usage() def __init__(self, args): setWarningLevel(1) self.infile = None self.outfile = None self._name = args[0] self.parse(args) self.compileAll() if __name__ == "__main__": import profile profile.run('Compiler(sys.argv)', 'profile.out') --- NEW FILE: Parse.py --- #!/usr/bin/python # 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. import sys, types import SimData from xml.sax import ContentHandler, ErrorHandler, make_parser import xml.sax from gzip import GzipFile from zipfile import ZipFile import random import re import os.path from traceback import print_exception from Debug import * g_InterfaceRegistry = SimData.g_InterfaceRegistry class XMLSyntax(StandardError): def __init__(self, *args): print "XMLSyntax:", args self.args = args class CompilerErrorHandler(ErrorHandler): def __init__(self, path, id): self._path = path self._id = id def fatalError(self, error): print "FATAL ERROR parsing XML input." locator = error._locator if locator is not None: line = error._locator.getLineNumber() column = error._locator.getColumnNumber() place = "[%d:%d]" % (line, column) else: place = "" print "File %s%s - %s" % (self._path, place, ", ".join(error.args)) sys.exit(1) def path_to_id(path): if path.endswith('.gz'): path = path[:-3] if path.endswith('.xml'): path = path[:-4] parts = [] while 1: (path, tail) = os.path.split(path) if tail != "": parts.insert(0, tail) else: break; return '.'.join(parts) def id_to_path(id): return apply(os.path.join, id.split('.')) class ElementHandler(ContentHandler): def __init__(self, id, base, name, attrs): #print id, base, name self._handler = None self._handler_tag = None self._element = None self._id = id self._base = base self._name = name self._attrs = attrs self._paths = [] self._externals = [] def getElement(self): return self._element def characters(self, c): if self._handler is not None: self._handler.characters(c) else: self.cdata(c) def cdata(self, c): pass def endChild(self): self._element = self._handler.getElement() def handleChild(self, name, attrs): return None def end(self): pass def endElement(self, name): if self._handler is not None: done = self._handler.endElement(name) if done: self.endChild() self._externals.extend(self._handler._externals) self._paths.extend(self._handler._paths) self._handler = None self._handler_tag = None return 0 self.end() return 1 def validateChild(self, name, attrs): return 1 def startElement(self, name, attrs): if self._handler is None: if not self.validateChild(name, attrs): raise XMLSyntax, "Invalid child element <%s> in <%s>" % (name, self._name) handler = self.handleChild(name, attrs) if handler is None: handler_name = name+"Handler" try: handler = eval(handler_name) except: msg = "Unknown child element <%s>" % name raise XMLSyntax, msg self._handler = handler(self._id, self._base, name, attrs) self._handler_tag = name self._attrs = attrs else: self._handler.startElement(name, attrs) def assign(self, interface, obj, name): interface.set(obj, name, self.getElement()) #_element) def getObjectAttribute(self, obj, name, type_): attr = getattr(obj, name, None) if attr is None: if isinstance(obj, SimData.Object): if isinstance(type_, types.ClassType): attr = type_() else: attr = type_ setattr(obj, name, attr) else: msg = "Unknown attribute '%s' in object %s" % (name, str(obj)) raise XMLSyntax, msg return attr class SimpleHandler(ElementHandler): def __init__(self, id, base, name, attrs): ElementHandler.__init__(self, id, base, name, attrs) self._c = "" def validateChild(self, name, attrs): return 0 def cdata(self, c): self._c = self._c + c class ListHandler(SimpleHandler): def __init__(self, id, base, name, attrs): SimpleHandler.__init__(self, id, base, name, attrs) self._type = attrs.get("type", None) self._element = [] def endChild(self): self._element.append(self._handler.getElement()) def validateChild(self, name, attrs): if self._type is not None: return 0 return name in ('List', 'Enum', 'Path', 'Int', 'Bool', 'Number', 'Float', 'String', 'Date', 'Vector', 'Matrix', 'External', 'Object') def end(self): if self._type is not None: list = self._c.split() if self._type == "int": f = int elif self._type == "float": f = float elif self._type == "number": def spread(x): y = SimData.Spread() y.parseXML(x) return y f = spread elif self._type == "path": def path(x): y = SimData.Path() y.setPath(x) return y f = path self._paths.extend(list) elif self._type == "external": def external(x): y = SimData.External() y.setSource(x) return y f = external self._externals.extend(list) else: msg = "Unknown LIST type (%s)" % self._type raise XMLSyntax, msg self._element = map(f, map(str, list)) def assign(self, interface, obj, name): interface.clear(obj, name) for item in self._element: interface.push_back(obj, name, item) # if isinstance(items[0], SimData.Path): # for item in items: # if is_python: ##path = PyPathPointer() # path = SimData.PathPointer() # path.setPath(item.getPath()) # list.append(path) # else: # list.extend().setPath(item.getPath()) # else: # list.extend(items) class FloatListHandler(ListHandler): def __init__(self, id, base, name, attrs): ListHandler.__init__(self, id, base, name, attrs) self._type = "float" class IntHandler(SimpleHandler): def __init__(self, id, base, name, attrs): SimpleHandler.__init__(self, id, base, name, attrs) def end(self): self._element = int(self._c) class BoolHandler(SimpleHandler): def __init__(self, id, base, name, attrs): SimpleHandler.__init__(self, id, base, name, attrs) def end(self): value = self._c.encode('ascii').strip() if value.upper() == "TRUE": self._element = 1 elif value.upper() == "FALSE": self._element = 0 else: self._element = int(value) class FloatHandler(SimpleHandler): def __init__(self, id, base, name, attrs): SimpleHandler.__init__(self, id, base, name, attrs) def end(self): self._element = float(self._c) class RealHandler(SimpleHandler): def __init__(self, id, base, name, attrs): SimpleHandler.__init__(self, id, base, name, attrs) def end(self): self._element = float(self._c) class NumberHandler(SimpleHandler): def __init__(self, id, base, name, attrs): SimpleHandler.__init__(self, id, base, name, attrs) def end(self): self._element = SimData.Spread() self._element.parseXML(self._c) class VectorHandler(SimpleHandler): def __init__(self, id, base, name, attrs): SimpleHandler.__init__(self, id, base, name, attrs) def end(self): self._element = SimData.Vector3() self._element.parseXML(self._c) class MatrixHandler(SimpleHandler): def __init__(self, id, base, name, attrs): SimpleHandler.__init__(self, id, base, name, attrs) def end(self): self._element = SimData.Matrix3() self._element.parseXML(self._c) class DateHandler(SimpleHandler): def __init__(self, id, base, name, attrs): SimpleHandler.__init__(self, id, base, name, attrs) def end(self): self._element = SimData.SimDate() self._element.parseXML(self._c) class StringHandler(SimpleHandler): def __init__(self, id, base, name, attrs): SimpleHandler.__init__(self, id, base, name, attrs) def end(self): self._element = self._c.encode('ascii') # only needed for bug fix... remove once swig is patched # swig doesn't apply typemaps to member varibale accessors # correctly so we can't set std::string variable directly. # instead we filter our strings through a special class to # convert them to wrapped c++ std::strings which the set # method that swig generates will accept. yuck! def assign(self, interface, obj, name): interface.set(obj, name, str(self._element)) # return # try: # setattr(obj, name, self._element) # except: # fix = SimData.swig_string_bug_workaround(str(self._element)) # element = fix.get_as_swig_wrapped_pointer # setattr(obj, name, element) class EnumHandler(SimpleHandler): def __init__(self, id, base, name, attrs): SimpleHandler.__init__(self, id, base, name, attrs) def end(self): self._element = self._c def assign(self, interface, object, name): value = self._element.encode('ascii') interface.set_enum(object, name, value) # # FIXME this will break if the enum attribute doesn't exist in an Object, # # since it will not be linked to an enumeration # ext = self.getObjectAttribute(obj, name, None) # if ext is None: # raise XMLSyntax, "Object enumeration member undefined (no Enumeration class)" # ext.parseXML(self._c) class PathHandler(SimpleHandler): def __init__(self, id, base, name, attrs): SimpleHandler.__init__(self, id, base, name, attrs) def getElement(self): p = SimData.PathPointer() p.setPath(self._element.encode('ascii')) return p def end(self): if self._attrs.has_key("source"): source = self._attrs["source"] else: source = self._c.strip() if not source.startswith("."): source = self._base + "." + source else: source = source[1:] self._element = source self._paths.append(source) def assign(self, interface, obj, name): interface.set(obj, name, self.getElement()) # ext = self.getObjectAttribute(obj, name, SimData.PathPointer) # #ext = self.getObjectAttribute(obj, name, SimData.PyPathPointer) # if isinstance(ext, types.StringType): # msg = "Path member '%s' of %s does not appear to be properly wrapped.\n" % (name, str(obj.__class__)) # msg = msg + \ # "You may have forgotten to add 'new_pointer(classname)' in the SWIG interface file\n" + \ # "associated with this class." # raise str(msg) # ext.setPath(self._element.encode('ascii')) class ExternalHandler(SimpleHandler): def __init__(self, id, base, name, attrs): SimpleHandler.__init__(self, id, base, name, attrs) def end(self): if self._attrs.has_key("source"): source = self._attrs["source"] else: source = self._c.strip() source = apply(os.path.join, source.split("/")) self._element = source self._externals.append(source) def assign(self, interface, obj, name): ext = SimData.External() ext.setSource(self._element) interface.set(obj, name, ext) # ext = self.getObjectAttribute(obj, name, SimData.External()) # ext.setSource(self._element) class CurveHandler(SimpleHandler): handlers = { "Breaks" : FloatListHandler, "Values" : FloatListHandler, # "Method" : EnumHandler, } members = handlers.keys() required_members = members def __init__(self, id, base, name, attrs): SimpleHandler.__init__(self, id, base, name, attrs) for member in CurveHandler.members: setattr(self, "_"+member, None) def handleChild(self, name, attrs): return CurveHandler.handlers[name] def validateChild(self, name, attrs): return name in CurveHandler.members def endChild(self): child = self._handler.getElement() attrs = self._handler._attrs member = "_" + self._handler_tag setattr(self, member, (child, attrs)) def getElement(self): for member in CurveHandler.required_members: if getattr(self, "_"+member) is None: msg = "CurveHander required tag '%s' missing" % member raise XMLSyntax, msg curve = SimData.Curve() breaks, attrs = self._Breaks curve.setBreaks(breaks) if not attrs.has_key("spacing"): msg = "CurveHander <Breaks> tag missing required attribute 'spacing'" raise XMLSyntax, msg spacing = float(attrs['spacing']) #method, attrs = self._Method #curve.method.parseXML(method) values, attrs = self._Values curve.setData(values) curve.interpolate(spacing) return curve class TableHandler(SimpleHandler): handlers = { "XBreaks" : FloatListHandler, "YBreaks" : FloatListHandler, "Values" : FloatListHandler, # "Method" : EnumHandler, } members = handlers.keys() required_members = members def __init__(self, id, base, name, attrs): SimpleHandler.__init__(self, id, base, name, attrs) self._keys = {} #for member in TableHandler.members: # setattr(self, "_"+member, None) def handleChild(self, name, attrs): return TableHandler.handlers[name] def validateChild(self, name, attrs): return name in TableHandler.members def endChild(self): child = self._handler.getElement() attrs = self._handler._attrs #member = "_" + self._handler_tag member = self._handler_tag self._keys[member] = (child, attrs) #setattr(self, member, (child, attrs)) def assign(self, interface, object, name): missing = filter(lambda x, f=self._keys.has_key: not f(x), TableHandler.required_members) assert len(missing)== 0, "TableHandler required tag(s) missing:\n %s" % str(missing) table = SimData.Table() #table = self.getObjectAttribute(object, name, None) #SimData.Table) tags = self._keys xbreaks, attrs = tags["XBreaks"] if not attrs.has_key("spacing"): msg = "CurveHander <XBreaks> tag missing required attribute 'spacing'" raise XMLSyntax, msg xspacing = float(attrs["spacing"]) table.setXBreaks(xbreaks) table.setXSpacing(xspacing) ybreaks, attrs = tags["YBreaks"] if not attrs.has_key("spacing"): msg = "CurveHander <YBreaks> tag missing required attribute 'spacing'" raise XMLSyntax, msg yspacing = float(attrs["spacing"]) table.setYBreaks(ybreaks) table.setYSpacing(yspacing) # method, attrs = tags["Method"] # table.method.parseXML(method) values, attrs = tags["Values"] table.setData(values) table.interpolate() interface.set(object, name, table) 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('.') base = '.'.join(id[:-1]) self._name = id[-1] ElementHandler.__init__(self, self._id, base, None, None) def validateChild(self, name, attrs): return name in ["Object"] class ObjectHandler(ElementHandler): def __init__(self, id, base, name=None, attrs=None): ElementHandler.__init__(self, id, base, name, attrs) self._class = attrs.get("class", None) self._interface = None if self._class is None: raise XMLSyntax, "Object missing class attribute" self._class = str(self._class) if g_InterfaceRegistry.hasInterface(self._class): self._interface = g_InterfaceRegistry.getInterface(self._class) else: msg = "Class '%s' not available" % self._class interface_names = map(lambda x: x.split(":")[0], g_InterfaceRegistry.getInterfaceNames()) interface_names.sort() print "Known classes are:" print " ", "\n ".join(interface_names) raise NameError, msg try: obj = self._interface.createObject() except: print "ERROR Creating class", self._class msg = "ERROR Creating class %s" % self._class raise msg self._object = obj self._assigned = {} self._objectClass = self._object.__class__ self._all_variables = self._interface.getVariableNames() self._req_variables = self._interface.getRequiredNames() static = attrs.get("static", "0").upper() in ("1", "TRUE") self._object.setStatic(static) def endChild(self): name = self._attrs["name"].encode('ascii') self._assigned[name] = 1 self._handler.assign(self._interface, self._object, name) self.checkName(name) def checkName(self, name): if name in self._all_variables: return 0 WARN(1, "Setting unknown member '%s' of class '%s'!" % (name, self._class)) return 1 def end(self): self._element = self._object self.checkAssigned() self._element.convertXML() def checkAssigned(self): if getWarningLevel() < 1: return isAssigned = self._assigned.has_key isUnassigned = lambda x, _a=isAssigned: not _a(x) unassigned = filter(isUnassigned, self._req_variables) if len(unassigned) > 0: msg = "'%s' Object in '%s' has unassigned member(s):\n" % (self._class, self._id) for member in unassigned: msg += " : %s\n" % member WARN(1, msg) def handleChild(self, name, attrs): _handler = None return _handler class ObjectXMLArchive: MASTER = None def __init__(self, path): if ObjectXMLArchive.MASTER is not None: raise "Can only create one ObjectXMLArchive object" ObjectXMLArchive.MASTER = self self._basepath = path self._objects = {} self._paths = {} self._externals = {} 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): if not os.path.exists(path): path = path + '.xml' if not os.path.exists(path): path = path + '.gz' if not os.path.exists(path): raise IOError, "Unable to find data for %s" % id if path.endswith('.gz'): f = GzipFile(path, "rb") else: f = open(path, "rt") data = f.read() fh = FileHandler(id=id) ceh = CompilerErrorHandler(path, id) try: xml.sax.parseString(data, fh, ceh) except RuntimeError: raise except StandardError, e: locator = fh._locator column = locator.getColumnNumber() line = locator.getLineNumber() public = locator.getPublicId() system = locator.getSystemId() print "In source file \"%s\" [line %d, col %d]" % (path, line, column), if public is not None or system is not None: print " - %s, %s" % (public, system) print print "Exception:", e type, value, traceback = sys.exc_info() log = open("error.log", "wt") if log is not None: print >>log, "%s[%d:%d] - %s, %s" % (path, line, column, public, system) print_exception(type, value, traceback, file=open("error.log", "wt")) print "Exception traceback saved to error.log" else: raise sys.exit(1) self.addReferences(id, self._paths, fh._paths) self.addReferences(id, self._externals, fh._externals) return fh.getElement() def addReferences(self, id, dest, src): for ref in src: base = dest.get(ref, []) base.append(id) dest[ref] = base def getPaths(self): return self._paths def getExternals(self): return self._externals def loadAll(self, path = ""): dirpath = os.path.join(self._basepath, path) filenames = os.listdir(dirpath) filenames.sort() for filename in filenames: filepath = os.path.normpath(os.path.join(path, filename)) fullpath = os.path.normpath(os.path.join(self._basepath, filepath)) 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) elif os.path.isdir(fullpath): DEBUG(1, "Entering " + fullpath) self.loadAll(filepath) return self._objects import time def demo(): master = ObjectXMLArchive("../XML"); master.loadAll() pw229 = master.getObject("engines.f100_pw_229") return print "ab_rpm = ", pw229.ab_rpm print "idle table = " for i in range(6): for j in range(6): print "%.5f" % pw229.idle.getPrecise(i*0.2, j*0.2), print print demo_show_members(pw229) def demo_show_members(obj): members = obj.__class__.__dict__["__swig_setmethods__"].keys() for member in members: c = getattr(obj, member).__class__ print "%30s: %s(%s)" % (member, c, str(getattr(obj, member))) for i in obj.thrusts: print i.x, i.y if __name__ == "__main__": import Objects setObjectClasses(Objects) start = time.time() demo() runtime = time.time() - start print print "Runtime =", runtime --- NEW FILE: Debug.py --- # 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. _WarningLevel = 0 _DebugLevel = 0 _MaxWarningLevel = 0 _WarningCount = 0 def DEBUG(level, msg): if level <= _DebugLevel: print "DEBUG:", msg.rstrip() def WARN(level, msg): global _MaxWarningLevel global _WarningCount if level <= _WarningLevel: print "WARNING:", msg.rstrip() _MaxWarningLevel = max(_MaxWarningLevel, level) _WarningCount = _WarningCount + 1 def setWarningLevel(n): global _WarningLevel _WarningLevel = n def setDebugLevel(n): global _DebugLevel _DebugLevel = n def getDebugLevel(): return _DebugLevel def getWarningLevel(): return _WarningLevel def getWarnings(): return _WarningCount, _MaxWarningLevel def resetWarnings(): global _MaxWarningLevel global _WarningCount _MaxWarningLevel = 0 _WarningCount = 0 --- NEW FILE: make_simdar --- ./Compile.py ../../../CSPFlightSim/Data/Sim ../../../CSPFlightSim/Data/Sim.dar |
From: <mk...@us...> - 2003-01-19 20:27:40
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Include/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv31582/SimData Log Message: Directory /cvsroot/csp/APPLICATIONS/SimData/Include/SimData added to the repository --> Using per-directory sticky tag `simdata' |
From: <mk...@us...> - 2003-01-19 20:27:25
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Tools/DataCompiler In directory sc8-pr-cvs1:/tmp/cvs-serv31433/DataCompiler Log Message: Directory /cvsroot/csp/APPLICATIONS/SimData/Tools/DataCompiler added to the repository --> Using per-directory sticky tag `simdata' |
From: <mk...@us...> - 2003-01-19 20:26:30
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Include In directory sc8-pr-cvs1:/tmp/cvs-serv30879/Include Log Message: Directory /cvsroot/csp/APPLICATIONS/SimData/Include added to the repository --> Using per-directory sticky tag `simdata' |