From 7ceda5bf7bedda6e0e183f95d0560a071f052c0b Mon Sep 17 00:00:00 2001 From: David Sehnal <david.sehnal@gmail.com> Date: Fri, 6 Oct 2017 15:00:06 +0200 Subject: [PATCH] Tweaks --- src/structure/model.ts | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/structure/model.ts b/src/structure/model.ts index 2ec048765..dd1dbcd1e 100644 --- a/src/structure/model.ts +++ b/src/structure/model.ts @@ -52,12 +52,12 @@ export namespace Unit { positions: Data.Positions, /** Per residue secondary structure assignment. */ - secondaryStructure: Data.SecondaryStructures, - + secondaryStructure: Data.SecondaryStructures + }> { '@spatialLookup': any, // TODO '@boundingSphere': Readonly<{ center: Vec3, radius: number }>, '@bonds': Data.Bonds - }> { } + } export namespace Conformation { export function spatialLookup(conformation: Conformation): any { @@ -77,6 +77,7 @@ export namespace Unit { | { kind: 'identity' } | { kind: 'symmetry', id: string, hkl: Vec3 } | { kind: 'assembly', index: number } + | { kind: 'custom' } export interface Operator extends Readonly<{ kind: OperatorKind, @@ -93,12 +94,12 @@ export interface Model extends Readonly<{ units: Unit[], structure: { [id: number]: Unit.Structure }, - conformation: { [id: number]: Unit.Conformation }, - + conformation: { [id: number]: Unit.Conformation } +}> { '@unitLookup'?: Unit.SpatialLookup, /** bonds between units */ '@unitBonds'?: Data.Bonds -}> { } +} export namespace Model { export function unitLookup(model: Model): Unit.SpatialLookup { @@ -134,7 +135,7 @@ export namespace Atom { return { _uint32: new Uint32Array(data), _float64: new Float64Array(data) }; }()); - export function emptyLocation(): Reference { return { unit: 0, atom: 0 }; } + export function emptyRef(): Reference { return { unit: 0, atom: 0 }; } export function packRef(location: Reference) { _uint32[0] = location.unit; @@ -143,7 +144,7 @@ export namespace Atom { } export function unpackRef(ref: PackedReference) { - return updateRef(ref, emptyLocation()); + return updateRef(ref, emptyRef()); } export function updateRef(ref: PackedReference, location: Reference): Reference { @@ -156,7 +157,7 @@ export namespace Atom { export interface Selector<T> { '@type': T, - create(m: Model, u: number): (a: number, v?: T) => T + create(m: Model, u: number): Selector.Field<T> } export function Selector<T>(create: (m: Model, u: number) => (a: number, v?: T) => T): Selector<T> { -- GitLab