API Docs for: 2.7.3
Show:

SwimmingPoolStructure Class

Extends BaseStructure
Module: Component
Parent Module: Wanaplan

SwimmingPool's structure.

Constructor

SwimmingPoolStructure

()

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

Adds a material.

Parameters:

  • parent BABYLON.Mesh

    The parent of the mesh.

  • mesh BABYLON.Mesh

    The stairway mesh.

  • materialItem wnp.StandardMaterial

    The item material.

checkCoherence

(
  • targetPoint
  • targetSide
)
Boolean private

Checks the coherence of swimmingPool's bassin.

Parameters:

  • targetPoint Number

    the point targeted in the drag.

  • targetSide Number

    the side targeted in the drag.

Returns:

Boolean:

True if the swimmingPool is coherent.

checkCoherence

(
  • targetPoint
  • targetSide
)
Boolean private

Checks the coherence of swimmingPool's points.

Parameters:

  • targetPoint Number

    the point targeted in the drag.

  • targetSide Number

    the side targeted in the drag.

Returns:

Boolean:

True if the swimmingPool is coherent.

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

getAvailableProperties

() Array

Returns the user-customizable properties of this swimmingPool.

Returns:

Array:

Properties.

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.

getWidthLength

(
  • isLength
)

Sets width or length of the swimmingPool.

Parameters:

  • isLength Boolean

    if it is length or width.

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 swimmingPool.

Returns:

Boolean:

False if the structure is corrupted, true otherwise.

move

(
  • moveVector
)

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

Parameters:

  • moveVector BABYLON.Vector2

    The translation vector by which the swimmingPool will by moved.

remove

(
  • structure
)

Removes the swimmingPool.

Parameters:

  • structure FloorStructure

    The structure from which the swimmingPool must be removed.

rotate

(
  • moveVector
)

Rotate the swimmingPool in 2D.

Parameters:

  • moveVector BABYLON.Vector2

    move of the mouse.

serialize

() Object

Inherited from BaseStructure:

Serializes the object (to JSON)

Returns:

Object: The serialization result, null if nothing is serialized

setBassinPosition

()

Sets the position in 2D of the swimmingPool's bassin.

setPoints

()

Sets vertices of the swimmingPool.

setPointsByMeasure

(
  • isLength
  • newValue
)

Sets vertices of the swimmingPool'tickness.

Parameters:

  • isLength Boolean

    if it is length or width.

  • newValue Number

    the new width or length.

setRotateTarget

()

Sets the position in 2D of the swimmingPool's rotating ring.

setThicknessPoints

()

Sets vertices of the swimmingPool'tickness.

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 swimmingPool.

The decorable meshes are:

  • font
  • thicknessMesh

modified

Boolean

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

Default: false

name

String

Inherited from BaseStructure:

Structure name

points

BABYLON.Vector2

The vertices of the swimmingPool. Points can be moved, added ( a swimmingPool 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 ] ).