WanaPlan

API Docs for: 2.7.0
Show:

FloorStructure

Extends BaseStructure
Module: Component
Parent Module: Wanaplan

Summary

Floor.

Constructor

FloorStructure

Syntax

FloorStructure

()

Summary

Methods

add

Inherited from BaseStructure:

Syntax

add

(
  • propertyName
  • value
)
private

Summary

Adds an element to the collection in parameter.

Parameters:

  • propertyName String
    Name of the dictionnary.
  • value Object
    Value to distribute.

Returns:

Returns true if the value is added else returns false.

addOneWall

Syntax

addOneWall

(
  • a
  • b
  • options
)
WallStructure

Summary

Adds one wall to the floor. The wall will be merged with the existing walls of the floor if needed.

Parameters:

  • a BABYLON.Vector2

    The first point, must have x and y attribute ( BABYLON.Vector2 for example ).

  • b BABYLON.Vector2

    The second point, must have x and y attribute ( BABYLON.Vector2 for example ).

  • options Object

    Set of options

    • height Number

      The height of the wall

    • tickness Number

      The thickness of the wall

Returns:

WallStructure:

The added wall

addWallsAsPolygon

Syntax

addWallsAsPolygon

(
  • polygon
  • options
)
WallStructure[]

Summary

Adds walls to the floor. The walls will be merged together if needed, and with the existing walls of the floor if needed.

Parameters:

  • polygon BABYLON.Vector2

    The 2D polygon, is an array of point objects which must have x and y attribute ( BABYLON.Vector2 for example ). The polygon does not need to repeat the first and last elements, it's already considered closed.

  • options Object

    Set of options

    • height Number

      The height of the walls

    • tickness Number

      The thickness of the walls

    • line Boolean

      true if the polygon is a line, will connect the last and first point if left to false

Returns:

WallStructure[]:

The added walls.

clone

Syntax

clone

() FloorStructure

Summary

Clones the current floor structure.

Returns:

FloorStructure:

the cloned object

deserialize

Inherited from BaseStructure:

Syntax

deserialize

(
  • hybrid
)
Object

Summary

Deserializes the object (from JSON).

Parameters:

  • hybrid Object
    JSON describing the object, built with the method serialize.

Returns:

Object:
The Structure object built from the deserialization

dirty

Syntax

dirty

()

Summary

Signals that the floor geometry has been dirtied, and needs to be updated.

disableCeiling

Syntax

disableCeiling

()

Summary

Disable the ceiling on all the floor

getElementByIdentifier

Syntax

getElementByIdentifier

(
  • id
  • category
  • [identifier="id"]
)

Summary

Returns an indexed element in the given category.

Parameters:

  • id Number

    Id of the element.

  • category String

    Category of the element (ex: "walls", "points",...).

  • [identifier="id"] String optional

    Primary key of the search (ex: "id", "name", ...).

getElementByName

Inherited from BaseStructure:

Syntax

getElementByName

(
  • name
  • collection
)
Object private

Summary

Gets an element of the collection by its name.

Parameters:

  • name String
    The name of the element to search.
  • collection String
    The name of the collection in which we want to search. If this parameter is not defined, the search is done in all the collection of type array.

Returns:

Object:
Returns the needed element if it exists, else returns null.

getElements

Syntax

getElements

(
  • category
)
BaseStructure[]

Summary

Returns all elements in a category.

Parameters:

  • category String

    Category of an element (ex: "walls", "points",...).

Returns:

BaseStructure[]:

List of elements of the category.

getFloor

Inherited from BaseStructure:

Syntax

getFloor

(
  • collection
)
FloorStructure

Summary

Gets the floor referencing this object

Parameters:

  • collection String
    Collection to search within.

Returns:

FloorStructure:
The floor containing this structure, -1 if the object has not been added to any floor collection.

initialize

Inherited from BaseStructure:

Syntax

initialize

() private

Summary

Method called after the loading of the component

insertElement

Syntax

insertElement

(
  • category
  • element
)

Summary

Inserts an element into the structure.

Parameters:

  • category String

    Category of the object (ex: "walls", "points",...).

  • element BaseStructure

    Element to insert.

isDirty

Syntax

isDirty

