WanaPlan

API Docs for: 2.7.0
Show:

WallPane3D

Module: Component
Parent Module: Wanaplan

Summary

3D decorable wall panes.

Constructor

WallPane3D

Syntax

WallPane3D

(
  • points
  • parent
  • parentWallSide
)

Summary

Parameters:

  • points BABYLON.Vector2

    Array of 2 vectors, for the 2 endings of the wall pane.

  • parent WallStructure

    Parent wall, which induced the wall pane.

  • parentWallSide BABYLON.Vector2

    A normal vector to the wall pane. It indicates on which side of the parent wall the pane lies.

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

(
  • material
)
BABYLON.Material

Summary

Adds or changes a material for the wall pane.

Parameters:

  • material BABYLON.Material

    The new Material.

Returns:

BABYLON.Material:

The old material, null if the WallPane did not have a material.

apply

Syntax

apply

()

Summary

Applies the material of the pane onto the wall mesh

center

Inherited from MeasureStructure:

Syntax

center

() BABYLON.Vector2

Summary

Returns the center of the measure.

Returns:

BABYLON.Vector2:
The center.

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

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.

getMaterial

Syntax

getMaterial

() BABYLON.Material

Summary

Returns the material of this wall pane.

Returns:

BABYLON.Material:

The material, null if the WallPane does not have a material.

identifyWithPanes

Syntax

identifyWithPanes

(
  • panes
)
Number

Summary

Identifies the wallpane with a set of wallpanes. Returns the pane the more similar with this pane, comparing the center and normal.

Parameters:

Returns:

Number:

The index in the list pointing to the most alike wallpane.

initialize

Inherited from BaseStructure:

Syntax

initialize

() private

Summary

Method called after the loading of the component

mergeMeasures

Inherited from MeasureStructure:

Syntax

mergeMeasures

(
  • measures
)

Summary

Tries to merge this measure with a set of measures.

Parameters:

nearestMaterial

Syntax

nearestMaterial

(
  • materialInfos
)
Number

Summary

Compares this wallPane's materialInfo to a list a materialInfos. Returns the materialInfo geometrically closest to this wallPane's materialInfo.

Parameters:

Returns:

Number:

The index of the closest materialInfo.

needToDelete

Inherited from MeasureStructure:

Syntax

needToDelete

(
  • measure
)
Boolean

Summary

Determine if 2 measures are very close together If it is the case, we delete one of the two measures.

Parameters:

Returns:

Boolean:
True if measures are close.

normal

Inherited from MeasureStructure:

Syntax

normal

() BABYLON.Vector2

Summary

Returns a normal vector to the measure. NB : The direction of this vector is away from the wall carrying the measure.

Returns:

BABYLON.Vector2:
The normal vector.

serialize

Inherited from BaseStructure:

Syntax

serialize

() Object

Summary

Serializes the object (to JSON)

Returns:

Object:
The serialization result, null if nothing is serialized

setMaterial

Syntax

setMaterial

(
  • material
)
BABYLON.Material

Summary

Adds or changes a material for the wall pane. This is an alias for addMaterial.

Parameters:

  • material BABYLON.Material

    The new Material.

Returns:

BABYLON.Material:

The old material, null if the WallPane did not have a material.

setRoom

Syntax

setRoom

(
  • room
)

Summary

Sets the parent room reference.

Parameters:

tryMerge

Inherited from MeasureStructure:

Syntax

tryMerge

(
  • measure
)
Boolean

Summary

Tries to merge this measure with another measure. Only merges if the measures are aligned and touch each other.

Parameters:

Returns:

Boolean:
True if the measure has been merged, false otherwise.

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

materialIndex

Syntax

materialIndex

Number

Summary

Material index in the wall mesh.

materialInfo

Syntax

materialInfo

MaterialInfo

Summary

Material information on this wall pane.

name

Inherited from BaseStructure:

Syntax

name

String

Summary

Structure name

offsetVector

Inherited from MeasureStructure:

Syntax

offsetVector

BABYLON.Vector2

Summary

Normalized vector indicating in which direction to offset the display of the measure in relation to the wall.

parent

Inherited from MeasureStructure:

Syntax

parent

WallStructure

Summary

Parent wall inducing the measure.

points

Inherited from MeasureStructure:

Syntax

points

BABYLON.Vector2

Summary

Contains all the points where to split the measure, ordered by increasing distance to points[0].

room

Syntax

Summary

Reference of the parent room containing this pane.

wallMesh

Syntax

wallMesh

BABYLON.Mesh

Summary

A reference to the wall mesh carrying the pane