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
rectangle.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2007 INRIA
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: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19
*/
20
#ifndef RECTANGLE_H
21
#define RECTANGLE_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
Rectangle
34
{
35
public
:
36
enum
Side
{
37
RIGHT
,
38
LEFT
,
39
TOP
,
40
BOTTOM
41
};
50
Rectangle
(
double
_xMin,
double
_xMax,
51
double
_yMin,
double
_yMax);
55
Rectangle
();
63
bool
IsInside
(
const
Vector
&position)
const
;
71
Side
GetClosestSide
(
const
Vector
&position)
const
;
82
Vector
CalculateIntersection
(
const
Vector
&
current
,
const
Vector
&speed)
const
;
83
84
/* The x coordinate of the left bound of the rectangle */
85
double
xMin
;
86
/* The x coordinate of the right bound of the rectangle */
87
double
xMax
;
88
/* The y coordinate of the bottom bound of the rectangle */
89
double
yMin
;
90
/* The y coordinate of the top bound of the rectangle */
91
double
yMax
;
92
};
93
94
std::ostream &
operator <<
(std::ostream &os,
const
Rectangle
&rectangle);
95
std::istream &
operator >>
(std::istream &is,
Rectangle
&rectangle);
96
103
ATTRIBUTE_HELPER_HEADER
(
Rectangle
);
104
105
}
// namespace ns3
106
107
#endif
/* RECTANGLE_H */
ns3::ATTRIBUTE_HELPER_HEADER
ATTRIBUTE_HELPER_HEADER(ObjectFactory)
ns3::operator>>
std::istream & operator>>(std::istream &is, Angles &a)
initialize a struct Angles from input
Definition:
angles.cc:49
ns3::Rectangle::CalculateIntersection
Vector CalculateIntersection(const Vector ¤t, const Vector &speed) const
Definition:
rectangle.cc:89
ns3::Rectangle::LEFT
Definition:
rectangle.h:38
ns3::Rectangle::yMax
double yMax
Definition:
rectangle.h:91
ns3::Vector3D
a 3d vector
Definition:
vector.h:31
ns3::Rectangle::xMin
double xMin
Definition:
rectangle.h:85
ns3::Rectangle::Rectangle
Rectangle()
Create a zero-sized rectangle located at coordinates (0.0,0.0)
Definition:
rectangle.cc:39
ns3::Rectangle::RIGHT
Definition:
rectangle.h:37
ns3::Rectangle::TOP
Definition:
rectangle.h:39
ns3::Rectangle::IsInside
bool IsInside(const Vector &position) const
Definition:
rectangle.cc:48
ns3::Rectangle::xMax
double xMax
Definition:
rectangle.h:87
ns3::Rectangle::Side
Side
Definition:
rectangle.h:36
ns3::Rectangle::yMin
double yMin
Definition:
rectangle.h:89
ns3::operator<<
std::ostream & operator<<(std::ostream &os, const Angles &a)
print a struct Angles to output
Definition:
angles.cc:43
current
Time current
Definition:
tcp-variants-comparison.cc:59
ns3::Rectangle::GetClosestSide
Side GetClosestSide(const Vector &position) const
Definition:
rectangle.cc:56
ns3::Rectangle::BOTTOM
Definition:
rectangle.h:40
ns3::Rectangle
a 2d rectangle
Definition:
rectangle.h:33
src
mobility
model
rectangle.h
Generated on Sat Apr 19 2014 14:07:04 for ns-3 by
1.8.6