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...> - 2005-10-15 20:20:51
|
Author: mkrose Date: 2005-10-15 13:20:41 -0700 (Sat, 15 Oct 2005) New Revision: 1628 Added: trunk/CSP/CSPSim/Include/ThrustData.h trunk/CSP/CSPSim/Source/ThrustData.cpp Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/F16/DJ/systems.xml trunk/CSP/CSPSim/Data/XML/vehicles/aircraft/m2k/systems.xml trunk/CSP/CSPSim/Include/Engine.h trunk/CSP/CSPSim/Source/Engine.cpp trunk/CSP/CSPSim/Source/SConscript trunk/CSP/CSPSim/VisualStudio/CSPSimDLL/CSPSimDLL.vcproj Log: * Move ThrustData to its own header and source files. Remove unused parameters from the Engine XML interface. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1628 Diff omitted (19968 bytes). |
From: <sv...@ww...> - 2005-10-15 20:06:50
|
Author: mkrose Date: 2005-10-15 13:06:43 -0700 (Sat, 15 Oct 2005) New Revision: 1627 Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Include/CockpitInterface.h trunk/CSP/CSPSim/Source/CockpitInterface.cpp Log: * Make the CockpitSwitch data channel a push channel and fix the constructor signature. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1627 Modified: trunk/CSP/CSPSim/CHANGES.current =================================================================== --- trunk/CSP/CSPSim/CHANGES.current 2005-10-15 20:02:50 UTC (rev 1626) +++ trunk/CSP/CSPSim/CHANGES.current 2005-10-15 20:06:43 UTC (rev 1627) @@ -11,6 +11,9 @@ * Add an osg::Group to SceneModel ("DynamicGroup") that can be used for attached objects such as external stores. + * Make the CockpitSwitch data channel a push channel and fix the + constructor signature. + 2005-08-27: onsight * Link against sigc-2.0, not sigc-1.2 for debug builds under MSVC. Modified: trunk/CSP/CSPSim/Include/CockpitInterface.h =================================================================== --- trunk/CSP/CSPSim/Include/CockpitInterface.h 2005-10-15 20:02:50 UTC (rev 1626) +++ trunk/CSP/CSPSim/Include/CockpitInterface.h 2005-10-15 20:06:43 UTC (rev 1627) @@ -62,8 +62,9 @@ */ class CockpitSwitch: public CockpitElement { public: + typedef simdata::Ref<CockpitSwitch> Ref; // if command == "", no input handlers will be registered. - CockpitSwitch(simdata::Enumeration *enumeration, std::string const &channel, std::string const &command, std::string const &initial); + CockpitSwitch(simdata::Enumeration const *enumeration, std::string const &channel, std::string const &command, std::string const &initial); CockpitSwitch(std::string const &enumeration, std::string const &channel, std::string const &command, std::string const &initial); CockpitSwitch(DataChannel<simdata::EnumLink> *channel, std::string const &command); simdata::EnumLink &state() { return m_State->value(); } @@ -90,7 +91,7 @@ public: virtual void registerChannels(Bus *bus); virtual void bindEvents(InputInterface *pInterface); - virtual void addElement(CockpitElement *element); + virtual CockpitElement* addElement(CockpitElement *element); private: std::vector<CockpitElement::Ref> m_Elements; Modified: trunk/CSP/CSPSim/Source/CockpitInterface.cpp =================================================================== --- trunk/CSP/CSPSim/Source/CockpitInterface.cpp 2005-10-15 20:02:50 UTC (rev 1626) +++ trunk/CSP/CSPSim/Source/CockpitInterface.cpp 2005-10-15 20:06:43 UTC (rev 1627) @@ -26,17 +26,17 @@ #include <CockpitInterface.h> -CockpitSwitch::CockpitSwitch(simdata::Enumeration *states, std::string const &channel, std::string const &command, std::string const &initial): m_Command(command) { +CockpitSwitch::CockpitSwitch(simdata::Enumeration const *states, std::string const &channel, std::string const &command, std::string const &initial): m_Command(command) { assert(states); simdata::EnumLink initial_value(*states, initial); - m_State = DataChannel<simdata::EnumLink>::newShared(channel, initial_value); + m_State = DataChannel<simdata::EnumLink>::newSharedPush(channel, initial_value); } CockpitSwitch::CockpitSwitch(std::string const &states, std::string const &channel, std::string const &command, std::string const &initial): m_Command(command) { assert(!states.empty()); simdata::Enumeration enumeration(states); simdata::EnumLink initial_value(enumeration, initial); - m_State = DataChannel<simdata::EnumLink>::newShared(channel, initial_value); + m_State = DataChannel<simdata::EnumLink>::newSharedPush(channel, initial_value); } CockpitSwitch::CockpitSwitch(DataChannel<simdata::EnumLink> *channel, std::string const &command): m_Command(command), m_State(channel) { @@ -66,21 +66,25 @@ void CockpitSwitch::onToggle() { std::cout << m_Command << " toggle\n"; m_State->value().cycle(); + m_State->push(); } void CockpitSwitch::onCycleNext() { std::cout << m_Command << " next\n"; m_State->value().cycle(); + m_State->push(); } void CockpitSwitch::onCyclePrev() { std::cout << m_Command << " prev\n"; m_State->value().cycleBack(); + m_State->push(); } void CockpitSwitch::onSelect(int state) { m_State->value().set(state); std::cout << m_Command << " select " << m_State->value().getToken() << "\n"; + m_State->push(); } void CockpitInterface::bindEvents(InputInterface *input) { @@ -90,8 +94,9 @@ } } -void CockpitInterface::addElement(CockpitElement *element) { +CockpitElement* CockpitInterface::addElement(CockpitElement *element) { m_Elements.push_back(element); + return element; } void CockpitInterface::registerChannels(Bus *bus) { |
From: <sv...@ww...> - 2005-10-15 20:02:57
|
Author: mkrose Date: 2005-10-15 13:02:50 -0700 (Sat, 15 Oct 2005) New Revision: 1626 Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Include/ObjectModel.h trunk/CSP/CSPSim/Source/ObjectModel.cpp Log: * Add an osg::Group to SceneModel ("DynamicGroup") that can be used for attached objects such as external stores. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1626 Modified: trunk/CSP/CSPSim/CHANGES.current =================================================================== --- trunk/CSP/CSPSim/CHANGES.current 2005-10-15 19:55:47 UTC (rev 1625) +++ trunk/CSP/CSPSim/CHANGES.current 2005-10-15 20:02:50 UTC (rev 1626) @@ -8,6 +8,9 @@ animitions like gauge needles where the physics isn't worth modeling). Fix minor initialization glitch in AnimatedMomentarySwitch. + * Add an osg::Group to SceneModel ("DynamicGroup") that can be used for + attached objects such as external stores. + 2005-08-27: onsight * Link against sigc-2.0, not sigc-1.2 for debug builds under MSVC. Modified: trunk/CSP/CSPSim/Include/ObjectModel.h =================================================================== --- trunk/CSP/CSPSim/Include/ObjectModel.h 2005-10-15 19:55:47 UTC (rev 1625) +++ trunk/CSP/CSPSim/Include/ObjectModel.h 2005-10-15 20:02:50 UTC (rev 1626) @@ -192,6 +192,7 @@ private: osg::ref_ptr<osg::PositionAttitudeTransform> m_Transform; osg::ref_ptr<osg::PositionAttitudeTransform> m_CenterOfMassOffset; + osg::ref_ptr<osg::Group> m_DynamicGroup; osg::ref_ptr<osg::Group> m_Children; osg::ref_ptr<osg::Node> m_ModelCopy; osg::ref_ptr<osgText::Text> m_Label; @@ -213,6 +214,7 @@ simdata::Ref<ObjectModel> getModel() { return m_Model; } osg::Group* getRoot(); + osg::Group* getDynamicGroup(); void setPositionAttitude(simdata::Vector3 const &position, simdata::Quat const &attitude, simdata::Vector3 const &cm_offset); Modified: trunk/CSP/CSPSim/Source/ObjectModel.cpp =================================================================== --- trunk/CSP/CSPSim/Source/ObjectModel.cpp 2005-10-15 19:55:47 UTC (rev 1625) +++ trunk/CSP/CSPSim/Source/ObjectModel.cpp 2005-10-15 20:02:50 UTC (rev 1626) @@ -770,10 +770,17 @@ // create a working copy ModelCopy model_copy; + + simdata::Timer timer; + timer.start(); m_ModelCopy = model_copy(model_node); m_PitSwitch = model_copy.getPitSwitch(); + timer.stop(); CSP_LOG(APP, INFO, "Copied model, animation count = " << model_copy.getAnimationCallbacks().size()); + if (timer.elapsed() > 0.01) { + CSP_LOG(APP, WARNING, "Model copy took " << (timer.elapsed() * 1e+3) << " ms"); + } m_AnimationCallbacks.resize(model_copy.getAnimationCallbacks().size()); @@ -939,6 +946,14 @@ return m_Transform.get(); } +osg::Group *SceneModel::getDynamicGroup() { + if (!m_DynamicGroup) { + m_DynamicGroup = new osg::Group; + m_CenterOfMassOffset->addChild(m_DynamicGroup.get()); + } + return m_DynamicGroup.get(); +} + void SceneModel::addChild(simdata::Ref<SceneModelChild> const &child) { assert(child->getRoot()); if (!m_Children) { |
From: <sv...@ww...> - 2005-10-15 19:55:53
|
Author: mkrose Date: 2005-10-15 12:55:47 -0700 (Sat, 15 Oct 2005) New Revision: 1625 Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Include/Animation.h trunk/CSP/CSPSim/Source/Animation.cpp Log: * Refactor rotation animation classes, moving some common operations to the base class. Add an optional non-linear gain to the rotation response. Add a rate limit for driven rotations (useful for simple animitions like gauge needles where the physics isn't worth modeling). Fix minor initialization glitch in AnimatedMomentarySwitch. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1625 Modified: trunk/CSP/CSPSim/CHANGES.current =================================================================== --- trunk/CSP/CSPSim/CHANGES.current 2005-10-15 19:43:37 UTC (rev 1624) +++ trunk/CSP/CSPSim/CHANGES.current 2005-10-15 19:55:47 UTC (rev 1625) @@ -1,6 +1,13 @@ Version 0.4.0 (in progress) =========================== +2005-10-15: onsight + * Refactor rotation animation classes, moving some common operations + to the base class. Add an optional non-linear gain to the rotation + response. Add a rate limit for driven rotations (useful for simple + animitions like gauge needles where the physics isn't worth modeling). + Fix minor initialization glitch in AnimatedMomentarySwitch. + 2005-08-27: onsight * Link against sigc-2.0, not sigc-1.2 for debug builds under MSVC. Modified: trunk/CSP/CSPSim/Include/Animation.h =================================================================== --- trunk/CSP/CSPSim/Include/Animation.h 2005-10-15 19:43:37 UTC (rev 1624) +++ trunk/CSP/CSPSim/Include/Animation.h 2005-10-15 19:55:47 UTC (rev 1625) @@ -67,6 +67,13 @@ * (e.g., by toggling a switch) and return true to prevent further processing. */ virtual bool pick(int /*flags*/) { return false; } + + /** Get the elapsed time in seconds since the last call to elapsedTime. + */ + double elapsedTime(const osg::NodeVisitor *nv); + +private: + double m_LastUpdateTime; }; Modified: trunk/CSP/CSPSim/Source/Animation.cpp =================================================================== --- trunk/CSP/CSPSim/Source/Animation.cpp 2005-10-15 19:43:37 UTC (rev 1624) +++ trunk/CSP/CSPSim/Source/Animation.cpp 2005-10-15 19:55:47 UTC (rev 1625) @@ -36,6 +36,7 @@ #include <SimData/Enum.h> #include <SimData/Math.h> #include <SimData/osg.h> +#include <SimData/LUT.h> #include <SimData/Vector3.h> #include <SimData/ObjectInterface.h> @@ -250,7 +251,14 @@ node.setUpdateCallback(this); } +double AnimationCallback::elapsedTime(const osg::NodeVisitor *nv) { + const double now = nv->getFrameStamp()->getReferenceTime(); + const double dt = now - m_LastUpdateTime; + m_LastUpdateTime = now; + return dt; +} + //////////////////////////////////////////////////////////////////////////////////// // //////////////////////////////////////////////////////////////////////////////////// @@ -278,13 +286,14 @@ class Rotation: public Animation { std::string m_ChannelName; simdata::Vector3 m_Axis; - float m_Gain; - float m_Phase; - float m_Limit0; - float m_Limit1; + double m_Gain; + double m_Phase; + double m_Limit0; + double m_Limit1; bool m_PreMultiply; bool m_PostMultiply; osg::Vec3 m_OSGAxis; + simdata::Table1 m_NonLinearScale; public: SIMDATA_DECLARE_ABSTRACT_OBJECT(Rotation) @@ -293,21 +302,28 @@ m_Axis(simdata::Vector3::ZERO), m_Gain(1.0f), m_Phase(0.0f), - m_Limit0(static_cast<float>(-simdata::PI)), - m_Limit1(static_cast<float>(simdata::PI)), + m_Limit0(-180), + m_Limit1(180), m_PreMultiply(false), m_PostMultiply(false) { } inline const std::string &getChannelName() const { return m_ChannelName; } - inline float getGain() const { return m_Gain; } - inline float getPhase() const { return m_Phase; } + inline double getGain() const { return m_Gain; } + inline double getPhase() const { return m_Phase; } inline const osg::Vec3 &getAxis() const { return m_OSGAxis; } - inline float getLimit0() const { return m_Limit0; } - inline float getLimit1() const { return m_Limit1; } + inline double getLimit0() const { return m_Limit0; } + inline double getLimit1() const { return m_Limit1; } inline bool getPreMultiply() const { return m_PreMultiply; } inline bool getPostMultiply() const { return m_PostMultiply; } + double toRadians(double value) const { + double angle = m_NonLinearScale.isInterpolated() ? m_NonLinearScale[static_cast<float>(value)] : value * m_Gain; + double lower = std::min(getLimit0(), getLimit1()); + double upper = std::max(getLimit0(), getLimit1()); + return simdata::toRadians(simdata::clampTo(angle + m_Phase, lower, upper)); + } + protected: virtual void postCreate() { Animation::postCreate(); @@ -325,6 +341,7 @@ SIMDATA_DEF("limit_1", m_Limit1, false) SIMDATA_DEF("pre_multiply", m_PreMultiply, false) SIMDATA_DEF("post_multiply", m_PostMultiply, false) + SIMDATA_DEF("non_linear_scale", m_NonLinearScale, false) SIMDATA_XML_END @@ -382,7 +399,7 @@ } if (m_Transform && m_Channel.value() >= 0) { assert(static_cast<int>(m_Animation->getAngles().size()) > m_Channel.value()); - const float angle = simdata::toRadians(m_Animation->getAngles()[m_Channel.value()]); + const double angle = simdata::toRadians(m_Animation->getAngles()[m_Channel.value()]); osg::Matrix m = osg::Matrix::rotate(angle, m_Animation->getAxis()); m.setTrans(m_Transform->getMatrix().getTrans()); m_Transform->setMatrix(m); @@ -719,12 +736,16 @@ */ class DrivenRotation: public Rotation { class Callback; + double m_RateLimit; public: SIMDATA_DECLARE_OBJECT(DrivenRotation) + DrivenRotation(): m_RateLimit(0) { } virtual AnimationCallback *newCallback(osg::Node *node) const; + double rateLimit() const { return m_RateLimit; } }; SIMDATA_XML_BEGIN(DrivenRotation) + SIMDATA_DEF("rate_limit", m_RateLimit, false) SIMDATA_XML_END @@ -733,34 +754,55 @@ DoubleChannel m_Channel; osg::MatrixTransform *m_Transform; osg::Matrix m_Original; + double m_Angle; + double m_AngleTarget; + double m_LastTime; + double m_RateLimit; public: - Callback(DrivenRotation const *driven_rotation): m_Animation(driven_rotation), m_Transform(0) { assert(driven_rotation); } + Callback(DrivenRotation const *driven_rotation): m_Animation(driven_rotation), m_Transform(0) { + assert(driven_rotation); + m_RateLimit = simdata::toRadians(driven_rotation->rateLimit()); + } + void updateValue(double dt) { + m_AngleTarget = m_Animation->toRadians(m_Channel.value()); + if (m_RateLimit > 0) { + const double delta = m_AngleTarget - m_Angle; + if (delta < 0) { + m_Angle -= std::min(-delta, dt * m_RateLimit); + } else { + m_Angle += std::min(delta, dt * m_RateLimit); + } + } else { + m_Angle = m_AngleTarget; + } + } + virtual void operator()(osg::Node* node, osg::NodeVisitor* nv) { - if (nv->getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR && m_Channel.update()) { - if (!m_Transform) { - m_Transform = dynamic_cast<osg::MatrixTransform*>(node); - assert(m_Transform); - m_Original = m_Transform->getMatrix(); - } - if (m_Transform) { - float angle = m_Animation->getGain() * m_Channel.value() + m_Animation->getPhase(); - float lower = std::min(m_Animation->getLimit0(), m_Animation->getLimit1()); - float upper = std::max(m_Animation->getLimit0(), m_Animation->getLimit1()); - angle = simdata::clampTo(angle, lower, upper); - const osg::Vec3 t = m_Transform->getMatrix().getTrans(); - osg::Matrix m = osg::Matrix::rotate(angle, m_Animation->getAxis()); - if (node->getUpdateCallback() != this) { - m.preMult(m_Transform->getMatrix()); + if (nv->getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR) { + const double dt = elapsedTime(nv); + if (m_Channel.update() || m_Angle != m_AngleTarget) { + if (!m_Transform) { + m_Transform = dynamic_cast<osg::MatrixTransform*>(node); + assert(m_Transform); + m_Original = m_Transform->getMatrix(); } - if (m_Animation->getPostMultiply()) { - m.preMult(m_Original); - } else if (m_Animation->getPreMultiply()) { - m.postMult(m_Original); + if (m_Transform) { + updateValue(dt); + const osg::Vec3 t = m_Transform->getMatrix().getTrans(); + osg::Matrix m = osg::Matrix::rotate(m_Angle, m_Animation->getAxis()); + if (node->getUpdateCallback() != this) { + m.preMult(m_Transform->getMatrix()); + } + if (m_Animation->getPostMultiply()) { + m.preMult(m_Original); + } else if (m_Animation->getPreMultiply()) { + m.postMult(m_Original); + } + m.setTrans(t); + m_Transform->setMatrix(m); } - m.setTrans(t); - m_Transform->setMatrix(m); } } traverse(node, nv); @@ -1424,7 +1466,7 @@ m_AnimationPathCallback(path), m_Index(0), m_Cycle(0.0), - m_Scale(0.0), + m_Scale(-0.1), m_LastTime(-1.0), m_Pause(false) // force initial reset { |
From: <sv...@ww...> - 2005-10-15 19:43:47
|
Author: mkrose Date: 2005-10-15 12:43:37 -0700 (Sat, 15 Oct 2005) New Revision: 1624 Modified: trunk/CSP/SimData/CHANGES.current trunk/CSP/SimData/Include/SimData/Link.h trunk/CSP/SimData/SimData/Parse.py trunk/CSP/SimData/Source/LUT.cpp Log: * Add support for serializing uninitialized TableN instances, which allows TableN members to be marked as optional in an XML interface. * Add better support for TableN instances in the XML parser. The parser now checks that the number of values matches the count expected from the breakpoints. Breakpoints and table values can now be scaled by the parser (e.g., scale="0.5" in the BreakN and Values attributes), which for example allows radian angles to be conveniently specified in degrees in the XML file. Note that the "spacing" attribute for breakpoints is also scaled by this factor. * Fix a syntax error in Link.h. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1624 Modified: trunk/CSP/SimData/CHANGES.current =================================================================== --- trunk/CSP/SimData/CHANGES.current 2005-08-30 05:30:42 UTC (rev 1623) +++ trunk/CSP/SimData/CHANGES.current 2005-10-15 19:43:37 UTC (rev 1624) @@ -1,6 +1,20 @@ Version 0.4.0 (in progress) =========================== +2005-10-15: onsight + * Add support for serializing uninitialized TableN instances, which allows + TableN members to be marked as optional in an XML interface. + + * Add better support for TableN instances in the XML parser. The parser + now checks that the number of values matches the count expected from + the breakpoints. Breakpoints and table values can now be scaled by + the parser (e.g., scale="0.5" in the BreakN and Values attributes), + which for example allows radian angles to be conveniently specified in + degrees in the XML file. Note that the "spacing" attribute for + breakpoints is also scaled by this factor. + + * Fix a syntax error in Link.h. + 2005-08-28: onsight * Small tweaks to the SimData API (Random.h), typemaps, and build scripts to workaround problems with swig 1.3.23 and Modified: trunk/CSP/SimData/Include/SimData/Link.h =================================================================== --- trunk/CSP/SimData/Include/SimData/Link.h 2005-08-30 05:30:42 UTC (rev 1623) +++ trunk/CSP/SimData/Include/SimData/Link.h 2005-10-15 19:43:37 UTC (rev 1624) @@ -297,7 +297,7 @@ */ T *operator =(T *t) { _path = 0; - _assign_fast(t); + _reassign(t); return t; } #endif // SWIG Modified: trunk/CSP/SimData/SimData/Parse.py =================================================================== --- trunk/CSP/SimData/SimData/Parse.py 2005-08-30 05:30:42 UTC (rev 1623) +++ trunk/CSP/SimData/SimData/Parse.py 2005-10-15 19:43:37 UTC (rev 1624) @@ -441,7 +441,7 @@ p = SimData.LinkBase() p.setPath(self._element.encode('ascii')) return p - + def end(self): if self._attrs.has_key("source"): source = self._attrs["source"] @@ -545,16 +545,28 @@ tags = self._keys breaks = [] spacing = [] + total = 1 for i in range(self._dim): breakpoints, attrs = tags["Breaks%d" % i] if not attrs.has_key("spacing"): msg = "LUTHander <Breaks%d> tag missing required attribute 'spacing'" % i raise XMLSyntax, msg + dx = float(attrs["spacing"]) + if attrs.has_key("scale"): + scale = float(attrs["scale"]) + breakpoints = [x * scale for x in breakpoints] + dx *= scale breaks.append(breakpoints) - dx = float(attrs["spacing"]) n = 1 + int((max(breaks[i]) - min(breaks[i])) / dx) spacing.append(n) + total *= len(breakpoints) values, attrs = tags["Values"] + if attrs.has_key("scale"): + scale = float(attrs["scale"]) + values = [x * scale for x in values] + if len(values) != total: + msg = "LUTHander value count does not match breakpoint count (%d vs %d)" % (len(values), total) + raise XMLSyntax, msg table.load(values, breaks) try: method = getattr(table, self._method.upper()) Modified: trunk/CSP/SimData/Source/LUT.cpp =================================================================== --- trunk/CSP/SimData/Source/LUT.cpp 2005-08-30 05:30:42 UTC (rev 1623) +++ trunk/CSP/SimData/Source/LUT.cpp 2005-10-15 19:43:37 UTC (rev 1624) @@ -438,6 +438,7 @@ int dim, n; reader >> dim; if (dim != N) { + if (dim == -N) return; // not interpolated std::ostringstream msg; msg << "LUT<" << N << ">::serialize table of dimension " << dim; throw InterpolationUnpackMismatch(msg.str()); @@ -455,9 +456,13 @@ template <int N, class X> void LUT<N,X>::serialize(Writer &writer) const { + int dim = N; + if (!this->isInterpolated()) { + writer << -dim; + return; + } this->checkInterpolated(); int n = tableSize(); - int dim = N; writer << dim; writer << this->m_X0; writer << this->m_X1; @@ -688,6 +693,7 @@ X x0, x1; int n; if (dim != 1) { + if (dim == -1) return; std::ostringstream msg; msg << "LUT<1>::serialize table of dimension " << dim; throw InterpolationUnpackMismatch(msg.str()); @@ -706,6 +712,10 @@ template <typename X> void LUT<1,X>::serialize(Writer &writer) const { int dim = 1; + if (!this->isInterpolated()) { + writer << -dim; + return; + } writer << dim; this->checkInterpolated(); int n = tableSize(); |
From: <sv...@ww...> - 2005-08-30 05:30:53
|
Author: mkrose Date: 2005-08-29 22:30:42 -0700 (Mon, 29 Aug 2005) New Revision: 1623 Modified: trunk/CSP/CSPSim/Demo/Win/makedemo.py Log: Skip .svn directories when constructing a demo. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1623 Modified: trunk/CSP/CSPSim/Demo/Win/makedemo.py =================================================================== --- trunk/CSP/CSPSim/Demo/Win/makedemo.py 2005-08-29 19:16:58 UTC (rev 1622) +++ trunk/CSP/CSPSim/Demo/Win/makedemo.py 2005-08-30 05:30:42 UTC (rev 1623) @@ -51,6 +51,30 @@ sys.exit(1) +def copy_tree(src, dst, symlinks=0, exclude=None): + """Just like shutil.copytree, but allows files to be excluded based on a regexp.""" + if isinstance(exclude, str): exclude = re.compile(exclude) + names = os.listdir(src) + os.mkdir(dst) + errors = [] + for name in names: + if exclude and exclude.search(name): continue + srcname = os.path.join(src, name) + dstname = os.path.join(dst, name) + try: + if symlinks and os.path.islink(srcname): + linkto = os.readlink(srcname) + os.symlink(linkto, dstname) + elif os.path.isdir(srcname): + copy_tree(srcname, dstname, symlinks, exclude) + else: + shutil.copy2(srcname, dstname) + except (IOError, os.error), why: + errors.append((srcname, dstname, why)) + if errors: + raise Error, errors + + def make_demo(version): TEMPLATE = 'CSPSim-Demo' DEMO = 'CSPSim-Demo-%s' % version @@ -62,7 +86,7 @@ error('%s already exists! Aborting.' % DEMO) print 'Copying data from %s to %s' % (TEMPLATE, DEMO) - shutil.copytree(TEMPLATE, DEMO) + copy_tree(TEMPLATE, DEMO, exclude=r'^\.svn$') DIST_DIR = os.path.join(DEMO, 'Bin') print 'Running py2exe to create %s' % DIST_DIR @@ -82,7 +106,7 @@ DATA_TARGET = os.path.join(DEMO, 'Data') if not os.path.exists(DATA_TARGET): print 'Copying data from %s to %s' % (CSPSIM_DATA, DATA_TARGET) - shutil.copytree(CSPSIM_DATA, DATA_TARGET) + copy_tree(CSPSIM_DATA, DATA_TARGET, exclude=r'^\.svn$') print 'Writing README header' README = os.path.join(DEMO, 'README') |
From: <sv...@ww...> - 2005-08-29 19:17:08
|
Author: stormbringer Date: 2005-08-29 12:16:58 -0700 (Mon, 29 Aug 2005) New Revision: 1622 Modified: trunk/CSP/CSPSim/Demo/Win/InstallScript_CSPSim-Demo-0.5.nsi trunk/CSP/CSPSim/Demo/Win/README Log: Fixed a bug in the NSIS script. Added NSIS build instructions to README. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1622 Modified: trunk/CSP/CSPSim/Demo/Win/InstallScript_CSPSim-Demo-0.5.nsi =================================================================== --- trunk/CSP/CSPSim/Demo/Win/InstallScript_CSPSim-Demo-0.5.nsi 2005-08-28 23:08:19 UTC (rev 1621) +++ trunk/CSP/CSPSim/Demo/Win/InstallScript_CSPSim-Demo-0.5.nsi 2005-08-29 19:16:58 UTC (rev 1622) @@ -49,7 +49,7 @@ ;Install properties !insertmacro MUI_PAGE_WELCOME -!insertmacro MUI_PAGE_LICENSE "csp_license.txt" +!insertmacro MUI_PAGE_LICENSE "./CSPSim-Demo-0.5/COPYING" !insertmacro MUI_PAGE_COMPONENTS !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_INSTFILES Modified: trunk/CSP/CSPSim/Demo/Win/README =================================================================== --- trunk/CSP/CSPSim/Demo/Win/README 2005-08-28 23:08:19 UTC (rev 1621) +++ trunk/CSP/CSPSim/Demo/Win/README 2005-08-29 19:16:58 UTC (rev 1622) @@ -1,20 +1,22 @@ -CREATING A DEMO RELEASE OF CSPSIM FOR WINDOWS -============================================= - -In this directory, run: - -> python makedemo.py VERSION - -where VERSION is of the form major.minor (e.g., "0.5"). This will create -a subdirectory named CSPSim-Demo-VERSION that contains all of the necessary -modules, dlls, and data. Note that if any system libraries are reported as -"missing" you may have to copy them by hand to this directory and repeat the -makedemo command. - -After makedemo has completed successfully, update the README and LICENSE files -in the CSPSim-Demo-VERSION subdirectory. Zip the entire directory to create -the demo release: CSPSim-Demo-VERSION.zip. Unzip this file in C:\tmp and test -that the sim runs correctly. Ideally repeat this test on another computer -that isn't used for CSP development. When everything looks good, upload the -zip file to the CSP project page at SourceForge and announce the new demo on -the forums. +CREATING A DEMO RELEASE OF CSPSIM FOR WINDOWS +============================================= + +In this directory, run: + +> python makedemo.py VERSION + +where VERSION is of the form major.minor (e.g., "0.5"). This will create +a subdirectory named CSPSim-Demo-VERSION that contains all of the necessary +modules, dlls, and data. Note that if any system libraries are reported as +"missing" you may have to copy them by hand to this directory and repeat the +makedemo command. + +After makedemo has completed successfully, update the README and LICENSE files +in the CSPSim-Demo-VERSION subdirectory. Zip the entire directory to create +the demo release: CSPSim-Demo-VERSION.zip. Unzip this file in C:\tmp and test +that the sim runs correctly. Ideally repeat this test on another computer +that isn't used for CSP development. When everything looks good, upload the +zip file to the CSP project page at SourceForge and announce the new demo on +the forums. + +Another way of creating a demo is using the NSIS install script. NSIS (Nullsoft Scriptable Install System - see http://nsis.sf.net) is a tool to create Windows installers. The file "InstallScript_CSPSim-Demo-X.Y.nsi" can be run from a NSIS GUI like VenisIX (see http://www.spaceblue.com/venis - it's free for non-profit use). When placed in the same directory as "makedemo.py", it zips the whole CSPSim-Demo-X.Y folder to a single "setup.exe" file. The NSIS script needs to be adapted to the current version of the CSPSim demo. All you have to do is to change all directory names in the script and set them to the actual CSPSim demo directory (e.g. "!insertmacro MUI_PAGE_LICENSE "./CSPSim-Demo-0.5/COPYING") The next step is compiling the script (Tools->Compile in VenisIX), and building the Setup.exe file. |
From: <sv...@ww...> - 2005-08-28 23:08:26
|
Author: mkrose Date: 2005-08-28 16:08:19 -0700 (Sun, 28 Aug 2005) New Revision: 1621 Modified: trunk/CSP/CSPSim/Source/VirtualScene.cpp Log: Fix yet another MSVC warning. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1621 Modified: trunk/CSP/CSPSim/Source/VirtualScene.cpp =================================================================== --- trunk/CSP/CSPSim/Source/VirtualScene.cpp 2005-08-28 22:54:01 UTC (rev 1620) +++ trunk/CSP/CSPSim/Source/VirtualScene.cpp 2005-08-28 23:08:19 UTC (rev 1621) @@ -834,7 +834,7 @@ } void VirtualScene::setLabels(bool show) { - m_NodeMask = (m_NodeMask & ~SceneMasks::LABELS) | show ? SceneMasks::LABELS : 0; + m_NodeMask = (m_NodeMask & ~SceneMasks::LABELS) | (show ? SceneMasks::LABELS : 0); m_FarView->setCullMask(SceneMasks::CULL_ONLY | SceneMasks::NORMAL | m_NodeMask); } |
From: <sv...@ww...> - 2005-08-28 22:54:11
|
Author: mkrose Date: 2005-08-28 15:54:01 -0700 (Sun, 28 Aug 2005) New Revision: 1620 Modified: trunk/CSP/CSPSim/Include/Views/CameraKinematics.h trunk/CSP/CSPSim/Source/Views/CameraAgent.cpp trunk/CSP/CSPSim/Source/Views/CameraKinematics.cpp trunk/CSP/CSPSim/Source/Views/ExternalViews.cpp Log: Use double instead of float in the various view classes. Eliminates various warnings in MSVC while simplifying the code. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1620 Modified: trunk/CSP/CSPSim/Include/Views/CameraKinematics.h =================================================================== --- trunk/CSP/CSPSim/Include/Views/CameraKinematics.h 2005-08-28 22:46:03 UTC (rev 1619) +++ trunk/CSP/CSPSim/Include/Views/CameraKinematics.h 2005-08-28 22:54:01 UTC (rev 1620) @@ -31,24 +31,24 @@ class CameraKinematics: public simdata::Referenced { // XXX: serialize - const float m_BaseRate, m_DisplacementCoefficient; - const float m_MinimumDistanceOffset, m_AbsoluteMaximumDistance; + const double m_BaseRate, m_DisplacementCoefficient; + const double m_MinimumDistanceOffset, m_AbsoluteMaximumDistance; double m_Phi, m_Theta; - float m_FOVScale; - float m_PanRatePhi, m_PanRateTheta, m_ZoomRate; + double m_FOVScale; + double m_PanRatePhi, m_PanRateTheta, m_ZoomRate; double m_DistanceToObject, m_MinimumDistance; double m_Accel; bool m_ExternalPan; void rotateTheta(double dt) { m_Theta += m_Accel * m_PanRateTheta * dt * m_FOVScale; } void rotatePhi(double dt) { m_Phi += m_Accel * m_PanRatePhi * dt * m_FOVScale; } void scale(double dt); - float smooth(double value, float min_value,float max_value) const; + double smooth(double value, double min_value,double max_value) const; public: CameraKinematics(); virtual ~CameraKinematics() {} - void clampPhi(float min_phi,float max_phi, bool smooth_on = true); - void clampTheta(float min_theta,float max_theta, bool smooth_on = true); + void clampPhi(double min_phi,double max_phi, bool smooth_on = true); + void clampTheta(double min_theta,double max_theta, bool smooth_on = true); void reset(); void resetDistance(); void update(double dt); @@ -72,7 +72,7 @@ inline double getPhi() const { return m_Phi; } inline void setTheta(double theta) { m_Theta = theta; } inline double getTheta() const { return m_Theta; } - inline void setDistance(float d) { m_DistanceToObject = d; } + inline void setDistance(double d) { m_DistanceToObject = d; } inline double getDistance() const { return m_DistanceToObject; } void accept(CameraCommand* cc); bool externalPan() const { return m_ExternalPan; } Modified: trunk/CSP/CSPSim/Source/Views/CameraAgent.cpp =================================================================== --- trunk/CSP/CSPSim/Source/Views/CameraAgent.cpp 2005-08-28 22:46:03 UTC (rev 1619) +++ trunk/CSP/CSPSim/Source/Views/CameraAgent.cpp 2005-08-28 22:54:01 UTC (rev 1620) @@ -55,7 +55,7 @@ const simdata::Ref<TerrainObject> terrain = scene->getTerrain(); TerrainObject::IntersectionHint camera_hint = 0; double const SAFETY = 3.0; - float h = SAFETY + terrain->getGroundElevation(m_EyePoint.x(), m_EyePoint.y(), camera_hint); + double h = SAFETY + terrain->getGroundElevation(m_EyePoint.x(), m_EyePoint.y(), camera_hint); // if the eyepoint is near the ground, check more carefully that the terrain isn't // clipped by the near-clipping plane. if (m_EyePoint.z() < h) { Modified: trunk/CSP/CSPSim/Source/Views/CameraKinematics.cpp =================================================================== --- trunk/CSP/CSPSim/Source/Views/CameraKinematics.cpp 2005-08-28 22:46:03 UTC (rev 1619) +++ trunk/CSP/CSPSim/Source/Views/CameraKinematics.cpp 2005-08-28 22:54:01 UTC (rev 1620) @@ -34,7 +34,7 @@ void CameraKinematics::scale(double dt) { - float scale_factor = 1.0 + m_ZoomRate * dt; + double scale_factor = 1.0 + m_ZoomRate * dt; if ((m_DistanceToObject > m_MinimumDistance && scale_factor < 1.0) || (m_DistanceToObject < m_AbsoluteMaximumDistance && scale_factor > 1.0) ) { m_DistanceToObject *= scale_factor; @@ -53,9 +53,9 @@ m_Accel = 1.0 + (m_Accel - 1.0) * std::max(0.0, 1.0 - dt); } -float CameraKinematics::smooth(double value, float min_value, float max_value) const { - float epsilon = 0.1f * fabs(max_value - min_value); - float damping = std::min(value - min_value, max_value - value)/epsilon; +double CameraKinematics::smooth(double value, double min_value, double max_value) const { + double epsilon = 0.1f * fabs(max_value - min_value); + double damping = std::min(value - min_value, max_value - value)/epsilon; if (damping > 0.0 && damping < 1.0) { return damping; } else { @@ -74,14 +74,14 @@ m_ExternalPan(false) { reset(); } -void CameraKinematics::clampPhi(float min_phi, float max_phi, bool smooth_on) { +void CameraKinematics::clampPhi(double min_phi, double max_phi, bool smooth_on) { if (smooth_on && m_PanRatePhi != 0.0) { m_PanRatePhi = simdata::sign(m_PanRatePhi) * smooth(m_Phi, min_phi, max_phi) * m_BaseRate; } m_Phi = simdata::clampTo<double>(m_Phi, min_phi, max_phi); } -void CameraKinematics::clampTheta(float min_theta, float max_theta, bool smooth_on) { +void CameraKinematics::clampTheta(double min_theta, double max_theta, bool smooth_on) { if (smooth_on && m_PanRateTheta != 0.0) { m_PanRateTheta = simdata::sign(m_PanRateTheta)*smooth(m_Theta, min_theta, max_theta)*m_BaseRate; } Modified: trunk/CSP/CSPSim/Source/Views/ExternalViews.cpp =================================================================== --- trunk/CSP/CSPSim/Source/Views/ExternalViews.cpp 2005-08-28 22:46:03 UTC (rev 1619) +++ trunk/CSP/CSPSim/Source/Views/ExternalViews.cpp 2005-08-28 22:54:01 UTC (rev 1620) @@ -126,10 +126,10 @@ void FlybyView::recalculate(simdata::Vector3& ep, simdata::Vector3& /*lp*/, simdata::Vector3& /*up*/, double /*dt*/) { TerrainObject* terrain = CSPSim::theSim->getTerrain(); if (terrain) { - const float SAFETY = 2.0f; + const double SAFETY = 2.0f; TerrainObject::IntersectionHint camera_hint = 0; - float h = SAFETY + terrain->getGroundElevation(ep.x(), ep.y(), camera_hint); - float d = static_cast<float>(ep.z() - h); + double h = SAFETY + terrain->getGroundElevation(ep.x(), ep.y(), camera_hint); + double d = ep.z() - h; if (d<0) ep.z() -= d; } } |
From: <sv...@ww...> - 2005-08-28 22:46:10
|
Author: mkrose Date: 2005-08-28 15:46:03 -0700 (Sun, 28 Aug 2005) New Revision: 1619 Modified: trunk/CSP/CSPSim/Bin/CSPSim.py trunk/CSP/CSPSim/Include/Config.h trunk/CSP/SimData/CHANGES.current trunk/CSP/SimData/Include/SimData/LUT.i trunk/CSP/SimData/Include/SimData/Random.h trunk/CSP/SimData/Include/SimData/Random.i trunk/CSP/tools/build.py Log: Small tweaks to the SimData API (Random.h), typemaps, and build scripts to workaround problems with swig 1.3.23 and newer. Tested with swig 1.3.22-25 under Linux. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1619 Modified: trunk/CSP/CSPSim/Bin/CSPSim.py =================================================================== --- trunk/CSP/CSPSim/Bin/CSPSim.py 2005-08-28 22:40:29 UTC (rev 1618) +++ trunk/CSP/CSPSim/Bin/CSPSim.py 2005-08-28 22:46:03 UTC (rev 1619) @@ -352,7 +352,7 @@ loadCSP() print "Loading configuration from '%s'." % config - if not cCSP.openConfig(config): + if not cCSP.openConfig(config, 1): print "Unable to open primary configuration file (%s)" % config sys.exit(0) Modified: trunk/CSP/CSPSim/Include/Config.h =================================================================== --- trunk/CSP/CSPSim/Include/Config.h 2005-08-28 22:40:29 UTC (rev 1618) +++ trunk/CSP/CSPSim/Include/Config.h 2005-08-28 22:46:03 UTC (rev 1619) @@ -37,7 +37,7 @@ /** * Open the global configuration file. */ -extern bool openConfig(std::string path, bool report_error=true); +extern bool openConfig(std::string path, bool report_error); //=true); /** * Get the main cache path. Modified: trunk/CSP/SimData/CHANGES.current =================================================================== --- trunk/CSP/SimData/CHANGES.current 2005-08-28 22:40:29 UTC (rev 1618) +++ trunk/CSP/SimData/CHANGES.current 2005-08-28 22:46:03 UTC (rev 1619) @@ -1,6 +1,11 @@ Version 0.4.0 (in progress) =========================== +2005-08-28: onsight + * Small tweaks to the SimData API (Random.h), typemaps, and + build scripts to workaround problems with swig 1.3.23 and + newer. Tested with swig 1.3.22-25 under Linux. + 2005-08-27: onsight * Extend warning pragma to MSVC Express 8, and disable 'deprecated' function warning. Modified: trunk/CSP/SimData/Include/SimData/LUT.i =================================================================== --- trunk/CSP/SimData/Include/SimData/LUT.i 2005-08-28 22:40:29 UTC (rev 1618) +++ trunk/CSP/SimData/Include/SimData/LUT.i 2005-08-28 22:46:03 UTC (rev 1619) @@ -44,38 +44,43 @@ */ %typemap(in) std::vector<std::vector<float> > const & (std::vector<std::vector<float> > temp) { - if (PyTuple_Check($input) || PyList_Check($input)) { - unsigned int size = (PyTuple_Check($input) ? PyTuple_Size($input) : PyList_Size($input)); - temp.resize(size); - $1 = &temp; - for (unsigned int i=0; i<size; i++) { - PyObject* o = PySequence_GetItem($input,i); - if (PyTuple_Check(o) || PyList_Check(o)) { - unsigned int size = (PyTuple_Check(o) ? PyTuple_Size(o) : PyList_Size(o)); - temp[i].resize(size); - for (unsigned int j=0; j<size; j++) { - PyObject* v = PySequence_GetItem(o,j); - if (SwigNumber_Check(v)) { - temp[i][j] = (float)(SwigNumber_AsDouble(v)); - Py_DECREF(v); - }else { - Py_DECREF(v); - PyErr_SetString(PyExc_TypeError, "vector<vector<float>> expected"); - SWIG_fail; + if (PyTuple_Check($input) || PyList_Check($input)) { + unsigned int size = (PyTuple_Check($input) ? PyTuple_Size($input) : PyList_Size($input)); + temp.resize(size); + $1 = &temp; + for (unsigned int i=0; i<size; i++) { + PyObject* o = PySequence_GetItem($input,i); + if (PyTuple_Check(o) || PyList_Check(o)) { + unsigned int size = (PyTuple_Check(o) ? PyTuple_Size(o) : PyList_Size(o)); + temp[i].resize(size); + for (unsigned int j=0; j<size; j++) { + PyObject* v = PySequence_GetItem(o,j); + if (PyFloat_Check(v)) { + temp[i][j] = static_cast<float>(PyFloat_AsDouble(v)); + Py_DECREF(v); + } else if (PyInt_Check(v)) { + temp[i][j] = static_cast<float>(PyInt_AsLong(v)); + Py_DECREF(v); + } else if (PyLong_Check(v)) { + temp[i][j] = static_cast<float>(PyLong_AsLong(v)); + Py_DECREF(v); + } else { + Py_DECREF(v); + PyErr_SetString(PyExc_TypeError, "vector<vector<float>> expected"); + SWIG_fail; + } } + Py_DECREF(o); + } else { + Py_DECREF(o); + PyErr_SetString(PyExc_TypeError, "vector<vector<float>> expected"); + SWIG_fail; } - Py_DECREF(o); - } else { - Py_DECREF(o); - PyErr_SetString(PyExc_TypeError, "vector<vector<float>> expected"); - SWIG_fail; } - - } - } else { - PyErr_SetString(PyExc_TypeError,"vector<vector<float>> expected"); - SWIG_fail; - } + } else { + PyErr_SetString(PyExc_TypeError,"vector<vector<float>> expected"); + SWIG_fail; + } } NAMESPACE_SIMDATA Modified: trunk/CSP/SimData/Include/SimData/Random.h =================================================================== --- trunk/CSP/SimData/Include/SimData/Random.h 2005-08-28 22:40:29 UTC (rev 1618) +++ trunk/CSP/SimData/Include/SimData/Random.h 2005-08-28 22:46:03 UTC (rev 1619) @@ -382,15 +382,21 @@ /////////////////////////////////////////////////////////////////////////////////// // Random Number Generator Wrappers + +/** Base class for storing the state of a random number generator. + */ +class RandomStateWrapper: public Referenced { +protected: + RandomStateWrapper() {} + virtual ~RandomStateWrapper() {} +}; + + /** Abstract interface for random number generators and random distributions. */ class SIMDATA_EXPORT RandomInterface { -protected: - /** Base class for storing the state of a random number generator. - */ - struct _State: Referenced { virtual ~_State() {} }; public: - typedef Ref<_State> State; + typedef Ref<RandomStateWrapper> State; typedef unsigned long int SeedType; virtual ~RandomInterface(); @@ -455,10 +461,13 @@ /** Random number generator state. */ - struct RNGState: _State { + class RNGState: public RandomStateWrapper { + public: typename RNG::State _state; }; + RNG _gen; + public: /** Reseed the random number generator. * @@ -656,7 +665,8 @@ class RandomDistribution: public RandomDistributionInterface { /** Random number generator state. */ - struct RDState: _State { + class RDState: public RandomStateWrapper { + public: typename RD::State _state; }; RD _dist; Modified: trunk/CSP/SimData/Include/SimData/Random.i =================================================================== --- trunk/CSP/SimData/Include/SimData/Random.i 2005-08-28 22:40:29 UTC (rev 1618) +++ trunk/CSP/SimData/Include/SimData/Random.i 2005-08-28 22:46:03 UTC (rev 1619) @@ -29,10 +29,11 @@ NAMESPACE_SIMDATA + class RandomInterface { protected: public: - typedef Ref<_State> State; + typedef simdata::Ref<simdata::RandomStateWrapper> State; typedef unsigned long int SeedType; virtual ~RandomInterface(); virtual void setSeed(SeedType seed)=0; @@ -55,21 +56,7 @@ virtual unsigned long uniformUInt(unsigned long upper)=0; }; -/** - * Random number generator wrapper, implementing the random number - * generator interface. These generics provide a uniform interface - * to the underlying generators and generator state data. The - * performance penalty relative to using the raw generators is - * typically about 20%. - */ -%ignore _State; -%ignore RNGState; -struct _State {}; //: Referenced { }; template <class RNG> -struct RNGState: _State { - typename RNG::State _state; -}; -template <class RNG> class RandomNumberGenerator: public RandomNumberGeneratorInterface { RNG _gen; public: Modified: trunk/CSP/tools/build.py =================================================================== --- trunk/CSP/tools/build.py 2005-08-28 22:40:29 UTC (rev 1618) +++ trunk/CSP/tools/build.py 2005-08-28 22:46:03 UTC (rev 1619) @@ -220,7 +220,7 @@ _checking(context, 'swig') swig_in, swig_out, swig_err = os.popen3('%s -version' % context.env.get('SWIG', 'swig'), 't') if swig_err is not None: - output = swig_err.readlines() + output = swig_err.readlines() + swig_out.readlines() output = " ".join(map(lambda x: x.strip(), output)) match = re.search(r'SWIG Version (\d+\.\d+.\d+)', output) if match is not None: |
From: <sv...@ww...> - 2005-08-28 22:40:38
|
Author: mkrose Date: 2005-08-28 15:40:29 -0700 (Sun, 28 Aug 2005) New Revision: 1618 Modified: trunk/CSP/SimData/Include/SimData/Matrix3.h Log: Change Matrix3 copy implementation to avoid deprecation warnings under MSVC 8. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1618 Modified: trunk/CSP/SimData/Include/SimData/Matrix3.h =================================================================== --- trunk/CSP/SimData/Include/SimData/Matrix3.h 2005-08-28 21:49:40 UTC (rev 1617) +++ trunk/CSP/SimData/Include/SimData/Matrix3.h 2005-08-28 22:40:29 UTC (rev 1618) @@ -40,7 +40,6 @@ #include <SimData/Vector3.h> #include <vector> -#include <algorithm> #include <cassert> #include <cmath> @@ -173,7 +172,7 @@ */ inline Matrix3& operator = (const Matrix3& other) { if (&other == this) return *this; - std::copy((double*)other._mat, (double*)other._mat+9, (double*)(_mat)); + set(reinterpret_cast<double const *>(other._mat)); return *this; } #endif // SWIG @@ -181,13 +180,14 @@ /** Set this matrix from another matrix. */ inline void set(const Matrix3& other) { - std::copy((double*)other._mat, (double*)other._mat+9, (double*)(_mat)); + set(reinterpret_cast<double const *>(other._mat)); } /** Set this matrix from a double[9] array. */ - inline void set(double const * const ptr_) { - std::copy(ptr_, ptr_+9, (double*)(_mat)); + inline void set(double const * src) { + double *dst = reinterpret_cast<double*>(_mat); + for (const double *end = src + 9; src != end; ) *dst++ = *src++; } /** Set this matrix from a list of element values. |
From: <sv...@ww...> - 2005-08-28 21:49:46
|
Author: stormbringer Date: 2005-08-28 14:49:40 -0700 (Sun, 28 Aug 2005) New Revision: 1617 Removed: trunk/CSP/CSPSim/Demo/Win/csp_license.txt Modified: trunk/CSP/CSPSim/Demo/Win/InstallScript_CSPSim-Demo-0.5.nsi Log: Changed the NSIS script to include the licence file from the demo dir Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1617 Modified: trunk/CSP/CSPSim/Demo/Win/InstallScript_CSPSim-Demo-0.5.nsi =================================================================== --- trunk/CSP/CSPSim/Demo/Win/InstallScript_CSPSim-Demo-0.5.nsi 2005-08-28 21:35:14 UTC (rev 1616) +++ trunk/CSP/CSPSim/Demo/Win/InstallScript_CSPSim-Demo-0.5.nsi 2005-08-28 21:49:40 UTC (rev 1617) @@ -75,7 +75,7 @@ ;LogSet on ;License page -LicenseData "csp_license.txt" +LicenseData "./CSPSim-Demo-0.5/COPYING" LicenseForceSelection radiobuttons ;Show install details. Deleted: trunk/CSP/CSPSim/Demo/Win/csp_license.txt =================================================================== --- trunk/CSP/CSPSim/Demo/Win/csp_license.txt 2005-08-28 21:35:14 UTC (rev 1616) +++ trunk/CSP/CSPSim/Demo/Win/csp_license.txt 2005-08-28 21:49:40 UTC (rev 1617) @@ -1,90 +0,0 @@ -The package contains the main CSPSim application and several supporting -libraries. The following summarizes the copyright and licensing terms -of the various components, with links to the associated websites where -the source code can be obtained. Licenses for data files can be found -in the associated directories. Please report any errors or ommisions -on the forums at http://csp.sf.net/forum. - -CSPSim -Copyright 2002-2005 The Combat Simulator Project -Licensed under the terms of the GNU General Public License version 2 or -later. -http://csp.sf.net/forum - -SimData -Copyright 2002-2005 Mark Rose <mk...@us...> -Licensed under the terms of the GNU General Public License version 2 or -later. -http://csp.sf.net/forum - -SDL -Copyright 1997-2002 Sam Lantinga -Licensed under the terms of the GNU Library General Public License version -2 or later. -http://www.libsdl.org/ - -SDL_image -Copyright 1997-2001 Sam Lantinga -Licensed under the terms of the GNU Library General Public License version -2 or later. -http://www.libsdl.org/projects/SDL_image/ - -OpenThreads -OpenThread library, Copyright 2002-2003 The Open Thread Group -Licensed under the terms of the GNU Library General Public License version -2.1 or later. -http://openthreads.sourceforge.net/ - -Producer -Copyright 2002 Don Burns -Licensed under the terms of the GNU Library General Public License. -http://www.andesengineering.com/Producer/ - -OpenSceneGraph -Copyright 1998-2005 Robert Osfield -Licensed under the terms of the OpenSceneGraph Public License (OSGPL) version -0.0 or later. -http://www.openscenegraph.org/ - -Demeter -Licensed under the terms of the GNU Library General Public License version -2 or later. -Copyright 2002 Clay Fowler -http://sourceforge.net/projects/demeter/ - -Python (executable and various core modules) -Copyright 2001, 2002, 2003 Python Software Foundation. -Copyright 2000 BeOpen.com. -Copyright 1995-2001 Corporation for National Research Initiatives. -Copyright 1991-1995 Stichting Mathematisch Centrum. -Each copyright holder provides a different license, all of which are certified -Open Source and GNU GPL-compatible; see LICENSES/python. -http://python.org/ - -GNU Common C++ -Copyright 1999-2003 Open Source Telecom Corporation. -Licensed under the terms of the GNU General Public License version 2 or -later. -http://www.gnu.org/software/commoncpp/ - -LibSigC++ -Copyright 2002, The libsigc++ Development Team -Licensed under the terms of the GNU Library General Public License version -2 or later. -http://libsigc.sourceforge.net/ - -zlib -Copyright 1995-1998 Jean-loup Gailly and Mark Adler -See LICENSES/zlib -http://www.gzip.org/zlib/ - -libjpeg -Copyright 1991-1998, Thomas G. Lane -See LICENSES/libjpeg for the license. -http://www.ijg.org/ - -libpng -Copyright 1998-2004 Glenn Randers-Pehrson -See LICENSES/libpng for the license. -http://libpng.sourceforge.net/ - |
From: <sv...@ww...> - 2005-08-28 21:35:22
|
Author: stormbringer Date: 2005-08-28 14:35:14 -0700 (Sun, 28 Aug 2005) New Revision: 1616 Added: trunk/CSP/CSPSim/Demo/Win/CSPIcon.bmp trunk/CSP/CSPSim/Demo/Win/CSPLogo.bmp trunk/CSP/CSPSim/Demo/Win/CSPSim.ico trunk/CSP/CSPSim/Demo/Win/CheckRegistryKey.nsi trunk/CSP/CSPSim/Demo/Win/InstallScript_CSPSim-Demo-0.5.nsi trunk/CSP/CSPSim/Demo/Win/csp_license.txt Log: Added the NSIS install scripts for the Windows build Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1616 Diff omitted (10660 bytes). |
From: <sv...@ww...> - 2005-08-28 20:55:03
|
Author: mkrose Date: 2005-08-28 13:54:54 -0700 (Sun, 28 Aug 2005) New Revision: 1615 Modified: trunk/CSP/SimData/SimData/Tests/ArchiveTests.py Log: Fix archive unittest for type Real. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1615 Modified: trunk/CSP/SimData/SimData/Tests/ArchiveTests.py =================================================================== --- trunk/CSP/SimData/SimData/Tests/ArchiveTests.py 2005-08-28 10:57:33 UTC (rev 1614) +++ trunk/CSP/SimData/SimData/Tests/ArchiveTests.py 2005-08-28 20:54:54 UTC (rev 1615) @@ -88,14 +88,14 @@ x0 = SimData.Real(10.0, 1.0) y0 = SimData.Real(10.0, 1.0) self.archive._Real(x0) - self.assertEqual(x0.getMean(), y0.getMean()) - self.assertEqual(x0.getSigma(), y0.getSigma()) + self.assertEqual(x0.mean(), y0.mean()) + self.assertEqual(x0.sigma(), y0.sigma()) self.setRead() self.assertEqual(self.size, 8) x1 = self.archive._Real() - self.assertEqual(x0.getMean(), x1.getMean()) - self.assertEqual(x0.getSigma(), x1.getSigma()) - v = x1.getValue() + self.assertEqual(x0.mean(), x1.mean()) + self.assertEqual(x0.sigma(), x1.sigma()) + v = x1.value() # 5 sigma test ;-) self.failIf(v == 10.0 or v < 5.0 or v > 15.0) |
From: <sv...@ww...> - 2005-08-28 10:57:41
|
Author: mkrose Date: 2005-08-28 03:57:33 -0700 (Sun, 28 Aug 2005) New Revision: 1614 Modified: trunk/CSP/CSPSim/Demo/Win/makedemo.py Log: More tweaks. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1614 Modified: trunk/CSP/CSPSim/Demo/Win/makedemo.py =================================================================== --- trunk/CSP/CSPSim/Demo/Win/makedemo.py 2005-08-28 10:39:13 UTC (rev 1613) +++ trunk/CSP/CSPSim/Demo/Win/makedemo.py 2005-08-28 10:57:33 UTC (rev 1614) @@ -21,7 +21,6 @@ named %(DEMO)s.zip. """ - import CSP import CSP.SimData import CSP.CSPSim @@ -32,13 +31,15 @@ CSPSIM_BIN_SOURCE = os.path.join(BASE, 'CSPSim', '.bin', 'Source') SIMDATA = os.path.join(BASE, 'SimData') +sys.path.append(CSPSIM_BIN) + try: import modulefinder - modulefinder.AddPackagePath("CSP.CSPSim", CSPSIM_BIN) - modulefinder.AddPackagePath("CSP.CSPSim", CSPSIM_BIN_SOURCE) - modulefinder.AddPackagePath("CSP.SimData", SIMDATA) + modulefinder.AddPackagePath('CSP.CSPSim', CSPSIM_BIN) + modulefinder.AddPackagePath('CSP.CSPSim', CSPSIM_BIN_SOURCE) + modulefinder.AddPackagePath('CSP', SIMDATA) except ImportError: - print "WARNING: unable to import modulefinder" + print 'WARNING: unable to import modulefinder' from distutils.core import setup @@ -67,9 +68,9 @@ print 'Running py2exe to create %s' % DIST_DIR opts = { - "py2exe": { - "excludes": ['SimData', 'dl'], - "dist_dir": DIST_DIR + 'py2exe': { + 'excludes': ['SimData', 'dl'], + 'dist_dir': DIST_DIR } } |
From: <sv...@ww...> - 2005-08-28 10:39:31
|
Author: mkrose Date: 2005-08-28 03:39:13 -0700 (Sun, 28 Aug 2005) New Revision: 1613 Modified: trunk/CSP/CSPSim/Demo/Win/makedemo.py Log: Tweaking makedemo.py. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1613 Modified: trunk/CSP/CSPSim/Demo/Win/makedemo.py =================================================================== --- trunk/CSP/CSPSim/Demo/Win/makedemo.py 2005-08-28 10:22:56 UTC (rev 1612) +++ trunk/CSP/CSPSim/Demo/Win/makedemo.py 2005-08-28 10:39:13 UTC (rev 1613) @@ -10,7 +10,7 @@ USAGE = """\ CSPSim demo generation script. -Usage: %s version +Usage: %s version [options] """ FURTHER_INSTRUCTIONS = """\ @@ -42,7 +42,7 @@ from distutils.core import setup -#import py2exe +import py2exe def error(msg): @@ -98,11 +98,12 @@ def main(): args = sys.argv[1:] - if len(args) != 1: + if len(args) < 1: usage() sys.exit(1) version = args[0] + sys.argv[1:] = ['py2exe'] + args[1:] if not re.match(r'\d+\.\d+', version): error('Invalid version "%s"; should be of the form X.Y (e.g., "0.5")' % version) |
From: <sv...@ww...> - 2005-08-28 10:23:24
|
Author: mkrose Date: 2005-08-28 03:22:56 -0700 (Sun, 28 Aug 2005) New Revision: 1612 Added: trunk/CSP/CSPSim/Demo/Win/CSPSim-Demo/ trunk/CSP/CSPSim/Demo/Win/CSPSim-Demo/COPYING trunk/CSP/CSPSim/Demo/Win/CSPSim-Demo/LICENSES/ trunk/CSP/CSPSim/Demo/Win/CSPSim-Demo/LICENSES/GPL trunk/CSP/CSPSim/Demo/Win/CSPSim-Demo/LICENSES/GPL-2 trunk/CSP/CSPSim/Demo/Win/CSPSim-Demo/LICENSES/LGPL trunk/CSP/CSPSim/Demo/Win/CSPSim-Demo/LICENSES/LGPL-2 trunk/CSP/CSPSim/Demo/Win/CSPSim-Demo/LICENSES/LGPL-2.1 trunk/CSP/CSPSim/Demo/Win/CSPSim-Demo/LICENSES/libjpeg trunk/CSP/CSPSim/Demo/Win/CSPSim-Demo/LICENSES/libpng trunk/CSP/CSPSim/Demo/Win/CSPSim-Demo/LICENSES/osg trunk/CSP/CSPSim/Demo/Win/CSPSim-Demo/LICENSES/python trunk/CSP/CSPSim/Demo/Win/CSPSim-Demo/LICENSES/zlib trunk/CSP/CSPSim/Demo/Win/CSPSim-Demo/README trunk/CSP/CSPSim/Demo/Win/README trunk/CSP/CSPSim/Demo/Win/makedemo.py Removed: trunk/CSP/CSPSim/Demo/Win/CSPSim.py trunk/CSP/CSPSim/Demo/Win/ShellEnvironment.py trunk/CSP/CSPSim/Demo/Win/TestObjects.py trunk/CSP/CSPSim/Demo/Win/py2exe_cspsim_setup.py Log: Add scripts and templates for generating demo releases under Windows. See README for instructions. Remove obsolete demo files. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1612 Diff omitted (168703 bytes). |
From: <sv...@ww...> - 2005-08-28 07:20:57
|
Author: mkrose Date: 2005-08-28 00:20:47 -0700 (Sun, 28 Aug 2005) New Revision: 1611 Modified: trunk/CSP/SimData/SimData/Parse.py Log: Eliminate some very old, obsolete code. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1611 Modified: trunk/CSP/SimData/SimData/Parse.py =================================================================== --- trunk/CSP/SimData/SimData/Parse.py 2005-08-27 22:46:04 UTC (rev 1610) +++ trunk/CSP/SimData/SimData/Parse.py 2005-08-28 07:20:47 UTC (rev 1611) @@ -780,36 +780,3 @@ self.loadAll(filepath) return self._objects - - -def demo(): - master = ObjectXMLArchive("../XML"); - master.loadAll() - pw229 = master.getObject("engines.f100_pw_229") - return - print "ab_rpm = ", pw229.ab_rpm - print "idle table = " - for i in range(6): - for j in range(6): - print "%.5f" % pw229.idle.getPrecise(i*0.2, j*0.2), - print - print - demo_show_members(pw229) - -def demo_show_members(obj): - members = obj.__class__.__dict__["__swig_setmethods__"].keys() - for member in members: - c = getattr(obj, member).__class__ - print "%30s: %s(%s)" % (member, c, str(getattr(obj, member))) - for i in obj.thrusts: - print i.x, i.y - -if __name__ == "__main__": - import Objects - setObjectClasses(Objects) - start = time.time() - demo() - runtime = time.time() - start - print - print "Runtime =", runtime - |
From: <sv...@ww...> - 2005-08-27 22:46:11
|
Author: mkrose Date: 2005-08-27 15:46:04 -0700 (Sat, 27 Aug 2005) New Revision: 1610 Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/VisualStudio/CSPSimDLL/CSPSimDLL.vcproj Log: Link against sigc-2.0, not sigc-1.2 for debug builds under MSVC. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1610 Modified: trunk/CSP/CSPSim/CHANGES.current =================================================================== --- trunk/CSP/CSPSim/CHANGES.current 2005-08-27 21:01:23 UTC (rev 1609) +++ trunk/CSP/CSPSim/CHANGES.current 2005-08-27 22:46:04 UTC (rev 1610) @@ -1,6 +1,9 @@ Version 0.4.0 (in progress) =========================== +2005-08-27: onsight + * Link against sigc-2.0, not sigc-1.2 for debug builds under MSVC. + 2005-08-26: onsight * Adjust the HUD color and make it more configurable. Modified: trunk/CSP/CSPSim/VisualStudio/CSPSimDLL/CSPSimDLL.vcproj =================================================================== --- trunk/CSP/CSPSim/VisualStudio/CSPSimDLL/CSPSimDLL.vcproj 2005-08-27 21:01:23 UTC (rev 1609) +++ trunk/CSP/CSPSim/VisualStudio/CSPSimDLL/CSPSimDLL.vcproj 2005-08-27 22:46:04 UTC (rev 1610) @@ -45,7 +45,7 @@ <Tool Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" - AdditionalDependencies="SimNetd.lib OpenThreadsWin32d.lib osgChunkLodd.lib osgFXd.lib sigc-1.2d.lib producerd.lib opengl32.lib SDL.lib osgDBd.lib DemeterVisualC6d.lib osgTextd.lib osgUtild.lib osgParticled.lib osgd.lib _cSimDatad.lib ccgnu2.lib ccext2.lib SpatialIndexd.lib SimCored.lib" + AdditionalDependencies="SimNetd.lib OpenThreadsWin32d.lib osgChunkLodd.lib osgFXd.lib sigc-2.0d.lib producerd.lib opengl32.lib SDL.lib osgDBd.lib DemeterVisualC6d.lib osgTextd.lib osgUtild.lib osgParticled.lib osgd.lib _cSimDatad.lib ccgnu2.lib ccext2.lib SpatialIndexd.lib SimCored.lib" OutputFile="../../Bin/_cCSP.dll" LinkIncremental="2" SuppressStartupBanner="TRUE" |
From: <sv...@ww...> - 2005-08-27 21:01:30
|
Author: mkrose Date: 2005-08-27 14:01:23 -0700 (Sat, 27 Aug 2005) New Revision: 1609 Modified: trunk/CSP/SimNet/NetworkNode.h Log: Fix a MSVC warning in SimNet. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1609 Modified: trunk/CSP/SimNet/NetworkNode.h =================================================================== --- trunk/CSP/SimNet/NetworkNode.h 2005-08-27 20:50:19 UTC (rev 1608) +++ trunk/CSP/SimNet/NetworkNode.h 2005-08-27 21:01:23 UTC (rev 1609) @@ -32,7 +32,7 @@ #ifdef _WIN32 # define NOMINMAX # pragma warning(push) -# pragma warning(disable: 4100) +# pragma warning(disable: 4100 4996) #endif #include <cc++/socket.h> |
From: <sv...@ww...> - 2005-08-27 20:50:38
|
Author: mkrose Date: 2005-08-27 13:50:19 -0700 (Sat, 27 Aug 2005) New Revision: 1608 Modified: trunk/CSP/Demeter/Terrain.cpp Log: Fix MSVC warnings in Demeter. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1608 Modified: trunk/CSP/Demeter/Terrain.cpp =================================================================== --- trunk/CSP/Demeter/Terrain.cpp 2005-08-27 20:24:14 UTC (rev 1607) +++ trunk/CSP/Demeter/Terrain.cpp 2005-08-27 20:50:19 UTC (rev 1608) @@ -18,8 +18,8 @@ Boston, MA 02111-1307, USA. */ -# if defined(_MSC_VER) && (_MSC_VER <= 1300) -#pragma warning( disable : 4786 ) +# if defined(_MSC_VER) && (_MSC_VER <= 1400) +#pragma warning( disable : 4786 4996 ) #endif #include <fstream> @@ -345,7 +345,7 @@ } else { - double deltaX, deltaY, boxHeight; + double deltaX, deltaY, boxHeight = 0; double screenDistHorizontal, screenDistVertical, screenDistNew; if (tm == Settings::TM_OLD_UPRIGHTONLY) { @@ -466,7 +466,7 @@ int halfStride = m_Stride / 2; int bottomLeft = m_HomeIndex + m_Stride * pTerrain->GetWidthVertices(); int bottomRight = bottomLeft + m_Stride; - int i,previousVertex; + int i,previousVertex = 0; int v0; int numVertices = 0; @@ -965,14 +965,22 @@ void Terrain::SetAllElevations(const float* pElevations,int elevWidth,int elevHeight,float vertexSpacing,float elevationScale) { - if (m_pVertices) - delete[] m_pVertices; - if (m_pVertexStatus) - delete m_pVertexStatus; - if (m_pRootBlock) - delete m_pRootBlock; - if (m_pNormals) + if (m_pVertices) { + delete[] m_pVertices; + m_pVertices = NULL; + } + if (m_pVertexStatus) { + delete m_pVertexStatus; + m_pVertexStatus = NULL; + } + if (m_pRootBlock) { + delete m_pRootBlock; + m_pRootBlock = NULL; + } + if (m_pNormals) { delete[] m_pNormals; + m_pNormals = NULL; + } m_VertexSpacing = vertexSpacing; @@ -980,9 +988,8 @@ { string msg("The elevation data is NOT a power of 2 in both width and height. Elevation data must be a power of 2 in both width and height."); throw new DemeterException(msg); - m_pTriangleStrips = NULL; - m_pTriangleFans = NULL; - m_pVertices = NULL; + //m_pTriangleStrips = NULL; + //m_pTriangleFans = NULL; } m_WidthVertices = elevWidth + 1; // Add 1 dummy pixel line to edge for block strides @@ -3224,7 +3231,7 @@ Terrain* TerrainLattice::GetTerrainRelative(Terrain* pTerrain,Terrain::DIRECTION direction) { - int offsetX,offsetY; + int offsetX=0,offsetY=0; switch (direction) { case Terrain::DIR_NORTH: @@ -3259,6 +3266,8 @@ offsetX = -1; offsetY = 1; break; + default: + throw new DemeterException("Demeter: Terrain::GetTerrainRelative: Invalid direction"); } return GetTerrainRelative(pTerrain,offsetX,offsetY); } @@ -3443,6 +3452,8 @@ case Terrain::DIR_CENTER: oppositeDirection = Terrain::DIR_CENTER; break; + default: + throw new DemeterException("Demeter: Terrain::GetOppositeDirection: Invalid direction"); } return oppositeDirection; } @@ -3739,7 +3750,7 @@ fwrite(&m_SharedIndex,sizeof(int),1,file); if (m_SharedIndex < 0) { - int len,bytesPerPixel; + int len,bytesPerPixel = 0; if (m_szFilename == NULL) len = 0; else @@ -4140,8 +4151,8 @@ #endif if(!glClientActiveTextureARB_ptr || !glActiveTextureARB_ptr || !glMultiTexCoord2fARB_ptr) { + bMultiTextureSupported = false; throw new DemeterException("TERRAIN: ERROR: Multitexture extensions not supported by this OpenGL vendor!"); - bMultiTextureSupported = false; } } |
From: <sv...@ww...> - 2005-08-27 20:24:21
|
Author: mkrose Date: 2005-08-27 13:24:14 -0700 (Sat, 27 Aug 2005) New Revision: 1607 Modified: trunk/CSP/SimData/CHANGES.current trunk/CSP/SimData/VisualStudio2003/SimData.vcproj Log: Change debug build target to _cSimData.dll instead of _cSimDatad.dll. The latter cannot be imported into python since the module name is declared as "_cSimData". Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1607 Modified: trunk/CSP/SimData/CHANGES.current =================================================================== --- trunk/CSP/SimData/CHANGES.current 2005-08-27 20:02:16 UTC (rev 1606) +++ trunk/CSP/SimData/CHANGES.current 2005-08-27 20:24:14 UTC (rev 1607) @@ -5,6 +5,10 @@ * Extend warning pragma to MSVC Express 8, and disable 'deprecated' function warning. + * Change debug build target to _cSimData.dll instead of _cSimDatad.dll. + The latter cannot be imported into python since the module name is + declared as "_cSimData". + 2005-08-26: onsight * Minor comment cleanups and api tweaks. Fix Quat parsing from XML. Fix data archive globbing. Modified: trunk/CSP/SimData/VisualStudio2003/SimData.vcproj =================================================================== --- trunk/CSP/SimData/VisualStudio2003/SimData.vcproj 2005-08-27 20:02:16 UTC (rev 1606) +++ trunk/CSP/SimData/VisualStudio2003/SimData.vcproj 2005-08-27 20:24:14 UTC (rev 1607) @@ -130,13 +130,13 @@ Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" AdditionalDependencies="pthreadVC1.lib" - OutputFile="../SimData/_cSimDatad.dll" + OutputFile="../SimData/_cSimData.dll" LinkIncremental="2" SuppressStartupBanner="TRUE" AdditionalLibraryDirectories="$(PYTHON_PATH)/Libs" GenerateDebugInformation="TRUE" - ProgramDatabaseFile=".\Debug/_cSimDatad.pdb" - ImportLibrary="../SimData/_cSimDatad.lib"/> + ProgramDatabaseFile=".\Debug/_cSimData.pdb" + ImportLibrary="../SimData/_cSimData.lib"/> <Tool Name="VCMIDLTool" PreprocessorDefinitions="_DEBUG" |
From: <sv...@ww...> - 2005-08-27 20:02:29
|
Author: mkrose Date: 2005-08-27 13:02:16 -0700 (Sat, 27 Aug 2005) New Revision: 1606 Modified: trunk/CSP/SimData/CHANGES.current trunk/CSP/SimData/Include/SimData/Export.h trunk/CSP/SimData/Include/SimData/HashUtility.h Log: Extend warning pragma to MSVC Express 8, and disable 'deprecated' function warning. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1606 Modified: trunk/CSP/SimData/CHANGES.current =================================================================== --- trunk/CSP/SimData/CHANGES.current 2005-08-27 09:26:12 UTC (rev 1605) +++ trunk/CSP/SimData/CHANGES.current 2005-08-27 20:02:16 UTC (rev 1606) @@ -1,6 +1,10 @@ Version 0.4.0 (in progress) =========================== +2005-08-27: onsight + * Extend warning pragma to MSVC Express 8, and disable 'deprecated' + function warning. + 2005-08-26: onsight * Minor comment cleanups and api tweaks. Fix Quat parsing from XML. Fix data archive globbing. Modified: trunk/CSP/SimData/Include/SimData/Export.h =================================================================== --- trunk/CSP/SimData/Include/SimData/Export.h 2005-08-27 09:26:12 UTC (rev 1605) +++ trunk/CSP/SimData/Include/SimData/Export.h 2005-08-27 20:02:16 UTC (rev 1606) @@ -41,8 +41,12 @@ # define SIMDATA_EXPORT #endif -# if defined(_MSC_VER) && (_MSC_VER <= 1310) -#pragma warning (disable : 4786 4251 4290) +# if defined(_MSC_VER) && (_MSC_VER <= 1400) +// 4251, level 1: 'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2' +// 4290, level 3: C++ exception specification ignored except to indicate a function is not __declspec(nothrow) +// 4786, level 3: 'identifier' : identifier was truncated to 'number' characters in the debug information +// 4996, level 1: 'function': was declared deprecated +#pragma warning (disable : 4786 4251 4290 4996) # endif Modified: trunk/CSP/SimData/Include/SimData/HashUtility.h =================================================================== --- trunk/CSP/SimData/Include/SimData/HashUtility.h 2005-08-27 09:26:12 UTC (rev 1605) +++ trunk/CSP/SimData/Include/SimData/HashUtility.h 2005-08-27 20:02:16 UTC (rev 1606) @@ -27,11 +27,6 @@ #ifndef __SIMDATA_HASHUTILITY_H__ #define __SIMDATA_HASHUTILITY_H__ -# if defined(_MSC_VER) && (_MSC_VER <= 1300) -#pragma warning(disable : 4251) -# endif - - #include <SimData/Export.h> #include <SimData/Uniform.h> #include <SimData/hash_map.h> |
From: <sv...@ww...> - 2005-08-27 09:26:20
|
Author: mkrose Date: 2005-08-27 02:26:12 -0700 (Sat, 27 Aug 2005) New Revision: 1605 Modified: trunk/CSP/SimData/CHANGES.current trunk/CSP/SimData/Include/SimData/InterfaceProxy.h Log: Change object interface declaration macros to make interfaces static members of their Object class rather than standalone instances in an anonymous namespace. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1605 Modified: trunk/CSP/SimData/CHANGES.current =================================================================== --- trunk/CSP/SimData/CHANGES.current 2005-08-27 09:17:55 UTC (rev 1604) +++ trunk/CSP/SimData/CHANGES.current 2005-08-27 09:26:12 UTC (rev 1605) @@ -5,6 +5,10 @@ * Minor comment cleanups and api tweaks. Fix Quat parsing from XML. Fix data archive globbing. + * Change object interface declaration macros to make interfaces static + members of their Object class rather than standalone instances in an + anonymous namespace. + 2005-07-15: onsight * Fix Object unittest. Modified: trunk/CSP/SimData/Include/SimData/InterfaceProxy.h =================================================================== --- trunk/CSP/SimData/Include/SimData/InterfaceProxy.h 2005-08-27 09:17:55 UTC (rev 1604) +++ trunk/CSP/SimData/Include/SimData/InterfaceProxy.h 2005-08-27 09:26:12 UTC (rev 1605) @@ -425,8 +425,8 @@ typedef __simdata_object_class __simdata_object_baseclass; \ typedef _M_classname __simdata_object_class; \ virtual SIMDATA(Object) *_new() const { return SIMDATA(__simdata_object_factory)<_M_classname, _M_abstract>::create(); } \ - friend class __simdata_interface_proxy_##_M_classname; \ - class __simdata_interface_proxy_##_M_classname: public __simdata_object_baseclass::__simdata_interface_proxy { \ + friend class __simdata_interface_proxy__M_classname; \ + class __simdata_interface_proxy__M_classname: public __simdata_object_baseclass::__simdata_interface_proxy { \ static SIMDATA(ObjectInterface)<_M_classname> *_interface; \ public: \ static SIMDATA(fprint32) signature(); \ @@ -437,11 +437,12 @@ virtual bool isStatic() const { return _M_static; } \ virtual SIMDATA(hasht) getClassHash() const { return _M_classname::_getClassHash(); } \ virtual const char * getClassName() const { return _M_classname::_getClassName(); } \ - __simdata_interface_proxy_##_M_classname(bool=true); \ + __simdata_interface_proxy__M_classname(bool=true); \ }; \ - typedef __simdata_interface_proxy_##_M_classname __simdata_interface_proxy; \ + typedef __simdata_interface_proxy__M_classname __simdata_interface_proxy; \ virtual void _serialize(SIMDATA(Writer) &writer) const; \ - virtual void _serialize(SIMDATA(Reader) &reader); + virtual void _serialize(SIMDATA(Reader) &reader); \ + static __simdata_interface_proxy__M_classname __simdata_interface_proxy__M_classname_instance; #define SIMDATA_DECLARE_OBJECT(_M_classname) \ __SIMDATA_CLASS_DEFINE(_M_classname, false, false) @@ -464,15 +465,15 @@ } \ SIMDATA(hasht) _M_classname::_getClassHash() { \ static SIMDATA(hasht) hash = 0; /*defer evaluation*/\ - if (hash == 0) hash = SIMDATA(classhash_helper)(#_M_classname, __simdata_interface_proxy::signature()); \ + if (hash == 0) hash = SIMDATA(classhash_helper)(_getClassName(), __simdata_interface_proxy::signature()); \ return hash; \ } \ - SIMDATA(ObjectInterface)<_M_classname> *_M_classname::__simdata_interface_proxy_##_M_classname::_interface = 0; \ - namespace { _M_classname::__simdata_interface_proxy_##_M_classname __##_M_classname##_interface_proxy; } \ - SIMDATA(fprint32) _M_classname::__simdata_interface_proxy_##_M_classname::signature() { return _interface->signature(); } \ - void _M_classname::__simdata_interface_proxy_##_M_classname::serialize(_M_classname *object, SIMDATA(Reader) &reader) { _interface->serialize(object, reader); } \ - void _M_classname::__simdata_interface_proxy_##_M_classname::serialize(_M_classname const *object, SIMDATA(Writer) &writer) { _interface->serialize(object, writer); } \ - _M_classname::__simdata_interface_proxy_##_M_classname::__simdata_interface_proxy_##_M_classname(const bool reg) \ + SIMDATA(ObjectInterface)<_M_classname> *_M_classname::__simdata_interface_proxy__M_classname::_interface = 0; \ + _M_classname::__simdata_interface_proxy__M_classname _M_classname::__simdata_interface_proxy__M_classname_instance; \ + SIMDATA(fprint32) _M_classname::__simdata_interface_proxy__M_classname::signature() { return _interface->signature(); } \ + void _M_classname::__simdata_interface_proxy__M_classname::serialize(_M_classname *object, SIMDATA(Reader) &reader) { _interface->serialize(object, reader); } \ + void _M_classname::__simdata_interface_proxy__M_classname::serialize(_M_classname const *object, SIMDATA(Writer) &writer) { _interface->serialize(object, writer); } \ + _M_classname::__simdata_interface_proxy__M_classname::__simdata_interface_proxy__M_classname(const bool reg) \ : _M_classname::__simdata_object_baseclass::__simdata_interface_proxy(false) { \ typedef _M_classname _class; \ if (!_interface) { \ |
From: <sv...@ww...> - 2005-08-27 09:18:02
|
Author: mkrose Date: 2005-08-27 02:17:55 -0700 (Sat, 27 Aug 2005) New Revision: 1604 Modified: trunk/CSP/SimData/CHANGES.current trunk/CSP/SimData/Include/SimData/Conversions.h trunk/CSP/SimData/Include/SimData/DataArchive.h trunk/CSP/SimData/Include/SimData/LUT.h trunk/CSP/SimData/Include/SimData/Link.h trunk/CSP/SimData/Include/SimData/Path.h trunk/CSP/SimData/Include/SimData/Real.h trunk/CSP/SimData/SimData/Parse.py trunk/CSP/SimData/Source/DataArchive.cpp trunk/CSP/SimData/Source/Link.cpp trunk/CSP/SimData/Source/Path.cpp trunk/CSP/SimData/Source/Real.cpp trunk/CSP/SimData/Source/SConscript trunk/CSP/SimData/Source/TypeAdapter.cpp Log: Minor comment cleanups and api tweaks. Fix Quat parsing from XML. Fix data archive globbing. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1604 Diff omitted (14660 bytes). |