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

Indexable

[key: string]: any

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 } ); } );

Index

Constructors

constructor

Properties

buffer

buffer: Buffer[]

bufferList

bufferList: Buffer[]

Protected clipCenter

clipCenter: Vector3

Protected clipNear

clipNear: number

Protected clipRadius

clipRadius: number

Protected colorDomain

colorDomain: number[]

Protected colorMode

colorMode: ColorMode

Protected colorReverse

colorReverse: boolean

Protected colorScale

colorScale: string | string[]

Protected colorScheme

colorScheme: string

Protected colorValue

colorValue: number

Protected depthWrite

depthWrite: boolean

Protected diffuse

diffuse: number

Protected Optional diffuseInterior

diffuseInterior: undefined | false | true

Protected disableImpostor

disableImpostor: boolean

Protected disablePicking

disablePicking: boolean

Protected disposed

disposed: boolean

Protected flatShaded

flatShaded: boolean

Protected interiorColor

interiorColor: number

Protected interiorDarkening

interiorDarkening: number

lazy

lazy: boolean

lazyProps

lazyProps: { bufferParams: BufferParameters | {}; build: boolean; what: {} }

Type declaration

Protected manualAttach

manualAttach: () => any

Type declaration

    • (): any
    • Returns any

Protected matrix

matrix: Matrix4

Protected metalness

metalness: number

Protected name

name: string

Protected opacity

opacity: number

Protected openEnded

openEnded: boolean

parameters

parameters: any

Protected radialSegments

radialSegments: number

Protected roughness

roughness: number

Protected side

Protected sphereDetail

sphereDetail: number

tasks

tasks: Counter

Protected toBePrepared

toBePrepared: boolean

type

type: string

Protected Optional useInteriorColor

useInteriorColor: undefined | false | true

viewer

viewer: Viewer

visible

visible: boolean

Protected wireframe

wireframe: boolean

Methods

attach

  • attach(callback: () => void): void

build

  • build(updateWhat?: undefined | {}): void

clear

  • clear(): void

create

  • create(): void

dispose

  • dispose(): void

getBufferParams

  • getBufferParams(p?: {}): { clipCenter: Vector3; clipNear: number; clipRadius: number; depthWrite: boolean; diffuse: number; diffuseInterior: undefined | false | true; disablePicking: boolean; flatShaded: boolean; interiorColor: number; interiorDarkening: number; matrix: Matrix4; metalness: number; opacity: number; roughness: number; side: "double" | "front" | "back"; useInteriorColor: undefined | false | true; wireframe: boolean } & {}
  • Parameters

    • Default value p: {} = {}
      • [k: string]: any

    Returns { clipCenter: Vector3; clipNear: number; clipRadius: number; depthWrite: boolean; diffuse: number; diffuseInterior: undefined | false | true; disablePicking: boolean; flatShaded: boolean; interiorColor: number; interiorDarkening: number; matrix: Matrix4; metalness: number; opacity: number; roughness: number; side: "double" | "front" | "back"; useInteriorColor: undefined | false | true; wireframe: boolean } & {}

getColorParams

getParameters

  • getParameters(): {}

init

make

  • make(updateWhat?: undefined | false | true, callback?: undefined | (() => void)): void

prepare

  • prepare(cb: () => void): void

setColor

setParameters

setVisibility

  • setVisibility(value: boolean, noRenderRequest?: undefined | false | true): Representation

update

  • update(what?: any): void

updateParameters

Generated using TypeDoc