Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ShapeComponent

Component wrapping a Shape object

example

// get a shape component by adding a shape object to the stage var shape = new NGL.Shape( "shape" ); shape.addSphere( [ 0, 0, 0 ], [ 1, 0, 0 ], 1.5 ); var shapeComponent = stage.addComponentFromObject( shape ); shapeComponent.addRepresentation( "buffer" );

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)

shape

shape: Shape

stage

stage: Stage

stage object the component belongs to

transform

transform: Matrix4 = new Matrix4()

uuid

uuid: string

viewer

viewer: Viewer

Accessors

defaultParameters

  • get defaultParameters(): { name: string; status: string; visible: boolean }

name

  • get name(): string

status

  • get status(): string

type

  • get type(): string

visible

  • get visible(): boolean

Methods

Protected _addRepresentation

addAnnotation

addBufferRepresentation

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

addRepresentation

autoView

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

dispose

  • dispose(): void

eachAnnotation

  • eachAnnotation(callback: (a: Annotation) => void): void

eachRepresentation

getBox

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

getBoxUntransformed

  • getBoxUntransformed(): Box3

getCenter

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

getCenterUntransformed

  • getCenterUntransformed(): 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 local rotation transform (for global rotation use setTransform)

    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

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

updateMatrix

  • updateMatrix(): void

updateRepresentationMatrices

  • updateRepresentationMatrices(): 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