Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BufferRepresentation

Representation for showing buffer objects. Good for efficiently showing large amounts of geometric primitives e.g. spheres via SphereBuffer. Smaller numbers of geometric primitives are more easily shown with help from the Shape class.

Name: buffer

example

// add a single red sphere from a buffer to a shape instance var shape = new NGL.Shape( "shape" ); var sphereBuffer = new NGL.SphereBuffer( { position: new Float32Array( [ 0, 0, 0 ] ), color: new Float32Array( [ 1, 0, 0 ] ), radius: new Float32Array( [ 1 ] ) } ); shape.addBuffer( sphereBuffer ); var shapeComp = stage.addComponentFromObject( shape ); shapeComp.addRepresentation( "buffer" );

example

// add a single red sphere from a buffer to a structure component instance stage.loadFile( "rcsb://1crn" ).then( function( o ){ var sphereBuffer = new NGL.SphereBuffer( { position: new Float32Array( [ 0, 0, 0 ] ), color: new Float32Array( [ 1, 0, 0 ] ), radius: new Float32Array( [ 1 ] ) } ); o.addBufferRepresentation( sphereBuffer, { opacity: 0.5 } ); } );

Hierarchy

Index

Constructors

constructor

Methods

attach

  • attach(callback: any): void

build

  • build(updateWhat: any): void

clear

  • clear(): void

create

  • create(): void

dispose

  • dispose(): void

getBufferParams

  • getBufferParams(p: any): any

getColorParams

  • getColorParams(p: any): any

getParameters

  • getParameters(): object

init

  • init(params: any): void

make

  • make(updateWhat: any, callback: any): void

setColor

  • setColor(value: any, p: any): this

setParameters

  • setParameters(params: object, what?: object, rebuild?: boolean): Representation

setVisibility

  • setVisibility(value: boolean, noRenderRequest: boolean): Representation

update

  • update(): void

updateParameters

  • updateParameters(bufferParams?: object, what: any): void

Generated using TypeDoc