API Docs for: 2.7.3
Show:

FloorStructure Class

Extends BaseStructure
Module: Component
Parent Module: Wanaplan

Floor.

Constructor

FloorStructure

()

Methods

add

(
  • propertyName
  • value
)
private

Inherited from BaseStructure:

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

(
  • a
  • b
  • options
)
WallStructure

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

(
  • polygon
  • options
)
WallStructure[]

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

() FloorStructure

Clones the current floor structure.

Returns:

FloorStructure:

the cloned object

deserialize

(
  • hybrid
)
Object

Inherited from BaseStructure:

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

()

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

disableCeiling

()

Disable the ceiling on all the floor

getElementByIdentifier

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

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

(
  • name
  • collection
)
Object private

Inherited from BaseStructure:

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

(
  • category
)
BaseStructure[]

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

(
  • collection
)
FloorStructure

Inherited from BaseStructure:

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

() private

Inherited from BaseStructure:

Method called after the loading of the component

insertElement

(
  • category
  • element
)

Inserts an element into the structure.

Parameters:

  • category String

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

  • element BaseStructure

    Element to insert.

isDirty

() Boolean

Checks if the floor geometry has been dirtied.

Returns:

Boolean:

The geometry status.

prepareWallStructure

(
  • a
  • b
  • options
)
WallStructure private

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

(
  • collection
  • start
)

Reindexes a collection.

Parameters:

removeAllWalls

()

Removes all the walls of the floor

removeElement

(
  • category
  • element
)

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

(
  • category
  • elements
)

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

() Object

Inherited from BaseStructure:

Serializes the object (to JSON)

Returns:

Object: The serialization result, null if nothing is serialized

tidy

()

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

update

()

Inherited from BaseStructure:

Generic update method, must be overridden.

updateReferences

(
  • structure
)

Inherited from BaseStructure

Update the floor's walls' parents after deserialization.

Parameters:

Properties

dirtyGeometry

Boolean

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

Number

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

Default: 0

externalRooms

RoomStructure[]

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

extraPanes

WallPane3D[]

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

height

Number

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

Default: 250

hoppers

HopperStructure[]

Array of HopperStructure referenced in this floor.

id

Number

Inherited from BaseStructure:

Unique ID for the structure set up automatically

internalRooms

RoomStructure[]

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

label

String

Floor label, chosen by the user.

lockElevation

Boolean

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

Default: false

name

String

Inherited from BaseStructure:

Structure name

objects

ObjectStrcture

Array of ObjectStructure referenced in this floor.

overtures

OvertureStructure[]

Array of OvertureStructure referenced in this floor.

points

PointStructure[]

Array of PointStructure referenced in this floor.

roofs

RoofStructure[]

Array of RoofStructure referenced in this floor.

stairways

StairwayStructure[]

Array of StairwayStructure referenced in this floor.

subSlopeOverture

SubSlopeOvertureStructure[]

Array of SubSlopeOvertureStructure referenced in this floor.

subslopes

SubSlopeStructure[]

Array of SubSlopeStructure referenced in this floor.

walls

WallStructure[]

Array of WallStructure referenced in this floor.