NGL@0.10.4 Home Manual Reference Source GalleryRepository
import SurfaceComponent from 'ngl/src/component/surface-component.js'
public class | source

SurfaceComponent

Extends:

Component → SurfaceComponent

Component wrapping a Surface object

Example:

// get a surface component by loading a surface file into the stage
stage.loadFile( "url/for/surface" ).then( function( surfaceComponent ){
    surfaceComponent.addRepresentation( "surface" );
    surfaceComponent.autoView();
} );

Constructor Summary

Public Constructor
public

constructor(stage: Stage, surface: Surface, params: ComponentParameters)

Member Summary

Public Members
public get

Component type

Method Summary

Public Methods
public

Add a new surface representation to the component

Inherited Summary

From class Component
public

Events emitted by the component

public

addAnnotation(position: Vector3, content: String | Element, params: Object): Annotation

Add an anotation object

public

Add a new representation to the component

public

autoView(duration: Integer): undefined

Automatically center and zoom the component

public
public abstract
public
public

Remove all annotations from the component

public

Removes all representation components

public

Remove the give annotation from the component

public

Removes a representation component

public

Set position transform

public

Set rotation transform

public

Set scale transform

public

Set general transform.

public

Set the visibility of the component, including added representations

Public Constructors

public constructor(stage: Stage, surface: Surface, params: ComponentParameters) source

Override:

Component#constructor

Params:

NameTypeAttributeDescription
stage Stage

stage object the component belongs to

surface Surface

surface object to wrap

params ComponentParameters

component parameters

Public Members

public get type: String source

Component type

Public Methods

public addRepresentation(type: String, params: SurfaceRepresentationParameters): RepresentationComponent source

Add a new surface representation to the component

Override:

Component#addRepresentation

Params:

NameTypeAttributeDescription
type String

the name of the representation, one of: surface, dot.

params SurfaceRepresentationParameters

representation parameters

Return:

RepresentationComponent

the created representation wrapped into a representation component object