molstar
Version:
A comprehensive macromolecular library.
41 lines (40 loc) • 1.82 kB
JavaScript
;
/**
* Copyright (c) 2026 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.Streamlines = void 0;
const behavior_1 = require("../../../behavior.js");
const param_definition_1 = require("../../../../../mol-util/param-definition.js");
const streamlines_1 = require("../../../../../mol-model-props/volume/streamlines.js");
const representation_1 = require("../../../../../mol-model-props/volume/streamlines/representation.js");
exports.Streamlines = behavior_1.PluginBehavior.create({
name: 'streamlines-volume-prop',
category: 'custom-props',
display: { name: 'Streamlines' },
ctor: class extends behavior_1.PluginBehavior.Handler {
constructor() {
super(...arguments);
this.provider = streamlines_1.StreamlinesProvider;
}
update(p) {
const updated = (this.params.autoAttach !== p.autoAttach);
this.params.autoAttach = p.autoAttach;
this.ctx.customVolumeProperties.setDefaultAutoAttach(this.provider.descriptor.name, this.params.autoAttach);
return updated;
}
register() {
this.ctx.customVolumeProperties.register(this.provider, this.params.autoAttach);
this.ctx.representation.volume.registry.add(representation_1.StreamlinesRepresentationProvider);
}
unregister() {
this.ctx.customVolumeProperties.unregister(this.provider.descriptor.name);
this.ctx.representation.volume.registry.remove(representation_1.StreamlinesRepresentationProvider);
}
},
params: () => ({
autoAttach: param_definition_1.ParamDefinition.Boolean(false)
})
});