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-23 18:51:09
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Include/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv7179 Modified Files: Tag: simdata InterfaceRegistry.h Log Message: no message Index: InterfaceRegistry.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Attic/InterfaceRegistry.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 *** InterfaceRegistry.h 20 Jan 2003 05:53:12 -0000 1.1.2.2 --- InterfaceRegistry.h 23 Jan 2003 18:51:00 -0000 1.1.2.3 *************** *** 156,160 **** std::vector<InterfaceProxy *> const &getInterfaces() const; ! SWIG_PROTECTED: void addInterface(const char *name, hasht id, InterfaceProxy *proxy) throw(InterfaceError); --- 156,161 ---- std::vector<InterfaceProxy *> const &getInterfaces() const; ! //SWIG_PROTECTED: ! public: void addInterface(const char *name, hasht id, InterfaceProxy *proxy) throw(InterfaceError); |
From: <de...@us...> - 2003-01-23 18:50:44
|
Update of /cvsroot/csp/APPLICATIONS/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv6993 Modified Files: Tag: simdata README Log Message: added building hint on windows with vc++6 Index: README =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Attic/README,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** README 19 Jan 2003 20:25:44 -0000 1.1.2.1 --- README 23 Jan 2003 18:50:37 -0000 1.1.2.2 *************** *** 43,47 **** You will need both SWIG and Python in order to utilize SimData. ! While it may be technically possible to bulid SimData without these tools, the Data Compiler (which is essential to the use of SimData) is currently written in Python and relies on the --- 43,47 ---- You will need both SWIG and Python in order to utilize SimData. ! While it may be technically possible to build SimData without these tools, the Data Compiler (which is essential to the use of SimData) is currently written in Python and relies on the *************** *** 101,102 **** --- 101,112 ---- the XML data files to incorporate the changes into Sim.dar. + + BUILDING on Windows with msvc++6(sp5), stlport-4.5.3 (hints) + + 1) Install python2.2 and swig 1.3.17 + 2) Add python path to your global path + 3) Load SimDataMSVC.dsw + 4) Build it in release mode; in process, it should create a new file + called cSimData_wrap.cpp (this file name should already be in + project/Source) from cSimData.i which is parsed by swig. + 5) Testing procedure is same as above. \ No newline at end of file |
From: <mk...@us...> - 2003-01-22 08:17:19
|
Update of /cvsroot/csp/APPLICATIONS/CSPFlightSim/Include In directory sc8-pr-cvs1:/tmp/cvs-serv2348/Include Modified Files: Tag: simdata HID.h Added Files: Tag: simdata InputInterface.h Log Message: revised vhid layer --- NEW FILE: InputInterface.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 InputInterface.h * **/ #ifndef __INPUTINTERFACE_H__ #define __INPUTINTERFACE_H__ #include "SDL_events.h" class VirtualHID; class InputInterface { public: virtual ~InputInterface() {} virtual bool OnKey(SDL_KeyboardEvent const &) { return false; } virtual bool OnJoystickButton(SDL_JoyButtonEvent const &) { return false; } virtual bool OnJoystickAxisMotion(SDL_JoyAxisEvent const &) { return false; } virtual bool OnMouseMove(SDL_MouseMotionEvent const &) { return false; } virtual bool OnMouseButton(SDL_MouseButtonEvent const &) { return false; } }; #define ACTION_INTERFACE(obj_class, method) \ virtual void method(); \ static void on##method(InputInterface* obj, int, int) {\ obj_class* target = dynamic_cast<obj_class*>(obj);\ assert(target); \ target->method();\ } #define CLICK_INTERFACE(obj_class, method) \ virtual void method(int, int); \ static void on##method(InputInterface* obj, int x, int y) { \ obj_class* target = dynamic_cast<obj_class*>(obj);\ assert(target); \ target->method(x, y);\ } #define MOTION_INTERFACE(obj_class, method) \ virtual void method(int, int, int, int); \ static void on##method(InputInterface* obj, int x, int y, int dx, int dy) {\ obj_class* target = dynamic_cast<obj_class*>(obj);\ assert(target); \ target->method(x, y, dx, dy);\ } #define AXIS_INTERFACE(obj_class, method) \ virtual void method(double); \ static void on##method(InputInterface* obj, double value) {\ obj_class* target = dynamic_cast<obj_class*>(obj);\ assert(target); \ target->method(value);\ } #endif // __INPUTINTERFACE_H__ Index: HID.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPFlightSim/Include/Attic/HID.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 *** HID.h 4 Jan 2003 23:49:50 -0000 1.1.2.1 --- HID.h 22 Jan 2003 08:17:13 -0000 1.1.2.2 *************** *** 23,26 **** --- 23,41 ---- **/ + /************************************************************** + * TODO jan 2003 + * + * add joystick hat support + * map loading / parsing + * map caching + * automatic map swapping based on player object type + * rotary banding + * axis calibration, detents, and non-linear corrections + * finish the definition of the map scripting language + * complete the python tool to convert map scripts to binary + * add xml support to the python script tool + * + */ + #ifndef __HID_H__ #define __HID_H__ *************** *** 30,37 **** #include "SDL_keyboard.h" #include <vector> - #include <hash_map> ! #include "SimObject.h" --- 45,55 ---- #include "SDL_keyboard.h" + #include <string> #include <vector> ! #include <SimData/hash_map.h> ! ! ! class InputInterface; *************** *** 45,56 **** public: ! virtual bool OnKeyDown(SDL_keysym &key) = 0; ! virtual bool OnKeyUp(SDL_keysym &key) = 0; ! virtual bool OnJoystickButtonDown(int joynum, int butnum) = 0; ! virtual bool OnJoystickButtonUp(int joynum, int butnum) = 0; ! virtual void OnJoystickAxisMotion(int joynum, int axis, int val) = 0; virtual bool OnMouseMove(SDL_MouseMotionEvent const &) = 0; ! virtual bool OnMouseButtonDown(SDL_MouseButtonEvent const &) = 0; ! virtual bool OnMouseButtonUp(SDL_MouseButtonEvent const &) = 0; /* virtual void OnJoystickHatMotion(int joynum, int hat, int val) = 0; --- 63,74 ---- public: ! HID() {} ! virtual ~HID() {} ! ! virtual bool OnKey(SDL_KeyboardEvent const &) = 0; ! virtual bool OnJoystickButton(SDL_JoyButtonEvent const &) = 0; ! virtual bool OnJoystickAxisMotion(SDL_JoyAxisEvent const &) = 0; virtual bool OnMouseMove(SDL_MouseMotionEvent const &) = 0; ! virtual bool OnMouseButton(SDL_MouseButtonEvent const &) = 0; /* virtual void OnJoystickHatMotion(int joynum, int hat, int val) = 0; *************** *** 58,62 **** virtual void OnUpdate(double) = 0; ! virtual void bindObject(SimObject *) = 0; }; --- 76,82 ---- virtual void OnUpdate(double) = 0; ! virtual void bindObject(InputInterface *) = 0; ! ! virtual bool OnEvent(SDL_Event &event); }; *************** *** 65,69 **** { public: ! typedef enum { RELEASE, PRESS } EDir; struct LinearCorrection { --- 85,89 ---- { public: ! EventMapping(); struct LinearCorrection { *************** *** 74,111 **** struct Axis { ! Axis(int id_ = -1): id(id_) {} ! int id; }; struct Action { double time; ! int id; }; typedef std::vector<Action> Script; ! typedef std::hash_map<int, Script> script_map; typedef script_map::const_iterator EventScript; - typedef std::hash_map<int, int> motion_map; ! int getKeyID(SDL_keysym &key, EDir dir, int mode) const; ! int getJoystickButtonID(int device, int button, EDir dir, int mode) const; ! int getMouseButtonID(int device, int button, EDir dir, int kmode, int mode) const; ! int getMouseMotionID(int device, int state, int kmode, int mode) const; ! Script const *getKeyScript(SDL_keysym &key, EDir dir, int mode) const; ! Script const *getJoystickButtonScript(int device, int button, EDir dir, int mode) const; ! Script const *getMouseButtonScript(int device, int button, EDir dir, int kmode, int mode) const; Axis const *getJoystickAxis(int device, int axis) const; ! int getMouseMotion(int device, int state, int kmode, int mode) const; ! void addKeyMap(SDL_keysym &key, EDir dir, int mode, Script const &s); ! void addJoystickButtonMap(int device, int button, EDir dir, int mode, Script const &s); void addJoystickAxisMap(int device, int axis, Axis const &a); ! void addMouseMotionMap(int device, int state, int kmod, int mode, int map_to); // convenience method for testing purposes only ! void addKeyMap(SDLKey vkey, SDLMod kmode, EDir dir, int mode, int action, double time); // convenience method for testing purposes only ! void addJoystickButtonMap(int device, int button, EDir dir, int mode, int action, double time); private: --- 94,146 ---- struct Axis { ! Axis(std::string const &id_ = ""): id(id_) {} ! std::string id; }; struct Action { + Action(std::string const &id_ = "", + double time_ = 0.0, + int jmod_ = -1, + int mode_ = -1, + int loop_ = -1): + id(id_), mode(mode_), jmod(jmod_), loop(loop_), time(time_) {} + std::string id; + int mode; + int jmod; + int loop; double time; ! }; ! ! struct Motion { ! Motion(std::string const &id_ = ""): id(id_) {} ! std::string id; }; typedef std::vector<Action> Script; ! typedef HASH_MAP<int, Script> script_map; ! typedef HASH_MAP<int, Motion> motion_map; typedef script_map::const_iterator EventScript; ! int getKeyID(int device, SDL_keysym const &key, int state, int mode) const; ! int getJoystickButtonID(int device, int button, int state, int jmod, int mode) const; ! int getMouseButtonID(int device, int button, int state, int kmod, int mode) const; ! int getMouseMotionID(int device, int state, int kmod, int mode) const; ! Script const *getKeyScript(int device, SDL_keysym const &key, int state, int mode) const; ! Script const *getJoystickButtonScript(int device, int button, int state, int jmod, int mode) const; ! Script const *getMouseButtonScript(int device, int button, int state, int kmod, int mode) const; Axis const *getJoystickAxis(int device, int axis) const; ! Motion const *getMouseMotion(int device, int state, int kmod, int mode) const; ! void addKeyMap(int device, SDL_keysym &key, int state, int mode, Script const &s); ! void addJoystickButtonMap(int device, int button, int state, int jmod, int mode, Script const &s); void addJoystickAxisMap(int device, int axis, Axis const &a); ! void addMouseMotionMap(int device, int state, int kmod, int mode, Motion const &motion); ! void addMouseButtonMap(int device, int button, int state, int kmod, int mode, Script const &s); // convenience method for testing purposes only ! void addKeyMap(int device, SDLKey vkey, SDLMod kmode, int state, int mode, Action const &action); // convenience method for testing purposes only ! void addJoystickButtonMap(int device, int button, int state, int jmod, int mode, Action const &action); private: *************** *** 124,130 **** { public: ! typedef void (*ActionAdapter)(SimObject *, int, int); ! typedef void (*MotionAdapter)(SimObject *, int, int, int, int); ! typedef void (*AxisAdapter)(SimObject *, int); VirtualHID(); --- 159,165 ---- { public: ! typedef void (*ActionAdapter)(InputInterface *, int, int); ! typedef void (*MotionAdapter)(InputInterface *, int, int, int, int); ! typedef void (*AxisAdapter)(InputInterface *, double); VirtualHID(); *************** *** 132,145 **** virtual void setMapping(EventMapping const & map); ! virtual void bindObject(SimObject *object); ! virtual bool OnKeyDown(SDL_keysym &key); ! virtual bool OnKeyUp(SDL_keysym &key); ! virtual bool OnJoystickButtonDown(int joynum, int butnum); ! virtual bool OnJoystickButtonUp(int joynum, int butnum); ! virtual void OnJoystickAxisMotion(int joynum, int axis, int val); virtual bool OnMouseMove(SDL_MouseMotionEvent const &event); ! virtual bool OnMouseButtonDown(SDL_MouseButtonEvent const &event); ! virtual bool OnMouseButtonUp(SDL_MouseButtonEvent const &event); virtual void OnUpdate(double dt); --- 167,177 ---- virtual void setMapping(EventMapping const & map); ! virtual void bindObject(InputInterface *object); ! virtual bool OnKey(SDL_KeyboardEvent const &event); ! virtual bool OnJoystickButton(SDL_JoyButtonEvent const &event); ! virtual bool OnJoystickAxisMotion(SDL_JoyAxisEvent const &event); virtual bool OnMouseMove(SDL_MouseMotionEvent const &event); ! virtual bool OnMouseButton(SDL_MouseButtonEvent const &event); virtual void OnUpdate(double dt); *************** *** 147,156 **** protected: virtual void setScript(EventMapping::Script const *s, int x = -1, int y = -1); - virtual void bindEvents() = 0; virtual void setVirtualMode(int mode); ! typedef std::hash_map<int, ActionAdapter> ActionMap; ! typedef std::hash_map<int, MotionAdapter> MotionMap; ! typedef std::vector<AxisAdapter> AxisMap; ActionMap m_Actions; --- 179,195 ---- protected: virtual void setScript(EventMapping::Script const *s, int x = -1, int y = -1); virtual void setVirtualMode(int mode); + virtual void setJoystickModifier(int jmod); + + struct eqstr { + bool operator()(const char* s1, const char* s2) const { + return strcmp(s1, s2) == 0; + } + }; ! // too bad partially specialized template typedef's don't exist yet... ! typedef HASH_MAP<const char *, ActionAdapter, HASH<const char *>, eqstr> ActionMap; ! typedef HASH_MAP<const char *, MotionAdapter, HASH<const char *>, eqstr> MotionMap; ! typedef HASH_MAP<const char *, AxisAdapter, HASH<const char *>, eqstr> AxisMap; ActionMap m_Actions; *************** *** 159,165 **** int m_VirtualMode; const EventMapping *m_Map; ! SimObject *m_Object; EventMapping::Script const *m_ActiveScript; --- 198,205 ---- int m_VirtualMode; + bool m_JoystickModifier; const EventMapping *m_Map; ! InputInterface *m_Object; EventMapping::Script const *m_ActiveScript; *************** *** 167,171 **** double m_ScriptTime; ! int m_LastMouseMoveID; MotionAdapter m_LastMouseMoveAdapter; int m_MouseEventX; --- 207,211 ---- double m_ScriptTime; ! std::string m_LastMouseMoveID; MotionAdapter m_LastMouseMoveAdapter; int m_MouseEventX; *************** *** 174,223 **** - #define ACTION_INTERFACE(obj_class, method) static void on##method(SimObject* obj, int, int) {\ - obj_class* target = dynamic_cast<obj_class*>(obj);\ - assert(target); \ - target->method();\ - } - - #define CLICK_INTERFACE(obj_class, method) static void on##method(SimObject* obj, int x, int y) {\ - obj_class* target = dynamic_cast<obj_class*>(obj);\ - assert(target); \ - target->method(x, y);\ - } - - #define MOTION_INTERFACE(obj_class, method) static void on##method(SimObject* obj, int x, int y, int dx, int dy) {\ - obj_class* target = dynamic_cast<obj_class*>(obj);\ - assert(target); \ - target->method(x, y, dx, dy);\ - } - - #define AXIS_INTERFACE(obj_class, method) static void on##method(SimObject* obj, int value) {\ - obj_class* target = dynamic_cast<obj_class*>(obj);\ - assert(target); \ - target->set##method(value);\ - } - - class AircraftObject: public SimObject - { - public: - virtual void RetractGear() { cout << "retracting gear\n"; } - virtual void ExtendGear() { cout << "extending gear\n"; } - virtual void ToggleGear() { cout << "toggling gear\n"; } - virtual void setThrottle(double x) { cout << "throttle = " << x << endl; } - virtual void PanView(int x, int y, int dx, int dy) { - cout << "mouse " << x << ", " << y << " (" << dx << ", " << dy << ")\n"; - } - virtual void dump() {} - virtual void OnUpdate(double) {} - virtual void initialize() {} - virtual unsigned int OnRender() {} - - ACTION_INTERFACE(AircraftObject, RetractGear); - ACTION_INTERFACE(AircraftObject, ExtendGear); - ACTION_INTERFACE(AircraftObject, ToggleGear); - MOTION_INTERFACE(AircraftObject, PanView); - AXIS_INTERFACE(AircraftObject, Throttle); - - }; --- 214,217 ---- *************** *** 231,248 **** m_Motions[id] = &obj_class::on##method; - - class AircraftInterface: public VirtualHID - { - public: - enum { RETRACT_GEAR, EXTEND_GEAR, TOGGLE_GEAR }; - enum { THROTTLE, AILERONS, ELEVATORS, RUDDER }; - enum { PAN_VIEW }; - - AircraftInterface(); - - protected: - virtual void bindEvents(); - }; - /* --- 225,228 ---- |
From: <mk...@us...> - 2003-01-22 08:17:19
|
Update of /cvsroot/csp/APPLICATIONS/CSPFlightSim/Source In directory sc8-pr-cvs1:/tmp/cvs-serv2348/Source Modified Files: Tag: simdata HID.cpp Log Message: revised vhid layer Index: HID.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPFlightSim/Source/Attic/HID.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 *** HID.cpp 4 Jan 2003 23:49:51 -0000 1.1.2.1 --- HID.cpp 22 Jan 2003 08:17:13 -0000 1.1.2.2 *************** *** 24,27 **** --- 24,59 ---- #include "HID.h" + #include "InputInterface.h" + #include "SDL_events.h" + + #include <iostream> + + + ///////////////////////////////////////////////////////////////////////////// + // class HID + + bool HID::OnEvent(SDL_Event &event) { + switch (event.type) { + case SDL_MOUSEMOTION: + return OnMouseMove(event.motion); + case SDL_MOUSEBUTTONUP: + case SDL_MOUSEBUTTONDOWN: + return OnMouseButton(event.button); + case SDL_KEYUP: + case SDL_KEYDOWN: + return OnKey(event.key); + case SDL_JOYAXISMOTION: + return OnJoystickAxisMotion(event.jaxis); + case SDL_JOYHATMOTION: + //return OnJoystickHatMotion(event.jhat); + return false; + case SDL_JOYBUTTONUP: + case SDL_JOYBUTTONDOWN: + return OnJoystickButton(event.jbutton); + default: + break; + } + return false; + } *************** *** 31,46 **** ! int EventMapping::getKeyID(SDL_keysym &key, EDir dir, int mode) const { ! int press = (dir == PRESS) ? (1 << 28) : 0; ! return (key.sym & 0xFFF) + ((key.mod & 0xFFF) << 12) + ((mode & 0x00F) << 24) + press; } ! int EventMapping::getJoystickButtonID(int device, int button, EDir dir, int mode) const { ! int press = (dir == PRESS) ? (1 << 28) : 0; ! return (device & 0xFFF) + ((button & 0xFFF) << 12) + ((mode & 0x00F) << 24) + press; } ! int EventMapping::getMouseButtonID(int device, int button, EDir dir, int kmod, int mode) const { ! int press = (dir == PRESS) ? (1 << 28) : 0; return (device & 0xF) + ((button & 0xFF) << 4) + ((kmod & 0xFFF) << 12) + ((mode & 0xF) << 24) + press; } --- 63,81 ---- ! EventMapping::EventMapping() { } ! int EventMapping::getKeyID(int device, SDL_keysym const &key, int state, int mode) const { ! int press = (state == SDL_PRESSED) ? (1 << 31) : 0; ! return (device & 0xF) + ((key.sym & 0x3FF) << 4) + ((key.mod & 0xFFF) << 14) + ((mode & 0x00F) << 26) + press; } ! int EventMapping::getJoystickButtonID(int device, int button, int state, int jmod, int mode) const { ! int press = (state == SDL_PRESSED) ? (1 << 31) : 0; ! return (device & 0xF) + ((button & 0xFFF) << 4) + ((jmod & 0xF) << 16) + ((mode & 0xF) << 20) + press; ! } ! ! int EventMapping::getMouseButtonID(int device, int button, int state, int kmod, int mode) const { ! int press = (state == SDL_PRESSED) ? (1 << 31) : 0; return (device & 0xF) + ((button & 0xFF) << 4) + ((kmod & 0xFFF) << 12) + ((mode & 0xF) << 24) + press; } *************** *** 51,56 **** ! EventMapping::Script const *EventMapping::getKeyScript(SDL_keysym &key, EDir dir, int mode) const { ! int id = getKeyID(key, dir, mode); EventScript kScript = m_KeyMap.find(id); if (kScript == m_KeyMap.end()) return NULL; --- 86,91 ---- ! EventMapping::Script const *EventMapping::getKeyScript(int device, SDL_keysym const &key, int state, int mode) const { ! int id = getKeyID(device, key, state, mode); EventScript kScript = m_KeyMap.find(id); if (kScript == m_KeyMap.end()) return NULL; *************** *** 58,63 **** } ! EventMapping::Script const *EventMapping::getJoystickButtonScript(int device, int button, EDir dir, int mode) const { ! int id = getJoystickButtonID(device, button, dir, mode); EventScript bScript = m_JoystickButtonMap.find(id); if (bScript == m_JoystickButtonMap.end()) return NULL; --- 93,98 ---- } ! EventMapping::Script const *EventMapping::getJoystickButtonScript(int device, int button, int state, int jmod, int mode) const { ! int id = getJoystickButtonID(device, button, state, jmod, mode); EventScript bScript = m_JoystickButtonMap.find(id); if (bScript == m_JoystickButtonMap.end()) return NULL; *************** *** 75,118 **** } ! void EventMapping::addKeyMap(SDL_keysym &key, EDir dir, int mode, Script const &s) { ! int id = getKeyID(key, dir, mode); m_KeyMap[id] = s; } ! void EventMapping::addJoystickButtonMap(int device, int button, EDir dir, int mode, Script const &s) { ! int id = getJoystickButtonID(device, button, dir, mode); m_JoystickButtonMap[id] = s; } ! void EventMapping::addMouseMotionMap(int device, int state, int kmod, int mode, int map_to) { int id = getMouseMotionID(device, state, kmod, mode); ! m_MouseMotionMap[id] = map_to; } // convenience method for testing purposes only ! void EventMapping::addKeyMap(SDLKey vkey, SDLMod kmod, EDir dir, int mode, int action, double time) { SDL_keysym key; key.sym = vkey; key.mod = kmod; Script s; ! Action a; ! a.id = action; ! a.time = time; ! s.push_back(a); ! addKeyMap(key, dir, mode, s); } // convenience method for testing purposes only ! void EventMapping::addJoystickButtonMap(int device, int button, EDir dir, int mode, int action, double time) { Script s; ! Action a; ! a.id = action; ! a.time = time; ! s.push_back(a); ! addJoystickButtonMap(device, button, dir, mode, s); } ! EventMapping::Script const *EventMapping::getMouseButtonScript(int device, int button, EDir dir, int kmod, int mode) const { ! int id = getMouseButtonID(device, button, dir, kmod, mode); EventScript mScript = m_MouseButtonMap.find(id); if (mScript == m_MouseButtonMap.end()) return NULL; --- 110,152 ---- } ! void EventMapping::addKeyMap(int device, SDL_keysym &key, int state, int mode, Script const &s) { ! int id = getKeyID(device, key, state, mode); m_KeyMap[id] = s; } ! void EventMapping::addJoystickButtonMap(int device, int button, int state, int jmod, int mode, Script const &s) { ! int id = getJoystickButtonID(device, button, state, jmod, mode); m_JoystickButtonMap[id] = s; } ! void EventMapping::addMouseMotionMap(int device, int state, int kmod, int mode, Motion const &motion) { int id = getMouseMotionID(device, state, kmod, mode); ! m_MouseMotionMap[id] = motion; ! } ! ! void EventMapping::addMouseButtonMap(int device, int button, int state, int kmod, int mode, Script const &s) { ! int id = getMouseButtonID(device, button, state, kmod, mode); ! m_MouseButtonMap[id] = s; } // convenience method for testing purposes only ! void EventMapping::addKeyMap(int device, SDLKey vkey, SDLMod kmod, int state, int mode, Action const &action) { SDL_keysym key; key.sym = vkey; key.mod = kmod; Script s; ! s.push_back(action); ! addKeyMap(device, key, state, mode, s); } // convenience method for testing purposes only ! void EventMapping::addJoystickButtonMap(int device, int button, int state, int jmod, int mode, Action const &action) { Script s; ! s.push_back(action); ! addJoystickButtonMap(device, button, state, jmod, mode, s); } ! EventMapping::Script const *EventMapping::getMouseButtonScript(int device, int button, int state, int kmod, int mode) const { ! int id = getMouseButtonID(device, button, state, kmod, mode); EventScript mScript = m_MouseButtonMap.find(id); if (mScript == m_MouseButtonMap.end()) return NULL; *************** *** 120,128 **** } ! int EventMapping::getMouseMotion(int device, int state, int kmod, int mode) const { int id = getMouseMotionID(device, state, kmod, mode); motion_map::const_iterator map = m_MouseMotionMap.find(id); ! if (map == m_MouseMotionMap.end()) return -1; ! return map->second; } --- 154,163 ---- } ! //int EventMapping::getMouseMotion(int device, int state, int kmod, int mode) const { ! EventMapping::Motion const *EventMapping::getMouseMotion(int device, int state, int kmod, int mode) const { int id = getMouseMotionID(device, state, kmod, mode); motion_map::const_iterator map = m_MouseMotionMap.find(id); ! if (map == m_MouseMotionMap.end()) return NULL; ! return &(map->second); } *************** *** 136,141 **** m_Map = 0; m_VirtualMode = 0; m_ActiveScript = 0; ! m_LastMouseMoveID = -1; } --- 171,180 ---- m_Map = 0; m_VirtualMode = 0; + m_JoystickModifier = 0; m_ActiveScript = 0; ! m_LastMouseMoveID = ""; ! m_Actions.clear(); ! m_Motions.clear(); ! m_Axes.clear(); } *************** *** 146,162 **** } ! void VirtualHID::bindObject(SimObject *object) { m_Object = object; } ! ! bool VirtualHID::OnKeyDown(SDL_keysym &key) { ! if (!m_Object || !m_Map) return false; ! EventMapping::Script const *s = m_Map->getKeyScript(key, EventMapping::PRESS, 0); ! if (s == NULL) return false; ! setScript(s); ! return true; ! } ! bool VirtualHID::OnKeyUp(SDL_keysym &key) { ! if (!m_Object || !m_Map) return false; ! EventMapping::Script const *s = m_Map->getKeyScript(key, EventMapping::RELEASE, 0); if (s == NULL) return false; setScript(s); --- 185,195 ---- } ! void VirtualHID::bindObject(InputInterface *object) { m_Object = object; } ! bool VirtualHID::OnKey(SDL_KeyboardEvent const &event) { ! if (!m_Object) return false; ! if (m_Object->OnKey(event)) return true; ! if (!m_Map) return false; ! EventMapping::Script const *s = m_Map->getKeyScript(event.which, event.keysym, event.state, 0); if (s == NULL) return false; setScript(s); *************** *** 164,170 **** } ! bool VirtualHID::OnJoystickButtonDown(int joynum, int butnum) { ! if (!m_Object || !m_Map) return false; ! EventMapping::Script const *s = m_Map->getJoystickButtonScript(joynum, butnum, EventMapping::PRESS, m_VirtualMode); if (s == NULL) return false; setScript(s); --- 197,206 ---- } ! bool VirtualHID::OnJoystickButton(SDL_JoyButtonEvent const &event) { ! if (!m_Object) return false; ! if (m_Object->OnJoystickButton(event)) return true; ! if (!m_Map) return false; ! EventMapping::Script const *s = ! m_Map->getJoystickButtonScript(event.which, event.button, event.state, m_JoystickModifier, m_VirtualMode); if (s == NULL) return false; setScript(s); *************** *** 172,204 **** } ! bool VirtualHID::OnJoystickButtonUp(int joynum, int butnum) { ! if (!m_Object || !m_Map) return false; ! EventMapping::Script const *s = m_Map->getJoystickButtonScript(joynum, butnum, EventMapping::RELEASE, m_VirtualMode); ! if (s == NULL) return false; ! setScript(s); return true; } - void VirtualHID::OnJoystickAxisMotion(int joynum, int axis, int val) { - if (!m_Object || !m_Map) return; - EventMapping::Axis const *Axis = m_Map->getJoystickAxis(joynum, axis); - int id = Axis->id; - if (id < 0 || id > m_Axes.size()) return; - AxisAdapter adapter = m_Axes[id]; - if (adapter) adapter(m_Object, val); - } - void VirtualHID::setVirtualMode(int mode) { m_VirtualMode = mode; } bool VirtualHID::OnMouseMove(SDL_MouseMotionEvent const &event) { ! if (!m_Object || !m_Map) return false; int kmod = SDL_GetModState(); ! int id = m_Map->getMouseMotion(event.which, event.state, kmod, m_VirtualMode); if (id != m_LastMouseMoveID) { m_LastMouseMoveID = id; m_LastMouseMoveAdapter = NULL; ! MotionMap::const_iterator map = m_Motions.find(id); if (map == m_Motions.end()) return false; m_LastMouseMoveAdapter = map->second; --- 208,242 ---- } ! bool VirtualHID::OnJoystickAxisMotion(SDL_JoyAxisEvent const &event) { ! if (!m_Object) return false; ! if (m_Object->OnJoystickAxisMotion(event)) return true; ! if (!m_Map) return false; ! EventMapping::Axis const *a = m_Map->getJoystickAxis(event.which, event.axis); ! if (a == NULL || a->id == "") return false; ! AxisAdapter adapter = m_Axes[a->id.c_str()]; ! if (adapter) adapter(m_Object, event.value * (1.0/32768.0)); return true; } void VirtualHID::setVirtualMode(int mode) { m_VirtualMode = mode; } + void VirtualHID::setJoystickModifier(int jmod) { + m_JoystickModifier = jmod; + } + bool VirtualHID::OnMouseMove(SDL_MouseMotionEvent const &event) { ! if (!m_Object) return false; ! if (m_Object->OnMouseMove(event)) return true; ! if (!m_Map) return false; int kmod = SDL_GetModState(); ! EventMapping::Motion const *m = m_Map->getMouseMotion(event.which, event.state, kmod, m_VirtualMode); ! if (m == NULL || m->id == "") return false; ! std::string const &id = m->id; if (id != m_LastMouseMoveID) { m_LastMouseMoveID = id; m_LastMouseMoveAdapter = NULL; ! MotionMap::const_iterator map = m_Motions.find(id.c_str()); if (map == m_Motions.end()) return false; m_LastMouseMoveAdapter = map->second; *************** *** 210,226 **** } ! bool VirtualHID::OnMouseButtonDown(SDL_MouseButtonEvent const &event) { ! if (!m_Object || !m_Map) return false; ! int kmod = SDL_GetModState(); ! EventMapping::Script const *s = m_Map->getMouseButtonScript(event.which, event.button, EventMapping::PRESS, kmod, m_VirtualMode); ! if (s == NULL) return false; ! setScript(s, event.x, event.y); ! return true; ! } ! ! bool VirtualHID::OnMouseButtonUp(SDL_MouseButtonEvent const &event) { ! if (!m_Object || !m_Map) return false; int kmod = SDL_GetModState(); ! EventMapping::Script const *s = m_Map->getMouseButtonScript(event.which, event.button, EventMapping::RELEASE, kmod, m_VirtualMode); if (s == NULL) return false; setScript(s, event.x, event.y); --- 248,257 ---- } ! bool VirtualHID::OnMouseButton(SDL_MouseButtonEvent const &event) { ! if (!m_Object) return false; ! if (m_Object->OnMouseButton(event)) return true; ! if (!m_Map) return false; int kmod = SDL_GetModState(); ! EventMapping::Script const *s = m_Map->getMouseButtonScript(event.which, event.button, event.state, kmod, m_VirtualMode); if (s == NULL) return false; setScript(s, event.x, event.y); *************** *** 230,249 **** void VirtualHID::OnUpdate(double dt) { if (!m_ActiveScript) return; m_ScriptTime += dt; while (m_ScriptAction->time <= m_ScriptTime) { ! int id = m_ScriptAction->id; ! if (id < -15) { ! // nop ! } else ! if (id < 0) { ! setVirtualMode(-id); ! } else { ! // FIXME: don't use [] ! ActionAdapter adapter = m_Actions[id]; ! if (adapter) adapter(m_Object, m_MouseEventX, m_MouseEventY); } ! if (++m_ScriptAction == m_ActiveScript->end()) { ! m_ActiveScript = 0; break; } } --- 261,295 ---- void VirtualHID::OnUpdate(double dt) { if (!m_ActiveScript) return; + // wait out the delay until the next action should start + // strings of actions with delay = 0 will be executed in + // a single call of OnUpdate() m_ScriptTime += dt; while (m_ScriptAction->time <= m_ScriptTime) { ! const char *id = m_ScriptAction->id.c_str(); ! // action time represents a relative delay instead of absolute ! m_ScriptTime = 0.0; ! if (m_ScriptAction->mode >= 0) { ! setVirtualMode(m_ScriptAction->mode); } ! if (m_ScriptAction->jmod >= 0) { ! setJoystickModifier(m_ScriptAction->jmod); ! } ! // execute the action ! ActionAdapter adapter = m_Actions[id]; ! if (adapter) { ! adapter(m_Object, m_MouseEventX, m_MouseEventY); ! } else { ! std::cout << "Missing HID interface for command '" << id << "'\n"; ! } ! // advance, end, or loop the script ! int loop = m_ScriptAction->loop; ! if (loop >= 0 && (unsigned)loop < m_ActiveScript->size()) { ! m_ScriptAction = m_ActiveScript->begin() + loop; break; + } else { + if (++m_ScriptAction == m_ActiveScript->end()) { + m_ActiveScript = 0; + break; + } } } *************** *** 257,281 **** m_ScriptTime = 0.0; OnUpdate(0.0); - } - - - //////////////////////////////////////////////////////////////////// - // class AircraftInterface: public VirtualHID - - AircraftInterface::AircraftInterface(): VirtualHID() { - // temparory for testing... - bindObject(new AircraftObject()); - bindEvents(); - } - - void AircraftInterface::bindEvents() { - m_Actions.clear(); - m_Axes.clear(); - m_Axes.resize(16, NULL); - BIND_ACTION(AircraftObject, RETRACT_GEAR, RetractGear); - BIND_ACTION(AircraftObject, EXTEND_GEAR, ExtendGear); - BIND_ACTION(AircraftObject, TOGGLE_GEAR, ToggleGear); - BIND_MOTION(AircraftObject, PAN_VIEW, PanView); - BIND_AXIS(AircraftObject, THROTTLE, Throttle); } --- 303,306 ---- |
Update of /cvsroot/csp/APPLICATIONS/SimData/Source In directory sc8-pr-cvs1:/tmp/cvs-serv8014/Source Modified Files: Tag: simdata DataArchive.cpp HashUtility.cpp Path.cpp cSimData.py cSimData_wrap.cpp Log Message: hasht fixes, printf Index: DataArchive.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Attic/DataArchive.cpp,v retrieving revision 1.1.2.5 retrieving revision 1.1.2.6 diff -C2 -d -r1.1.2.5 -r1.1.2.6 *** DataArchive.cpp 20 Jan 2003 23:06:48 -0000 1.1.2.5 --- DataArchive.cpp 21 Jan 2003 19:04:12 -0000 1.1.2.6 *************** *** 52,56 **** t.classhash = hash; t.pathhash = hash_string(path); - //printf("%s => %lld\n", path, t.pathhash); table_map[t.pathhash] = n_objects; n_objects++; --- 52,55 ---- *************** *** 82,86 **** size_t n; n = fread(&table_offset, 4, 1, f); - printf("table offset = %08x\n", (int)table_offset); if (n != 1) { throw CorruptArchive("Lookup table offset."); --- 81,84 ---- *************** *** 88,92 **** fseek(f, table_offset, SEEK_SET); n = fread(&n_objects, 4, 1, f); - printf("table entries = %d\n", n_objects); if (n != 1 || n_objects < 0 || n_objects > 100000) { throw CorruptArchive("Number of objects."); --- 86,89 ---- *************** *** 102,106 **** //printf("%6d %d\n", i, table[i].pathhash); table_map[table[i].pathhash] = i; ! //printf("%02d: %llu %llu %08x %d\n", i, table[i].pathhash, table[i].classhash, table[i].offset, table[i].length); } } --- 99,105 ---- //printf("%6d %d\n", i, table[i].pathhash); table_map[table[i].pathhash] = i; ! //printf("%02d: ", i); ! //std::cout << table[i].pathhash << " " << table[i].classhash; ! //printf(" %08x %d\n", table[i].offset, table[i].length); } } *************** *** 168,172 **** a.pack(p); int length = p.getCount(); ! fprintf(stderr, "added %s (%d bytes) [%llu]\n", path, length, hash_string(path)); _addEntry(offset, length, a.getClassHash(), path); } --- 167,171 ---- a.pack(p); int length = p.getCount(); ! std::cerr << "added " << path << " (" << length << " bytes) [" << hash_string(path) << "]" << std::endl; _addEntry(offset, length, a.getClassHash(), path); } *************** *** 275,280 **** if (i == table_map.end()) { std::string msg; - char buf[128]; - snprintf(buf, 128, " [%llu]", key); if (path_str==0 || *path_str==0) { msg = "human-readable path unavailable"; --- 274,277 ---- *************** *** 282,287 **** msg = path_str; } ! msg = "path not found in archive '" + _fn + "' (" + msg + ")" + buf + "\n"; ! printf(msg.c_str()); throw IndexError(msg.c_str()); } --- 279,284 ---- msg = path_str; } ! msg = "path not found in archive '" + _fn + "' (" + msg + ")" + key.str() + "\n"; ! std::cerr << msg; throw IndexError(msg.c_str()); } *************** *** 302,306 **** printf("getObject(\"%s\"):\n", path_str); } ! printf("Interface proxy [%llu] not found.\n", t.classhash); assert(0); } --- 299,303 ---- printf("getObject(\"%s\"):\n", path_str); } ! std::cout << "Interface proxy [" << t.classhash << "] not found." << std::endl; assert(0); } *************** *** 314,318 **** n_buffer++; } else { ! printf("BUFFERSIZE exceeded, allocating larger buffer\n"); buffer = (char*) malloc(length); free_buffer = true; --- 311,315 ---- n_buffer++; } else { ! std::cout << "BUFFERSIZE exceeded, allocating larger buffer" << std::endl; buffer = (char*) malloc(length); free_buffer = true; *************** *** 322,326 **** fread(buffer, length, 1, f); UnPacker p(buffer, length, this); ! printf("got object %s\n",dup->getClassName()); dup->_setPath(key); dup->unpack(p); --- 319,323 ---- fread(buffer, length, 1, f); UnPacker p(buffer, length, this); ! std::cout << "got object " << dup->getClassName() << std::endl; dup->_setPath(key); dup->unpack(p); *************** *** 331,335 **** } if (!p.isComplete()) { ! printf("INTERNAL ERROR: Object extraction incomplete for class '%s'.\n", dup->getClassName()); assert(0); } --- 328,332 ---- } if (!p.isComplete()) { ! std::cout << "INTERNAL ERROR: Object extraction incomplete for class '" << dup->getClassName() << "'." << std::endl; assert(0); } Index: HashUtility.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Attic/HashUtility.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 *** HashUtility.cpp 20 Jan 2003 23:06:48 -0000 1.1.2.2 --- HashUtility.cpp 21 Jan 2003 19:04:12 -0000 1.1.2.3 *************** *** 28,31 **** --- 28,32 ---- #include <SimData/HashUtility.h> + #include <sstream> *************** *** 119,128 **** } ! ! NAMESPACE_END // namespace simdata ! std::ostream & operator<<(std::ostream &o, const hasht &x) { return o << "(" << x.b << ":" << x.a << ")"; } --- 120,135 ---- } ! std::string HashT::str() const { ! std::stringstream repr; ! repr << *this; ! return repr.str(); ! } std::ostream & operator<<(std::ostream &o, const hasht &x) { return o << "(" << x.b << ":" << x.a << ")"; } + + + NAMESPACE_END // namespace simdata + Index: Path.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Attic/Path.cpp,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** Path.cpp 20 Jan 2003 05:53:12 -0000 1.1.2.3 --- Path.cpp 21 Jan 2003 19:04:12 -0000 1.1.2.4 *************** *** 23,26 **** --- 23,28 ---- #include <SimData/ns-simdata.h> + #include <sstream> + using std::cout; using std::endl; *************** *** 49,55 **** std::string Path::asString() const { ! char repr[128]; ! snprintf(repr, 128, "<Path %llu>", _path); ! return repr; } --- 51,57 ---- std::string Path::asString() const { ! std::stringstream repr; ! repr << "<Path " << _path << ">"; ! return repr.str(); } *************** *** 127,133 **** std::string PathPointerBase::asString() const { ! char repr[128]; ! snprintf(repr, 128, "<Path %llu>", _path); ! return repr; } --- 129,135 ---- std::string PathPointerBase::asString() const { ! std::stringstream repr; ! repr << "<Path " << _path << ">"; ! return repr.str(); } *************** *** 154,158 **** _assign(0); } else { ! printf("loading pathpointerbase from %llu %llu\n", path, _path); Path _p(path); PathPointerBase _ppb; --- 156,160 ---- _assign(0); } else { ! std::cerr << "loading pathpointerbase from " << path << " " << _path << std::endl; Path _p(path); PathPointerBase _ppb; Index: cSimData.py =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Attic/cSimData.py,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** cSimData.py 20 Jan 2003 23:06:48 -0000 1.1.2.2 --- cSimData.py 21 Jan 2003 19:04:12 -0000 1.1.2.3 *************** *** 82,91 **** __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, HashT, name) - __swig_setmethods__["a"] = _cSimData.HashT_a_set - __swig_getmethods__["a"] = _cSimData.HashT_a_get - if _newclass:a = property(_cSimData.HashT_a_get,_cSimData.HashT_a_set) - __swig_setmethods__["b"] = _cSimData.HashT_b_set - __swig_getmethods__["b"] = _cSimData.HashT_b_get - if _newclass:b = property(_cSimData.HashT_b_get,_cSimData.HashT_b_set) def __init__(self,*args): self.this = apply(_cSimData.new_HashT,args) --- 82,85 ---- *************** *** 106,111 **** self.__class__ = HashT _cSimData.HashT_swigregister(HashTPtr) - - newhash4_cstring = _cSimData.newhash4_cstring hash_string = _cSimData.hash_string --- 100,103 ---- Index: cSimData_wrap.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Attic/cSimData_wrap.cpp,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -C2 -d -r1.1.2.4 -r1.1.2.5 *** cSimData_wrap.cpp 20 Jan 2003 23:06:48 -0000 1.1.2.4 --- cSimData_wrap.cpp 21 Jan 2003 19:04:12 -0000 1.1.2.5 *************** *** 1779,1866 **** return Py_BuildValue((char *)""); } - static PyObject *_wrap_HashT_a_set(PyObject *self, PyObject *args) { - PyObject *resultobj; - simdata::HashT *arg1 = (simdata::HashT *) 0 ; - guint32 arg2 ; - guint32 *argp2 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if(!PyArg_ParseTuple(args,(char *)"OO:HashT_a_set",&obj0,&obj1)) goto fail; - if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_simdata__HashT,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - if ((SWIG_ConvertPtr(obj1,(void **) &argp2, SWIGTYPE_p_guint32,SWIG_POINTER_EXCEPTION) == -1)) SWIG_fail; - arg2 = *argp2; - if (arg1) (arg1)->a = arg2; - - Py_INCREF(Py_None); resultobj = Py_None; - return resultobj; - fail: - return NULL; - } - - - static PyObject *_wrap_HashT_a_get(PyObject *self, PyObject *args) { - PyObject *resultobj; - simdata::HashT *arg1 = (simdata::HashT *) 0 ; - guint32 result; - PyObject * obj0 = 0 ; - - if(!PyArg_ParseTuple(args,(char *)"O:HashT_a_get",&obj0)) goto fail; - if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_simdata__HashT,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - result = ((arg1)->a); - - { - guint32 * resultptr; - resultptr = new guint32((guint32 &) result); - resultobj = SWIG_NewPointerObj((void *) resultptr, SWIGTYPE_p_guint32, 1); - } - return resultobj; - fail: - return NULL; - } - - - static PyObject *_wrap_HashT_b_set(PyObject *self, PyObject *args) { - PyObject *resultobj; - simdata::HashT *arg1 = (simdata::HashT *) 0 ; - guint32 arg2 ; - guint32 *argp2 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if(!PyArg_ParseTuple(args,(char *)"OO:HashT_b_set",&obj0,&obj1)) goto fail; - if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_simdata__HashT,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - if ((SWIG_ConvertPtr(obj1,(void **) &argp2, SWIGTYPE_p_guint32,SWIG_POINTER_EXCEPTION) == -1)) SWIG_fail; - arg2 = *argp2; - if (arg1) (arg1)->b = arg2; - - Py_INCREF(Py_None); resultobj = Py_None; - return resultobj; - fail: - return NULL; - } - - - static PyObject *_wrap_HashT_b_get(PyObject *self, PyObject *args) { - PyObject *resultobj; - simdata::HashT *arg1 = (simdata::HashT *) 0 ; - guint32 result; - PyObject * obj0 = 0 ; - - if(!PyArg_ParseTuple(args,(char *)"O:HashT_b_get",&obj0)) goto fail; - if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_simdata__HashT,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - result = ((arg1)->b); - - { - guint32 * resultptr; - resultptr = new guint32((guint32 &) result); - resultobj = SWIG_NewPointerObj((void *) resultptr, SWIGTYPE_p_guint32, 1); - } - return resultobj; - fail: - return NULL; - } - - static PyObject *_wrap_new_HashT__SWIG_0(PyObject *self, PyObject *args) { PyObject *resultobj; --- 1779,1782 ---- *************** *** 2252,2270 **** return Py_BuildValue((char *)""); } - static PyObject *_wrap_newhash4_cstring(PyObject *self, PyObject *args) { - PyObject *resultobj; - char *arg1 ; - u4 result; - - if(!PyArg_ParseTuple(args,(char *)"s:newhash4_cstring",&arg1)) goto fail; - result = (u4)simdata::newhash4_cstring((char const *)arg1); - - resultobj = PyInt_FromLong((long)result); - return resultobj; - fail: - return NULL; - } - - static PyObject *_wrap_hash_string(PyObject *self, PyObject *args) { PyObject *resultobj; --- 2168,2171 ---- *************** *** 21957,21964 **** { (char *)"delete_PythonException", _wrap_delete_PythonException, METH_VARARGS }, { (char *)"PythonException_swigregister", PythonException_swigregister, METH_VARARGS }, - { (char *)"HashT_a_set", _wrap_HashT_a_set, METH_VARARGS }, - { (char *)"HashT_a_get", _wrap_HashT_a_get, METH_VARARGS }, - { (char *)"HashT_b_set", _wrap_HashT_b_set, METH_VARARGS }, - { (char *)"HashT_b_get", _wrap_HashT_b_get, METH_VARARGS }, { (char *)"new_HashT", _wrap_new_HashT, METH_VARARGS }, { (char *)"HashT___eq__", _wrap_HashT___eq__, METH_VARARGS }, --- 21858,21861 ---- *************** *** 21966,21970 **** { (char *)"delete_HashT", _wrap_delete_HashT, METH_VARARGS }, { (char *)"HashT_swigregister", HashT_swigregister, METH_VARARGS }, - { (char *)"newhash4_cstring", _wrap_newhash4_cstring, METH_VARARGS }, { (char *)"hash_string", _wrap_hash_string, METH_VARARGS }, { (char *)"new_ParseException", _wrap_new_ParseException, METH_VARARGS }, --- 21863,21866 ---- |
From: <mk...@us...> - 2003-01-21 19:04:14
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Include/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv8014/Include/SimData Modified Files: Tag: simdata HashUtility.h HashUtility.i Log Message: hasht fixes, printf Index: HashUtility.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Attic/HashUtility.h,v retrieving revision 1.1.2.5 retrieving revision 1.1.2.6 diff -C2 -d -r1.1.2.5 -r1.1.2.6 *** HashUtility.h 20 Jan 2003 23:06:47 -0000 1.1.2.5 --- HashUtility.h 21 Jan 2003 19:04:11 -0000 1.1.2.6 *************** *** 29,32 **** --- 29,33 ---- #define __HASHUTILITY_H__ + #include <string> #include <iostream> #include <SimData/hash_map.h> *************** *** 92,95 **** --- 93,97 ---- a = x.a; b = x.b; } + std::string str() const; }; *************** *** 155,167 **** typedef HASH_MAP<hasht, ObjectProxyBase*, hasht_hash, hasht_eq> proxy_map; - - NAMESPACE_END // namespace simdata - - - typedef SIMDATA(HashT) hasht; - extern std::ostream & operator<<(std::ostream &o, const hasht &x); ! #endif // __HASHUTILITY_H__ --- 157,163 ---- typedef HASH_MAP<hasht, ObjectProxyBase*, hasht_hash, hasht_eq> proxy_map; extern std::ostream & operator<<(std::ostream &o, const hasht &x); ! NAMESPACE_END // namespace simdata #endif // __HASHUTILITY_H__ Index: HashUtility.i =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Attic/HashUtility.i,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.i 20 Jan 2003 23:06:48 -0000 1.1.2.2 --- HashUtility.i 21 Jan 2003 19:04:12 -0000 1.1.2.3 *************** *** 9,14 **** typedef unsigned char u1; /* unsigned 1-byte type */ - /* typedef unsigned long long u8; /* unsigned 8-byte type */ - %rename(hash_string) SIMDATA(newhasht_cstring)(const char*); --- 9,12 ---- *************** *** 16,51 **** struct HashT { ! guint32 a, b; ! HashT() { ! a = b = 0; ! } ! HashT(guint32 x) { ! a = x; b = 0; ! } ! HashT(guint32 b_, guint32 a_) { ! a = a_; b = b_; ! } ! HashT(const HashT &x) { ! a = x.a; b = x.b; ! } ! bool operator ==(guint32 x) const { ! return (b == 0 && a == x); ! } ! bool operator !=(guint32 x) const { ! return (b != 0 || a != x); ! } ! bool operator ==(HashT const &x) const { ! return (b == x.b && a == x.a); ! } ! bool operator !=(HashT const &x) const { ! return (b != x.b || a != x.a); ! } }; typedef HashT hasht; - - u4 newhash4_cstring(const char*); HashT newhasht_cstring(const char*); NAMESPACE_END --- 14,31 ---- struct HashT { ! HashT(); ! HashT(guint32 x); ! HashT(guint32 b_, guint32 a_); ! HashT(const HashT &x); ! bool operator ==(guint32 x) const; ! bool operator !=(guint32 x) const; ! bool operator ==(HashT const &x) const; ! bool operator !=(HashT const &x) const; }; typedef HashT hasht; HashT newhasht_cstring(const char*); + NAMESPACE_END |
From: <mk...@us...> - 2003-01-20 23:06:53
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Include/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv26134/Include/SimData Modified Files: Tag: simdata HashUtility.h HashUtility.i Log Message: more hasht fixes Index: HashUtility.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Attic/HashUtility.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 *** HashUtility.h 20 Jan 2003 05:53:12 -0000 1.1.2.4 --- HashUtility.h 20 Jan 2003 23:06:47 -0000 1.1.2.5 *************** *** 29,32 **** --- 29,33 ---- #define __HASHUTILITY_H__ + #include <iostream> #include <SimData/hash_map.h> #include <SimData/GlibCsp.h> *************** *** 39,63 **** ! #define hashstr4 newhash4_cstring ! #define hashstr8 newhash8_cstring // use 64-bit hash values - #define hash_string hashstr8 //#define hasht u8 ! #define hasht_hash hashu8 ! #define hasht_eq equ8 typedef guint32 u4; /* unsigned 4-byte type */ typedef guint8 u1; /* unsigned 1-byte type */ typedef guint64 u8; /* unsigned 8-byte type */ ! typedef u8 hasht; NAMESPACE_SIMDATA ! typedef u8 hasht; extern u4 newhash4_cstring(const char*); ! extern u8 newhash8_cstring(const char*); --- 40,103 ---- ! //#define hashstr4 newhash4_cstring ! //#define hashstr8 newhash8_cstring // use 64-bit hash values //#define hasht u8 ! #define hash_string newhasht_cstring ! //#define hash_string hashstr8 ! //#define hasht_hash hashu8 ! //#define hasht_eq equ8 typedef guint32 u4; /* unsigned 4-byte type */ typedef guint8 u1; /* unsigned 1-byte type */ typedef guint64 u8; /* unsigned 8-byte type */ ! //typedef u8 hasht; ! NAMESPACE_SIMDATA ! //typedef u8 hasht; ! struct HashT { ! guint32 a, b; ! HashT() { ! a = b = 0; ! } ! HashT(guint32 x) { ! a = x; b = 0; ! } ! HashT(guint32 b_, guint32 a_) { ! a = a_; b = b_; ! } ! HashT(const HashT &x) { ! a = x.a; b = x.b; ! } ! bool operator ==(guint32 x) const { ! return (b == 0 && a == x); ! } ! bool operator !=(guint32 x) const { ! return (b != 0 || a != x); ! } ! bool operator ==(HashT const &x) const { ! return (b == x.b && a == x.a); ! } ! bool operator !=(HashT const &x) const { ! return (b != x.b || a != x.a); ! } ! void operator =(guint32 x) { ! a = x; b = 0; ! } ! void operator =(HashT const &x) { ! a = x.a; b = x.b; ! } ! }; ! ! typedef HashT hasht; ! extern u4 newhash4_cstring(const char*); ! extern hasht newhasht_cstring(const char*); ! //extern u8 newhash8_cstring(const char*); *************** *** 80,83 **** --- 120,137 ---- }; + + struct hasht_eq { + bool operator()(hasht i1, hasht i2) const { + return ((i1.a == i2.a) && (i1.b == i2.b)); + } + }; + + struct hasht_hash { + bool operator()(hasht i1) const { + return i1.a; + } + }; + + /* struct equ8 { bool operator()(u8 i1, u8 i2) const { *************** *** 91,94 **** --- 145,149 ---- } }; + */ typedef HASH_MAP<hasht, int, hasht_hash, hasht_eq> hasht_map; *************** *** 102,105 **** --- 157,167 ---- NAMESPACE_END // namespace simdata + + + typedef SIMDATA(HashT) hasht; + + extern std::ostream & operator<<(std::ostream &o, const hasht &x); + + #endif // __HASHUTILITY_H__ Index: HashUtility.i =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Attic/HashUtility.i,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.i 19 Jan 2003 20:28:29 -0000 1.1.2.1 --- HashUtility.i 20 Jan 2003 23:06:48 -0000 1.1.2.2 *************** *** 8,18 **** typedef unsigned long int u4; /* unsigned 4-byte type */ typedef unsigned char u1; /* unsigned 1-byte type */ - typedef unsigned long long u8; /* unsigned 8-byte type */ ! %rename(hash_string) SIMDATA(newhash8_cstring)(const char*); NAMESPACE_SIMDATA u4 newhash4_cstring(const char*); ! u8 newhash8_cstring(const char*); NAMESPACE_END --- 8,51 ---- typedef unsigned long int u4; /* unsigned 4-byte type */ typedef unsigned char u1; /* unsigned 1-byte type */ ! /* typedef unsigned long long u8; /* unsigned 8-byte type */ ! ! %rename(hash_string) SIMDATA(newhasht_cstring)(const char*); NAMESPACE_SIMDATA + + struct HashT { + guint32 a, b; + HashT() { + a = b = 0; + } + HashT(guint32 x) { + a = x; b = 0; + } + HashT(guint32 b_, guint32 a_) { + a = a_; b = b_; + } + HashT(const HashT &x) { + a = x.a; b = x.b; + } + bool operator ==(guint32 x) const { + return (b == 0 && a == x); + } + bool operator !=(guint32 x) const { + return (b != 0 || a != x); + } + bool operator ==(HashT const &x) const { + return (b == x.b && a == x.a); + } + bool operator !=(HashT const &x) const { + return (b != x.b || a != x.a); + } + }; + + typedef HashT hasht; + + u4 newhash4_cstring(const char*); ! HashT newhasht_cstring(const char*); NAMESPACE_END |
Update of /cvsroot/csp/APPLICATIONS/SimData/Source In directory sc8-pr-cvs1:/tmp/cvs-serv26134/Source Modified Files: Tag: simdata DataArchive.cpp HashUtility.cpp InterfaceRegistry.cpp cSimData.py cSimData_wrap.cpp Log Message: more hasht fixes Index: DataArchive.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Attic/DataArchive.cpp,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -C2 -d -r1.1.2.4 -r1.1.2.5 *** DataArchive.cpp 20 Jan 2003 18:26:30 -0000 1.1.2.4 --- DataArchive.cpp 20 Jan 2003 23:06:48 -0000 1.1.2.5 *************** *** 102,106 **** //printf("%6d %d\n", i, table[i].pathhash); table_map[table[i].pathhash] = i; ! printf("%02d: %llu %llu %08x %d\n", i, table[i].pathhash, table[i].classhash, table[i].offset, table[i].length); } } --- 102,106 ---- //printf("%6d %d\n", i, table[i].pathhash); table_map[table[i].pathhash] = i; ! //printf("%02d: %llu %llu %08x %d\n", i, table[i].pathhash, table[i].classhash, table[i].offset, table[i].length); } } Index: HashUtility.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Attic/HashUtility.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 *** HashUtility.cpp 19 Jan 2003 20:31:41 -0000 1.1.2.1 --- HashUtility.cpp 20 Jan 2003 23:06:48 -0000 1.1.2.2 *************** *** 112,116 **** --- 112,128 ---- } + HashT newhasht_cstring(const char* str) { + u4 h0, h1; + h0 = newhash((u1*)str, strlen(str), 0); + h1 = newhash((u1*)str, strlen(str), 1); + return HashT(h1, h0); + } + NAMESPACE_END // namespace simdata + + + std::ostream & operator<<(std::ostream &o, const hasht &x) { + return o << "(" << x.b << ":" << x.a << ")"; + } Index: InterfaceRegistry.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Attic/InterfaceRegistry.cpp,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -C2 -d -r1.1.2.4 -r1.1.2.5 *** InterfaceRegistry.cpp 20 Jan 2003 18:27:54 -0000 1.1.2.4 --- InterfaceRegistry.cpp 20 Jan 2003 23:06:48 -0000 1.1.2.5 *************** *** 63,67 **** InterfaceProxy::InterfaceProxy(const char *cname, hasht chash) { ! assert(chash); g_InterfaceRegistry.addInterface(cname, chash, this); } --- 63,67 ---- InterfaceProxy::InterfaceProxy(const char *cname, hasht chash) { ! assert(chash != 0); g_InterfaceRegistry.addInterface(cname, chash, this); } Index: cSimData.py =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Attic/cSimData.py,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.py 20 Jan 2003 04:30:48 -0000 1.1.2.1 --- cSimData.py 20 Jan 2003 23:06:48 -0000 1.1.2.2 *************** *** 77,80 **** --- 77,110 ---- _cSimData.PythonException_swigregister(PythonExceptionPtr) + class HashT(_object): + __swig_setmethods__ = {} + __setattr__ = lambda self, name, value: _swig_setattr(self, HashT, name, value) + __swig_getmethods__ = {} + __getattr__ = lambda self, name: _swig_getattr(self, HashT, name) + __swig_setmethods__["a"] = _cSimData.HashT_a_set + __swig_getmethods__["a"] = _cSimData.HashT_a_get + if _newclass:a = property(_cSimData.HashT_a_get,_cSimData.HashT_a_set) + __swig_setmethods__["b"] = _cSimData.HashT_b_set + __swig_getmethods__["b"] = _cSimData.HashT_b_get + if _newclass:b = property(_cSimData.HashT_b_get,_cSimData.HashT_b_set) + def __init__(self,*args): + self.this = apply(_cSimData.new_HashT,args) + self.thisown = 1 + def __eq__(*args): return apply(_cSimData.HashT___eq__,args) + def __ne__(*args): return apply(_cSimData.HashT___ne__,args) + def __del__(self, destroy= _cSimData.delete_HashT): + try: + if self.thisown: destroy(self) + except: pass + def __repr__(self): + return "<C HashT instance at %s>" % (self.this,) + + class HashTPtr(HashT): + def __init__(self,this): + self.this = this + if not hasattr(self,"thisown"): self.thisown = 0 + self.__class__ = HashT + _cSimData.HashT_swigregister(HashTPtr) + newhash4_cstring = _cSimData.newhash4_cstring Index: cSimData_wrap.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Attic/cSimData_wrap.cpp,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** cSimData_wrap.cpp 20 Jan 2003 18:47:46 -0000 1.1.2.3 --- cSimData_wrap.cpp 20 Jan 2003 23:06:48 -0000 1.1.2.4 *************** *** 657,720 **** #define SWIGTYPE_p_simdata__InterfaceRegistry swig_types[8] #define SWIGTYPE_p_simdata__External swig_types[9] ! #define SWIGTYPE_p_bool swig_types[10] ! #define SWIGTYPE_p_simdata__InvalidDate swig_types[11] ! #define SWIGTYPE_p_simdata__BadMagic swig_types[12] ! #define SWIGTYPE_p_double swig_types[13] ! #define SWIGTYPE_p_a_3__double swig_types[14] ! #define SWIGTYPE_p_std__vectorTsimdata__Spread_t swig_types[15] ! #define SWIGTYPE_p_simdata__Enumeration swig_types[16] ! #define SWIGTYPE_p_simdata__ListTsimdata__Spread_t swig_types[17] [...1751 lines suppressed...] _swigt__p_FILE, + _swigt__p_tm, + _swigt__p_simdata__HashT, _swigt__p_int, _swigt__p_std__vectorTsimdata__Table_t, *************** *** 22372,22377 **** _swigt__p_simdata__IOError, _swigt__p_std__vectorTsimdata__InterfaceProxy_p_t, - _swigt__p_simdata__SimDate, _swigt__p_simdata__InterpolatedData, _swigt__p_std__vectorTstd__string_t, _swigt__p_simdata__Matrix3, --- 22930,22935 ---- _swigt__p_simdata__IOError, _swigt__p_std__vectorTsimdata__InterfaceProxy_p_t, _swigt__p_simdata__InterpolatedData, + _swigt__p_simdata__SimDate, _swigt__p_std__vectorTstd__string_t, _swigt__p_simdata__Matrix3, |
From: <mk...@us...> - 2003-01-20 18:47:55
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Source In directory sc8-pr-cvs1:/tmp/cvs-serv10966 Modified Files: Tag: simdata cSimData_wrap.cpp Log Message: regen Index: cSimData_wrap.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Attic/cSimData_wrap.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 *** cSimData_wrap.cpp 20 Jan 2003 04:56:49 -0000 1.1.2.2 --- cSimData_wrap.cpp 20 Jan 2003 18:47:46 -0000 1.1.2.3 *************** *** 19021,19025 **** result = (simdata::BadMagic *)new simdata::BadMagic((char const *)arg1); ! }catch (simdata::PythonException &e) { printf("SWIG: passing Python exception back\n"); return NULL; --- 19021,19025 ---- result = (simdata::BadMagic *)new simdata::BadMagic((char const *)arg1); ! }catch (simdata::PythonException) { printf("SWIG: passing Python exception back\n"); return NULL; *************** *** 19047,19051 **** delete arg1; ! }catch (simdata::PythonException &e) { printf("SWIG: passing Python exception back\n"); return NULL; --- 19047,19051 ---- delete arg1; ! }catch (simdata::PythonException) { printf("SWIG: passing Python exception back\n"); return NULL; *************** *** 19079,19083 **** result = (simdata::BadByteOrder *)new simdata::BadByteOrder((char const *)arg1); ! }catch (simdata::PythonException &e) { printf("SWIG: passing Python exception back\n"); return NULL; --- 19079,19083 ---- result = (simdata::BadByteOrder *)new simdata::BadByteOrder((char const *)arg1); ! }catch (simdata::PythonException) { printf("SWIG: passing Python exception back\n"); return NULL; *************** *** 19105,19109 **** delete arg1; ! }catch (simdata::PythonException &e) { printf("SWIG: passing Python exception back\n"); return NULL; --- 19105,19109 ---- delete arg1; ! }catch (simdata::PythonException) { printf("SWIG: passing Python exception back\n"); return NULL; *************** *** 19137,19141 **** result = (simdata::CorruptArchive *)new simdata::CorruptArchive((char const *)arg1); ! }catch (simdata::PythonException &e) { printf("SWIG: passing Python exception back\n"); return NULL; --- 19137,19141 ---- result = (simdata::CorruptArchive *)new simdata::CorruptArchive((char const *)arg1); ! }catch (simdata::PythonException) { printf("SWIG: passing Python exception back\n"); return NULL; *************** *** 19163,19167 **** delete arg1; ! }catch (simdata::PythonException &e) { printf("SWIG: passing Python exception back\n"); return NULL; --- 19163,19167 ---- delete arg1; ! }catch (simdata::PythonException) { printf("SWIG: passing Python exception back\n"); return NULL; *************** *** 19195,19199 **** result = (simdata::IndexError *)new simdata::IndexError((char const *)arg1); ! }catch (simdata::PythonException &e) { printf("SWIG: passing Python exception back\n"); return NULL; --- 19195,19199 ---- result = (simdata::IndexError *)new simdata::IndexError((char const *)arg1); ! }catch (simdata::PythonException) { printf("SWIG: passing Python exception back\n"); return NULL; *************** *** 19221,19225 **** delete arg1; ! }catch (simdata::PythonException &e) { printf("SWIG: passing Python exception back\n"); return NULL; --- 19221,19225 ---- delete arg1; ! }catch (simdata::PythonException) { printf("SWIG: passing Python exception back\n"); return NULL; *************** *** 19253,19257 **** result = (simdata::ObjectMismatch *)new simdata::ObjectMismatch((char const *)arg1); ! }catch (simdata::PythonException &e) { printf("SWIG: passing Python exception back\n"); return NULL; --- 19253,19257 ---- result = (simdata::ObjectMismatch *)new simdata::ObjectMismatch((char const *)arg1); ! }catch (simdata::PythonException) { printf("SWIG: passing Python exception back\n"); return NULL; *************** *** 19279,19283 **** delete arg1; ! }catch (simdata::PythonException &e) { printf("SWIG: passing Python exception back\n"); return NULL; --- 19279,19283 ---- delete arg1; ! }catch (simdata::PythonException) { printf("SWIG: passing Python exception back\n"); return NULL; *************** *** 19320,19324 **** result = (simdata::IOError *)new simdata::IOError(arg1); ! }catch (simdata::PythonException &e) { printf("SWIG: passing Python exception back\n"); return NULL; --- 19320,19324 ---- result = (simdata::IOError *)new simdata::IOError(arg1); ! }catch (simdata::PythonException) { printf("SWIG: passing Python exception back\n"); return NULL; *************** *** 19346,19350 **** delete arg1; ! }catch (simdata::PythonException &e) { printf("SWIG: passing Python exception back\n"); return NULL; --- 19346,19350 ---- delete arg1; ! }catch (simdata::PythonException) { printf("SWIG: passing Python exception back\n"); return NULL; *************** *** 19535,19539 **** result = (simdata::TableEntry *)new simdata::TableEntry(); ! }catch (simdata::PythonException &e) { printf("SWIG: passing Python exception back\n"); return NULL; --- 19535,19539 ---- result = (simdata::TableEntry *)new simdata::TableEntry(); ! }catch (simdata::PythonException) { printf("SWIG: passing Python exception back\n"); return NULL; *************** *** 19561,19565 **** delete arg1; ! }catch (simdata::PythonException &e) { printf("SWIG: passing Python exception back\n"); return NULL; --- 19561,19565 ---- delete arg1; ! }catch (simdata::PythonException) { printf("SWIG: passing Python exception back\n"); return NULL; *************** *** 19709,19713 **** result = (simdata::FP *)new simdata::FP(); ! }catch (simdata::PythonException &e) { printf("SWIG: passing Python exception back\n"); return NULL; --- 19709,19713 ---- result = (simdata::FP *)new simdata::FP(); ! }catch (simdata::PythonException) { printf("SWIG: passing Python exception back\n"); return NULL; *************** *** 19735,19739 **** delete arg1; ! }catch (simdata::PythonException &e) { printf("SWIG: passing Python exception back\n"); return NULL; --- 19735,19739 ---- delete arg1; ! }catch (simdata::PythonException) { printf("SWIG: passing Python exception back\n"); return NULL; *************** *** 19768,19772 **** result = (simdata::DataArchive *)new simdata::DataArchive((char const *)arg1,arg2); ! }catch (simdata::PythonException &e) { printf("SWIG: passing Python exception back\n"); return NULL; --- 19768,19772 ---- result = (simdata::DataArchive *)new simdata::DataArchive((char const *)arg1,arg2); ! }catch (simdata::PythonException) { printf("SWIG: passing Python exception back\n"); return NULL; *************** *** 19794,19798 **** delete arg1; ! }catch (simdata::PythonException &e) { printf("SWIG: passing Python exception back\n"); return NULL; --- 19794,19798 ---- delete arg1; ! }catch (simdata::PythonException) { printf("SWIG: passing Python exception back\n"); return NULL; *************** *** 19827,19831 **** (arg1)->_addEntry(arg2,arg3,arg4,(char const *)arg5); ! }catch (simdata::PythonException &e) { printf("SWIG: passing Python exception back\n"); return NULL; --- 19827,19831 ---- (arg1)->_addEntry(arg2,arg3,arg4,(char const *)arg5); ! }catch (simdata::PythonException) { printf("SWIG: passing Python exception back\n"); return NULL; *************** *** 19857,19861 **** (arg1)->addObject(*arg2,(char const *)arg3); ! }catch (simdata::PythonException &e) { printf("SWIG: passing Python exception back\n"); return NULL; --- 19857,19861 ---- (arg1)->addObject(*arg2,(char const *)arg3); ! }catch (simdata::PythonException) { printf("SWIG: passing Python exception back\n"); return NULL; *************** *** 19883,19887 **** (arg1)->close(); ! }catch (simdata::PythonException &e) { printf("SWIG: passing Python exception back\n"); return NULL; --- 19883,19887 ---- (arg1)->close(); ! }catch (simdata::PythonException) { printf("SWIG: passing Python exception back\n"); return NULL; *************** *** 19910,19914 **** result = (bool)(arg1)->isClosed(); ! }catch (simdata::PythonException &e) { printf("SWIG: passing Python exception back\n"); return NULL; --- 19910,19914 ---- result = (bool)(arg1)->isClosed(); ! }catch (simdata::PythonException) { printf("SWIG: passing Python exception back\n"); return NULL; *************** *** 19937,19941 **** result = (bool)(arg1)->isWrite(); ! }catch (simdata::PythonException &e) { printf("SWIG: passing Python exception back\n"); return NULL; --- 19937,19941 ---- result = (bool)(arg1)->isWrite(); ! }catch (simdata::PythonException) { printf("SWIG: passing Python exception back\n"); return NULL; *************** *** 19963,19967 **** (arg1)->setDefault(); ! }catch (simdata::PythonException &e) { printf("SWIG: passing Python exception back\n"); return NULL; --- 19963,19967 ---- (arg1)->setDefault(); ! }catch (simdata::PythonException) { printf("SWIG: passing Python exception back\n"); return NULL; *************** *** 19991,19995 **** result = (arg1)->getObject((char const *)arg2); ! }catch (simdata::PythonException &e) { printf("SWIG: passing Python exception back\n"); return NULL; --- 19991,19995 ---- result = (arg1)->getObject((char const *)arg2); ! }catch (simdata::PythonException) { printf("SWIG: passing Python exception back\n"); return NULL; *************** *** 20026,20030 **** result = (arg1)->getObject((simdata::Path const &)*arg2,(char const *)arg3); ! }catch (simdata::PythonException &e) { printf("SWIG: passing Python exception back\n"); return NULL; --- 20026,20030 ---- result = (arg1)->getObject((simdata::Path const &)*arg2,(char const *)arg3); ! }catch (simdata::PythonException) { printf("SWIG: passing Python exception back\n"); return NULL; *************** *** 20126,20130 **** result = (long)(arg1)->_getOffset(); ! }catch (simdata::PythonException &e) { printf("SWIG: passing Python exception back\n"); return NULL; --- 20126,20130 ---- result = (long)(arg1)->_getOffset(); ! }catch (simdata::PythonException) { printf("SWIG: passing Python exception back\n"); return NULL; *************** *** 20153,20157 **** result = (arg1)->_filePointer(); ! }catch (simdata::PythonException &e) { printf("SWIG: passing Python exception back\n"); return NULL; --- 20153,20157 ---- result = (arg1)->_filePointer(); ! }catch (simdata::PythonException) { printf("SWIG: passing Python exception back\n"); return NULL; *************** *** 20191,20195 **** } ! }catch (simdata::PythonException &e) { printf("SWIG: passing Python exception back\n"); return NULL; --- 20191,20195 ---- } ! }catch (simdata::PythonException) { printf("SWIG: passing Python exception back\n"); return NULL; |
From: <de...@us...> - 2003-01-20 18:30:24
|
Update of /cvsroot/csp/APPLICATIONS/SimData/SimDataMSVC In directory sc8-pr-cvs1:/tmp/cvs-serv3458 Added Files: Tag: simdata SimDataMSVC.dsp SimDataMSVC.dsw Log Message: no message --- NEW FILE: SimDataMSVC.dsp --- # Microsoft Developer Studio Project File - Name="SimDataMSVC" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 CFG=SimDataMSVC - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "SimDataMSVC.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "SimDataMSVC.mak" CFG="SimDataMSVC - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "SimDataMSVC - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "SimDataMSVC - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "SimDataMSVC - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SIMDATAMSVC_EXPORTS" /YX /FD /c # ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SIMDATAMSVC_EXPORTS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x40c /d "NDEBUG" # ADD RSC /l 0x40c /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 !ELSEIF "$(CFG)" == "SimDataMSVC - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SIMDATAMSVC_EXPORTS" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GR /GX /ZI /Od /I "../Include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SIMDATAMSVC_EXPORTS" /FD /GZ /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x40c /d "_DEBUG" # ADD RSC /l 0x40c /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "SimDataMSVC - Win32 Release" # Name "SimDataMSVC - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\Source\BaseType.cpp # End Source File # Begin Source File SOURCE=..\Source\cSimData_wrap.cpp # End Source File # Begin Source File SOURCE=..\Source\DataArchive.cpp # End Source File # Begin Source File SOURCE=..\Source\Date.cpp # End Source File # Begin Source File SOURCE=..\Source\Enum.cpp # End Source File # Begin Source File SOURCE=..\Source\Exception.cpp # End Source File # Begin Source File SOURCE=..\Source\External.cpp # End Source File # Begin Source File SOURCE=..\Source\HashUtility.cpp # End Source File # Begin Source File SOURCE=..\Source\InterfaceRegistry.cpp # End Source File # Begin Source File SOURCE=..\Source\Interpolate.cpp # End Source File # Begin Source File SOURCE=..\Source\List.cpp # End Source File # Begin Source File SOURCE=..\Source\main.cpp # End Source File # Begin Source File SOURCE=..\Source\Math.cpp # End Source File # Begin Source File SOURCE=..\Source\Matrix3.cpp # End Source File # Begin Source File SOURCE=..\Source\Object.cpp # End Source File # Begin Source File SOURCE=..\Source\Pack.cpp # End Source File # Begin Source File SOURCE=..\Source\Path.cpp # End Source File # Begin Source File SOURCE=..\Source\Quaternion.cpp # End Source File # Begin Source File SOURCE=..\Source\Random.cpp # End Source File # Begin Source File SOURCE=..\Source\Spread.cpp # End Source File # Begin Source File SOURCE=..\Source\TypeAdapter.cpp # End Source File # Begin Source File SOURCE=..\Source\Vector3.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\Include\SimData\BaseType.h # End Source File # Begin Source File SOURCE=..\Include\SimData\DataArchive.h # End Source File # Begin Source File SOURCE=..\Include\SimData\Date.h # End Source File # Begin Source File SOURCE=..\Include\SimData\Enum.h # End Source File # Begin Source File SOURCE=..\Include\SimData\Exception.h # End Source File # Begin Source File SOURCE=..\Include\SimData\External.h # End Source File # Begin Source File SOURCE=..\Include\SimData\GlibCsp.h # End Source File # Begin Source File SOURCE=..\Include\SimData\hash_map.h # End Source File # Begin Source File SOURCE=..\Include\SimData\HashUtility.h # End Source File # Begin Source File SOURCE=..\Include\SimData\Integer.h # End Source File # Begin Source File SOURCE=..\Include\SimData\InterfaceRegistry.h # End Source File # Begin Source File SOURCE=..\Include\SimData\InterfaceRegistry_wrap.h # End Source File # Begin Source File SOURCE=..\Include\SimData\Interpolate.h # End Source File # Begin Source File SOURCE=..\Include\SimData\List.h # End Source File # Begin Source File SOURCE=..\Include\SimData\Math.h # End Source File # Begin Source File SOURCE=..\Include\SimData\Matrix3.h # End Source File # Begin Source File SOURCE="..\Include\SimData\ns-simdata.h" # End Source File # Begin Source File SOURCE=..\Include\SimData\Object.h # End Source File # Begin Source File SOURCE=..\Include\SimData\ObjectInterface.h # End Source File # Begin Source File SOURCE=..\Include\SimData\Pack.h # End Source File # Begin Source File SOURCE=..\Include\SimData\Path.h # End Source File # Begin Source File SOURCE=..\Include\SimData\Quaternion.h # End Source File # Begin Source File SOURCE=..\Include\SimData\Random.h # End Source File # Begin Source File SOURCE=..\Include\SimData\Real.h # End Source File # Begin Source File SOURCE=..\Include\SimData\Spread.h # End Source File # Begin Source File SOURCE=..\Include\SimData\String.h # End Source File # Begin Source File SOURCE=..\Include\SimData\TypeAdapter.h # End Source File # Begin Source File SOURCE=..\Include\SimData\Types.h # End Source File # Begin Source File SOURCE=..\Include\SimData\Vector3.h # End Source File # Begin Source File SOURCE=..\Include\SimData\Vector3.inl # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project --- NEW FILE: SimDataMSVC.dsw --- Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "SimDataMSVC"=".\SimDataMSVC.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### |
From: <de...@us...> - 2003-01-20 18:29:37
|
Update of /cvsroot/csp/APPLICATIONS/SimData/SimDataMSVC In directory sc8-pr-cvs1:/tmp/cvs-serv3019/SimDataMSVC Log Message: Directory /cvsroot/csp/APPLICATIONS/SimData/SimDataMSVC added to the repository --> Using per-directory sticky tag `simdata' |
From: <de...@us...> - 2003-01-20 18:29:13
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Source In directory sc8-pr-cvs1:/tmp/cvs-serv2873 Modified Files: Tag: simdata Spread.cpp Log Message: no message Index: Spread.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Attic/Spread.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 *** Spread.cpp 20 Jan 2003 05:53:12 -0000 1.1.2.2 --- Spread.cpp 20 Jan 2003 18:29:09 -0000 1.1.2.3 *************** *** 88,92 **** float Spread::__neg__() { return -_value; } float Spread::__pos__() { return _value; } ! float Spread::__abs__() { return fabs(_value); } int Spread::__nonzero__() { return _value != 0.0; } float Spread::__float__() { return _value; } --- 88,92 ---- float Spread::__neg__() { return -_value; } float Spread::__pos__() { return _value; } ! float Spread::__abs__() { return static_cast<float>(fabs(_value)); } int Spread::__nonzero__() { return _value != 0.0; } float Spread::__float__() { return _value; } *************** *** 101,106 **** float Spread::__div__(float v) { assert(v != 0.0); return _value / v; } float Spread::__rdiv__(float v) { assert(_value != 0.0); return v / _value; } ! float Spread::__rpow__(float v) { return pow(v, _value); } ! float Spread::__pow__(float v) { return pow(_value, v); } --- 101,106 ---- float Spread::__div__(float v) { assert(v != 0.0); return _value / v; } float Spread::__rdiv__(float v) { assert(_value != 0.0); return v / _value; } ! float Spread::__rpow__(float v) { return static_cast<float>(pow(v, _value)); } ! float Spread::__pow__(float v) { return static_cast<float>(pow(_value, v)); } |
From: <de...@us...> - 2003-01-20 18:29:02
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Source In directory sc8-pr-cvs1:/tmp/cvs-serv2790 Modified Files: Tag: simdata Random.cpp Log Message: no message Index: Random.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Attic/Random.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 *** Random.cpp 19 Jan 2003 20:31:41 -0000 1.1.2.1 --- Random.cpp 20 Jan 2003 18:28:59 -0000 1.1.2.2 *************** *** 38,43 **** */ float box_muller(float mean, float sigma) { ! float x1, x2, w, y1; ! static float y2; static int use_last = 0; if (use_last) { --- 38,43 ---- */ float box_muller(float mean, float sigma) { ! double x1, x2, w, y1; ! static double y2; static int use_last = 0; if (use_last) { *************** *** 56,60 **** use_last = 1; } ! return( mean + y1 * sigma ); } --- 56,60 ---- use_last = 1; } ! return static_cast<float>( mean + y1 * sigma ); } *************** *** 137,142 **** if (iy < 1) iy += IMM1; ! if ((temp = AM*iy) > RNMX) ! return RNMX; else return temp; --- 137,142 ---- if (iy < 1) iy += IMM1; ! if ((temp = static_cast<float>(AM*iy)) > RNMX) ! return static_cast<float>(RNMX); else return temp; *************** *** 154,159 **** */ float Gauss::box_muller(float mean, float sigma) { ! float x1, x2, w, y1; ! static float y2; static int use_last = 0; if (use_last) { --- 154,159 ---- */ float Gauss::box_muller(float mean, float sigma) { ! double x1, x2, w, y1; ! static double y2; static int use_last = 0; if (use_last) { *************** *** 172,176 **** use_last = 1; } ! return( mean + y1 * sigma ); } --- 172,176 ---- use_last = 1; } ! return static_cast<float>( mean + y1 * sigma ); } |
From: <de...@us...> - 2003-01-20 18:28:52
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Include/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv2721 Modified Files: Tag: simdata Path.h Log Message: no message Index: Path.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Attic/Path.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 *** Path.h 19 Jan 2003 20:28:30 -0000 1.1.2.1 --- Path.h 20 Jan 2003 18:28:49 -0000 1.1.2.2 *************** *** 30,34 **** --- 30,43 ---- #define __PATH_H__ + #if defined(_MSC_VER) && (_MSC_VER <= 1200) + #pragma warning (disable : 4290) + #endif + #include <string> + + #if defined(_MSC_VER) && (_MSC_VER <= 1200) + #include <assert.h> + #endif + #include <SimData/HashUtility.h> #include <SimData/BaseType.h> |
From: <de...@us...> - 2003-01-20 18:28:43
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Include/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv2594 Modified Files: Tag: simdata Pack.h Log Message: no message Index: Pack.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Attic/Pack.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 *** Pack.h 20 Jan 2003 05:53:12 -0000 1.1.2.2 --- Pack.h 20 Jan 2003 18:28:37 -0000 1.1.2.3 *************** *** 191,195 **** int x; unpack(x); ! y = (bool) x; } void unpack(hasht& y) { --- 191,195 ---- int x; unpack(x); ! y = (x != 0); } void unpack(hasht& y) { |
From: <de...@us...> - 2003-01-20 18:28:18
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Source In directory sc8-pr-cvs1:/tmp/cvs-serv2443 Modified Files: Tag: simdata main.cpp Log Message: no message Index: main.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Attic/main.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 *** main.cpp 19 Jan 2003 20:31:41 -0000 1.1.2.1 --- main.cpp 20 Jan 2003 18:28:15 -0000 1.1.2.2 *************** *** 2,8 **** #include <iostream> using namespace simdata; ! main() { Vector3 x, y; Matrix3 a, b; --- 2,11 ---- #include <iostream> + using std::cout; + using std::endl; + using namespace simdata; ! int main() { Vector3 x, y; Matrix3 a, b; *************** *** 16,19 **** --- 19,23 ---- y = a * x; cout << y << endl; + return 0; }; |
From: <de...@us...> - 2003-01-20 18:28:07
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Source In directory sc8-pr-cvs1:/tmp/cvs-serv2359 Modified Files: Tag: simdata Interpolate.cpp Log Message: no message Index: Interpolate.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Attic/Interpolate.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 *** Interpolate.cpp 20 Jan 2003 04:56:49 -0000 1.1.2.2 --- Interpolate.cpp 20 Jan 2003 18:28:04 -0000 1.1.2.3 *************** *** 71,79 **** value_t d = breaks[i+1] - breaks[i-1]; value_t sig = (breaks[i] - breaks[i-1]) / d; ! value_t p = 2.0 + sig * z[i-1]; ! z[i] = (sig - 1.0) / p; value_t a = (data[i+1] - data[i]) / (breaks[i+1] - breaks[i]); value_t b = (data[i] - data[i-1]) / (breaks[i] - breaks[i-1]); ! u[i] = (6.0 * (a - b) / d - sig * u[i-1]) / p; } z[n-1] = 0.0; --- 71,79 ---- value_t d = breaks[i+1] - breaks[i-1]; value_t sig = (breaks[i] - breaks[i-1]) / d; ! value_t p = static_cast<float>(2.0 + sig * z[i-1]); ! z[i] = static_cast<float>((sig - 1.0) / p); value_t a = (data[i+1] - data[i]) / (breaks[i+1] - breaks[i]); value_t b = (data[i] - data[i-1]) / (breaks[i] - breaks[i-1]); ! u[i] = static_cast<float>((6.0 * (a - b) / d - sig * u[i-1]) / p); } z[n-1] = 0.0; *************** *** 160,164 **** _min = _breaks[0]; double max = _breaks[n-1]; ! double _range = max - _min; _i_n = int(_range / spacing) + 1; _table.resize(_i_n); --- 160,164 ---- _min = _breaks[0]; double max = _breaks[n-1]; ! float _range = static_cast<float>(max - _min); _i_n = int(_range / spacing) + 1; _table.resize(_i_n); *************** *** 166,170 **** int i; for (i=0; i<_i_n; i++) { ! double x = _min + _range * i / (_i_n-1); *element++ = getPrecise(x); } --- 166,170 ---- int i; for (i=0; i<_i_n; i++) { ! float x = _min + _range * i / (_i_n-1); *element++ = getPrecise(x); } *************** *** 185,189 **** double y2 = _data[i+1]; double s = h * h / 6.0; ! v = y1*f1 + y2*f2 + (f1*(f1*f1 - 1.0)*d1 + f2*(f2*f2 - 1.0)*d2) * s; return v; } --- 185,189 ---- double y2 = _data[i+1]; double s = h * h / 6.0; ! v = static_cast<float>(y1*f1 + y2*f2 + (f1*(f1*f1 - 1.0)*d1 + f2*(f2*f2 - 1.0)*d2) * s); return v; } *************** *** 198,202 **** double y1 = _table[idx]; double y2 = _table[idx+1]; ! double z = f * y2 + (1.0 - f) * y1; return z; } --- 198,202 ---- double y1 = _table[idx]; double y2 = _table[idx+1]; ! float z = static_cast<float>(f * y2 + (1.0 - f) * y1); return z; } |
From: <de...@us...> - 2003-01-20 18:27:58
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Source In directory sc8-pr-cvs1:/tmp/cvs-serv2262 Modified Files: Tag: simdata InterfaceRegistry.cpp Log Message: no message Index: InterfaceRegistry.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Attic/InterfaceRegistry.cpp,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** InterfaceRegistry.cpp 20 Jan 2003 05:53:12 -0000 1.1.2.3 --- InterfaceRegistry.cpp 20 Jan 2003 18:27:54 -0000 1.1.2.4 *************** *** 69,72 **** --- 69,73 ---- Object *InterfaceProxy::createObject() const { assert(0); + return 0; } *************** *** 112,119 **** --- 113,122 ---- hasht InterfaceProxy::getClassHash() const { assert(0); + return 0; } const char * InterfaceProxy::getClassName() const { assert(0); + return 0; } |
From: <de...@us...> - 2003-01-20 18:27:47
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Include/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv2142 Modified Files: Tag: simdata hash_map.h Log Message: no message Index: hash_map.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Attic/hash_map.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 *** hash_map.h 20 Jan 2003 05:53:12 -0000 1.1.2.4 --- hash_map.h 20 Jan 2003 18:27:43 -0000 1.1.2.5 *************** *** 15,20 **** #endif #else ! #ifdef WIN32 ! #include <hash_map.h> #define HASH_MAP std::hash_map #define HASH std::hash --- 15,20 ---- #endif #else ! #ifdef _MSC_VER ! #include <hash_map> #define HASH_MAP std::hash_map #define HASH std::hash |
From: <de...@us...> - 2003-01-20 18:27:12
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Include/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv1899 Modified Files: Tag: simdata Enum.h Log Message: no message Index: Enum.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Attic/Enum.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 *** Enum.h 20 Jan 2003 05:53:12 -0000 1.1.2.4 --- Enum.h 20 Jan 2003 18:27:09 -0000 1.1.2.5 *************** *** 28,31 **** --- 28,36 ---- #define __ENUM_H__ + # if defined(_MSC_VER) && (_MSC_VER <= 1200) + #pragma warning (disable : 4786) + # endif + + #include <string> #include <vector> |
From: <de...@us...> - 2003-01-20 18:27:02
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Source In directory sc8-pr-cvs1:/tmp/cvs-serv1797 Modified Files: Tag: simdata Date.cpp Log Message: no message Index: Date.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Attic/Date.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 *** Date.cpp 20 Jan 2003 04:06:53 -0000 1.1.2.2 --- Date.cpp 20 Jan 2003 18:26:56 -0000 1.1.2.3 *************** *** 31,34 **** --- 31,35 ---- #ifdef _WIN32 #include <Windows.h> + #include <ctime> static LARGE_INTEGER _tstart, _tend; static LARGE_INTEGER freq; *************** *** 506,510 **** *this = SimDate(dy, dm, dd, th, tm, ts); } ! catch (InvalidDate &e) { throw ParseException("SYNTAX ERROR: invalid date string"); } --- 507,511 ---- *this = SimDate(dy, dm, dd, th, tm, ts); } ! catch (InvalidDate) { throw ParseException("SYNTAX ERROR: invalid date string"); } |
From: <de...@us...> - 2003-01-20 18:26:44
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Include/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv1552 Modified Files: Tag: simdata Date.h Log Message: no message Index: Date.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Attic/Date.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 *** Date.h 19 Jan 2003 20:28:30 -0000 1.1.2.1 --- Date.h 20 Jan 2003 18:26:41 -0000 1.1.2.2 *************** *** 568,572 **** double getJulianDate() const { double j = getJulian(); ! float t = getTime() * F1p0_86000p0 + 0.5; return j + t; } --- 568,572 ---- double getJulianDate() const { double j = getJulian(); ! double t = getTime() * F1p0_86000p0 + 0.5; return j + t; } |
From: <de...@us...> - 2003-01-20 18:26:33
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Source In directory sc8-pr-cvs1:/tmp/cvs-serv1459 Modified Files: Tag: simdata DataArchive.cpp Log Message: no message Index: DataArchive.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Attic/DataArchive.cpp,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** DataArchive.cpp 20 Jan 2003 05:53:12 -0000 1.1.2.3 --- DataArchive.cpp 20 Jan 2003 18:26:30 -0000 1.1.2.4 *************** *** 26,29 **** --- 26,32 ---- NAMESPACE_SIMDATA + const int DataArchive::AS = 1024; + const int DataArchive::BUFFERSIZE = 4096; + const int DataArchive::BUFFERS = 10; DataArchive* g_defaultArchive; *************** *** 358,362 **** bool DataArchive::isClosed() { ! return closed; } --- 361,365 ---- bool DataArchive::isClosed() { ! return (closed != 0); } |
From: <de...@us...> - 2003-01-20 18:26:22
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Include/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv1393 Modified Files: Tag: simdata DataArchive.h Log Message: no message Index: DataArchive.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Attic/DataArchive.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 *** DataArchive.h 20 Jan 2003 04:56:49 -0000 1.1.2.3 --- DataArchive.h 20 Jan 2003 18:26:20 -0000 1.1.2.4 *************** *** 84,95 **** friend class PathPointerBase; ! /** ! template <class T> friend class PathPointer; ! template <class T> friend PathPointer<T> getObject(DataArchive&, const char*); ! */ ! static const int AS = 1024; ! static const int BUFFERSIZE = 4096; ! static const int BUFFERS = 10; TableEntry* table; FILE *f; --- 84,94 ---- friend class PathPointerBase; ! ! //template <class T> friend class PathPointer; ! //template <class T> friend PathPointer<T> getObject(DataArchive&, const char*); ! static const int AS; ! static const int BUFFERSIZE; ! static const int BUFFERS; TableEntry* table; FILE *f; *************** *** 99,103 **** int bytes; int closed; ! char* object_buffer[BUFFERS]; int n_buffer; hasht_map table_map; --- 98,102 ---- int bytes; int closed; ! char* object_buffer[10]; // vector<string> here? int n_buffer; hasht_map table_map; |
From: <de...@us...> - 2003-01-20 18:26:09
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Include/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv1296 Modified Files: Tag: simdata TypeAdapter.h Log Message: no message Index: TypeAdapter.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Attic/TypeAdapter.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 *** TypeAdapter.h 19 Jan 2003 20:28:30 -0000 1.1.2.1 --- TypeAdapter.h 20 Jan 2003 18:26:06 -0000 1.1.2.2 *************** *** 28,31 **** --- 28,35 ---- #define __TYPEADAPTER_H__ + #if defined(_MSC_VER) && (_MSC_VER <= 1200) + #pragma warning (disable : 4290 4786) + #endif + #include <string> #include <iostream> *************** *** 110,114 **** operator double const() const { DoubleCheck(); return var.d; } ! operator float const() const { DoubleCheck(); return var.d; } operator std::string const() const { StringCheck(); return s; } --- 114,118 ---- operator double const() const { DoubleCheck(); return var.d; } ! operator float const() const { DoubleCheck(); return static_cast<float>(var.d); } operator std::string const() const { StringCheck(); return s; } |