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