WanaPlan

API Docs for: 2.7.0
Show:

SwimmingPoolStructure

Extends BaseStructure
Module: Component
Parent Module: Wanaplan

Summary

SwimmingPool's structure.

Constructor

SwimmingPoolStructure

Syntax

SwimmingPoolStructure

()

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

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.

checkCoherence

Syntax

checkCoherence

(
  • targetPoint
  • targetSide
)
Boolean private

Summary

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

Syntax

checkCoherence

(
  • targetPoint
  • targetSide
)
Boolean private

Summary

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

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

getAvailableProperties

Syntax

getAvailableProperties

() Array

Summary

Returns the user-customizable properties of this swimmingPool.

Returns:

Array:

Properties.

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.

getWidthLength

Syntax

getWidthLength

(
  • isLength
)

Summary

Sets width or length of the swimmingPool.

Parameters:

  • isLength Boolean

    if it is length or width.

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

Returns:

Boolean:

False if the structure is corrupted, true otherwise.

move

Syntax

move

(
  • moveVector
)

Summary

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

Syntax

remove

(
  • structure
)

Summary

Removes the swimmingPool.

Parameters:

  • structure FloorStructure

    The structure from which the swimmingPool must be removed.

rotate

Syntax

rotate

(
  • moveVector
)

Summary

Rotate the swimmingPool in 2D.

Parameters:

  • moveVector BABYLON.Vector2

    move of the mouse.

serialize

Inherited from BaseStructure:

Syntax

serialize

() Object

Summary

Serializes the object (to JSON)

Returns:

Object:
The serialization result, null if nothing is serialized

setBassinPosition

Syntax

setBassinPosition

()

Summary

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

setPoints

Syntax

setPoints

()

Summary

Sets vertices of the swimmingPool.

setPointsByMeasure

Syntax

setPointsByMeasure

(
  • isLength
  • newValue
)

Summary

Sets vertices of the swimmingPool'tickness.

Parameters:

  • isLength Boolean

    if it is length or width.

  • newValue Number

    the new width or length.

setRotateTarget

Syntax

setRotateTarget

()

Summary

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

setThicknessPoints

Syntax

setThicknessPoints

()

Summary

Sets vertices of the swimmingPool'tickness.

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

The decorable meshes are:

  • font
  • thicknessMesh

modified

Syntax

modified

Boolean

Summary

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

Default: false

name

Inherited from BaseStructure:

Syntax

name

String

Summary

Structure name

points

Syntax

points

BABYLON.Vector2

Summary

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 ] ).