You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(153) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(48) |
Feb
(46) |
Mar
(12) |
Apr
(4) |
May
(4) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2007 |
Jan
|
Feb
(263) |
Mar
(235) |
Apr
(66) |
May
(42) |
Jun
(270) |
Jul
(65) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2013 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Markus R. <rol...@us...> - 2006-02-15 01:00:31
|
Update of /cvsroot/simspark/simspark/spark/oxygen/sceneserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9553 Modified Files: basenode.cpp Log Message: - replace deprecated use of make_shared() with lock() Index: basenode.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/sceneserver/basenode.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** basenode.cpp 5 Dec 2005 21:21:17 -0000 1.1 --- basenode.cpp 15 Feb 2006 01:00:19 -0000 1.2 *************** *** 51,65 **** const salt::Matrix& BaseNode::GetWorldTransform() const { ! shared_ptr<BaseNode> parent = shared_static_cast<BaseNode> ! (make_shared(mParent)); ! ! // no parent, return identity ! if (parent.get() == 0) { return mIdentityMatrix; } else ! { ! return parent->GetWorldTransform(); ! } } --- 51,62 ---- const salt::Matrix& BaseNode::GetWorldTransform() const { ! if (mParent.expired()) { return mIdentityMatrix; } else ! { ! return shared_static_cast<BaseNode> ! (mParent.lock())->GetWorldTransform(); ! } } *************** *** 70,82 **** void BaseNode::SetWorldTransform(const salt::Matrix& transform) { ! shared_ptr<BaseNode> parent = shared_static_cast<BaseNode> ! (make_shared(mParent)); ! ! if (parent.get() == 0) { return; } ! parent->SetWorldTransform(transform); } --- 67,77 ---- void BaseNode::SetWorldTransform(const salt::Matrix& transform) { ! if (mParent.expired()) { return; } ! shared_static_cast<BaseNode> ! (mParent.lock())->SetWorldTransform(transform); } *************** *** 150,154 **** { // is this node the scene node ? ! shared_ptr<Scene> self = shared_dynamic_cast<Scene>(make_shared(GetSelf())); if (self.get() != 0) { --- 145,151 ---- { // is this node the scene node ? ! shared_ptr<Scene> self = ! shared_dynamic_cast<Scene>(GetSelf().lock()); ! if (self.get() != 0) { *************** *** 198,203 **** } ! shared_ptr<BaseNode> node = shared_dynamic_cast<BaseNode> ! (make_shared(GetSelf())); return sceneServer->ImportScene(fileName,node,parameter); } --- 195,201 ---- } ! shared_ptr<BaseNode> node = ! shared_dynamic_cast<BaseNode>(GetSelf().lock()); ! return sceneServer->ImportScene(fileName,node,parameter); } |
|
From: Markus R. <rol...@us...> - 2006-02-15 00:59:19
|
Update of /cvsroot/simspark/simspark/spark/kerosin/sceneserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8983 Modified Files: axis.h axis.cpp Log Message: - compute a bounding box for the Axis Index: axis.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/sceneserver/axis.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** axis.h 5 Dec 2005 21:38:23 -0000 1.1 --- axis.h 15 Feb 2006 00:59:02 -0000 1.2 *************** *** 42,45 **** --- 42,48 ---- void SetSize(float size); + /** computes the local bounding box of the node */ + virtual void ComputeBoundingBox(); + protected: virtual void RenderInternal(); Index: axis.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/sceneserver/axis.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** axis.cpp 5 Dec 2005 21:38:23 -0000 1.1 --- axis.cpp 15 Feb 2006 00:59:02 -0000 1.2 *************** *** 72,73 **** --- 72,78 ---- } + void Axis::ComputeBoundingBox() + { + mLocalBoundingBox.minVec.Set(0.0, 0.0, 0.0); + mLocalBoundingBox.maxVec.Set(mSize,mSize,mSize); + } |
|
From: Markus R. <rol...@us...> - 2006-02-15 00:58:25
|
Update of /cvsroot/simspark/simspark/spark/kerosin/sceneserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8950 Modified Files: sphere.cpp Log Message: - update bounding box after the radius of a sphere changes Index: sphere.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/sceneserver/sphere.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** sphere.cpp 5 Dec 2005 21:38:23 -0000 1.1 --- sphere.cpp 15 Feb 2006 00:58:14 -0000 1.2 *************** *** 51,53 **** --- 51,54 ---- mScale[1] = radius; mScale[2] = radius; + CalcBoundingBox(); } |
|
From: Markus R. <rol...@us...> - 2006-02-15 00:57:53
|
Update of /cvsroot/simspark/simspark/spark/kerosin/sceneserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8722 Modified Files: box.cpp Log Message: - update bounding box after the extents of a box change Index: box.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/sceneserver/box.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** box.cpp 5 Dec 2005 21:38:23 -0000 1.1 --- box.cpp 15 Feb 2006 00:57:45 -0000 1.2 *************** *** 45,48 **** --- 45,49 ---- { mScale = extents; + CalcBoundingBox(); } |
|
From: Markus R. <rol...@us...> - 2006-02-15 00:57:13
|
Update of /cvsroot/simspark/simspark/spark/kerosin/sceneserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8566 Modified Files: staticmesh.cpp Log Message: - fixed calculation of bounding boxes for static meshes Index: staticmesh.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/sceneserver/staticmesh.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** staticmesh.cpp 5 Dec 2005 21:38:23 -0000 1.1 --- staticmesh.cpp 15 Feb 2006 00:57:05 -0000 1.2 *************** *** 156,160 **** mMesh.reset(); mMaterials.clear(); ! ComputeBoundingBox(); shared_ptr<GeometryServer> geometryServer = shared_dynamic_cast<GeometryServer> --- 156,160 ---- mMesh.reset(); mMaterials.clear(); ! CalcBoundingBox(); shared_ptr<GeometryServer> geometryServer = shared_dynamic_cast<GeometryServer> *************** *** 185,189 **** } ! ComputeBoundingBox(); // load corresponding materials --- 185,189 ---- } ! CalcBoundingBox(); // load corresponding materials |
|
From: Markus R. <rol...@us...> - 2006-02-12 11:39:24
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29616 Modified Files: property.cpp Log Message: - use const references to property nodes to avoid repeated dereferencing of shared_ptrs Index: property.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/property.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** property.cpp 12 Feb 2006 11:19:25 -0000 1.5 --- property.cpp 12 Feb 2006 11:39:09 -0000 1.6 *************** *** 120,127 **** void Property::GenClassEntries(shared_ptr<Leaf> leaf, TEntryList& entries) const { ! shared_ptr<Class> cl = shared_static_cast<Class>(leaf); // originating bundle ! shared_ptr<salt::SharedLibrary> bundle = cl->GetBundle(); entries.push_back( Entry( --- 120,127 ---- void Property::GenClassEntries(shared_ptr<Leaf> leaf, TEntryList& entries) const { ! const Class& cl = *shared_static_cast<Class>(leaf); // originating bundle ! shared_ptr<salt::SharedLibrary> bundle = cl.GetBundle(); entries.push_back( Entry( *************** *** 132,136 **** // base classes ! const Class::TStringList& baseCl = cl->GetBaseClasses(); for ( --- 132,136 ---- // base classes ! const Class::TStringList& baseCl = cl.GetBaseClasses(); for ( *************** *** 144,148 **** // supported functions ! const Class::TCommandMap& cmds = cl->GetCommandMap(); for ( --- 144,148 ---- // supported functions ! const Class::TCommandMap& cmds = cl.GetCommandMap(); for ( *************** *** 158,180 **** void Property::GenTransformEntries(shared_ptr<Leaf> leaf, TEntryList& entries) const { ! shared_ptr<Transform> trans = shared_static_cast<Transform>(leaf); ! entries.push_back(Entry(_T("GetChangedMark"), FormatInt(trans->GetChangedMark()))); ! entries.push_back(Entry(_T("GetLocalTransform"), FormatMatrix(trans->GetLocalTransform()))); ! entries.push_back(Entry(_T("GetWorldTransform"), FormatMatrix(trans->GetWorldTransform()))); } void Property::GenBodyEntries(shared_ptr<Leaf> leaf, TEntryList& entries) const { ! shared_ptr<Body> body = shared_static_cast<Body>(leaf); ! entries.push_back(Entry(_T("GetMass"),FormatFloat(body->GetMass()))); ! entries.push_back(Entry(_T("GetVelocity"),FormatVector3(body->GetVelocity()))); ! entries.push_back(Entry(_T("GetAngularVelocity"),FormatVector3(body->GetAngularVelocity()))); ! entries.push_back(Entry(_T("GetPosition"),FormatVector3(body->GetPosition()))); } void Property::GenJointEntries(shared_ptr<Leaf> leaf, TEntryList& entries) const { ! shared_ptr<Joint> joint = shared_static_cast<Joint>(leaf); ! entries.push_back(Entry(_T("FeedBackEnabled"),FormatBool(joint->FeedBackEnabled()))); for (int i=0;i<2;++i) --- 158,180 ---- void Property::GenTransformEntries(shared_ptr<Leaf> leaf, TEntryList& entries) const { ! const Transform& trans = *shared_static_cast<Transform>(leaf); ! entries.push_back(Entry(_T("GetChangedMark"), FormatInt(trans.GetChangedMark()))); ! entries.push_back(Entry(_T("GetLocalTransform"), FormatMatrix(trans.GetLocalTransform()))); ! entries.push_back(Entry(_T("GetWorldTransform"), FormatMatrix(trans.GetWorldTransform()))); } void Property::GenBodyEntries(shared_ptr<Leaf> leaf, TEntryList& entries) const { ! const Body& body = *shared_static_cast<Body>(leaf); ! entries.push_back(Entry(_T("GetMass"),FormatFloat(body.GetMass()))); ! entries.push_back(Entry(_T("GetVelocity"),FormatVector3(body.GetVelocity()))); ! entries.push_back(Entry(_T("GetAngularVelocity"),FormatVector3(body.GetAngularVelocity()))); ! entries.push_back(Entry(_T("GetPosition"),FormatVector3(body.GetPosition()))); } void Property::GenJointEntries(shared_ptr<Leaf> leaf, TEntryList& entries) const { ! const Joint& joint = *shared_static_cast<Joint>(leaf); ! entries.push_back(Entry(_T("FeedBackEnabled"),FormatBool(joint.FeedBackEnabled()))); for (int i=0;i<2;++i) *************** *** 183,188 **** const Joint::EBodyIndex idx = static_cast<Joint::EBodyIndex>(i); ! entries.push_back(Entry(_T("GetFeedbackForce")+strIdx,FormatVector3(joint->GetFeedbackForce(idx)))); ! entries.push_back(Entry(_T("GetFeedbackTorque")+strIdx,FormatVector3(joint->GetFeedbackTorque(idx)))); } --- 183,188 ---- const Joint::EBodyIndex idx = static_cast<Joint::EBodyIndex>(i); ! entries.push_back(Entry(_T("GetFeedbackForce")+strIdx,FormatVector3(joint.GetFeedbackForce(idx)))); ! entries.push_back(Entry(_T("GetFeedbackTorque")+strIdx,FormatVector3(joint.GetFeedbackTorque(idx)))); } *************** *** 192,208 **** const Joint::EAxisIndex idx = static_cast<Joint::EAxisIndex>(i); ! entries.push_back(Entry(_T("GetBounce")+strIdx,FormatFloat(joint->GetBounce(idx)))); ! entries.push_back(Entry(_T("GetLowStopDeg")+strIdx,FormatFloat(joint->GetLowStopDeg(idx)))); ! entries.push_back(Entry(_T("GetHighStopDeg")+strIdx,FormatFloat(joint->GetHighStopDeg(idx)))); ! entries.push_back(Entry(_T("GetLowStopPos")+strIdx,FormatFloat(joint->GetLowStopPos(idx)))); ! entries.push_back(Entry(_T("GetHighStopPos")+strIdx,FormatFloat(joint->GetHighStopPos(idx)))); ! entries.push_back(Entry(_T("GetCFM")+strIdx,FormatFloat(joint->GetCFM(idx)))); ! entries.push_back(Entry(_T("GetStopCFM")+strIdx,FormatFloat(joint->GetStopCFM(idx)))); ! entries.push_back(Entry(_T("GetSuspensionCFM")+strIdx,FormatFloat(joint->GetSuspensionCFM(idx)))); ! entries.push_back(Entry(_T("GetStopERP")+strIdx,FormatFloat(joint->GetStopERP(idx)))); ! entries.push_back(Entry(_T("GetSuspensionERP")+strIdx,FormatFloat(joint->GetSuspensionERP(idx)))); ! entries.push_back(Entry(_T("GetLinearMotorVelocity")+strIdx,FormatFloat(joint->GetLinearMotorVelocity(idx)))); ! entries.push_back(Entry(_T("GetAngularMotorVelocity")+strIdx,FormatFloat(joint->GetAngularMotorVelocity(idx)))); ! entries.push_back(Entry(_T("GetMaxMotorForce")+strIdx,FormatFloat(joint->GetMaxMotorForce(idx)))); } } --- 192,208 ---- const Joint::EAxisIndex idx = static_cast<Joint::EAxisIndex>(i); ! entries.push_back(Entry(_T("GetBounce")+strIdx,FormatFloat(joint.GetBounce(idx)))); ! entries.push_back(Entry(_T("GetLowStopDeg")+strIdx,FormatFloat(joint.GetLowStopDeg(idx)))); ! entries.push_back(Entry(_T("GetHighStopDeg")+strIdx,FormatFloat(joint.GetHighStopDeg(idx)))); ! entries.push_back(Entry(_T("GetLowStopPos")+strIdx,FormatFloat(joint.GetLowStopPos(idx)))); ! entries.push_back(Entry(_T("GetHighStopPos")+strIdx,FormatFloat(joint.GetHighStopPos(idx)))); ! entries.push_back(Entry(_T("GetCFM")+strIdx,FormatFloat(joint.GetCFM(idx)))); ! entries.push_back(Entry(_T("GetStopCFM")+strIdx,FormatFloat(joint.GetStopCFM(idx)))); ! entries.push_back(Entry(_T("GetSuspensionCFM")+strIdx,FormatFloat(joint.GetSuspensionCFM(idx)))); ! entries.push_back(Entry(_T("GetStopERP")+strIdx,FormatFloat(joint.GetStopERP(idx)))); ! entries.push_back(Entry(_T("GetSuspensionERP")+strIdx,FormatFloat(joint.GetSuspensionERP(idx)))); ! entries.push_back(Entry(_T("GetLinearMotorVelocity")+strIdx,FormatFloat(joint.GetLinearMotorVelocity(idx)))); ! entries.push_back(Entry(_T("GetAngularMotorVelocity")+strIdx,FormatFloat(joint.GetAngularMotorVelocity(idx)))); ! entries.push_back(Entry(_T("GetMaxMotorForce")+strIdx,FormatFloat(joint.GetMaxMotorForce(idx)))); } } *************** *** 210,217 **** void Property::GenWorldEntries(shared_ptr<Leaf> leaf, TEntryList& entries) const { ! shared_ptr<World> world = shared_static_cast<World>(leaf); ! entries.push_back(Entry(_T("GetGravity"),FormatVector3(world->GetGravity()))); ! entries.push_back(Entry(_T("GetERP"),FormatFloat(world->GetERP()))); ! entries.push_back(Entry(_T("GetCFM"),FormatFloat(world->GetCFM()))); } --- 210,217 ---- void Property::GenWorldEntries(shared_ptr<Leaf> leaf, TEntryList& entries) const { ! const World& world = *shared_static_cast<World>(leaf); ! entries.push_back(Entry(_T("GetGravity"),FormatVector3(world.GetGravity()))); ! entries.push_back(Entry(_T("GetERP"),FormatFloat(world.GetERP()))); ! entries.push_back(Entry(_T("GetCFM"),FormatFloat(world.GetCFM()))); } *************** *** 224,230 **** void Property::GenContactJointEntries(shared_ptr<Leaf> leaf, TEntryList& entries) const { ! shared_ptr<ContactJointHandler> cjh = shared_static_cast<ContactJointHandler>(leaf); ! int mode = cjh->GetContactMode(); wxString strMode = FORMAT_FLAG(mode, dContactMu2) + --- 224,230 ---- void Property::GenContactJointEntries(shared_ptr<Leaf> leaf, TEntryList& entries) const { ! const ContactJointHandler& cjh = *shared_static_cast<ContactJointHandler>(leaf); ! int mode = cjh.GetContactMode(); wxString strMode = FORMAT_FLAG(mode, dContactMu2) + *************** *** 243,264 **** entries.push_back(Entry(_T("GetContactMode"),strMode)); ! entries.push_back(Entry(_T("GetBounceValue"),FormatFloat(cjh->GetBounceValue()))); ! entries.push_back(Entry(_T("GetMinBounceVel"),FormatFloat(cjh->GetMinBounceVel()))); ! entries.push_back(Entry(_T("GetContactSoftERP"),FormatFloat(cjh->GetContactSoftERP()))); ! entries.push_back(Entry(_T("GetContactSoftCFM"),FormatFloat(cjh->GetContactSoftCFM()))); ! entries.push_back(Entry(_T("GetContactSlip1"),FormatFloat(cjh->GetContactSlip1()))); ! entries.push_back(Entry(_T("GetContactSlip2"),FormatFloat(cjh->GetContactSlip2()))); ! entries.push_back(Entry(_T("GetContactMu"),FormatFloat(cjh->GetContactMu()))); } void Property::GenDragControllerEntries(shared_ptr<Leaf> leaf, TEntryList& entries) const { ! shared_ptr<DragController> dc = shared_static_cast<DragController>(leaf); ! entries.push_back(Entry(_T("GetLinearDrag"),FormatFloat(dc->GetLinearDrag()))); ! entries.push_back(Entry(_T("GetAngularDrag"),FormatFloat(dc->GetAngularDrag()))); } - void Property::GetClassList(boost::shared_ptr<Class> cl, TClassList& clList) const { --- 243,263 ---- entries.push_back(Entry(_T("GetContactMode"),strMode)); ! entries.push_back(Entry(_T("GetBounceValue"),FormatFloat(cjh.GetBounceValue()))); ! entries.push_back(Entry(_T("GetMinBounceVel"),FormatFloat(cjh.GetMinBounceVel()))); ! entries.push_back(Entry(_T("GetContactSoftERP"),FormatFloat(cjh.GetContactSoftERP()))); ! entries.push_back(Entry(_T("GetContactSoftCFM"),FormatFloat(cjh.GetContactSoftCFM()))); ! entries.push_back(Entry(_T("GetContactSlip1"),FormatFloat(cjh.GetContactSlip1()))); ! entries.push_back(Entry(_T("GetContactSlip2"),FormatFloat(cjh.GetContactSlip2()))); ! entries.push_back(Entry(_T("GetContactMu"),FormatFloat(cjh.GetContactMu()))); } void Property::GenDragControllerEntries(shared_ptr<Leaf> leaf, TEntryList& entries) const { ! const DragController& dc = *shared_static_cast<DragController>(leaf); ! entries.push_back(Entry(_T("GetLinearDrag"),FormatFloat(dc.GetLinearDrag()))); ! entries.push_back(Entry(_T("GetAngularDrag"),FormatFloat(dc.GetAngularDrag()))); } void Property::GetClassList(boost::shared_ptr<Class> cl, TClassList& clList) const { |
|
From: Markus R. <rol...@us...> - 2006-02-12 11:37:20
|
Update of /cvsroot/simspark/simspark/spark/oxygen/physicsserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28956 Modified Files: angularmotor.cpp angularmotor.h balljoint.cpp balljoint.h dragcontroller.cpp dragcontroller.h fixedjoint.cpp fixedjoint.h hinge2joint.cpp hinge2joint.h hingejoint.cpp hingejoint.h joint.cpp joint.h sliderjoint.cpp sliderjoint.h universaljoint.cpp universaljoint.h Log Message: - const correctnes for GetXXX() methods Index: hingejoint.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/physicsserver/hingejoint.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** hingejoint.cpp 2 Jan 2006 19:07:10 -0000 1.3 --- hingejoint.cpp 12 Feb 2006 11:36:52 -0000 1.4 *************** *** 93,97 **** // calculate hinge axis (pos. y, relative to world transform) Vector3f forward(GetWorldTransform().Rotate(Vector3f(0,1,0))); ! dJointSetHingeAxis(mODEJoint, forward[0], forward[1], forward[2]); break; } --- 93,97 ---- // calculate hinge axis (pos. y, relative to world transform) Vector3f forward(GetWorldTransform().Rotate(Vector3f(0,1,0))); ! dJointSetHingeAxis(mODEJoint, forward[0], forward[1], forward[2]); break; } *************** *** 130,134 **** } ! float HingeJoint::GetParameter(int parameter) { return dJointGetHingeParam(mODEJoint, parameter); --- 130,134 ---- } ! float HingeJoint::GetParameter(int parameter) const { return dJointGetHingeParam(mODEJoint, parameter); Index: angularmotor.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/physicsserver/angularmotor.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** angularmotor.cpp 5 Dec 2005 21:16:49 -0000 1.1 --- angularmotor.cpp 12 Feb 2006 11:36:52 -0000 1.2 *************** *** 112,116 **** } ! float AngularMotor::GetParameter(int parameter) { return dJointGetAMotorParam(mODEJoint, parameter); --- 112,116 ---- } ! float AngularMotor::GetParameter(int parameter) const { return dJointGetAMotorParam(mODEJoint, parameter); Index: dragcontroller.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/physicsserver/dragcontroller.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** dragcontroller.h 5 Dec 2005 21:16:49 -0000 1.1 --- dragcontroller.h 12 Feb 2006 11:36:52 -0000 1.2 *************** *** 39,43 **** // returns the applied linear drag ! float GetLinearDrag(); // sets the applied linear drag --- 39,43 ---- // returns the applied linear drag ! float GetLinearDrag() const; // sets the applied linear drag *************** *** 45,49 **** // returns the applied angular drag ! float GetAngularDrag(); // sets the applied angular drag --- 45,49 ---- // returns the applied angular drag ! float GetAngularDrag() const; // sets the applied angular drag Index: dragcontroller.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/physicsserver/dragcontroller.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** dragcontroller.cpp 5 Dec 2005 21:16:49 -0000 1.1 --- dragcontroller.cpp 12 Feb 2006 11:36:52 -0000 1.2 *************** *** 56,60 **** } ! float DragController::GetLinearDrag() { return mLinearDrag; --- 56,60 ---- } ! float DragController::GetLinearDrag() const { return mLinearDrag; *************** *** 66,70 **** } ! float DragController::GetAngularDrag() { return mAngularDrag; --- 66,70 ---- } ! float DragController::GetAngularDrag() const { return mAngularDrag; Index: sliderjoint.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/physicsserver/sliderjoint.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** sliderjoint.cpp 5 Dec 2005 21:16:49 -0000 1.1 --- sliderjoint.cpp 12 Feb 2006 11:36:52 -0000 1.2 *************** *** 68,72 **** } ! float SliderJoint::GetParameter(int parameter) { return dJointGetSliderParam(mODEJoint, parameter); --- 68,72 ---- } ! float SliderJoint::GetParameter(int parameter) const { return dJointGetSliderParam(mODEJoint, parameter); Index: hinge2joint.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/physicsserver/hinge2joint.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** hinge2joint.cpp 5 Dec 2005 21:16:49 -0000 1.1 --- hinge2joint.cpp 12 Feb 2006 11:36:52 -0000 1.2 *************** *** 123,127 **** } ! float Hinge2Joint::GetParameter(int parameter) { return dJointGetHinge2Param(mODEJoint, parameter); --- 123,127 ---- } ! float Hinge2Joint::GetParameter(int parameter) const { return dJointGetHinge2Param(mODEJoint, parameter); Index: universaljoint.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/physicsserver/universaljoint.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** universaljoint.h 6 Jan 2006 13:53:38 -0000 1.2 --- universaljoint.h 12 Feb 2006 11:36:52 -0000 1.3 *************** *** 57,61 **** /** returns the vector describing one of the two axis (in local coordinates) ! \param idx index of the desired axis */ salt::Vector3f GetAxis(EAxisIndex idx); --- 57,61 ---- /** returns the vector describing one of the two axis (in local coordinates) ! \param idx index of the desired axis */ salt::Vector3f GetAxis(EAxisIndex idx); *************** *** 74,78 **** /** returns a joint parameter value */ ! virtual float GetParameter(int parameter); protected: --- 74,78 ---- /** returns a joint parameter value */ ! virtual float GetParameter(int parameter) const; protected: Index: sliderjoint.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/physicsserver/sliderjoint.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** sliderjoint.h 5 Dec 2005 21:16:49 -0000 1.1 --- sliderjoint.h 12 Feb 2006 11:36:52 -0000 1.2 *************** *** 55,59 **** /** returns a joint parameter value */ ! virtual float GetParameter(int parameter); }; --- 55,59 ---- /** returns a joint parameter value */ ! virtual float GetParameter(int parameter) const; }; Index: hinge2joint.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/physicsserver/hinge2joint.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** hinge2joint.h 5 Dec 2005 21:16:49 -0000 1.1 --- hinge2joint.h 12 Feb 2006 11:36:52 -0000 1.2 *************** *** 62,66 **** /** returns a joint parameter value */ ! virtual float GetParameter(int parameter); }; --- 62,66 ---- /** returns a joint parameter value */ ! virtual float GetParameter(int parameter) const; }; Index: joint.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/physicsserver/joint.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** joint.cpp 18 Dec 2005 18:07:10 -0000 1.3 --- joint.cpp 12 Feb 2006 11:36:52 -0000 1.4 *************** *** 162,166 **** } ! int Joint::GetType() { return dJointGetType(mODEJoint); --- 162,166 ---- } ! int Joint::GetType() const { return dJointGetType(mODEJoint); *************** *** 221,230 **** } ! bool Joint::FeedBackEnabled() { return (dJointGetFeedback(mODEJoint) != 0); } ! Vector3f Joint::GetFeedbackForce(EBodyIndex idx) { dJointFeedback* fb = mFeedback.get(); --- 221,230 ---- } ! bool Joint::FeedBackEnabled() const { return (dJointGetFeedback(mODEJoint) != 0); } ! Vector3f Joint::GetFeedbackForce(EBodyIndex idx) const { dJointFeedback* fb = mFeedback.get(); *************** *** 255,259 **** } ! Vector3f Joint::GetFeedbackTorque(EBodyIndex idx) { dJointFeedback* fb = mFeedback.get(); --- 255,259 ---- } ! Vector3f Joint::GetFeedbackTorque(EBodyIndex idx) const { dJointFeedback* fb = mFeedback.get(); *************** *** 289,293 **** } ! float Joint::GetBounce(EAxisIndex idx) { return GetParameter(dParamBounce + (idx * dParamGroup)); --- 289,293 ---- } ! float Joint::GetBounce(EAxisIndex idx) const { return GetParameter(dParamBounce + (idx * dParamGroup)); *************** *** 299,303 **** } ! float Joint::GetLowStopPos(EAxisIndex idx) { return GetParameter(dParamLoStop + (idx * dParamGroup)); --- 299,303 ---- } ! float Joint::GetLowStopPos(EAxisIndex idx) const { return GetParameter(dParamLoStop + (idx * dParamGroup)); *************** *** 309,313 **** } ! float Joint::GetHighStopPos(EAxisIndex idx) { return GetParameter(dParamHiStop + (idx * dParamGroup)); --- 309,313 ---- } ! float Joint::GetHighStopPos(EAxisIndex idx) const { return GetParameter(dParamHiStop + (idx * dParamGroup)); *************** *** 319,323 **** } ! float Joint::GetLowStopDeg(EAxisIndex idx) { return gRadToDeg(GetParameter(dParamLoStop + (idx * dParamGroup))); --- 319,323 ---- } ! float Joint::GetLowStopDeg(EAxisIndex idx) const { return gRadToDeg(GetParameter(dParamLoStop + (idx * dParamGroup))); *************** *** 329,333 **** } ! float Joint::GetHighStopDeg(EAxisIndex idx) { return gRadToDeg(GetParameter(dParamHiStop + (idx * dParamGroup))); --- 329,333 ---- } ! float Joint::GetHighStopDeg(EAxisIndex idx) const { return gRadToDeg(GetParameter(dParamHiStop + (idx * dParamGroup))); *************** *** 339,343 **** } ! float Joint::GetCFM(EAxisIndex idx) { return GetParameter(dParamCFM + (idx * dParamGroup)); --- 339,343 ---- } ! float Joint::GetCFM(EAxisIndex idx) const { return GetParameter(dParamCFM + (idx * dParamGroup)); *************** *** 349,353 **** } ! float Joint::GetStopCFM(EAxisIndex idx) { return GetParameter(dParamStopCFM + (idx * dParamGroup)); --- 349,353 ---- } ! float Joint::GetStopCFM(EAxisIndex idx) const { return GetParameter(dParamStopCFM + (idx * dParamGroup)); *************** *** 359,363 **** } ! float Joint::GetStopERP(EAxisIndex idx) { return GetParameter(dParamStopERP + (idx * dParamGroup)); --- 359,363 ---- } ! float Joint::GetStopERP(EAxisIndex idx) const { return GetParameter(dParamStopERP + (idx * dParamGroup)); *************** *** 369,373 **** } ! float Joint::GetSuspensionERP(EAxisIndex idx) { return GetParameter(dParamSuspensionERP + (idx * dParamGroup)); --- 369,373 ---- } ! float Joint::GetSuspensionERP(EAxisIndex idx) const { return GetParameter(dParamSuspensionERP + (idx * dParamGroup)); *************** *** 379,383 **** } ! float Joint::GetSuspensionCFM(EAxisIndex idx) { return GetParameter(dParamSuspensionCFM + (idx * dParamGroup)); --- 379,383 ---- } ! float Joint::GetSuspensionCFM(EAxisIndex idx) const { return GetParameter(dParamSuspensionCFM + (idx * dParamGroup)); *************** *** 389,393 **** } ! float Joint::GetLinearMotorVelocity(EAxisIndex idx) { return GetParameter(dParamVel + (idx * dParamGroup)); --- 389,393 ---- } ! float Joint::GetLinearMotorVelocity(EAxisIndex idx) const { return GetParameter(dParamVel + (idx * dParamGroup)); *************** *** 399,403 **** } ! float Joint::GetAngularMotorVelocity(EAxisIndex idx) { return gRadToDeg(GetParameter(dParamVel + (idx * dParamGroup))); --- 399,403 ---- } ! float Joint::GetAngularMotorVelocity(EAxisIndex idx) const { return gRadToDeg(GetParameter(dParamVel + (idx * dParamGroup))); *************** *** 409,413 **** } ! float Joint::GetMaxMotorForce(EAxisIndex idx) { return GetParameter(dParamFMax + (idx * dParamGroup)); --- 409,413 ---- } ! float Joint::GetMaxMotorForce(EAxisIndex idx) const { return GetParameter(dParamFMax + (idx * dParamGroup)); Index: universaljoint.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/physicsserver/universaljoint.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** universaljoint.cpp 6 Jan 2006 13:53:38 -0000 1.2 --- universaljoint.cpp 12 Feb 2006 11:36:52 -0000 1.3 *************** *** 153,157 **** } ! float UniversalJoint::GetParameter(int parameter) { return dJointGetUniversalParam(mODEJoint, parameter); --- 153,157 ---- } ! float UniversalJoint::GetParameter(int parameter) const { return dJointGetUniversalParam(mODEJoint, parameter); Index: hingejoint.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/physicsserver/hingejoint.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** hingejoint.h 2 Jan 2006 19:07:11 -0000 1.3 --- hingejoint.h 12 Feb 2006 11:36:52 -0000 1.4 *************** *** 66,70 **** /** returns a joint parameter value */ ! virtual float GetParameter(int parameter); protected: --- 66,70 ---- /** returns a joint parameter value */ ! virtual float GetParameter(int parameter) const; protected: Index: balljoint.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/physicsserver/balljoint.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** balljoint.h 5 Dec 2005 21:16:49 -0000 1.1 --- balljoint.h 12 Feb 2006 11:36:52 -0000 1.2 *************** *** 53,57 **** /** returns a joint parameter value */ ! virtual float GetParameter(int parameter); }; --- 53,57 ---- /** returns a joint parameter value */ ! virtual float GetParameter(int parameter) const; }; Index: joint.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/physicsserver/joint.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** joint.h 5 Dec 2005 21:16:49 -0000 1.1 --- joint.h 12 Feb 2006 11:36:52 -0000 1.2 *************** *** 95,99 **** dJointTypeHinge2, dJointTypeFixed or dJointTypeAMotor. */ ! int GetType(); /** returns true if the two given bodies are connected by a --- 95,99 ---- dJointTypeHinge2, dJointTypeFixed or dJointTypeAMotor. */ ! int GetType() const; /** returns true if the two given bodies are connected by a *************** *** 121,135 **** /** returns true if the joint is set to collect feedback information */ ! bool FeedBackEnabled(); /** queries the force that the joint applied to one body attached to it during the last timestep. */ ! salt::Vector3f GetFeedbackForce(EBodyIndex idx); /** queries the torque that the joint applied to one body attached to it during the last timestep. */ ! salt::Vector3f GetFeedbackTorque(EBodyIndex idx); /** sets the bouncyness of the stops. This is a restitution --- 121,135 ---- /** returns true if the joint is set to collect feedback information */ ! bool FeedBackEnabled() const; /** queries the force that the joint applied to one body attached to it during the last timestep. */ ! salt::Vector3f GetFeedbackForce(EBodyIndex idx) const; /** queries the torque that the joint applied to one body attached to it during the last timestep. */ ! salt::Vector3f GetFeedbackTorque(EBodyIndex idx) const; /** sets the bouncyness of the stops. This is a restitution *************** *** 140,144 **** /** returns the bouncyness of the stops */ ! float GetBounce(EAxisIndex idx); /** sets the low stop angle in degrees, this stop must be greater --- 140,144 ---- /** returns the bouncyness of the stops */ ! float GetBounce(EAxisIndex idx) const; /** sets the low stop angle in degrees, this stop must be greater *************** *** 148,152 **** /** returns the low stop angle in degrees */ ! float GetLowStopDeg(EAxisIndex idx); /** sets the high stop angle in degrees, this stop must be less --- 148,152 ---- /** returns the low stop angle in degrees */ ! float GetLowStopDeg(EAxisIndex idx) const; /** sets the high stop angle in degrees, this stop must be less *************** *** 156,160 **** /** returns the high stop angle in degrees */ ! float GetHighStopDeg(EAxisIndex idx); /** sets the low stop position */ --- 156,160 ---- /** returns the high stop angle in degrees */ ! float GetHighStopDeg(EAxisIndex idx) const; /** sets the low stop position */ *************** *** 162,166 **** /** returns the low stop position */ ! float GetLowStopPos(EAxisIndex idx); /** sets the high stop position */ --- 162,166 ---- /** returns the low stop position */ ! float GetLowStopPos(EAxisIndex idx) const; /** sets the high stop position */ *************** *** 168,172 **** /** returns the high stop position */ ! float GetHighStopPos(EAxisIndex idx); /** the constraint force mixing (CFM) value used when not at a --- 168,172 ---- /** returns the high stop position */ ! float GetHighStopPos(EAxisIndex idx) const; /** the constraint force mixing (CFM) value used when not at a *************** *** 176,180 **** /** returns the constraint force mixing value used when not a a stop */ ! float GetCFM(EAxisIndex idx); /** sets the constraint force mixing (CFM) value used by the --- 176,180 ---- /** returns the constraint force mixing value used when not a a stop */ ! float GetCFM(EAxisIndex idx) const; /** sets the constraint force mixing (CFM) value used by the *************** *** 187,191 **** /** returns the constraint force mixing value used by the stops */ ! float GetStopCFM(EAxisIndex idx); /** sets the error reduction parameter (ERP) used by the stops. */ --- 187,191 ---- /** returns the constraint force mixing value used by the stops */ ! float GetStopCFM(EAxisIndex idx) const; /** sets the error reduction parameter (ERP) used by the stops. */ *************** *** 193,197 **** /** returns the error reduction parameter used by the stops */ ! float GetStopERP(EAxisIndex idx); /** sets the suspension error reduction parameter (ERP). As of ode --- 193,197 ---- /** returns the error reduction parameter used by the stops */ ! float GetStopERP(EAxisIndex idx) const; /** sets the suspension error reduction parameter (ERP). As of ode *************** *** 203,207 **** ode 0.039 this is only implemented on the hinge-2 joint. */ ! float GetSuspensionERP(EAxisIndex idx); /** sets the suspension constraint force mixing value. As of ode --- 203,207 ---- ode 0.039 this is only implemented on the hinge-2 joint. */ ! float GetSuspensionERP(EAxisIndex idx) const; /** sets the suspension constraint force mixing value. As of ode *************** *** 213,217 **** ode 0.039 this is only implemented on the hinge-2 joint. */ ! float GetSuspensionCFM(EAxisIndex idx); /** sets the linear motor velocity */ --- 213,217 ---- ode 0.039 this is only implemented on the hinge-2 joint. */ ! float GetSuspensionCFM(EAxisIndex idx) const; /** sets the linear motor velocity */ *************** *** 219,223 **** /** returns the linear motor velocity */ ! float GetLinearMotorVelocity(EAxisIndex idx); /** sets the angular motor velocity in degrees */ --- 219,223 ---- /** returns the linear motor velocity */ ! float GetLinearMotorVelocity(EAxisIndex idx) const; /** sets the angular motor velocity in degrees */ *************** *** 225,229 **** /** returns the angular motor velocity in degrees */ ! float GetAngularMotorVelocity(EAxisIndex idx); /** sets the maximum force or torque that the motor will use to --- 225,229 ---- /** returns the angular motor velocity in degrees */ ! float GetAngularMotorVelocity(EAxisIndex idx) const; /** sets the maximum force or torque that the motor will use to *************** *** 237,241 **** achieve the desired velocity. */ ! float GetMaxMotorForce(EAxisIndex idx); protected: --- 237,241 ---- achieve the desired velocity. */ ! float GetMaxMotorForce(EAxisIndex idx) const; protected: *************** *** 250,254 **** /** returns a joint parameter value */ ! virtual float GetParameter(int parameter) = 0; protected: --- 250,254 ---- /** returns a joint parameter value */ ! virtual float GetParameter(int parameter) const = 0; protected: Index: angularmotor.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/physicsserver/angularmotor.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** angularmotor.h 5 Dec 2005 21:16:49 -0000 1.1 --- angularmotor.h 12 Feb 2006 11:36:52 -0000 1.2 *************** *** 123,127 **** /** returns a joint parameter value */ ! virtual float GetParameter(int parameter); }; --- 123,127 ---- /** returns a joint parameter value */ ! virtual float GetParameter(int parameter) const; }; Index: fixedjoint.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/physicsserver/fixedjoint.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** fixedjoint.h 5 Dec 2005 21:16:49 -0000 1.1 --- fixedjoint.h 12 Feb 2006 11:36:52 -0000 1.2 *************** *** 43,47 **** /** returns a joint parameter value */ ! virtual float GetParameter(int parameter); }; --- 43,47 ---- /** returns a joint parameter value */ ! virtual float GetParameter(int parameter) const; }; Index: fixedjoint.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/physicsserver/fixedjoint.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** fixedjoint.cpp 5 Dec 2005 21:16:49 -0000 1.1 --- fixedjoint.cpp 12 Feb 2006 11:36:52 -0000 1.2 *************** *** 49,53 **** } ! float FixedJoint::GetParameter(int /*parameter*/) { // no ode get param fkt. defined --- 49,53 ---- } ! float FixedJoint::GetParameter(int /*parameter*/) const { // no ode get param fkt. defined Index: balljoint.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/physicsserver/balljoint.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** balljoint.cpp 5 Dec 2005 21:16:49 -0000 1.1 --- balljoint.cpp 12 Feb 2006 11:36:52 -0000 1.2 *************** *** 82,86 **** } ! float BallJoint::GetParameter(int /*parameter*/) { // no ode get param fkt. defined --- 82,86 ---- } ! float BallJoint::GetParameter(int /*parameter*/) const { // no ode get param fkt. defined |
|
From: Markus R. <rol...@us...> - 2006-02-12 11:25:49
|
Update of /cvsroot/simspark/simspark/spark/oxygen/physicsserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26032 Modified Files: contactjointhandler.h contactjointhandler.cpp Log Message: - added some more accessors Index: contactjointhandler.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/physicsserver/contactjointhandler.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** contactjointhandler.cpp 5 Dec 2005 21:16:49 -0000 1.1 --- contactjointhandler.cpp 12 Feb 2006 11:25:36 -0000 1.2 *************** *** 169,172 **** --- 169,178 ---- } + const dSurfaceParameters& + ContactJointHandler::SetSurfaceParameter() const + { + return mSurfaceParameter; + } + void ContactJointHandler::SetContactMode(int mode, bool set) *************** *** 181,184 **** --- 187,196 ---- } + int + ContactJointHandler::GetContactMode() const + { + return mSurfaceParameter.mode; + } + void ContactJointHandler::SetContactBounceMode(bool set) *************** *** 193,196 **** --- 205,214 ---- } + float + ContactJointHandler::GetMinBounceVel() const + { + return mSurfaceParameter.bounce_vel; + } + void ContactJointHandler::SetBounceValue(float bounce) *************** *** 199,202 **** --- 217,226 ---- } + float + ContactJointHandler::GetBounceValue() const + { + return mSurfaceParameter.bounce; + } + void ContactJointHandler::SetContactSoftERPMode(bool set) *************** *** 212,215 **** --- 236,245 ---- } + float + ContactJointHandler::GetContactSoftERP() const + { + return mSurfaceParameter.soft_erp; + } + void ContactJointHandler::SetContactSoftCFMMode(bool set) *************** *** 224,227 **** --- 254,262 ---- } + float ContactJointHandler::GetContactSoftCFM() const + { + return mSurfaceParameter.soft_cfm; + } + void ContactJointHandler::SetContactSlipMode (bool set) { *************** *** 236,239 **** --- 271,286 ---- } + float + ContactJointHandler::GetContactSlip1() const + { + return mSurfaceParameter.slip1; + } + + float + ContactJointHandler::GetContactSlip2() const + { + return mSurfaceParameter.slip2; + } + void ContactJointHandler::SetContactMu(float mu) { *************** *** 241,244 **** --- 288,297 ---- } + float ContactJointHandler::GetContactMu() const + { + return mSurfaceParameter.mu; + } + + Index: contactjointhandler.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/physicsserver/contactjointhandler.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** contactjointhandler.h 5 Dec 2005 21:16:49 -0000 1.1 --- contactjointhandler.h 12 Feb 2006 11:25:36 -0000 1.2 *************** *** 63,69 **** --- 63,79 ---- void SetSurfaceParameter(const dSurfaceParameters& surface); + /** returns the surface parameters for the contact joints taht the + CollisionHandler creates + */ + const dSurfaceParameters& SetSurfaceParameter() const; + /** sets or resets a contact mode flag in the surface parameter*/ void SetContactMode(int mode, bool set); + /** returns the current set of contact mode flags in the surface + parameter + */ + int GetContactMode() const; + /** sets or resets the dContactBounce mode flag */ void SetContactBounceMode(bool set); *************** *** 72,78 **** --- 82,94 ---- void SetBounceValue(float bounce); + /** returns the bounce value */ + float GetBounceValue() const; + /** sets the mininum incoming velocity necessary for bounce */ void SetMinBounceVel(float vel); + /** returns the mininum incoming velocity necessary for bounce */ + float GetMinBounceVel() const; + /** sets or resets the error reduction parameter (ERP) mode, useful to make surfaces soft *************** *** 83,86 **** --- 99,105 ---- void SetContactSoftERP(float erp); + /** returns the contact normal error reduction parameter (ERP) */ + float GetContactSoftERP() const; + /** sets or resets the constraint force mixing mode (CFM), useful to make surfaces soft *************** *** 88,106 **** void SetContactSoftCFMMode(bool set); ! /** sets the constraint force mixing parameter (CFM) ! */ void SetContactSoftCFM(float cfm); /** sets or resets the force dependent contact slip mode (FDS) */ void SetContactSlipMode (bool set); ! /** sets the force dependent slip (FDS) ! */ void SetContactSlip(float slip); /** sets the Coulomb friction coefficient */ void SetContactMu(float mu); protected: f_inline float MixValues(const float v1, const float v2, const int n) const; --- 107,141 ---- void SetContactSoftCFMMode(bool set); ! /** sets the constraint force mixing parameter (CFM) */ void SetContactSoftCFM(float cfm); + /** returns the constraint force mixing parameter (CFM) */ + float GetContactSoftCFM() const; + /** sets or resets the force dependent contact slip mode (FDS) */ void SetContactSlipMode (bool set); ! /** sets the force dependent slip (FDS) in both friction ! directions ! */ void SetContactSlip(float slip); + /** returns the force dependent slip in the first slip direction + (FDS) + */ + float GetContactSlip1() const; + + /** returns the force dependent slip in the second slip direction + (FDS) + */ + float GetContactSlip2() const; + /** sets the Coulomb friction coefficient */ void SetContactMu(float mu); + /** returns the Coulomb friction coefficient */ + float GetContactMu() const; + protected: f_inline float MixValues(const float v1, const float v2, const int n) const; |
|
From: Markus R. <rol...@us...> - 2006-02-12 11:19:38
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24038 Modified Files: property.h property.cpp Log Message: - added properties for collisionhandler, contactjointhandler and - dragcontroller Index: property.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/property.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** property.cpp 24 Jan 2006 18:08:46 -0000 1.4 --- property.cpp 12 Feb 2006 11:19:25 -0000 1.5 *************** *** 36,39 **** --- 36,42 ---- #include <oxygen/physicsserver/joint.h> #include <oxygen/physicsserver/world.h> + #include <oxygen/physicsserver/collisionhandler.h> + #include <oxygen/physicsserver/contactjointhandler.h> + #include <oxygen/physicsserver/dragcontroller.h> *************** *** 80,83 **** --- 83,89 ---- } + #define FORMAT_FLAG(_i, _flag)\ + wxString((_i & _flag) ? #_flag" " : "") + Property::Property() { *************** *** 96,99 **** --- 102,108 ---- mClassMap[_T("/classes/oxygen/Joint")] = CL_JOINT; mClassMap[_T("/classes/oxygen/World")] = CL_WORLD; + mClassMap[_T("/classes/oxygen/CollisionHandler")] = CL_COLLISIONHANDLER; + mClassMap[_T("/classes/oxygen/ContactJointHandler")] = CL_CONTACTJOINTHANDLER; + mClassMap[_T("/classes/oxygen/DragController")] = CL_DRAGCONTROLLER; } *************** *** 207,210 **** --- 216,263 ---- } + void Property::GenCollisionHandlerEntries(shared_ptr<Leaf> leaf, TEntryList& entries) const + { + shared_ptr<CollisionHandler> ch = shared_static_cast<CollisionHandler>(leaf); + entries.push_back(Entry(_T("IsSymmetricHandler"),FormatBool(ch->IsSymmetricHandler()))); + } + + void Property::GenContactJointEntries(shared_ptr<Leaf> leaf, TEntryList& entries) const + { + shared_ptr<ContactJointHandler> cjh = shared_static_cast<ContactJointHandler>(leaf); + + int mode = cjh->GetContactMode(); + wxString strMode = + FORMAT_FLAG(mode, dContactMu2) + + FORMAT_FLAG(mode, dContactFDir1) + + FORMAT_FLAG(mode, dContactBounce) + + FORMAT_FLAG(mode, dContactSoftERP) + + FORMAT_FLAG(mode, dContactSoftCFM) + + FORMAT_FLAG(mode, dContactMotion1) + + FORMAT_FLAG(mode, dContactMotion2) + + FORMAT_FLAG(mode, dContactSlip1) + + FORMAT_FLAG(mode, dContactSlip2) + + FORMAT_FLAG(mode, dContactApprox0) + + FORMAT_FLAG(mode, dContactApprox1_1) + + FORMAT_FLAG(mode, dContactApprox1_2) + + FORMAT_FLAG(mode, dContactApprox1); + + entries.push_back(Entry(_T("GetContactMode"),strMode)); + entries.push_back(Entry(_T("GetBounceValue"),FormatFloat(cjh->GetBounceValue()))); + entries.push_back(Entry(_T("GetMinBounceVel"),FormatFloat(cjh->GetMinBounceVel()))); + entries.push_back(Entry(_T("GetContactSoftERP"),FormatFloat(cjh->GetContactSoftERP()))); + entries.push_back(Entry(_T("GetContactSoftCFM"),FormatFloat(cjh->GetContactSoftCFM()))); + entries.push_back(Entry(_T("GetContactSlip1"),FormatFloat(cjh->GetContactSlip1()))); + entries.push_back(Entry(_T("GetContactSlip2"),FormatFloat(cjh->GetContactSlip2()))); + entries.push_back(Entry(_T("GetContactMu"),FormatFloat(cjh->GetContactMu()))); + } + + void Property::GenDragControllerEntries(shared_ptr<Leaf> leaf, TEntryList& entries) const + { + shared_ptr<DragController> dc = shared_static_cast<DragController>(leaf); + + entries.push_back(Entry(_T("GetLinearDrag"),FormatFloat(dc->GetLinearDrag()))); + entries.push_back(Entry(_T("GetAngularDrag"),FormatFloat(dc->GetAngularDrag()))); + } + void Property::GetClassList(boost::shared_ptr<Class> cl, TClassList& clList) const *************** *** 309,312 **** --- 362,378 ---- case CL_WORLD: GenWorldEntries(leaf, entries); + break; + + case CL_COLLISIONHANDLER: + GenCollisionHandlerEntries(leaf, entries); + break; + + case CL_CONTACTJOINTHANDLER: + GenContactJointEntries(leaf, entries); + break; + + case CL_DRAGCONTROLLER: + GenDragControllerEntries(leaf, entries); + break; } } Index: property.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/property.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** property.h 22 Jan 2006 18:57:46 -0000 1.3 --- property.h 12 Feb 2006 11:19:25 -0000 1.4 *************** *** 43,47 **** CL_BODY, CL_JOINT, ! CL_WORLD }; --- 43,50 ---- CL_BODY, CL_JOINT, ! CL_WORLD, ! CL_COLLISIONHANDLER, ! CL_CONTACTJOINTHANDLER, ! CL_DRAGCONTROLLER }; *************** *** 80,83 **** --- 83,90 ---- void GenJointEntries(boost::shared_ptr<zeitgeist::Leaf> leaf, TEntryList& entries) const; void GenWorldEntries(boost::shared_ptr<zeitgeist::Leaf> leaf, TEntryList& entries) const; + void GenCollisionHandlerEntries(boost::shared_ptr<zeitgeist::Leaf> leaf, TEntryList& entries) const; + void GenContactJointEntries(boost::shared_ptr<zeitgeist::Leaf> leaf, TEntryList& entries) const; + void GenDragControllerEntries(boost::shared_ptr<zeitgeist::Leaf> leaf, TEntryList& entries) const; + void GetClassList(boost::shared_ptr<zeitgeist::Class> cl, TClassList& clList) const; |
|
From: Jan M. <ja...@us...> - 2006-02-10 10:12:31
|
Update of /cvsroot/simspark/simspark/spark/salt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15790 Modified Files: gmath.h Log Message: fixed a small mistake that may result in superfluous casting Index: gmath.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/salt/gmath.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** gmath.h 5 Dec 2005 20:56:00 -0000 1.1 --- gmath.h 10 Feb 2006 10:12:19 -0000 1.2 *************** *** 153,157 **** f_inline TYPE gDegToRad(TYPE deg) { ! return (static_cast<double>(deg)) * (M_PI / 180.0); } --- 153,157 ---- f_inline TYPE gDegToRad(TYPE deg) { ! return (static_cast<TYPE>(deg)) * (M_PI / 180.0); } |
|
From: Markus R. <rol...@us...> - 2006-01-24 19:31:25
|
Update of /cvsroot/simspark/simspark/spark/spark In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9617 Modified Files: spark.rb Log Message: - registered the RosImporter Index: spark.rb =================================================================== RCS file: /cvsroot/simspark/simspark/spark/spark/spark.rb,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** spark.rb 25 Dec 2005 17:20:59 -0000 1.3 --- spark.rb 24 Jan 2006 19:31:11 -0000 1.4 *************** *** 319,322 **** --- 319,326 ---- sceneServer.initSceneImporter("RubySceneImporter"); + # use the ros scene importer to import scenes + importeBundle 'rosimporter' + sceneServer.initSceneImporter("RosImporter"); + # create world and space aspects world = new('oxygen/World', $scenePath+'world') |
|
From: Markus R. <rol...@us...> - 2006-01-24 19:18:46
|
Update of /cvsroot/simspark/simspark/spark In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3796 Modified Files: configure.ac Log Message: - added tinyxml and rosimporter Index: configure.ac =================================================================== RCS file: /cvsroot/simspark/simspark/spark/configure.ac,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** configure.ac 25 Dec 2005 14:55:51 -0000 1.2 --- configure.ac 24 Jan 2006 19:18:39 -0000 1.3 *************** *** 173,176 **** --- 173,177 ---- utility/sfsexp/Makefile \ utility/rcssnet/Makefile \ + utility/tinyxml/Makefile \ salt/Makefile \ salt/salt-config \ *************** *** 190,193 **** --- 191,195 ---- plugin/sexpparser/Makefile \ plugin/rubysceneimporter/Makefile \ + plugin/rosimporter/Makefile \ plugin/sparkmonitor/Makefile \ plugin/sparkagent/Makefile \ |
|
From: Markus R. <rol...@us...> - 2006-01-24 19:16:44
|
Update of /cvsroot/simspark/simspark/spark/plugin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2613 Modified Files: Makefile.am Log Message: - added initial skeleton for a RosSim XML Importer Index: Makefile.am =================================================================== RCS file: /cvsroot/simspark/simspark/spark/plugin/Makefile.am,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile.am 25 Dec 2005 14:54:35 -0000 1.2 --- Makefile.am 24 Jan 2006 19:16:32 -0000 1.3 *************** *** 5,8 **** --- 5,9 ---- sexpparser \ rubysceneimporter\ + rosimporter\ sparkmonitor\ sparkagent\ |
|
From: Markus R. <rol...@us...> - 2006-01-24 19:16:44
|
Update of /cvsroot/simspark/simspark/spark/plugin/sparkagent In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2613/sparkagent Modified Files: universaljointeffector.cpp Log Message: - added initial skeleton for a RosSim XML Importer Index: universaljointeffector.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/plugin/sparkagent/universaljointeffector.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** universaljointeffector.cpp 6 Jan 2006 13:57:36 -0000 1.1 --- universaljointeffector.cpp 24 Jan 2006 19:16:32 -0000 1.2 *************** *** 36,40 **** } ! bool UniversalJointEffector::Realize(boost::shared_ptr<ActionObject> action) { if (mJoint.get() == 0) --- 36,40 ---- } ! bool UniversalJointEffector::Realize(shared_ptr<ActionObject> action) { if (mJoint.get() == 0) |
|
From: Markus R. <rol...@us...> - 2006-01-24 19:16:43
|
Update of /cvsroot/simspark/simspark/spark/plugin/rosimporter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2613/rosimporter Added Files: Makefile.am export.cpp rosimporter.cpp rosimporter.h rosimporter_c.cpp Log Message: - added initial skeleton for a RosSim XML Importer --- NEW FILE: rosimporter_c.cpp --- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- this file is part of rcssserver3D Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group $Id: rosimporter_c.cpp,v 1.1 2006/01/24 19:16:32 rollmark Exp $ 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; version 2 of the License. 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "rosimporter.h" void CLASS(RosImporter)::DefineClass() { DEFINE_BASECLASS(oxygen/SceneImporter); } --- NEW FILE: export.cpp --- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- this file is part of rcssserver3D Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group $Id: export.cpp,v 1.1 2006/01/24 19:16:32 rollmark Exp $ 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; version 2 of the License. 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "rosimporter.h" ZEITGEIST_EXPORT_BEGIN() ZEITGEIST_EXPORT(RosImporter); ZEITGEIST_EXPORT_END() --- NEW FILE: Makefile.am --- pkglib_LTLIBRARIES = rosimporter.la rosimporter_la_SOURCES =\ export.cpp \ rosimporter.cpp\ rosimporter.h \ rosimporter_c.cpp # -module tells automake we're not building a library but a loadable module # so we don't need the "lib" prefix in the module name rosimporter_la_LDFLAGS = -module -avoid-version -L${top_srcdir}/utility/tinyxml rosimporter_la_LIBADD = -ltinyxml AM_CPPFLAGS = -I${top_srcdir}/lib -I${top_srcdir}/utility @RUBY_CPPFLAGS@ --- NEW FILE: rosimporter.cpp --- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- this file is part of rcssserver3D Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group $Id: rosimporter.cpp,v 1.1 2006/01/24 19:16:32 rollmark Exp $ 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; version 2 of the License. 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "rosimporter.h" #include <zeitgeist/logserver/logserver.h> #include <zeitgeist/fileserver/fileserver.h> #include <boost/scoped_array.hpp> using namespace zeitgeist; using namespace oxygen; using namespace boost; using namespace std; #define S_FROMSTRING "<from string>"; RosImporter::RosImporter() : SceneImporter() { } RosImporter::~RosImporter() { } TiXmlElement* RosImporter::GetFirstChild(TiXmlNode* node, const std::string& type) { TiXmlNode* childNode = node->FirstChild(type.c_str()); if ( (childNode == 0) || (childNode->Type() != TiXmlNode::ELEMENT) ) { return 0; } return static_cast<TiXmlElement*>(childNode); } TiXmlElement* RosImporter::IterateChildren(TiXmlNode* node, const std::string& type) { TiXmlNode* childNode = node->Parent()->IterateChildren(type.c_str(),node); if ( (childNode == 0) || (childNode->Type() != TiXmlNode::ELEMENT) ) { return 0; } return static_cast<TiXmlElement*>(childNode); } bool RosImporter::ImportScene(const std::string& fileName, shared_ptr<BaseNode> root, shared_ptr<ParameterList> parameter) { // try to open the file shared_ptr<salt::RFile> file = GetFile()->Open(fileName); if (file.get() == 0) { GetLog()->Error() << "(RosImporter) ERROR: cannot open file '" << fileName << "'\n"; return false; } mFileName = fileName; // read entire file into a temporary buffer scoped_array<char> buffer(new char[file->Size() + 1]); file->Read(buffer.get(), file->Size()); buffer[file->Size()] = 0; return ParseScene(buffer.get(), file->Size(), root, parameter); } bool RosImporter::ParseScene(const std::string& scene, shared_ptr<BaseNode> root, shared_ptr<ParameterList> parameter) { mFileName = S_FROMSTRING; return ParseScene(scene.c_str(),scene.size(),root,parameter); } bool RosImporter::ParseScene(const char* scene, int size, boost::shared_ptr<oxygen::BaseNode> root, boost::shared_ptr<zeitgeist::ParameterList> parameter) { TiXmlDocument document; document.Parse(scene); if (document.Error()) { GetLog()->Error() << "(RosImporter) ERROR: xml parsing error: " << document.ErrorDesc() << std::endl; return false; } TiXmlElement* xmlRoot = document.RootElement(); if (xmlRoot == 0) { // empty doc return true; } for ( TiXmlNode* node = xmlRoot->FirstChild(); xmlRoot != 0; node = xmlRoot->IterateChildren(node) ) { TiXmlElement* element = static_cast<TiXmlElement*>(node); std::string value(node->Value()); } return true; } --- NEW FILE: rosimporter.h --- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- this file is part of rcssserver3D Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group $Id: rosimporter.h,v 1.1 2006/01/24 19:16:32 rollmark Exp $ 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; version 2 of the License. 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef ROSIMPORTER_H #define ROSIMPORTER_H #include <oxygen/sceneserver/sceneimporter.h> #include <oxygen/sceneserver/basenode.h> #include <tinyxml/tinyxml.h> class RosImporter : public oxygen::SceneImporter { public: RosImporter(); virtual ~RosImporter(); virtual bool ImportScene(const std::string& fileName, boost::shared_ptr<oxygen::BaseNode> root, boost::shared_ptr<zeitgeist::ParameterList> parameter); virtual bool ParseScene(const std::string& scene, boost::shared_ptr<oxygen::BaseNode> root, boost::shared_ptr<zeitgeist::ParameterList> parameter); protected: virtual bool ParseScene(const char* scene, int size, boost::shared_ptr<oxygen::BaseNode> root, boost::shared_ptr<zeitgeist::ParameterList> parameter); TiXmlElement* GetFirstChild(TiXmlNode* node, const std::string& type); TiXmlElement* IterateChildren(TiXmlNode* node, const std::string& type); protected: /** the last supplied fileName */ std::string mFileName; }; DECLARE_CLASS(RosImporter); #endif // ROSIMPORTER_H |
|
From: Markus R. <rol...@us...> - 2006-01-24 19:15:25
|
Update of /cvsroot/simspark/simspark/spark/plugin/rosimporter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2426/rosimporter Log Message: Directory /cvsroot/simspark/simspark/spark/plugin/rosimporter added to the repository |
Update of /cvsroot/simspark/simspark/spark/utility/tinyxml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1712/tinyxml Added Files: Makefile.am readme.txt tinystr.cpp tinystr.h tinyxml.cpp tinyxml.h tinyxmlerror.cpp tinyxmlparser.cpp Log Message: - added TinyXML parser to the utility library --- NEW FILE: tinyxmlerror.cpp --- /* www.sourceforge.net/projects/tinyxml Original code (2.0 and earlier )copyright (c) 2000-2002 Lee Thomason (www.grinninglizard.com) This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ #include "tinyxml.h" // The goal of the seperate error file is to make the first // step towards localization. tinyxml (currently) only supports // english error messages, but the could now be translated. // // It also cleans up the code a bit. // const char* TiXmlBase::errorString[ TIXML_ERROR_STRING_COUNT ] = { "No error", "Error", "Failed to open file", "Memory allocation failed.", "Error parsing Element.", "Failed to read Element name", "Error reading Element value.", "Error reading Attributes.", "Error: empty tag.", "Error reading end tag.", "Error parsing Unknown.", "Error parsing Comment.", "Error parsing Declaration.", "Error document empty.", "Error null (0) or unexpected EOF found in input stream.", "Error parsing CDATA.", }; --- NEW FILE: tinystr.h --- /* www.sourceforge.net/projects/tinyxml Original file by Yves Berquin. This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ /* * THIS FILE WAS ALTERED BY Tyge Lovset, 7. April 2005. * * - completely rewritten. compact, clean, and fast implementation. * - sizeof(TiXmlString) = pointer size (4 bytes on 32-bit systems) * - fixed reserve() to work as per specification. * - fixed buggy compares operator==(), operator<(), and operator>() * - fixed operator+=() to take a const ref argument, following spec. * - added "copy" constructor with length, and most compare operators. * - added swap(), clear(), size(), capacity(), operator+(). */ #ifndef TIXML_USE_STL #ifndef TIXML_STRING_INCLUDED #define TIXML_STRING_INCLUDED #include <assert.h> #include <string.h> /* The support for explicit isn't that universal, and it isn't really required - it is used to check that the TiXmlString class isn't incorrectly used. Be nice to old compilers and macro it here: */ #if defined(_MSC_VER) && (_MSC_VER >= 1200 ) // Microsoft visual studio, version 6 and higher. #define TIXML_EXPLICIT explicit #elif defined(__GNUC__) && (__GNUC__ >= 3 ) // GCC version 3 and higher.s #define TIXML_EXPLICIT explicit #else #define TIXML_EXPLICIT #endif /* TiXmlString is an emulation of a subset of the std::string template. Its purpose is to allow compiling TinyXML on compilers with no or poor STL support. Only the member functions relevant to the TinyXML project have been implemented. The buffer allocation is made by a simplistic power of 2 like mechanism : if we increase a string and there's no more room, we allocate a buffer twice as big as we need. */ class TiXmlString { public : // The size type used typedef size_t size_type; // Error value for find primitive static const size_type npos; // = -1; // TiXmlString empty constructor TiXmlString () : rep_(&nullrep_) { } // TiXmlString copy constructor TiXmlString ( const TiXmlString & copy) { init(copy.length()); memcpy(start(), copy.data(), length()); } // TiXmlString constructor, based on a string TIXML_EXPLICIT TiXmlString ( const char * copy) { init( static_cast<size_type>( strlen(copy) )); memcpy(start(), copy, length()); } // TiXmlString constructor, based on a string TIXML_EXPLICIT TiXmlString ( const char * str, size_type len) { init(len); memcpy(start(), str, len); } // TiXmlString destructor ~TiXmlString () { quit(); } // = operator TiXmlString& operator = (const char * copy) { return assign( copy, (size_type)strlen(copy)); } // = operator TiXmlString& operator = (const TiXmlString & copy) { return assign(copy.start(), copy.length()); } // += operator. Maps to append TiXmlString& operator += (const char * suffix) { return append(suffix, static_cast<size_type>( strlen(suffix) )); } // += operator. Maps to append TiXmlString& operator += (char single) { return append(&single, 1); } // += operator. Maps to append TiXmlString& operator += (const TiXmlString & suffix) { return append(suffix.data(), suffix.length()); } // Convert a TiXmlString into a null-terminated char * const char * c_str () const { return rep_->str; } // Convert a TiXmlString into a char * (need not be null terminated). const char * data () const { return rep_->str; } // Return the length of a TiXmlString size_type length () const { return rep_->size; } // Alias for length() size_type size () const { return rep_->size; } // Checks if a TiXmlString is empty bool empty () const { return rep_->size == 0; } // Return capacity of string size_type capacity () const { return rep_->capacity; } // single char extraction const char& at (size_type index) const { assert( index < length() ); return rep_->str[ index ]; } // [] operator char& operator [] (size_type index) const { assert( index < length() ); return rep_->str[ index ]; } // find a char in a string. Return TiXmlString::npos if not found size_type find (char lookup) const { return find(lookup, 0); } // find a char in a string from an offset. Return TiXmlString::npos if not found size_type find (char tofind, size_type offset) const { if (offset >= length()) return npos; for (const char* p = c_str() + offset; *p != '\0'; ++p) { if (*p == tofind) return static_cast< size_type >( p - c_str() ); } return npos; } void clear () { //Lee: //The original was just too strange, though correct: // TiXmlString().swap(*this); //Instead use the quit & re-init: quit(); init(0,0); } /* Function to reserve a big amount of data when we know we'll need it. Be aware that this function DOES NOT clear the content of the TiXmlString if any exists. */ void reserve (size_type cap); TiXmlString& assign (const char* str, size_type len); TiXmlString& append (const char* str, size_type len); void swap (TiXmlString& other) { Rep* r = rep_; rep_ = other.rep_; other.rep_ = r; } private: void init(size_type sz) { init(sz, sz); } void set_size(size_type sz) { rep_->str[ rep_->size = sz ] = '\0'; } char* start() const { return rep_->str; } char* finish() const { return rep_->str + rep_->size; } struct Rep { size_type size, capacity; char str[1]; }; void init(size_type sz, size_type cap) { if (cap) { // Lee: the original form: // rep_ = static_cast<Rep*>(operator new(sizeof(Rep) + cap)); // doesn't work in some cases of new being overloaded. Switching // to the normal allocation, although use an 'int' for systems // that are overly picky about structure alignment. const size_type bytesNeeded = sizeof(Rep) + cap; const size_type intsNeeded = ( bytesNeeded + sizeof(int) - 1 ) / sizeof( int ); rep_ = reinterpret_cast<Rep*>( new int[ intsNeeded ] ); rep_->str[ rep_->size = sz ] = '\0'; rep_->capacity = cap; } else { rep_ = &nullrep_; } } void quit() { if (rep_ != &nullrep_) { // The rep_ is really an array of ints. (see the allocator, above). // Cast it back before delete, so the compiler won't incorrectly call destructors. delete [] ( reinterpret_cast<int*>( rep_ ) ); } } Rep * rep_; static Rep nullrep_; } ; inline bool operator == (const TiXmlString & a, const TiXmlString & b) { return ( a.length() == b.length() ) // optimization on some platforms && ( strcmp(a.c_str(), b.c_str()) == 0 ); // actual compare } inline bool operator < (const TiXmlString & a, const TiXmlString & b) { return strcmp(a.c_str(), b.c_str()) < 0; } inline bool operator != (const TiXmlString & a, const TiXmlString & b) { return !(a == b); } inline bool operator > (const TiXmlString & a, const TiXmlString & b) { return b < a; } inline bool operator <= (const TiXmlString & a, const TiXmlString & b) { return !(b < a); } inline bool operator >= (const TiXmlString & a, const TiXmlString & b) { return !(a < b); } inline bool operator == (const TiXmlString & a, const char* b) { return strcmp(a.c_str(), b) == 0; } inline bool operator == (const char* a, const TiXmlString & b) { return b == a; } inline bool operator != (const TiXmlString & a, const char* b) { return !(a == b); } inline bool operator != (const char* a, const TiXmlString & b) { return !(b == a); } TiXmlString operator + (const TiXmlString & a, const TiXmlString & b); TiXmlString operator + (const TiXmlString & a, const char* b); TiXmlString operator + (const char* a, const TiXmlString & b); /* TiXmlOutStream is an emulation of std::ostream. It is based on TiXmlString. Only the operators that we need for TinyXML have been developped. */ class TiXmlOutStream : public TiXmlString { public : // TiXmlOutStream << operator. TiXmlOutStream & operator << (const TiXmlString & in) { *this += in; return *this; } // TiXmlOutStream << operator. TiXmlOutStream & operator << (const char * in) { *this += in; return *this; } } ; #endif // TIXML_STRING_INCLUDED #endif // TIXML_USE_STL --- NEW FILE: Makefile.am --- pkglib_LTLIBRARIES = libtinyxml.la libtinyxml_la_SOURCES = \ tinystr.cpp\ tinyxml.cpp\ tinyxmlerror.cpp\ tinyxmlparser.cpp --- NEW FILE: tinyxmlparser.cpp --- /* www.sourceforge.net/projects/tinyxml Original code (2.0 and earlier )copyright (c) 2000-2002 Lee Thomason (www.grinninglizard.com) This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. [...1541 lines suppressed...] standalone = attrib.Value(); } else { // Read over whatever it is. while( p && *p && *p != '>' && !IsWhiteSpace( *p ) ) ++p; } } return 0; } bool TiXmlText::Blank() const { for ( unsigned i=0; i<value.length(); i++ ) if ( !IsWhiteSpace( value[i] ) ) return false; return true; } --- NEW FILE: tinystr.cpp --- /* www.sourceforge.net/projects/tinyxml Original file by Yves Berquin. This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ /* * THIS FILE WAS ALTERED BY Tyge Løvset, 7. April 2005. */ #ifndef TIXML_USE_STL #include "tinystr.h" // Error value for find primitive const TiXmlString::size_type TiXmlString::npos = static_cast< size_type >(-1); // Null rep. TiXmlString::Rep TiXmlString::nullrep_ = { 0, 0, '\0' }; void TiXmlString::reserve (size_type cap) { if (cap > capacity()) { TiXmlString tmp; tmp.init(length(), cap); memcpy(tmp.start(), data(), length()); swap(tmp); } } TiXmlString& TiXmlString::assign(const char* str, size_type len) { size_type cap = capacity(); if (len > cap || cap > 3*(len + 8)) { TiXmlString tmp; tmp.init(len); memcpy(tmp.start(), str, len); swap(tmp); } else { memmove(start(), str, len); set_size(len); } return *this; } TiXmlString& TiXmlString::append(const char* str, size_type len) { size_type newsize = length() + len; if (newsize > capacity()) { reserve (newsize + capacity()); } memmove(finish(), str, len); set_size(newsize); return *this; } TiXmlString operator + (const TiXmlString & a, const TiXmlString & b) { TiXmlString tmp; tmp.reserve(a.length() + b.length()); tmp += a; tmp += b; return tmp; } TiXmlString operator + (const TiXmlString & a, const char* b) { TiXmlString tmp; TiXmlString::size_type b_len = static_cast<TiXmlString::size_type>( strlen(b) ); tmp.reserve(a.length() + b_len); tmp += a; tmp.append(b, b_len); return tmp; } TiXmlString operator + (const char* a, const TiXmlString & b) { TiXmlString tmp; TiXmlString::size_type a_len = static_cast<TiXmlString::size_type>( strlen(a) ); tmp.reserve(a_len + b.length()); tmp.append(a, a_len); tmp += b; return tmp; } #endif // TIXML_USE_STL --- NEW FILE: tinyxml.h --- /* www.sourceforge.net/projects/tinyxml Original code (2.0 and earlier )copyright (c) 2000-2002 Lee Thomason (www.grinninglizard.com) This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. [...1481 lines suppressed...] /// Return the handle as a TiXmlNode. This may return null. TiXmlNode* Node() const { return node; } /// Return the handle as a TiXmlElement. This may return null. TiXmlElement* Element() const { return ( ( node && node->ToElement() ) ? node->ToElement() : 0 ); } /// Return the handle as a TiXmlText. This may return null. TiXmlText* Text() const { return ( ( node && node->ToText() ) ? node->ToText() : 0 ); } /// Return the handle as a TiXmlUnknown. This may return null; TiXmlUnknown* Unknown() const { return ( ( node && node->ToUnknown() ) ? node->ToUnknown() : 0 ); } private: TiXmlNode* node; }; #ifdef _MSC_VER #pragma warning( pop ) #endif #endif --- NEW FILE: readme.txt --- /** @mainpage <h1> TinyXml </h1> TinyXml is a simple, small, C++ XML parser that can be easily integrating into other programs. <h2> What it does. </h2> In brief, TinyXml parses an XML document, and builds from that a Document Object Model (DOM) that can be read, modified, and saved. XML stands for "eXtensible Markup Language." It allows you to create your own document markups. Where HTML does a very good job of marking documents for browsers, XML allows you to define any kind of document markup, for example a document that describes a "to do" list for an organizer application. XML is a very structured and convenient format. All those random file formats created to store application data can all be replaced with XML. One parser for everything. The best place for the complete, correct, and quite frankly hard to read spec is at <a href="http://www.w3.org/TR/2004/REC-xml-20040204/"> http://www.w3.org/TR/2004/REC-xml-20040204/</a>. An intro to XML (that I really like) can be found at <a href="http://skew.org/xml/tutorial/">http://skew.org/xml/tutorial</a>. There are different ways to access and interact with XML data. TinyXml uses a Document Object Model (DOM), meaning the XML data is parsed into a C++ objects that can be browsed and manipulated, and then written to disk or another output stream. You can also construct an XML document from scratch with C++ objects and write this to disk or another output stream. TinyXml is designed to be easy and fast to learn. It is two headers and four cpp files. Simply add these to your project and off you go. There is an example file - xmltest.cpp - to get you started. TinyXml is released under the ZLib license, so you can use it in open source or commercial code. The details of the license are at the top of every source file. TinyXml attempts to be a flexible parser, but with truly correct and compliant XML output. TinyXml should compile on any reasonably C++ compliant system. It does not rely on exceptions or RTTI. It can be compiled with or without STL support. TinyXml fully supports the UTF-8 encoding, and the first 64k character entities. <h2> What it doesn't do. </h2> It doesnt parse or use DTDs (Document Type Definitions) or XSLs (eXtensible Stylesheet Language.) There are other parsers out there (check out www.sourceforge.org, search for XML) that are much more fully featured. But they are also much bigger, take longer to set up in your project, have a higher learning curve, and often have a more restrictive license. If you are working with browsers or have more complete XML needs, TinyXml is not the parser for you. The following DTD syntax will not parse at this time in TinyXml: @verbatim <!DOCTYPE Archiv [ <!ELEMENT Comment (#PCDATA)> ]> @endverbatim because TinyXml sees this as a !DOCTYPE node with an illegally embedded !ELEMENT node. This may be addressed in the future. <h2> Tutorials. </h2> For the impatient, here is a tutorial to get you going. A great way to get started, but it is worth your time to read this (very short) manual completely. - @subpage tutorial0 <h2> Code Status. </h2> TinyXml is mature, tested code. It is very stable. If you find bugs, please file a bug report on the sourceforge web site (www.sourceforge.net/projects/tinyxml). We'll get them straightened out as soon as possible. There are some areas of improvement; please check sourceforge if you are interested in working on TinyXml. <h2> Features </h2> <h3> Using STL </h3> TinyXml can be compiled to use or not use STL. When using STL, TinyXml uses the std::string class, and fully supports std::istream, std::ostream, operator<<, and operator>>. Many API methods have both 'const char*' and 'const std::string&' forms. When STL support is compiled out, no STL files are included whatsover. All the string classes are implemented by TinyXml itself. API methods all use the 'const char*' form for input. Use the compile time #define: TIXML_USE_STL to compile one version or the other. This can be passed by the compiler, or set as the first line of "tinyxml.h". Note: If compiling the test code in Linux, setting the environment variable TINYXML_USE_STL=YES/NO will control STL compilation. In the Windows project file, STL and non STL targets are provided. In your project, its probably easiest to add the line "#define TIXML_USE_STL" as the first line of tinyxml.h. <h3> UTF-8 </h3> TinyXml supports UTF-8 allowing to manipulate XML files in any language. TinyXml also supports "legacy mode" - the encoding used before UTF-8 support and probably best described as "extended ascii". Normally, TinyXml will try to detect the correct encoding and use it. However, by setting the value of TIXML_DEFAULT_ENCODING in the header file, TinyXml can be forced to always use one encoding. TinyXml will assume Legacy Mode until one of the following occurs: <ol> <li> If the non-standard but common "UTF-8 lead bytes" (0xef 0xbb 0xbf) begin the file or data stream, TinyXml will read it as UTF-8. </li> <li> If the declaration tag is read, and it has an encoding="UTF-8", then TinyXml will read it as UTF-8. </li> <li> If the declaration tag is read, and it has no encoding specified, then TinyXml will read it as UTF-8. </li> <li> If the declaration tag is read, and it has an encoding="something else", then TinyXml will read it as Legacy Mode. In legacy mode, TinyXml will work as it did before. It's not clear what that mode does exactly, but old content should keep working.</li> <li> Until one of the above criteria is met, TinyXml runs in Legacy Mode.</li> </ol> What happens if the encoding is incorrectly set or detected? TinyXml will try to read and pass through text seen as improperly encoded. You may get some strange results or mangled characters. You may want to force TinyXml to the correct mode. <b> You may force TinyXml to Legacy Mode by using LoadFile( TIXML_ENCODING_LEGACY ) or LoadFile( filename, TIXML_ENCODING_LEGACY ). You may force it to use legacy mode all the time by setting TIXML_DEFAULT_ENCODING = TIXML_ENCODING_LEGACY. Likewise, you may force it to TIXML_ENCODING_UTF8 with the same technique.</b> For English users, using English XML, UTF-8 is the same as low-ASCII. You don't need to be aware of UTF-8 or change your code in any way. You can think of UTF-8 as a "superset" of ASCII. UTF-8 is not a double byte format - but it is a standard encoding of Unicode! TinyXml does not use or directly support wchar, TCHAR, or Microsofts _UNICODE at this time. It is common to see the term "Unicode" improperly refer to UTF-16, a wide byte encoding of unicode. This is a source of confusion. For "high-ascii" languages - everything not English, pretty much - TinyXml can handle all languages, at the same time, as long as the XML is encoded in UTF-8. That can be a little tricky, older programs and operating systems tend to use the "default" or "traditional" code page. Many apps (and almost all modern ones) can output UTF-8, but older or stubborn (or just broken) ones still output text in the default code page. For example, Japanese systems traditionally use SHIFT-JIS encoding. Text encoded as SHIFT-JIS can not be read by tinyxml. A good text editor can import SHIFT-JIS and then save as UTF-8. The <a href="http://skew.org/xml/tutorial/">Skew.org link</a> does a great job covering the encoding issue. The test file "utf8test.xml" is an XML containing English, Spanish, Russian, and Simplified Chinese. (Hopefully they are translated correctly). The file "utf8test.gif" is a screen capture of the XML file, rendered in IE. Note that if you don't have the correct fonts (Simplified Chinese or Russian) on your system, you won't see output that matches the GIF file even if you can parse it correctly. Also note that (at least on my Windows machine) console output is in a Western code page, so that Print() or printf() cannot correctly display the file. This is not a bug in TinyXml - just an OS issue. No data is lost or destroyed by TinyXml. The console just doesn't render UTF-8. <h3> Entities </h3> TinyXml recognizes the pre-defined "character entities", meaning special characters. Namely: @verbatim & & < < > > " " ' ' @endverbatim These are recognized when the XML document is read, and translated to there UTF-8 equivalents. For instance, text with the XML of: @verbatim Far & Away @endverbatim will have the Value() of "Far & Away" when queried from the TiXmlText object, and will be written back to the XML stream/file as an ampersand. Older versions of TinyXml "preserved" character entities, but the newer versions will translate them into characters. Additionally, any character can be specified by its Unicode code point: The syntax " " or " " are both to the non-breaking space characher. <h3> Streams </h3> With TIXML_USE_STL on, TiXml has been modified to support both C (FILE) and C++ (operator <<,>>) streams. There are some differences that you may need to be aware of. C style output: - based on FILE* - the Print() and SaveFile() methods Generates formatted output, with plenty of white space, intended to be as human-readable as possible. They are very fast, and tolerant of ill formed XML documents. For example, an XML document that contains 2 root elements and 2 declarations, will still print. C style input: - based on FILE* - the Parse() and LoadFile() methods A fast, tolerant read. Use whenever you don't need the C++ streams. C++ style ouput: - based on std::ostream - operator<< Generates condensed output, intended for network transmission rather than readability. Depending on your system's implementation of the ostream class, these may be somewhat slower. (Or may not.) Not tolerant of ill formed XML: a document should contain the correct one root element. Additional root level elements will not be streamed out. C++ style input: - based on std::istream - operator>> Reads XML from a stream, making it useful for network transmission. The tricky part is knowing when the XML document is complete, since there will almost certainly be other data in the stream. TinyXml will assume the XML data is complete after it reads the root element. Put another way, documents that are ill-constructed with more than one root element will not read correctly. Also note that operator>> is somewhat slower than Parse, due to both implementation of the STL and limitations of TinyXml. <h3> White space </h3> The world simply does not agree on whether white space should be kept, or condensed. For example, pretend the '_' is a space, and look at "Hello____world". HTML, and at least some XML parsers, will interpret this as "Hello_world". They condense white space. Some XML parsers do not, and will leave it as "Hello____world". (Remember to keep pretending the _ is a space.) Others suggest that __Hello___world__ should become Hello___world. It's an issue that hasn't been resolved to my satisfaction. TinyXml supports the first 2 approaches. Call TiXmlBase::SetCondenseWhiteSpace( bool ) to set the desired behavior. The default is to condense white space. If you change the default, you should call TiXmlBase::SetCondenseWhiteSpace( bool ) before making any calls to Parse XML data, and I don't recommend changing it after it has been set. <h3> Handles </h3> Where browsing an XML document in a robust way, it is important to check for null returns from method calls. An error safe implementation can generate a lot of code like: @verbatim TiXmlElement* root = document.FirstChildElement( "Document" ); if ( root ) { TiXmlElement* element = root->FirstChildElement( "Element" ); if ( element ) { TiXmlElement* child = element->FirstChildElement( "Child" ); if ( child ) { TiXmlElement* child2 = child->NextSiblingElement( "Child" ); if ( child2 ) { // Finally do something useful. @endverbatim Handles have been introduced to clean this up. Using the TiXmlHandle class, the previous code reduces to: @verbatim TiXmlHandle docHandle( &document ); TiXmlElement* child2 = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).Child( "Child", 1 ).Element(); if ( child2 ) { // do something useful @endverbatim Which is much easier to deal with. See TiXmlHandle for more information. <h3> Row and Column tracking </h3> Being able to track nodes and attributes back to their origin location in source files can be very important for some applications. Additionally, knowing where parsing errors occured in the original source can be very time saving. TinyXml can tracks the row and column origin of all nodes and attributes in a text file. The TiXmlBase::Row() and TiXmlBase::Column() methods return the origin of the node in the source text. The correct tabs can be configured in TiXmlDocument::SetTabSize(). <h2> Using and Installing </h2> To Compile and Run xmltest: A Linux Makefile and a Windows Visual C++ .dsw file is provided. Simply compile and run. It will write the file demotest.xml to your disk and generate output on the screen. It also tests walking the DOM by printing out the number of nodes found using different techniques. The Linux makefile is very generic and will probably run on other systems, but is only tested on Linux. You no longer need to run 'make depend'. The dependecies have been hard coded. <h3>Windows project file for VC6</h3> <ul> <li>tinyxml: tinyxml library, non-STL </li> <li>tinyxmlSTL: tinyxml library, STL </li> <li>tinyXmlTest: test app, non-STL </li> <li>tinyXmlTestSTL: test app, STL </li> </ul> <h3>Linux Make file</h3> At the top of the makefile you can set: PROFILE, DEBUG, and TINYXML_USE_STL. Details (such that they are) are in the makefile. In the tinyxml directory, type "make clean" then "make". The executable file 'xmltest' will be created. <h3>To Use in an Application:</h3> Add tinyxml.cpp, tinyxml.h, tinyxmlerror.cpp, tinyxmlparser.cpp, tinystr.cpp, and tinystr.h to your project or make file. That's it! It should compile on any reasonably compliant C++ system. You do not need to enable exceptions or RTTI for TinyXml. <h2> How TinyXml works. </h2> An example is probably the best way to go. Take: @verbatim <?xml version="1.0" standalone=no> <!-- Our to do list data --> <ToDo> <Item priority="1"> Go to the <bold>Toy store!</bold></Item> <Item priority="2"> Do bills</Item> </ToDo> @endverbatim Its not much of a To Do list, but it will do. To read this file (say "demo.xml") you would create a document, and parse it in: @verbatim TiXmlDocument doc( "demo.xml" ); doc.LoadFile(); @endverbatim And its ready to go. Now lets look at some lines and how they relate to the DOM. @verbatim <?xml version="1.0" standalone=no> @endverbatim The first line is a declaration, and gets turned into the TiXmlDeclaration class. It will be the first child of the document node. This is the only directive/special tag parsed by by TinyXml. Generally directive targs are stored in TiXmlUnknown so the commands wont be lost when it is saved back to disk. @verbatim <!-- Our to do list data --> @endverbatim A comment. Will become a TiXmlComment object. @verbatim <ToDo> @endverbatim The "ToDo" tag defines a TiXmlElement object. This one does not have any attributes, but does contain 2 other elements. @verbatim <Item priority="1"> @endverbatim Creates another TiXmlElement which is a child of the "ToDo" element. This element has 1 attribute, with the name "priority" and the value "1". Go to the A TiXmlText. This is a leaf node and cannot contain other nodes. It is a child of the "Item" TiXmlElement. @verbatim <bold> @endverbatim Another TiXmlElement, this one a child of the "Item" element. Etc. Looking at the entire object tree, you end up with: @verbatim TiXmlDocument "demo.xml" TiXmlDeclaration "version='1.0'" "standalone=no" TiXmlComment " Our to do list data" TiXmlElement "ToDo" TiXmlElement "Item" Attribtutes: priority = 1 TiXmlText "Go to the " TiXmlElement "bold" TiXmlText "Toy store!" TiXmlElement "Item" Attributes: priority=2 TiXmlText "Do bills" @endverbatim <h2> Documentation </h2> The documentation is build with Doxygen, using the 'dox' configuration file. <h2> License </h2> TinyXml is released under the zlib license: This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. <h2> References </h2> The World Wide Web Consortium is the definitive standard body for XML, and there web pages contain huge amounts of information. The definitive spec: <a href="http://www.w3.org/TR/2004/REC-xml-20040204/"> http://www.w3.org/TR/2004/REC-xml-20040204/</a> I also recommend "XML Pocket Reference" by Robert Eckstein and published by OReilly...the book that got the whole thing started. <h2> Contributors, Contacts, and a Brief History </h2> Thanks very much to everyone who sends suggestions, bugs, ideas, and encouragement. It all helps, and makes this project fun. A special thanks to the contributors on the web pages that keep it lively. So many people have sent in bugs and ideas, that rather than list here we try to give credit due in the "changes.txt" file. TinyXml was originally written be Lee Thomason. (Often the "I" still in the documenation.) Lee reviews changes and releases new versions, with the help of Yves Berquin and the tinyXml community. We appreciate your suggestions, and would love to know if you use TinyXml. Hopefully you will enjoy it and find it useful. Please post questions, comments, file bugs, or contact us at: www.sourceforge.net/projects/tinyxml Lee Thomason, Yves Berquin */ --- NEW FILE: tinyxml.cpp --- /* www.sourceforge.net/projects/tinyxml Original code (2.0 and earlier )copyright (c) 2000-2002 Lee Thomason (www.grinninglizard.com) This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. [...1760 lines suppressed...] } TiXmlHandle TiXmlHandle::ChildElement( const char* value, int count ) const { if ( node ) { int i; TiXmlElement* child = node->FirstChildElement( value ); for ( i=0; child && i<count; child = child->NextSiblingElement( value ), ++i ) { // nothing } if ( child ) return TiXmlHandle( child ); } return TiXmlHandle( 0 ); } |
|
From: Markus R. <rol...@us...> - 2006-01-24 19:15:05
|
Update of /cvsroot/simspark/simspark/spark/utility In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1712 Modified Files: Makefile.am Log Message: - added TinyXML parser to the utility library Index: Makefile.am =================================================================== RCS file: /cvsroot/simspark/simspark/spark/utility/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile.am 19 Dec 2005 19:13:29 -0000 1.1 --- Makefile.am 24 Jan 2006 19:14:54 -0000 1.2 *************** *** 2,4 **** libobj \ rcssnet \ ! sfsexp --- 2,6 ---- libobj \ rcssnet \ ! sfsexp\ ! tinyxml ! |
|
From: Markus R. <rol...@us...> - 2006-01-24 19:13:38
|
Update of /cvsroot/simspark/simspark/spark/utility/tinyxml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1335/tinyxml Log Message: Directory /cvsroot/simspark/simspark/spark/utility/tinyxml added to the repository |
|
From: Markus R. <rol...@us...> - 2006-01-24 18:09:08
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2014 Modified Files: property.cpp Log Message: - applied unicode compile fixes, thanks Joschka Index: property.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/property.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** property.cpp 22 Jan 2006 18:57:46 -0000 1.3 --- property.cpp 24 Jan 2006 18:08:46 -0000 1.4 *************** *** 100,104 **** void Property::GenLeafEntries(shared_ptr<Leaf> leaf, TEntryList& entries) const { ! entries.push_back(Entry(_T("GetFullPath"), leaf->GetFullPath())); } --- 100,104 ---- void Property::GenLeafEntries(shared_ptr<Leaf> leaf, TEntryList& entries) const { ! entries.push_back(Entry(_T("GetFullPath"), wxString(leaf->GetFullPath().c_str(), wxConvUTF8))); } *************** *** 118,122 **** Entry( _T("GetBundle"), ! (bundle.get() != 0) ? bundle->GetName() : _T("<None>") ) ); --- 118,122 ---- Entry( _T("GetBundle"), ! (bundle.get() != 0) ? wxString(bundle->GetName().c_str(), wxConvUTF8) : _T("<None>") ) ); *************** *** 131,135 **** ) { ! entries.push_back(Entry(_T("GetBaseClasses"), _T((*iter).c_str()))); } --- 131,135 ---- ) { ! entries.push_back(Entry(_T("GetBaseClasses"), wxString((*iter).c_str(), wxConvUTF8))); } *************** *** 143,147 **** ) { ! entries.push_back(Entry(_T("GetCommandMap"), _T((*iter).first.c_str()))); } } --- 143,147 ---- ) { ! entries.push_back(Entry(_T("GetCommandMap"), wxString((*iter).first.c_str(), wxConvUTF8))); } } *************** *** 221,225 **** } ! TClassMap::const_iterator iter = mClassMap.find(cl->GetFullPath()); if (iter != mClassMap.end()) { --- 221,225 ---- } ! TClassMap::const_iterator iter = mClassMap.find(wxString(cl->GetFullPath().c_str(), wxConvUTF8)); if (iter != mClassMap.end()) { |
|
From: Markus R. <rol...@us...> - 2006-01-22 18:57:57
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13745 Modified Files: property.cpp property.h Log Message: - added properties of Body, Joint and World Index: property.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/property.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** property.cpp 22 Jan 2006 17:25:23 -0000 1.2 --- property.cpp 22 Jan 2006 18:57:46 -0000 1.3 *************** *** 33,36 **** --- 33,40 ---- #include <oxygen/sceneserver/basenode.h> #include <oxygen/sceneserver/transform.h> + #include <oxygen/physicsserver/body.h> + #include <oxygen/physicsserver/joint.h> + #include <oxygen/physicsserver/world.h> + using namespace std; *************** *** 61,64 **** --- 65,83 ---- } + inline wxString FormatFloat(const float f) + { + return wxString::Format(_T("%.2f"),f); + } + + inline wxString FormatInt(const int i) + { + return wxString::Format(_T("%d"),i); + } + + inline wxString FormatBool(const bool b) + { + return b ? _T("true") : _T("false"); + } + Property::Property() { *************** *** 74,77 **** --- 93,99 ---- mClassMap[_T("/classes/oxygen/BaseNode")] = CL_BASENODE; mClassMap[_T("/classes/oxygen/Transform")] = CL_TRANSFORM; + mClassMap[_T("/classes/oxygen/Body")] = CL_BODY; + mClassMap[_T("/classes/oxygen/Joint")] = CL_JOINT; + mClassMap[_T("/classes/oxygen/World")] = CL_WORLD; } *************** *** 128,136 **** { shared_ptr<Transform> trans = shared_static_cast<Transform>(leaf); ! entries.push_back(Entry(_T("GetChangedMark"), wxString::Format("%d",trans->GetChangedMark()))); entries.push_back(Entry(_T("GetLocalTransform"), FormatMatrix(trans->GetLocalTransform()))); entries.push_back(Entry(_T("GetWorldTransform"), FormatMatrix(trans->GetWorldTransform()))); } void Property::GetClassList(boost::shared_ptr<Class> cl, TClassList& clList) const { --- 150,211 ---- { shared_ptr<Transform> trans = shared_static_cast<Transform>(leaf); ! entries.push_back(Entry(_T("GetChangedMark"), FormatInt(trans->GetChangedMark()))); entries.push_back(Entry(_T("GetLocalTransform"), FormatMatrix(trans->GetLocalTransform()))); entries.push_back(Entry(_T("GetWorldTransform"), FormatMatrix(trans->GetWorldTransform()))); } + void Property::GenBodyEntries(shared_ptr<Leaf> leaf, TEntryList& entries) const + { + shared_ptr<Body> body = shared_static_cast<Body>(leaf); + entries.push_back(Entry(_T("GetMass"),FormatFloat(body->GetMass()))); + entries.push_back(Entry(_T("GetVelocity"),FormatVector3(body->GetVelocity()))); + entries.push_back(Entry(_T("GetAngularVelocity"),FormatVector3(body->GetAngularVelocity()))); + entries.push_back(Entry(_T("GetPosition"),FormatVector3(body->GetPosition()))); + } + + void Property::GenJointEntries(shared_ptr<Leaf> leaf, TEntryList& entries) const + { + shared_ptr<Joint> joint = shared_static_cast<Joint>(leaf); + entries.push_back(Entry(_T("FeedBackEnabled"),FormatBool(joint->FeedBackEnabled()))); + + for (int i=0;i<2;++i) + { + wxString strIdx = _T("(") + FormatInt(i) + _T(")"); + const Joint::EBodyIndex idx = static_cast<Joint::EBodyIndex>(i); + + entries.push_back(Entry(_T("GetFeedbackForce")+strIdx,FormatVector3(joint->GetFeedbackForce(idx)))); + entries.push_back(Entry(_T("GetFeedbackTorque")+strIdx,FormatVector3(joint->GetFeedbackTorque(idx)))); + } + + for (int i=0;i<3;++i) + { + wxString strIdx = _T("(") + FormatInt(i) + _T(")"); + const Joint::EAxisIndex idx = static_cast<Joint::EAxisIndex>(i); + + entries.push_back(Entry(_T("GetBounce")+strIdx,FormatFloat(joint->GetBounce(idx)))); + entries.push_back(Entry(_T("GetLowStopDeg")+strIdx,FormatFloat(joint->GetLowStopDeg(idx)))); + entries.push_back(Entry(_T("GetHighStopDeg")+strIdx,FormatFloat(joint->GetHighStopDeg(idx)))); + entries.push_back(Entry(_T("GetLowStopPos")+strIdx,FormatFloat(joint->GetLowStopPos(idx)))); + entries.push_back(Entry(_T("GetHighStopPos")+strIdx,FormatFloat(joint->GetHighStopPos(idx)))); + entries.push_back(Entry(_T("GetCFM")+strIdx,FormatFloat(joint->GetCFM(idx)))); + entries.push_back(Entry(_T("GetStopCFM")+strIdx,FormatFloat(joint->GetStopCFM(idx)))); + entries.push_back(Entry(_T("GetSuspensionCFM")+strIdx,FormatFloat(joint->GetSuspensionCFM(idx)))); + entries.push_back(Entry(_T("GetStopERP")+strIdx,FormatFloat(joint->GetStopERP(idx)))); + entries.push_back(Entry(_T("GetSuspensionERP")+strIdx,FormatFloat(joint->GetSuspensionERP(idx)))); + entries.push_back(Entry(_T("GetLinearMotorVelocity")+strIdx,FormatFloat(joint->GetLinearMotorVelocity(idx)))); + entries.push_back(Entry(_T("GetAngularMotorVelocity")+strIdx,FormatFloat(joint->GetAngularMotorVelocity(idx)))); + entries.push_back(Entry(_T("GetMaxMotorForce")+strIdx,FormatFloat(joint->GetMaxMotorForce(idx)))); + } + } + + void Property::GenWorldEntries(shared_ptr<Leaf> leaf, TEntryList& entries) const + { + shared_ptr<World> world = shared_static_cast<World>(leaf); + entries.push_back(Entry(_T("GetGravity"),FormatVector3(world->GetGravity()))); + entries.push_back(Entry(_T("GetERP"),FormatFloat(world->GetERP()))); + entries.push_back(Entry(_T("GetCFM"),FormatFloat(world->GetCFM()))); + } + + void Property::GetClassList(boost::shared_ptr<Class> cl, TClassList& clList) const { *************** *** 223,226 **** --- 298,312 ---- GenTransformEntries(leaf, entries); break; + + case CL_BODY: + GenBodyEntries(leaf, entries); + break; + + case CL_JOINT: + GenJointEntries(leaf, entries); + break; + + case CL_WORLD: + GenWorldEntries(leaf, entries); } } Index: property.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/property.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** property.h 22 Jan 2006 17:25:23 -0000 1.2 --- property.h 22 Jan 2006 18:57:46 -0000 1.3 *************** *** 40,44 **** CL_CLASS, CL_BASENODE, ! CL_TRANSFORM }; --- 40,47 ---- CL_CLASS, CL_BASENODE, ! CL_TRANSFORM, ! CL_BODY, ! CL_JOINT, ! CL_WORLD }; *************** *** 74,77 **** --- 77,83 ---- void GenBaseNodeEntries(boost::shared_ptr<zeitgeist::Leaf> leaf, TEntryList& entries) const; void GenTransformEntries(boost::shared_ptr<zeitgeist::Leaf> leaf, TEntryList& entries) const; + void GenBodyEntries(boost::shared_ptr<zeitgeist::Leaf> leaf, TEntryList& entries) const; + void GenJointEntries(boost::shared_ptr<zeitgeist::Leaf> leaf, TEntryList& entries) const; + void GenWorldEntries(boost::shared_ptr<zeitgeist::Leaf> leaf, TEntryList& entries) const; void GetClassList(boost::shared_ptr<zeitgeist::Class> cl, TClassList& clList) const; |
|
From: Markus R. <rol...@us...> - 2006-01-22 18:57:28
|
Update of /cvsroot/simspark/simspark/spark/oxygen/physicsserver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13614 Modified Files: world.cpp world.h Log Message: - added method getgravity Index: world.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/physicsserver/world.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** world.h 5 Dec 2005 21:16:49 -0000 1.1 --- world.h 22 Jan 2006 18:57:15 -0000 1.2 *************** *** 50,53 **** --- 50,56 ---- void SetGravity(const salt::Vector3f& gravity); + /** gets the gravity vector of this world */ + salt::Vector3f GetGravity() const; + /** sets the Error Reduction Parameter of this world. The ERP specifies what proportion of a joint error will be fixed Index: world.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/physicsserver/world.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** world.cpp 5 Dec 2005 21:16:49 -0000 1.1 --- world.cpp 22 Jan 2006 18:57:14 -0000 1.2 *************** *** 53,56 **** --- 53,63 ---- } + salt::Vector3f World::GetGravity() const + { + dVector3 dGravity; + dWorldGetGravity(mODEWorld,dGravity); + return Vector3f(dGravity[0],dGravity[1],dGravity[2]); + } + void World::SetERP(float erp) { |
|
From: Markus R. <rol...@us...> - 2006-01-22 17:25:33
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8982 Modified Files: Makefile.am mainframe.cpp mainframe.h property.cpp property.h propertyframe.cpp propertyframe.h Log Message: - replaced the text control above the tree with a property list of the current selected node Index: mainframe.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/mainframe.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** mainframe.h 22 Jan 2006 12:19:28 -0000 1.6 --- mainframe.h 22 Jan 2006 17:25:23 -0000 1.7 *************** *** 22,25 **** --- 22,26 ---- #include <wx/image.h> #include "sparktree.h" + #include "propertylist.h" #ifndef MAINFRAME_H *************** *** 30,33 **** --- 31,35 ---- // begin wxGlade: ::dependencies #include <wx/splitter.h> + #include <wx/listctrl.h> #include <wx/treectrl.h> // end wxGlade *************** *** 83,86 **** --- 85,90 ---- bool CanClose(); + void InitTreeNodeProperties(); + void OnTreeItemExpanding(wxTreeEvent& event); void OnTreeSelChanged(wxTreeEvent& event); *************** *** 97,102 **** wxMenuBar* MainFrame_menubar; wxStatusBar* MainFrame_statusbar; ! wxTextCtrl* mCtrLocation; wxTreeCtrl* mCtrTree; wxPanel* mLeftPane; SparkGLCanvas* mCanvas; --- 101,109 ---- wxMenuBar* MainFrame_menubar; wxStatusBar* MainFrame_statusbar; ! wxListCtrl* mCtrPropList; ! wxPanel* mLeftTopPane; wxTreeCtrl* mCtrTree; + wxPanel* mLeftBottomPane; + wxSplitterWindow* window_1; wxPanel* mLeftPane; SparkGLCanvas* mCanvas; *************** *** 113,116 **** --- 120,124 ---- wxToolBar* mToolBar; SparkTree mSparkTree; + PropertyList mPropList; int mLastHorSashPosition; Index: propertyframe.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/propertyframe.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** propertyframe.cpp 22 Jan 2006 12:18:18 -0000 1.1 --- propertyframe.cpp 22 Jan 2006 17:25:23 -0000 1.2 *************** *** 66,142 **** { mLeaf = leaf; ! ! shared_ptr<Property> property = wxGetApp().GetProperty(); ! if (property.get() != 0) ! { ! property->GetClassList(mLeaf.lock(), mClassList); ! } ! ! InitList(); } void propertyframe::RefreshProperties() { ! if (mLeaf.expired()) ! { ! return; ! } ! ! shared_ptr<Property> property = wxGetApp().GetProperty(); ! if (property.get() == 0) ! { ! return; ! } ! ! shared_ptr<Leaf> leaf = mLeaf.lock(); ! ! Property::TEntryList entries; ! property->GenEntries(leaf, mClassList, entries); ! ! int line = 0; ! bool valRefresh = (mCtrList->GetItemCount() == entries.size()); ! ! if (valRefresh) ! { ! // just refresh values to prevent flicker ! int line = 0; ! for ( ! Property::TEntryList::const_iterator iter = entries.begin(); ! iter != entries.end(); ! ++iter ! ) ! { ! const Property::Entry& entry = (*iter); ! mCtrList->SetItem(line, 1, entry.value); ! ++line; ! } ! } else ! { ! // complete refresh ! mCtrList->DeleteAllItems(); ! ! for ( ! Property::TEntryList::const_iterator iter = entries.begin(); ! iter != entries.end(); ! ++iter ! ) ! { ! const Property::Entry& entry = (*iter); ! ! int row = mCtrList->InsertItem(line, entry.name); ! mCtrList->SetItem(row, 1, entry.value); ! ! ++line; ! } ! } ! } ! ! void propertyframe::InitList() ! { ! mCtrList->ClearAll(); ! ! mCtrList->InsertColumn(0, _T("name"), wxLIST_FORMAT_LEFT, 120); ! mCtrList->InsertColumn(1, _T("value"), wxLIST_FORMAT_LEFT, 600); ! ! RefreshProperties(); } --- 66,75 ---- { mLeaf = leaf; ! mPropList.Init(mLeaf,mCtrList); ! RefreshProperties(); } void propertyframe::RefreshProperties() { ! mPropList.Refresh(); } Index: property.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/property.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** property.h 22 Jan 2006 12:17:33 -0000 1.1 --- property.h 22 Jan 2006 17:25:23 -0000 1.2 *************** *** 18,25 **** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <list> #include <map> #include <boost/weak_ptr.hpp> - #include <wx/string.h> --- 18,27 ---- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + #ifndef PROPERTY_H__ + #define PROPERTY_H__ + #include <list> #include <map> #include <boost/weak_ptr.hpp> #include <wx/string.h> *************** *** 79,80 **** --- 81,84 ---- TClassMap mClassMap; }; + + #endif // PROPERTY_H__ Index: Makefile.am =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/Makefile.am,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Makefile.am 22 Jan 2006 12:19:28 -0000 1.4 --- Makefile.am 22 Jan 2006 17:25:23 -0000 1.5 *************** *** 25,28 **** --- 25,29 ---- inputwx.cpp\ sparktree.cpp\ + propertylist.cpp\ propertyframe.cpp\ property.cpp Index: mainframe.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/mainframe.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** mainframe.cpp 22 Jan 2006 12:19:28 -0000 1.7 --- mainframe.cpp 22 Jan 2006 17:25:23 -0000 1.8 *************** *** 72,76 **** // the default width of the tree window pane [pixel] ! static const int TREEWND_DEFAULT_WIDTH = 150; mainframe::mainframe(wxWindow* parent, int id, const wxString& title, const wxPoint& pos, const wxSize& size, long style): --- 72,76 ---- // the default width of the tree window pane [pixel] ! static const int TREEWND_DEFAULT_WIDTH = 270; mainframe::mainframe(wxWindow* parent, int id, const wxString& title, const wxPoint& pos, const wxSize& size, long style): *************** *** 85,88 **** --- 85,91 ---- mTopPane = new wxPanel(mCtrHorSplitter, -1); mLeftPane = new wxPanel(mCtrVertSplitter, -1); + window_1 = new wxSplitterWindow(mLeftPane, -1, wxDefaultPosition, wxDefaultSize, wxSP_3D|wxSP_BORDER); + mLeftBottomPane = new wxPanel(window_1, -1); + mLeftTopPane = new wxPanel(window_1, -1); MainFrame_menubar = new wxMenuBar(); SetMenuBar(MainFrame_menubar); *************** *** 99,104 **** MainFrame_menubar->Append(wxglade_tmp_menu_3, wxT("&Simulation")); MainFrame_statusbar = CreateStatusBar(1, 0); ! mCtrLocation = new wxTextCtrl(mLeftPane, -1, wxT("")); ! mCtrTree = new wxTreeCtrl(mLeftPane, 1, wxDefaultPosition, wxDefaultSize, wxTR_HAS_BUTTONS|wxTR_NO_LINES|wxTR_DEFAULT_STYLE|wxSUNKEN_BORDER); mCanvas = new SparkGLCanvas(mTopPane, -1); mCtrLog = new wxTextCtrl(mBottomPane, -1, wxT(""), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY|wxHSCROLL|wxTE_LINEWRAP); --- 102,107 ---- MainFrame_menubar->Append(wxglade_tmp_menu_3, wxT("&Simulation")); MainFrame_statusbar = CreateStatusBar(1, 0); ! mCtrPropList = new wxListCtrl(mLeftTopPane, -1, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxSUNKEN_BORDER); ! mCtrTree = new wxTreeCtrl(mLeftBottomPane, 1, wxDefaultPosition, wxDefaultSize, wxTR_HAS_BUTTONS|wxTR_NO_LINES|wxTR_DEFAULT_STYLE|wxSUNKEN_BORDER); mCanvas = new SparkGLCanvas(mTopPane, -1); mCtrLog = new wxTextCtrl(mBottomPane, -1, wxT(""), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY|wxHSCROLL|wxTE_LINEWRAP); *************** *** 130,133 **** --- 133,137 ---- // init spark tree mSparkTree.Init(mCtrTree); + InitTreeNodeProperties(); // init log wnd timer *************** *** 140,144 **** mCtrHorSplitter->SetSashPosition(mLastHorSashPosition); ! // only resize top pane, when window is resized mCtrHorSplitter->SetSashGravity(1.0); } --- 144,148 ---- mCtrHorSplitter->SetSashPosition(mLastHorSashPosition); ! mCtrHorSplitter->SetSashGravity(1.0); } *************** *** 177,182 **** wxBoxSizer* sizer_5 = new wxBoxSizer(wxVERTICAL); wxBoxSizer* sizer_7 = new wxBoxSizer(wxVERTICAL); ! sizer_7->Add(mCtrLocation, 0, wxEXPAND|wxADJUST_MINSIZE, 0); ! sizer_7->Add(mCtrTree, 1, wxEXPAND, 0); mLeftPane->SetAutoLayout(true); mLeftPane->SetSizer(sizer_7); --- 181,198 ---- wxBoxSizer* sizer_5 = new wxBoxSizer(wxVERTICAL); wxBoxSizer* sizer_7 = new wxBoxSizer(wxVERTICAL); ! wxBoxSizer* sizer_8 = new wxBoxSizer(wxHORIZONTAL); ! wxBoxSizer* sizer_4 = new wxBoxSizer(wxHORIZONTAL); ! sizer_4->Add(mCtrPropList, 1, wxEXPAND, 0); ! mLeftTopPane->SetAutoLayout(true); ! mLeftTopPane->SetSizer(sizer_4); ! sizer_4->Fit(mLeftTopPane); ! sizer_4->SetSizeHints(mLeftTopPane); ! sizer_8->Add(mCtrTree, 1, wxEXPAND, 0); ! mLeftBottomPane->SetAutoLayout(true); ! mLeftBottomPane->SetSizer(sizer_8); ! sizer_8->Fit(mLeftBottomPane); ! sizer_8->SetSizeHints(mLeftBottomPane); ! window_1->SplitHorizontally(mLeftTopPane, mLeftBottomPane); ! sizer_7->Add(window_1, 1, wxEXPAND, 0); mLeftPane->SetAutoLayout(true); mLeftPane->SetSizer(sizer_7); *************** *** 377,390 **** } void mainframe::OnTreeSelChanged(wxTreeEvent& event) { ! wxString location; ! if (! mSparkTree.GetLocation(event.GetItem(), location)) ! { ! location = _T("?"); ! } ! ! mCtrLocation->SetValue(location); } --- 393,405 ---- } + void mainframe::InitTreeNodeProperties() + { + mPropList.Init(mSparkTree.GetLeaf(mCtrTree->GetSelection()), mCtrPropList); + RefreshProperties(); + } void mainframe::OnTreeSelChanged(wxTreeEvent& event) { ! InitTreeNodeProperties(); } *************** *** 407,410 **** --- 422,427 ---- void mainframe::RefreshProperties() { + mPropList.Refresh(); + wxWindowList& children = GetChildren(); for ( Index: property.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/property.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** property.cpp 22 Jan 2006 12:17:33 -0000 1.1 --- property.cpp 22 Jan 2006 17:25:23 -0000 1.2 *************** *** 70,77 **** mClassMap.clear(); ! mClassMap["/classes/zeitgeist/Leaf"] = CL_LEAF; ! mClassMap["ClassClass"] = CL_CLASS; ! mClassMap["/classes/oxygen/BaseNode"] = CL_BASENODE; ! mClassMap["/classes/oxygen/Transform"] = CL_TRANSFORM; } --- 70,77 ---- mClassMap.clear(); ! mClassMap[_T("/classes/zeitgeist/Leaf")] = CL_LEAF; ! mClassMap[_T("ClassClass")] = CL_CLASS; ! mClassMap[_T("/classes/oxygen/BaseNode")] = CL_BASENODE; ! mClassMap[_T("/classes/oxygen/Transform")] = CL_TRANSFORM; } Index: propertyframe.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/propertyframe.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** propertyframe.h 22 Jan 2006 12:18:18 -0000 1.1 --- propertyframe.h 22 Jan 2006 17:25:23 -0000 1.2 *************** *** 32,35 **** --- 32,36 ---- #include <boost/weak_ptr.hpp> + #include "propertylist.h" namespace zeitgeist *************** *** 47,51 **** void SetLeaf(boost::weak_ptr<zeitgeist::Leaf> leaf); - void InitList(); void RefreshProperties(); --- 48,51 ---- *************** *** 62,66 **** boost::weak_ptr<zeitgeist::Leaf> mLeaf; ! Property::TClassList mClassList; }; // wxGlade: end class --- 62,66 ---- boost::weak_ptr<zeitgeist::Leaf> mLeaf; ! PropertyList mPropList; }; // wxGlade: end class |
|
From: Markus R. <rol...@us...> - 2006-01-22 17:24:53
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8880 Added Files: propertylist.h propertylist.cpp Log Message: - added class PropertyList that manages a list control that display node properties (factored out from PropertyFrame) --- NEW FILE: propertylist.cpp --- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- this file is part of rcssserver3D Fri May 9 2003 Copyright (C) 2003 Koblenz University $Id: propertylist.cpp,v 1.1 2006/01/22 17:24:45 rollmark Exp $ 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; version 2 of the License. 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "propertylist.h" #include <wx/listctrl.h> #include "main.h" //! wxWidgets and zeitgeist both use a 'DECLARE_CLASS' macro #undef DECLARE_CLASS #include <zeitgeist/leaf.h> using namespace boost; using namespace zeitgeist; PropertyList::PropertyList() { mCtrList = 0; } void PropertyList::Init(weak_ptr<Leaf> leaf, wxListCtrl* ctrList) { mLeaf.reset(); mCtrList = 0; if ( (leaf.expired()) || (ctrList == 0) ) { return; } mLeaf = leaf; mCtrList = ctrList; shared_ptr<Property> property = wxGetApp().GetProperty(); if (property.get() != 0) { property->GetClassList(mLeaf.lock(), mClassList); } mCtrList->ClearAll(); mCtrList->InsertColumn(0, _T("name"), wxLIST_FORMAT_LEFT, 120); mCtrList->InsertColumn(1, _T("value"), wxLIST_FORMAT_LEFT, 600); } void PropertyList::Refresh() { if ( (mCtrList == 0) || (mLeaf.expired()) ) { return; } shared_ptr<Property> property = wxGetApp().GetProperty(); if (property.get() == 0) { return; } Property::TEntryList entries; property->GenEntries(mLeaf.lock(), mClassList, entries); Refresh(entries); } void PropertyList::Refresh(const Property::TEntryList& entries) { if (mCtrList == 0) { return; } bool valRefresh = (mCtrList->GetItemCount() == entries.size()); if (! valRefresh) { mCtrList->DeleteAllItems(); } int line = 0; for ( Property::TEntryList::const_iterator iter = entries.begin(); iter != entries.end(); ++iter ) { const Property::Entry& entry = (*iter); if (valRefresh) { // just refresh values to prevent flicker mCtrList->SetItem(line, 1, entry.value); } else { // complete refresh int row = mCtrList->InsertItem(line, entry.name); mCtrList->SetItem(row, 1, entry.value); } ++line; } } --- NEW FILE: propertylist.h --- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- this file is part of rcssserver3D Fri May 9 2003 Copyright (C) 2003 Koblenz University $Id: propertylist.h,v 1.1 2006/01/22 17:24:45 rollmark Exp $ 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; version 2 of the License. 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef PROPERTYLIST_H__ #define PROPERTYLIST_H__ #include "property.h" class wxListCtrl; class PropertyList { public: PropertyList(); void Init(boost::weak_ptr<zeitgeist::Leaf> leaf, wxListCtrl* ctrList); void Refresh(); protected: void Refresh(boost::shared_ptr<zeitgeist::Leaf> leaf); void Refresh(const Property::TEntryList& entries); protected: wxListCtrl* mCtrList; Property::TClassList mClassList; boost::weak_ptr<zeitgeist::Leaf> mLeaf; }; #endif // PROPERTYLIST_H__ |
|
From: Markus R. <rol...@us...> - 2006-01-22 12:19:50
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6104 Modified Files: Makefile.am main.cpp main.h mainframe.cpp mainframe.h rsgedit.wxg sparktree.cpp sparktree.h Log Message: - rsgedit displays and updates a small property window, when the user double clicks on a tree item Index: main.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/main.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** main.cpp 9 Jan 2006 11:28:24 -0000 1.5 --- main.cpp 22 Jan 2006 12:19:28 -0000 1.6 *************** *** 43,46 **** --- 43,47 ---- #include "sparkglcanvas.h" #include "simspark.h" + #include "property.h" IMPLEMENT_APP(RsgEditApp) *************** *** 57,60 **** --- 58,63 ---- } + mProperty = shared_ptr<Property>(new Property); + mainframe* frame = new mainframe(NULL, wxID_ANY, _T("RsgEdit")); *************** *** 70,71 **** --- 73,79 ---- return mSpark; } + + shared_ptr<Property> RsgEditApp::GetProperty() + { + return mProperty; + } Index: mainframe.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/mainframe.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** mainframe.h 9 Jan 2006 11:28:24 -0000 1.5 --- mainframe.h 22 Jan 2006 12:19:28 -0000 1.6 *************** *** 85,92 **** --- 85,96 ---- void OnTreeItemExpanding(wxTreeEvent& event); void OnTreeSelChanged(wxTreeEvent& event); + void OnTreeItemActivated(wxTreeEvent& event); void SplitHor(); void SplitVert(); + /** refresh the contents of all open property windows */ + void RefreshProperties(); + protected: // begin wxGlade: mainframe::attributes Index: sparktree.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/sparktree.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** sparktree.cpp 21 Jan 2006 13:53:52 -0000 1.2 --- sparktree.cpp 22 Jan 2006 12:19:28 -0000 1.3 *************** *** 119,124 **** if (childClass.get() != 0) { ! label << _T(" (") ! << wxString(childClass->GetName().c_str(), wxConvUTF8) << _T(")"); } --- 119,124 ---- if (childClass.get() != 0) { ! label << _T(" (") ! << wxString(childClass->GetName().c_str(), wxConvUTF8) << _T(")"); } *************** *** 138,150 **** } ! bool SparkTree::GetLocation(const wxTreeItemId id, wxString& location) { ItemData* data = GetItemData(id); if (data == 0) { return false; } ! location = wxString(data->leaf.lock()->GetFullPath().c_str(), wxConvUTF8); return true; } --- 138,162 ---- } ! weak_ptr<Leaf> SparkTree::GetLeaf(const wxTreeItemId id) { ItemData* data = GetItemData(id); if (data == 0) { + return weak_ptr<Leaf>(); + } + + return data->leaf; + } + + bool SparkTree::GetLocation(const wxTreeItemId id, wxString& location) + { + weak_ptr<Leaf> leaf = GetLeaf(id); + + if (leaf.expired()) + { return false; } ! location = wxString(leaf.lock()->GetFullPath().c_str(), wxConvUTF8); return true; } Index: rsgedit.wxg =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/rsgedit.wxg,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** rsgedit.wxg 9 Jan 2006 11:28:24 -0000 1.3 --- rsgedit.wxg 22 Jan 2006 12:19:28 -0000 1.4 *************** *** 1,6 **** <?xml version="1.0"?> ! <!-- generated by wxGlade 0.4 on Sun Jan 8 22:39:29 2006 --> ! <application path="/home/markus/cvs/simspark/contrib/rsgedit" name="" class="" option="1" language="C++" top_window="MainFrame" encoding="UTF-8" use_gettext="0" overwrite="0" use_new_namespace="1" for_version="2.6"> <object class="mainframe" name="MainFrame" base="EditFrame"> <style>wxICONIZE|wxCAPTION|wxMINIMIZE|wxCLOSE_BOX|wxMINIMIZE_BOX|wxMAXIMIZE_BOX|wxSYSTEM_MENU|wxRESIZE_BORDER|wxCLIP_CHILDREN</style> --- 1,6 ---- <?xml version="1.0"?> ! <!-- generated by wxGlade 0.4 on Sun Jan 22 13:15:36 2006 --> ! <application path="/home/markus/cvs/simspark/contrib/rsgedit/" name="" class="" option="1" language="C++" top_window="MainFrame" encoding="UTF-8" use_gettext="0" overwrite="0" use_new_namespace="1" for_version="2.6"> <object class="mainframe" name="MainFrame" base="EditFrame"> <style>wxICONIZE|wxCAPTION|wxMINIMIZE|wxCLOSE_BOX|wxMINIMIZE_BOX|wxMAXIMIZE_BOX|wxSYSTEM_MENU|wxRESIZE_BORDER|wxCLIP_CHILDREN</style> *************** *** 8,12 **** <menubar>1</menubar> <statusbar>1</statusbar> ! <size>640, 480</size> <object class="wxMenuBar" name="MainFrame_menubar" base="EditMenuBar"> <menus> --- 8,12 ---- <menubar>1</menubar> <statusbar>1</statusbar> ! <size>815, 601</size> <object class="wxMenuBar" name="MainFrame_menubar" base="EditMenuBar"> <menus> *************** *** 17,20 **** --- 17,34 ---- </item> </menu> + <menu name="" label="&View"> + <item> + <label>message &log</label> + <id>ID_VIEW_LOG</id> + <help_str>Show/Hide message log</help_str> + <checkable>1</checkable> + </item> + <item> + <label>object &tree</label> + <id>ID_VIEW_TREE</id> + <help_str>Show/Hide object tree</help_str> + <checkable>1</checkable> + </item> + </menu> <menu name="" label="&Simulation"> <item> *************** *** 45,55 **** <style>wxSP_3D|wxSP_BORDER</style> <orientation>wxSPLIT_VERTICAL</orientation> ! <window_2>rightPane</window_2> ! <window_1>leftPane</window_1> ! <object class="wxPanel" name="leftPane" base="EditPanel"> <style>wxTAB_TRAVERSAL</style> <object class="wxBoxSizer" name="sizer_7" base="EditBoxSizer"> <orient>wxVERTICAL</orient> <object class="sizeritem"> <flag>wxEXPAND</flag> <border>0</border> --- 59,76 ---- <style>wxSP_3D|wxSP_BORDER</style> <orientation>wxSPLIT_VERTICAL</orientation> ! <window_2>mRightPane</window_2> ! <window_1>mLeftPane</window_1> ! <object class="wxPanel" name="mLeftPane" base="EditPanel"> <style>wxTAB_TRAVERSAL</style> <object class="wxBoxSizer" name="sizer_7" base="EditBoxSizer"> <orient>wxVERTICAL</orient> <object class="sizeritem"> + <flag>wxEXPAND|wxADJUST_MINSIZE</flag> + <border>0</border> + <option>0</option> + <object class="wxTextCtrl" name="mCtrLocation" base="EditTextCtrl"> + </object> + </object> + <object class="sizeritem"> <flag>wxEXPAND</flag> <border>0</border> *************** *** 62,66 **** </object> </object> ! <object class="wxPanel" name="rightPane" base="EditPanel"> <style>wxTAB_TRAVERSAL</style> <object class="wxBoxSizer" name="sizer_2" base="EditBoxSizer"> --- 83,87 ---- </object> </object> ! <object class="wxPanel" name="mRightPane" base="EditPanel"> <style>wxTAB_TRAVERSAL</style> <object class="wxBoxSizer" name="sizer_2" base="EditBoxSizer"> *************** *** 73,79 **** <style>wxSP_3D|wxSP_BORDER</style> <orientation>wxSPLIT_HORIZONTAL</orientation> ! <window_2>bottomPane</window_2> ! <window_1>topPane</window_1> ! <object class="wxPanel" name="topPane" base="EditPanel"> <style>wxTAB_TRAVERSAL</style> <object class="wxBoxSizer" name="sizer_5" base="EditBoxSizer"> --- 94,100 ---- <style>wxSP_3D|wxSP_BORDER</style> <orientation>wxSPLIT_HORIZONTAL</orientation> ! <window_2>mBottomPane</window_2> ! <window_1>mTopPane</window_1> ! <object class="wxPanel" name="mTopPane" base="EditPanel"> <style>wxTAB_TRAVERSAL</style> <object class="wxBoxSizer" name="sizer_5" base="EditBoxSizer"> *************** *** 92,96 **** </object> </object> ! <object class="wxPanel" name="bottomPane" base="EditPanel"> <style>wxTAB_TRAVERSAL</style> <object class="wxBoxSizer" name="sizer_6" base="EditBoxSizer"> --- 113,117 ---- </object> </object> ! <object class="wxPanel" name="mBottomPane" base="EditPanel"> <style>wxTAB_TRAVERSAL</style> <object class="wxBoxSizer" name="sizer_6" base="EditBoxSizer"> *************** *** 114,116 **** --- 135,153 ---- </object> </object> + <object class="propertyframe" name="Properties" base="EditFrame"> + <style>wxCAPTION|wxCLOSE_BOX|wxMINIMIZE_BOX|wxMAXIMIZE_BOX|wxSYSTEM_MENU|wxRESIZE_BORDER|wxFRAME_TOOL_WINDOW|wxFRAME_FLOAT_ON_PARENT|wxCLIP_CHILDREN</style> + <title>frame_1</title> + <size>300, 150</size> + <object class="wxBoxSizer" name="sizer_3" base="EditBoxSizer"> + <orient>wxVERTICAL</orient> + <object class="sizeritem"> + <flag>wxEXPAND</flag> + <border>0</border> + <option>1</option> + <object class="wxListCtrl" name="mCtrList" base="EditListCtrl"> + <style>wxLC_REPORT|wxSUNKEN_BORDER</style> + </object> + </object> + </object> + </object> </application> Index: Makefile.am =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/Makefile.am,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Makefile.am 9 Jan 2006 11:28:24 -0000 1.3 --- Makefile.am 22 Jan 2006 12:19:28 -0000 1.4 *************** *** 24,28 **** sparkglrender.cpp\ inputwx.cpp\ ! sparktree.cpp --- 24,32 ---- sparkglrender.cpp\ inputwx.cpp\ ! sparktree.cpp\ ! propertyframe.cpp\ ! property.cpp ! ! Index: mainframe.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/mainframe.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** mainframe.cpp 9 Jan 2006 11:28:24 -0000 1.6 --- mainframe.cpp 22 Jan 2006 12:19:28 -0000 1.7 *************** *** 22,25 **** --- 22,26 ---- #include "sparkglcanvas.h" #include "main.h" + #include "propertyframe.h" #include <rsgedit/res/xpm_play.xpm> *************** *** 55,62 **** --- 56,65 ---- EVT_TREE_ITEM_EXPANDING(1, mainframe::OnTreeItemExpanding) EVT_TREE_SEL_CHANGED(1, mainframe::OnTreeSelChanged) + EVT_TREE_ITEM_ACTIVATED(1, mainframe::OnTreeItemActivated) END_EVENT_TABLE() using namespace boost; + using namespace zeitgeist; using namespace kerosin; using namespace oxygen; *************** *** 154,158 **** // begin wxGlade: mainframe::set_properties SetTitle(wxT("RsgEdit")); ! SetSize(wxSize(640, 480)); int MainFrame_statusbar_widths[] = { 0 }; MainFrame_statusbar->SetStatusWidths(1, MainFrame_statusbar_widths); --- 157,161 ---- // begin wxGlade: mainframe::set_properties SetTitle(wxT("RsgEdit")); ! SetSize(wxSize(815, 601)); int MainFrame_statusbar_widths[] = { 0 }; MainFrame_statusbar->SetStatusWidths(1, MainFrame_statusbar_widths); *************** *** 353,356 **** --- 356,360 ---- // refresh the display + RefreshProperties(); mCanvas->Render(); *************** *** 385,388 **** --- 389,426 ---- } + void mainframe::OnTreeItemActivated(wxTreeEvent& event) + { + shared_ptr<Leaf> leaf = mSparkTree.GetLeaf(event.GetItem()).lock(); + if (leaf.get() == 0) + { + return; + } + + wxString location(leaf->GetFullPath().c_str(), wxConvUTF8); + + propertyframe* frame(new propertyframe(this, wxID_ANY, location)); + frame->SetLeaf(leaf); + frame->SetTitle(location); + frame->Show(); + } + + void mainframe::RefreshProperties() + { + wxWindowList& children = GetChildren(); + for ( + wxWindowList::Node *node = children.GetFirst(); + node != 0; + node = node->GetNext() + ) + { + propertyframe* pf = dynamic_cast<propertyframe*>(node->GetData()); + if (pf == 0) + { + continue; + } + + pf->RefreshProperties(); + } + } void mainframe::OnUpdateViewTree(wxUpdateUIEvent& event) Index: main.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/main.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** main.h 25 Dec 2005 15:06:28 -0000 1.1 --- main.h 22 Jan 2006 12:19:28 -0000 1.2 *************** *** 26,29 **** --- 26,30 ---- class SimSpark; + class Property; class RsgEditApp: public wxApp *************** *** 32,38 **** --- 33,41 ---- bool OnInit(); boost::shared_ptr<SimSpark> GetSpark(); + boost::shared_ptr<Property> GetProperty(); protected: boost::shared_ptr<SimSpark> mSpark; + boost::shared_ptr<Property> mProperty; }; Index: sparktree.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/sparktree.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** sparktree.h 16 Jan 2006 11:35:55 -0000 1.1 --- sparktree.h 22 Jan 2006 12:19:28 -0000 1.2 *************** *** 44,47 **** --- 44,49 ---- void Init(wxTreeCtrl* tree); bool CreateChildren(const wxTreeItemId id); + boost::weak_ptr<zeitgeist::Leaf> GetLeaf(const wxTreeItemId id); + bool GetLocation(const wxTreeItemId id, wxString& location); |