From 8647fb623c9363a87da957075b5a1a45c366b145 Mon Sep 17 00:00:00 2001 From: John Abraham Date: Thu, 22 Sep 2011 19:09:47 -0400 Subject: [PATCH] NetAnim: Remove type conversion warnings for old gccs, Remove canvaslocation refs --- src/netanim/model/animation-interface.cc | 2 +- src/netanim/model/canvas-location.cc | 62 ----------------------- src/netanim/model/canvas-location.h | 64 ------------------------ 3 files changed, 1 insertion(+), 127 deletions(-) delete mode 100644 src/netanim/model/canvas-location.cc delete mode 100644 src/netanim/model/canvas-location.h diff --git a/src/netanim/model/animation-interface.cc b/src/netanim/model/animation-interface.cc index 735578f58..65d6b8df5 100644 --- a/src/netanim/model/animation-interface.cc +++ b/src/netanim/model/animation-interface.cc @@ -193,7 +193,7 @@ Vector AnimationInterface::UpdatePosition (Ptr n) { NS_LOG_WARN ( "Node:" << n->GetId () << " Does not have a mobility model"); Vector deterministicVector (100,100,0); - Vector randomVector (UniformVariable ().GetInteger (0, topo_maxX-topo_minX), UniformVariable ().GetInteger (0,topo_maxY-topo_minY), 0); + Vector randomVector (UniformVariable (0, topo_maxX-topo_minX).GetValue (), UniformVariable (0, topo_maxY-topo_minY).GetValue (), 0); if (randomPosition) { nodeLocation[n->GetId ()] = randomVector; diff --git a/src/netanim/model/canvas-location.cc b/src/netanim/model/canvas-location.cc deleted file mode 100644 index d6f07f056..000000000 --- a/src/netanim/model/canvas-location.cc +++ /dev/null @@ -1,62 +0,0 @@ -/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ -/* - * Copyright (c) 2009 Georgia Institute of Technology - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; - * - * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Author: George Riley - */ - -#include "canvas-location.h" - -namespace ns3 { - -NS_OBJECT_ENSURE_REGISTERED (CanvasLocation); - -TypeId -CanvasLocation::GetTypeId (void) -{ - static TypeId tid = TypeId ("ns3::CanvasLocation") - .SetParent () - .AddAttribute ("Location", "The current location on the canvas.", - TypeId::ATTR_SET | TypeId::ATTR_GET, - VectorValue (Vector (0.0, 0.0, 0.0)), - MakeVectorAccessor (&CanvasLocation::SetLocation, - &CanvasLocation::GetLocation), - MakeVectorChecker ()) - ; - return tid; -} - -CanvasLocation::CanvasLocation () -{ -} - -CanvasLocation::~CanvasLocation () -{ -} - -Vector -CanvasLocation::GetLocation (void) const -{ - return m_location; -} - -void -CanvasLocation::SetLocation (const Vector &location) -{ - m_location = location; -} - -} // namespace ns3 diff --git a/src/netanim/model/canvas-location.h b/src/netanim/model/canvas-location.h deleted file mode 100644 index 4ec10385a..000000000 --- a/src/netanim/model/canvas-location.h +++ /dev/null @@ -1,64 +0,0 @@ -/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ -/* - * Copyright (c) 2009 Georgia Institute of Technology - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; - * - * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Author: George Riley - */ -#ifndef CANVAS_LOCATION_H -#define CANVAS_LOCATION_H - -#include "ns3/object.h" -#include "ns3/traced-callback.h" -#include "ns3/vector.h" - -namespace ns3 { - - -/** - * \ingroup netanim - * - * \brief Keep track of the current location of an object - * - * This can be used anytime a logical node location is needed - * (as opposed to a physical location used by the wireless PHY - * layer to calculate path loss). One potential use of - * this is by the animator to determine where to position the - * node icon on the animation display. Location units are - * arbitrary and dimensionless. In the case of use by the - * animator they dimensions are in pixels. - */ -class CanvasLocation : public Object -{ -public: - static TypeId GetTypeId (void); - CanvasLocation (); - virtual ~CanvasLocation (); - - /** - * \returns the current location - */ - Vector GetLocation (void) const; - /** - * \param location the location to set. - */ - void SetLocation (const Vector &location); -private: - Vector m_location; -}; - -} // namespace ns3 - -#endif /* CANVAS_LOCATION_H */