WanaPlan

API Docs for: 2.7.0
Show:

StraightStairwayStructure

Module: Component
Parent Module: Wanaplan

Summary

Stairway structure for straight stairways.

Constructor

StraightStairwayStructure

Syntax

StraightStairwayStructure

()

Summary

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.

addMaterial

Inherited from StairwayStructure:

Syntax

addMaterial

(
  • parent
  • mesh
  • materialItem
)
private

Summary

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

Syntax

computeSteps

() private

Summary

Compute the point of the step of a straight stairway.

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

draw

Syntax

draw

(
  • ctx
  • tmpPoint
)
private

Summary

Draw the straight stairway.

Parameters:

  • ctx CanvasRenderingContext2D

    Context 2D of the canvas.

  • tmpPoint BABYLON.Vector2

    The temporary position of the stairway.

drawStep

Syntax

drawStep

(
  • ctx
  • step
)

Summary

Draws the step.

Parameters:

  • ctx CanvasRenderingContext2D

    Context 2D of the canvas.

  • step Number

    The n-th step of the stairway.

drawStepBearing

Syntax

drawStepBearing

(
  • ctx
  • polygon
  • end
)
private

Summary

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

Syntax

drawStepStairs

(
  • ctx
  • segment
)
private

Summary

Draw all the steps of the stairway.

Parameters:

  • ctx CanvasRenderingContext2D

    Context 2D of the canvas.

  • segment BABYLON.Vector2

    The segment done by the step.

getAvailableProperties

Inherited from StairwayStructure:

Syntax

getAvailableProperties

() Object[]

Summary

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

Returns:

Object[]:

An array containing several properties of the object.

getBoundPoints

Syntax

getBoundPoints

(
  • step
)
BABYLON.Vector2

Summary

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

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.

getHopperPoints

Inherited from StairwayStructure:

Syntax

getHopperPoints

() BABYLON.Vector2

Summary

Gets the hopper points created by the stairway.

Returns:

BABYLON.Vector2:

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

getNormalAtPoint

Inherited from StairwayStructure:

Syntax

getNormalAtPoint

(
  • index
)
BABYLON.Vector3 deprecated

Summary

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

Inherited from StairwayStructure:

Syntax

getStepBoundPoints

(
  • bottomIndex
)
BABYLON.Vector3 private

Summary

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

Inherited from BaseStructure:

Syntax

initialize

() private

Summary

Method called after the loading of the component

isTargeted

Syntax

isTargeted

(
  • vector
)
Boolean

Summary

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

Syntax

isValid

() Boolean

Summary

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

Returns:

Boolean:

True if valid.

remove

Inherited from StairwayStructure:

Syntax

remove

(
  • structure
)

Summary

Deletes the stairway.

Parameters:

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

bearing

Inherited from StairwayStructure:

Syntax

bearing

Boolean

Summary

Has a bearing.

Default: true

diameter

Inherited from StairwayStructure:

Syntax

diameter

Number

Summary

The diameter of the middle of the stairway.

Default: 6

elevation

Inherited from StairwayStructure:

Syntax

elevation

Number

Summary

The elevation of the stairway.

Default: 0

have_contremarche

Inherited from StairwayStructure:

Syntax

have_contremarche

Boolean

Summary

Has a riser

Default: true

height

Inherited from StairwayStructure:

Syntax

height

Number

Summary

Height of the stairway.

Default: 250

id

Inherited from BaseStructure:

Syntax

id

Number

Summary

Unique ID for the structure set up automatically

limon

Inherited from StairwayStructure:

Syntax

limon

Number

Summary

Has a limon.

Default: -1

materials

Inherited from StairwayStructure:

Syntax

materials

Object

Summary

The materials of the stairway. Nested object.

name

Inherited from BaseStructure:

Syntax

name

String

Summary

Structure name

orientation

Inherited from StairwayStructure:

Syntax

orientation

Boolean

Summary

The orientation of the stairway.

Default: true

points

Inherited from StairwayStructure:

Syntax

points

BABYLON.Vector3

Summary

The points defining the path of the stairway.

rail_a

Inherited from StairwayStructure:

Syntax

rail_a

Boolean

Summary

Has a rail on the 'a' side.

Default: true

rail_b

Inherited from StairwayStructure:

Syntax

rail_b

Boolean

Summary

Has a rail on the 'b' side.

Default: true

room

Inherited from StairwayStructure:

Syntax

Summary

The parent room.

stair_height

Inherited from StairwayStructure:

Syntax

stair_height

Number

Summary

The stair height.

Default: 20

stair_offset

Inherited from StairwayStructure:

Syntax

stair_offset

Number

Summary

The stair offset.

Default: 3

stair_thickness

Inherited from StairwayStructure:

Syntax

stair_thickness

Number

Summary

The stair thickness.

Default: 3

stair_width

Inherited from StairwayStructure:

Syntax

stair_width

Number

Summary

The stair width.

Default: 25

stick_spacement

Inherited from StairwayStructure:

Syntax

stick_spacement

Number

Summary

The stick spacement.

Default: 20

type

Inherited from StairwayStructure:

Syntax

type

String

Summary

Type of the stairway (straight or spiral).

Default: "straight"

width

Inherited from StairwayStructure:

Syntax

width

Number

Summary

Width of the stairway.

Default: 90