Selection
Extends:
An object selection.
Object selections use render layers to facilitate quick and efficient visibility changes.
Constructor Summary
Public Constructor | ||
public |
constructor(iterable: Iterable<Object3D>, layer: Number) Constructs a new selection. |
Member Summary
Public Members | ||
public |
Controls whether objects that are added to this selection should be removed from all other layers. |
|
public get |
The render layer for selected objects. |
|
public set |
|
Method Summary
Public Methods | ||
public |
Adds an object to this selection. |
|
public |
Clears this selection. |
|
public |
Removes an object from this selection. |
|
public |
this method was deprecated. Use layer instead.
Returns the current render layer for selected objects. |
|
public |
this method was deprecated. Added for backward-compatibility.
An alias for has. |
|
public |
this method was deprecated. Use exclusive instead.
Indicates whether objects that are added to this selection will be removed from all other layers. |
|
public |
Clears this selection and adds the given objects. |
|
public |
setExclusive(value: Number) this method was deprecated. Use exclusive instead.
Controls whether objects that are added to this selection should be removed from all other layers. |
|
public |
this method was deprecated. Use layer instead.
Sets the render layer for selected objects. |
|
public |
setVisible(visible: Boolean): Selection Sets the visibility of all selected objects. |
|
public |
Removes an existing object from the selection. |
Public Constructors
public constructor(iterable: Iterable<Object3D>, layer: Number) source
Constructs a new selection.
Params:
Name | Type | Attribute | Description |
iterable | Iterable<Object3D> |
|
A collection of objects that should be added to this selection. |
layer | Number |
|
A dedicated render layer for selected objects. Range is |
Public Members
public exclusive: boolean source
Controls whether objects that are added to this selection should be removed from all other layers.
public set layer source
Public Methods
public add(object: Object3D): Selection source
Adds an object to this selection.
If exclusive is set to true
, the object will also be removed from all other layers.
Params:
Name | Type | Attribute | Description |
object | Object3D | The object that should be selected. |
public delete(object: Object3D): Boolean source
Removes an object from this selection.
Params:
Name | Type | Attribute | Description |
object | Object3D | The object that should be deselected. |
Return:
Boolean | Returns true if an object has successfully been removed from this selection; otherwise false. |
public getLayer(): Number source
Returns the current render layer for selected objects.
The default layer is 2. If this collides with your own custom layers, please change it before rendering!
public indexOf(object: Object3D): Number source
An alias for has.
Params:
Name | Type | Attribute | Description |
object | Object3D | An object. |
public isExclusive(): Number source
Indicates whether objects that are added to this selection will be removed from all other layers.
public set(objects: Iterable<Object3D>): Selection source
Clears this selection and adds the given objects.
Params:
Name | Type | Attribute | Description |
objects | Iterable<Object3D> | The objects that should be selected. |
public setExclusive(value: Number) source
Controls whether objects that are added to this selection should be removed from all other layers.
Params:
Name | Type | Attribute | Description |
value | Number | Whether this selection should be exclusive. |
public setLayer(value: Number) source
Sets the render layer for selected objects.
The current selection will be updated accordingly.
Params:
Name | Type | Attribute | Description |
value | Number | The layer. Range is [0, 31]. |