a 3d building block More...
#include "building.h"
Public Types | |
enum | BuildingType_t { Residential , Office , Commercial } |
Building type enum. More... | |
enum | ExtWallsType_t { Wood , ConcreteWithWindows , ConcreteWithoutWindows , StoneBlocks } |
External building wall type enum. More... | |
Public Member Functions | |
Building () | |
Create a zero-sized building located at coordinates (0.0,0.0,0.0) and with 1 floors and 1 room. More... | |
Building (double xMin, double xMax, double yMin, double yMax, double zMin, double zMax) | |
Construct a simple building with 1 room and 1 floor. More... | |
~Building () override | |
Destructor. More... | |
void | DoDispose () override |
Destructor implementation. More... | |
Box | GetBoundaries () const |
BuildingType_t | GetBuildingType () const |
ExtWallsType_t | GetExtWallsType () const |
uint16_t | GetFloor (Vector position) const |
uint32_t | GetId () const |
uint16_t | GetNFloors () const |
uint16_t | GetNRoomsX () const |
uint16_t | GetNRoomsY () const |
uint16_t | GetRoomX (Vector position) const |
uint16_t | GetRoomY (Vector position) const |
bool | IsInside (Vector position) const |
bool | IsIntersect (const Vector &l1, const Vector &l2) const |
Checks if a line-segment between position l1 and position l2 intersects a building. More... | |
void | SetBoundaries (Box box) |
Set the boundaries of the building. More... | |
void | SetBuildingType (Building::BuildingType_t t) |
void | SetExtWallsType (Building::ExtWallsType_t t) |
void | SetNFloors (uint16_t nfloors) |
void | SetNRoomsX (uint16_t nroomx) |
void | SetNRoomsY (uint16_t nroomy) |
Public Member Functions inherited from ns3::Object | |
Object () | |
Constructor. More... | |
~Object () override | |
Destructor. More... | |
void | AggregateObject (Ptr< Object > other) |
Aggregate two Objects together. More... | |
void | Dispose () |
Dispose of this Object. More... | |
AggregateIterator | GetAggregateIterator () const |
Get an iterator to the Objects aggregated to this one. More... | |
TypeId | GetInstanceTypeId () const override |
Get the most derived TypeId for this Object. More... | |
template<typename T > | |
Ptr< T > | GetObject () const |
Get a pointer to the requested aggregated Object. More... | |
template<> | |
Ptr< Object > | GetObject () const |
Specialization of () for objects of type ns3::Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
Get a pointer to the requested aggregated Object by TypeId. More... | |
template<> | |
Ptr< Object > | GetObject (TypeId tid) const |
Specialization of (TypeId tid) for objects of type ns3::Object. More... | |
void | Initialize () |
Invoke DoInitialize on all Objects aggregated to this one. More... | |
bool | IsInitialized () const |
Check if the object has been initialized. More... | |
Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter > | |
SimpleRefCount () | |
Default constructor. More... | |
SimpleRefCount (const SimpleRefCount &o[[maybe_unused]]) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount () const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= (const SimpleRefCount &o[[maybe_unused]]) |
Assignment operator. More... | |
void | Ref () const |
Increment the reference count. More... | |
void | Unref () const |
Decrement the reference count. More... | |
Public Member Functions inherited from ns3::ObjectBase | |
virtual | ~ObjectBase () |
Virtual destructor. More... | |
void | GetAttribute (std::string name, AttributeValue &value) const |
Get the value of an attribute, raising fatal errors if unsuccessful. More... | |
bool | GetAttributeFailSafe (std::string name, AttributeValue &value) const |
Get the value of an attribute without raising errors. More... | |
void | SetAttribute (std::string name, const AttributeValue &value) |
Set a single attribute, raising fatal errors if unsuccessful. More... | |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
Set a single attribute without raising errors. More... | |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
Connect a TraceSource to a Callback with a context. More... | |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
Connect a TraceSource to a Callback without a context. More... | |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected with a context. More... | |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected without a context. More... | |
Static Public Member Functions | |
static TypeId | GetTypeId () |
Get the type ID. More... | |
Static Public Member Functions inherited from ns3::Object | |
static TypeId | GetTypeId () |
Register this type. More... | |
Static Public Member Functions inherited from ns3::ObjectBase | |
static TypeId | GetTypeId () |
Get the type ID. More... | |
Private Attributes | |
Box | m_buildingBounds |
Building boundaries. More... | |
uint32_t | m_buildingId |
Building ID number. More... | |
BuildingType_t | m_buildingType |
Building type. More... | |
ExtWallsType_t | m_externalWalls |
External building wall type. More... | |
uint16_t | m_floors |
number of floors, must be greater than 0, and 1 means only one floor (i.e., groundfloor) More... | |
uint16_t | m_roomsX |
X Room coordinate. More... | |
uint16_t | m_roomsY |
Y Room coordinate. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from ns3::Object | |
Object (const Object &o) | |
Copy an Object. More... | |
virtual void | DoInitialize () |
Initialize() implementation. More... | |
virtual void | NotifyNewAggregate () |
Notify all Objects aggregated to this one of a new Object being aggregated. More... | |
Protected Member Functions inherited from ns3::ObjectBase | |
void | ConstructSelf (const AttributeConstructionList &attributes) |
Complete construction of ObjectBase; invoked by derived classes. More... | |
virtual void | NotifyConstructionCompleted () |
Notifier called once the ObjectBase is fully constructed. More... | |
Related Functions inherited from ns3::ObjectBase | |
static TypeId | GetObjectIid () |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
a 3d building block
Definition at line 37 of file building.h.
Building type enum.
Enumerator | |
---|---|
Residential | |
Office | |
Commercial |
Definition at line 50 of file building.h.
External building wall type enum.
Enumerator | |
---|---|
Wood | |
ConcreteWithWindows | |
ConcreteWithoutWindows | |
StoneBlocks |
Definition at line 60 of file building.h.
ns3::Building::Building | ( | double | xMin, |
double | xMax, | ||
double | yMin, | ||
double | yMax, | ||
double | zMin, | ||
double | zMax | ||
) |
Construct a simple building with 1 room and 1 floor.
xMin | x coordinates of left boundary. |
xMax | x coordinates of right boundary. |
yMin | y coordinates of bottom boundary. |
yMax | y coordinates of top boundary. |
zMin | z coordinates of down boundary. |
zMax | z coordinates of up boundary. |
Definition at line 100 of file building.cc.
References NS_FATAL_ERROR.
ns3::Building::Building | ( | ) |
Create a zero-sized building located at coordinates (0.0,0.0,0.0) and with 1 floors and 1 room.
Definition at line 118 of file building.cc.
References ns3::BuildingList::Add(), m_buildingId, and NS_LOG_FUNCTION.
|
override |
|
overridevirtual |
Destructor implementation.
This method is called by Dispose() or by the Object's destructor, whichever comes first.
Subclasses are expected to implement their real destruction code in an overridden version of this method and chain up to their parent's implementation once they are done. i.e, for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose() method.
It is safe to call GetObject() from within this method.
Reimplemented from ns3::Object.
Definition at line 130 of file building.cc.
References NS_LOG_FUNCTION.
Box ns3::Building::GetBoundaries | ( | ) | const |
Definition at line 185 of file building.cc.
References m_buildingBounds, and NS_LOG_FUNCTION.
Referenced by GetTypeId().
Building::BuildingType_t ns3::Building::GetBuildingType | ( | ) | const |
Definition at line 192 of file building.cc.
References m_buildingType.
Referenced by GetTypeId().
Building::ExtWallsType_t ns3::Building::GetExtWallsType | ( | ) | const |
Definition at line 198 of file building.cc.
References m_externalWalls.
Referenced by GetTypeId().
uint16_t ns3::Building::GetFloor | ( | Vector | position | ) | const |
position | a position inside the building |
Definition at line 270 of file building.cc.
References IsInside(), m_buildingBounds, m_floors, NS_ASSERT, NS_LOG_LOGIC, ns3::Box::zMax, and ns3::Box::zMin.
uint32_t ns3::Building::GetId | ( | void | ) | const |
Definition at line 136 of file building.cc.
References m_buildingId, and NS_LOG_FUNCTION.
Referenced by GetTypeId().
uint16_t ns3::Building::GetNFloors | ( | ) | const |
Definition at line 204 of file building.cc.
References m_floors.
Referenced by GetTypeId().
uint16_t ns3::Building::GetNRoomsX | ( | ) | const |
Definition at line 210 of file building.cc.
References m_roomsX.
Referenced by GetTypeId().
uint16_t ns3::Building::GetNRoomsY | ( | ) | const |
Definition at line 216 of file building.cc.
References m_roomsY.
Referenced by GetTypeId().
uint16_t ns3::Building::GetRoomX | ( | Vector | position | ) | const |
position | a position inside the building |
Definition at line 228 of file building.cc.
References IsInside(), m_buildingBounds, m_roomsX, NS_ASSERT, NS_LOG_LOGIC, two-ray-to-three-gpp-ch-calibration::x, ns3::Box::xMax, and ns3::Box::xMin.
uint16_t ns3::Building::GetRoomY | ( | Vector | position | ) | const |
position | a position inside the building |
Definition at line 249 of file building.cc.
References IsInside(), m_buildingBounds, m_roomsY, NS_ASSERT, NS_LOG_LOGIC, ns3::Box::yMax, and ns3::Box::yMin.
|
static |
Get the type ID.
Definition at line 41 of file building.cc.
References Commercial, ConcreteWithoutWindows, ConcreteWithWindows, GetBoundaries(), GetBuildingType(), GetExtWallsType(), GetId(), GetNFloors(), GetNRoomsX(), GetNRoomsY(), ns3::MakeEnumChecker(), ns3::MakeUintegerAccessor(), Office, Residential, SetBoundaries(), SetBuildingType(), SetExtWallsType(), SetNFloors(), SetNRoomsX(), SetNRoomsY(), ns3::TypeId::SetParent(), StoneBlocks, and Wood.
bool ns3::Building::IsInside | ( | Vector | position | ) | const |
position | some position |
Definition at line 222 of file building.cc.
References ns3::Box::IsInside(), and m_buildingBounds.
Referenced by GetFloor(), GetRoomX(), and GetRoomY().
bool ns3::Building::IsIntersect | ( | const Vector & | l1, |
const Vector & | l2 | ||
) | const |
Checks if a line-segment between position l1 and position l2 intersects a building.
l1 | position |
l2 | position |
Definition at line 291 of file building.cc.
References ns3::Box::IsIntersect(), and m_buildingBounds.
void ns3::Building::SetBoundaries | ( | Box | box | ) |
Set the boundaries of the building.
box | the Box defining the boundaries of the building |
Definition at line 143 of file building.cc.
References m_buildingBounds, and NS_LOG_FUNCTION.
Referenced by GetTypeId().
void ns3::Building::SetBuildingType | ( | Building::BuildingType_t | t | ) |
t | the type of building (i.e., Residential, Office, Commercial) |
This method allows to set building type (default is Residential)
Definition at line 150 of file building.cc.
References m_buildingType, and NS_LOG_FUNCTION.
Referenced by GetTypeId().
void ns3::Building::SetExtWallsType | ( | Building::ExtWallsType_t | t | ) |
t | the type of external walls (i.e., Wood, ConcreteWithWindows, ConcreteWithoutWindows and StoneBlocks), used for evaluating the loss due to the penetration of external walls in outdoor <-> indoor comm. |
This method allows to set external walls type (default is Residential)
Definition at line 157 of file building.cc.
References m_externalWalls, and NS_LOG_FUNCTION.
Referenced by GetTypeId().
void ns3::Building::SetNFloors | ( | uint16_t | nfloors | ) |
nfloors | the number of floors in the building |
This method allows to set the number of floors in the building (default is 1)
Definition at line 164 of file building.cc.
References m_floors, and NS_LOG_FUNCTION.
Referenced by GetTypeId().
void ns3::Building::SetNRoomsX | ( | uint16_t | nroomx | ) |
nroomx | the number of rooms along the x axis |
This method allows to set the number of rooms along the x-axis
Definition at line 171 of file building.cc.
References m_roomsX, and NS_LOG_FUNCTION.
Referenced by GetTypeId().
void ns3::Building::SetNRoomsY | ( | uint16_t | nroomy | ) |
nroomy | the number of floors in the building |
This method allows to set the number of rooms along the y-axis
Definition at line 178 of file building.cc.
References m_roomsY, and NS_LOG_FUNCTION.
Referenced by GetTypeId().
|
private |
Building boundaries.
Definition at line 222 of file building.h.
Referenced by GetBoundaries(), GetFloor(), GetRoomX(), GetRoomY(), IsInside(), IsIntersect(), and SetBoundaries().
|
private |
Building ID number.
Definition at line 232 of file building.h.
Referenced by Building(), and GetId().
|
private |
Building type.
Definition at line 233 of file building.h.
Referenced by GetBuildingType(), and SetBuildingType().
|
private |
External building wall type.
Definition at line 234 of file building.h.
Referenced by GetExtWallsType(), and SetExtWallsType().
|
private |
number of floors, must be greater than 0, and 1 means only one floor (i.e., groundfloor)
Definition at line 228 of file building.h.
Referenced by GetFloor(), GetNFloors(), and SetNFloors().
|
private |
X Room coordinate.
Definition at line 229 of file building.h.
Referenced by GetNRoomsX(), GetRoomX(), and SetNRoomsX().
|
private |
Y Room coordinate.
Definition at line 230 of file building.h.
Referenced by GetNRoomsY(), GetRoomY(), and SetNRoomsY().