Class vxlScene

Constructor

vxlScene()
Each view has a vxlScene object associated to it. The actors added to the scene are those that the renderer's view will render. Actors can be added/removed from the scene at any time. The scene also determines the lookup table that is used by the actors in it. A scene can have one or more views associated to it.
Author: Diego Cantor.

Methods

.addActor(actor)
Adds one actor.The added actor becomes the current one (vxl.c.actor)

Parameters:

Type Name Description
actor

the actor to be added to the scene

.clearAnimation()
Removes the animation if there is one associated to this scene

See:

vxlFrameAnimation
.computeBoundingBox()
Calculates the global bounding box and the center of the scene.Updates the Scene's axis and bounding box toys.
.createActor(model)
This function creates AND ADD a new actor to this scene

Parameters:

Type Name Description
vxlModel model

the model from which a new actor will be created AND added to this sceneIf you are looking to create but not adding an actor call new vxlActor(model) instead.

Returns:

actor the actor that was created and added to the scene, from the model passed as parameter
.createActorGroup(name, list)
Creates an actor group

Parameters:

Type Name Description
Object name

name of the actor group

Object list

list of actors to add to the actor group. Elements in the list can beactor classes, actors UID, actor names or any combination of these.

See:

.createActors(models)
Creates multiples actors at once

Parameters:

Type Name Description
[ vxlModel ] models

a list of models to create actors from

.flipNormals()
Flips the normals for all the actors in the scene. This willhave an immediate effect in the side of the object that it is being lit.
.getActor(actorNameOrUID)
Retrieves an actor by Name or UID

Parameters:

Type Name Description
actorNameOrUID

vxlActor|null .getActorByCellUID(cellUID)
Given a cell uid the scene identifies the actor it belongs to. If an actor is not foundthis method returns null

Parameters:

Type Name Description
String cellUID

Returns:

{vxlActor|null}
.getActorByName(name)
Retrieves an actor object by name

Parameters:

Type Name Description
name

the name of the actor to retrieve

.getActorByUID(UID)
Retrieves an actor object by Unique Identifier (UID)

Parameters:

Type Name Description
UID

the actor's UID

.getActorGroup(name)
Retrieves an actor group by name

Parameters:

Type Name Description
Object name

Array .getActorNames()
Returns a list with the actor names

Returns:

{Array} a list with the actor names
Array .getActorsThat(condition)

Returns a list of actors based on the condition passed as parameter.

The condition is a function with the following signature:

condition(vxlActor): returns boolean

If the condition evaluates true then that actor is included in the results

Parameters:

Type Name Description
function condition

the condition to evaluate in the actor list it receives an actor as a parameter

Returns:

{Array} list of actors
.getPickableActors()
Return a list with the actors that are currently pickable
.handleEvent(event, the)
Handles events sent by vxlNotifier

Parameters:

Type Name Description
String event

This event should be defined in vxl.events

Object the

source that sent the event. Useful for callbacks

.hasActor(actor)
Verifies if the actor passed as a parameter belongs to this scene

Parameters:

Type Name Description
vxlActor|String actor

the actor object or the actor name to verify

.removeActor(actor)
Removes one actor

Parameters:

Type Name Description
actor

the actor to be removed from the scene

.reset()
.setAnimation(animation)
Sets the animation for this scene

Parameters:

Type Name Description
vxlFrameAnimation animation

the animation to set on this scene

See:

vxlFrameAnimation
.setLoadingMode(mode)
Sets the loading mode for this scene

Parameters:

Type Name Description
mode

one of the valid loading modes

See:

.setLookupTable(lutID)
Sets a new lookup table by passing the lookup table id

Parameters:

Type Name Description
lutID

the lookup table id

.setOpacity(o, name)
Changes the opacity for one or all actors in the scene

Parameters:

Type Name Description
o

opacity value [0..1]

name

the name of the actor whose opacity will be changed. If this parameter is missing, the opacity of all actors will be changed.

.setPropertyFor(list, property, value)
Sets a property for a list of actors.

Parameters:

Type Name Description
Array list

list of actors (String or vxlActor)

String property

the name of the actor property

Object value

the value of the property

.setPropertyForAll(property, value)
Sets a property for all the actors in the scene

Parameters:

Type Name Description
String property

the name of the actor property

Object value

the value of the property

.setVisualizationMode(mode)
Changes the visualization mode for all the objects in the scene

Parameters:

Type Name Description
mode

the visualization mode. It can be... TODO

.updateActor(actor)
Recreates the WebGL buffers when an actor has changed its geometry

Parameters:

Type Name Description
actor

the actor to be updated

.updateScalarRange()
Updates the Scene's scalarMAX and scalarMIN properties.