WanaPlan

API Docs for: 2.7.0
Show:

FloorController

Extends BaseComponent2D
Module: Component
Parent Module: Wanaplan

Summary

A remote control to interact with the floors.

Constructor

FloorController

Syntax

FloorController

(
  • core
)

Summary

Parameters:

  • core Core

    Wanaplan Core.

Methods

buildHTML

Syntax

buildHTML

()

Summary

Builds the HTML code for the component.

destroy

Inherited from BaseComponent2D:

Syntax

destroy

()

Summary

Method called when the component is destroyed

disable

Inherited from BaseComponent2D:

Syntax

disable

()

Summary

Disables the component

duplicateForFloor

Syntax

duplicateForFloor

(
  • options
)

Summary

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:

Syntax

enable

()

Summary

Enables the component

getTargeted

Inherited from BaseComponent2D:

Syntax

getTargeted

(
  • vector
)
Object

Summary

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:

Syntax

initialize

()

Summary

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

insertFloorBefore

Syntax

insertFloorBefore

(
  • floorIndex
  • beforeIndex
)

Summary

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

Syntax

onAddItemClick

(
  • event
)

Summary

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

Syntax

onAddItemConfirm

(
  • event
  • options
)

Summary

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

Inherited from BaseComponent2D:

Syntax

onContextChanged

(
  • context
)

Summary

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

Parameters:

  • context String
    The new context

onContextMenuPropertyChanged

Syntax

onContextMenuPropertyChanged

(
  • target
  • property
  • value
)

Summary

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

Parameters:

onItemClick

Syntax

onItemClick

(
  • event
)

Summary

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

Parameters:

  • event Event

    The object associated to the event.

onItemContextMenu

Syntax

onItemContextMenu

(
  • event
)

Summary

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

Syntax

onItemDelete

(
  • event
)

Summary

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

Parameters:

  • event Event

    The associated event.

removeHTML

Syntax

removeHTML

()

Summary

Removes the HTML code for the component.

selectFloor

Syntax

selectFloor

(
  • id
)

Summary

Selects a floor to display.

Parameters:

  • id Number

    The id of the floor to select.

startListening

Inherited from BaseComponent2D:

Syntax

startListening

()

Summary

Calls all the event listeners.

stopListening

Inherited from BaseComponent2D:

Syntax

stopListening

()

Summary

Removes all the event listeners.

update

Inherited from BaseComponent2D:

Syntax

update

()

Summary

Generic update method, called on every frame

updateHTML

Syntax

updateHTML

()

Summary

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

Properties

name

Inherited from BaseComponent2D:

Syntax

name

String

Summary

Component name

priority

Inherited from BaseComponent2D:

Syntax

priority

Number

Summary

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

structure

Inherited from BaseComponent2D:

Syntax

structure

wnp.Structure

Summary

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

Events

wnp.request.floorAdded

Syntax

wnp.request.floorAdded

Summary

Fired when a floor needs to be added.

wnp.request.floorDeleted

Syntax

wnp.request.floorDeleted

Summary

Fired when a floor needs to be deleted.

wnp.request.floorSelected

Syntax

wnp.request.floorSelected

Summary

Fired when a floor needs to be selected.

wnp.request.floorSelected

Syntax

wnp.request.floorSelected

Summary

Fired when a floor needs to be selected.