draw line between nodes with net anim

112 views
Skip to first unread message

Francisco Eduardo Balart Sanchez

unread,
Jul 12, 2017, 5:44:46 PM7/12/17
to ns-3-users
Good day:

Using: ns3.25
Netanim: 3.107

I would like to know if there is a way from the test through netanim commands to draw a line between nodes (for cluster visualization purposes).
I look up on the threads and found that in 3.106 only could be done through QT commands in the animatormode.cpp
in

So, is there a way in the test to draw a line between nodes so i can be seen in net anim xml replay?
or we need to tweak the netanim 

I also saw that the snippet of code shown in the previous forum mentioned above is no longer there:
 static QGraphicsLineItem * line = 0;
      if (!line && m_currentTime > 0)
        {
          AnimNode * a = AnimNodeMgr::getInstance()->getNode(0);
          AnimNode * b = AnimNodeMgr::getInstance()->getNode(1);
          line = AnimatorScene::getInstance()->addLine(a->x(), a->y(),b->x(),b->y());
          QPen p;
          p.setColor(QColor(Qt::red));          
          line->setPen(p);
        }
      if (line && m_currentTime > 6)
        {
          line->setVisible(false);
        }
i saw a little bit in of the addLine command:
animatormode.*
and
animatorscene.*

thanks in advance and best regards

Francisco Eduardo Balart Sanchez

unread,
Aug 3, 2017, 11:25:47 AM8/3/17
to ns-3-users
God day John:

Just following up if there was any pointer on this :)

Francisco Eduardo Balart Sanchez

unread,
Aug 21, 2017, 9:57:16 PM8/21/17
to ns-3-users
Good day:

To clarify, i would like to be able to perform the function of drawing the line from the
netaniminterface found in src/netanim/model directory and not from animatormode.cpp

So when in the test i call the animationinterface this is can be done either from the test via function a call or automatically on the *.cc file

Thanks in advance and best regards

John Abraham

unread,
Aug 22, 2017, 10:15:47 AM8/22/17
to ns-3-...@googlegroups.com
Hi,

Through animationinterface there is no API provided. You might have to simulate a point to point link.

For example:

hg diff src/netanim/examples/dumbbell-animation.cc 

diff -r 1bb606297cff src/netanim/examples/dumbbell-animation.cc

--- a/src/netanim/examples/dumbbell-animation.cc Wed Jun 21 11:55:57 2017 +0300

+++ b/src/netanim/examples/dumbbell-animation.cc Tue Aug 22 07:15:06 2017 -0700

@@ -25,6 +25,7 @@

 #include "ns3/netanim-module.h"

 #include "ns3/applications-module.h"

 #include "ns3/point-to-point-layout-module.h"

+#include "ns3/point-to-point-module.h"

 

 using namespace ns3;

 

@@ -63,6 +64,8 @@

                                 nRightLeaf, pointToPointLeaf,

                                 pointToPointRouter);

 

+  PointToPointHelper h;

+  h.Install (d.GetRight(2), d.GetLeft(3));

   // Install Stack

   InternetStackHelper stack;

   d.InstallStack (stack);


--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+unsubscribe@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at https://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages