Component
Direct Subclass:
Base class for components
Constructor Summary
Public Constructor | ||
public |
constructor(stage: Stage, params: ComponentParameters) |
Member Summary
Public Members | ||
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
Events emitted by the component |
|
public |
|
|
public |
|
|
public |
|
|
public get |
|
|
public |
|
|
public |
|
|
public |
|
Method Summary
Public Methods | ||
public |
addAnnotation(position: Vector3, content: String | Element, params: Object): Annotation Add an anotation object |
|
public |
|
|
public |
addRepresentation(type: String, object: Object, params: RepresentationParameters): RepresentationComponent Add a new representation to the component |
|
public |
Automatically center and zoom the component |
|
public |
dispose() |
|
public |
eachAnnotation(callback: Function): undefined Iterator over each annotation and executing the callback |
|
public |
eachRepresentation(callback: Function): undefined Iterator over each representation and executing the callback |
|
public |
|
|
public abstract |
|
|
public |
|
|
public |
|
|
public |
getZoom() |
|
public |
|
|
public |
Remove all annotations from the component |
|
public |
Removes all representation components |
|
public |
removeAnnotation(annotation: Annotation): undefined Remove the give annotation from the component |
|
public |
Removes a representation component |
|
public |
setName() |
|
public |
setPosition(p: Vector3 | Array): Component Set position transform |
|
public |
setRotation(r: Quaternion | Euler | Array): Component Set rotation transform |
|
public |
Set scale transform |
|
public |
|
|
public |
setTransform(m: Matrix4): Component Set general transform. |
|
public |
setVisibility(value: Boolean): Component Set the visibility of the component, including added representations |
|
public |
|
|
public |
|
Public Constructors
public constructor(stage: Stage, params: ComponentParameters) source
Params:
Name | Type | Attribute | Description |
stage | Stage | stage object the component belongs to |
|
params | ComponentParameters | parameter object |
Public Members
public annotationList source
public controls source
public matrix source
public name source
public position source
public quaternion source
public reprList source
public scale source
public stage source
public status source
public transform source
public get type source
public uuid source
public viewer source
public visible source
Public Methods
public addAnnotation(position: Vector3, content: String | Element, params: Object): Annotation source
Add an anotation object
public addBufferRepresentation() source
public addRepresentation(type: String, object: Object, params: RepresentationParameters): RepresentationComponent source
Add a new representation to the component
Params:
Name | Type | Attribute | Description |
type | String | the name of the representation |
|
object | Object | the object on which the representation should be based |
|
params | RepresentationParameters |
|
representation parameters |
Return:
RepresentationComponent | the created representation wrapped into a representation component object |
public autoView(duration: Integer): undefined source
Automatically center and zoom the component
Params:
Name | Type | Attribute | Description |
duration | Integer |
|
duration of the animation, defaults to 0 |
public dispose() source
public eachAnnotation(callback: Function): undefined source
Iterator over each annotation and executing the callback
Params:
Name | Type | Attribute | Description |
callback | Function | function to execute |
public eachRepresentation(callback: Function): undefined source
Iterator over each representation and executing the callback
Params:
Name | Type | Attribute | Description |
callback | Function | function to execute |
public getCenterUntransformed() source
public getZoom() source
public hasRepresentation() source
public removeAnnotation(annotation: Annotation): undefined source
Remove the give annotation from the component
Params:
Name | Type | Attribute | Description |
annotation | Annotation | the annotation to remove |
public removeRepresentation(repr: RepresentationComponent): undefined source
Removes a representation component
Params:
Name | Type | Attribute | Description |
repr | RepresentationComponent | the representation component |
public setName() source
public setPosition(p: Vector3 | Array): Component source
Set position transform
Example:
// translate by 25 angstrom along x axis
component.setPosition( [ 25, 0, 0 ] );
public setRotation(r: Quaternion | Euler | Array): Component source
Set rotation transform
Params:
Name | Type | Attribute | Description |
r | Quaternion | Euler | Array | the rotation |
Example:
// rotate by 2 degree radians on x axis
component.setRotation( [ 2, 0, 0 ] );
public setScale(s: Number): Component source
Set scale transform
Params:
Name | Type | Attribute | Description |
s | Number | the scale |
Example:
// scale by factor of two
component.setScale( 2 );
public setStatus() source
public setTransform(m: Matrix4): Component source
Set general transform. Is applied before and in addition to the position, rotation and scale transformations
Params:
Name | Type | Attribute | Description |
m | Matrix4 | the matrix |
Example:
component.setTransform( matrix );
public setVisibility(value: Boolean): Component source
Set the visibility of the component, including added representations
Params:
Name | Type | Attribute | Description |
value | Boolean | visibility flag |