Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Basic2DAppState<NodeModelType, SceneModelType>

Type parameters

Hierarchy

Index

Constructors

constructor

  • new Basic2DAppState<NodeModelType, SceneModelType>(): Basic2DAppState<NodeModelType, SceneModelType>

Properties

Protected _clockID

_clockID: number

_currentMaterialName

_currentMaterialName: string

_currentNewModelTypeName

_currentNewModelTypeName: string

Protected _eventCallbackDicts

_eventCallbackDicts: {} = {}

Type declaration

_guiKey

_guiKey: string

_isCreatingShape

_isCreatingShape: boolean

_lastFrameInterval

_lastFrameInterval: number = 0

Private _lastFrameTime

_lastFrameTime: number = 0

Protected _paused

_paused: boolean

Protected _subscriptions

_subscriptions: {} = {}

Type declaration

_time

_time: number

appClock

appClock: AClock

creatingNew

creatingNew: boolean

sceneControllers

sceneControllers: {} = {}

Get set selectedModel

Type declaration

sceneModel

sceneModel: SceneModelType

selectedColor

selectedColor: Color

selectionModel

selectionModel: ASelectionModel<NodeModelType>

state

state: {} = {}

Type declaration

  • [name: string]: any

uid

uid: string

Static AObjectStateKeys

AObjectStateKeys: string[] = []

Static AObjectVersion

AObjectVersion: number = 1

Static SceneControllerIDs

SceneControllerIDs: typeof SceneControllerIDs = ...

Accessors

ClassConstructor

  • get ClassConstructor(): typeof AObject

currentMaterialModel

currentMaterialName

  • get currentMaterialName(): string
  • set currentMaterialName(value: string): void

currentNewModelType

  • get currentNewModelType(): any

currentNewModelTypeName

  • get currentNewModelTypeName(): string
  • set currentNewModelTypeName(value: string): void

materials

modelSelection

  • get modelSelection(): NodeModelType[]

selectedModels

  • get selectedModels(): NodeModelType[]

selectionSubscriptionIsActive

  • get selectionSubscriptionIsActive(): boolean
  • set selectionSubscriptionIsActive(value: boolean): void

serializationLabel

  • get serializationLabel(): any

stateSnapshop

  • get stateSnapshop(): {}

timeSinceLastFrame

  • get timeSinceLastFrame(): number

Methods

AppComponent

CreateMaterial

CreateTestSquare

  • CreateTestSquare(color?: Color, position?: Vec2): NodeModelType

NewNode

  • NewNode(): NodeModelType

Abstract NewSceneModel

  • NewSceneModel(...args: []): SceneModelType

_getEventCallbackDict

_getListeners

  • _getListeners(): {}

Protected _getSpecSceneController

  • _getSpecSceneController(): undefined | ASceneController<NodeModelType, SceneModelType>

activateSubscription

  • activateSubscription(name: string): void

addClockListener

  • addClockListener(callback: (t: number) => any): AStateCallbackSwitch

addDefaultNode

  • addDefaultNode(color?: Color, position?: Vec2, ...args: any[]): Promise<void>

addEventListener

  • addEventListener(eventName: string, callback: (...args: any[]) => void, handle?: string): AEventCallbackSwitch

addEventListeners

  • addEventListeners(eventName: string, callbacks: ((...args: any[]) => void)[], handle?: string): AEventCallbackSwitch

addOneTimeEventListener

  • addOneTimeEventListener(eventName: string, callback: (...args: any[]) => void, handle?: string): AEventCallbackSwitch

addSVG

  • addSVG(name: string, svgText: string): void

addSceneController

  • addSceneController(sceneController: ASceneController<NodeModelType, SceneModelType>, name: string): void

addSceneControllerClass

  • addSceneControllerClass(container: HTMLDivElement, sceneControllerClass: ClassInterface<ASceneController<NodeModelType, SceneModelType>>, name?: string): void

addStateKeyListener

  • addStateKeyListener(state_key: string, callback: (self: AObject) => void, handle?: string, synchronous?: boolean): AStateCallbackSwitch
  • Sets a callback function to be called whenever the state specified in state_key changes. The return value callbackSwitch is a callback switch. You can activate the listener with callbackSwitch.activate() and deactive with callbackSwitch.deactivate(). Example Usage:

    var callbackswitch = model.addStateKeyListener('name',()=>{
    n_name_changes = n_name_changes+1;
    })

    Parameters

    • state_key: string

      the name of the state to listen to

    • callback: (self: AObject) => void

      the callback to be executed when state changes

    • Optional handle: string

      the handle / unique identifier for

    • synchronous: boolean = true

      whether callbacks should happen synchronously or allow for batching

    Returns AStateCallbackSwitch

addStateListener

  • addStateListener(callback: (self: AObject) => void, handle?: string, synchronous?: boolean): AStateCallbackSwitch

clearSubscriptions

  • clearSubscriptions(): void

deactivateSubscription

  • deactivateSubscription(name: string): void

dispose

  • dispose(): void

freezeSelection

  • freezeSelection(): void

getControlPanelStandardSpec

  • getControlPanelStandardSpec(): {}

getModelControlSpecs

  • getModelControlSpecs(): {}

handleSceneGraphSelection

  • handleSceneGraphSelection(m: any): void

imageUploaded

  • imageUploaded(name: string, texture: Texture): void

init

  • init(): void

Abstract initSceneModel

  • initSceneModel(): void

initSelection

  • initSelection(): void

loadModelFromURL

  • loadModelFromURL(path: string, callback: (obj: Object3D) => void): void

modelUploaded

onAnimationFrameCallback

  • onAnimationFrameCallback(): void

onSelectionChanged

  • onSelectionChanged(selection: ASelection<NodeModelType>): void

pauseClock

  • pauseClock(): void

removeEventListener

  • removeEventListener(eventName: string, handle: string): void

removeListener

  • removeListener(handle: string): void

selectModel

  • selectModel(model?: NodeModelType): void

setInteractionMode

  • setInteractionMode(modeName?: string): void

setIsCreatingShape

  • setIsCreatingShape(v: boolean): void

setNodeMaterial

signalEvent

  • signalEvent(eventName: string, ...args: any[]): void

subscribe

toJSON

  • toJSON(): {}

toggleClockPause

  • toggleClockPause(): void

triggerGUIUpdate

  • triggerGUIUpdate(): void

unfreezeSelection

  • unfreezeSelection(): void

unpauseClock

  • unpauseClock(): void

unsubscribe

  • unsubscribe(name: string, errorIfAbsent?: boolean): void

Static CreateWithState

  • CreateWithState(state: {}): AObject

Static GetAppState

Static SerializationLabel

  • SerializationLabel(): any

Static fromJSON

Generated using TypeDoc