MeasureStructure
Summary
The measure structure. Allows to merge and split measures.
Constructor
MeasureStructure
Syntax
MeasureStructure
-
points -
parent -
offsetVector
Summary
Parameters:
-
pointsBABYLON.Vector2The points where to split the measure, ordered by increasing distance to points[0].
-
parentWallStructureParent wall inducing the measure.
-
offsetVectorBABYLON.Vector2Normalized vector indicating in which direction to offset the display of the measure in relation to the wall.
Item Index
Methods
Properties
Methods
add
Syntax
add
-
propertyName -
value
Summary
Adds an element to the collection in parameter.Returns:
center
Syntax
center
()
BABYLON.Vector2
Summary
Returns the center of the measure.
Returns:
The center.
deserialize
Syntax
Summary
Deserializes the object (from JSON).Parameters:
-
hybridObjectJSON describing the object, built with the method serialize.
Returns:
The Structure object built from the deserialization
getElementByName
Syntax
Summary
Gets an element of the collection by its name.Parameters:
Returns:
getFloor
Syntax
Summary
Gets the floor referencing this objectParameters:
-
collectionStringCollection to search within.
Returns:
The floor containing this structure, -1 if the object has not been added to any floor collection.
initialize
Syntax
initialize
()
private
Summary
Method called after the loading of the componentmergeMeasures
Syntax
mergeMeasures
-
measures
Summary
Tries to merge this measure with a set of measures.
Parameters:
-
measuresMeasureStructure[]An array of measures.
needToDelete
Syntax
Summary
Determine if 2 measures are very close together If it is the case, we delete one of the two measures.
Parameters:
-
measureMeasureStructureAnother measure.
Returns:
True if measures are close.
normal
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:
The normal vector.
serialize
Syntax
Summary
Serializes the object (to JSON)Returns:
tryMerge
Syntax
Summary
Tries to merge this measure with another measure. Only merges if the measures are aligned and touch each other.
Parameters:
-
measureMeasureStructureAnother measure.
Returns:
True if the measure has been merged, false otherwise.
update
Syntax
update
()
Summary
Generic update method, must be overridden.updateReferences
Syntax
updateReferences
-
structure
Summary
Generic method for rebuilding references after the deserialization. For example : restoring the link between a PointStructure and its parent WallStructureParameters:
-
structurewnp.StructureFloor Structure to work with
Properties
offsetVector
Syntax
offsetVector
BABYLON.Vector2
Summary
Normalized vector indicating in which direction to offset the display of the measure in relation to the wall.
points
Syntax
points
BABYLON.Vector2
Summary
Contains all the points where to split the measure, ordered by increasing distance to points[0].