API Docs for: 2.7.3
Show:

WallPane3D Class

Module: Component
Parent Module: Wanaplan

3D decorable wall panes.

Constructor

WallPane3D

(
  • points
  • parent
  • parentWallSide
)

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

(
  • 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

(
  • material
)
BABYLON.Material

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

()

Applies the material of the pane onto the wall mesh

center

() BABYLON.Vector2

Inherited from MeasureStructure:

Returns the center of the measure.

Returns:

BABYLON.Vector2: The center.

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

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.

getMaterial

() BABYLON.Material

Returns the material of this wall pane.

Returns:

BABYLON.Material:

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

identifyWithPanes

(
  • panes
)
Number

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

() private

Inherited from BaseStructure:

Method called after the loading of the component

mergeMeasures

(
  • measures
)

Inherited from MeasureStructure:

Tries to merge this measure with a set of measures.

Parameters:

nearestMaterial

(
  • materialInfos
)
Number

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

(
  • measure
)
Boolean

Inherited from MeasureStructure:

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

() BABYLON.Vector2

Inherited from MeasureStructure:

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

() Object

Inherited from BaseStructure:

Serializes the object (to JSON)

Returns:

Object: The serialization result, null if nothing is serialized

setMaterial

(
  • material
)
BABYLON.Material

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

(
  • room
)

Sets the parent room reference.

Parameters:

tryMerge

(
  • measure
)
Boolean

Inherited from MeasureStructure:

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:

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

materialIndex

Number

Material index in the wall mesh.

materialInfo

MaterialInfo

Material information on this wall pane.

name

String

Inherited from BaseStructure:

Structure name

offsetVector

BABYLON.Vector2

Inherited from MeasureStructure:

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

parent

WallStructure

Inherited from MeasureStructure:

Parent wall inducing the measure.

points

BABYLON.Vector2

Inherited from MeasureStructure:

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

room

RoomStructure

Reference of the parent room containing this pane.

wallMesh

BABYLON.Mesh

A reference to the wall mesh carrying the pane