molstar
Version:
A comprehensive macromolecular library.
40 lines (39 loc) • 1.6 kB
TypeScript
/**
* Copyright (c) 2018-2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
import { Iterator } from '../../mol-data';
import { Vec3 } from '../../mol-math/linear-algebra';
import { Location } from '../../mol-model/location';
export interface LocationValue {
location: Location;
index: number;
groupIndex: number;
instanceIndex: number;
isSecondary: boolean;
}
export interface LocationIterator extends Iterator<LocationValue> {
readonly hasNext: boolean;
readonly isNextNewInstance: boolean;
readonly groupCount: number;
readonly instanceCount: number;
readonly count: number;
readonly stride: number;
readonly nonInstanceable: boolean;
move(): LocationValue;
reset(): void;
skipInstance(): void;
voidInstances(): void;
}
declare type LocationGetter = (groupIndex: number, instanceIndex: number) => Location;
declare type IsSecondaryGetter = (groupIndex: number, instanceIndex: number) => boolean;
export declare function LocationIterator(groupCount: number, instanceCount: number, stride: number, getLocation: LocationGetter, nonInstanceable?: boolean, isSecondary?: IsSecondaryGetter): LocationIterator;
/** A position Location */
export interface PositionLocation {
readonly kind: 'position-location';
readonly position: Vec3;
}
export declare function PositionLocation(position?: Vec3): PositionLocation;
export declare function isPositionLocation(x: any): x is PositionLocation;
export {};