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
vector.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 NS3_VECTOR_H
21
#define NS3_VECTOR_H
22
23
#include "
attribute.h
"
24
#include "
attribute-helper.h
"
25
26
namespace
ns3 {
27
31
class
Vector3D
32
{
33
public
:
41
Vector3D
(
double
_x,
double
_y,
double
_z);
45
Vector3D
();
49
double
x
;
53
double
y
;
57
double
z
;
58
};
59
63
class
Vector2D
64
{
65
public
:
72
Vector2D
(
double
_x,
double
_y);
76
Vector2D
();
80
double
x
;
84
double
y
;
85
};
86
92
double
CalculateDistance
(
const
Vector3D
&a,
const
Vector3D
&b);
93
99
double
CalculateDistance
(
const
Vector2D
&a,
const
Vector2D
&b);
100
109
ATTRIBUTE_HELPER_HEADER
(
Vector3D
);
110
ATTRIBUTE_HELPER_HEADER
(
Vector2D
);
111
112
std::ostream &
operator <<
(std::ostream &os,
const
Vector3D
&vector);
113
std::istream &
operator >>
(std::istream &is,
Vector3D
&vector);
114
std::ostream &
operator <<
(std::ostream &os,
const
Vector2D
&vector);
115
std::istream &
operator >>
(std::istream &is,
Vector2D
&vector);
116
117
// for compatibility with mobility models
118
typedef
Vector3D
Vector
;
119
typedef
Vector3DValue
VectorValue
;
120
typedef
Vector3DChecker
VectorChecker
;
121
ATTRIBUTE_ACCESSOR_DEFINE
(
Vector
);
122
Ptr<const AttributeChecker>
MakeVectorChecker
(
void
);
123
124
}
// namespace ns3
125
126
#endif
/* NS3_VECTOR_H */
ns3::MakeVectorChecker
Ptr< const AttributeChecker > MakeVectorChecker(void)
Definition:
vector.cc:33
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::Vector3D::x
double x
x coordinate of vector
Definition:
vector.h:49
ns3::Ptr
smart pointer class similar to boost::intrusive_ptr
Definition:
ptr.h:59
ns3::VectorChecker
Vector3DChecker VectorChecker
Definition:
vector.h:120
ns3::Vector3D
a 3d vector
Definition:
vector.h:31
ns3::Vector2D::x
double x
x coordinate of vector
Definition:
vector.h:80
ns3::Vector2D::Vector2D
Vector2D()
Create vector vector (0.0, 0.0)
Definition:
vector.cc:63
ns3::Vector2D::y
double y
y coordinate of vector
Definition:
vector.h:84
ns3::CalculateDistance
double CalculateDistance(const Vector3D &a, const Vector3D &b)
Definition:
vector.cc:71
ns3::Vector3D::Vector3D
Vector3D()
Create vector (0.0, 0.0, 0.0)
Definition:
vector.cc:48
attribute.h
ns3::Vector
Vector3D Vector
Definition:
vector.h:118
ns3::ATTRIBUTE_ACCESSOR_DEFINE
ATTRIBUTE_ACCESSOR_DEFINE(Boolean)
ns3::operator<<
std::ostream & operator<<(std::ostream &os, const Angles &a)
print a struct Angles to output
Definition:
angles.cc:43
ns3::Vector2D
a 3d vector
Definition:
vector.h:63
ns3::Vector3D::y
double y
y coordinate of vector
Definition:
vector.h:53
attribute-helper.h
ns3::Vector3DValue
hold objects of type ns3::Vector3D
ns3::Vector3D::z
double z
z coordinate of vector
Definition:
vector.h:57
ns3::VectorValue
Vector3DValue VectorValue
Definition:
vector.h:119
src
core
model
vector.h
Generated on Sat Apr 19 2014 14:06:52 for ns-3 by
1.8.6