[ns] How to get the Nodes' coordinate from TCL to C++
mmm59 at aub.edu.lb
Thu Jan 22 01:48:05 PST 2009
Thanks for the reply.
You said getting the coordinates from the TCL file easier... i have
them stored in a topography.tcl file (or so i recall) that has the X Y
Z coordinates of each sensor.
So what's the way to get them from the TCL file directly to be used in C++ ??
Quoting Waleed Tuffaha <tuffaha at gmail.com>:
> Hello Mathiew,
> ( Note that I didn't test this ! )
> The "Node class" uses a "Location class" in which the X,Y,Z variables are
> defined. The "mobilenode class" inherits from the node class.
> So, if node_ is a pointer to a mobilenode, then you should be able to get
> the coordinates using:
> int x,y,z;
> node_->location_->getLocation(&x, &y, &z)
> So if you have an array containing pointers to all the nodes then you can
> loop on the array and get the coordinates for each node.
> I think that getting the coordinates from Tcl is easier, but I don't know
> what exactly you are doing.
> Hope this helps
> -- Waleed
> On Thu, Jan 22, 2009 at 9:59 AM, Mathiew Moussa <mmm59 at aub.edu.lb> wrote:
>> Dear NS Users,
>> Can someone please tell me how you can retrieve the coordinates of the
>> network nodes from a TCL file into C++.
>> So is their some loop or something that can be written in C++ and
>> traverses all the nodes and gets X, Y, & Z, and how is it written.
>> Hope you can help me.
More information about the Ns-users