API Docs for: 2.7.3
Show:

FloorController Class

Extends BaseComponent2D
Module: Component
Parent Module: Wanaplan

A remote control to interact with the floors.

Constructor

FloorController

(
  • core
)

Parameters:

  • core Core

    Wanaplan Core.

Methods

buildHTML

()

Builds the HTML code for the component.

destroy

()

Inherited from BaseComponent2D:

Method called when the component is destroyed

disable

()

Inherited from BaseComponent2D:

Disables the component

duplicateForFloor

(
  • options
)

Duplicates the current floor with the duplication rules chosen by the user.

options["walls"] = true => Keep the wall. options["objects"] = true => Keep the objects. etc...

Parameters:

  • options Object

    The different options set by the user.

enable

()

Inherited from BaseComponent2D:

Enables the component

getTargeted

(
  • vector
)
Object

Inherited from BaseComponent2D:

Finds out if the given position is over an element handled by the component

Parameters:

  • vector Vector
    A position, usually the cursor's one.

Returns:

Object: The targeted element, or null if nothing is found.

initialize

()

Inherited from BaseComponent2D:

Method called when Wanaplan is initialized. You don't need to call this method manually.

insertFloorBefore

(
  • floorIndex
  • beforeIndex
)

Inserts a floor before another.

For instance, you can move the 4th floor to the 1st floor, This will shift up every floor after the current 1st one, including the 1st.

Parameters:

  • floorIndex Number

    The index of the floor to move.

  • beforeIndex Number

    The index of the floor to insert before.

onAddItemClick

(
  • event
)

Opens a new window allowing to add a new floor and choose properties to clone from the floor below. Triggered on click on the "+" HTML element.

Parameters:

  • event Event

    The object associated with the event.

onAddItemConfirm

(
  • event
  • options
)

Adds a new floor while duplicating the properties specified in the options. Triggered on click on the add button of the duplication window.

Parameters:

  • event Event

    The objet associated with the event.

  • options Object

    The different options set by the user.

onContextChanged

(
  • context
)

Inherited from BaseComponent2D:

Method called when the context is switched (2D -> 3D or 3D -> 2D)

Parameters:

  • context String
    The new context

onContextMenuPropertyChanged

(
  • target
  • property
  • value
)

Triggered when a floor property is changed in a context menu.

Parameters:

onItemClick

(
  • event
)

Selects a chosen floor. Triggered on event clickon the floor html element.

Parameters:

  • event Event

    The object associated to the event.

onItemContextMenu

(
  • event
)

Shows a context menu to change the floor parameters Triggered on event click on the "i" inside the floor html element.

Parameters:

  • event Event

    The object associated to the event.

onItemDelete

(
  • event
)

Deletes a floor. Triggered on click on the "x" inside the floor html element.

Parameters:

  • event Event

    The associated event.

removeHTML

()

Removes the HTML code for the component.

selectFloor

(
  • id
)

Selects a floor to display.

Parameters:

  • id Number

    The id of the floor to select.

startListening

()

Inherited from BaseComponent2D:

Calls all the event listeners.

stopListening

()

Inherited from BaseComponent2D:

Removes all the event listeners.

update

()

Inherited from BaseComponent2D:

Generic update method, called on every frame

updateHTML

()

Updates the HTML element of the remote control. Triggered on event wnp.structure.locale.loaded

Properties

name

String

Inherited from BaseComponent2D:

Component name

priority

Number

Inherited from BaseComponent2D:

Priority of the component in the "update" and "draw" routines

structure

wnp.Structure

Inherited from BaseComponent2D:

Structure file instance (shortcut to wanaplan.structure). This is the base object where the whole plan is saved

Events

wnp.request.floorAdded

Fired when a floor needs to be added.

wnp.request.floorDeleted

Fired when a floor needs to be deleted.

wnp.request.floorSelected

Fired when a floor needs to be selected.

wnp.request.floorSelected

Fired when a floor needs to be selected.