a 2d rectangle More...
#include <rectangle.h>
Public Types | |
enum | Side { RIGHT, LEFT, TOP, BOTTOM } |
Public Member Functions | |
Rectangle (double _xMin, double _xMax, double _yMin, double _yMax) | |
Rectangle () | |
Create a zero-sized rectangle located at coordinates (0.0,0.0) More... | |
Vector | CalculateIntersection (const Vector ¤t, const Vector &speed) const |
Side | GetClosestSide (const Vector &position) const |
bool | IsInside (const Vector &position) const |
Public Attributes | |
double | xMax |
double | xMin |
double | yMax |
double | yMin |
a 2d rectangle
Definition at line 33 of file rectangle.h.
enum ns3::Rectangle::Side |
Enumerator | |
---|---|
RIGHT | |
LEFT | |
TOP | |
BOTTOM |
Definition at line 36 of file rectangle.h.
ns3::Rectangle::Rectangle | ( | double | _xMin, |
double | _xMax, | ||
double | _yMin, | ||
double | _yMax | ||
) |
_xMin | x coordinates of left boundary. |
_xMax | x coordinates of right boundary. |
_yMin | y coordinates of bottom boundary. |
_yMax | y coordinates of top boundary. |
Create a rectangle.
Definition at line 30 of file rectangle.cc.
ns3::Rectangle::Rectangle | ( | ) |
Create a zero-sized rectangle located at coordinates (0.0,0.0)
Definition at line 39 of file rectangle.cc.
current | the current position |
speed | the current speed |
This method assumes that the current position is located inside the rectangle 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 89 of file rectangle.cc.
References IsInside(), NS_ASSERT, ns3::Vector3D::x, xMax, xMin, ns3::Vector3D::y, yMax, and yMin.
Referenced by ns3::RandomWalk2dMobilityModel::DoWalk(), and ns3::RandomDirection2dMobilityModel::SetDirectionAndSpeed().
Rectangle::Side ns3::Rectangle::GetClosestSide | ( | const Vector & | position | ) | const |
position | the position to test. |
This method compares only the x and y coordinates of the input position. It ignores the z coordinate.
Definition at line 56 of file rectangle.cc.
References BOTTOM, LEFT, RIGHT, TOP, ns3::Vector3D::x, xMax, ns3::Vector3D::y, and yMax.
Referenced by ns3::RandomWalk2dMobilityModel::Rebound(), and ns3::RandomDirection2dMobilityModel::ResetDirectionAndSpeed().
bool ns3::Rectangle::IsInside | ( | const Vector & | position | ) | const |
position | the position to test. |
This method compares only the x and y coordinates of the input position. It ignores the z coordinate.
Definition at line 48 of file rectangle.cc.
References ns3::Vector3D::x, xMax, xMin, ns3::Vector3D::y, yMax, and yMin.
Referenced by CalculateIntersection(), ns3::RandomWalk2dMobilityModel::DoSetPosition(), and ns3::RandomWalk2dMobilityModel::DoWalk().
double ns3::Rectangle::xMax |
Definition at line 87 of file rectangle.h.
Referenced by CalculateIntersection(), GetClosestSide(), ns3::AnimationInterface::GetXMLOpen_topology(), IsInside(), ns3::operator<<(), ns3::operator>>(), ns3::AnimationInterface::SetBoundary(), and ns3::ConstantVelocityHelper::UpdateWithBounds().
double ns3::Rectangle::xMin |
Definition at line 85 of file rectangle.h.
Referenced by CalculateIntersection(), ns3::AnimationInterface::GetXMLOpen_topology(), IsInside(), ns3::operator<<(), ns3::operator>>(), ns3::AnimationInterface::SetBoundary(), and ns3::ConstantVelocityHelper::UpdateWithBounds().
double ns3::Rectangle::yMax |
Definition at line 91 of file rectangle.h.
Referenced by CalculateIntersection(), GetClosestSide(), ns3::AnimationInterface::GetXMLOpen_topology(), IsInside(), ns3::operator<<(), ns3::operator>>(), ns3::AnimationInterface::SetBoundary(), and ns3::ConstantVelocityHelper::UpdateWithBounds().
double ns3::Rectangle::yMin |
Definition at line 89 of file rectangle.h.
Referenced by CalculateIntersection(), ns3::AnimationInterface::GetXMLOpen_topology(), IsInside(), ns3::operator<<(), ns3::operator>>(), ns3::AnimationInterface::SetBoundary(), and ns3::ConstantVelocityHelper::UpdateWithBounds().