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: <sv...@ww...> - 2004-09-26 06:07:07
|
Author: mkrose Date: 2004-09-25 23:06:59 -0700 (Sat, 25 Sep 2004) New Revision: 1252 Modified: trunk/CSP/SimCore/Util/SConscript trunk/CSP/SimCore/Util/StringTools.cpp trunk/CSP/SimCore/Util/StringTools.h Log: Clean up string tools, add to build. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1252 Modified: trunk/CSP/SimCore/Util/SConscript =================================================================== --- trunk/CSP/SimCore/Util/SConscript 2004-09-26 06:00:09 UTC (rev 1251) +++ trunk/CSP/SimCore/Util/SConscript 2004-09-26 06:06:59 UTC (rev 1252) @@ -19,6 +19,7 @@ Import('env build') SOURCES = [ + 'StringTools.cpp', 'SynchronousUpdate.cpp' ] Modified: trunk/CSP/SimCore/Util/StringTools.cpp =================================================================== --- trunk/CSP/SimCore/Util/StringTools.cpp 2004-09-26 06:00:09 UTC (rev 1251) +++ trunk/CSP/SimCore/Util/StringTools.cpp 2004-09-26 06:06:59 UTC (rev 1252) @@ -1,63 +1,48 @@ -// Combat Simulator Project - FlightSim Demo -// Copyright (C) 2002 The Combat Simulator Project +// Combat Simulator Project +// Copyright (C) 2002, 2004 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 Tools.cpp + * @file StringTools.cpp * **/ -#include "Tools.h" +#include <SimCore/Util/StringTools.h> #include <ctype.h> #include <algorithm> -// catches non-existent files to open, displays an error and exits the program -FILE* fileopen(const char *cFilename, const char *cMode) -{ - FILE *f = fopen(cFilename, cMode); - - if (f==0) - { - printf("\n\n\nerror while opening file '%s'! Exiting program ....\n\n", cFilename); - exit(-1); - } - - return f; +void ConvertStringToUpper(std::string &str) { + std::transform(str.begin(), str.end(), str.begin(), ::toupper); } - -void ConvertStringToUpper(string & str) -{ - transform(str.begin(), str.end(), str.begin(), ::toupper); +void ConvertStringToLower(std::string &str) { + std::transform(str.begin(), str.end(), str.begin(), ::tolower); } - -StringTokenizer::StringTokenizer(const string &rStr, const string &rDelimiters) -{ - string::size_type lastPos(rStr.find_first_not_of(rDelimiters, 0)); - string::size_type pos(rStr.find_first_of(rDelimiters, lastPos)); - while (string::npos != pos || string::npos != lastPos) - { - push_back(rStr.substr(lastPos, pos - lastPos)); - lastPos = rStr.find_first_not_of(rDelimiters, pos); - pos = rStr.find_first_of(rDelimiters, lastPos); +StringTokenizer::StringTokenizer(const std::string &str, const std::string &delimiters) { + std::string::size_type lastPos(str.find_first_not_of(delimiters, 0)); + std::string::size_type pos(str.find_first_of(delimiters, lastPos)); + while (std::string::npos != pos || std::string::npos != lastPos) { + push_back(str.substr(lastPos, pos - lastPos)); + lastPos = str.find_first_not_of(delimiters, pos); + pos = str.find_first_of(delimiters, lastPos); } } Modified: trunk/CSP/SimCore/Util/StringTools.h =================================================================== --- trunk/CSP/SimCore/Util/StringTools.h 2004-09-26 06:00:09 UTC (rev 1251) +++ trunk/CSP/SimCore/Util/StringTools.h 2004-09-26 06:06:59 UTC (rev 1252) @@ -1,57 +1,51 @@ -// Combat Simulator Project - FlightSim Demo -// Copyright (C) 2002 The Combat Simulator Project +// Combat Simulator Project +// Copyright (C) 2002, 2004 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 Tools.h + * @file StringTools.h * **/ -#ifndef __TOOLS_H__ -#define __TOOLS_H__ +#ifndef __SIMCORE_UTIL_STRINGTOOLS_H__ +#define __SIMCORE_UTIL_STRINGTOOLS_H__ + #include <string> #include <deque> -#include <cstdio> -using namespace std; -typedef unsigned int uint; -typedef unsigned char uchar; -typedef unsigned short ushort; +/** Convert a string to uppercase (in place). + */ +void ConvertStringToUpper(std::string &str); +/** Convert a string to lowercase (in place). + */ +void ConvertStringToLower(std::string &str); -FILE* fileopen(const char *cFilename, const char *cMode); -void ConvertStringToUpper(string & str); - - -/** - * class StringTokenizer - * - * @author unknown +/** Tokenize a string, placing the tokens into a deque. */ -class StringTokenizer : public deque<string> -{ - public: - StringTokenizer(const string &rStr, const string &rDelimiters = " ,\n"); +class StringTokenizer: public std::deque<std::string> { +public: + StringTokenizer(const std::string &str, const std::string &delimiters = " ,\n"); }; -#endif // __TOOLS_H__ +#endif // __SIMCORE_UTIL_STRINGTOOLS_H__ |
From: <sv...@ww...> - 2004-09-26 06:00:24
|
Author: mkrose Date: 2004-09-25 23:00:09 -0700 (Sat, 25 Sep 2004) New Revision: 1251 Added: trunk/CSP/SimCore/Util/StringTools.cpp trunk/CSP/SimCore/Util/StringTools.h Log: Move Tools.* from CSPSim to SimCore/Utils/StringTools.* Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1251 Copied: trunk/CSP/SimCore/Util/StringTools.cpp (from rev 1239, trunk/CSP/CSPSim/Source/Tools.cpp) Copied: trunk/CSP/SimCore/Util/StringTools.h (from rev 1239, trunk/CSP/CSPSim/Include/Tools.h) |
From: <sv...@ww...> - 2004-09-26 05:55:44
|
Author: mkrose Date: 2004-09-25 22:55:37 -0700 (Sat, 25 Sep 2004) New Revision: 1250 Modified: trunk/CSP/SimCore/Battlefield/Battlefield.cpp trunk/CSP/SimCore/Battlefield/Battlefield.h trunk/CSP/SimCore/Battlefield/SceneManager.cpp trunk/CSP/SimCore/Battlefield/SceneManager.h trunk/CSP/SimCore/Battlefield/SimObject.cpp trunk/CSP/SimCore/Battlefield/SimObject.h trunk/CSP/SimCore/Util/Dispatch.h trunk/CSP/SimCore/Util/Log.h trunk/CSP/SimCore/Util/SynchronousUpdate.cpp trunk/CSP/SimCore/Util/SynchronousUpdate.h Log: Fix up include paths and a couple warnings. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1250 Modified: trunk/CSP/SimCore/Battlefield/Battlefield.cpp =================================================================== --- trunk/CSP/SimCore/Battlefield/Battlefield.cpp 2004-09-26 05:42:44 UTC (rev 1249) +++ trunk/CSP/SimCore/Battlefield/Battlefield.cpp 2004-09-26 05:55:37 UTC (rev 1250) @@ -22,8 +22,8 @@ * */ -#include "Battlefield.h" -#include "SceneManager.h" +#include <SimCore/Battlefield/Battlefield.h> +#include <SimCore/Battlefield/SceneManager.h> class Battlefield::ObjectWrapper: public Battlefield::QuadTreeChild { @@ -307,7 +307,7 @@ m_StaticIndex->insert(*wrapper); } -Battlefield::Unit Battlefield::getNextUnit(Unit const &unit, bool human, bool local, int category) { +Battlefield::Unit Battlefield::getNextUnit(Unit const &unit, bool human, bool local, int /*category*/) { UnitMap::iterator iter = m_UnitMap.find(unit->id()); if (iter == m_UnitMap.end()) return 0; UnitMap::iterator scan = iter; @@ -515,7 +515,7 @@ } } -void Battlefield::updateAggregationAgent(UnitWrapper *wrapper, GridPoint const &old_position, GridPoint const &new_position) { +void Battlefield::updateAggregationAgent(UnitWrapper *wrapper, GridPoint const &/*old_position*/, GridPoint const &new_position) { // only the owner of an object can update its aggregation state if (wrapper->unit()->isRemote()) return; Modified: trunk/CSP/SimCore/Battlefield/Battlefield.h =================================================================== --- trunk/CSP/SimCore/Battlefield/Battlefield.h 2004-09-26 05:42:44 UTC (rev 1249) +++ trunk/CSP/SimCore/Battlefield/Battlefield.h 2004-09-26 05:55:37 UTC (rev 1250) @@ -27,10 +27,9 @@ * - implement a threaded scene manager **/ -#ifndef __BATTLEFIELD_H__ -#define __BATTLEFIELD_H__ +#ifndef __SIMCORE_BATTLEFIELD_BATTLEFIELD_H__ +#define __SIMCORE_BATTLEFIELD_BATTLEFIELD_H__ -#include <limits> #include <map> #include <vector> @@ -38,8 +37,8 @@ #include <SimData/ScopedPointer.h> #include <SpatialIndex/QuadTree.h> -#include "SynchronousUpdate.h" -#include "SimObject.h" +#include <SimCore/Util/SynchronousUpdate.h> +#include <SimCore/Battlefield/SimObject.h> class SceneManager; @@ -483,6 +482,6 @@ GridPoint m_CameraGridPosition; }; -#endif // __BATTLEFIELD_H__ +#endif // __SIMCORE_BATTLEFIELD_BATTLEFIELD_H__ Modified: trunk/CSP/SimCore/Battlefield/SceneManager.cpp =================================================================== --- trunk/CSP/SimCore/Battlefield/SceneManager.cpp 2004-09-26 05:42:44 UTC (rev 1249) +++ trunk/CSP/SimCore/Battlefield/SceneManager.cpp 2004-09-26 05:55:37 UTC (rev 1250) @@ -23,8 +23,8 @@ **/ -#include "SceneManager.h" -#include "SimObject.h" +#include <SimCore/Battlefield/SceneManager.h> +#include <SimCore/Battlefield/SimObject.h> void SceneManager::setVisible(ObjectRef const& object, bool visible) { Modified: trunk/CSP/SimCore/Battlefield/SceneManager.h =================================================================== --- trunk/CSP/SimCore/Battlefield/SceneManager.h 2004-09-26 05:42:44 UTC (rev 1249) +++ trunk/CSP/SimCore/Battlefield/SceneManager.h 2004-09-26 05:55:37 UTC (rev 1250) @@ -22,8 +22,8 @@ * **/ -#ifndef __SCENEMANAGER_H__ -#define __SCENEMANAGER_H__ +#ifndef __SIMCORE_BATTLEFIELD_SCENEMANAGER_H__ +#define __SIMCORE_BATTLEFIELD_SCENEMANAGER_H__ #include <SimData/Ref.h> @@ -117,5 +117,5 @@ }; -#endif // __SCENEMANAGER_H__ +#endif // __SIMCORE_BATTLEFIELD_SCENEMANAGER_H__ Modified: trunk/CSP/SimCore/Battlefield/SimObject.cpp =================================================================== --- trunk/CSP/SimCore/Battlefield/SimObject.cpp 2004-09-26 05:42:44 UTC (rev 1249) +++ trunk/CSP/SimCore/Battlefield/SimObject.cpp 2004-09-26 05:55:37 UTC (rev 1250) @@ -23,8 +23,8 @@ **/ -#include "SimObject.h" -#include "Log.h" +#include <SimCore/Battlefield/SimObject.h> +#include <SimCore/Util/Log.h> #include <sstream> Modified: trunk/CSP/SimCore/Battlefield/SimObject.h =================================================================== --- trunk/CSP/SimCore/Battlefield/SimObject.h 2004-09-26 05:42:44 UTC (rev 1249) +++ trunk/CSP/SimCore/Battlefield/SimObject.h 2004-09-26 05:55:37 UTC (rev 1250) @@ -22,13 +22,13 @@ * **/ -#ifndef __SIMOBJECT_H__ -#define __SIMOBJECT_H__ +#ifndef __SIMCORE_BATTLEFIELD_SIMOBJECT_H__ +#define __SIMCORE_BATTLEFIELD_SIMOBJECT_H__ -#include "SynchronousUpdate.h" -#include "Dispatch.h" -#include "Log.h" +#include <SimCore/Util/SynchronousUpdate.h> +#include <SimCore/Util/Dispatch.h> +#include <SimCore/Util/Log.h> #include <SimData/Object.h> #include <SimData/Vector3.h> @@ -224,7 +224,7 @@ * @returns sleep time between updates (return 0.0 for * fastest possible updating). */ - virtual double onUpdate(double dt) { return 10.0; } + virtual double onUpdate(double dt) { dt=dt; return 10.0; } public: @@ -302,5 +302,5 @@ return os << object._debugId(); } -#endif // __SIMOBJECT_H__ +#endif // __SIMCORE_BATTLEFIELD_SIMOBJECT_H__ Modified: trunk/CSP/SimCore/Util/Dispatch.h =================================================================== --- trunk/CSP/SimCore/Util/Dispatch.h 2004-09-26 05:42:44 UTC (rev 1249) +++ trunk/CSP/SimCore/Util/Dispatch.h 2004-09-26 05:55:37 UTC (rev 1250) @@ -62,8 +62,8 @@ **/ -#ifndef __DISPATCH_H__ -#define __DISPATCH_H__ +#ifndef __SIMCORE_UTIL_DISPATCH_H__ +#define __SIMCORE_UTIL_DISPATCH_H__ #include <SimData/TaggedRecord.h> @@ -98,7 +98,7 @@ } protected: - virtual bool childDispatch(simdata::Ref<simdata::TaggedRecord> const &record) { + virtual bool childDispatch(simdata::Ref<simdata::TaggedRecord> const &/*record*/) { return false; } @@ -107,5 +107,5 @@ }; -#endif // __DISPATCH_H__ +#endif // __SIMCORE_UTIL_DISPATCH_H__ Modified: trunk/CSP/SimCore/Util/Log.h =================================================================== --- trunk/CSP/SimCore/Util/Log.h 2004-09-26 05:42:44 UTC (rev 1249) +++ trunk/CSP/SimCore/Util/Log.h 2004-09-26 05:55:37 UTC (rev 1250) @@ -23,8 +23,8 @@ **/ -#ifndef __CSP_LOG_H__ -#define __CSP_LOG_H__ +#ifndef __SIMCORE_UTIL_LOG_H__ +#define __SIMCORE_UTIL_LOG_H__ #include <SimData/Log.h> @@ -87,6 +87,6 @@ ::csplog().entry(simdata::LOG_##P, CSP_##C, __FILE__, __LINE__) << M << std::endl -#endif // __CSP_LOG_H__ +#endif // __SIMCORE_UTIL_LOG_H__ Modified: trunk/CSP/SimCore/Util/SynchronousUpdate.cpp =================================================================== --- trunk/CSP/SimCore/Util/SynchronousUpdate.cpp 2004-09-26 05:42:44 UTC (rev 1249) +++ trunk/CSP/SimCore/Util/SynchronousUpdate.cpp 2004-09-26 05:55:37 UTC (rev 1250) @@ -22,8 +22,8 @@ * **/ -#include "SynchronousUpdate.h" -#include "Log.h" +#include <SimCore/Util/SynchronousUpdate.h> +#include <SimCore/Util/Log.h> int UpdateProxy::update(double time) { Modified: trunk/CSP/SimCore/Util/SynchronousUpdate.h =================================================================== --- trunk/CSP/SimCore/Util/SynchronousUpdate.h 2004-09-26 05:42:44 UTC (rev 1249) +++ trunk/CSP/SimCore/Util/SynchronousUpdate.h 2004-09-26 05:55:37 UTC (rev 1250) @@ -23,8 +23,8 @@ **/ -#ifndef __SYNCHRONOUSUPDATE_H__ -#define __SYNCHRONOUSUPDATE_H__ +#ifndef __SIMCORE_UTIL_SYNCHRONOUSUPDATE_H__ +#define __SIMCORE_UTIL_SYNCHRONOUSUPDATE_H__ #include <SimData/Ref.h> @@ -234,5 +234,5 @@ }; -#endif // __SYNCHRONOUSUPDATE_H__ +#endif // __SIMCORE_UTIL_SYNCHRONOUSUPDATE_H__ |
From: <sv...@ww...> - 2004-09-26 05:42:56
|
Author: mkrose Date: 2004-09-25 22:42:44 -0700 (Sat, 25 Sep 2004) New Revision: 1249 Added: trunk/CSP/SimCore/Battlefield/Battlefield.cpp trunk/CSP/SimCore/Battlefield/Battlefield.h trunk/CSP/SimCore/Battlefield/SceneManager.cpp trunk/CSP/SimCore/Battlefield/SceneManager.h trunk/CSP/SimCore/Battlefield/SimObject.cpp trunk/CSP/SimCore/Battlefield/SimObject.h trunk/CSP/SimCore/Util/Dispatch.h trunk/CSP/SimCore/Util/Log.h trunk/CSP/SimCore/Util/SynchronousUpdate.cpp trunk/CSP/SimCore/Util/SynchronousUpdate.h Log: Ok, readded as copies from CSPSim. Should preserve the history now. They will be removed from CSPSim in a separate step. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1249 Copied: trunk/CSP/SimCore/Battlefield/Battlefield.cpp (from rev 1239, trunk/CSP/CSPSim/Source/Battlefield.cpp) Copied: trunk/CSP/SimCore/Battlefield/Battlefield.h (from rev 1239, trunk/CSP/CSPSim/Include/Battlefield.h) Copied: trunk/CSP/SimCore/Battlefield/SceneManager.cpp (from rev 1239, trunk/CSP/CSPSim/Source/SceneManager.cpp) Copied: trunk/CSP/SimCore/Battlefield/SceneManager.h (from rev 1239, trunk/CSP/CSPSim/Include/SceneManager.h) Copied: trunk/CSP/SimCore/Battlefield/SimObject.cpp (from rev 1239, trunk/CSP/CSPSim/Source/SimObject.cpp) Copied: trunk/CSP/SimCore/Battlefield/SimObject.h (from rev 1240, trunk/CSP/CSPSim/Include/SimObject.h) Copied: trunk/CSP/SimCore/Util/Dispatch.h (from rev 1239, trunk/CSP/CSPSim/Include/Dispatch.h) Copied: trunk/CSP/SimCore/Util/Log.h (from rev 1239, trunk/CSP/CSPSim/Include/Log.h) =================================================================== --- trunk/CSP/CSPSim/Include/Log.h 2004-09-25 05:02:03 UTC (rev 1239) +++ trunk/CSP/SimCore/Util/Log.h 2004-09-26 05:42:44 UTC (rev 1249) @@ -0,0 +1,92 @@ +// 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 Log.h + * + **/ + + +#ifndef __CSP_LOG_H__ +#define __CSP_LOG_H__ + +#include <SimData/Log.h> + +#undef ERROR + +/** + * Define the possible classes/categories of logging messages + */ +enum { + CSP_NONE = 0x00000000, + + CSP_AUDIO = 0x00000001, + CSP_OPENGL = 0x00000002, + CSP_PROFILE = 0x00000004, + CSP_FILE = 0x00000008, + CSP_INPUT = 0x00000010, + CSP_MATH = 0x00000020, + CSP_NETWORK = 0x00000040, + CSP_SHARED = 0x00000080, + CSP_WINDOW = 0x00000100, + CSP_FACTORY = 0x00000200, + CSP_FRAMEWORK = 0x00000400, + CSP_LOG = 0x00000800, + CSP_TERRAIN = 0x00001000, + CSP_APP = 0x00002000, + CSP_GEOMETRY = 0x00004000, + CSP_PHYSICS = 0x00008000, + CSP_UNDEFD = 0x00010000, // for range checking + CSP_SCENE = 0x00020000, + CSP_BATTLEFIELD = 0x00040000, + CSP_OBJECT = 0x00080000, + + CSP_ALL = 0xFFFFFFFF +}; + + + +/** + * @relates LogStream + * Return the one and only csp LogStream instance. + * We use a function together with lazy construction so we are assured + * that cerr has been initialised. + * @return csp LogStream + */ +inline simdata::LogStream& csplog() { + static simdata::LogStream *log_stream = 0; + if (log_stream == 0) log_stream = simdata::LogStream::getOrCreateNamedLog("CSP"); + return *log_stream; +} + + +#ifdef CSP_NDEBUG +# define CSP_NOTEWORTHY(C,P) false +#else +# define CSP_NOTEWORTHY(C,P) ::csplog().isNoteworthy(simdata::LOG_##P, CSP_##C) +#endif + +# define CSP_LOG(C,P,M) \ + if (CSP_NOTEWORTHY(C, P)) \ + ::csplog().entry(simdata::LOG_##P, CSP_##C, __FILE__, __LINE__) << M << std::endl + + +#endif // __CSP_LOG_H__ + + Copied: trunk/CSP/SimCore/Util/SynchronousUpdate.cpp (from rev 1239, trunk/CSP/CSPSim/Source/SynchronousUpdate.cpp) Copied: trunk/CSP/SimCore/Util/SynchronousUpdate.h (from rev 1239, trunk/CSP/CSPSim/Include/SynchronousUpdate.h) |
From: <sv...@ww...> - 2004-09-26 05:39:48
|
Author: mkrose Date: 2004-09-25 22:39:33 -0700 (Sat, 25 Sep 2004) New Revision: 1248 Removed: trunk/CSP/SimCore/Battlefield/Battlefield.cpp trunk/CSP/SimCore/Battlefield/Battlefield.h trunk/CSP/SimCore/Battlefield/SceneManager.cpp trunk/CSP/SimCore/Battlefield/SceneManager.h trunk/CSP/SimCore/Battlefield/SimObject.cpp trunk/CSP/SimCore/Battlefield/SimObject.h trunk/CSP/SimCore/Util/Dispatch.h trunk/CSP/SimCore/Util/Log.h trunk/CSP/SimCore/Util/SynchronousUpdate.cpp trunk/CSP/SimCore/Util/SynchronousUpdate.h Log: Ugh. Committed cpp and h files by accident under SimCore; svn isn't exactly intuitive when adding new directories! Removing them so that they can be properly branched from CSPSim in another changelist. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1248 Diff omitted (72815 bytes). |
From: <sv...@ww...> - 2004-09-26 05:25:42
|
Author: mkrose Date: 2004-09-25 22:25:22 -0700 (Sat, 25 Sep 2004) New Revision: 1247 Added: trunk/CSP/SimCore/ trunk/CSP/SimCore/Battlefield/ trunk/CSP/SimCore/Battlefield/Battlefield.cpp trunk/CSP/SimCore/Battlefield/Battlefield.h trunk/CSP/SimCore/Battlefield/SConscript trunk/CSP/SimCore/Battlefield/SceneManager.cpp trunk/CSP/SimCore/Battlefield/SceneManager.h trunk/CSP/SimCore/Battlefield/SimObject.cpp trunk/CSP/SimCore/Battlefield/SimObject.h trunk/CSP/SimCore/SConscript trunk/CSP/SimCore/Util/ trunk/CSP/SimCore/Util/Dispatch.h trunk/CSP/SimCore/Util/Log.h trunk/CSP/SimCore/Util/SConscript trunk/CSP/SimCore/Util/SynchronousUpdate.cpp trunk/CSP/SimCore/Util/SynchronousUpdate.h Log: Add a new package skeleton for base components that may be common to multiple CSP applications. Packages within SimCore can be interdependent, and can depend on higher level libraries such as SimTools, SimData, and SpatialIndex. The Battlefield and Util components will be moved from CSPSim in a subsequent changelist. Eventually much of the generic utility code in CSPSim that didn't quite fit in SimData will migrate to SimCore. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1247 Diff omitted (76567 bytes). |
From: <sv...@ww...> - 2004-09-25 21:29:36
|
Author: mkrose Date: 2004-09-25 14:29:26 -0700 (Sat, 25 Sep 2004) New Revision: 1246 Modified: trunk/CSP/SConstruct trunk/CSP/SimData/CHANGES.current trunk/CSP/SimData/SConscript trunk/CSP/SimData/SimData/Tests/TestSuites.py trunk/CSP/SimData/SimData/Tests/TypeTests.py Log: Add a tests build target for scons to run all unittests (currently only simdata). Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1246 Modified: trunk/CSP/SConstruct =================================================================== --- trunk/CSP/SConstruct 2004-09-25 09:26:37 UTC (rev 1245) +++ trunk/CSP/SConstruct 2004-09-25 21:29:26 UTC (rev 1246) @@ -27,6 +27,7 @@ scons IndexServer build the master server needed for multiplayer scons all build everything scons dox generate doxygen documentation + scons test run unittests """ from tools import build Modified: trunk/CSP/SimData/CHANGES.current =================================================================== --- trunk/CSP/SimData/CHANGES.current 2004-09-25 09:26:37 UTC (rev 1245) +++ trunk/CSP/SimData/CHANGES.current 2004-09-25 21:29:26 UTC (rev 1246) @@ -1,6 +1,10 @@ Version 0.4.0 (in progress) =========================== +2004-09-25: onsight + * Add scons build target 'test' which runs the simdata unittests + (so far). + 2004-09-24: onsight * Minor cleanups, mostly doxygen related. Modified: trunk/CSP/SimData/SConscript =================================================================== --- trunk/CSP/SimData/SConscript 2004-09-25 09:26:37 UTC (rev 1245) +++ trunk/CSP/SimData/SConscript 2004-09-25 21:29:26 UTC (rev 1246) @@ -37,4 +37,6 @@ build.BuildModules(env, MODULES) - +runtests_action = Action('python $SOURCE', lambda a,b,c: '\n<<Running SimData Tests>>') +runtests = env.Command('RUNTESTS', 'runtests.py', runtests_action, ENV={'SIMDATA_LOGPRIORITY': '4'}) +env.Alias('test', runtests) Modified: trunk/CSP/SimData/SimData/Tests/TestSuites.py =================================================================== --- trunk/CSP/SimData/SimData/Tests/TestSuites.py 2004-09-25 09:26:37 UTC (rev 1245) +++ trunk/CSP/SimData/SimData/Tests/TestSuites.py 2004-09-25 21:29:26 UTC (rev 1246) @@ -13,5 +13,5 @@ suites.append(suite) def Run(): - runner = unittest.TextTestRunner() + runner = unittest.TextTestRunner(descriptions=1, verbosity=2) runner.run(unittest.TestSuite(suites)) Modified: trunk/CSP/SimData/SimData/Tests/TypeTests.py =================================================================== --- trunk/CSP/SimData/SimData/Tests/TypeTests.py 2004-09-25 09:26:37 UTC (rev 1245) +++ trunk/CSP/SimData/SimData/Tests/TypeTests.py 2004-09-25 21:29:26 UTC (rev 1246) @@ -40,6 +40,7 @@ self.assertEqual(str(d), "1903/01/09 05:06:07z") self.assertEqual(d.typeString(), "type::SimDate") def testErrors(self): + """Test error handling for invalid dates and times""" def catch(code, err=1): caught = 0 try: @@ -61,6 +62,7 @@ catch("SimData.SimDate(2003, 2, 0, 22, 51, 7)") catch("SimData.SimDate(2003, 10, 32, 22, 51, 7)") def testRollover(self): + """Test date rollover.""" sd = SimData.SimDate test = self.assertEqual test(sd(2003, 3, 1, -1, -1, -1), sd(2003, 2, 28, 22, 58, 59)) |
From: <sv...@ww...> - 2004-09-25 09:26:45
|
Author: mkrose Date: 2004-09-25 02:26:37 -0700 (Sat, 25 Sep 2004) New Revision: 1245 Added: trunk/CSP/SimData/Source/SConscript Log: Oops, forgot one of the scons scripts. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1245 Added: trunk/CSP/SimData/Source/SConscript =================================================================== --- trunk/CSP/SimData/Source/SConscript 2004-09-25 09:23:03 UTC (rev 1244) +++ trunk/CSP/SimData/Source/SConscript 2004-09-25 09:26:37 UTC (rev 1245) @@ -0,0 +1,72 @@ +# -*- python -*- +# +# Copyright 2004 Mark Rose <mk...@us...> +# +# 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 + +from glob import glob + +Import('env build') + + +SOURCES = [ + 'BaseType.cpp', + 'DataArchive.cpp', + 'DataManager.cpp', + 'Date.cpp', + 'Enum.cpp', + 'ExceptionBase.cpp', + 'External.cpp', + 'FileUtility.cpp', + 'GeoPos.cpp', + 'HashUtility.cpp', + 'InterfaceRegistry.cpp', + 'Interpolate.cpp', + 'Key.cpp', + 'Link.cpp', + 'List.cpp', + 'LogStream.cpp', + 'LUT.cpp', + 'Math.cpp', + 'Matrix3.cpp', + 'Noise.cpp', + 'Object.cpp', + 'Path.cpp', + 'Quat.cpp', + 'Random.cpp', + 'Real.cpp', + 'ThreadBase.cpp', + 'Timing.cpp', + 'TypeAdapter.cpp', + 'Vector3.cpp', + 'Version.cpp', +] + + +cSimData_wrap, cSimData_module = env.Swig('cSimData.i', SWIGINCLUDES='-ISimData/Include') +copy_module = env.CopyFile('#/SimData/SimData/cSimData.py', cSimData_module) +env.Alias(['shared', 'all'], copy_module) +INTERFACES = [env.SwigWrapper(cSimData_wrap)] + +shlib = env.SharedLibrary('#/SimData/SimData/cSimData', INTERFACES + SOURCES) +build.MarkVersionSource(env, shlib) +env.Alias(['shared', 'all'], shlib) + +if not build.IsWindows(env): + stlib = env.StaticLibrary('#/SimData/SimData/SimData', SOURCES) + build.MarkVersionSource(env, stlib) + env.Alias('static', stlib) + env.Clean('all', stlib) + |
From: <sv...@ww...> - 2004-09-25 09:23:14
|
Author: mkrose Date: 2004-09-25 02:23:03 -0700 (Sat, 25 Sep 2004) New Revision: 1244 Added: trunk/CSP/CSPChunkLod/SConscript trunk/CSP/CSPSim/SConscript trunk/CSP/CSPSim/Source/SConscript trunk/CSP/CSPSim/__init__.py trunk/CSP/Demeter/SConscript trunk/CSP/README trunk/CSP/SConstruct trunk/CSP/SimData/SConscript trunk/CSP/SimData/SConstruct.old trunk/CSP/SimData/Source/SConscript.old trunk/CSP/SimNet/SConscript trunk/CSP/SpatialIndex/SConscript trunk/CSP/tools/build.py Removed: trunk/CSP/SimData/SConstruct trunk/CSP/SimData/Source/SConscript Modified: trunk/CSP/CSPSim/Bin/CSPSim.py trunk/CSP/CSPSim/Bin/ShellEnvironment.py trunk/CSP/CSPSim/Bin/TestObjects.py trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Include/CSPSim.i trunk/CSP/CSPSim/Source/CSPSim.cpp trunk/CSP/CSPSim/Source/DemeterTerrain.cpp trunk/CSP/CSPSim/Source/DynamicObject.cpp trunk/CSP/CSPSim/Source/Exception.cpp trunk/CSP/CSPSim/Source/System.cpp trunk/CSP/CSPSim/Source/cCSP.i trunk/CSP/CSPSim/configure.win.py trunk/CSP/Demeter/DemeterDrawable.cpp trunk/CSP/Demeter/Terrain.cpp trunk/CSP/Demeter/aclocal.m4 trunk/CSP/Demeter/configure trunk/CSP/SimData/CHANGES.current Log: Add a scons build system for all of CSP under linux. Change the include path for Demeter so that includes are prefixed by "Demeter/". Change the cCSP and SimData module import paths to use the new CSP.py bootstrap module. You need to run setup.py first for this to work. Add a top level README with basic build info (needs much work). Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1244 Diff omitted (159416 bytes). |
From: <sv...@ww...> - 2004-09-25 08:24:12
|
Author: mkrose Date: 2004-09-25 01:24:04 -0700 (Sat, 25 Sep 2004) New Revision: 1243 Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Tools/Terrain/dem2dat/Makefile trunk/CSP/CSPSim/Tools/Terrain/tile/Makefile Log: Add 'clean' targets to tools makefiles. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1243 Modified: trunk/CSP/CSPSim/CHANGES.current =================================================================== --- trunk/CSP/CSPSim/CHANGES.current 2004-09-25 08:20:20 UTC (rev 1242) +++ trunk/CSP/CSPSim/CHANGES.current 2004-09-25 08:24:04 UTC (rev 1243) @@ -3,6 +3,7 @@ 2004-09-24: onsight * Fix a few compiler warnings under gcc. + * Add 'clean' target to tools makefiles. 2004-09-18: delta * Updated VisualStudio/CSPSimDLL/CSPSimDLL.vcproj linking onto Modified: trunk/CSP/CSPSim/Tools/Terrain/dem2dat/Makefile =================================================================== --- trunk/CSP/CSPSim/Tools/Terrain/dem2dat/Makefile 2004-09-25 08:20:20 UTC (rev 1242) +++ trunk/CSP/CSPSim/Tools/Terrain/dem2dat/Makefile 2004-09-25 08:24:04 UTC (rev 1243) @@ -20,3 +20,5 @@ dem2dat_wrap.cxx: dem2dat.i dem2dat.h $(SWIG) -c -c++ -python -noexcept dem2dat.i +clean: + $(RM) dem2dat_wrap.o dem2dat dem2dat_wrap.cxx dem2dat.py Modified: trunk/CSP/CSPSim/Tools/Terrain/tile/Makefile =================================================================== --- trunk/CSP/CSPSim/Tools/Terrain/tile/Makefile 2004-09-25 08:20:20 UTC (rev 1242) +++ trunk/CSP/CSPSim/Tools/Terrain/tile/Makefile 2004-09-25 08:24:04 UTC (rev 1243) @@ -7,4 +7,5 @@ csptile: tile.cpp g++ -W -Wall -O2 -g $^ -o $@ -I$(SIMDATA_INC) -L$(SIMDATA_LIB) -lSimData -lz -lpthread - +clean: + $(RM) csptile |
From: <sv...@ww...> - 2004-09-25 08:20:30
|
Author: mkrose Date: 2004-09-25 01:20:20 -0700 (Sat, 25 Sep 2004) New Revision: 1242 Removed: trunk/CSP/tools/bootstrap.py Modified: trunk/CSP/tools/pyrun trunk/CSP/tools/subset trunk/CSP/tools/trace trunk/CSP/tools/undiff Log: Remove explicit bootstrap module. Use the CSP.py bootstrap module installed by setup.py instead. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1242 Deleted: trunk/CSP/tools/bootstrap.py =================================================================== --- trunk/CSP/tools/bootstrap.py 2004-09-25 05:11:06 UTC (rev 1241) +++ trunk/CSP/tools/bootstrap.py 2004-09-25 08:20:20 UTC (rev 1242) @@ -1,15 +0,0 @@ -import sys -import os.path - -try: - import CSP -except: - dn = os.path.dirname - root = dn(dn(dn(__file__))) - sys.path.insert(0, root) - try: - import CSP - except: - print 'Unable to import the main CSP module. Check that you have' - print 'a complete working copy.' - sys.exit(1) Modified: trunk/CSP/tools/pyrun =================================================================== --- trunk/CSP/tools/pyrun 2004-09-25 05:11:06 UTC (rev 1241) +++ trunk/CSP/tools/pyrun 2004-09-25 08:20:20 UTC (rev 1242) @@ -37,7 +37,6 @@ import zipfile from modulefinder import ModuleFinder -import bootstrap from CSP.base import app Modified: trunk/CSP/tools/subset =================================================================== --- trunk/CSP/tools/subset 2004-09-25 05:11:06 UTC (rev 1241) +++ trunk/CSP/tools/subset 2004-09-25 08:20:20 UTC (rev 1242) @@ -30,10 +30,6 @@ Run "%(prog)s help <command>" for help on a specific command. """ - -# setup CSP -import bootstrap - from CSP.base import app from CSP.tools import subcmd Modified: trunk/CSP/tools/trace =================================================================== --- trunk/CSP/tools/trace 2004-09-25 05:11:06 UTC (rev 1241) +++ trunk/CSP/tools/trace 2004-09-25 08:20:20 UTC (rev 1242) @@ -48,8 +48,6 @@ import re import os.path -import bootstrap - from CSP.base import app @@ -245,7 +243,7 @@ input = sys.stdin.readlines() except KeyboardInterrupt: return 0 - + dir = app.options.dir stack_trace = StackTrace() stack_trace.process(input, dir) Modified: trunk/CSP/tools/undiff =================================================================== --- trunk/CSP/tools/undiff 2004-09-25 05:11:06 UTC (rev 1241) +++ trunk/CSP/tools/undiff 2004-09-25 08:20:20 UTC (rev 1242) @@ -36,7 +36,6 @@ import sys import os -import bootstrap from CSP.base import app |
From: <sv...@ww...> - 2004-09-25 05:11:17
|
Author: mkrose Date: 2004-09-24 22:11:06 -0700 (Fri, 24 Sep 2004) New Revision: 1241 Modified: trunk/CSP/CSPChunkLod/src/osgChunkLod/ChunkLodDrawable.cpp trunk/CSP/CSPChunkLod/src/osgChunkLod/TextureQuadTree.cpp Log: Fix a couple gcc warnings in CSPChunkLod. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1241 Modified: trunk/CSP/CSPChunkLod/src/osgChunkLod/ChunkLodDrawable.cpp =================================================================== --- trunk/CSP/CSPChunkLod/src/osgChunkLod/ChunkLodDrawable.cpp 2004-09-25 05:09:26 UTC (rev 1240) +++ trunk/CSP/CSPChunkLod/src/osgChunkLod/ChunkLodDrawable.cpp 2004-09-25 05:11:06 UTC (rev 1241) @@ -148,14 +148,14 @@ osg::Timer_t update_t = t.tick(); tree->update (viewpoint, state); - osg::Timer_t render_t = t.tick(); + //osg::Timer_t render_t = t.tick(); _triangles_rendered = tree->render(state, *_details); _triangle_count += _triangles_rendered; float dt = t.delta_s(update_t, t.tick()); if (dt > 0.0030) { - float utime = t.delta_s(update_t, render_t) * 1000.0; + //float utime = t.delta_s(update_t, render_t) * 1000.0; dt *= 1000.0; //std::cout << "PAUSE c-lod render " << dt << " ms (" << utime << ", " << (dt - utime) << ")\n"; } Modified: trunk/CSP/CSPChunkLod/src/osgChunkLod/TextureQuadTree.cpp =================================================================== --- trunk/CSP/CSPChunkLod/src/osgChunkLod/TextureQuadTree.cpp 2004-09-25 05:09:26 UTC (rev 1240) +++ trunk/CSP/CSPChunkLod/src/osgChunkLod/TextureQuadTree.cpp 2004-09-25 05:11:06 UTC (rev 1241) @@ -210,7 +210,7 @@ jmd.decompress(); osg::Image* img = new osg::Image(); - unsigned int pf; + unsigned int pf = 0; if (jmd.depth == 1) pf = GL_LUMINANCE; else if (jmd.depth == 2) pf = GL_LUMINANCE_ALPHA; else if (jmd.depth == 3) pf = GL_RGB; |
From: <sv...@ww...> - 2004-09-25 05:09:41
|
Author: mkrose Date: 2004-09-24 22:09:26 -0700 (Fri, 24 Sep 2004) New Revision: 1240 Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Include/Bus.h trunk/CSP/CSPSim/Include/DynamicObject.h trunk/CSP/CSPSim/Include/Engine.h trunk/CSP/CSPSim/Include/SimObject.h Log: Fix a few compiler warnings in CSPSim under gcc. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1240 Modified: trunk/CSP/CSPSim/CHANGES.current =================================================================== --- trunk/CSP/CSPSim/CHANGES.current 2004-09-25 05:02:03 UTC (rev 1239) +++ trunk/CSP/CSPSim/CHANGES.current 2004-09-25 05:09:26 UTC (rev 1240) @@ -1,17 +1,20 @@ Version 0.4.0 (in progress) =========================== +2004-09-24: onsight + * Fix a few compiler warnings under gcc. + 2004-09-18: delta * Updated VisualStudio/CSPSimDLL/CSPSimDLL.vcproj linking onto - CSPSim/lib/SpatialIndex(d).lib. - - * A few changes in the header files to prevent some microsoft - specific compiler conflicts which finally cleaned the code. - + CSPSim/lib/SpatialIndex(d).lib. + + * A few changes in the header files to prevent some microsoft + specific compiler conflicts which finally cleaned the code. + * Fixed a few cast warnings in Projection.h. - + * Replaced the forward declaration of ObjectModel by a #include - "ObjectModel.h" in Include/Theater/FeatureObjectModel.h. + "ObjectModel.h" in Include/Theater/FeatureObjectModel.h. 2004-09-12: onsight * removed VirtualBattlefield.* Modified: trunk/CSP/CSPSim/Include/Bus.h =================================================================== --- trunk/CSP/CSPSim/Include/Bus.h 2004-09-25 05:02:03 UTC (rev 1239) +++ trunk/CSP/CSPSim/Include/Bus.h 2004-09-25 05:09:26 UTC (rev 1240) @@ -223,7 +223,7 @@ MASK_HANDLER = 0x00010000, MASK_PUSH = 0x00020000, MASK_PULL = 0x00040000, - MASK_DIRTY = 0x00080000, + MASK_DIRTY = 0x00080000 }; protected: Modified: trunk/CSP/CSPSim/Include/DynamicObject.h =================================================================== --- trunk/CSP/CSPSim/Include/DynamicObject.h 2004-09-25 05:02:03 UTC (rev 1239) +++ trunk/CSP/CSPSim/Include/DynamicObject.h 2004-09-25 05:09:26 UTC (rev 1240) @@ -94,9 +94,8 @@ void setVehicleCore(SystemsModel::Ref); - protected: - Bus::Ref DynamicObject::getBus(); + Bus::Ref getBus(); public: BEGIN_SIMDATA_XML_VIRTUAL_INTERFACE(DynamicObject) Modified: trunk/CSP/CSPSim/Include/Engine.h =================================================================== --- trunk/CSP/CSPSim/Include/Engine.h 2004-09-25 05:02:03 UTC (rev 1239) +++ trunk/CSP/CSPSim/Include/Engine.h 2004-09-25 05:09:26 UTC (rev 1240) @@ -87,7 +87,7 @@ void setAltitude(float altitude) { m_Altitude = altitude; } simdata::Vector3 getThrust() const; - simdata::Vector3 const &Engine::getSmokeEmitterLocation() const; + simdata::Vector3 const &getSmokeEmitterLocation() const; }; Modified: trunk/CSP/CSPSim/Include/SimObject.h =================================================================== --- trunk/CSP/CSPSim/Include/SimObject.h 2004-09-25 05:02:03 UTC (rev 1239) +++ trunk/CSP/CSPSim/Include/SimObject.h 2004-09-25 05:09:26 UTC (rev 1240) @@ -52,7 +52,7 @@ TYPE_AIR_UNIT, TYPE_MUD_UNIT, TYPE_SEA_UNIT, - TYPE_STATIC, + TYPE_STATIC } TypeId; private: @@ -76,7 +76,7 @@ // immutable settings F_STATIC = 0x00010000, - F_AIR = 0x00020000, // air object (airplane or helo) + F_AIR = 0x00020000 // air object (airplane or helo) }; void setSceneFlag(bool flag) { setFlags(F_INSCENE, flag); } |
From: <sv...@ww...> - 2004-09-25 05:02:16
|
Author: mkrose Date: 2004-09-24 22:02:03 -0700 (Fri, 24 Sep 2004) New Revision: 1239 Modified: trunk/CSP/SimData/CHANGES.current trunk/CSP/SimData/Include/SimData/Composite.h trunk/CSP/SimData/Include/SimData/Date.h trunk/CSP/SimData/Include/SimData/Key.h trunk/CSP/SimData/Include/SimData/Properties.h trunk/CSP/SimData/Include/SimData/TaggedRecordRegistry.h trunk/CSP/SimData/Include/SimData/Vector3.h trunk/CSP/SimData/Source/Real.cpp trunk/CSP/SimData/Source/Version.cpp Log: Minor SimData cleanups, mostly doxygen related. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1239 Modified: trunk/CSP/SimData/CHANGES.current =================================================================== --- trunk/CSP/SimData/CHANGES.current 2004-09-24 05:04:28 UTC (rev 1238) +++ trunk/CSP/SimData/CHANGES.current 2004-09-25 05:02:03 UTC (rev 1239) @@ -1,9 +1,12 @@ Version 0.4.0 (in progress) =========================== +2004-09-24: onsight + * Minor cleanups, mostly doxygen related. + 2004-09-16: delta - * Tried to reduce the impact of including windows API headers on the - code. + * Tried to reduce the impact of including windows API headers on the + code. 2004-09-12: onsight * Add an interface for creating and retrieving log streams based on Modified: trunk/CSP/SimData/Include/SimData/Composite.h =================================================================== --- trunk/CSP/SimData/Include/SimData/Composite.h 2004-09-24 05:04:28 UTC (rev 1238) +++ trunk/CSP/SimData/Include/SimData/Composite.h 2004-09-25 05:02:03 UTC (rev 1239) @@ -429,13 +429,13 @@ template <class N> -void VisitorCore<N>::descend(CompositeBase<N> &node) { +void VisitorCore<N>::descend(Node &node) { node.descend(this); }; template <class N> -void VisitorCore<N>::ascend(CompositeBase<N> &node) { +void VisitorCore<N>::ascend(Node &node) { node.ascend(this); }; Modified: trunk/CSP/SimData/Include/SimData/Date.h =================================================================== --- trunk/CSP/SimData/Include/SimData/Date.h 2004-09-24 05:04:28 UTC (rev 1238) +++ trunk/CSP/SimData/Include/SimData/Date.h 2004-09-25 05:02:03 UTC (rev 1239) @@ -912,11 +912,15 @@ /** Parse date/time string from XML cdata. * * The format is either: - * <Date name='...'>yyyy-mm-dd hh-mm-ss.ms</Date> - * where '.ms' is optional, or: - * <Date name='...'>yyyy-mm-dd</Date> + * @code + * <Date name='...'>yyyy-mm-dd hh-mm-ss.ms</Date> + * @endcode + * where '.ms' is optional, or: + * @code + * <Date name='...'>yyyy-mm-dd</Date> + * @endcode * in which case the time is set to zero. - */ + */ virtual void parseXML(const char* cdata); }; Modified: trunk/CSP/SimData/Include/SimData/Key.h =================================================================== --- trunk/CSP/SimData/Include/SimData/Key.h 2004-09-24 05:04:28 UTC (rev 1238) +++ trunk/CSP/SimData/Include/SimData/Key.h 2004-09-25 05:02:03 UTC (rev 1239) @@ -91,7 +91,7 @@ /** String compare unequal */ bool operator!=(std::string const &k) const { return !(*this==k); } - + /** Order comparison, for use with standard stl comparisons */ bool operator<(Key const &k) const { return _key < k._key; } @@ -100,7 +100,7 @@ */ virtual void serialize(Reader&); virtual void serialize(Writer&) const; - + /** Standard string representation. */ virtual std::string asString() const; Modified: trunk/CSP/SimData/Include/SimData/Properties.h =================================================================== --- trunk/CSP/SimData/Include/SimData/Properties.h 2004-09-24 05:04:28 UTC (rev 1238) +++ trunk/CSP/SimData/Include/SimData/Properties.h 2004-09-25 05:02:03 UTC (rev 1239) @@ -63,18 +63,22 @@ * * Example usage: * + * @code * template <class FOO> * class Widget: HasBase<FOO, Bar>, public WidgetBase { * ... * }; + * @endcode * * This will only allow Widget<FOO> to compile if FOO is a subclass of * class Bar: * + * @code * class BarChild: public Bar { }; * class NotBarChild { }; * Widget<BarChild> bar_widget; // ok * Widget<NotBarChild> not_bar_widget; // compiler error + * @endcode * * @author Mark Rose <mk...@us...> */ Modified: trunk/CSP/SimData/Include/SimData/TaggedRecordRegistry.h =================================================================== --- trunk/CSP/SimData/Include/SimData/TaggedRecordRegistry.h 2004-09-24 05:04:28 UTC (rev 1238) +++ trunk/CSP/SimData/Include/SimData/TaggedRecordRegistry.h 2004-09-25 05:02:03 UTC (rev 1239) @@ -108,7 +108,7 @@ /** Test if an object interface is registered. * - * @param key The object class hash. + * @param id The object class hash. */ bool hasFactory(TaggedRecord::Id id) const { HashT key(static_cast<uint32>(id), static_cast<uint32>(id>>32)); Modified: trunk/CSP/SimData/Include/SimData/Vector3.h =================================================================== --- trunk/CSP/SimData/Include/SimData/Vector3.h 2004-09-24 05:04:28 UTC (rev 1238) +++ trunk/CSP/SimData/Include/SimData/Vector3.h 2004-09-25 05:02:03 UTC (rev 1239) @@ -324,7 +324,7 @@ virtual void serialize(Reader&); virtual void serialize(Writer&) const; - /** Parse the character data from an XML <Vector> tag. + /** Parse the character data from an XML \<Vector\> tag. * * The three components must be separated by whitespace. */ Modified: trunk/CSP/SimData/Source/Real.cpp =================================================================== --- trunk/CSP/SimData/Source/Real.cpp 2004-09-24 05:04:28 UTC (rev 1238) +++ trunk/CSP/SimData/Source/Real.cpp 2004-09-25 05:02:03 UTC (rev 1239) @@ -101,6 +101,5 @@ } - NAMESPACE_SIMDATA_END Modified: trunk/CSP/SimData/Source/Version.cpp =================================================================== --- trunk/CSP/SimData/Source/Version.cpp 2004-09-24 05:04:28 UTC (rev 1238) +++ trunk/CSP/SimData/Source/Version.cpp 2004-09-25 05:02:03 UTC (rev 1239) @@ -25,9 +25,6 @@ #include <SimData/Version.h> -#include <cstdio> -#include <iostream> -#include <iomanip> #define SIMDATA_BUILD_DATE __TIME__ " " __DATE__ |
From: <sv...@ww...> - 2004-09-18 18:10:42
|
Author: delta Date: 2004-09-18 11:10:30 -0700 (Sat, 18 Sep 2004) New Revision: 1236 Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Include/Battlefield.h trunk/CSP/CSPSim/Include/CSPSim.h trunk/CSP/CSPSim/Include/DynamicObject.h trunk/CSP/CSPSim/Include/FlightModel.h trunk/CSP/CSPSim/Include/Projection.h trunk/CSP/CSPSim/Include/SimNet/Networking.h trunk/CSP/CSPSim/Include/Systems/AircraftSimpleFCS.h trunk/CSP/CSPSim/Include/Theater/FeatureObjectModel.h trunk/CSP/CSPSim/Source/Collision.cpp trunk/CSP/CSPSim/Source/FlightDynamics.cpp trunk/CSP/CSPSim/Source/FlightModel.cpp trunk/CSP/CSPSim/Source/Sky.cpp trunk/CSP/CSPSim/Source/SynchronousUpdate.cpp trunk/CSP/CSPSim/Source/Systems/AircraftInputSystem.cpp trunk/CSP/CSPSim/VisualStudio/CSPSimDLL/CSPSimDLL.vcproj Log: * Updated VisualStudio/CSPSimDLL/CSPSimDLL.vcproj linking onto CSPSim/lib/SpatialIndex(d).lib. * A few changes in the header files to prevent some microsoft specific compiler conflicts which finally cleaned the code. * Fixed a few cast warnings in Projection.h. * Replaced the forward declaration of ObjectModel by a #include "ObjectModel.h" in Include/Theater/FeatureObjectModel.h. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1236 Diff omitted (17815 bytes). |
From: <sv...@ww...> - 2004-09-17 04:50:50
|
Author: mkrose Date: 2004-09-16 21:50:41 -0700 (Thu, 16 Sep 2004) New Revision: 1235 Modified: trunk/CSP/SpatialIndex/quadtree/makefile Log: Oops, forgot to update the makefile for the new extension. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1235 Modified: trunk/CSP/SpatialIndex/quadtree/makefile =================================================================== --- trunk/CSP/SpatialIndex/quadtree/makefile 2004-09-17 04:49:21 UTC (rev 1234) +++ trunk/CSP/SpatialIndex/quadtree/makefile 2004-09-17 04:50:41 UTC (rev 1235) @@ -37,7 +37,7 @@ debug: $(MAKE) CXXFLAGS='-g -fPIC' -.cc.o: +.cpp.o: $(CXX) $(CXXFLAGS) -I.. -c $< clean: |
From: <sv...@ww...> - 2004-09-17 04:49:29
|
Author: mkrose Date: 2004-09-16 21:49:21 -0700 (Thu, 16 Sep 2004) New Revision: 1234 Added: trunk/CSP/SpatialIndex/quadtree/QuadTree.cpp Removed: trunk/CSP/SpatialIndex/quadtree/QuadTree.cc Log: Rename QuadTree.cc to QuadTree.cpp, preserving history. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1234 Diff omitted (10398 bytes). |
From: <sv...@ww...> - 2004-09-17 04:48:45
|
Author: mkrose Date: 2004-09-16 21:48:36 -0700 (Thu, 16 Sep 2004) New Revision: 1233 Removed: trunk/CSP/SpatialIndex/quadtree/QuadTree.cpp Modified: trunk/CSP/SpatialIndex/quadtree/QuadTree.cc Log: Small bugfix in QuadTree.cc. Removing QuadTree.cpp, which was added as a copy of QuadTree.cpp. Next submit will use svn mv to rename QuadTree.cc to QuadTree.cpp. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1233 Diff omitted (11016 bytes). |
From: <sv...@ww...> - 2004-09-17 04:41:25
|
Author: mkrose Date: 2004-09-16 21:41:16 -0700 (Thu, 16 Sep 2004) New Revision: 1232 Added: trunk/CSP/setup.py trunk/CSP/tools/CSP_bootstrap Modified: trunk/CSP/__init__.py Log: Add a mechanism for bootstrapping the CSP python module space. The basic idea is to run ./setup.py in a new workspace, which installs the file tools/CSP_bootstrap as CSP.py into your Python site-packages directory. This special module provides access to the python modules in the current workspace. Once it has been installed, you can import these modules without any changes to sys.path. If you change to a directory in another workspace, the imports will automagically find the modules in that workspace. This will simplify some of the existing modules and allow new modules to be added more easily. Eventually setup.py will also take care of preparing the build system in a platform-specific way (for example, running aclocal and autoconf under GNU/Linux). Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1232 Modified: trunk/CSP/__init__.py =================================================================== --- trunk/CSP/__init__.py 2004-09-16 19:31:03 UTC (rev 1231) +++ trunk/CSP/__init__.py 2004-09-17 04:41:16 UTC (rev 1232) @@ -1 +1,35 @@ +# Combat Simulator Project - CSPSim +# Copyright (C) 2002, 2004 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. + CSP = 1 + +import sys +import os +import os.path + +# make SimData available without qualification +sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'SimData')) + +def initDynamicLoading(): + """Enable lazy loading of shared library modules if available""" + if os.name == 'posix': + import dl + sys.setdlopenflags(dl.RTLD_GLOBAL|dl.RTLD_LAZY) + +initDynamicLoading() + Added: trunk/CSP/setup.py =================================================================== --- trunk/CSP/setup.py 2004-09-16 19:31:03 UTC (rev 1231) +++ trunk/CSP/setup.py 2004-09-17 04:41:16 UTC (rev 1232) @@ -0,0 +1,78 @@ +#!/usr/bin/env python +# +# Combat Simulator Project Workspace Setup Script +# Copyright (C) 2004 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. + + +""" +CSP Workspace Setup Script + +Installs a stub module CSP.py into the Python site-packages directory, +allowing CSP and its submodules to be imported from the current client +workspace without modifying the default Python module path. + +Also prepares the build environment for the current platform. (Not +fully implemented yet.) + +Usage: %(prog)s [flags] +""" + +import sys +import os.path +from distutils import sysconfig +from distutils import file_util +from distutils import util +from distutils import log +from base import app # (CSP.base) + +log.set_verbosity(log.INFO) + + +def InstallLoader(force): + """Install tools/CSP_bootstrap as CSP.py in Python site-packages.""" + site_packages = sysconfig.get_python_lib() + target = os.path.join(site_packages, 'CSP.py') + if os.path.exists(target) and not force: + print 'Error: unable to import CSP, but CSP.py exists in site-packages.' + print 'Use --force to overwrite.' + sys.exit(1) + source = os.path.join('tools', 'CSP_bootstrap') + log.info('installing bootstrap loader') + try: + file_util.copy_file(source, target) + except file_util.DistutilsFileError, e: + print e + sys.exit(1) + log.info('byte compiling bootstrap loader') + util.byte_compile(target) + + +def main(args): + do_install = app.options.force + try: + import CSP + except ImportError: + do_install = 1 + if do_install: + InstallLoader(app.options.force) + else: + print 'Nothing to do; try %s --help for more options.' % app.programName() + + +app.addOption('-f', '--force', action='store_true', default=False, help='force reinstall') +app.start() Property changes on: trunk/CSP/setup.py ___________________________________________________________________ Name: svn:executable + * Added: trunk/CSP/tools/CSP_bootstrap =================================================================== --- trunk/CSP/tools/CSP_bootstrap 2004-09-16 19:31:03 UTC (rev 1231) +++ trunk/CSP/tools/CSP_bootstrap 2004-09-17 04:41:16 UTC (rev 1232) @@ -0,0 +1,71 @@ +# -*-python-*- +# +# Combat Simulator Project Workspace Setup Script +# Copyright (C) 2004 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. + +""" +This is a bootstrap loader for the Combat Simulator Project. +It is intended to be placed into the Python path (typically +in site-packages). When loaded, it replaces itself with the +CSP package from the current workspace (if possible). +""" + +import os +import os.path +import sys + +# remove '.' from sys.path +try: + dotindex = sys.path.index('.') +except ValueError: + dotindex = -1 + +if dotindex >= 0: + del sys.path[dotindex] + +# remove this module from sys.modules +self = sys.modules['CSP'] +del sys.modules['CSP'] + +# look for the root of the current workspace +cwd = os.getcwd() +parts = cwd.split(os.sep) +if not 'CSP' in parts: + print 'Error: trying to import CSP from outside of a workspace.' + sys.exit(1) +while parts[-1] != 'CSP': + parts = parts[:-1] + +ROOT = os.path.sep.join(parts[:-1]) + +if not os.path.exists(os.path.join(ROOT, '.svn')): + print 'Warning: %s does not contain .svn and may not be a valid CSP workspace.' % ROOT + +# load the real CSP package +sys.path.insert(0, ROOT) + +try: + import CSP +except ImportError, e: + print 'Unable to bootstrap a CSP module space from the current working directory:' + print e + +# restore '.' to the path +if dotindex >= 0: + sys.path.insert(dotindex + 1, '.') + |
From: <sv...@ww...> - 2004-09-16 19:31:12
|
Author: delta Date: 2004-09-16 12:31:03 -0700 (Thu, 16 Sep 2004) New Revision: 1231 Added: trunk/CSP/SpatialIndex/VisualStudio/ trunk/CSP/SpatialIndex/VisualStudio/SpatialIndex.sln trunk/CSP/SpatialIndex/VisualStudio/SpatialIndex.vcproj trunk/CSP/SpatialIndex/quadtree/QuadTree.cpp Log: First vs .net 7.1 project file. Only QuadTree.cpp is built. The generated static lib goes to ../../lib. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1231 Diff omitted (17476 bytes). |
From: <sv...@ww...> - 2004-09-16 19:15:33
|
Author: delta Date: 2004-09-16 12:15:22 -0700 (Thu, 16 Sep 2004) New Revision: 1230 Modified: trunk/CSP/SimData/CHANGES.current trunk/CSP/SimData/Include/SimData/AtomicCounter.h Log: Tried to reduce the impact of including windows API headers on the code. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1230 Modified: trunk/CSP/SimData/CHANGES.current =================================================================== --- trunk/CSP/SimData/CHANGES.current 2004-09-14 03:48:21 UTC (rev 1229) +++ trunk/CSP/SimData/CHANGES.current 2004-09-16 19:15:22 UTC (rev 1230) @@ -1,6 +1,10 @@ Version 0.4.0 (in progress) =========================== +2004-09-16: delta + * Tried to reduce the impact of including windows API headers on the + code. + 2004-09-12: onsight * Add an interface for creating and retrieving log streams based on a unique id string. This allows multiple related libraries in an Modified: trunk/CSP/SimData/Include/SimData/AtomicCounter.h =================================================================== --- trunk/CSP/SimData/Include/SimData/AtomicCounter.h 2004-09-14 03:48:21 UTC (rev 1229) +++ trunk/CSP/SimData/Include/SimData/AtomicCounter.h 2004-09-16 19:15:22 UTC (rev 1230) @@ -39,6 +39,7 @@ #if defined(WIN32) # define WIN_ATOMIC # define _WINSOCKAPI_ +# define NOMINMAX # include <Windows.h> #else # define LIN_ATOMIC |
From: <sv...@ww...> - 2004-09-14 03:48:30
|
Author: mkrose Date: 2004-09-13 20:48:21 -0700 (Mon, 13 Sep 2004) New Revision: 1229 Modified: trunk/CSP/SpatialIndex/SpatialIndex.h trunk/CSP/SpatialIndex/makefile trunk/CSP/SpatialIndex/quadtree/makefile trunk/CSP/SpatialIndex/rtree/Leaf.cc trunk/CSP/SpatialIndex/rtree/Node.cc trunk/CSP/SpatialIndex/rtree/Statistics.cc trunk/CSP/SpatialIndex/rtree/makefile trunk/CSP/SpatialIndex/spatialindex/Point.cc trunk/CSP/SpatialIndex/spatialindex/Region.cc trunk/CSP/SpatialIndex/spatialindex/TimePoint.cc trunk/CSP/SpatialIndex/spatialindex/TimeRegion.cc trunk/CSP/SpatialIndex/spatialindex/makefile trunk/CSP/SpatialIndex/storagemanager/MemoryStorageManager.cc trunk/CSP/SpatialIndex/storagemanager/makefile Log: Increase gcc warning level and fix numerous compiler warnings. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1229 Diff omitted (13777 bytes). |
From: <sv...@ww...> - 2004-09-13 09:06:11
|
Author: mkrose Date: 2004-09-13 02:06:02 -0700 (Mon, 13 Sep 2004) New Revision: 1228 Modified: trunk/CSP/SimData/CHANGES.current trunk/CSP/SimData/Include/SimData/Log.h trunk/CSP/SimData/Include/SimData/LogStream.h trunk/CSP/SimData/Source/LogStream.cpp Log: Add an interface for creating and retrieving log streams based on a unique id string. This allows multiple related libraries in an application to easily share the same log. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1228 Modified: trunk/CSP/SimData/CHANGES.current =================================================================== --- trunk/CSP/SimData/CHANGES.current 2004-09-13 04:07:17 UTC (rev 1227) +++ trunk/CSP/SimData/CHANGES.current 2004-09-13 09:06:02 UTC (rev 1228) @@ -1,6 +1,11 @@ Version 0.4.0 (in progress) =========================== +2004-09-12: onsight + * Add an interface for creating and retrieving log streams based on + a unique id string. This allows multiple related libraries in an + application to easily share the same log. + 2004-08-25: onsight * Clean up some compiler warnings, and a few misc. fixes. Modified: trunk/CSP/SimData/Include/SimData/Log.h =================================================================== --- trunk/CSP/SimData/Include/SimData/Log.h 2004-09-13 04:07:17 UTC (rev 1227) +++ trunk/CSP/SimData/Include/SimData/Log.h 2004-09-13 09:06:02 UTC (rev 1228) @@ -90,7 +90,7 @@ // settings. note that this LogStream instance is never freed, so // it is safe to log messages from static destructors. log_stream = new LogStream(std::cerr); - log_stream->initFromEnvironment(); + log_stream->initFromEnvironment("SIMDATA_LOGFILE", "SIMDATA_LOGPRIORITY"); } return *log_stream; } Modified: trunk/CSP/SimData/Include/SimData/LogStream.h =================================================================== --- trunk/CSP/SimData/Include/SimData/LogStream.h 2004-09-13 04:07:17 UTC (rev 1227) +++ trunk/CSP/SimData/Include/SimData/LogStream.h 2004-09-13 09:06:02 UTC (rev 1228) @@ -111,12 +111,15 @@ bool getTimeLogging() const { return m_log_time; } /** Configure logging parameters and destination base on - * environment variables. The default implementation uses - * SIMDATA_LOGFILE and SIMDATA_PRIORITY to set the output - * file and priority threshold. This method is not called - * by the constructor; call it explicitly if needed. + * environment variables. This method is not called by + * the constructor; call it explicitly if needed. + * + * @param log_file the environment variable specifying the log + * output path (e.g. "SIMDATA_LOGFILE"). + * @param log_priority the environment variable specifying the log + * priority threshold (e.g. "SIMDATA_LOGPRIORITY"). */ - virtual void initFromEnvironment(); + void initFromEnvironment(const char *log_file, const char *log_priority); /** Close the underlying output stream. * @@ -203,9 +206,21 @@ */ std::ostream & entry(int priority, int category=~0, const char *file=0, int line=0); + /** Get or create a new log stream assocated with a string identifier. + * + * This method can be used to easily share one log file across multiple + * components. + * + * @param name a unique identifier for the log stream. + * @return the existing logstream associated with the identifier, or a + * new logstream. + */ + static LogStream *getOrCreateNamedLog(const std::string &name); + }; + NAMESPACE_SIMDATA_END Modified: trunk/CSP/SimData/Source/LogStream.cpp =================================================================== --- trunk/CSP/SimData/Source/LogStream.cpp 2004-09-13 04:07:17 UTC (rev 1227) +++ trunk/CSP/SimData/Source/LogStream.cpp 2004-09-13 09:06:02 UTC (rev 1228) @@ -37,22 +37,27 @@ #include <SimData/Log.h> #include <cstdlib> +#include <map> NAMESPACE_SIMDATA -void LogStream::initFromEnvironment() { - char *env_logfile = getenv("SIMDATA_LOGFILE"); - if (env_logfile && *env_logfile) { - setOutput(env_logfile); +void LogStream::initFromEnvironment(const char *log_file, const char *log_priority) { + if (log_file) { + char *env_logfile = getenv(log_file); + if (env_logfile && *env_logfile) { + setOutput(env_logfile); + } } - char *env_priority = getenv("SIMDATA_LOGPRIORITY"); - if (env_priority && *env_priority) { - int priority = atoi(env_priority); - if (priority < 0) priority = 0; - if (priority > LOG_ERROR) priority = LOG_ERROR; - setLogPriority(priority); + if (log_priority) { + char *env_priority = getenv(log_priority); + if (env_priority && *env_priority) { + int priority = atoi(env_priority); + if (priority < 0) priority = 0; + if (priority > LOG_ERROR) priority = LOG_ERROR; + setLogPriority(priority); + } } } @@ -75,5 +80,22 @@ } +// nothing very fancy. the logstreams persist unless explicitly +// deleted by a caller, since they may be needed even during static +// destruction. +typedef std::map<std::string, LogStream *> LogStreamRegistry; +LogStreamRegistry NamedLogStreamRegistry; + +LogStream *LogStream::getOrCreateNamedLog(const std::string &name) { + LogStreamRegistry::iterator iter = NamedLogStreamRegistry.find(name); + if (iter == NamedLogStreamRegistry.end()) { + LogStream *logstream = new LogStream(std::cerr); + NamedLogStreamRegistry[name] = logstream; + return logstream; + } + return iter->second; +} + + NAMESPACE_SIMDATA_END |
From: <sv...@ww...> - 2004-09-13 04:07:24
|
Author: mkrose Date: 2004-09-12 21:07:17 -0700 (Sun, 12 Sep 2004) New Revision: 1227 Removed: trunk/CSP/CSPSim/Include/VirtualBattlefield.h trunk/CSP/CSPSim/Source/VirtualBattlefield.cpp Modified: trunk/CSP/CSPSim/CHANGES.current Log: Remove VirtualBattlefield.* Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1227 Diff omitted (39722 bytes). |
From: <sv...@ww...> - 2004-09-12 23:46:46
|
Author: mkrose Date: 2004-09-12 16:46:39 -0700 (Sun, 12 Sep 2004) New Revision: 1226 Added: trunk/CSP/CSPSim/Include/Battlefield.h trunk/CSP/CSPSim/Include/SceneManager.h trunk/CSP/CSPSim/Include/SimpleSceneManager.h trunk/CSP/CSPSim/Source/Battlefield.cpp trunk/CSP/CSPSim/Source/SceneManager.cpp trunk/CSP/CSPSim/Source/SimpleSceneManager.cpp Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Include/CSPSim.h trunk/CSP/CSPSim/Include/CSPSim.i trunk/CSP/CSPSim/Include/ClientNode.h trunk/CSP/CSPSim/Include/Dispatch.h trunk/CSP/CSPSim/Include/DispatchCenter.h trunk/CSP/CSPSim/Include/DynamicObject.h trunk/CSP/CSPSim/Include/SimNet/DispatchMessageHandler.h trunk/CSP/CSPSim/Include/SimNet/NetworkMessage.h trunk/CSP/CSPSim/Include/SimNet/NetworkMessageHandler.h trunk/CSP/CSPSim/Include/SimNet/Networking.h trunk/CSP/CSPSim/Include/SimObject.h trunk/CSP/CSPSim/Include/SynchronousUpdate.h trunk/CSP/CSPSim/Include/Theater/FeatureGroup.h trunk/CSP/CSPSim/Include/Views/View.h trunk/CSP/CSPSim/Include/VirtualScene.h trunk/CSP/CSPSim/Include/VirtualScene.i trunk/CSP/CSPSim/Makefile.in trunk/CSP/CSPSim/Source/CSPSim.cpp trunk/CSP/CSPSim/Source/ClientNode.cpp trunk/CSP/CSPSim/Source/DispatchCenter.cpp trunk/CSP/CSPSim/Source/DynamicObject.cpp trunk/CSP/CSPSim/Source/GameScreen.cpp trunk/CSP/CSPSim/Source/Makefile.in trunk/CSP/CSPSim/Source/PhysicsModel.cpp trunk/CSP/CSPSim/Source/ScreenInfo.cpp trunk/CSP/CSPSim/Source/SimNet/DispatchMessageHandler.cpp trunk/CSP/CSPSim/Source/SimObject.cpp trunk/CSP/CSPSim/Source/SynchronousUpdate.cpp trunk/CSP/CSPSim/Source/TankObject.cpp trunk/CSP/CSPSim/Source/Theater/FeatureGroup.cpp trunk/CSP/CSPSim/Source/Views/View.cpp trunk/CSP/CSPSim/Source/VirtualScene.cpp trunk/CSP/CSPSim/Source/cCSP.i Log: * Implemented a new Battlefield class to replace VirtualBattlefield. This class uses quadtree spatial indices instead of a fixed grid structure, and has a looser coupling to other components of CSP than the old battlefield. This should make it easier to reuse for the index server. * Defined a SceneManager interface to decouple the battlefield from the scene graph. Implemented the interface in SimpleSceneManager to provide basic addition and removal of objects from the scene graph. In the future it would be good to implemented a more sophisticated scene manager subclass that constructs the scene graph elements of FeatureGroups in a separate thread, and handles feature transparency to smoothly hide features at the edge of the visible range. * Added a method to synchronous update to allow update targets to be manually disconnected from an update master. * Revised the SimObject interface, consolidating some pieces that had spread to DynamicObject and FeatureGroup. SimObject is the only object class that the new battlefield needs to know about. * Minor tweaks to SimNet to reduce header dependencies. * Implemented a new view mode that places the camera in a fixed location 20 m behind the object and tracks the object motion from that point. This was useful when testing object visibility updates with the new battlefield code, but may be removed when no longer needed/desired. * Changed the makefile paths such that TOPDIR now refers to CSP/. Also added the SpatialIndex library (CSP/SpatialIndex/libspatialindex). * Fix .dep file dependencies, so that a .dep file will be regenerated whenever the corresponding object file is regenerated. Previously .dep files were only regenerated when the corresponding source file changed, but this neglected important header file changes. Linux developers should 'make clean-deps' (or just 'make clean') after this update to ensure that the dependency files are set up correctly. > Windows users: - build and link to the SpatialIndex library. - add Battlefield.cpp, SceneManager.cpp, and SimpleSceneManager.cpp to the build. - remove VirtualBattlefield.cpp from the build. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1226 Diff omitted (123565 bytes). |