Skybox

Methods

extend

Method use to decorate a given object (publicAPI+model) with vtkSkybox characteristics.

Argument Type Required Description
publicAPI Yes object on which methods will be bounds (public)
model Yes object on which data structure will be bounds (protected)
initialValues ISkyboxInitialValues No (default: {})

getFromat

getIsOpaque

getSupportsSelection

hasTranslucentPolygonalGeometry

newInstance

Method use to create a new instance of vtkSkybox

setFromat

Argument Type Required Description
format Yes

Source

index.d.ts
import vtkActor from "../Actor";

interface ISkyboxInitialValues {
format?: string;
}

export interface vtkSkybox extends vtkActor {

/**
*
*/
getFromat(): string;

/**
*
*/
getIsOpaque(): boolean;

/**
*
*/
getSupportsSelection(): boolean;

/**
*
*/
hasTranslucentPolygonalGeometry(): boolean;

/**
*
* @param format
*/
setFromat(format: string): boolean;
}

/**
* Method use to decorate a given object (publicAPI+model) with vtkSkybox characteristics.
*
* @param publicAPI object on which methods will be bounds (public)
* @param model object on which data structure will be bounds (protected)
* @param {ISkyboxInitialValues} [initialValues] (default: {})
*/
export function extend(publicAPI: object, model: object, initialValues?: ISkyboxInitialValues): void;

/**
* Method use to create a new instance of vtkSkybox
*/
export function newInstance(initialValues?: ISkyboxInitialValues): vtkSkybox;

/**
*
*/
export declare const vtkSkybox: {
newInstance: typeof newInstance,
extend: typeof extend,
};
export default vtkSkybox;
index.js
import macro from 'vtk.js/Sources/macros';
import vtkActor from 'vtk.js/Sources/Rendering/Core/Actor';

// ----------------------------------------------------------------------------
// vtkSkybox methods
// ----------------------------------------------------------------------------

function vtkSkybox(publicAPI, model) {
// Set our className
model.classHierarchy.push('vtkSkybox');

publicAPI.getIsOpaque = () => true;

publicAPI.hasTranslucentPolygonalGeometry = () => false;

publicAPI.getSupportsSelection = () => false;
}

// ----------------------------------------------------------------------------
// Object fSkyboxy
// ----------------------------------------------------------------------------

const DEFAULT_VALUES = {
format: 'box',
};

// ----------------------------------------------------------------------------

export function extend(publicAPI, model, initialValues = {}) {
Object.assign(model, DEFAULT_VALUES, initialValues);

// Inheritance
vtkActor.extend(publicAPI, model, initialValues);

// Build VTK API
macro.setGet(publicAPI, model, [
'format', // can be box or background, in the future sphere, floor as well
]);

// Object methods
vtkSkybox(publicAPI, model);
}

// ----------------------------------------------------------------------------

export const newInstance = macro.newInstance(extend, 'vtkSkybox');

// ----------------------------------------------------------------------------

export default { newInstance, extend };