API Docs for: 2.7.3
Show:

PointStructure Class

Extends BaseStructure
Module: Component
Parent Module: Wanaplan

Class representing wall points.

Constructor

PointStructure

()

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.

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

forceMerge

(
  • point
  • fs
)

Forces merging with another point.

Parameters:

  • point PointStructure

    Other point to merge with. It will be deleted from the floor structure.

  • fs FloorStructure

    The floor structure containing this point.

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.

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

isAttached

() Boolean

Returns the current attached status.

Returns:

Boolean:

True if the point is attached.

remove

(
  • fs
)

Removes the point from the floor structure.

Parameters:

replaceParent

(
  • oldWall
  • newWall
)

Replaces a parent wall with another parent wall.

NB: The order of the parents list can change.

Parameters:

  • oldWall WallStructure

    The old parent.

  • newWall WallStructure

    The new parent, can be undefined if you just want to delete a parent.

serialize

() Object

Inherited from BaseStructure:

Serializes the object (to JSON)

Returns:

Object: The serialization result, null if nothing is serialized

translate

(
  • vector
)

Moves the point by a given offset vector.

Parameters:

  • vector BABYLON.Vector2

    Offset vector.

tryAttach

(
  • fs
  • [blacklist]
)
Boolean

Tries to attach the point to the surrounding walls, if possible.

Parameters:

  • fs FloorStructure

    The floor structure containing this point.

  • [blacklist] WallStructure optional

    Wall to ignore while searching for candidates.

Returns:

Boolean:

False if nothing has been attached, true otherwise.

tryMerge

(
  • fs
)
PointStructure

Tries to merge the point with the other surrounding points, if possible.

Parameters:

Returns:

PointStructure:

The merged point. Returns this point if nothing has been merged.

unAttach

() Boolean

Unattaches a point from a wall.

Returns:

Boolean:

False if the point wasn't previously attached, true otherwise.

update

()

Inherited from BaseStructure:

Generic update method, must be overridden.

updateReferences

(
  • structure
)

Inherited from BaseStructure:

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

wallAttached

() WallStructure

Returns the wall to which the point is attached.

Returns:

WallStructure:

A wall, or undefined/null if the point is not attached.

Properties

_parentIds

Number[] private

Internal, for deserialization.

attachedTo

WallStructure

Wall to which the point is attached. Can be null.

id

Number

Inherited from BaseStructure:

Unique ID for the structure set up automatically

name

String

Inherited from BaseStructure:

Structure name

needsUpdate

Boolean

Flag that indicates if the points needs to be updated (attached or merged).

parents

WallStructure[]

The parent walls of the point. The length can be 1 or 2.

position

BABYLON.Vector2

2D position of the point.