|
@@ -7,21 +7,12 @@
|
|
import { Structure } from '../structure'
|
|
import { Structure } from '../structure'
|
|
import { StructureSelection } from './selection'
|
|
import { StructureSelection } from './selection'
|
|
import { QueryContext, QueryFn, QueryContextOptions } from './context';
|
|
import { QueryContext, QueryFn, QueryContextOptions } from './context';
|
|
-import Expression from '../../../mol-script/language/expression';
|
|
|
|
-import { compile } from '../../../mol-script/runtime/query/compiler';
|
|
|
|
-import { MolScriptBuilder } from '../../../mol-script/language/builder';
|
|
|
|
|
|
|
|
interface StructureQuery extends QueryFn<StructureSelection> { }
|
|
interface StructureQuery extends QueryFn<StructureSelection> { }
|
|
namespace StructureQuery {
|
|
namespace StructureQuery {
|
|
export function run(query: StructureQuery, structure: Structure, options?: QueryContextOptions) {
|
|
export function run(query: StructureQuery, structure: Structure, options?: QueryContextOptions) {
|
|
return query(new QueryContext(structure, options));
|
|
return query(new QueryContext(structure, options));
|
|
}
|
|
}
|
|
-
|
|
|
|
- export function runExpr(expr: Expression | ((builder: typeof MolScriptBuilder) => Expression), structure: Structure, options?: QueryContextOptions) {
|
|
|
|
- const e = typeof expr === 'function' ? expr(MolScriptBuilder) : expr;
|
|
|
|
- const query = compile<StructureSelection>(e);
|
|
|
|
- return query(new QueryContext(structure, options));
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
|
|
|
|
export { StructureQuery }
|
|
export { StructureQuery }
|