a 3d box More...
#include "box.h"
Collaboration diagram for ns3::Box:Public Types | |
| enum | Side { RIGHT , LEFT , TOP , BOTTOM , UP , DOWN } |
| Enum class to specify sides of a box. More... | |
Public Member Functions | |
| Box () | |
| Create a zero-sized box located at coordinates (0.0,0.0,0.0) | |
| Box (double _xMin, double _xMax, double _yMin, double _yMax, double _zMin, double _zMax) | |
| Vector | CalculateIntersection (const Vector ¤t, const Vector &speed) const |
| Side | GetClosestSide (const Vector &position) const |
| bool | IsInside (const Vector &position) const |
| bool | IsIntersect (const Vector &l1, const Vector &l2) const |
| Checks if a line-segment between position l1 and position l2 intersects a box. | |
Public Attributes | |
| double | xMax |
| The x coordinate of the right bound of the box. | |
| double | xMin |
| The x coordinate of the left bound of the box. | |
| double | yMax |
| The y coordinate of the top bound of the box. | |
| double | yMin |
| The y coordinate of the bottom bound of the box. | |
| double | zMax |
| The z coordinate of the up bound of the box. | |
| double | zMin |
| The z coordinate of the down bound of the box. | |
| enum ns3::Box::Side |
| ns3::Box::Box | ( | double | _xMin, |
| double | _xMax, | ||
| double | _yMin, | ||
| double | _yMax, | ||
| double | _zMin, | ||
| double | _zMax ) |
| ns3::Box::Box | ( | ) |
| Vector ns3::Box::CalculateIntersection | ( | const Vector & | current, |
| const Vector & | speed ) const |
| current | the current position |
| speed | the current speed |
This method assumes that the current position is located inside the cube and checks for this with an assert. This method compares only the x and y coordinates of the input position and speed. It ignores the z coordinate.
Definition at line 97 of file box.cc.
References IsInside(), NS_ASSERT, xMax, xMin, yMax, and yMin.
Here is the call graph for this function:| Box::Side ns3::Box::GetClosestSide | ( | const Vector & | position | ) | const |
| bool ns3::Box::IsInside | ( | const Vector & | position | ) | const |
| position | the position to test. |
This method compares the x, y, and z coordinates of the input position.
Definition at line 43 of file box.cc.
References xMax, xMin, yMax, yMin, zMax, and zMin.
Referenced by CalculateIntersection(), ns3::RandomWalk2dOutdoorMobilityModel::CalculateIntersectionFromOutside(), and IsIntersect().
Here is the caller graph for this function:| bool ns3::Box::IsIntersect | ( | const Vector & | l1, |
| const Vector & | l2 ) const |
Checks if a line-segment between position l1 and position l2 intersects a box.
This method considers all the three coordinates, i.e., x, y, and z. This function was developed by NYU Wireless and is based on the algorithm described here http://www.3dkingdoms.com/weekly/weekly.php?a=21. Reference: Menglei Zhang, Michele Polese, Marco Mezzavilla, Sundeep Rangan, Michele Zorzi. "ns-3 Implementation of the 3GPP MIMO Channel Model for Frequency Spectrum above 6 GHz". In Proceedings of the Workshop on ns-3 (WNS3 '17). 2017.
| l1 | position |
| l2 | position |
Definition at line 133 of file box.cc.
References IsInside(), xMax, xMin, yMax, yMin, zMax, and zMin.
Here is the call graph for this function:| double ns3::Box::xMax |
The x coordinate of the right bound of the box.
Definition at line 101 of file box.h.
Referenced by Box(), Box(), FemtocellBlockAllocator::FemtocellBlockAllocator(), AreOverlapping(), BoxLineIntersectionTestCase::BuildNameString(), CalculateIntersection(), ns3::RandomWalk2dOutdoorMobilityModel::CalculateIntersectionFromOutside(), FemtocellBlockAllocator::Create(), GetClosestSide(), ns3::FixedRoomPositionAllocator::GetNext(), ns3::RandomBuildingPositionAllocator::GetNext(), ns3::RandomRoomPositionAllocator::GetNext(), ns3::SameRoomPositionAllocator::GetNext(), IsInside(), IsIntersect(), ns3::operator<<(), ns3::operator>>(), PrintGnuplottableBuildingListToFile(), and ns3::ConstantVelocityHelper::UpdateWithBounds().
| double ns3::Box::xMin |
The x coordinate of the left bound of the box.
Definition at line 99 of file box.h.
Referenced by Box(), Box(), FemtocellBlockAllocator::FemtocellBlockAllocator(), AreOverlapping(), BoxLineIntersectionTestCase::BuildNameString(), CalculateIntersection(), ns3::RandomWalk2dOutdoorMobilityModel::CalculateIntersectionFromOutside(), FemtocellBlockAllocator::Create(), ns3::FixedRoomPositionAllocator::GetNext(), ns3::RandomBuildingPositionAllocator::GetNext(), ns3::RandomRoomPositionAllocator::GetNext(), ns3::SameRoomPositionAllocator::GetNext(), IsInside(), IsIntersect(), ns3::operator<<(), ns3::operator>>(), PrintGnuplottableBuildingListToFile(), and ns3::ConstantVelocityHelper::UpdateWithBounds().
| double ns3::Box::yMax |
The y coordinate of the top bound of the box.
Definition at line 105 of file box.h.
Referenced by Box(), Box(), FemtocellBlockAllocator::FemtocellBlockAllocator(), AreOverlapping(), BoxLineIntersectionTestCase::BuildNameString(), CalculateIntersection(), ns3::RandomWalk2dOutdoorMobilityModel::CalculateIntersectionFromOutside(), FemtocellBlockAllocator::Create(), GetClosestSide(), ns3::FixedRoomPositionAllocator::GetNext(), ns3::RandomBuildingPositionAllocator::GetNext(), ns3::RandomRoomPositionAllocator::GetNext(), ns3::SameRoomPositionAllocator::GetNext(), IsInside(), IsIntersect(), ns3::operator<<(), ns3::operator>>(), PrintGnuplottableBuildingListToFile(), and ns3::ConstantVelocityHelper::UpdateWithBounds().
| double ns3::Box::yMin |
The y coordinate of the bottom bound of the box.
Definition at line 103 of file box.h.
Referenced by Box(), Box(), FemtocellBlockAllocator::FemtocellBlockAllocator(), AreOverlapping(), BoxLineIntersectionTestCase::BuildNameString(), CalculateIntersection(), ns3::RandomWalk2dOutdoorMobilityModel::CalculateIntersectionFromOutside(), FemtocellBlockAllocator::Create(), ns3::FixedRoomPositionAllocator::GetNext(), ns3::RandomBuildingPositionAllocator::GetNext(), ns3::RandomRoomPositionAllocator::GetNext(), ns3::SameRoomPositionAllocator::GetNext(), IsInside(), IsIntersect(), ns3::operator<<(), ns3::operator>>(), PrintGnuplottableBuildingListToFile(), and ns3::ConstantVelocityHelper::UpdateWithBounds().
| double ns3::Box::zMax |
The z coordinate of the up bound of the box.
Definition at line 109 of file box.h.
Referenced by Box(), Box(), BoxLineIntersectionTestCase::BuildNameString(), GetClosestSide(), ns3::FixedRoomPositionAllocator::GetNext(), ns3::RandomBuildingPositionAllocator::GetNext(), ns3::RandomRoomPositionAllocator::GetNext(), ns3::SameRoomPositionAllocator::GetNext(), IsInside(), IsIntersect(), ns3::operator<<(), ns3::operator>>(), and ns3::ConstantVelocityHelper::UpdateWithBounds().
| double ns3::Box::zMin |
The z coordinate of the down bound of the box.
Definition at line 107 of file box.h.
Referenced by Box(), Box(), BoxLineIntersectionTestCase::BuildNameString(), ns3::FixedRoomPositionAllocator::GetNext(), ns3::RandomBuildingPositionAllocator::GetNext(), ns3::RandomRoomPositionAllocator::GetNext(), ns3::SameRoomPositionAllocator::GetNext(), IsInside(), IsIntersect(), ns3::operator<<(), ns3::operator>>(), and ns3::ConstantVelocityHelper::UpdateWithBounds().