A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
building.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
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: Marco Miozzo <marco.miozzo@cttc.es>
18
*
19
*/
20
#ifndef BUILDING_H
21
#define BUILDING_H
22
23
#include <ns3/attribute-helper.h>
24
#include <ns3/attribute.h>
25
#include <ns3/box.h>
26
#include <ns3/object.h>
27
#include <ns3/simple-ref-count.h>
28
#include <ns3/vector.h>
29
30
namespace
ns3
31
{
32
33
/**
34
* \defgroup buildings Buildings
35
*
36
* The models to define 3d buildings, associated channel models, and mobility.
37
*/
38
39
/**
40
* \ingroup buildings
41
* \brief a 3d building block
42
*/
43
class
Building
:
public
Object
44
{
45
public
:
46
/**
47
* \brief Get the type ID.
48
* \return The object TypeId.
49
*/
50
static
TypeId
GetTypeId
();
51
void
DoDispose
()
override
;
52
53
/**
54
* Building type enum
55
*/
56
enum
BuildingType_t
57
{
58
Residential
,
59
Office
,
60
Commercial
61
};
62
63
/**
64
* External building wall type enum
65
*/
66
enum
ExtWallsType_t
67
{
68
Wood
,
69
ConcreteWithWindows
,
70
ConcreteWithoutWindows
,
71
StoneBlocks
72
};
73
74
/**
75
* Construct a simple building with 1 room and 1 floor
76
*
77
* \param xMin x coordinates of left boundary.
78
* \param xMax x coordinates of right boundary.
79
* \param yMin y coordinates of bottom boundary.
80
* \param yMax y coordinates of top boundary.
81
* \param zMin z coordinates of down boundary.
82
* \param zMax z coordinates of up boundary.
83
*
84
*/
85
Building
(
double
xMin,
double
xMax,
double
yMin,
double
yMax,
double
zMin,
double
zMax);
86
87
/**
88
* Create a zero-sized building located at coordinates (0.0,0.0,0.0)
89
* and with 1 floors and 1 room.
90
*/
91
Building
();
92
93
/**
94
* Destructor
95
*
96
*/
97
~Building
()
override
;
98
99
/**
100
* \return the unique id of this Building. This unique id happens to
101
* be also the index of the Building into the BuildingList.
102
*/
103
uint32_t
GetId
()
const
;
104
105
/**
106
* Set the boundaries of the building
107
*
108
* \param box the Box defining the boundaries of the building
109
*/
110
void
SetBoundaries
(
Box
box);
111
112
/**
113
* \param t the type of building (i.e., Residential, Office, Commercial)
114
*
115
* This method allows to set building type (default is Residential)
116
*/
117
void
SetBuildingType
(
Building::BuildingType_t
t);
118
119
/**
120
* \param t the type of external walls (i.e., Wood, ConcreteWithWindows,
121
* ConcreteWithoutWindows and StoneBlocks), used for evaluating the loss
122
* due to the penetration of external walls in outdoor <-> indoor comm.
123
*
124
* This method allows to set external walls type (default is Residential)
125
*/
126
void
SetExtWallsType
(
Building::ExtWallsType_t
t);
127
128
/**
129
* \param nfloors the number of floors in the building
130
*
131
* This method allows to set the number of floors in the building
132
* (default is 1)
133
*/
134
void
SetNFloors
(uint16_t nfloors);
135
136
/**
137
* \param nroomx the number of rooms along the x axis
138
*
139
* This method allows to set the number of rooms along the x-axis
140
*/
141
void
SetNRoomsX
(uint16_t nroomx);
142
143
/**
144
* \param nroomy the number of floors in the building
145
*
146
* This method allows to set the number of rooms along the y-axis
147
*/
148
void
SetNRoomsY
(uint16_t nroomy);
149
150
/**
151
*
152
* \return the boundaries of the building
153
*/
154
Box
GetBoundaries
()
const
;
155
156
/**
157
* \return the type of building
158
*/
159
BuildingType_t
GetBuildingType
()
const
;
160
161
/**
162
* \return the type of external walls of the building
163
*/
164
ExtWallsType_t
GetExtWallsType
()
const
;
165
166
/**
167
* \return the number of floors of the building
168
*/
169
uint16_t
GetNFloors
()
const
;
170
171
/**
172
* \return the number of rooms along the x-axis of the building
173
*/
174
uint16_t
GetNRoomsX
()
const
;
175
176
/**
177
* \return the number of rooms along the y-axis
178
*/
179
uint16_t
GetNRoomsY
()
const
;
180
181
/**
182
*
183
*
184
* \param position some position
185
*
186
* \return true if the position fall inside the building, false otherwise
187
*/
188
bool
IsInside
(Vector position)
const
;
189
190
/**
191
*
192
*
193
* \param position a position inside the building
194
*
195
* \return the number of the room along the X axis where the
196
* position falls
197
*/
198
uint16_t
GetRoomX
(Vector position)
const
;
199
200
/**
201
*
202
*
203
* \param position a position inside the building
204
*
205
* \return the number of the room along the Y axis where the
206
* position falls
207
*/
208
uint16_t
GetRoomY
(Vector position)
const
;
209
210
/**
211
*
212
* \param position a position inside the building
213
*
214
* \return the floor where the position falls
215
*/
216
uint16_t
GetFloor
(Vector position)
const
;
217
/**
218
* \brief Checks if a line-segment between position l1 and position l2
219
* intersects a building.
220
*
221
* \param l1 position
222
* \param l2 position
223
* \return true if there is a intersection, false otherwise
224
*/
225
bool
IsIntersect
(
const
Vector& l1,
const
Vector& l2)
const
;
226
227
private
:
228
Box
m_buildingBounds
;
//!< Building boundaries
229
230
/**
231
* number of floors, must be greater than 0, and 1 means only one floor
232
* (i.e., groundfloor)
233
*/
234
uint16_t
m_floors
;
235
uint16_t
m_roomsX
;
//!< X Room coordinate
236
uint16_t
m_roomsY
;
//!< Y Room coordinate
237
238
uint32_t
m_buildingId
;
//!< Building ID number
239
BuildingType_t
m_buildingType
;
//!< Building type
240
ExtWallsType_t
m_externalWalls
;
//!< External building wall type
241
};
242
243
}
// namespace ns3
244
245
#endif
/* BUILDING_H */
ns3::Box
a 3d box
Definition:
box.h:35
ns3::Building
a 3d building block
Definition:
building.h:44
ns3::Building::Building
Building()
Create a zero-sized building located at coordinates (0.0,0.0,0.0) and with 1 floors and 1 room.
Definition:
building.cc:118
ns3::Building::GetId
uint32_t GetId() const
Definition:
building.cc:136
ns3::Building::GetNRoomsY
uint16_t GetNRoomsY() const
Definition:
building.cc:216
ns3::Building::m_buildingId
uint32_t m_buildingId
Building ID number.
Definition:
building.h:238
ns3::Building::m_buildingType
BuildingType_t m_buildingType
Building type.
Definition:
building.h:239
ns3::Building::GetExtWallsType
ExtWallsType_t GetExtWallsType() const
Definition:
building.cc:198
ns3::Building::ExtWallsType_t
ExtWallsType_t
External building wall type enum.
Definition:
building.h:67
ns3::Building::Wood
@ Wood
Definition:
building.h:68
ns3::Building::StoneBlocks
@ StoneBlocks
Definition:
building.h:71
ns3::Building::ConcreteWithWindows
@ ConcreteWithWindows
Definition:
building.h:69
ns3::Building::ConcreteWithoutWindows
@ ConcreteWithoutWindows
Definition:
building.h:70
ns3::Building::m_externalWalls
ExtWallsType_t m_externalWalls
External building wall type.
Definition:
building.h:240
ns3::Building::SetBuildingType
void SetBuildingType(Building::BuildingType_t t)
Definition:
building.cc:150
ns3::Building::GetNFloors
uint16_t GetNFloors() const
Definition:
building.cc:204
ns3::Building::SetBoundaries
void SetBoundaries(Box box)
Set the boundaries of the building.
Definition:
building.cc:143
ns3::Building::GetBuildingType
BuildingType_t GetBuildingType() const
Definition:
building.cc:192
ns3::Building::SetNRoomsX
void SetNRoomsX(uint16_t nroomx)
Definition:
building.cc:171
ns3::Building::IsIntersect
bool IsIntersect(const Vector &l1, const Vector &l2) const
Checks if a line-segment between position l1 and position l2 intersects a building.
Definition:
building.cc:291
ns3::Building::GetRoomY
uint16_t GetRoomY(Vector position) const
Definition:
building.cc:249
ns3::Building::SetExtWallsType
void SetExtWallsType(Building::ExtWallsType_t t)
Definition:
building.cc:157
ns3::Building::m_floors
uint16_t m_floors
number of floors, must be greater than 0, and 1 means only one floor (i.e., groundfloor)
Definition:
building.h:234
ns3::Building::DoDispose
void DoDispose() override
Destructor implementation.
Definition:
building.cc:130
ns3::Building::SetNRoomsY
void SetNRoomsY(uint16_t nroomy)
Definition:
building.cc:178
ns3::Building::GetBoundaries
Box GetBoundaries() const
Definition:
building.cc:185
ns3::Building::m_roomsX
uint16_t m_roomsX
X Room coordinate.
Definition:
building.h:235
ns3::Building::~Building
~Building() override
Destructor.
Definition:
building.cc:124
ns3::Building::GetFloor
uint16_t GetFloor(Vector position) const
Definition:
building.cc:270
ns3::Building::GetNRoomsX
uint16_t GetNRoomsX() const
Definition:
building.cc:210
ns3::Building::m_roomsY
uint16_t m_roomsY
Y Room coordinate.
Definition:
building.h:236
ns3::Building::IsInside
bool IsInside(Vector position) const
Definition:
building.cc:222
ns3::Building::SetNFloors
void SetNFloors(uint16_t nfloors)
Definition:
building.cc:164
ns3::Building::m_buildingBounds
Box m_buildingBounds
Building boundaries.
Definition:
building.h:228
ns3::Building::GetRoomX
uint16_t GetRoomX(Vector position) const
Definition:
building.cc:228
ns3::Building::BuildingType_t
BuildingType_t
Building type enum.
Definition:
building.h:57
ns3::Building::Residential
@ Residential
Definition:
building.h:58
ns3::Building::Commercial
@ Commercial
Definition:
building.h:60
ns3::Building::Office
@ Office
Definition:
building.h:59
ns3::Building::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition:
building.cc:41
ns3::Object
A base class which provides memory management and object aggregation.
Definition:
object.h:89
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
uint32_t
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
buildings
model
building.h
Generated on Tue May 28 2024 23:34:15 for ns-3 by
1.9.6