A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
box.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2009 Dan Broyles
4
*
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 2 as
7
* published by the Free Software Foundation;
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*
18
* Author: Dan Broyles <dbroyl01@ku.edu>
19
*/
20
#ifndef BOX_H
21
#define BOX_H
22
23
#include "ns3/attribute.h"
24
#include "ns3/attribute-helper.h"
25
#include "ns3/vector.h"
26
27
namespace
ns3 {
28
33
class
Box
34
{
35
public
:
36
enum
Side
{
37
RIGHT
,
38
LEFT
,
39
TOP
,
40
BOTTOM
,
41
UP
,
42
DOWN
43
};
54
Box
(
double
_xMin,
double
_xMax,
55
double
_yMin,
double
_yMax,
56
double
_zMin,
double
_zMax);
60
Box
();
68
bool
IsInside
(
const
Vector
&position)
const
;
75
Side
GetClosestSide
(
const
Vector
&position)
const
;
86
Vector
CalculateIntersection
(
const
Vector
¤t,
const
Vector
&speed)
const
;
87
88
/* The x coordinate of the left bound of the box */
89
double
xMin
;
90
/* The x coordinate of the right bound of the box */
91
double
xMax
;
92
/* The y coordinate of the bottom bound of the box */
93
double
yMin
;
94
/* The y coordinate of the top bound of the box */
95
double
yMax
;
96
/* The z coordinate of the down bound of the box */
97
double
zMin
;
98
/* The z coordinate of the up bound of the box */
99
double
zMax
;
100
};
101
102
std::ostream &
operator <<
(std::ostream &os,
const
Box
&box);
103
std::istream &
operator >>
(std::istream &is,
Box
&box);
104
110
ATTRIBUTE_HELPER_HEADER
(
Box
);
111
112
}
// namespace ns3
113
114
#endif
/* BOX_H */
src
mobility
model
box.h
Generated on Tue Oct 9 2012 16:45:42 for ns-3 by
1.8.1.2