icn3d 3.45.1 → 3.45.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/icn3d.css +49 -49
- package/icn3d.js +56 -31
- package/icn3d.min.js +1 -1
- package/icn3d.module.js +56 -31
- package/package.json +1 -1
package/icn3d.module.js
CHANGED
|
@@ -59810,7 +59810,7 @@ class SetMenu {
|
|
|
59810
59810
|
html += this.setTools();
|
|
59811
59811
|
|
|
59812
59812
|
// show title at the top left corner
|
|
59813
|
-
html += me.htmlCls.divStr + "title' class='icn3d-commandTitle' style='
|
|
59813
|
+
html += me.htmlCls.divStr + "title' class='icn3d-commandTitle icn3d-title' style='display:table-row; margin: 85px 0px 0px 5px; color:" + titleColor + "; width:" + me.htmlCls.WIDTH + "px'></div>";
|
|
59814
59814
|
|
|
59815
59815
|
html += me.htmlCls.divStr + "viewer' style='position:relative; width:100%; height:100%; background-color: " + me.htmlCls.GREYD + ";'>";
|
|
59816
59816
|
|
|
@@ -59944,7 +59944,7 @@ class SetMenu {
|
|
|
59944
59944
|
//html += me.htmlCls.setMenuCls.setTools();
|
|
59945
59945
|
|
|
59946
59946
|
// show title at the top left corner
|
|
59947
|
-
html += me.htmlCls.divStr + "title' class='icn3d-commandTitle' style='
|
|
59947
|
+
html += me.htmlCls.divStr + "title' class='icn3d-commandTitle icn3d-title' style='display:block; margin: 12px 0px 0px 40px; color:" + titleColor + "; width:" +(me.htmlCls.WIDTH - 40).toString() + "px'></div>";
|
|
59948
59948
|
html += me.htmlCls.divStr + "viewer' style='position:relative; width:100%; height:100%; background-color: " + me.htmlCls.GREYD + ";'>";
|
|
59949
59949
|
// don't show legend in mobile
|
|
59950
59950
|
//html += me.htmlCls.divStr + "legend' class='icn3d-text icn3d-legend'></div>";
|
|
@@ -75144,7 +75144,7 @@ class Scene {
|
|
|
75144
75144
|
ic.shininess = shininess;
|
|
75145
75145
|
}
|
|
75146
75146
|
|
|
75147
|
-
if(!me.bNode && me.htmlCls.setHtmlCls.getCookie('light1') != '') {
|
|
75147
|
+
if(!me.bNode && me.htmlCls.setHtmlCls.getCookie('light1') != '' && !me.bNode && me.htmlCls.setHtmlCls.getCookie('light2') != '' && !me.bNode && me.htmlCls.setHtmlCls.getCookie('light3') != '') {
|
|
75148
75148
|
let light1 = parseFloat(me.htmlCls.setHtmlCls.getCookie('light1'));
|
|
75149
75149
|
let light2 = parseFloat(me.htmlCls.setHtmlCls.getCookie('light2'));
|
|
75150
75150
|
let light3 = parseFloat(me.htmlCls.setHtmlCls.getCookie('light3'));
|
|
@@ -79894,19 +79894,25 @@ class Tube {
|
|
|
79894
79894
|
//mesh = new THREE.Mesh(geo, new THREE.MeshPhongMaterial({ transparent: true, opacity: 0.5, specular: ic.frac, shininess: ic.shininess, emissive: ic.emissive, vertexColors: THREE.FaceColors, side: THREE.DoubleSide }));
|
|
79895
79895
|
mesh = new Mesh$1(geo, new MeshPhongMaterial({ transparent: true, opacity: 0.5, specular: ic.frac, shininess: ic.shininess, emissive: ic.emissive, vertexColors: true, side: DoubleSide$1 }));
|
|
79896
79896
|
|
|
79897
|
-
if(ic.mdl)
|
|
79897
|
+
if(ic.mdl) {
|
|
79898
|
+
ic.mdl.add(mesh);
|
|
79899
|
+
}
|
|
79898
79900
|
}
|
|
79899
79901
|
else if(bHighlight === 1) {
|
|
79900
79902
|
mesh = new Mesh$1(geo, ic.matShader);
|
|
79901
79903
|
mesh.renderOrder = ic.renderOrderPicking;
|
|
79902
79904
|
//ic.mdlPicking.add(mesh);
|
|
79903
|
-
if(ic.mdl)
|
|
79905
|
+
if(ic.mdl) {
|
|
79906
|
+
ic.mdl.add(mesh);
|
|
79907
|
+
}
|
|
79904
79908
|
}
|
|
79905
79909
|
else {
|
|
79906
79910
|
//mesh = new THREE.Mesh(geo, new THREE.MeshPhongMaterial({ specular: ic.frac, shininess: ic.shininess, emissive: ic.emissive, vertexColors: THREE.FaceColors, side: THREE.DoubleSide }));
|
|
79907
79911
|
mesh = new Mesh$1(geo, new MeshPhongMaterial({ specular: ic.frac, shininess: ic.shininess, emissive: ic.emissive, vertexColors: true, side: DoubleSide$1 }));
|
|
79908
79912
|
|
|
79909
|
-
if(ic.mdl)
|
|
79913
|
+
if(ic.mdl) {
|
|
79914
|
+
ic.mdl.add(mesh);
|
|
79915
|
+
}
|
|
79910
79916
|
}
|
|
79911
79917
|
|
|
79912
79918
|
if(bHighlight === 1 || bHighlight === 2) {
|
|
@@ -84304,7 +84310,11 @@ class ApplyClbonds {
|
|
|
84304
84310
|
applyClbondsOptions(options) { let ic = this.icn3d, me = ic.icn3dui;
|
|
84305
84311
|
if(options === undefined) options = ic.opts;
|
|
84306
84312
|
|
|
84307
|
-
|
|
84313
|
+
ic.lines['clbond'] = [];
|
|
84314
|
+
|
|
84315
|
+
if(options.chemicals == 'nothing') return {};
|
|
84316
|
+
|
|
84317
|
+
// if(!ic.bCalcCrossLink) {
|
|
84308
84318
|
// find all bonds to chemicals
|
|
84309
84319
|
ic.clbondpnts = {};
|
|
84310
84320
|
ic.clbondResid2serial = {};
|
|
@@ -84315,10 +84325,11 @@ class ApplyClbonds {
|
|
|
84315
84325
|
// chemical to protein/nucleotide
|
|
84316
84326
|
this.applyClbondsOptions_base('all');
|
|
84317
84327
|
|
|
84318
|
-
|
|
84319
|
-
|
|
84328
|
+
// ic.bCalcCrossLink = true;
|
|
84329
|
+
// }
|
|
84320
84330
|
|
|
84321
|
-
|
|
84331
|
+
// if (options.clbonds.toLowerCase() === 'yes' && options.chemicals !== 'nothing') {
|
|
84332
|
+
if (options.clbonds.toLowerCase() === 'yes') {
|
|
84322
84333
|
let color = '#006400';
|
|
84323
84334
|
me.parasCls.thr(0x006400);
|
|
84324
84335
|
|
|
@@ -84344,7 +84355,8 @@ class ApplyClbonds {
|
|
|
84344
84355
|
line.serial1 = ic.clbondResid2serial[resid0 + ',' + resid1];
|
|
84345
84356
|
line.serial2 = ic.clbondResid2serial[resid1 + ',' + resid0];
|
|
84346
84357
|
|
|
84347
|
-
|
|
84358
|
+
// only apply to displayed atoms
|
|
84359
|
+
// if(!ic.dAtoms.hasOwnProperty(line.serial1) || !ic.dAtoms.hasOwnProperty(line.serial2)) continue;
|
|
84348
84360
|
|
|
84349
84361
|
line.position1 = ic.atoms[line.serial1].coord;
|
|
84350
84362
|
line.position2 = ic.atoms[line.serial2].coord;
|
|
@@ -84376,9 +84388,14 @@ class ApplyClbonds {
|
|
|
84376
84388
|
return ic.residuesHashClbonds;
|
|
84377
84389
|
}
|
|
84378
84390
|
|
|
84379
|
-
applyClbondsOptions_base(type) { let ic = this.icn3d
|
|
84391
|
+
applyClbondsOptions_base(type) { let ic = this.icn3d, me = ic.icn3dui;
|
|
84392
|
+
// only apply to displayed atoms
|
|
84393
|
+
let atomHash = me.hashUtilsCls.cloneHash(ic.chemicals);
|
|
84394
|
+
atomHash = me.hashUtilsCls.intHash(atomHash, ic.dAtoms);
|
|
84395
|
+
|
|
84380
84396
|
// chemical to chemical first
|
|
84381
|
-
|
|
84397
|
+
// for (let i in ic.chemicals) {
|
|
84398
|
+
for (let i in atomHash) {
|
|
84382
84399
|
let atom0 = ic.atoms[i];
|
|
84383
84400
|
|
|
84384
84401
|
let chain0 = atom0.structure + '_' + atom0.chain;
|
|
@@ -86973,24 +86990,27 @@ class Instancing {
|
|
|
86973
86990
|
let normalArray2 = (baseGeometry.attributes.normal) ? me.hashUtilsCls.hashvalue2array(baseGeometry.attributes.normal.array) : [];
|
|
86974
86991
|
let colorArray2 = (baseGeometry.attributes.color) ? me.hashUtilsCls.hashvalue2array(baseGeometry.attributes.color.array) : [];
|
|
86975
86992
|
let indexArray2 = (baseGeometry.index) ? me.hashUtilsCls.hashvalue2array(baseGeometry.index.array) : [];
|
|
86993
|
+
|
|
86994
|
+
if(colorArray2.length > 0) { // avoid an black object in the center of of assembly, e.g., https://www.ncbi.nlm.nih.gov/Structure/icn3d/?pdbid=1qqp
|
|
86995
|
+
positionArray = positionArray.concat(positionArray2);
|
|
86996
|
+
normalArray = normalArray.concat(normalArray2);
|
|
86997
|
+
colorArray = colorArray.concat(colorArray2);
|
|
86998
|
+
indexArray = indexArray.concat(indexArray2);
|
|
86976
86999
|
|
|
86977
|
-
|
|
86978
|
-
|
|
86979
|
-
|
|
86980
|
-
|
|
86981
|
-
|
|
86982
|
-
|
|
86983
|
-
let bCylinder = (baseGeometry.type == 'CylinderGeometry') ? 1.0 : 0.0;
|
|
86984
|
-
for(let i = 0, il = positionArray.length / 3; i < il; ++i) {
|
|
86985
|
-
bCylinderArray.push(bCylinder);
|
|
86986
|
-
}
|
|
87000
|
+
let bCylinderArray = [];
|
|
87001
|
+
let bCylinder = (baseGeometry.type == 'CylinderGeometry') ? 1.0 : 0.0;
|
|
87002
|
+
// let bCylinder = (baseGeometry.geometry.type == 'CylinderGeometry') ? 1.0 : 0.0;
|
|
87003
|
+
for(let i = 0, il = positionArray.length / 3; i < il; ++i) {
|
|
87004
|
+
bCylinderArray.push(bCylinder);
|
|
87005
|
+
}
|
|
86987
87006
|
|
|
86988
|
-
|
|
86989
|
-
|
|
86990
|
-
|
|
87007
|
+
geometry.setAttribute('position', new BufferAttribute$1(new Float32Array(positionArray), 3));
|
|
87008
|
+
geometry.setAttribute('normal', new BufferAttribute$1(new Float32Array(normalArray), 3) );
|
|
87009
|
+
geometry.setAttribute('color', new BufferAttribute$1(new Float32Array(colorArray), 3) );
|
|
86991
87010
|
|
|
86992
|
-
|
|
86993
|
-
|
|
87011
|
+
geometry.setAttribute('cylinder', new BufferAttribute$1(new Float32Array(bCylinderArray), 1) );
|
|
87012
|
+
geometry.setIndex(new BufferAttribute$1(new Uint32Array(indexArray), 1));
|
|
87013
|
+
}
|
|
86994
87014
|
|
|
86995
87015
|
positionArray2 = null;
|
|
86996
87016
|
normalArray2 = null;
|
|
@@ -87052,7 +87072,7 @@ class Instancing {
|
|
|
87052
87072
|
|
|
87053
87073
|
let mesh2 = new Mesh$1(geometry, ic.instancedMaterial);
|
|
87054
87074
|
|
|
87055
|
-
mesh2.onBeforeRender = ic.impostorCls.onBeforeRender;
|
|
87075
|
+
if(ic.bImpo) mesh2.onBeforeRender = ic.impostorCls.onBeforeRender;
|
|
87056
87076
|
//mesh2.onBeforeRender = this.onBeforeRender;
|
|
87057
87077
|
|
|
87058
87078
|
// important: https://stackoverflow.com/questions/21184061/mesh-suddenly-disappears-in-three-js-clipping
|
|
@@ -87278,7 +87298,7 @@ class Alternate {
|
|
|
87278
87298
|
|
|
87279
87299
|
//ic.glycanCls.showGlycans();
|
|
87280
87300
|
|
|
87281
|
-
ic.opts['rotationcenter'] = 'highlight center';
|
|
87301
|
+
// ic.opts['rotationcenter'] = 'highlight center';
|
|
87282
87302
|
|
|
87283
87303
|
ic.drawCls.draw();
|
|
87284
87304
|
|
|
@@ -97529,9 +97549,14 @@ class Annotation {
|
|
|
97529
97549
|
$("[id^=" + ic.pre + "transmem]").hide();
|
|
97530
97550
|
if($("#" + ic.pre + "anno_transmem").length) $("#" + ic.pre + "anno_transmem")[0].checked = false;
|
|
97531
97551
|
}
|
|
97532
|
-
async setAnnoTabIg(bSelection, template) { let ic = this.icn3d
|
|
97552
|
+
async setAnnoTabIg(bSelection, template) { let ic = this.icn3d, me = ic.icn3dui;
|
|
97553
|
+
let selAtoms = me.hashUtilsCls.cloneHash(ic.hAtoms);
|
|
97554
|
+
|
|
97533
97555
|
await this.updateIg(bSelection, template);
|
|
97534
97556
|
|
|
97557
|
+
// preserve previous selection
|
|
97558
|
+
ic.hAtoms = me.hashUtilsCls.cloneHash(selAtoms);
|
|
97559
|
+
|
|
97535
97560
|
$("[id^=" + ic.pre + "ig]").show();
|
|
97536
97561
|
if($("#" + ic.pre + "anno_ig").length) $("#" + ic.pre + "anno_ig")[0].checked = true;
|
|
97537
97562
|
}
|