API Docs for: 2.7.3
Show:

BaseStructure Class

Module: Component
Parent Module: Wanaplan

Base Virtual Class for component's data

Constructor

BaseStructure

(
  • [name]
)

Parameters:

  • [name] String optional

    A generic name for the data type

Methods

add

(
  • propertyName
  • value
)
private

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.

Deserialize

(
  • hybrid
)
Object static

Deserializes the object (from JSON). This method is the static version of deserialize, it creates an object.

Parameters:

  • hybrid Object

    JSON describing the object, built with the method serialize.

Returns:

Object:

The Structure object built from the deserialization

deserialize

(
  • hybrid
)
Object

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

getElementByName

(
  • name
  • collection
)
Object private

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.

getFloor

(
  • collection
)
FloorStructure

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

Method called after the loading of the component

serialize

() Object

Serializes the object (to JSON)

Returns:

Object:

The serialization result, null if nothing is serialized

update

()

Generic update method, must be overridden.

updateReferences

(
  • structure
)

Generic method for rebuilding references after the deserialization. For example : restoring the link between a PointStructure and its parent WallStructure

Parameters:

  • structure wnp.Structure

    Floor Structure to work with

Properties

id

Number

Unique ID for the structure set up automatically

name

String

Structure name