API Docs for: 2.7.3
Show:

StraightStairwayStructure Class

Module: Component
Parent Module: Wanaplan

Stairway structure for straight stairways.

Constructor

StraightStairwayStructure

()

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.

addMaterial

(
  • parent
  • mesh
  • materialItem
)
private

Inherited from StairwayStructure:

Adds a material.

Parameters:

  • parent BABYLON.Mesh

    The parent of the mesh.

  • mesh BABYLON.Mesh

    The stairway mesh.

  • materialItem wnp.StandardMaterial

    The item material.

computeSteps

() private

Compute the point of the step of a straight stairway.

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

draw

(
  • ctx
  • tmpPoint
)
private

Draw the straight stairway.

Parameters:

  • ctx CanvasRenderingContext2D

    Context 2D of the canvas.

  • tmpPoint BABYLON.Vector2

    The temporary position of the stairway.

drawStep

(
  • ctx
  • step
)

Draws the step.

Parameters:

drawStepBearing

(
  • ctx
  • polygon
  • end
)
private

Draw the bearing.

Parameters:

  • ctx CanvasRenderingContext2D

    Context 2D of the canvas.

  • polygon BABYLON.Vector2

    The polygon points of the bearing.

  • end Number

    Know if it is the last bearing or not.

drawStepStairs

(
  • ctx
  • segment
)
private

Draw all the steps of the stairway.

Parameters:

getAvailableProperties

() Object[]

Inherited from StairwayStructure:

Gets the available properties of the object (user-customizable).

Returns:

Object[]:

An array containing several properties of the object.

getBoundPoints

(
  • step
)
BABYLON.Vector2

Get the bounding points of a step.

Parameters:

  • step Number

    The n-th step of the stairway.

Returns:

BABYLON.Vector2:

An array of the bounding points.

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.

getHopperPoints

() BABYLON.Vector2

Inherited from StairwayStructure:

Gets the hopper points created by the stairway.

Returns:

BABYLON.Vector2:

The four points of the hopper carved in the upper floor.

getNormalAtPoint

(
  • index
)
BABYLON.Vector3 deprecated

Inherited from StairwayStructure:

Gets the normal at the given index point.

Parameters:

  • index Number

    The index of the point.

Returns:

BABYLON.Vector3:

The normal at the point.

getStepBoundPoints

(
  • bottomIndex
)
BABYLON.Vector3 private

Inherited from StairwayStructure:

Returns the 4 points of the step.

Parameters:

  • bottomIndex Number

    The index of the bottom point of the step.

Returns:

BABYLON.Vector3:

The four points of a step.

initialize

() private

Inherited from BaseStructure:

Method called after the loading of the component

isTargeted

(
  • vector
)
Boolean

Check if the stair is targeted by the given vector.

Parameters:

  • vector BABYLON.Vector2

    A position, usually the one of the cursor.

Returns:

Boolean:

True if target by the vector.

isValid

() Boolean

Checks if the stair is valid and has enough points to create the 3D mesh.

Returns:

Boolean:

True if valid.

remove

(
  • structure
)

Inherited from StairwayStructure:

Deletes the stairway.

Parameters:

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

bearing

Boolean

Inherited from StairwayStructure:

Has a bearing.

Default: true

diameter

Number

Inherited from StairwayStructure:

The diameter of the middle of the stairway.

Default: 6

elevation

Number

Inherited from StairwayStructure:

The elevation of the stairway.

Default: 0

have_contremarche

Boolean

Inherited from StairwayStructure:

Has a riser

Default: true

height

Number

Inherited from StairwayStructure:

Height of the stairway.

Default: 250

id

Number

Inherited from BaseStructure:

Unique ID for the structure set up automatically

limon

Number

Inherited from StairwayStructure:

Has a limon.

Default: -1

materials

Object

Inherited from StairwayStructure:

The materials of the stairway. Nested object.

name

String

Inherited from BaseStructure:

Structure name

orientation

Boolean

Inherited from StairwayStructure:

The orientation of the stairway.

Default: true

points

BABYLON.Vector3

Inherited from StairwayStructure:

The points defining the path of the stairway.

rail_a

Boolean

Inherited from StairwayStructure:

Has a rail on the 'a' side.

Default: true

rail_b

Boolean

Inherited from StairwayStructure:

Has a rail on the 'b' side.

Default: true

room

RoomStructure

Inherited from StairwayStructure:

The parent room.

stair_height

Number

Inherited from StairwayStructure:

The stair height.

Default: 20

stair_offset

Number

Inherited from StairwayStructure:

The stair offset.

Default: 3

stair_thickness

Number

Inherited from StairwayStructure:

The stair thickness.

Default: 3

stair_width

Number

Inherited from StairwayStructure:

The stair width.

Default: 25

stick_spacement

Number

Inherited from StairwayStructure:

The stick spacement.

Default: 20

type

String

Inherited from StairwayStructure:

Type of the stairway (straight or spiral).

Default: "straight"

width

Number

Inherited from StairwayStructure:

Width of the stairway.

Default: 90