() Boolean

Summary

Checks if the floor geometry has been dirtied.

Returns:

Boolean:

The geometry status.

prepareWallStructure

Syntax

prepareWallStructure

(
  • a
  • b
  • options
)
WallStructure private

Summary

Instanciates a WallStructure with the desired parameters

Parameters:

  • a BABYLON.Vector2

    The first point, must have x and y attribute ( BABYLON.Vector2 for exemple ).

  • b BABYLON.Vector2

    The second point, must have x and y attribute ( BABYLON.Vector2 for exemple ).

  • options Object

    Set of options

    • height Number

      The height of the walls

    • tickness Number

      The thickness of the walls

Returns:

WallStructure:

The wall structure

reindexElements

Syntax

reindexElements

(
  • collection
  • start
)

Summary

Reindexes a collection.

Parameters:

removeAllWalls

Syntax

removeAllWalls

()

Summary

Removes all the walls of the floor

removeElement

Syntax

removeElement

(
  • category
  • element
)

Summary

Deletes an element from a category in the structure.

Parameters:

  • category String

    Category of the element (ex: "walls", "points",...).

  • element BaseStructure

    Element to delete.

removeElements

Syntax

removeElements

(
  • category
  • elements
)

Summary

Replaces all the elements of a category.

Parameters:

  • category String

    Category of the element (ex: "walls", "points",...).

  • elements BaseStructure[]

    Array of elements to insert.

serialize

Inherited from BaseStructure:

Syntax

serialize

() Object

Summary

Serializes the object (to JSON)

Returns:

Object:
The serialization result, null if nothing is serialized

tidy

Syntax

tidy

()

Summary

Signals that the floor geometry has been tidied, and no longer needs to be updated.

update

Inherited from BaseStructure:

Syntax

update

()

Summary

Generic update method, must be overridden.

updateReferences

Inherited from BaseStructure

Syntax

updateReferences

(
  • structure
)

Summary

Update the floor's walls' parents after deserialization.

Parameters:

Properties

dirtyGeometry

Syntax

dirtyGeometry

Boolean

Summary

This flag signals if the geometry of the floor has been dirtied by some component. Components should read this with isDirty() and update their logic if the floor is dirty.

elevation

Syntax

elevation

Number

Summary

Floor elevation. Represents the "y" coordinate of the bottom of the floor.

Default: 0

externalRooms

Syntax

externalRooms

RoomStructure[]

Summary

Array of RoomStructure referenced in this floor. These rooms are external, see Wiki for more info.

extraPanes

Syntax

extraPanes

WallPane3D[]

Summary

Extra wall panes, needed for the decoration of the house to be complete. Act as fillers.

height

Syntax

height

Number

Summary

Floor height. Represents the height difference between the top (ceiling) and the bottom of the floor.

Default: 250

hoppers

Syntax

Summary

Array of HopperStructure referenced in this floor.

id

Inherited from BaseStructure:

Syntax

id

Number

Summary

Unique ID for the structure set up automatically

internalRooms

Syntax

internalRooms

RoomStructure[]

Summary

Array of RoomStructure referenced in this floor. These rooms are internal, see Wiki for more info.

label

Syntax

label

String

Summary

Floor label, chosen by the user.

lockElevation

Syntax

lockElevation

Boolean

Summary

Lock floor elevation. When true, prevents auto modification of this floor's elevation.

Default: false

name

Inherited from BaseStructure:

Syntax

name

String

Summary

Structure name

objects

Syntax

objects

ObjectStrcture

Summary

Array of ObjectStructure referenced in this floor.

overtures

Syntax

Summary

Array of OvertureStructure referenced in this floor.

points

Syntax

Summary

Array of PointStructure referenced in this floor.

roofs

Syntax

Summary

Array of RoofStructure referenced in this floor.

stairways

Syntax

Summary

Array of StairwayStructure referenced in this floor.

subSlopeOverture

Syntax

subSlopeOverture

SubSlopeOvertureStructure[]

Summary

Array of SubSlopeOvertureStructure referenced in this floor.

subslopes

Syntax

Summary

Array of SubSlopeStructure referenced in this floor.

walls

Syntax

Summary

Array of WallStructure referenced in this floor.