A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
box.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2009 Dan Broyles
3
*
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation;
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
*
17
* Author: Dan Broyles <dbroyl01@ku.edu>
18
*/
19
#ifndef BOX_H
20
#define BOX_H
21
22
#include "ns3/attribute-helper.h"
23
#include "ns3/attribute.h"
24
#include "ns3/vector.h"
25
26
namespace
ns3
27
{
28
34
class
Box
35
{
36
public
:
40
enum
Side
41
{
42
RIGHT
,
43
LEFT
,
44
TOP
,
45
BOTTOM
,
46
UP
,
47
DOWN
48
};
49
60
Box
(
double
_xMin,
double
_xMax,
double
_yMin,
double
_yMax,
double
_zMin,
double
_zMax);
64
Box
();
72
bool
IsInside
(
const
Vector& position)
const
;
79
Side
GetClosestSide
(
const
Vector& position)
const
;
90
Vector
CalculateIntersection
(
const
Vector& current,
const
Vector& speed)
const
;
107
bool
IsIntersect
(
const
Vector& l1,
const
Vector& l2)
const
;
108
110
double
xMin
;
112
double
xMax
;
114
double
yMin
;
116
double
yMax
;
118
double
zMin
;
120
double
zMax
;
121
};
122
123
std::ostream&
operator<<
(std::ostream& os,
const
Box
& box);
124
std::istream&
operator>>
(std::istream& is,
Box
& box);
125
126
ATTRIBUTE_HELPER_HEADER
(
Box
);
127
128
}
// namespace ns3
129
130
#endif
/* BOX_H */
ns3::Box
a 3d box
Definition:
box.h:35
ns3::Box::yMax
double yMax
The y coordinate of the top bound of the box.
Definition:
box.h:116
ns3::Box::IsInside
bool IsInside(const Vector &position) const
Definition:
box.cc:54
ns3::Box::xMin
double xMin
The x coordinate of the left bound of the box.
Definition:
box.h:110
ns3::Box::Side
Side
Enum class to specify sides of a box.
Definition:
box.h:41
ns3::Box::RIGHT
@ RIGHT
Definition:
box.h:42
ns3::Box::UP
@ UP
Definition:
box.h:46
ns3::Box::DOWN
@ DOWN
Definition:
box.h:47
ns3::Box::BOTTOM
@ BOTTOM
Definition:
box.h:45
ns3::Box::LEFT
@ LEFT
Definition:
box.h:43
ns3::Box::TOP
@ TOP
Definition:
box.h:44
ns3::Box::yMin
double yMin
The y coordinate of the bottom bound of the box.
Definition:
box.h:114
ns3::Box::xMax
double xMax
The x coordinate of the right bound of the box.
Definition:
box.h:112
ns3::Box::CalculateIntersection
Vector CalculateIntersection(const Vector ¤t, const Vector &speed) const
Definition:
box.cc:108
ns3::Box::zMin
double zMin
The z coordinate of the down bound of the box.
Definition:
box.h:118
ns3::Box::IsIntersect
bool IsIntersect(const Vector &l1, const Vector &l2) const
Checks if a line-segment between position l1 and position l2 intersects a box.
Definition:
box.cc:144
ns3::Box::GetClosestSide
Side GetClosestSide(const Vector &position) const
Definition:
box.cc:61
ns3::Box::Box
Box()
Create a zero-sized box located at coordinates (0.0,0.0,0.0)
Definition:
box.cc:43
ns3::Box::zMax
double zMax
The z coordinate of the up bound of the box.
Definition:
box.h:120
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::ATTRIBUTE_HELPER_HEADER
ATTRIBUTE_HELPER_HEADER(ValueClassTest)
ns3::operator>>
std::istream & operator>>(std::istream &is, Angles &a)
Definition:
angles.cc:183
ns3::operator<<
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition:
angles.cc:159
src
mobility
model
box.h
Generated on Sun Mar 3 2024 17:11:05 for ns-3 by
1.9.1