import BufferRepresentation from 'ngl/src/representation/buffer-representation.js'
BufferRepresentation
Extends:
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" );
// 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 } );
} );
Constructor Summary
Public Constructor | ||
public |
constructor(buffer: Buffer, viewer: Viewer, params: RepresentationParameters) Create Buffer representation |
Member Summary
Public Members | ||
public |
|
|
public |
|
|
public |
|
Inherited Summary
From class Representation | ||
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
Counter that keeps track of tasks related to the creation of the representation, including surface calculations. |
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
private |
|
|
private |
|
|
public |
attach() |
|
public |
build() |
|
public |
clear() |
|
public |
create() |
|
public |
dispose() |
|
public |
|
|
public |
|
|
public |
|
|
public |
init() |
|
public |
make() |
|
public |
setColor() |
|
public |
setParameters(params: RepresentationParameters, what: Object, rebuild: Boolean): Representation Set the visibility of the representation |
|
public |
setVisibility(value: Boolean, noRenderRequest: Boolean): Representation Set the visibility of the representation |
|
public |
update() |
|
public |
|
Public Constructors
public constructor(buffer: Buffer, viewer: Viewer, params: RepresentationParameters) source
Create Buffer representation
Override:
Representation#constructorParams:
Name | Type | Attribute | Description |
buffer | Buffer | a buffer object |
|
viewer | Viewer | a viewer object |
|
params | RepresentationParameters | representation parameters |