ns3::Rectangle Class Reference

a 2d rectangle More...

#include <rectangle.h>

List of all members.

Public Types

enum  Side { RIGHT, LEFT, TOP, BOTTOM }

Public Member Functions

 Rectangle (double _xMin, double _xMax, double _yMin, double _yMax)
 Rectangle ()
bool IsInside (const Vector &position) const
Side GetClosestSide (const Vector &position) const
Vector CalculateIntersection (const Vector &current, const Vector &speed) const

Public Attributes

double xMin
double xMax
double yMin
double yMax

Detailed Description

a 2d rectangle

Definition at line 33 of file rectangle.h.


Member Enumeration Documentation

Enumerator:
RIGHT 
LEFT 
TOP 
BOTTOM 

Definition at line 36 of file rectangle.h.


Constructor & Destructor Documentation

ns3::Rectangle::Rectangle ( double  _xMin,
double  _xMax,
double  _yMin,
double  _yMax 
)
Parameters:
_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 23 of file rectangle.cc.

References Rectangle().

ns3::Rectangle::Rectangle (  ) 

Create a zero-sized rectangle located at coordinates (0.0,0.0)

Definition at line 31 of file rectangle.cc.

Referenced by Rectangle().


Member Function Documentation

Vector ns3::Rectangle::CalculateIntersection ( const Vector current,
const Vector speed 
) const
Parameters:
current the current position
speed the current speed
Returns:
the intersection point between the rectangle and the current+speed vector.

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 80 of file rectangle.cc.

References TOP.

Referenced by ns3::RandomWalk2dMobilityModel::DoWalk(), and ns3::RandomDirection2dMobilityModel::SetDirectionAndSpeed().

Rectangle::Side ns3::Rectangle::GetClosestSide ( const Vector position  )  const
Parameters:
position the position to test.
Returns:
the side of the rectangle the input position is closest to.

This method compares only the x and y coordinates of the input position. It ignores the z coordinate.

Definition at line 47 of file rectangle.cc.

References ns3::Vector::x, xMax, xMin, ns3::Vector::y, yMax, and yMin.

Referenced by ns3::RandomWalk2dMobilityModel::Rebound(), and ns3::RandomDirection2dMobilityModel::ResetDirectionAndSpeed().

bool ns3::Rectangle::IsInside ( const Vector position  )  const
Parameters:
position the position to test.
Returns:
true if the input position is located within the rectangle, false otherwise.

This method compares only the x and y coordinates of the input position. It ignores the z coordinate.

Definition at line 39 of file rectangle.cc.

Referenced by ns3::RandomWalk2dMobilityModel::DoSetPosition(), and ns3::RandomWalk2dMobilityModel::DoWalk().


Member Data Documentation

Definition at line 88 of file rectangle.h.

Referenced by GetClosestSide(), and ns3::StaticSpeedHelper::UpdateWithBounds().

Definition at line 86 of file rectangle.h.

Referenced by GetClosestSide(), and ns3::StaticSpeedHelper::UpdateWithBounds().

Definition at line 92 of file rectangle.h.

Referenced by GetClosestSide(), and ns3::StaticSpeedHelper::UpdateWithBounds().

Definition at line 90 of file rectangle.h.

Referenced by GetClosestSide(), and ns3::StaticSpeedHelper::UpdateWithBounds().


The documentation for this class was generated from the following files:
Generated on Thu Dec 3 14:11:58 2009 for NS-3 by  doxygen 1.6.3