API Docs for: 2.7.3
Show:

HopperStructure Class

Extends BaseStructure
Module: Component
Parent Module: Wanaplan

Hopper's structure.

Constructor

HopperStructure

(
  • [points]
)

Parameters:

  • [points] BABYLON.Vector2 optional

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

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

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

inserPointAt

(
  • The
  • The
)
private

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

() Boolean

Checks the consistency of the hopper.

Returns:

Boolean:

False if the structure is corrupted, true otherwise.

move

(
  • moveVector
)

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

(
  • structure
)

Removes the hopper.

Parameters:

  • structure FloorStructure

    The structure from which the hopper must be removed.

serialize

() Object

Inherited from BaseStructure:

Serializes the object (to JSON)

Returns:

Object: The serialization result, null if nothing is serialized

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

Properties

id

Number

Inherited from BaseStructure:

Unique ID for the structure set up automatically

materials

BABYLON.Material

Set of labeled materials used for painting the hopper.

The decorable meshes are:

  • rail_stick
  • rails
  • bas

modified

Boolean

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

Default: false

name

String

Inherited from BaseStructure:

Structure name

points

BABYLON.Vector2

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

String

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

Default: null

sticks

Boolean[]

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.