Skip to content
Snippets Groups Projects
Select Git revision
  • eb10ca8a4b170ce5aa8b2cd29b954db8c45db88d
  • zig default
  • master
  • zig-threaded
  • openat
  • chdir
  • clear
  • compll
  • v1.18.1
  • v2.2.2
  • v1.18
  • v2.2.1
  • v2.2
  • v1.17
  • v2.1.2
  • v2.1.1
  • v2.1
  • v2.0.1
  • v2.0
  • v2.0-beta3
  • v2.0-beta2
  • v2.0-beta1
  • v1.16
  • v1.15.1
  • v1.15
  • v1.14.2
  • v1.14.1
  • v1.14
28 results

calc.c

Blame
  • list.ts 961 B
    /*
     * Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
     *
     * Adapted from LiteMol
     * Copyright (c) 2016 - now David Sehnal, licensed under Apache 2.0, See LICENSE file for more info.
     */
    
    import { Context } from '../../context/context'
    import { Controller } from '../controller';
    import { AnyTransform } from 'mol-view/state/transform';
    import { AnyEntity } from 'mol-view/state/entity';
    
    export interface TransformListState {
        entity?: AnyEntity
        transforms: AnyTransform[]
    }
    
    export class TransformListController extends Controller<TransformListState> {
        constructor(context: Context) {
            super(context, { transforms: [], entity: undefined });
    
            context.currentTransforms.subscribe((transforms) => {
                this.state.next({ transforms, entity: context.currentEntity.getValue() }) // TODO
                this.setState({ transforms, entity: context.currentEntity.getValue() })
            })
        }
    }