WanaPlan

API Docs for: 2.7.0
Show:

HopperStructure

Extends BaseStructure
Module: Component
Parent Module: Wanaplan

Summary

Hopper's structure.

Constructor

HopperStructure

Syntax

HopperStructure

(
  • [points]
)

Summary

Parameters:

  • [points] BABYLON.Vector2 optional

    The polygon which defines the hopper shape, default is a 100cm large square.

Methods

add

Inherited from BaseStructure:

Syntax

add

(
  • propertyName
  • value
)
private

Summary

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

Inherited from BaseStructure:

Syntax

deserialize

(
  • hybrid
)
Object

Summary

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

Inherited from BaseStructure:

Syntax

getElementByName

(
  • name
  • collection
)
Object private

Summary

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

Inherited from BaseStructure:

Syntax

getFloor

(
  • collection
)
FloorStructure

Summary

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

Inherited from BaseStructure:

Syntax

initialize

() private

Summary

Method called after the loading of the component

inserPointAt

Syntax

inserPointAt

(
  • The
  • The
)
private

Summary

Inserts a point at a given index.

Parameters:

  • The Number

    index where the point must be inserted in the array of points.

  • The BABYLON.Vector2

    inserted point.

isValid

Syntax

isValid

() Boolean

Summary

Checks the consistency of the hopper.

Returns:

Boolean:

False if the structure is corrupted, true otherwise.

move

Syntax

move

(
  • moveVector
)

Summary

Moves the hopper by the translation vector passed in params ( relative move ).

Parameters:

  • moveVector BABYLON.Vector2

    The translation vector by which the hopper will by moved.

remove

Syntax

remove

(
  • structure
)

Summary

Removes the hopper.

Parameters:

  • structure FloorStructure

    The structure from which the hopper must be removed.

serialize

Inherited from BaseStructure:

Syntax

serialize

() Object

Summary

Serializes the object (to JSON)

Returns:

Object:
The serialization result, null if nothing is serialized

update

Inherited from BaseStructure:

Syntax

update

()

Summary

Generic update method, must be overridden.

updateReferences

Inherited from BaseStructure:

Syntax

updateReferences

(
  • structure
)

Summary

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

Inherited from BaseStructure:

Syntax

id

Number

Summary

Unique ID for the structure set up automatically

materials

Syntax

materials

BABYLON.Material

Summary

Set of labeled materials used for painting the hopper.

The decorable meshes are:

  • rail_stick
  • rails
  • bas

modified

Syntax

modified

Boolean

Summary

Indicates if the hopper has been modified or if it's the default hopper.

Default: false

name

Inherited from BaseStructure:

Syntax

name

String

Summary

Structure name

points

Syntax

points

BABYLON.Vector2

Summary

The vertices of the hopper. By default, the hopper is a 100cm large square. Points can be moved, added ( a hopper can have more than 4 vertices ), and removed ( as long as there is still at least 3 vertices ).

Note that when we refer to the side i, it is the edge ( points[ i ] , points[ i+1 ] ).

stairwayId

Syntax

stairwayId

String

Summary

If the hopper is associated with a stairway, the stairway id ( null otherwise ).

Default: null

sticks

Syntax

sticks

Boolean[]

Summary

Indicates which sides of the hopper should have a guardrail. It is an object with a boolean for each side. example : { 0 : false, // Side 0 has no guardrail 1 : true, // whereas side 1 has one ... };

Default: { 0:false , 1:false , 2:false , 3:false } A hopper without guardrails.