CompositeVRManipulator

Methods

Source

index.d.ts
import { States } from '../../../Rendering/Core/InteractorStyle/Constants';
import vtkRenderer from '../../../Rendering/Core/Renderer';
import vtkInteractorObserver from '../../../Rendering/Core/InteractorObserver';
import {
Device,
Input,
} from '../../../Rendering/Core/RenderWindowInteractor/Constants';
import {
I3DEvent,
IButton3DEvent,
} from '../../../Rendering/Core/RenderWindowInteractor';

export interface vtkCompositeVRManipulator {
onButton3D(
interactorStyle: vtkInteractorObserver,
renderer: vtkRenderer,
state: States,
eventData: IButton3DEvent
): void;

onMove3D(
interactorStyle: vtkInteractorObserver,
renderer: vtkRenderer,
state: States,
eventData: I3DEvent
): void;
}

export interface ICompositeVRManipulatorInitialValues {
device?: Device;
input?: Input;
}

export function extend(
publicAPI: object,
model: object,
initialValues?: ICompositeVRManipulatorInitialValues
): void;

export const vtkCompositeVRManipulator: {
extend: typeof extend;
};

export default vtkCompositeVRManipulator;
index.js
import macro from 'vtk.js/Sources/macros';
import {
Device,
Input,
} from 'vtk.js/Sources/Rendering/Core/RenderWindowInteractor/Constants';

// ----------------------------------------------------------------------------
// vtkCompositeVRManipulator methods
// ----------------------------------------------------------------------------

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

publicAPI.onButton3D = (interactorStyle, renderer, state, eventData) => {};
publicAPI.onMove3D = (interactorStyle, renderer, state, eventData) => {};
}

// ----------------------------------------------------------------------------
// Object factory
// ----------------------------------------------------------------------------

const DEFAULT_VALUES = {
// device: null, // Device.RightController
// input: null, // Input.TrackPad
};

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

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

// Create get-set macros
macro.setGet(publicAPI, model, ['device', 'input']);

// Object specific methods
vtkCompositeVRManipulator(publicAPI, model);
}

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

export default { extend, Device, Input };