Class Index | File Index

Classes


Class ModelManager


Defined in: ModelManager.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Singleton managing 3D models cache.
Field Summary
Field Attributes Field Name and Description
<static>  
ModelManager.LIGHT_SHAPE_PREFIX
Shape3D name prefix for lights.
<static>  
ModelManager.MIRROR_SHAPE_PREFIX
Shape3D name prefix for mirror shapes.
<static>  
Shape3D name prefix for window pane shapes.
Method Summary
Method Attributes Method Name and Description
 
Clears loaded models cache.
 
cloneNode(node, clonedSharedGroups)
Returns a clone of the given node.
 
Frees geometry data of the given node.
 
Returns the 2D area of the 3D shapes children of the given scene 3D node projected on the floor (plan y = 0), or of the given staircase if node is an instance of HomePieceOfFurniture.
 
getBounds(node, transformation)
Returns the bounds of the 3D shapes of node with an additional optional transformation.
 
getFrontArea(cutOutShape, node)
Returns the shape matching the given cut out shape if not null or the 2D area of the 3D shapes children of the node projected on its front side.
<static>  
ModelManager.getInstance()
Returns an instance of this singleton.
 
Returns the minimum size of a model.
 
getNormalizedTransform(node, modelRotation, width, modelCenteredAtOrigin)
Returns a transformation matrix that will transform the model node to let it fill a box of the given width centered on the origin.
 
getNormalizedTransformGroup(node, modelRotation, width, modelCenteredAtOrigin)
Returns a transform group that will transform the model node to let it fill a box of the given width centered on the origin.
 
getShape(svgPathShape)
Returns the shape matching the given SVG path shape.
 
getSize(node, transformation)
Returns the size of 3D shapes of node after an additional optional transformation.
 
loadModel(content, synchronous, modelObserver)
Reads a 3D node from content with supported loaders and notifies the loaded model to the given modelObserver once available with its modelUpdated and modelError methods.
 
unloadModel(content, disposeGeometries)
Removes the model matching the given content from the manager.
Class Detail
ModelManager()
Singleton managing 3D models cache.
Author: Emmanuel Puybaret.
Field Detail
<static> ModelManager.LIGHT_SHAPE_PREFIX
Shape3D name prefix for lights.

<static> ModelManager.MIRROR_SHAPE_PREFIX
Shape3D name prefix for mirror shapes.

<static> ModelManager.WINDOW_PANE_SHAPE_PREFIX
Shape3D name prefix for window pane shapes.
Method Detail
clear()
Clears loaded models cache.

cloneNode(node, clonedSharedGroups)
Returns a clone of the given node. All the children and the attributes of the given node are duplicated except the geometries and the texture images of shapes.
Parameters:
{Node3D} node
the root of a model
clonedSharedGroups

disposeGeometries(node)
Frees geometry data of the given node.
Parameters:
{Node3D} node
the root of a model

{Area} getAreaOnFloor(node)
Returns the 2D area of the 3D shapes children of the given scene 3D node projected on the floor (plan y = 0), or of the given staircase if node is an instance of HomePieceOfFurniture.
Parameters:
{Node3D|HomePieceOfFurniture} node
Returns:
{Area}

getBounds(node, transformation)
Returns the bounds of the 3D shapes of node with an additional optional transformation.
Parameters:
{Node3D} node
the root of a model
{Array} transformation Optional
the optional transformation applied to the model

getFrontArea(cutOutShape, node)
Returns the shape matching the given cut out shape if not null or the 2D area of the 3D shapes children of the node projected on its front side. The returned area is normalized in a 1 unit square centered at the origin.
Parameters:
cutOutShape
node

<static> {ModelManager} ModelManager.getInstance()
Returns an instance of this singleton.
Returns:
{ModelManager}

getMinimumSize()
Returns the minimum size of a model.

getNormalizedTransform(node, modelRotation, width, modelCenteredAtOrigin)
Returns a transformation matrix that will transform the model node to let it fill a box of the given width centered on the origin.
Parameters:
{Node3D} node
the root of a model with any size and location
{?Array} modelRotation
the rotation applied to the model before normalization or null if no transformation should be applied to node.
{number} width
the width of the box
{boolean} modelCenteredAtOrigin Optional
if true center will be moved to match the origin after the model rotation is applied

getNormalizedTransformGroup(node, modelRotation, width, modelCenteredAtOrigin)
Returns a transform group that will transform the model node to let it fill a box of the given width centered on the origin.
Parameters:
{Node3D} node
the root of a model with any size and location
{Array} modelRotation
the rotation applied to the model before normalization or null if no transformation should be applied to node.
{number} width
the width of the box
{boolean} modelCenteredAtOrigin Optional
if true or missing, center will be moved to match the origin after the model rotation is applied

{Shape} getShape(svgPathShape)
Returns the shape matching the given SVG path shape.
Parameters:
{string} svgPathShape
Returns:
{Shape}

getSize(node, transformation)
Returns the size of 3D shapes of node after an additional optional transformation.
Parameters:
{Node3D} node
the root of a model
{Array} transformation Optional
the optional transformation applied to the model

loadModel(content, synchronous, modelObserver)
Reads a 3D node from content with supported loaders and notifies the loaded model to the given modelObserver once available with its modelUpdated and modelError methods.
Parameters:
{URLContent} content
an object containing a model
{boolean} synchronous Optional
optional parameter equal to false by default
{{modelUpdated|modelError|progression}} modelObserver
the observer that will be notified once the model is available or if an error happens

unloadModel(content, disposeGeometries)
Removes the model matching the given content from the manager.
Parameters:
{URLContent} content
an object containing a model
{boolean} disposeGeometries
if true model geometries will be disposed too

© Copyrights 2017 Emmanuel PUYBARET / eTeks
Distributed under GNU General Public License
Documentation generated by JsDoc Toolkit 2.4.0 on Wed Oct 25 2017 16:36:09 GMT+0200 (CEST)