Floorplan
Extends:
A Floorplan represents a number of Walls, Corners and Rooms. This is an abstract that keeps the 2d and 3d in sync
Constructor Summary
Public Constructor | ||
public |
Constructs a floorplan. |
Member Summary
Public Members | ||
public get |
|
|
public set |
carbonSheet(val: CarbonSheet) |
|
public |
List of elements of Corner instance |
|
public |
floorTextures: {} |
|
public |
An Object that stores the metadata of rooms like name |
|
public |
new_corner_callbacks: *[] this member was deprecated.
|
|
public |
new_wall_callbacks: *[] this member was deprecated.
|
|
public |
redraw_callbacks: *[] this member was deprecated.
|
|
public |
roomLoadedCallbacks: *[] this member was deprecated.
|
|
public |
List of elements of Room instance |
|
public |
updated_rooms: *[] this member was deprecated.
|
|
public |
List of elements of Wall instance |
Private Members | ||
private |
The CarbonSheet that handles the background image to show in the 2D view |
Method Summary
Public Methods | ||
public |
An internal cleanup method |
|
public |
findRooms(corners: Corners[]): Corners[][] Find the "rooms" in our planar straight-line graph. |
|
public |
fireOnNewCorner(callback: *) |
|
public |
fireOnNewWall(callback: *) |
|
public |
fireOnRedraw(callback: *) |
|
public |
fireOnUpdatedRooms(callback: *) |
|
public |
floorPlanes(): Mesh[] Returns all the planes for intersection of the floors in all room |
|
public |
getCenter(): Vector2 Returns the center of the floorplan in the y plane |
|
public |
getCorners(): Corner[] Gets the corners. |
|
public |
getDimensions(center: boolean): Vector3 Returns the bounding size or the center location of the full floorplan |
|
public |
getFloorTexture(uuid: *): * this method was deprecated.
|
|
public |
The metadata object with information about the rooms. |
|
public |
Gets the rooms. |
|
public |
getSize(): Vector3 Returns the bounding volume of the full floorplan |
|
public |
Gets the walls. |
|
public |
loadFloorplan(floorplan: JSON): void |
|
public |
Creates a new corner. |
|
public |
Creates a new wall. |
|
public |
newWallsForIntersections(start: Corner, end: Corner): boolean Checks existing walls for any intersections they would make. |
|
public |
overlappedCorner(x: Number, y: Number, tolerance: Number): Corner Gets the Corner overlapping the location x, y at a tolerance. |
|
public |
overlappedRoom(mx: Number, my: Number): Room Gets the room overlapping the location x, y. |
|
public |
overlappedWall(x: Number, y: Number, tolerance: Number): Wall Gets the Wall overlapping the location x, y at a tolerance. |
|
public |
removeCorner(corner: Corner) Removes a corner. |
|
public |
removeWall(wall: Wall) Removes a wall. |
|
public |
reset(): void Resets the floorplan data to empty |
|
public |
roofPlanes(): Mesh[] Returns the roof planes in the floorplan for intersection testing |
|
public |
roomNameChanged(event: Object) |
|
public |
saveFloorplan(): void |
|
public |
setFloorTexture(uuid: *, url: *, scale: *) this method was deprecated.
|
|
public |
update() Update the floorplan with new rooms, remove old rooms etc. |
|
public |
this method was deprecated.
|
|
public |
wallEdgePlanes(): Mesh[] Returns all the planes for intersection for the walls |
|
public |
|
Public Constructors
Public Members
public get carbonSheet: CarbonSheet: * source
public set carbonSheet(val: CarbonSheet) source
public corners: Corner[] source
List of elements of Corner instance
Properties:
Name | Type | Attribute | Description |
corners | Corner[] | array of corners |
public floorTextures: {} source
public metaroomsdata: Object source
An Object that stores the metadata of rooms like name
Properties:
Name | Type | Attribute | Description |
metaroomsdata | Object | stores the metadata of rooms like name |
public rooms: Room[] source
List of elements of Room instance
Properties:
Name | Type | Attribute | Description |
walls | Room[] | Array of walls |
public walls: Wall[] source
List of elements of Wall instance
Properties:
Name | Type | Attribute | Description |
walls | Wall[] | Array of walls |
Private Members
private _carbonSheet: Object source
The CarbonSheet that handles the background image to show in the 2D view
Properties:
Name | Type | Attribute | Description |
_carbonSheet | CarbonSheet | The carbonsheet instance |
Public Methods
public findRooms(corners: Corners[]): Corners[][] source
Find the "rooms" in our planar straight-line graph. Rooms are set of the smallest (by area) possible cycles in this graph. @param corners The corners of the floorplan. @returns The rooms, each room as an array of corners.
Params:
Name | Type | Attribute | Description |
corners | Corners[] |
Return:
Corners[][] | loops |
public fireOnNewCorner(callback: *) source
Params:
Name | Type | Attribute | Description |
callback | * |
public fireOnNewWall(callback: *) source
Params:
Name | Type | Attribute | Description |
callback | * |
public fireOnRedraw(callback: *) source
Params:
Name | Type | Attribute | Description |
callback | * |
public fireOnUpdatedRooms(callback: *) source
Params:
Name | Type | Attribute | Description |
callback | * |
public floorPlanes(): Mesh[] source
Returns all the planes for intersection of the floors in all room
public getCenter(): Vector2 source
Returns the center of the floorplan in the y plane
Return:
Vector2 | center |
public getDimensions(center: boolean): Vector3 source
Returns the bounding size or the center location of the full floorplan
Params:
Name | Type | Attribute | Description |
center | boolean | If true return the center else the size |
Return:
Vector3 | size |
public getFloorTexture(uuid: *): * source
Params:
Name | Type | Attribute | Description |
uuid | * |
Return:
* |
public getSize(): Vector3 source
Returns the bounding volume of the full floorplan
Return:
Vector3 | size |
public loadFloorplan(floorplan: JSON): void source
Params:
Name | Type | Attribute | Description |
floorplan | JSON |
Return:
void |
Emit:
public newWallsForIntersections(start: Corner, end: Corner): boolean source
Checks existing walls for any intersections they would make. If there are intersections then introduce new corners and new walls as required at places
public overlappedCorner(x: Number, y: Number, tolerance: Number): Corner source
Gets the Corner overlapping the location x, y at a tolerance.
public overlappedRoom(mx: Number, my: Number): Room source
Gets the room overlapping the location x, y.
public overlappedWall(x: Number, y: Number, tolerance: Number): Wall source
Gets the Wall overlapping the location x, y at a tolerance.
public removeCorner(corner: Corner) source
Removes a corner.
Params:
Name | Type | Attribute | Description |
corner | Corner | The corner to be removed. |
public removeWall(wall: Wall) source
Removes a wall.
Params:
Name | Type | Attribute | Description |
wall | Wall | The wall to be removed. |
public roofPlanes(): Mesh[] source
Returns the roof planes in the floorplan for intersection testing
public roomNameChanged(event: Object) source
Params:
Name | Type | Attribute | Description |
event | Object |
Listen:
When a room name is changed and updates to metaroomdata |
public setFloorTexture(uuid: *, url: *, scale: *) source
Params:
Name | Type | Attribute | Description |
uuid | * | ||
url | * | ||
scale | * |