--- a/examples/matrix-topology/matrix-topology.cc Tue Apr 19 14:39:15 2011 +0200 +++ a/examples/matrix-topology/matrix-topology.cc Tue Apr 19 16:33:19 2011 -0700 @@ -196,10 +196,10 @@ { positionAlloc_n->Add (Vector (coord_array[m][0], coord_array[m][1], 0)); Ptr n0 = nodes.Get (m); - Ptr nLoc = n0->GetObject (); + Ptr nLoc = n0->GetObject (); if (nLoc == 0) { - nLoc = CreateObject (); + nLoc = CreateObject (); n0->AggregateObject (nLoc); } // y-coordinates are negated for correct display in NetAnim @@ -207,7 +207,7 @@ // by negating the y coordinates, we declare the reference (0,0) coordinate // to the bottom left corner Vector nVec (coord_array[m][0], -coord_array[m][1], 0); - nLoc->SetLocation (nVec); + nLoc->SetPosition (nVec); } mobility_n.SetPositionAllocator (positionAlloc_n); --- a/src/netanim/bindings/modulegen__gcc_ILP32.py Tue Apr 19 14:39:15 2011 +0200 +++ a/src/netanim/bindings/modulegen__gcc_ILP32.py Tue Apr 19 16:33:19 2011 -0700 @@ -150,10 +150,6 @@ module.add_class('AttributeInfo', import_from_module='ns.core', outer_class=root_module['ns3::TypeId']) ## attribute-list.h (module 'core'): ns3::UnsafeAttributeList [class] module.add_class('UnsafeAttributeList', import_from_module='ns.core') - ## vector.h (module 'core'): ns3::Vector2D [class] - module.add_class('Vector2D', import_from_module='ns.core') - ## vector.h (module 'core'): ns3::Vector3D [class] - module.add_class('Vector3D', import_from_module='ns.core') ## empty.h (module 'core'): ns3::empty [class] module.add_class('empty', import_from_module='ns.core') ## int64x64-double.h (module 'core'): ns3::int64x64_t [class] @@ -228,8 +224,6 @@ module.add_class('CallbackImplBase', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter >']) ## callback.h (module 'core'): ns3::CallbackValue [class] module.add_class('CallbackValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) - ## canvas-location.h (module 'netanim'): ns3::CanvasLocation [class] - module.add_class('CanvasLocation', parent=root_module['ns3::Object']) ## attribute.h (module 'core'): ns3::EmptyAttributeValue [class] module.add_class('EmptyAttributeValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) ## event-impl.h (module 'core'): ns3::EventImpl [class] @@ -296,14 +290,6 @@ module.add_class('TypeIdChecker', import_from_module='ns.core', parent=root_module['ns3::AttributeChecker']) ## type-id.h (module 'core'): ns3::TypeIdValue [class] module.add_class('TypeIdValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) - ## vector.h (module 'core'): ns3::Vector2DChecker [class] - module.add_class('Vector2DChecker', import_from_module='ns.core', parent=root_module['ns3::AttributeChecker']) - ## vector.h (module 'core'): ns3::Vector2DValue [class] - module.add_class('Vector2DValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) - ## vector.h (module 'core'): ns3::Vector3DChecker [class] - module.add_class('Vector3DChecker', import_from_module='ns.core', parent=root_module['ns3::AttributeChecker']) - ## vector.h (module 'core'): ns3::Vector3DValue [class] - module.add_class('Vector3DValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) ## address.h (module 'network'): ns3::AddressChecker [class] module.add_class('AddressChecker', import_from_module='ns.network', parent=root_module['ns3::AttributeChecker']) ## address.h (module 'network'): ns3::AddressValue [class] @@ -311,21 +297,9 @@ typehandlers.add_type_alias('void ( * ) ( std::ostream & ) *', 'ns3::LogTimePrinter') typehandlers.add_type_alias('void ( * ) ( std::ostream & ) **', 'ns3::LogTimePrinter*') typehandlers.add_type_alias('void ( * ) ( std::ostream & ) *&', 'ns3::LogTimePrinter&') - typehandlers.add_type_alias('ns3::Vector3DValue', 'ns3::VectorValue') - typehandlers.add_type_alias('ns3::Vector3DValue*', 'ns3::VectorValue*') - typehandlers.add_type_alias('ns3::Vector3DValue&', 'ns3::VectorValue&') - module.add_typedef(root_module['ns3::Vector3DValue'], 'VectorValue') typehandlers.add_type_alias('void ( * ) ( std::ostream & ) *', 'ns3::LogNodePrinter') typehandlers.add_type_alias('void ( * ) ( std::ostream & ) **', 'ns3::LogNodePrinter*') typehandlers.add_type_alias('void ( * ) ( std::ostream & ) *&', 'ns3::LogNodePrinter&') - typehandlers.add_type_alias('ns3::Vector3D', 'ns3::Vector') - typehandlers.add_type_alias('ns3::Vector3D*', 'ns3::Vector*') - typehandlers.add_type_alias('ns3::Vector3D&', 'ns3::Vector&') - module.add_typedef(root_module['ns3::Vector3D'], 'Vector') - typehandlers.add_type_alias('ns3::Vector3DChecker', 'ns3::VectorChecker') - typehandlers.add_type_alias('ns3::Vector3DChecker*', 'ns3::VectorChecker*') - typehandlers.add_type_alias('ns3::Vector3DChecker&', 'ns3::VectorChecker&') - module.add_typedef(root_module['ns3::Vector3DChecker'], 'VectorChecker') ## Register a nested module for the namespace FatalImpl @@ -393,8 +367,6 @@ register_Ns3TypeId_methods(root_module, root_module['ns3::TypeId']) register_Ns3TypeIdAttributeInfo_methods(root_module, root_module['ns3::TypeId::AttributeInfo']) register_Ns3UnsafeAttributeList_methods(root_module, root_module['ns3::UnsafeAttributeList']) - register_Ns3Vector2D_methods(root_module, root_module['ns3::Vector2D']) - register_Ns3Vector3D_methods(root_module, root_module['ns3::Vector3D']) register_Ns3Empty_methods(root_module, root_module['ns3::empty']) register_Ns3Int64x64_t_methods(root_module, root_module['ns3::int64x64_t']) register_Ns3Chunk_methods(root_module, root_module['ns3::Chunk']) @@ -427,7 +399,6 @@ register_Ns3CallbackChecker_methods(root_module, root_module['ns3::CallbackChecker']) register_Ns3CallbackImplBase_methods(root_module, root_module['ns3::CallbackImplBase']) register_Ns3CallbackValue_methods(root_module, root_module['ns3::CallbackValue']) - register_Ns3CanvasLocation_methods(root_module, root_module['ns3::CanvasLocation']) register_Ns3EmptyAttributeValue_methods(root_module, root_module['ns3::EmptyAttributeValue']) register_Ns3EventImpl_methods(root_module, root_module['ns3::EventImpl']) register_Ns3Ipv4_methods(root_module, root_module['ns3::Ipv4']) @@ -457,10 +428,6 @@ register_Ns3TimeValue_methods(root_module, root_module['ns3::TimeValue']) register_Ns3TypeIdChecker_methods(root_module, root_module['ns3::TypeIdChecker']) register_Ns3TypeIdValue_methods(root_module, root_module['ns3::TypeIdValue']) - register_Ns3Vector2DChecker_methods(root_module, root_module['ns3::Vector2DChecker']) - register_Ns3Vector2DValue_methods(root_module, root_module['ns3::Vector2DValue']) - register_Ns3Vector3DChecker_methods(root_module, root_module['ns3::Vector3DChecker']) - register_Ns3Vector3DValue_methods(root_module, root_module['ns3::Vector3DValue']) register_Ns3AddressChecker_methods(root_module, root_module['ns3::AddressChecker']) register_Ns3AddressValue_methods(root_module, root_module['ns3::AddressValue']) return @@ -3147,36 +3114,6 @@ [param('std::string', 'name'), param('ns3::AttributeValue const &', 'param')]) return -def register_Ns3Vector2D_methods(root_module, cls): - cls.add_output_stream_operator() - ## vector.h (module 'core'): ns3::Vector2D::Vector2D(ns3::Vector2D const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Vector2D const &', 'arg0')]) - ## vector.h (module 'core'): ns3::Vector2D::Vector2D(double _x, double _y) [constructor] - cls.add_constructor([param('double', '_x'), param('double', '_y')]) - ## vector.h (module 'core'): ns3::Vector2D::Vector2D() [constructor] - cls.add_constructor([]) - ## vector.h (module 'core'): ns3::Vector2D::x [variable] - cls.add_instance_attribute('x', 'double', is_const=False) - ## vector.h (module 'core'): ns3::Vector2D::y [variable] - cls.add_instance_attribute('y', 'double', is_const=False) - return - -def register_Ns3Vector3D_methods(root_module, cls): - cls.add_output_stream_operator() - ## vector.h (module 'core'): ns3::Vector3D::Vector3D(ns3::Vector3D const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Vector3D const &', 'arg0')]) - ## vector.h (module 'core'): ns3::Vector3D::Vector3D(double _x, double _y, double _z) [constructor] - cls.add_constructor([param('double', '_x'), param('double', '_y'), param('double', '_z')]) - ## vector.h (module 'core'): ns3::Vector3D::Vector3D() [constructor] - cls.add_constructor([]) - ## vector.h (module 'core'): ns3::Vector3D::x [variable] - cls.add_instance_attribute('x', 'double', is_const=False) - ## vector.h (module 'core'): ns3::Vector3D::y [variable] - cls.add_instance_attribute('y', 'double', is_const=False) - ## vector.h (module 'core'): ns3::Vector3D::z [variable] - cls.add_instance_attribute('z', 'double', is_const=False) - return - def register_Ns3Empty_methods(root_module, cls): ## empty.h (module 'core'): ns3::empty::empty() [constructor] cls.add_constructor([]) @@ -4613,27 +4550,6 @@ [param('ns3::CallbackBase', 'base')]) return -def register_Ns3CanvasLocation_methods(root_module, cls): - ## canvas-location.h (module 'netanim'): ns3::CanvasLocation::CanvasLocation(ns3::CanvasLocation const & arg0) [copy constructor] - cls.add_constructor([param('ns3::CanvasLocation const &', 'arg0')]) - ## canvas-location.h (module 'netanim'): ns3::CanvasLocation::CanvasLocation() [constructor] - cls.add_constructor([]) - ## canvas-location.h (module 'netanim'): ns3::Vector ns3::CanvasLocation::GetLocation() const [member function] - cls.add_method('GetLocation', - 'ns3::Vector', - [], - is_const=True) - ## canvas-location.h (module 'netanim'): static ns3::TypeId ns3::CanvasLocation::GetTypeId() [member function] - cls.add_method('GetTypeId', - 'ns3::TypeId', - [], - is_static=True) - ## canvas-location.h (module 'netanim'): void ns3::CanvasLocation::SetLocation(ns3::Vector const & location) [member function] - cls.add_method('SetLocation', - 'void', - [param('ns3::Vector const &', 'location')]) - return - def register_Ns3EmptyAttributeValue_methods(root_module, cls): ## attribute.h (module 'core'): ns3::EmptyAttributeValue::EmptyAttributeValue(ns3::EmptyAttributeValue const & arg0) [copy constructor] cls.add_constructor([param('ns3::EmptyAttributeValue const &', 'arg0')]) @@ -6275,86 +6191,6 @@ [param('ns3::TypeId const &', 'value')]) return -def register_Ns3Vector2DChecker_methods(root_module, cls): - ## vector.h (module 'core'): ns3::Vector2DChecker::Vector2DChecker() [constructor] - cls.add_constructor([]) - ## vector.h (module 'core'): ns3::Vector2DChecker::Vector2DChecker(ns3::Vector2DChecker const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Vector2DChecker const &', 'arg0')]) - return - -def register_Ns3Vector2DValue_methods(root_module, cls): - ## vector.h (module 'core'): ns3::Vector2DValue::Vector2DValue() [constructor] - cls.add_constructor([]) - ## vector.h (module 'core'): ns3::Vector2DValue::Vector2DValue(ns3::Vector2DValue const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Vector2DValue const &', 'arg0')]) - ## vector.h (module 'core'): ns3::Vector2DValue::Vector2DValue(ns3::Vector2D const & value) [constructor] - cls.add_constructor([param('ns3::Vector2D const &', 'value')]) - ## vector.h (module 'core'): ns3::Ptr ns3::Vector2DValue::Copy() const [member function] - cls.add_method('Copy', - 'ns3::Ptr< ns3::AttributeValue >', - [], - is_const=True, is_virtual=True) - ## vector.h (module 'core'): bool ns3::Vector2DValue::DeserializeFromString(std::string value, ns3::Ptr checker) [member function] - cls.add_method('DeserializeFromString', - 'bool', - [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], - is_virtual=True) - ## vector.h (module 'core'): ns3::Vector2D ns3::Vector2DValue::Get() const [member function] - cls.add_method('Get', - 'ns3::Vector2D', - [], - is_const=True) - ## vector.h (module 'core'): std::string ns3::Vector2DValue::SerializeToString(ns3::Ptr checker) const [member function] - cls.add_method('SerializeToString', - 'std::string', - [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], - is_const=True, is_virtual=True) - ## vector.h (module 'core'): void ns3::Vector2DValue::Set(ns3::Vector2D const & value) [member function] - cls.add_method('Set', - 'void', - [param('ns3::Vector2D const &', 'value')]) - return - -def register_Ns3Vector3DChecker_methods(root_module, cls): - ## vector.h (module 'core'): ns3::Vector3DChecker::Vector3DChecker() [constructor] - cls.add_constructor([]) - ## vector.h (module 'core'): ns3::Vector3DChecker::Vector3DChecker(ns3::Vector3DChecker const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Vector3DChecker const &', 'arg0')]) - return - -def register_Ns3Vector3DValue_methods(root_module, cls): - ## vector.h (module 'core'): ns3::Vector3DValue::Vector3DValue() [constructor] - cls.add_constructor([]) - ## vector.h (module 'core'): ns3::Vector3DValue::Vector3DValue(ns3::Vector3DValue const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Vector3DValue const &', 'arg0')]) - ## vector.h (module 'core'): ns3::Vector3DValue::Vector3DValue(ns3::Vector3D const & value) [constructor] - cls.add_constructor([param('ns3::Vector3D const &', 'value')]) - ## vector.h (module 'core'): ns3::Ptr ns3::Vector3DValue::Copy() const [member function] - cls.add_method('Copy', - 'ns3::Ptr< ns3::AttributeValue >', - [], - is_const=True, is_virtual=True) - ## vector.h (module 'core'): bool ns3::Vector3DValue::DeserializeFromString(std::string value, ns3::Ptr checker) [member function] - cls.add_method('DeserializeFromString', - 'bool', - [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], - is_virtual=True) - ## vector.h (module 'core'): ns3::Vector3D ns3::Vector3DValue::Get() const [member function] - cls.add_method('Get', - 'ns3::Vector3D', - [], - is_const=True) - ## vector.h (module 'core'): std::string ns3::Vector3DValue::SerializeToString(ns3::Ptr checker) const [member function] - cls.add_method('SerializeToString', - 'std::string', - [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], - is_const=True, is_virtual=True) - ## vector.h (module 'core'): void ns3::Vector3DValue::Set(ns3::Vector3D const & value) [member function] - cls.add_method('Set', - 'void', - [param('ns3::Vector3D const &', 'value')]) - return - def register_Ns3AddressChecker_methods(root_module, cls): ## address.h (module 'network'): ns3::AddressChecker::AddressChecker() [constructor] cls.add_constructor([]) --- a/src/netanim/helper/point-to-point-dumbbell-helper.cc Tue Apr 19 14:39:15 2011 +0200 +++ a/src/netanim/helper/point-to-point-dumbbell-helper.cc Tue Apr 19 16:33:19 2011 -0700 @@ -24,7 +24,7 @@ // ns3 includes #include "ns3/animation-interface.h" #include "ns3/point-to-point-dumbbell-helper.h" -#include "ns3/canvas-location.h" +#include "ns3/constant-position-mobility-model.h" #include "ns3/node-list.h" #include "ns3/point-to-point-net-device.h" @@ -175,25 +175,25 @@ // Place the left router Ptr lr = GetLeft (); - Ptr loc = lr->GetObject (); + Ptr loc = lr->GetObject (); if (loc == 0) { - loc = CreateObject (); + loc = CreateObject (); lr->AggregateObject (loc); } Vector lrl (ulx + xAdder, uly + yDist/2.0, 0); - loc->SetLocation (lrl); + loc->SetPosition (lrl); // Place the right router Ptr rr = GetRight (); - loc = rr->GetObject (); + loc = rr->GetObject (); if (loc == 0) { - loc = CreateObject (); + loc = CreateObject (); rr->AggregateObject (loc); } Vector rrl (ulx + xAdder * 2, uly + yDist/2.0, 0); // Right router location - loc->SetLocation (rrl); + loc->SetPosition (rrl); // Place the left leaf nodes double theta = -M_PI_2 + thetaL; @@ -209,10 +209,10 @@ } } Ptr ln = GetLeft (l); - loc = ln->GetObject (); + loc = ln->GetObject (); if (loc == 0) { - loc = CreateObject (); + loc = CreateObject (); ln->AggregateObject (loc); } Vector lnl (lrl.x - cos (theta) * xAdder, @@ -226,7 +226,7 @@ { lnl.y = lry; // Set to lower right y } - loc->SetLocation (lnl); + loc->SetPosition (lnl); theta += thetaL; } // Place the right nodes @@ -242,10 +242,10 @@ } } Ptr rn = GetRight (r); - loc = rn->GetObject (); + loc = rn->GetObject (); if (loc == 0) { - loc = CreateObject (); + loc = CreateObject (); rn->AggregateObject (loc); } Vector rnl (rrl.x + cos (theta) * xAdder, // Right node location @@ -259,7 +259,7 @@ { rnl.y = lry; // Set to lower right y } - loc->SetLocation (rnl); + loc->SetPosition (rnl); theta += thetaR; } } --- a/src/netanim/helper/point-to-point-grid-helper.cc Tue Apr 19 14:39:15 2011 +0200 +++ a/src/netanim/helper/point-to-point-grid-helper.cc Tue Apr 19 16:33:19 2011 -0700 @@ -20,7 +20,7 @@ #include "ns3/animation-interface.h" #include "ns3/internet-stack-helper.h" #include "ns3/point-to-point-helper.h" -#include "ns3/canvas-location.h" +#include "ns3/constant-position-mobility-model.h" #include "ns3/string.h" #include "ns3/vector.h" #include "ns3/log.h" @@ -160,14 +160,14 @@ for (uint32_t j = 0; j < m_xSize; ++j) { Ptr node = GetNode (i, j); - Ptr loc = node->GetObject (); + Ptr loc = node->GetObject (); if (loc ==0) { - loc = CreateObject (); + loc = CreateObject (); node->AggregateObject (loc); } Vector locVec (xLoc, yLoc, 0); - loc->SetLocation (locVec); + loc->SetPosition (locVec); xLoc += xAdder; } --- a/src/netanim/helper/point-to-point-star-helper.cc Tue Apr 19 14:39:15 2011 +0200 +++ a/src/netanim/helper/point-to-point-star-helper.cc Tue Apr 19 16:33:19 2011 -0700 @@ -20,7 +20,7 @@ // ns3 includes #include "ns3/animation-interface.h" #include "ns3/point-to-point-star-helper.h" -#include "ns3/canvas-location.h" +#include "ns3/constant-position-mobility-model.h" #include "ns3/node-list.h" #include "ns3/point-to-point-net-device.h" @@ -120,14 +120,14 @@ // Place the hub Ptr hub = m_hub.Get (0); - Ptr hubLoc = hub->GetObject (); + Ptr hubLoc = hub->GetObject (); if (hubLoc == 0) { - hubLoc = CreateObject (); + hubLoc = CreateObject (); hub->AggregateObject (hubLoc); } Vector hubVec (ulx + xDist/2.0, uly + yDist/2.0, 0); - hubLoc->SetLocation (hubVec); + hubLoc->SetPosition (hubVec); double spokeDist; if (xDist > yDist) @@ -143,16 +143,16 @@ for (uint32_t i = 0; i < m_spokes.GetN (); ++i) { Ptr spokeNode = m_spokes.Get (i); - Ptr spokeLoc = spokeNode->GetObject (); + Ptr spokeLoc = spokeNode->GetObject (); if (spokeLoc == 0) { - spokeLoc = CreateObject (); + spokeLoc = CreateObject (); spokeNode->AggregateObject (spokeLoc); } Vector spokeVec (hubVec.x + cos (theta*i) * spokeDist, hubVec.y + sin (theta*i) * spokeDist, 0); - spokeLoc->SetLocation (spokeVec); + spokeLoc->SetPosition (spokeVec); } } --- a/src/netanim/model/animation-interface.cc Tue Apr 19 14:39:15 2011 +0200 +++ a/src/netanim/model/animation-interface.cc Tue Apr 19 16:33:19 2011 -0700 @@ -36,7 +36,7 @@ #include "ns3/channel.h" #include "ns3/config.h" #include "ns3/node.h" -#include "ns3/canvas-location.h" +#include "ns3/mobility-model.h" #include "ns3/packet.h" #include "ns3/simulator.h" @@ -99,11 +99,11 @@ for (NodeList::Iterator i = NodeList::Begin (); i != NodeList::End (); ++i) { Ptr n = *i; - Ptr loc = n->GetObject (); + Ptr loc = n->GetObject (); if (loc) { // Location exists, dump it - Vector v = loc->GetLocation (); + Vector v = loc->GetPosition (); ostringstream oss; oss << "0.0 N " << n->GetId () << " " << v.x << " " << v.y << endl; --- a/src/netanim/wscript Tue Apr 19 14:39:15 2011 +0200 +++ a/src/netanim/wscript Tue Apr 19 16:33:19 2011 -0700 @@ -1,11 +1,10 @@ ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- def build(bld): - module = bld.create_ns3_module('netanim', ['internet', 'point-to-point']) + module = bld.create_ns3_module('netanim', ['internet', 'point-to-point', 'mobility']) module.includes = '.' module.source = [ 'model/animation-interface.cc', - 'model/canvas-location.cc', 'helper/point-to-point-dumbbell-helper.cc', 'helper/point-to-point-grid-helper.cc', 'helper/point-to-point-star-helper.cc', @@ -15,7 +14,6 @@ headers.module = 'netanim' headers.source = [ 'model/animation-interface.h', - 'model/canvas-location.h', 'helper/point-to-point-dumbbell-helper.h', 'helper/point-to-point-grid-helper.h', 'helper/point-to-point-star-helper.h',