a 3d building block More...
#include <building.h>
Public Types | |
enum | BuildingType_t { Residential, Office, Commercial } |
enum | ExtWallsType_t { Wood, ConcreteWithWindows, ConcreteWithoutWindows, StoneBlocks } |
Public Member Functions | |
Building (double xMin, double xMax, double yMin, double yMax, double zMin, double zMax) | |
Building () | |
virtual | ~Building () |
virtual void | DoDispose () |
Box | GetBoundaries () const |
BuildingType_t | GetBuildingType () const |
ExtWallsType_t | GetExtWallsType () const |
uint16_t | GetFloor (Vector position) const |
uint32_t | GetId (void) 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 |
void | SetBoundaries (Box box) |
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) |
![]() | |
Object () | |
virtual | ~Object () |
void | AggregateObject (Ptr< Object > other) |
void | Dispose (void) |
AggregateIterator | GetAggregateIterator (void) const |
virtual TypeId | GetInstanceTypeId (void) const |
template<typename T > | |
Ptr< T > | GetObject (void) const |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
void | Start (void) |
![]() | |
SimpleRefCount () | |
SimpleRefCount (const SimpleRefCount &o) | |
uint32_t | GetReferenceCount (void) const |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
void | Ref (void) const |
void | Unref (void) const |
![]() | |
virtual | ~ObjectBase () |
void | GetAttribute (std::string name, AttributeValue &value) const |
bool | GetAttributeFailSafe (std::string name, AttributeValue &attribute) const |
void | SetAttribute (std::string name, const AttributeValue &value) |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
This method returns the TypeId associated to ns3::Building. |
Private Attributes | |
Box | m_buildingBounds |
uint32_t | m_buildingId |
BuildingType_t | m_buildingType |
ExtWallsType_t | m_externalWalls |
uint16_t | m_floors |
uint16_t | m_roomsX |
uint16_t | m_roomsY |
Additional Inherited Members | |
![]() | |
Object (const Object &o) | |
virtual void | DoStart (void) |
virtual void | NotifyNewAggregate (void) |
a 3d building block
Definition at line 37 of file building.h.
Definition at line 46 of file building.h.
Definition at line 50 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 84 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 114 of file building.cc.
References ns3::BuildingList::Add(), m_buildingId, and NS_LOG_FUNCTION.
|
virtual |
|
virtual |
This method is called by Object::Dispose or by the object's destructor, whichever comes first.
Subclasses are expected to implement their real destruction code in an overriden 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 126 of file building.cc.
References NS_LOG_FUNCTION.
Box ns3::Building::GetBoundaries | ( | ) | const |
Definition at line 181 of file building.cc.
References m_buildingBounds, and NS_LOG_FUNCTION.
Referenced by GetTypeId().
Building::BuildingType_t ns3::Building::GetBuildingType | ( | ) | const |
Definition at line 188 of file building.cc.
References m_buildingType.
Referenced by ns3::ItuR1238PropagationLossModel::GetLoss(), and GetTypeId().
Building::ExtWallsType_t ns3::Building::GetExtWallsType | ( | ) | const |
Definition at line 194 of file building.cc.
References m_externalWalls.
Referenced by ns3::BuildingsPropagationLossModel::ExternalWallLoss(), and GetTypeId().
uint16_t ns3::Building::GetFloor | ( | Vector | position | ) | const |
position | a position inside the building |
Definition at line 267 of file building.cc.
References IsInside(), m_buildingBounds, m_floors, NS_ASSERT, NS_LOG_LOGIC, ns3::Vector3D::z, ns3::Box::zMax, and ns3::Box::zMin.
uint32_t ns3::Building::GetId | ( | void | ) | const |
Definition at line 132 of file building.cc.
References m_buildingId, and NS_LOG_FUNCTION.
Referenced by ns3::BuildingsHelperOneTestCase::DoRun(), ns3::ItuR1238PropagationLossModel::GetLoss(), ns3::RandomRoomPositionAllocator::GetNext(), ns3::SameRoomPositionAllocator::GetNext(), and GetTypeId().
uint16_t ns3::Building::GetNFloors | ( | ) | const |
Definition at line 200 of file building.cc.
References m_floors.
Referenced by ns3::RandomRoomPositionAllocator::GetNext(), and GetTypeId().
uint16_t ns3::Building::GetNRoomsX | ( | ) | const |
Definition at line 206 of file building.cc.
References m_roomsX.
Referenced by ns3::RandomRoomPositionAllocator::GetNext(), and GetTypeId().
uint16_t ns3::Building::GetNRoomsY | ( | ) | const |
Definition at line 212 of file building.cc.
References m_roomsY.
Referenced by ns3::RandomRoomPositionAllocator::GetNext(), and GetTypeId().
uint16_t ns3::Building::GetRoomX | ( | Vector | position | ) | const |
position | a position inside the building |
Definition at line 225 of file building.cc.
References IsInside(), m_buildingBounds, m_roomsX, NS_ASSERT, NS_LOG_LOGIC, sample-rng-plot::x, ns3::Vector3D::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 246 of file building.cc.
References IsInside(), m_buildingBounds, m_roomsY, NS_ASSERT, NS_LOG_LOGIC, ns3::Vector3D::y, ns3::Box::yMax, and ns3::Box::yMin.
|
static |
This method returns the TypeId associated to ns3::Building.
Attributes defined for this type:
No TraceSources defined for this type.
Reimplemented from ns3::Object.
Definition at line 40 of file building.cc.
References Commercial, ConcreteWithoutWindows, ConcreteWithWindows, GetBoundaries(), GetBuildingType(), GetExtWallsType(), GetId(), GetNFloors(), GetNRoomsX(), GetNRoomsY(), ns3::MakeEnumAccessor(), ns3::MakeEnumChecker(), 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 218 of file building.cc.
References ns3::Box::IsInside(), and m_buildingBounds.
Referenced by GetFloor(), GetRoomX(), GetRoomY(), and ns3::BuildingsMobilityModel::SetIndoor().
void ns3::Building::SetBoundaries | ( | Box | box | ) |
Set the boundaries of the building
box | the Box defining the boundaries of the building |
Definition at line 139 of file building.cc.
References m_buildingBounds, and NS_LOG_FUNCTION.
Referenced by ns3::BuildingsPathlossTestCase::DoRun(), ns3::BuildingsShadowingTestCase::DoRun(), ns3::RandomRoomPositionAllocatorTestCase::DoRun(), ns3::BuildingsHelperOneTestCase::DoRun(), ns3::SameRoomPositionAllocatorTestCase::DoRun(), GetTypeId(), and main().
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 146 of file building.cc.
References m_buildingType, and NS_LOG_FUNCTION.
Referenced by ns3::BuildingsPathlossTestCase::DoRun(), ns3::BuildingsShadowingTestCase::DoRun(), GetTypeId(), and main().
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 153 of file building.cc.
References m_externalWalls, and NS_LOG_FUNCTION.
Referenced by ns3::BuildingsPathlossTestCase::DoRun(), ns3::BuildingsShadowingTestCase::DoRun(), GetTypeId(), and main().
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 160 of file building.cc.
References m_floors, and NS_LOG_FUNCTION.
Referenced by ns3::BuildingsPathlossTestCase::DoRun(), ns3::BuildingsShadowingTestCase::DoRun(), ns3::RandomRoomPositionAllocatorTestCase::DoRun(), ns3::BuildingsHelperOneTestCase::DoRun(), ns3::SameRoomPositionAllocatorTestCase::DoRun(), and 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 167 of file building.cc.
References m_roomsX, and NS_LOG_FUNCTION.
Referenced by ns3::RandomRoomPositionAllocatorTestCase::DoRun(), ns3::BuildingsHelperOneTestCase::DoRun(), ns3::SameRoomPositionAllocatorTestCase::DoRun(), and 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 174 of file building.cc.
References m_roomsY, and NS_LOG_FUNCTION.
Referenced by ns3::RandomRoomPositionAllocatorTestCase::DoRun(), ns3::BuildingsHelperOneTestCase::DoRun(), ns3::SameRoomPositionAllocatorTestCase::DoRun(), and GetTypeId().
|
private |
Definition at line 209 of file building.h.
Referenced by GetBoundaries(), GetFloor(), GetRoomX(), GetRoomY(), IsInside(), and SetBoundaries().
|
private |
Definition at line 219 of file building.h.
Referenced by Building(), and GetId().
|
private |
Definition at line 220 of file building.h.
Referenced by GetBuildingType(), and SetBuildingType().
|
private |
Definition at line 221 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 215 of file building.h.
Referenced by GetFloor(), GetNFloors(), and SetNFloors().
|
private |
Definition at line 216 of file building.h.
Referenced by GetNRoomsX(), GetRoomX(), and SetNRoomsX().
|
private |
Definition at line 217 of file building.h.
Referenced by GetNRoomsY(), GetRoomY(), and SetNRoomsY().