buildings: Remove deprecated methods
This commit is contained in:
@@ -58,50 +58,4 @@ BuildingsHelper::Install (Ptr<Node> node)
|
||||
model->AggregateObject (buildingInfo);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
BuildingsHelper::MakeMobilityModelConsistent ()
|
||||
{
|
||||
NS_LOG_FUNCTION_NOARGS ();
|
||||
for (NodeList::Iterator nit = NodeList::Begin (); nit != NodeList::End (); ++nit)
|
||||
{
|
||||
Ptr<MobilityModel> mm = (*nit)->GetObject<MobilityModel> ();
|
||||
if (mm != 0)
|
||||
{
|
||||
Ptr<MobilityBuildingInfo> bmm = mm->GetObject<MobilityBuildingInfo> ();
|
||||
NS_ABORT_MSG_UNLESS (0 != bmm, "node " << (*nit)->GetId () << " has a MobilityModel that does not have a MobilityBuildingInfo");
|
||||
bmm->MakeConsistent (mm);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
BuildingsHelper::MakeConsistent (Ptr<MobilityModel> mm)
|
||||
{
|
||||
Ptr<MobilityBuildingInfo> bmm = mm->GetObject<MobilityBuildingInfo> ();
|
||||
bool found = false;
|
||||
for (BuildingList::Iterator bit = BuildingList::Begin (); bit != BuildingList::End (); ++bit)
|
||||
{
|
||||
NS_LOG_LOGIC ("checking building " << (*bit)->GetId () << " with boundaries " << (*bit)->GetBoundaries ());
|
||||
Vector pos = mm->GetPosition ();
|
||||
if ((*bit)->IsInside (pos))
|
||||
{
|
||||
NS_LOG_LOGIC ("MobilityBuildingInfo " << bmm << " pos " << mm->GetPosition () << " falls inside building " << (*bit)->GetId ());
|
||||
NS_ABORT_MSG_UNLESS (found == false, " MobilityBuildingInfo already inside another building!");
|
||||
found = true;
|
||||
uint16_t floor = (*bit)->GetFloor (pos);
|
||||
uint16_t roomX = (*bit)->GetRoomX (pos);
|
||||
uint16_t roomY = (*bit)->GetRoomY (pos);
|
||||
bmm->SetIndoor (*bit, floor, roomX, roomY);
|
||||
}
|
||||
}
|
||||
if (!found)
|
||||
{
|
||||
NS_LOG_LOGIC ("MobilityBuildingInfo " << bmm << " pos " << mm->GetPosition () << " is outdoor");
|
||||
bmm->SetOutdoor ();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} // namespace ns3
|
||||
|
||||
@@ -48,34 +48,8 @@ public:
|
||||
* \param c the NodeContainer including the nodes to be updated
|
||||
*/
|
||||
static void Install (NodeContainer c); // for any nodes
|
||||
/**
|
||||
* \brief This method goes through the whole NodeList and, for each node in
|
||||
* the list, calls BuildingsHelper::MakeConsistent() passing to it
|
||||
* the MobilityModel of that node.
|
||||
*
|
||||
* \deprecated This method will go away in future release of ns-3.
|
||||
* A node position will be make consistent by the method \c IsInside () of
|
||||
* \c MobilityBuildingInfo class.
|
||||
*
|
||||
*/
|
||||
NS_DEPRECATED_3_31
|
||||
static void MakeMobilityModelConsistent ();
|
||||
/**
|
||||
* \brief Make the given mobility model consistent, by determining whether
|
||||
* its position falls inside any of the building in BuildingList, and
|
||||
* updating accordingly the BuildingInfo aggregated with the MobilityModel.
|
||||
*
|
||||
* \param mm the mobility model to be made consistent
|
||||
*
|
||||
* \deprecated This method will go away in future release of ns-3.
|
||||
* See instead \c MakeConsistent method of \c MobilityBuildingInfo class.
|
||||
*/
|
||||
NS_DEPRECATED
|
||||
static void MakeConsistent (Ptr<MobilityModel> mm);
|
||||
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif /* BUILDINGS_HELPER_H */
|
||||
|
||||
@@ -89,14 +89,6 @@ MobilityBuildingInfo::IsIndoor (void)
|
||||
return m_indoor;
|
||||
}
|
||||
|
||||
bool
|
||||
MobilityBuildingInfo::IsOutdoor (void)
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
bool isIndoor = IsIndoor ();
|
||||
return (!isIndoor);
|
||||
}
|
||||
|
||||
void
|
||||
MobilityBuildingInfo::SetIndoor (Ptr<Building> building, uint8_t nfloor, uint8_t nroomx, uint8_t nroomy)
|
||||
{
|
||||
|
||||
@@ -70,20 +70,6 @@ public:
|
||||
*/
|
||||
bool IsIndoor (void);
|
||||
|
||||
/**
|
||||
*
|
||||
* \brief Is outdoor function
|
||||
*
|
||||
* \return true if the MobilityBuildingInfo instance is outdoor, false otherwise
|
||||
*
|
||||
* \deprecated This method will go away in a future release of ns-3.
|
||||
* Calling \c IsIndoor () method of \c MobilityBuildingInfo class
|
||||
* will satisfy the need to determine if a node is inside or outside
|
||||
* a building.
|
||||
*/
|
||||
NS_DEPRECATED_3_31
|
||||
bool IsOutdoor (void);
|
||||
|
||||
/**
|
||||
* \brief Mark this MobilityBuildingInfo instance as indoor
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user