molstar
Version:
A comprehensive macromolecular library.
34 lines (33 loc) • 1.1 kB
JavaScript
/**
* Copyright (c) 2019 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Koya Sakuma
* Adapted from MolQL implemtation of atom-set.ts
*
* Copyright (c) 2017 MolQL contributors, licensed under MIT, See LICENSE file for more info.
*
* @author David Sehnal <david.sehnal@gmail.com>
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.propertySet = exports.countQuery = exports.atomCount = void 0;
var selection_1 = require("../selection");
var filters_1 = require("./filters");
function atomCount(ctx) {
return ctx.currentStructure.elementCount;
}
exports.atomCount = atomCount;
function countQuery(query) {
return function (ctx) {
var sel = query(ctx);
return selection_1.StructureSelection.structureCount(sel);
};
}
exports.countQuery = countQuery;
function propertySet(prop) {
return function (ctx) {
var set = new Set();
return (0, filters_1.getCurrentStructureProperties)(ctx, prop, set);
};
}
exports.propertySet = propertySet;
;