NetAnim: Remove obsolete functionalities
authorJohn Abraham <john.abraham.in@gmail.com>
Wed, 23 Apr 2014 08:30:00 -0700
changeset 10699 e2ce909f37a0
parent 10698 88c653a2840a
child 10700 159c58e203a6
NetAnim: Remove obsolete functionalities
src/netanim/examples/wireless-animation.cc
src/netanim/model/animation-interface.cc
src/netanim/model/animation-interface.h
--- a/src/netanim/examples/wireless-animation.cc	Tue Apr 22 21:42:28 2014 +0200
+++ b/src/netanim/examples/wireless-animation.cc	Wed Apr 23 08:30:00 2014 -0700
@@ -170,7 +170,6 @@
   AnimationInterface::SetNodeColor (wifiApNode, 0, 255, 0); // Optional
   AnimationInterface::SetNodeColor (wifiStaNodes, 255, 0, 0); // Optional
   AnimationInterface::SetNodeColor (csmaNodes, 0, 0, 255); // Optional
-  AnimationInterface::SetBoundary (0, 0, 35, 35); // Optional
 
   AnimationInterface anim ("wireless-animation.xml"); // Mandatory
 
--- a/src/netanim/model/animation-interface.cc	Tue Apr 22 21:42:28 2014 +0200
+++ b/src/netanim/model/animation-interface.cc	Wed Apr 23 08:30:00 2014 -0700
@@ -61,7 +61,6 @@
 std::map <uint32_t, std::string> AnimationInterface::nodeDescriptions;
 std::map <uint32_t, Rgb> AnimationInterface::nodeColors;
 std::map <P2pLinkNodeIdPair, LinkProperties, LinkPairCompare> AnimationInterface::linkProperties;
-Rectangle * AnimationInterface::userBoundary = 0;
 
 
 AnimationInterface::AnimationInterface (const std::string fn, bool enable3105, uint64_t maxPktsPerFile)
@@ -82,10 +81,6 @@
 
 AnimationInterface::~AnimationInterface ()
 {
-  if (userBoundary)
-    {
-      delete userBoundary;
-    }
   StopAnimation ();
 }
 
@@ -664,8 +659,6 @@
   
   std::ostringstream oss;
   oss << GetXMLOpen_anim (0);
-  oss << GetPreamble ();
-  oss << GetXMLOpen_topology (m_topoMinX, m_topoMinY, m_topoMaxX, m_topoMaxY);
   WriteN (oss.str (), m_f);
   NS_LOG_INFO ("Setting topology for "<<NodeList::GetNNodes ()<<" Nodes");
   // Dump the topology
@@ -748,7 +741,6 @@
     }
   if (!restart)
     {
-      WriteN (GetXMLClose ("topology"), m_f);
       Simulator::Schedule (m_mobilityPollInterval, &AnimationInterface::MobilityAutoCheck, this);
     }
   if (!restart)
@@ -1596,9 +1588,7 @@
   std::ostringstream oss; 
   if (!m_enable3105)
     {
-      oss << GetXMLOpen_topology (m_topoMinX, m_topoMinY, m_topoMaxX, m_topoMaxY);
       oss << GetXMLOpenClose_node (0, n->GetId (), v.x, v.y, nodeColors[n->GetId ()]);
-      oss << GetXMLClose ("topology");
     }
   else
     {
@@ -1629,10 +1619,6 @@
     return;
   std::vector <Ptr <Node> > MovedNodes = RecalcTopoBounds ();
   std::ostringstream oss;
-  if (!m_enable3105)
-    {
-      oss << GetXMLOpen_topology (m_topoMinX, m_topoMinY, m_topoMaxX, m_topoMaxY);
-    }
   for (uint32_t i = 0; i < MovedNodes.size (); i++)
     {
       Ptr <Node> n = MovedNodes [i];
@@ -1649,8 +1635,6 @@
     }
   if (!m_enable3105)
     {
-      oss << GetXMLClose ("topology");
-      WriteN (oss.str (), m_f);
       WriteDummyPacket ();
     }
   else
@@ -1834,22 +1818,6 @@
 
 }
 
-void AnimationInterface::SetBoundary (double minX, double minY, double maxX, double maxY)
-{
-  if (initialized)
-    NS_FATAL_ERROR ("SetBoundary must be used prior to creating the AnimationInterface object");
-  NS_ASSERT (minX < maxX);
-  NS_ASSERT (minY < maxY);
-  if (!userBoundary)
-    {
-      userBoundary = new Rectangle;
-    }
-  userBoundary->xMax = maxX;
-  userBoundary->yMax = maxY;
-  userBoundary->xMin = minX;
-  userBoundary->yMin = minY;
-}
-
 void AnimationInterface::UpdateNodeCounter (uint32_t nodeCounterId, uint32_t nodeId, double counter)
 {
   if (nodeCounterId > (m_nodeCounters.size ()-1))
@@ -2053,22 +2021,6 @@
   oss <<"<anim ver=\"" << GetNetAnimVersion () << "\">\n";
   return oss.str ();
 }
-std::string AnimationInterface::GetXMLOpen_topology (double minX, double minY, double maxX, double maxY)
-{
-  if (userBoundary)
-    {
-      minX = userBoundary->xMin;
-      minY = userBoundary->yMin;
-      maxX = userBoundary->xMax;
-      maxY = userBoundary->yMax;
-    }
-  std::ostringstream oss;
-  oss << "<topology minX = \"" << minX << "\" minY = \"" << minY
-      << "\" maxX = \"" << maxX << "\" maxY = \"" << maxY
-      << "\">" << std::endl;
-  return oss.str ();
-
-}
 
 std::string AnimationInterface::GetXMLOpenClose_nodeupdate (uint32_t id, bool visible)
 {
--- a/src/netanim/model/animation-interface.h	Tue Apr 22 21:42:28 2014 +0200
+++ b/src/netanim/model/animation-interface.h	Wed Apr 23 08:30:00 2014 -0700
@@ -241,16 +241,6 @@
   static void SetConstantPosition (Ptr <Node> n, double x, double y, double z=0);
 
   /**
-   * \brief Helper function to set the topology boundary rectangle
-   * \param minX X value of the lower left corner
-   * \param minY Y value of the lower left corner
-   * \param maxX X value of the upper right corner
-   * \param maxY Y value of the upper right corner
-   *
-   */
-  static void SetBoundary (double minX, double minY, double maxX, double maxY);
-
-  /**
    * \brief Helper function to set a brief description for a given node
    * \param n Ptr to the node
    * \param descr A string to briefly describe the node
@@ -724,7 +714,6 @@
   double m_topoMinY;
   double m_topoMaxX;
   double m_topoMaxY;
-  static Rectangle * userBoundary;
 
   bool m_enable3105;
   bool m_trackPackets;