A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
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
37
class
Building
:
public
Object
38
{
39
public
:
44
static
TypeId
GetTypeId
();
45
void
DoDispose
()
override
;
46
50
enum
BuildingType_t
51
{
52
Residential
,
53
Office
,
54
Commercial
55
};
56
60
enum
ExtWallsType_t
61
{
62
Wood
,
63
ConcreteWithWindows
,
64
ConcreteWithoutWindows
,
65
StoneBlocks
66
};
67
79
Building
(
double
xMin,
double
xMax,
double
yMin,
double
yMax,
double
zMin,
double
zMax);
80
85
Building
();
86
91
~Building
()
override
;
92
97
uint32_t
GetId
()
const
;
98
104
void
SetBoundaries
(
Box
box);
105
111
void
SetBuildingType
(
Building::BuildingType_t
t);
112
120
void
SetExtWallsType
(
Building::ExtWallsType_t
t);
121
128
void
SetNFloors
(uint16_t nfloors);
129
135
void
SetNRoomsX
(uint16_t nroomx);
136
142
void
SetNRoomsY
(uint16_t nroomy);
143
148
Box
GetBoundaries
()
const
;
149
153
BuildingType_t
GetBuildingType
()
const
;
154
158
ExtWallsType_t
GetExtWallsType
()
const
;
159
163
uint16_t
GetNFloors
()
const
;
164
168
uint16_t
GetNRoomsX
()
const
;
169
173
uint16_t
GetNRoomsY
()
const
;
174
182
bool
IsInside
(Vector position)
const
;
183
192
uint16_t
GetRoomX
(Vector position)
const
;
193
202
uint16_t
GetRoomY
(Vector position)
const
;
203
210
uint16_t
GetFloor
(Vector position)
const
;
219
bool
IsIntersect
(
const
Vector& l1,
const
Vector& l2)
const
;
220
221
private
:
222
Box
m_buildingBounds
;
223
228
uint16_t
m_floors
;
229
uint16_t
m_roomsX
;
230
uint16_t
m_roomsY
;
231
232
uint32_t
m_buildingId
;
233
BuildingType_t
m_buildingType
;
234
ExtWallsType_t
m_externalWalls
;
235
};
236
237
}
// namespace ns3
238
239
#endif
/* BUILDING_H */
ns3::Box
a 3d box
Definition:
box.h:35
ns3::Building
a 3d building block
Definition:
building.h:38
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:232
ns3::Building::m_buildingType
BuildingType_t m_buildingType
Building type.
Definition:
building.h:233
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:61
ns3::Building::Wood
@ Wood
Definition:
building.h:62
ns3::Building::StoneBlocks
@ StoneBlocks
Definition:
building.h:65
ns3::Building::ConcreteWithWindows
@ ConcreteWithWindows
Definition:
building.h:63
ns3::Building::ConcreteWithoutWindows
@ ConcreteWithoutWindows
Definition:
building.h:64
ns3::Building::m_externalWalls
ExtWallsType_t m_externalWalls
External building wall type.
Definition:
building.h:234
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:228
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:229
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:230
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:222
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:51
ns3::Building::Residential
@ Residential
Definition:
building.h:52
ns3::Building::Commercial
@ Commercial
Definition:
building.h:54
ns3::Building::Office
@ Office
Definition:
building.h:53
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
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
buildings
model
building.h
Generated on Sun Mar 3 2024 17:10:54 for ns-3 by
1.9.1