A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ns3::Box Class Reference

a 3d box More...

#include <box.h>

Public Types

enum  Side {
  RIGHT, LEFT, TOP, BOTTOM,
  UP, DOWN
}
 

Public Member Functions

 Box (double _xMin, double _xMax, double _yMin, double _yMax, double _zMin, double _zMax)
 
 Box ()
 Create a zero-sized box located at coordinates (0.0,0.0,0.0) More...
 
Vector CalculateIntersection (const Vector &current, 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
 
double zMax
 
double zMin
 

Detailed Description

a 3d box

Definition at line 33 of file box.h.

Member Enumeration Documentation

Enumerator
RIGHT 
LEFT 
TOP 
BOTTOM 
UP 
DOWN 

Definition at line 36 of file box.h.

Constructor & Destructor Documentation

ns3::Box::Box ( double  _xMin,
double  _xMax,
double  _yMin,
double  _yMax,
double  _zMin,
double  _zMax 
)
Parameters
_xMinx coordinates of left boundary.
_xMaxx coordinates of right boundary.
_yMiny coordinates of bottom boundary.
_yMaxy coordinates of top boundary.
_zMinz coordinates of down boundary.
_zMaxz coordinates of up boundary.

Create a box.

Definition at line 31 of file box.cc.

ns3::Box::Box ( )

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

Definition at line 43 of file box.cc.

Member Function Documentation

Vector ns3::Box::CalculateIntersection ( const Vector current,
const Vector speed 
) const
Parameters
currentthe current position
speedthe 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 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 110 of file box.cc.

References IsInside(), NS_ASSERT, ns3::Vector3D::x, xMax, xMin, ns3::Vector3D::y, yMax, and yMin.

+ Here is the call graph for this function:

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

This method compares the x, y, and z coordinates of the input position.

Definition at line 63 of file box.cc.

References BOTTOM, DOWN, LEFT, RIGHT, TOP, UP, ns3::Vector3D::x, xMax, ns3::Vector3D::y, yMax, ns3::Vector3D::z, and zMax.

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

This method compares the x, y, and z coordinates of the input position.

Definition at line 54 of file box.cc.

References ns3::Vector3D::x, xMax, xMin, ns3::Vector3D::y, yMax, yMin, ns3::Vector3D::z, zMax, and zMin.

Referenced by CalculateIntersection(), ns3::GaussMarkovMobilityModel::DoWalk(), and ns3::Building::IsInside().

+ Here is the caller graph for this function:

Member Data Documentation


The documentation for this class was generated from the following files: