A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
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
34
class
Rectangle
35
{
36
public
:
40
enum
Side
{
41
RIGHT
,
42
LEFT
,
43
TOP
,
44
BOTTOM
45
};
54
Rectangle
(
double
_xMin,
double
_xMax,
55
double
_yMin,
double
_yMax);
59
Rectangle
();
67
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
double
xMin
;
89
double
xMax
;
90
double
yMin
;
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
97
ATTRIBUTE_HELPER_HEADER
(
Rectangle
);
98
99
}
// namespace ns3
100
101
#endif
/* RECTANGLE_H */
ns3::Rectangle
a 2d rectangle
Definition:
rectangle.h:35
ns3::Rectangle::GetClosestSide
Side GetClosestSide(const Vector &position) const
Definition:
rectangle.cc:56
ns3::Rectangle::yMax
double yMax
The y coordinate of the top bound of the rectangle.
Definition:
rectangle.h:91
ns3::Rectangle::IsInside
bool IsInside(const Vector &position) const
Definition:
rectangle.cc:48
ns3::Rectangle::xMax
double xMax
The x coordinate of the right bound of the rectangle.
Definition:
rectangle.h:89
ns3::Rectangle::CalculateIntersection
Vector CalculateIntersection(const Vector ¤t, const Vector &speed) const
Definition:
rectangle.cc:177
ns3::Rectangle::Side
Side
enum for naming sides
Definition:
rectangle.h:40
ns3::Rectangle::BOTTOM
@ BOTTOM
Definition:
rectangle.h:44
ns3::Rectangle::LEFT
@ LEFT
Definition:
rectangle.h:42
ns3::Rectangle::RIGHT
@ RIGHT
Definition:
rectangle.h:41
ns3::Rectangle::TOP
@ TOP
Definition:
rectangle.h:43
ns3::Rectangle::xMin
double xMin
The x coordinate of the left bound of the rectangle.
Definition:
rectangle.h:88
ns3::Rectangle::Rectangle
Rectangle()
Create a zero-sized rectangle located at coordinates (0.0,0.0)
Definition:
rectangle.cc:39
ns3::Rectangle::yMin
double yMin
The y coordinate of the bottom bound of the rectangle.
Definition:
rectangle.h:90
ATTRIBUTE_HELPER_HEADER
#define ATTRIBUTE_HELPER_HEADER(type)
Declare the attribute value, accessor and checkers for class type
Definition:
attribute-helper.h:390
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::operator>>
std::istream & operator>>(std::istream &is, Angles &a)
Definition:
angles.cc:162
ns3::operator<<
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition:
angles.cc:139
src
mobility
model
rectangle.h
Generated on Tue Feb 6 2024 19:21:24 for ns-3 by
1.9.1