Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Component

Base class for components

Hierarchy

Index

Constructors

constructor

Properties

annotationList

annotationList: Annotation[] = []

controls

matrix

matrix: Matrix4 = new Matrix4()

object

object: any

parameters

position

position: Vector3 = new Vector3()

quaternion

quaternion: Quaternion = new Quaternion()

reprList

reprList: RepresentationElement[] = []

scale

scale: Vector3 = new Vector3(1, 1, 1)

stage

stage: Stage

stage object the component belongs to

transform

transform: Matrix4 = new Matrix4()

uuid

uuid: string

viewer

viewer: Viewer

Accessors

defaultParameters

  • get defaultParameters(): object

name

  • get name(): string

status

  • get status(): string

type

  • get type(): string

visible

  • get visible(): boolean

Methods

Protected _addRepresentation

  • Add a new representation to the component

    Parameters

    • type: string

      the name of the representation

    • object: any

      the object on which the representation should be based

    • params: any
    • Default value hidden: boolean = false

    Returns RepresentationElement

    the created representation wrapped into a representation element object

addAnnotation

addBufferRepresentation

  • addBufferRepresentation(buffer: any, params: any): any

Abstract addRepresentation

  • addRepresentation(type: any, params: any): any

autoView

  • autoView(duration?: undefined | number): void

dispose

  • dispose(): void

eachAnnotation

  • eachAnnotation(callback: function): void

eachRepresentation

  • eachRepresentation(callback: function): void

getBox

  • getBox(...args: any[]): Box3

getBoxUntransformed

  • getBoxUntransformed(...args: any[]): Box3

getCenter

  • getCenter(...args: any[]): Vector3

getCenterUntransformed

  • getCenterUntransformed(...args: any[]): Vector3

getZoom

  • getZoom(...args: any[]): number

hasRepresentation

removeAllAnnotations

  • removeAllAnnotations(): void

removeAllRepresentations

  • removeAllRepresentations(): void

removeAnnotation

removeRepresentation

setName

  • setName(value: string): this

setPosition

  • setPosition(p: [number, number, number] | Vector3): this
  • Set position transform

    example

    // translate by 25 angstrom along x axis component.setPosition([ 25, 0, 0 ]);

    Parameters

    • p: [number, number, number] | Vector3

      the coordinates

    Returns this

    this object

setRotation

  • setRotation(r: [number, number, number] | Euler | Quaternion): this
  • Set rotation transform

    example

    // rotate by 2 degree radians on x axis component.setRotation( [ 2, 0, 0 ] );

    Parameters

    • r: [number, number, number] | Euler | Quaternion

      the rotation

    Returns this

    this object

setScale

  • setScale(s: number): this
  • Set scale transform

    example

    // scale by factor of two component.setScale( 2 );

    Parameters

    • s: number

      the scale

    Returns this

    this object

setStatus

  • setStatus(value: string): this

setTransform

  • setTransform(m: Matrix4): this
  • Set general transform. Is applied before and in addition to the position, rotation and scale transformations

    example

    component.setTransform( matrix );

    Parameters

    • m: Matrix4

      the matrix

    Returns this

    this object

setVisibility

  • setVisibility(value: boolean): this
  • Set the visibility of the component, including added representations

    Parameters

    • value: boolean

      visibility flag

    Returns this

    this object

updateMatrix

  • updateMatrix(): void

updateRepresentations

  • updateRepresentations(what: any): void

Object literals

signals

signals: object

Events emitted by the component

disposed

disposed: Signal<T> = new Signal()

matrixChanged

matrixChanged: Signal<T> = new Signal()

nameChanged

nameChanged: Signal<T> = new Signal()

representationAdded

representationAdded: Signal<T> = new Signal()

representationRemoved

representationRemoved: Signal<T> = new Signal()

statusChanged

statusChanged: Signal<T> = new Signal()

visibilityChanged

visibilityChanged: Signal<T> = new Signal()

Generated using TypeDoc