A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
rectangle.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2007 INRIA
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: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
18
*/
19
#ifndef RECTANGLE_H
20
#define RECTANGLE_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
Rectangle
35
{
36
public
:
40
enum
Side
41
{
42
RIGHTSIDE
= 0,
43
LEFTSIDE
,
44
TOPSIDE
,
45
BOTTOMSIDE
,
46
TOPRIGHTCORNER
,
47
TOPLEFTCORNER
,
48
BOTTOMRIGHTCORNER
,
49
BOTTOMLEFTCORNER
50
};
51
60
Rectangle
(
double
_xMin,
double
_xMax,
double
_yMin,
double
_yMax);
64
Rectangle
();
72
bool
IsInside
(
const
Vector& position)
const
;
80
bool
IsOnTheBorder
(
const
Vector& position)
const
;
102
Side
GetClosestSideOrCorner
(
const
Vector& position)
const
;
113
Vector
CalculateIntersection
(
const
Vector& current,
const
Vector& speed)
const
;
114
115
double
xMin
;
116
double
xMax
;
117
double
yMin
;
118
double
yMax
;
119
};
120
121
std::ostream&
operator<<
(std::ostream& os,
const
Rectangle
& rectangle);
122
std::istream&
operator>>
(std::istream& is,
Rectangle
& rectangle);
123
std::ostream&
operator<<
(std::ostream& os,
const
Rectangle::Side
& side);
124
125
ATTRIBUTE_HELPER_HEADER
(
Rectangle
);
126
127
}
// namespace ns3
128
129
#endif
/* RECTANGLE_H */
ns3::Rectangle
a 2d rectangle
Definition:
rectangle.h:35
ns3::Rectangle::yMax
double yMax
The y coordinate of the top bound of the rectangle.
Definition:
rectangle.h:118
ns3::Rectangle::GetClosestSideOrCorner
Side GetClosestSideOrCorner(const Vector &position) const
Definition:
rectangle.cc:64
ns3::Rectangle::IsInside
bool IsInside(const Vector &position) const
Definition:
rectangle.cc:50
ns3::Rectangle::IsOnTheBorder
bool IsOnTheBorder(const Vector &position) const
Definition:
rectangle.cc:57
ns3::Rectangle::xMax
double xMax
The x coordinate of the right bound of the rectangle.
Definition:
rectangle.h:116
ns3::Rectangle::CalculateIntersection
Vector CalculateIntersection(const Vector ¤t, const Vector &speed) const
Definition:
rectangle.cc:152
ns3::Rectangle::Side
Side
enum for naming sides
Definition:
rectangle.h:41
ns3::Rectangle::BOTTOMSIDE
@ BOTTOMSIDE
Definition:
rectangle.h:45
ns3::Rectangle::TOPSIDE
@ TOPSIDE
Definition:
rectangle.h:44
ns3::Rectangle::LEFTSIDE
@ LEFTSIDE
Definition:
rectangle.h:43
ns3::Rectangle::BOTTOMLEFTCORNER
@ BOTTOMLEFTCORNER
Definition:
rectangle.h:49
ns3::Rectangle::BOTTOMRIGHTCORNER
@ BOTTOMRIGHTCORNER
Definition:
rectangle.h:48
ns3::Rectangle::TOPLEFTCORNER
@ TOPLEFTCORNER
Definition:
rectangle.h:47
ns3::Rectangle::RIGHTSIDE
@ RIGHTSIDE
Definition:
rectangle.h:42
ns3::Rectangle::TOPRIGHTCORNER
@ TOPRIGHTCORNER
Definition:
rectangle.h:46
ns3::Rectangle::xMin
double xMin
The x coordinate of the left bound of the rectangle.
Definition:
rectangle.h:115
ns3::Rectangle::Rectangle
Rectangle()
Create a zero-sized rectangle located at coordinates (0.0,0.0)
Definition:
rectangle.cc:41
ns3::Rectangle::yMin
double yMin
The y coordinate of the bottom bound of the rectangle.
Definition:
rectangle.h:117
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
rectangle.h
Generated on Sun Mar 3 2024 17:11:05 for ns-3 by
1.9.1