UNPKG

molstar

Version:

A comprehensive macromolecular library.

45 lines 1.88 kB
"use strict"; /** * Copyright (c) 2018-2020 mol* contributors, licensed under MIT, See LICENSE file for more info. * * @author David Sehnal <david.sehnal@gmail.com> * @author Alexander Rose <alexander.rose@weirdbyte.de> */ Object.defineProperty(exports, "__esModule", { value: true }); exports.BuiltInShapeFormats = exports.PlyProvider = exports.ShapeFormatCategory = void 0; var tslib_1 = require("tslib"); var transforms_1 = require("../transforms"); var provider_1 = require("./provider"); exports.ShapeFormatCategory = 'Shape'; exports.PlyProvider = (0, provider_1.DataFormatProvider)({ label: 'PLY', description: 'PLY', category: exports.ShapeFormatCategory, stringExtensions: ['ply'], parse: function (plugin, data) { return (0, tslib_1.__awaiter)(void 0, void 0, void 0, function () { var format, shape; return (0, tslib_1.__generator)(this, function (_a) { switch (_a.label) { case 0: format = plugin.state.data.build() .to(data) .apply(transforms_1.StateTransforms.Data.ParsePly, {}, { state: { isGhost: true } }); shape = format.apply(transforms_1.StateTransforms.Model.ShapeFromPly); return [4 /*yield*/, format.commit()]; case 1: _a.sent(); return [2 /*return*/, { format: format.selector, shape: shape.selector }]; } }); }); }, visuals: function (plugin, data) { var repr = plugin.state.data.build() .to(data.shape) .apply(transforms_1.StateTransforms.Representation.ShapeRepresentation3D); return repr.commit(); } }); exports.BuiltInShapeFormats = [ ['ply', exports.PlyProvider], ]; //# sourceMappingURL=shape.js.map