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...> - 2007-07-25 20:49:16
|
Author: Herkules Date: 2007-07-25 13:48:06 -0700 (Wed, 25 Jul 2007) New Revision: 2151 Added: doc/dynamics/ doc/dynamics/PhysicsSystemClassOverview.jpg Log: class diagram Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2151 Added: doc/dynamics/PhysicsSystemClassOverview.jpg =================================================================== (Binary files differ) Property changes on: doc/dynamics/PhysicsSystemClassOverview.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream |
From: <sv...@ww...> - 2007-07-25 18:23:02
|
Author: mkrose Date: 2007-07-25 11:21:58 -0700 (Wed, 25 Jul 2007) New Revision: 2150 Modified: doc/README Log: Updated mirror URL to /csp/mirror/doc instead of /csp/doc/mirror. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2150 Modified: doc/README =================================================================== --- doc/README 2007-07-25 17:53:53 UTC (rev 2149) +++ doc/README 2007-07-25 18:21:58 UTC (rev 2150) @@ -1,4 +1,4 @@ -/doc/... is mirrored at https://www.zerobar.net/csp/doc/mirror/... +/doc/... is mirrored at https://www.zerobar.net/csp/mirror/doc/... Please use the mirror rather than the corresponding repository URL when referencing documentation externally. |
From: <sv...@ww...> - 2007-07-25 17:55:00
|
Author: mkrose Date: 2007-07-25 10:53:53 -0700 (Wed, 25 Jul 2007) New Revision: 2149 Added: doc/README Removed: doc/mirror.txt Log: Third test worked. Remove test file and add a README to explain how to use the mirror. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2149 Added: doc/README =================================================================== --- doc/README (rev 0) +++ doc/README 2007-07-25 17:53:53 UTC (rev 2149) @@ -0,0 +1,4 @@ +/doc/... is mirrored at https://www.zerobar.net/csp/doc/mirror/... + +Please use the mirror rather than the corresponding repository URL +when referencing documentation externally. Deleted: doc/mirror.txt =================================================================== --- doc/mirror.txt 2007-07-25 17:51:17 UTC (rev 2148) +++ doc/mirror.txt 2007-07-25 17:53:53 UTC (rev 2149) @@ -1 +0,0 @@ -test number 3 |
From: <sv...@ww...> - 2007-07-25 17:52:22
|
Author: mkrose Date: 2007-07-25 10:51:17 -0700 (Wed, 25 Jul 2007) New Revision: 2148 Modified: doc/mirror.txt Log: Third test. Second failed due to stray .svn owned by root. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2148 Modified: doc/mirror.txt =================================================================== --- doc/mirror.txt 2007-07-25 17:49:36 UTC (rev 2147) +++ doc/mirror.txt 2007-07-25 17:51:17 UTC (rev 2148) @@ -1 +1 @@ -test number 2 +test number 3 |
From: <sv...@ww...> - 2007-07-25 17:50:42
|
Author: mkrose Date: 2007-07-25 10:49:36 -0700 (Wed, 25 Jul 2007) New Revision: 2147 Modified: doc/mirror.txt Log: Second test, first failed due to https auth Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2147 Modified: doc/mirror.txt =================================================================== --- doc/mirror.txt 2007-07-25 17:47:38 UTC (rev 2146) +++ doc/mirror.txt 2007-07-25 17:49:36 UTC (rev 2147) @@ -1 +1 @@ -testing +test number 2 |
From: <sv...@ww...> - 2007-07-25 17:48:56
|
Author: mkrose Date: 2007-07-25 10:47:38 -0700 (Wed, 25 Jul 2007) New Revision: 2146 Added: doc/mirror.txt Log: Test /doc mirroring on zerobar Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2146 Added: doc/mirror.txt =================================================================== --- doc/mirror.txt (rev 0) +++ doc/mirror.txt 2007-07-25 17:47:38 UTC (rev 2146) @@ -0,0 +1 @@ +testing |
From: <sv...@ww...> - 2007-07-25 17:17:33
|
Author: mkrose Date: 2007-07-25 10:11:34 -0700 (Wed, 25 Jul 2007) New Revision: 2145 Added: doc/ Log: Add a toplevel /doc directory for storing project related documentation. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2145 |
From: <sv...@ww...> - 2007-07-25 08:48:01
|
Author: mkrose Date: 2007-07-25 01:45:29 -0700 (Wed, 25 Jul 2007) New Revision: 2144 Added: trunk/csp/csplib/data/test/test_Vector3.cpp Modified: trunk/csp/csplib/SConscript trunk/csp/csplib/data/Vector3.h Log: Minor style cleanups in Vector3.h, plus a new unittest for Vector3. Split csplib_tests into separate modules and add the new Quat and Vector3 unittests to the build. To build and run the tests, try any of the following: $ scons runtests $ scons csplib.runtests $ scons csplib/test_data.run Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2144 Diff omitted (15250 bytes). |
From: <sv...@ww...> - 2007-07-24 08:39:04
|
Author: mkrose Date: 2007-07-24 01:38:00 -0700 (Tue, 24 Jul 2007) New Revision: 2143 Modified: trunk/csp/tools/build/__init__.py trunk/csp/tools/build/registry.py trunk/csp/tools/build/rules.py trunk/csp/tools/build/util.py Log: Add better support for defining and running unittests from scons. Instead of build.SharedLibrary, test modules should be defined using build.Test. 'scons runtests' still works, but more selective test execution will be possible once the monolithic test modules are broken into smaller pieces. The exact scons syntax and test layout remains tbd, but something along the lines of 'scons csplib/util.runtests' will allow all of the csplib utility tests to be built and executed. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2143 Modified: trunk/csp/tools/build/__init__.py =================================================================== --- trunk/csp/tools/build/__init__.py 2007-07-24 08:27:44 UTC (rev 2142) +++ trunk/csp/tools/build/__init__.py 2007-07-24 08:38:00 UTC (rev 2143) @@ -78,7 +78,7 @@ from csp.tools.build.setup import Environment from csp.tools.build.rules import \ - SourceGroup, Program, Generate, SharedLibrary, Command + SourceGroup, Program, Generate, SharedLibrary, Command, Test from csp.tools.build.autoconf import \ CheckSConsVersion, CheckPythonVersion, GetPythonInclude, GetPythonLibrary, GetGCCVersion Modified: trunk/csp/tools/build/registry.py =================================================================== --- trunk/csp/tools/build/registry.py 2007-07-24 08:27:44 UTC (rev 2142) +++ trunk/csp/tools/build/registry.py 2007-07-24 08:38:00 UTC (rev 2143) @@ -28,6 +28,7 @@ self._sources = {} self._libraries = {} self._tests = [] + self._dir_tests = {} def AddLibrary(self, name, lib): self._libraries[name] = lib @@ -92,27 +93,50 @@ config[name] = dict(lib._settings) autoconf.SaveConfig(env, config) - def _RunTests(self): - if not self._tests: return + def _SetupTests(self): os.environ.setdefault('CSPLOG_FILE', os.path.join(scons.File('#/.testlog').abspath)) try: import csp.csplib except ImportError: print 'ERROR: unnable to import csp.csplib' return - for test in self._tests: - csp.csplib.TestRegistry.loadTestModule(test[0].abspath) - csp.csplib.TestRegistry.runAll() + return csp.csplib.TestRegistry + def _RunTests(self, *args, **kw): + tests = kw['source'] + if not tests: return + tester = self._SetupTests() + for test in tests: + tester.loadTestModule(test.abspath) + tester.runAll() + + def _RunOneTest(self, *args, **kw): + tester = self._SetupTests() + modules = kw['source'] + for module in modules: + tester.loadTestModule(module.abspath) + tester.runAll() + def Build(self, env): self.Configure(env) for target in self._targets.values(): object = target.build() if target.isTest(): self._tests.append(object) - def runtests(*args, **kw): - self._RunTests() - env.Command('runtests', 'tests', runtests) + if target._path not in self._dir_tests: + self._dir_tests[target._path] = [] + self._dir_tests[target._path].append(object) + run_alias = os.path.join(target._path, target._name) + '.run' + env.Command(run_alias, object, util.SilentAction(self._RunOneTest)) + env.Command('runtests', self._tests, util.SilentAction(self._RunTests)) + for path, targets in self._dir_tests.items(): + env.Command(path + '.runtests', targets, util.SilentAction(self._RunTests)) + # sample aliases for running tests: + # $ scons runtests + # $ scons cspsim.runtests + # $ scons csplib.runtests + # $ scons cspsim/test_PhysicsModel.run + # $ scons csplib/data/test_Object.run BuildRegistry = _BuildRegistry() Modified: trunk/csp/tools/build/rules.py =================================================================== --- trunk/csp/tools/build/rules.py 2007-07-24 08:27:44 UTC (rev 2142) +++ trunk/csp/tools/build/rules.py 2007-07-24 08:38:00 UTC (rev 2143) @@ -102,7 +102,7 @@ class Target: - def __init__(self, env, name, sources=[], aliases=[], deps=[], always_build=0, softlink=0, doxygen=None, **kw): + def __init__(self, env, name, sources=[], aliases=[], deps=[], always_build=0, softlink=0, doxygen=None, is_test=0, **kw): self._env = env.Copy() self._name = name self._sources = [s for s in sources if s.startswith('@')] @@ -110,10 +110,15 @@ if pure or deps: SourceGroup(env, name, sources=pure, deps=deps) self._sources.append('@' + name) + self._path = env.Dir('.').srcnode().path self._target = os.path.join(env.Dir('.').path, name) # a bit ugly - if isinstance(aliases, str): aliases = [aliases] + if isinstance(aliases, str): + aliases = [aliases] + else: + aliases = aliases[:] + if is_test: aliases.append('tests') self._aliases = aliases - self._is_test = 'tests' in aliases + self._is_test = is_test or ('tests' in aliases) # the latter is for backward compatibility self._always_build = always_build self._softlink = softlink self._doxygen = None @@ -275,6 +280,12 @@ settings.merge(XRPATH=[os.path.abspath(target_dir)], LIBPATH=[target_dir], LIBS=[os.path.basename(self._target)]) +class Test(SharedLibrary): + def __init__(self, env, **kw): + kw['is_test'] = 1 + SharedLibrary.__init__(self, env, **kw) + + class Command(Target): def __init__(self, env, function, **kw): name = getattr(function, '__name__', None) Modified: trunk/csp/tools/build/util.py =================================================================== --- trunk/csp/tools/build/util.py 2007-07-24 08:27:44 UTC (rev 2142) +++ trunk/csp/tools/build/util.py 2007-07-24 08:38:00 UTC (rev 2143) @@ -59,6 +59,11 @@ return CommandAction(cmd, strfunction=s) +def SilentAction(callback): + def noprint(*args, **kw): pass + return Action(callback, noprint) + + def Extension(fn): return os.path.splitext(fn)[1] |
From: <sv...@ww...> - 2007-07-24 08:28:49
|
Author: mkrose Date: 2007-07-24 01:27:44 -0700 (Tue, 24 Jul 2007) New Revision: 2142 Added: trunk/csp/csplib/data/test/test_Quat.cpp Modified: trunk/csp/csplib/data/Quat.cpp trunk/csp/csplib/data/Quat.h trunk/csp/csplib/data/Vector3.h Log: Minor cleanups in Quat and Vector3. Add a reasonably comprehensive test for Quat (which is not yet integrated into the build). Add nlerp method to Quat. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2142 Diff omitted (20498 bytes). |
From: <sv...@ww...> - 2007-07-24 08:25:19
|
Author: mkrose Date: 2007-07-24 01:24:13 -0700 (Tue, 24 Jul 2007) New Revision: 2141 Modified: trunk/csp/csplib/util/Testing.h Log: Fix syntax errors in Testing.h and add comparison helpers. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2141 Modified: trunk/csp/csplib/util/Testing.h =================================================================== --- trunk/csp/csplib/util/Testing.h 2007-07-24 08:21:54 UTC (rev 2140) +++ trunk/csp/csplib/util/Testing.h 2007-07-24 08:24:13 UTC (rev 2141) @@ -186,9 +186,9 @@ template <typename A, typename B> struct not_equal_to { bool operator()(A const &a, B const &b) const { return !equal_to<A,B>()(a, b); } }; template <typename A, typename B> -struct greater_than { bool operator()(A const &a, B const &b) const { return !less_equal<A,B>(a, b); } }; +struct greater_than { bool operator()(A const &a, B const &b) const { return !less_equal<A,B>()(a, b); } }; template <typename A, typename B> -struct greater_equal { bool operator()(A const &a, B const &b) const { return !less_than<A,B>(a, b); } }; +struct greater_equal { bool operator()(A const &a, B const &b) const { return !less_than<A,B>()(a, b); } }; template <typename A > struct float_equal { bool operator()(A const &a, A const &b) const { return float_eq(a, b); } }; template <typename A> @@ -266,12 +266,14 @@ #define CSP_TEST__(A, B, OP, MODE) \ if (CSP(test::TestResult) result = CSP(test::TestResult)(A, B, OP, #A, #B)); \ - else CSP(test::TestLogEntry)(__FILE__, __LINE__, CSP(test::TestLogEntry)::MODE) << result.msg(); + else CSP(test::TestLogEntry)(__FILE__, __LINE__, CSP(test::TestLogEntry)::MODE) << result.msg() << " " #define CSP_TEST_U__(A, MODE) \ if (A); else CSP(test::TestLogEntry)(__FILE__, __LINE__, CSP(test::TestLogEntry)::MODE) << "TEST FAILED (" #A ") " #define CSP_ENSURE(A) CSP_TEST_U__(A, FAIL) +#define CSP_ENSURE_TRUE(A) CSP_TEST_U__(A, FAIL) +#define CSP_ENSURE_FALSE(A) CSP_TEST_U__(!(A), FAIL) #define CSP_ENSURE_EQ(A, B) CSP_TEST__(A, B, CSP(test::EqualTo()), FAIL) #define CSP_ENSURE_NE(A, B) CSP_TEST__(A, B, CSP(test::NotEqualTo()), FAIL) #define CSP_ENSURE_LT(A, B) CSP_TEST__(A, B, CSP(test::LessThan()), FAIL) @@ -290,6 +292,8 @@ #define CSP_ENSURE_DGE(A, B) CSP_TEST__(A, B, CSP(test::DoubleGreaterEqual()), FAIL) #define CSP_EXPECT(A) CSP_TEST_U__(A, SOFTFAIL) +#define CSP_EXPECT_TRUE(A) CSP_TEST_U__(A, SOFTFAIL) +#define CSP_EXPECT_FALSE(A) CSP_TEST_U__(!(A), SOFTFAIL) #define CSP_EXPECT_EQ(A, B) CSP_TEST__(A, B, CSP(test::EqualTo()), SOFTFAIL) #define CSP_EXPECT_NE(A, B) CSP_TEST__(A, B, CSP(test::NotEqualTo()), SOFTFAIL) #define CSP_EXPECT_LT(A, B) CSP_TEST__(A, B, CSP(test::LessThan()), SOFTFAIL) |
From: <sv...@ww...> - 2007-07-24 08:23:08
|
Author: mkrose Date: 2007-07-24 01:21:54 -0700 (Tue, 24 Jul 2007) New Revision: 2140 Modified: trunk/csp/csplib/data/Matrix3.cpp Log: Fix bug in Matrix3::invert(). Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2140 Modified: trunk/csp/csplib/data/Matrix3.cpp =================================================================== --- trunk/csp/csplib/data/Matrix3.cpp 2007-07-24 08:18:38 UTC (rev 2139) +++ trunk/csp/csplib/data/Matrix3.cpp 2007-07-24 08:21:54 UTC (rev 2140) @@ -145,6 +145,11 @@ bool Matrix3::invert(const Matrix3& m, double tolerance) { + if (&m == this) { + Matrix3 copy(m); + return invert(copy); + } + _mat[0][0] = DET2(m._mat,1,1,2,2); _mat[0][1] = DET2(m._mat,0,2,2,1); _mat[0][2] = DET2(m._mat,0,1,1,2); |
From: <sv...@ww...> - 2007-07-24 08:19:42
|
Author: mkrose Date: 2007-07-24 01:18:38 -0700 (Tue, 24 Jul 2007) New Revision: 2139 Modified: trunk/csp/csplib/util/Math.h Log: Minor fixes to radian/degrees conversion functions to prevent common type errors (e.g., toRadians(60) vs. toRadians(60.0)). Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2139 Modified: trunk/csp/csplib/util/Math.h =================================================================== --- trunk/csp/csplib/util/Math.h 2007-07-21 17:04:25 UTC (rev 2138) +++ trunk/csp/csplib/util/Math.h 2007-07-24 08:18:38 UTC (rev 2139) @@ -52,6 +52,9 @@ const double PI_2 = 1.57079632679489661923; const double PI_4 = 0.78539816339744830962; +template <typename T> struct ToFloat { typedef double Type; }; +template <> struct ToFloat<float> { typedef float Type; }; + /** return the minimum of two values, equivilant to std::min. * std::min not used because of STL implementation under IRIX contains no std::min.*/ template<typename T> @@ -83,19 +86,19 @@ inline T square(T v) { return v*v; } template<typename T> -inline T signedSquare(T v) { return v<(T)0?-v*v:v*v; } +inline T signedSquare(T v) { return (v < static_cast<T>(0)) ? -v*v : v*v; } template<typename T> -inline T toRadians(T deg) { return static_cast<T>(deg * (PI / 180)); } +inline typename ToFloat<T>::Type toRadians(T deg) { return static_cast<typename ToFloat<T>::Type>(deg * (PI / 180)); } template<typename T> -inline T toDegrees(T rad) { return static_cast<T>(rad * (180 / PI)); } +inline typename ToFloat<T>::Type toDegrees(T rad) { return static_cast<typename ToFloat<T>::Type>(rad * (180 / PI)); } template<typename T> -inline T inDegrees(T angle) { return toRadians(angle); } +inline typename ToFloat<T>::Type inDegrees(T angle) { return toRadians(angle); } template<typename T> -inline T inRadians(T angle) { return angle; } +inline typename ToFloat<T>::Type inRadians(T angle) { return static_cast<typename ToFloat<T>::Type>(angle); } template<typename T> inline void swap(T &a, T &b) { T t = a; a = b; b = t; } |
From: <sv...@ww...> - 2007-07-21 17:05:26
|
Author: mkrose Date: 2007-07-21 10:04:25 -0700 (Sat, 21 Jul 2007) New Revision: 2138 Modified: trunk/csp/cspsim/VirtualScene.cpp Log: Fix occasional segv on startup. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2138 Modified: trunk/csp/cspsim/VirtualScene.cpp =================================================================== --- trunk/csp/cspsim/VirtualScene.cpp 2007-07-10 20:21:47 UTC (rev 2137) +++ trunk/csp/cspsim/VirtualScene.cpp 2007-07-21 17:04:25 UTC (rev 2138) @@ -793,10 +793,12 @@ //XXX--m_FogColor = m_Sky->getHorizonColor(angle); float angle = atan2(dir.y(), dir.x()); m_FogColor = m_Sky->getSkyDome()->getHorizonColor(angle); - pFogAttr->setColor(m_FogColor); - pFogAttr->setStart(m_FogStart * (1.0 + a) + clearSky); - pFogAttr->setEnd(m_FogEnd); - pStateSet->setAttributeAndModes(pFogAttr, osg::StateAttribute::ON); + if (pFogAttr != NULL) { // TODO why is pFogAttr NULL at startup? + pFogAttr->setColor(m_FogColor); + pFogAttr->setStart(m_FogStart * (1.0 + a) + clearSky); + pFogAttr->setEnd(m_FogEnd); + pStateSet->setAttributeAndModes(pFogAttr, osg::StateAttribute::ON); + } m_FogGroup->setStateSet(pStateSet); //XXX--m_Sky->updateHorizon(m_FogColor, eyePos.z(), m_ViewDistance); } |
From: <sv...@ww...> - 2007-07-10 20:22:41
|
Author: nsmoooose Date: 2007-07-10 13:21:47 -0700 (Tue, 10 Jul 2007) New Revision: 2137 Modified: trunk/csp/cspsim/CSPSim.cpp trunk/csp/cspsim/stores/StoresDatabase.cpp trunk/csp/cspsim/stores/StoresDatabase.h Log: Removed some memory leaks that occured when you: 1 started a simulation. 2 Returned to the main menu. 3 goto 1 Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2137 Modified: trunk/csp/cspsim/CSPSim.cpp =================================================================== --- trunk/csp/cspsim/CSPSim.cpp 2007-07-09 21:11:26 UTC (rev 2136) +++ trunk/csp/cspsim/CSPSim.cpp 2007-07-10 20:21:47 UTC (rev 2137) @@ -109,7 +109,6 @@ CSPSim::CSPSim(): m_ConfigurationChanged(new wf::Signal), - m_DataManager(new DataManager), m_Atmosphere(new Atmosphere), //--m_RenderSurface(new Producer::RenderSurface), m_InputEvent(new InputEvent) @@ -268,21 +267,6 @@ ospath::addpath(search_path, font_path); ObjectModel::setDataFilePathList(search_path); - // open the primary data archive - std::string cache_path = getCachePath(); - std::string archive_file = ospath::join(cache_path, "sim.dar"); - try { - DataArchive *sim = new DataArchive(archive_file.c_str(), 1); - assert(sim); - m_DataManager->addArchive(sim); - } - catch (Exception &e) { - CSPLOG(ERROR, APP) << "Error opening data archive " << archive_file; - CSPLOG(ERROR, APP) << e.getType() << ": " << e.getMessage(); - throw e; - //::exit(0); - } - if (initSDL()) { ::exit(1); // error already logged } @@ -347,6 +331,8 @@ m_SDLJoystick = NULL; } + StoresDatabase::getInstance().reset(); + // release cached objects. this must be done before the sound engine is shut // down to prevent errors when deleting cached sound samples. m_DataManager = 0; @@ -376,6 +362,24 @@ } void CSPSim::loadSimulation() { + + m_DataManager = new DataManager(); + + // open the primary data archive + std::string cache_path = getCachePath(); + std::string archive_file = ospath::join(cache_path, "sim.dar"); + try { + DataArchive *sim = new DataArchive(archive_file.c_str(), 1); + assert(sim); + m_DataManager->addArchive(sim); + } + catch (Exception &e) { + CSPLOG(ERROR, APP) << "Error opening data archive " << archive_file; + CSPLOG(ERROR, APP) << e.getType() << ": " << e.getMessage(); + throw e; + //::exit(0); + } + if(m_CurrentScreen.valid()) { m_CurrentScreen->onRender(); SDL_GL_SwapBuffers(); @@ -422,7 +426,6 @@ double lon = m_Terrain->getCenter().longitude(); m_Atmosphere->setPosition(lat, lon); - // TODO may need a reset method when we swap theaters StoresDatabase::getInstance().load(*m_DataManager, "sim:stores"); if(m_CurrentScreen.valid()) { @@ -539,20 +542,21 @@ } void CSPSim::unloadSimulationNow() { + // TODO Do we need to unload in a specific order? m_ActiveObject = NULL; - - // The virtual battlefield m_Battlefield = NULL; m_Scene = NULL; m_NetworkClient = NULL; - - // TODO the terrain will eventually be encapsulated in a Theater class m_Theater = NULL; + StoresDatabase::getInstance().reset(); + if(m_Terrain.valid()) { m_Terrain->deactivate(); m_Terrain = NULL; } + + m_DataManager = NULL; } void CSPSim::displayLogoScreen() { Modified: trunk/csp/cspsim/stores/StoresDatabase.cpp =================================================================== --- trunk/csp/cspsim/stores/StoresDatabase.cpp 2007-07-09 21:11:26 UTC (rev 2136) +++ trunk/csp/cspsim/stores/StoresDatabase.cpp 2007-07-10 20:21:47 UTC (rev 2137) @@ -62,6 +62,12 @@ _load(data_manager, ObjectID(root), root); } +void StoresDatabase::reset() { + m_StoresByKey.clear(); + m_ParentMatrix.clear(); + m_ChildMatrix.clear(); +} + Ref<Store> StoresDatabase::getStore(std::string const &id) { return getStore(Key(id)); } Modified: trunk/csp/cspsim/stores/StoresDatabase.h =================================================================== --- trunk/csp/cspsim/stores/StoresDatabase.h 2007-07-09 21:11:26 UTC (rev 2136) +++ trunk/csp/cspsim/stores/StoresDatabase.h 2007-07-10 20:21:47 UTC (rev 2137) @@ -62,6 +62,10 @@ * objects under the path indicated by the root parameter will be indexed. */ void load(DataManager &data_manager, std::string const &root); + + /** Unloads all objects in this singleton. Used when we swap theatre. + */ + void reset(); /** Convenience method to get a store by id string, equivalent to getStore(Key(id)). */ |
From: <sv...@ww...> - 2007-07-09 21:12:19
|
Author: nsmoooose Date: 2007-07-09 14:11:26 -0700 (Mon, 09 Jul 2007) New Revision: 2136 Modified: trunk/csp/bin/sim.py trunk/csp/cspsim/CSPSim.cpp trunk/csp/cspsim/CSPSim.h trunk/csp/data/ui/scripts/startup.py trunk/csp/data/ui/scripts/windows/quitresume.py trunk/csp/data/ui/themes/default/quit_resume.xml Log: It is now possible to return to the main menu from the simulation. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2136 Modified: trunk/csp/bin/sim.py =================================================================== --- trunk/csp/bin/sim.py 2007-07-08 17:35:22 UTC (rev 2135) +++ trunk/csp/bin/sim.py 2007-07-09 21:11:26 UTC (rev 2136) @@ -342,6 +342,7 @@ from csp.data.ui.scripts.startup import UserInterfaceStartup userInterface = UserInterfaceStartup(sim) userInterface.run(); + sim.run() finally: sim.cleanup() Modified: trunk/csp/cspsim/CSPSim.cpp =================================================================== --- trunk/csp/cspsim/CSPSim.cpp 2007-07-08 17:35:22 UTC (rev 2135) +++ trunk/csp/cspsim/CSPSim.cpp 2007-07-09 21:11:26 UTC (rev 2136) @@ -127,7 +127,7 @@ CSPLOG(DEBUG, APP) << "Constructing CSPSim object"; m_Clean = true; - + m_UnloadSimulationRequested = false; m_Paused = true; m_Finished = false; @@ -535,8 +535,26 @@ } void CSPSim::unloadSimulation() { + m_UnloadSimulationRequested = true; } +void CSPSim::unloadSimulationNow() { + m_ActiveObject = NULL; + + // The virtual battlefield + m_Battlefield = NULL; + m_Scene = NULL; + m_NetworkClient = NULL; + + // TODO the terrain will eventually be encapsulated in a Theater class + m_Theater = NULL; + + if(m_Terrain.valid()) { + m_Terrain->deactivate(); + m_Terrain = NULL; + } +} + void CSPSim::displayLogoScreen() { Ref<LogoScreen> logoScreen = new LogoScreen(screenSettings.width, screenSettings.height); logoScreen->onInit(); @@ -648,6 +666,14 @@ if (time_render.elapsed() + time_object_update.elapsed() > 0.05) { //std::cout << "long frame: update=" << time_object_update.elapsed() << " render=" << time_render.elapsed() << " lo=" << lopri << "\n"; } + + // Check if someone has requested that the simulation should be + // unloaded. This usually means that the user wants to go back to + // the main menu. + if(m_UnloadSimulationRequested) { + unloadSimulationNow(); + m_UnloadSimulationRequested = false; + } } //m_Battlefield->dumpObjectHistory(); } Modified: trunk/csp/cspsim/CSPSim.h =================================================================== --- trunk/csp/cspsim/CSPSim.h 2007-07-08 17:35:22 UTC (rev 2135) +++ trunk/csp/cspsim/CSPSim.h 2007-07-09 21:11:26 UTC (rev 2136) @@ -99,12 +99,13 @@ virtual void loadSimulation(); // Unloads all objects used during a simulation. virtual void unloadSimulation(); + virtual void unloadSimulationNow(); virtual void displayLogoScreen(); virtual void displayMenuScreen(); virtual void run(); virtual void quit(); virtual void cleanup(); - + virtual wf::Signal* getConfigurationChangedSignal(); virtual config::Configuration* getConfiguration(); virtual void setConfiguration(config::Configuration* config); @@ -158,6 +159,7 @@ bool m_Paused; bool m_Finished; bool m_Clean; + bool m_UnloadSimulationRequested; // The current simulation time/date SimDate m_CurrentTime; Modified: trunk/csp/data/ui/scripts/startup.py =================================================================== --- trunk/csp/data/ui/scripts/startup.py 2007-07-08 17:35:22 UTC (rev 2135) +++ trunk/csp/data/ui/scripts/startup.py 2007-07-09 21:11:26 UTC (rev 2136) @@ -68,7 +68,6 @@ self.displayDesktop() self.displayTopMenu() self.displayMainMenu() - self.cspsim.run() def configuration_Changed(self): self.configuration = self.cspsim.getConfiguration() Modified: trunk/csp/data/ui/scripts/windows/quitresume.py =================================================================== --- trunk/csp/data/ui/scripts/windows/quitresume.py 2007-07-08 17:35:22 UTC (rev 2135) +++ trunk/csp/data/ui/scripts/windows/quitresume.py 2007-07-09 21:11:26 UTC (rev 2136) @@ -57,5 +57,14 @@ self.close() def end_simulation_Click(self): - # self.cspsim.displayMenuScreen() - print 'End requested' + # Start by changing the screen. This makes it possible for us to + # display the main menu and the desktop. + self.cspsim.displayMenuScreen() + # End the simulation by unloading everything. + self.cspsim.unloadSimulation() + + # Use the UserInterfaceStartup class to return to the main menu + # and the desktop. + from csp.data.ui.scripts.startup import UserInterfaceStartup + startup = UserInterfaceStartup(self.cspsim) + startup.run() Modified: trunk/csp/data/ui/themes/default/quit_resume.xml =================================================================== --- trunk/csp/data/ui/themes/default/quit_resume.xml 2007-07-08 17:35:22 UTC (rev 2135) +++ trunk/csp/data/ui/themes/default/quit_resume.xml 2007-07-09 21:11:26 UTC (rev 2136) @@ -13,7 +13,7 @@ <Label CssClass="stripe" LocationX="0" LocationY="30" SizeWidth="428" SizeHeight="10" /> <Button LocationX="47" LocationY="60" SizeWidth="150" SizeHeight="40" Id="resume" Text="${resume}" /> - <Button LocationX="229" LocationY="60" SizeWidth="150" SizeHeight="40" Id="end_simulation" Text="${main_menu}" Enabled="false" /> + <Button LocationX="229" LocationY="60" SizeWidth="150" SizeHeight="40" Id="end_simulation" Text="${main_menu}" /> </Controls> </MultiControlContainer> </Control> |
From: <sv...@ww...> - 2007-07-08 17:36:11
|
Author: nsmoooose Date: 2007-07-08 10:35:22 -0700 (Sun, 08 Jul 2007) New Revision: 2135 Modified: trunk/csp/SConstruct Log: Accidentily commited the debug build settings for windows. Reverted these changes. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2135 Modified: trunk/csp/SConstruct =================================================================== --- trunk/csp/SConstruct 2007-07-07 23:21:22 UTC (rev 2134) +++ trunk/csp/SConstruct 2007-07-08 17:35:22 UTC (rev 2135) @@ -126,10 +126,10 @@ env.Replace(SWIGINCLUDES=self.INCLUDE) def customize_win(self, env): - env.Replace(CXXFLAGS=Split('/GR /MD /Zi /EHsc /W3 /nologo')) + env.Replace(CXXFLAGS=Split('/GR /MD /O2 /EHsc /W3 /nologo')) env.AppendUnique(CPPDEFINES=Split('WIN32 __WIN32__ _USRDLL _DLL NDEBUG _CRT_SECURE_NO_DEPRECATE')) - env.AppendUnique(LINKFLAGS=Split('/INCREMENTAL:NO /DEBUG /nologo')) - env.AppendUnique(SHLINKFLAGS=Split('/INCREMENTAL:NO /DEBUG /nologo')) + env.AppendUnique(LINKFLAGS=Split('/INCREMENTAL:NO /RELEASE /nologo')) + env.AppendUnique(SHLINKFLAGS=Split('/INCREMENTAL:NO /RELEASE /nologo')) env.AppendUnique(LIBPATH=[build.GetPythonLibrary()]) env.CopyEnvironment(Split('PATH INCLUDE LIB')) |
From: <sv...@ww...> - 2007-07-07 23:22:10
|
Author: nsmoooose Date: 2007-07-07 16:21:22 -0700 (Sat, 07 Jul 2007) New Revision: 2134 Modified: trunk/csp/data/ui/scripts/gamescreenmanager.py trunk/csp/data/ui/scripts/windows/pause.py trunk/csp/data/ui/scripts/windows/quitresume.py trunk/csp/data/ui/themes/default/quit_resume.xml trunk/csp/data/ui/themes/default/topmenu.xml Log: It is now possible to reach help from within the simulation using the top toolbar Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2134 Diff omitted (19581 bytes). |
From: <sv...@ww...> - 2007-07-04 23:57:28
|
Author: mkrose Date: 2007-07-04 16:56:42 -0700 (Wed, 04 Jul 2007) New Revision: 2133 Modified: trunk/csp/tools/build/autoconf.py Log: Fix typo in config script. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2133 Modified: trunk/csp/tools/build/autoconf.py =================================================================== --- trunk/csp/tools/build/autoconf.py 2007-06-19 21:36:47 UTC (rev 2132) +++ trunk/csp/tools/build/autoconf.py 2007-07-04 23:56:42 UTC (rev 2133) @@ -166,7 +166,7 @@ context.env['%s_VERSION' % lib_name.upper()] = version else: context.Result("no") - centext.Log(error) + context.Log(error) return ok |
From: <sv...@ww...> - 2007-06-19 21:37:18
|
Author: stormbringer Date: 2007-06-19 14:36:47 -0700 (Tue, 19 Jun 2007) New Revision: 2132 Added: trunk/csp/data/ui/localization/german/ trunk/csp/data/ui/localization/german/global.xml Log: German menu localization Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2132 Added: trunk/csp/data/ui/localization/german/global.xml =================================================================== --- trunk/csp/data/ui/localization/german/global.xml (rev 0) +++ trunk/csp/data/ui/localization/german/global.xml 2007-06-19 21:36:47 UTC (rev 2132) @@ -0,0 +1,30 @@ +<?xml version="1.0"?> +<StringTableDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation='../../window_document.xsd'> + <Strings> + <String key="cancel">Abbrechen</String> + <String key="credits">Credits</String> + <String key="csp">Combat Simulator Project</String> + <String key="full_screen_mode">Vollbildmodus</String> + <String key="help">Hilfe</String> + <String key="help_mouse">Maus</String> + <String key="help_keyboard_view">Sichten</String> + <String key="help_welcome">Willkommen</String> + <String key="help_joystick">Joystick</String> + <String key="help_f16_first_steps">F-16 Erste Schritte</String> + <String key="help_keyboard_aircraft">Flugzeugsteuerung</String> + <String key="instant_action">Sofort starten!</String> + <String key="main_menu">Hauptmen</String> + <String key="multiplayer">Mehrspieler</String> + <String key="ok">OK</String> + <String key="options">Optionen</String> + <String key="pause">Pause</String> + <String key="quit">Beenden</String> + <String key="resume">Fortsetzen</String> + <String key="restart_required">Neustart erforderlich</String> + <String key="singleplayer">Einzelspieler</String> + <String key="screen_resolution">Auflösung</String> + <String key="tutorials">Tutorials</String> + <String key="ui_theme">Theme</String> + <String key="ui_language">Sprache</String> + </Strings> +</StringTableDocument> \ No newline at end of file |
From: <sv...@ww...> - 2007-06-17 19:31:42
|
Author: nsmoooose Date: 2007-06-17 12:31:13 -0700 (Sun, 17 Jun 2007) New Revision: 2131 Modified: trunk/csp/cspsim/wf/ControlGeometryBuilder.cpp trunk/csp/data/ui/localization/svenska/global.xml Log: Added support for non a-z characters. All user interface xml files are expected to be in UTF8 format. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2131 Modified: trunk/csp/cspsim/wf/ControlGeometryBuilder.cpp =================================================================== --- trunk/csp/cspsim/wf/ControlGeometryBuilder.cpp 2007-06-16 16:32:24 UTC (rev 2130) +++ trunk/csp/cspsim/wf/ControlGeometryBuilder.cpp 2007-06-17 19:31:13 UTC (rev 2131) @@ -66,7 +66,7 @@ osgText::Text* ControlGeometryBuilder::buildText(const std::string& text, const std::string& fontFamily, float fontSize, osg::Vec4& color) const { osg::ref_ptr<osgText::Text> textNode = new osgText::Text; - textNode->setText(text); + textNode->setText(text, osgText::String::ENCODING_UTF8); textNode->setColor(color); textNode->setFont(fontFamily.c_str()); textNode->setCharacterSize(fontSize); @@ -572,7 +572,7 @@ getNextLayer(z); osg::ref_ptr<osgText::Text> button_text = new osgText::Text; - button_text->setText(parsedText); + button_text->setText(parsedText, osgText::String::ENCODING_UTF8); button_text->setColor(*style.color); button_text->setAlignment(osgText::Text::LEFT_CENTER); button_text->setFont(style.fontFamily->c_str()); Modified: trunk/csp/data/ui/localization/svenska/global.xml =================================================================== --- trunk/csp/data/ui/localization/svenska/global.xml 2007-06-16 16:32:24 UTC (rev 2130) +++ trunk/csp/data/ui/localization/svenska/global.xml 2007-06-17 19:31:13 UTC (rev 2131) @@ -1,30 +1,30 @@ -<?xml version="1.0"?> +<?xml version="1.0" ?> <StringTableDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation='../../window_document.xsd'> <Strings> <String key="cancel">Avbryt</String> - <String key="credits">Berom</String> + <String key="credits">Beröm</String> <String key="csp">Combat Simulator Project</String> - <String key="full_screen_mode">Helskarm</String> - <String key="help">Hjalp</String> + <String key="full_screen_mode">Helskärm</String> + <String key="help">Hjälp</String> <String key="help_mouse">Mus</String> <String key="help_keyboard_view">Vyer</String> - <String key="help_welcome">Valkommen</String> + <String key="help_welcome">Välkommen</String> <String key="help_joystick">Joystick</String> <String key="help_f16_first_steps">F16 Start</String> <String key="help_keyboard_aircraft">Flygplans kontroller</String> <String key="instant_action">Action</String> <String key="main_menu">Huvudmeny</String> - <String key="multiplayer">Natverk</String> + <String key="multiplayer">Nätverk</String> <String key="ok">OK</String> - <String key="options">Installningar</String> + <String key="options">Inställningar</String> <String key="pause">Paus</String> <String key="quit">Avsluta</String> - <String key="restart_required">Omstart kravs for att andring skall galla.</String> - <String key="resume">Aterga</String> - <String key="screen_resolution">Upplosning</String> + <String key="restart_required">Omstart krävs fär att ändring skall gälla.</String> + <String key="resume">Återgå</String> + <String key="screen_resolution">Upplösning</String> <String key="singleplayer">1 spelare</String> <String key="tutorials">Handledning</String> <String key="ui_theme">Tema</String> - <String key="ui_language">Sprak</String> + <String key="ui_language">Språk</String> </Strings> </StringTableDocument> \ No newline at end of file |
Author: nsmoooose Date: 2007-06-16 09:32:24 -0700 (Sat, 16 Jun 2007) New Revision: 2130 Added: trunk/csp/data/ui/scripts/windows/pause.py trunk/csp/data/ui/themes/default/images/pause.png trunk/csp/data/ui/themes/default/images/pause.svg trunk/csp/data/ui/themes/default/pause.xml Modified: trunk/csp/cspsim/GameScreen.cpp trunk/csp/cspsim/GameScreen.h trunk/csp/cspsim/ScreenInfoManager.cpp trunk/csp/cspsim/swig/wf.i trunk/csp/cspsim/wf/WindowManager.cpp trunk/csp/cspsim/wf/WindowManager.h trunk/csp/data/ui/localization/english/global.xml trunk/csp/data/ui/localization/svenska/global.xml trunk/csp/data/ui/scripts/gamescreenmanager.py Log: Added new pause window to the simulation. Contributed by MunchyYDL. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2130 Diff omitted (27381 bytes). |
From: <sv...@ww...> - 2007-06-16 16:00:16
|
Author: nsmoooose Date: 2007-06-16 08:59:48 -0700 (Sat, 16 Jun 2007) New Revision: 2129 Removed: branches/new_look_and_feel/ Log: Deleted new_look_and_feel branch since it is no longer in use and has been merged into the trunk. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2129 |
From: <sv...@ww...> - 2007-06-16 15:58:35
|
Author: nsmoooose Date: 2007-06-16 08:58:06 -0700 (Sat, 16 Jun 2007) New Revision: 2128 Added: trunk/csp/cspsim/wf/Image.cpp trunk/csp/cspsim/wf/Image.h Modified: trunk/csp/csplib/ trunk/csp/cspsim/ trunk/csp/cspsim/SConscript trunk/csp/cspsim/wf/ControlGeometryBuilder.cpp trunk/csp/cspsim/wf/ControlGeometryBuilder.h trunk/csp/cspsim/wf/Serialization.cpp trunk/csp/data/ui/scripts/windows/ trunk/csp/data/ui/themes/default/desktop.xml trunk/csp/data/ui/themes/default/styles.xml trunk/csp/data/ui/window_document.xsd Log: Added image widget to the window framework. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2128 Property changes on: trunk/csp/csplib ___________________________________________________________________ Name: svn:ignore - .bin *.pyc + .bin *.pyc .dox Property changes on: trunk/csp/cspsim ___________________________________________________________________ Name: svn:ignore - .bin *.pyc *.sconsign + .bin *.pyc *.sconsign .dox Modified: trunk/csp/cspsim/SConscript =================================================================== --- trunk/csp/cspsim/SConscript 2007-06-16 15:16:41 UTC (rev 2127) +++ trunk/csp/cspsim/SConscript 2007-06-16 15:58:06 UTC (rev 2128) @@ -392,6 +392,8 @@ 'wf/ControlCallback.h', 'wf/ControlGeometryBuilder.cpp', 'wf/ControlGeometryBuilder.h', + 'wf/Image.cpp', + 'wf/Image.h', 'wf/InputInterfaceManager.cpp', 'wf/InputInterfaceManager.h', 'wf/Label.cpp', Modified: trunk/csp/cspsim/wf/ControlGeometryBuilder.cpp =================================================================== --- trunk/csp/cspsim/wf/ControlGeometryBuilder.cpp 2007-06-16 15:16:41 UTC (rev 2127) +++ trunk/csp/cspsim/wf/ControlGeometryBuilder.cpp 2007-06-16 15:58:06 UTC (rev 2128) @@ -28,6 +28,7 @@ #include <csp/cspsim/wf/Button.h> #include <csp/cspsim/wf/CheckBox.h> #include <csp/cspsim/wf/ControlGeometryBuilder.h> +#include <csp/cspsim/wf/Image.h> #include <csp/cspsim/wf/Label.h> #include <csp/cspsim/wf/ListBox.h> #include <csp/cspsim/wf/ListBoxItem.h> @@ -669,6 +670,33 @@ return group.release(); } +osg::Group* ControlGeometryBuilder::buildImage(const Image* image) const { + Style style = StyleBuilder::buildStyle(image); + + // Test if the control is visible or not. + if (style.visible && *style.visible == false) { + return NULL; + } + + osg::ref_ptr<osg::Geode> geode = new osg::Geode; + float z = 0; + + buildControl(geode.get(), z, style, image); + + osg::ref_ptr<osg::Group> group = new osg::Group; + group->addChild(geode.get()); + + osg::StateSet *stateSet = group->getOrCreateStateSet(); + stateSet->setRenderBinDetails(100, "RenderBin"); + stateSet->setMode(GL_LIGHTING, osg::StateAttribute::OFF); + stateSet->setMode(GL_DEPTH_TEST, osg::StateAttribute::ON); + + osg::ref_ptr<osg::BlendFunc> blendFunction = new osg::BlendFunc; + stateSet->setAttributeAndModes(blendFunction.get()); + + return group.release(); +} + osg::Group* ControlGeometryBuilder::buildListBox(const ListBox* listBox) const { Style style = StyleBuilder::buildStyle(listBox); Modified: trunk/csp/cspsim/wf/ControlGeometryBuilder.h =================================================================== --- trunk/csp/cspsim/wf/ControlGeometryBuilder.h 2007-06-16 15:16:41 UTC (rev 2127) +++ trunk/csp/cspsim/wf/ControlGeometryBuilder.h 2007-06-16 15:58:06 UTC (rev 2128) @@ -51,6 +51,7 @@ class Button; class CheckBox; class Control; +class Image; class Label; class ListBox; class ListBoxItem; @@ -67,6 +68,7 @@ virtual void buildControl(osg::Geode* geode, float& z, const Style& style, const Control* control) const; virtual osg::Group* buildCheckBox(const CheckBox* checkBox) const; virtual osg::Group* buildLabel(const Label* label) const; + virtual osg::Group* buildImage(const Image* image) const; virtual osg::Group* buildListBox(const ListBox* listBox) const; virtual osg::Group* buildListBoxItem(const ListBox* listBox, const ListBoxItem* listBoxItem) const; virtual osg::Group* buildButton(const Button* button) const; Added: trunk/csp/cspsim/wf/Image.cpp =================================================================== --- trunk/csp/cspsim/wf/Image.cpp (rev 0) +++ trunk/csp/cspsim/wf/Image.cpp 2007-06-16 15:58:06 UTC (rev 2128) @@ -0,0 +1,54 @@ +// Combat Simulator Project +// 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 Image.cpp + * + **/ + +#include <csp/cspsim/wf/ControlGeometryBuilder.h> +#include <csp/cspsim/wf/Image.h> +#include <osg/Group> + +CSP_NAMESPACE + +namespace wf { + +Image::Image() { +} + +Image::~Image() { +} + +std::string Image::getName() const { + return "Image"; +} + +void Image::buildGeometry() { + // Make sure that all our child controls onInit() is called. + Control::buildGeometry(); + + ControlGeometryBuilder geometryBuilder; + osg::ref_ptr<osg::Group> image = geometryBuilder.buildImage(this); + getNode()->addChild(image.get()); +} + +} // namespace wf + +CSP_NAMESPACE_END Added: trunk/csp/cspsim/wf/Image.h =================================================================== --- trunk/csp/cspsim/wf/Image.h (rev 0) +++ trunk/csp/cspsim/wf/Image.h 2007-06-16 15:58:06 UTC (rev 2128) @@ -0,0 +1,49 @@ +// Combat Simulator Project +// 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 Image.h + * + **/ + +#ifndef __CSPSIM_WF_IMAGE_H__ +#define __CSPSIM_WF_IMAGE_H__ + +#include <csp/cspsim/wf/Control.h> + +CSP_NAMESPACE + +namespace wf { + +class CSPSIM_EXPORT Image : public Control { +public: + Image(); + virtual ~Image(); + + virtual std::string getName() const; + + virtual void buildGeometry(); +}; + +} // namespace wf + +CSP_NAMESPACE_END + +#endif // __CSPSIM_WF_IMAGE_H__ + Modified: trunk/csp/cspsim/wf/Serialization.cpp =================================================================== --- trunk/csp/cspsim/wf/Serialization.cpp 2007-06-16 15:16:41 UTC (rev 2127) +++ trunk/csp/cspsim/wf/Serialization.cpp 2007-06-16 15:58:06 UTC (rev 2128) @@ -31,6 +31,7 @@ #include <csp/cspsim/Config.h> #include <csp/cspsim/wf/Button.h> #include <csp/cspsim/wf/CheckBox.h> +#include <csp/cspsim/wf/Image.h> #include <csp/cspsim/wf/Label.h> #include <csp/cspsim/wf/ListBox.h> #include <csp/cspsim/wf/Model.h> @@ -274,6 +275,11 @@ archive.loadControl(control.get(), node); return control; } + else if(name == "Image") { + Ref<Image> control = new Image(); + archive.loadControl(control.get(), node); + return control; + } else if(name == "Label") { Ref<Label> control = new Label(); archive.loadControl(control.get(), node); Property changes on: trunk/csp/data/ui/scripts/windows ___________________________________________________________________ Name: svn:ignore + *.pyc Modified: trunk/csp/data/ui/themes/default/desktop.xml =================================================================== --- trunk/csp/data/ui/themes/default/desktop.xml 2007-06-16 15:16:41 UTC (rev 2127) +++ trunk/csp/data/ui/themes/default/desktop.xml 2007-06-16 15:58:06 UTC (rev 2128) @@ -8,14 +8,14 @@ <Control> <MultiControlContainer> <Controls> - <Label SizeWidth="550" SizeHeight="550"> + <Image SizeWidth="550" SizeHeight="550"> <Style> <BackgroundColor>ffffffff</BackgroundColor> <BackgroundImage>images/csplogo_large.png</BackgroundImage> <VerticalAlign>middle</VerticalAlign> <HorizontalAlign>center</HorizontalAlign> </Style> - </Label> + </Image> </Controls> </MultiControlContainer> </Control> Modified: trunk/csp/data/ui/themes/default/styles.xml =================================================================== --- trunk/csp/data/ui/themes/default/styles.xml 2007-06-16 15:16:41 UTC (rev 2127) +++ trunk/csp/data/ui/themes/default/styles.xml 2007-06-16 15:58:06 UTC (rev 2128) @@ -54,6 +54,11 @@ <BorderWidth>0</BorderWidth> <BorderColor>000000ff</BorderColor> </Style> + + <Style Name="Image"> + <Color>000000ff</Color> + <BackgroundColor>00000000</BackgroundColor> + </Style> <Style Name="Label"> <FontFamily>prima_sans_bt.ttf</FontFamily> Modified: trunk/csp/data/ui/window_document.xsd =================================================================== --- trunk/csp/data/ui/window_document.xsd 2007-06-16 15:16:41 UTC (rev 2127) +++ trunk/csp/data/ui/window_document.xsd 2007-06-16 15:58:06 UTC (rev 2128) @@ -167,6 +167,14 @@ </xsd:complexContent> </xsd:complexType> + <xsd:complexType name="Image_t"> + <xsd:complexContent> + <xsd:extension base="Control_t"> + <xsd:attribute name="Text" type="xsd:string" /> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + <xsd:complexType name="ListBox_t"> <xsd:complexContent> <xsd:extension base="Container_t"> @@ -208,6 +216,7 @@ <xsd:element name="Button" type="Button_t" /> <xsd:element name="CheckBox" type="CheckBox_t" /> <xsd:element name="Label" type="Label_t" /> + <xsd:element name="Image" type="Image_t" /> <xsd:element name="ListBox" type="ListBox_t" /> <xsd:element name="Model" type="Model_t" /> <xsd:element name="MultiControlContainer" type="MultiControlContainer_t" /> |
From: <sv...@ww...> - 2007-06-16 15:17:12
|
Author: nsmoooose Date: 2007-06-16 08:16:41 -0700 (Sat, 16 Jun 2007) New Revision: 2127 Modified: trunk/csp/cspsim/swig/wf.i Log: Added swig bindings for the model ui control. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=2127 Modified: trunk/csp/cspsim/swig/wf.i =================================================================== --- trunk/csp/cspsim/swig/wf.i 2007-06-14 05:43:03 UTC (rev 2126) +++ trunk/csp/cspsim/swig/wf.i 2007-06-16 15:16:41 UTC (rev 2127) @@ -22,6 +22,7 @@ #include <csp/cspsim/wf/Label.h> #include <csp/cspsim/wf/ListBox.h> #include <csp/cspsim/wf/ListBoxItem.h> +#include <csp/cspsim/wf/Model.h> #include <csp/cspsim/wf/Serialization.h> #include <csp/cspsim/wf/Signal.h> #include <csp/cspsim/wf/SignalData.h> @@ -47,6 +48,7 @@ class Control; class Label; class ListBoxItem; +class Model; class Signal; class SignalData; class Slot; @@ -114,6 +116,13 @@ return SWIGTYPE_p_csp__wf__Window; } } + { + csp::wf::Model *e = dynamic_cast<csp::wf::Model *>(*nptr); + if (e) { + *ptr = (void *) e; + return SWIGTYPE_p_csp__wf__Model; + } + } csp::wf::Control* f = dynamic_cast<csp::wf::Control*>(*nptr); if(f) { *ptr = (void *) f; @@ -230,6 +239,17 @@ virtual Signal* getSelectedItemChangedSignal(); }; +// ***************** MODEL ***************************** + +class Model : public Control { +public: + virtual std::string getModelFilePath() const; + virtual void setModelFilePath(std::string& filePath); + + virtual double getScale() const; + virtual void setScale(double scale); +}; + // ***************** SINGLECONTROLCONTAINER ***************************** class SingleControlContainer : public Container { |