A Discrete-Event Network Simulator
API
building.h
Go to the documentation of this file.
1/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
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: Marco Miozzo <marco.miozzo@cttc.es>
19 *
20 */
21#ifndef BUILDING_H
22#define BUILDING_H
23
24#include <ns3/attribute.h>
25#include <ns3/attribute-helper.h>
26#include <ns3/vector.h>
27#include <ns3/box.h>
28#include <ns3/simple-ref-count.h>
29#include <ns3/object.h>
30
31namespace ns3 {
32
37class Building : public Object
38{
39public:
40
45 static TypeId GetTypeId (void);
46 virtual void DoDispose ();
47
52 {
54 };
59 {
61 };
62
74 Building (double xMin,
75 double xMax,
76 double yMin,
77 double yMax,
78 double zMin,
79 double zMax);
80
85 Building ();
86
91 virtual ~Building ();
92
97 uint32_t GetId (void) const;
98
104 void SetBoundaries (Box box);
105
112
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
154
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
222
223
224private:
225
227
232 uint16_t m_floors;
233 uint16_t m_roomsX;
234 uint16_t m_roomsY;
235
239
240};
241
242} // namespace ns3
243
244#endif /* BUILDING_H */
a 3d box
Definition: box.h:35
a 3d building block
Definition: building.h:38
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:114
uint16_t GetNRoomsY() const
Definition: building.cc:212
uint32_t m_buildingId
Building ID number.
Definition: building.h:236
BuildingType_t m_buildingType
Building type.
Definition: building.h:237
ExtWallsType_t GetExtWallsType() const
Definition: building.cc:194
ExtWallsType_t
External building wall type enum.
Definition: building.h:59
@ ConcreteWithWindows
Definition: building.h:60
@ ConcreteWithoutWindows
Definition: building.h:60
ExtWallsType_t m_externalWalls
External building wall type.
Definition: building.h:238
void SetBuildingType(Building::BuildingType_t t)
Definition: building.cc:146
uint32_t GetId(void) const
Definition: building.cc:132
uint16_t GetNFloors() const
Definition: building.cc:200
void SetBoundaries(Box box)
Set the boundaries of the building.
Definition: building.cc:139
BuildingType_t GetBuildingType() const
Definition: building.cc:188
void SetNRoomsX(uint16_t nroomx)
Definition: building.cc:167
virtual ~Building()
Destructor.
Definition: building.cc:120
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:288
uint16_t GetRoomY(Vector position) const
Definition: building.cc:246
void SetExtWallsType(Building::ExtWallsType_t t)
Definition: building.cc:153
uint16_t m_floors
number of floors, must be greater than 0, and 1 means only one floor (i.e., groundfloor)
Definition: building.h:232
void SetNRoomsY(uint16_t nroomy)
Definition: building.cc:174
Box GetBoundaries() const
Definition: building.cc:181
uint16_t m_roomsX
X Room coordinate.
Definition: building.h:233
uint16_t GetFloor(Vector position) const
Definition: building.cc:267
uint16_t GetNRoomsX() const
Definition: building.cc:206
uint16_t m_roomsY
Y Room coordinate.
Definition: building.h:234
static TypeId GetTypeId(void)
Get the type ID.
Definition: building.cc:39
bool IsInside(Vector position) const
Definition: building.cc:218
virtual void DoDispose()
Destructor implementation.
Definition: building.cc:126
void SetNFloors(uint16_t nfloors)
Definition: building.cc:160
Box m_buildingBounds
Building boundaries.
Definition: building.h:226
uint16_t GetRoomX(Vector position) const
Definition: building.cc:225
BuildingType_t
Building type enum.
Definition: building.h:52
A base class which provides memory management and object aggregation.
Definition: object.h:88
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.