@chemistry/crystalview 1.0.9 → 3.1.1
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/LICENSE +1 -1
- package/README.md +61 -31
- package/dist/{src/camera → camera}/Camera.d.ts +69 -63
- package/dist/camera/Camera.d.ts.map +1 -0
- package/dist/camera/Camera.js +257 -0
- package/dist/camera/Camera.js.map +1 -0
- package/dist/camera/ICamera.d.ts +9 -0
- package/dist/camera/ICamera.d.ts.map +1 -0
- package/dist/camera/ICamera.js +2 -0
- package/dist/camera/ICamera.js.map +1 -0
- package/dist/{src/crystal-view.d.ts → crystal-view.d.ts} +25 -24
- package/dist/crystal-view.d.ts.map +1 -0
- package/dist/crystal-view.js +181 -0
- package/dist/crystal-view.js.map +1 -0
- package/dist/crystalview.css +47 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/{src/molecule3d → molecule3d}/Atom.d.ts +14 -13
- package/dist/molecule3d/Atom.d.ts.map +1 -0
- package/dist/molecule3d/Atom.js +19 -0
- package/dist/molecule3d/Atom.js.map +1 -0
- package/dist/{src/molecule3d → molecule3d}/Bond.d.ts +8 -7
- package/dist/molecule3d/Bond.d.ts.map +1 -0
- package/dist/molecule3d/Bond.js +11 -0
- package/dist/molecule3d/Bond.js.map +1 -0
- package/dist/{src/molecule3d → molecule3d}/CellAtom.d.ts +96 -96
- package/dist/molecule3d/CellAtom.d.ts.map +1 -0
- package/dist/molecule3d/CellAtom.js +132 -0
- package/dist/molecule3d/CellAtom.js.map +1 -0
- package/dist/{src/molecule3d → molecule3d}/Link.d.ts +15 -14
- package/dist/molecule3d/Link.d.ts.map +1 -0
- package/dist/molecule3d/Link.js +17 -0
- package/dist/molecule3d/Link.js.map +1 -0
- package/dist/{src/molecule3d → molecule3d}/Marker.d.ts +9 -8
- package/dist/molecule3d/Marker.d.ts.map +1 -0
- package/dist/molecule3d/Marker.js +11 -0
- package/dist/molecule3d/Marker.js.map +1 -0
- package/dist/{src/molecule3d → molecule3d}/MarkerContact.d.ts +7 -6
- package/dist/molecule3d/MarkerContact.d.ts.map +1 -0
- package/dist/molecule3d/MarkerContact.js +9 -0
- package/dist/molecule3d/MarkerContact.js.map +1 -0
- package/dist/{src/molecule3d → molecule3d}/Molecule3D.d.ts +45 -44
- package/dist/molecule3d/Molecule3D.d.ts.map +1 -0
- package/dist/molecule3d/Molecule3D.js +139 -0
- package/dist/molecule3d/Molecule3D.js.map +1 -0
- package/dist/{src/molecule3d → molecule3d}/MoleculeBuilder.d.ts +20 -19
- package/dist/molecule3d/MoleculeBuilder.d.ts.map +1 -0
- package/dist/molecule3d/MoleculeBuilder.js +131 -0
- package/dist/molecule3d/MoleculeBuilder.js.map +1 -0
- package/dist/molecule3d/MoleculeConnector.d.ts +10 -0
- package/dist/molecule3d/MoleculeConnector.d.ts.map +1 -0
- package/dist/molecule3d/MoleculeConnector.js +107 -0
- package/dist/molecule3d/MoleculeConnector.js.map +1 -0
- package/dist/{src/molecule3d → molecule3d}/UnitCell.d.ts +36 -35
- package/dist/molecule3d/UnitCell.d.ts.map +1 -0
- package/dist/molecule3d/UnitCell.js +238 -0
- package/dist/molecule3d/UnitCell.js.map +1 -0
- package/dist/molecule3d/io/IMoleculeReader.d.ts +8 -0
- package/dist/molecule3d/io/IMoleculeReader.d.ts.map +1 -0
- package/dist/molecule3d/io/IMoleculeReader.js +2 -0
- package/dist/molecule3d/io/IMoleculeReader.js.map +1 -0
- package/dist/{src/molecule3d → molecule3d}/io/MoleculeReaderJCIF.d.ts +12 -11
- package/dist/molecule3d/io/MoleculeReaderJCIF.d.ts.map +1 -0
- package/dist/molecule3d/io/MoleculeReaderJCIF.js +115 -0
- package/dist/molecule3d/io/MoleculeReaderJCIF.js.map +1 -0
- package/dist/{src/painter → painter}/CanvasContext.d.ts +15 -14
- package/dist/painter/CanvasContext.d.ts.map +1 -0
- package/dist/painter/CanvasContext.js +68 -0
- package/dist/painter/CanvasContext.js.map +1 -0
- package/dist/painter/Painter.d.ts +36 -0
- package/dist/painter/Painter.d.ts.map +1 -0
- package/dist/painter/Painter.js +237 -0
- package/dist/painter/Painter.js.map +1 -0
- package/dist/ui/ContextMenu.d.ts +24 -0
- package/dist/ui/ContextMenu.d.ts.map +1 -0
- package/dist/ui/ContextMenu.js +147 -0
- package/dist/ui/ContextMenu.js.map +1 -0
- package/dist/{src/ui → ui}/ContextMenuItem.d.ts +18 -17
- package/dist/ui/ContextMenuItem.d.ts.map +1 -0
- package/dist/ui/ContextMenuItem.js +72 -0
- package/dist/ui/ContextMenuItem.js.map +1 -0
- package/package.json +68 -87
- package/dist/crystal-view.min.js +0 -24
- package/dist/src/molecule3d/MoleculeConnector.d.ts +0 -9
- package/dist/src/painter/Painter.d.ts +0 -35
- package/dist/src/ui/ContextMenu.d.ts +0 -24
- package/package-lock.json +0 -9410
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { ChemElements } from '@chemistry/elements';
|
|
2
|
+
import { Vec3 } from '@chemistry/math';
|
|
3
|
+
import { Atom } from './Atom.js';
|
|
4
|
+
import { Link } from './Link.js';
|
|
5
|
+
export class CellAtom {
|
|
6
|
+
/**
|
|
7
|
+
* Atom ID within molecule
|
|
8
|
+
*/
|
|
9
|
+
id;
|
|
10
|
+
/**
|
|
11
|
+
* label
|
|
12
|
+
* @type {string}
|
|
13
|
+
*/
|
|
14
|
+
label;
|
|
15
|
+
/**
|
|
16
|
+
* Element
|
|
17
|
+
*/
|
|
18
|
+
element;
|
|
19
|
+
/**
|
|
20
|
+
* Cartezian position of Atom
|
|
21
|
+
*/
|
|
22
|
+
position;
|
|
23
|
+
/**
|
|
24
|
+
* Unit Cell
|
|
25
|
+
*/
|
|
26
|
+
unitCell;
|
|
27
|
+
/**
|
|
28
|
+
* Fractional position of Atom
|
|
29
|
+
*/
|
|
30
|
+
fractional;
|
|
31
|
+
/**
|
|
32
|
+
* Occupancy
|
|
33
|
+
*/
|
|
34
|
+
occupancy;
|
|
35
|
+
/**
|
|
36
|
+
* Isotropic U
|
|
37
|
+
*/
|
|
38
|
+
uiso;
|
|
39
|
+
/**
|
|
40
|
+
* Disorder Assembly
|
|
41
|
+
*/
|
|
42
|
+
assembly;
|
|
43
|
+
/**
|
|
44
|
+
* Disorder Group
|
|
45
|
+
*/
|
|
46
|
+
group;
|
|
47
|
+
/**
|
|
48
|
+
* List of Atoms Created From this Cell Atom
|
|
49
|
+
*/
|
|
50
|
+
children;
|
|
51
|
+
/**
|
|
52
|
+
* List of connected atoms
|
|
53
|
+
*/
|
|
54
|
+
links;
|
|
55
|
+
constructor(data) {
|
|
56
|
+
const element = ChemElements.getBySymbol(data.type);
|
|
57
|
+
if (!element) {
|
|
58
|
+
throw new Error('Wrong Element Name or ID: ' + element);
|
|
59
|
+
}
|
|
60
|
+
this.element = element;
|
|
61
|
+
this.id = data.id;
|
|
62
|
+
this.unitCell = data.unitCell;
|
|
63
|
+
this.label = data.label || element.symbol || '';
|
|
64
|
+
this.fractional = new Vec3(data.x, data.y, data.z);
|
|
65
|
+
this.occupancy = data.occupancy;
|
|
66
|
+
this.uiso = data.uiso;
|
|
67
|
+
this.assembly = data.assembly || '';
|
|
68
|
+
this.group = data.group || '';
|
|
69
|
+
this.position = this.unitCell.fractToOrth(this.fractional);
|
|
70
|
+
this.children = [];
|
|
71
|
+
this.links = [];
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Add link to another element
|
|
75
|
+
*/
|
|
76
|
+
addLink(otherAtom, symetry) {
|
|
77
|
+
const link = new Link(otherAtom, symetry);
|
|
78
|
+
this.links.push(link);
|
|
79
|
+
}
|
|
80
|
+
getLinks() {
|
|
81
|
+
return this.links;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Returns true if Cell Atom has Chield with Specific position
|
|
85
|
+
*/
|
|
86
|
+
hasChild(position) {
|
|
87
|
+
for (const ch of this.children) {
|
|
88
|
+
if (ch.fractional.equals(position)) {
|
|
89
|
+
return true;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Return Chield Atom with Specifified Position or null if not found
|
|
96
|
+
*/
|
|
97
|
+
getChild(position) {
|
|
98
|
+
for (const ch of this.children) {
|
|
99
|
+
if (ch.fractional.equals(position)) {
|
|
100
|
+
return ch;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Return true if has Atom with Specified symetry position
|
|
107
|
+
*/
|
|
108
|
+
hasChieldWithSymetry(symetry) {
|
|
109
|
+
// Predict inserted atom position
|
|
110
|
+
const predictedPostion = symetry.project(this.fractional);
|
|
111
|
+
return this.hasChild(predictedPostion);
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Return Chield Atom with Specifified symetry or similar atom liing on the same spot
|
|
115
|
+
*/
|
|
116
|
+
getChieldWithSymetry(symetry) {
|
|
117
|
+
const predictedPostion = symetry.project(this.fractional);
|
|
118
|
+
return this.getChild(predictedPostion);
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Create Atom & return it based on this Cell Atom
|
|
122
|
+
* and set correct settings
|
|
123
|
+
*/
|
|
124
|
+
createAtom(symetry, addToChields) {
|
|
125
|
+
const atom = new Atom(this, symetry);
|
|
126
|
+
if (addToChields) {
|
|
127
|
+
this.children.push(atom);
|
|
128
|
+
}
|
|
129
|
+
return atom;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=CellAtom.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CellAtom.js","sourceRoot":"","sources":["../../src/molecule3d/CellAtom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAmB,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAa,IAAI,EAAE,MAAM,iBAAiB,CAAC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AAC,CAAC;IACzC,CAAC;IAED;;OAEG;IACI,oBAAoB,CAAC,OAAkB;QAC5C,MAAM,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC1D,OAAO,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;IACzC,CAAC;IAED;;;OAGG;IAEI,UAAU,CAAC,OAAkB,EAAE,YAAqB;QACzD,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACrC,IAAI,YAAY,EAAE,CAAC;YACjB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3B,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { Vec3 } from
|
|
2
|
-
import { Matrix3x4 } from
|
|
3
|
-
import { CellAtom } from
|
|
4
|
-
export declare class Link {
|
|
5
|
-
atom: CellAtom;
|
|
6
|
-
symetry: Matrix3x4;
|
|
7
|
-
order: number;
|
|
8
|
-
/**
|
|
9
|
-
* Calc position of atom
|
|
10
|
-
* @type {Vec3}
|
|
11
|
-
*/
|
|
12
|
-
fractional: Vec3;
|
|
13
|
-
constructor(atom: CellAtom, symetry: Matrix3x4, order?: number);
|
|
14
|
-
}
|
|
1
|
+
import { Vec3 } from '@chemistry/math';
|
|
2
|
+
import { Matrix3x4 } from '@chemistry/math';
|
|
3
|
+
import { CellAtom } from './CellAtom.js';
|
|
4
|
+
export declare class Link {
|
|
5
|
+
atom: CellAtom;
|
|
6
|
+
symetry: Matrix3x4;
|
|
7
|
+
order: number;
|
|
8
|
+
/**
|
|
9
|
+
* Calc position of atom
|
|
10
|
+
* @type {Vec3}
|
|
11
|
+
*/
|
|
12
|
+
fractional: Vec3;
|
|
13
|
+
constructor(atom: CellAtom, symetry: Matrix3x4, order?: number);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=Link.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../src/molecule3d/Link.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,qBAAa,IAAI;IACR,IAAI,EAAE,QAAQ,CAAC;IACf,OAAO,EAAE,SAAS,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACI,UAAU,EAAE,IAAI,CAAC;gBAEZ,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,MAAM;CAM/D"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export class Link {
|
|
2
|
+
atom;
|
|
3
|
+
symetry;
|
|
4
|
+
order;
|
|
5
|
+
/**
|
|
6
|
+
* Calc position of atom
|
|
7
|
+
* @type {Vec3}
|
|
8
|
+
*/
|
|
9
|
+
fractional;
|
|
10
|
+
constructor(atom, symetry, order) {
|
|
11
|
+
this.atom = atom;
|
|
12
|
+
this.symetry = symetry;
|
|
13
|
+
this.order = order ?? 1;
|
|
14
|
+
this.fractional = symetry.project(atom.fractional);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=Link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Link.js","sourceRoot":"","sources":["../../src/molecule3d/Link.ts"],"names":[],"mappings":"AAIA,MAAM,OAAO,IAAI;IACR,IAAI,CAAW;IACf,OAAO,CAAY;IACnB,KAAK,CAAS;IACrB;;;OAGG;IACI,UAAU,CAAO;IAExB,YAAY,IAAc,EAAE,OAAkB,EAAE,KAAc;QAC5D,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,KAAK,GAAG,KAAK,IAAI,CAAC,CAAC;QACxB,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACrD,CAAC;CACF"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { Matrix3x4, Vec3 } from
|
|
2
|
-
import { CellAtom } from
|
|
3
|
-
export declare class Marker {
|
|
4
|
-
position: Vec3;
|
|
5
|
-
symetry: Matrix3x4;
|
|
6
|
-
cellAtom: CellAtom;
|
|
7
|
-
constructor(position: Vec3, symetry: Matrix3x4, cellAtom: CellAtom);
|
|
8
|
-
}
|
|
1
|
+
import { Matrix3x4, Vec3 } from '@chemistry/math';
|
|
2
|
+
import { CellAtom } from './CellAtom.js';
|
|
3
|
+
export declare class Marker {
|
|
4
|
+
position: Vec3;
|
|
5
|
+
symetry: Matrix3x4;
|
|
6
|
+
cellAtom: CellAtom;
|
|
7
|
+
constructor(position: Vec3, symetry: Matrix3x4, cellAtom: CellAtom);
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=Marker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Marker.d.ts","sourceRoot":"","sources":["../../src/molecule3d/Marker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,qBAAa,MAAM;IACV,QAAQ,EAAE,IAAI,CAAC;IACf,OAAO,EAAE,SAAS,CAAC;IACnB,QAAQ,EAAE,QAAQ,CAAC;gBAEd,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ;CAKnE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Marker.js","sourceRoot":"","sources":["../../src/molecule3d/Marker.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,MAAM;IACV,QAAQ,CAAO;IACf,OAAO,CAAY;IACnB,QAAQ,CAAW;IAE1B,YAAY,QAAc,EAAE,OAAkB,EAAE,QAAkB;QAChE,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;CACF"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { Vec3 } from
|
|
2
|
-
export declare class MarkerContact {
|
|
3
|
-
position1: Vec3;
|
|
4
|
-
position2: Vec3;
|
|
5
|
-
constructor(position1: Vec3, position2: Vec3);
|
|
6
|
-
}
|
|
1
|
+
import { Vec3 } from '@chemistry/math';
|
|
2
|
+
export declare class MarkerContact {
|
|
3
|
+
position1: Vec3;
|
|
4
|
+
position2: Vec3;
|
|
5
|
+
constructor(position1: Vec3, position2: Vec3);
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=MarkerContact.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarkerContact.d.ts","sourceRoot":"","sources":["../../src/molecule3d/MarkerContact.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC,qBAAa,aAAa;IACjB,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;gBAEX,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI;CAI7C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarkerContact.js","sourceRoot":"","sources":["../../src/molecule3d/MarkerContact.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,aAAa;IACjB,SAAS,CAAO;IAChB,SAAS,CAAO;IAEvB,YAAY,SAAe,EAAE,SAAe;QAC1C,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;CACF"}
|
|
@@ -1,44 +1,45 @@
|
|
|
1
|
-
import { Vec3 } from
|
|
2
|
-
import { Atom } from
|
|
3
|
-
import { Bond } from
|
|
4
|
-
import { CellAtom } from
|
|
5
|
-
import { Marker } from
|
|
6
|
-
import { MarkerContact } from
|
|
7
|
-
import { UnitCell } from
|
|
8
|
-
export declare class Molecule3D {
|
|
9
|
-
title: string;
|
|
10
|
-
unitCell: UnitCell;
|
|
11
|
-
cellAtoms: CellAtom[];
|
|
12
|
-
atoms: Atom[];
|
|
13
|
-
bonds: Bond[];
|
|
14
|
-
markers: Marker[];
|
|
15
|
-
markersContacts: MarkerContact[];
|
|
16
|
-
private reader;
|
|
17
|
-
private builder;
|
|
18
|
-
private connector;
|
|
19
|
-
private initConnectivity;
|
|
20
|
-
private center;
|
|
21
|
-
private radius;
|
|
22
|
-
constructor();
|
|
23
|
-
load(input: object): void;
|
|
24
|
-
buildConnectivity(): void;
|
|
25
|
-
clear(): void;
|
|
26
|
-
addCellAtom(data: {
|
|
27
|
-
type: string;
|
|
28
|
-
label: string;
|
|
29
|
-
x: number;
|
|
30
|
-
y: number;
|
|
31
|
-
z: number;
|
|
32
|
-
occupancy: number;
|
|
33
|
-
uiso: number;
|
|
34
|
-
assembly: string;
|
|
35
|
-
group: string;
|
|
36
|
-
}): void;
|
|
37
|
-
addAtom(atom: Atom): void;
|
|
38
|
-
/**
|
|
39
|
-
* Rerutn molecule center
|
|
40
|
-
*/
|
|
41
|
-
getCenter(): Vec3;
|
|
42
|
-
getRadius(): number;
|
|
43
|
-
extendByMarker(makers: Marker): void;
|
|
44
|
-
}
|
|
1
|
+
import { Vec3 } from '@chemistry/math';
|
|
2
|
+
import { Atom } from './Atom.js';
|
|
3
|
+
import { Bond } from './Bond.js';
|
|
4
|
+
import { CellAtom } from './CellAtom.js';
|
|
5
|
+
import { Marker } from './Marker.js';
|
|
6
|
+
import { MarkerContact } from './MarkerContact.js';
|
|
7
|
+
import { UnitCell } from './UnitCell.js';
|
|
8
|
+
export declare class Molecule3D {
|
|
9
|
+
title: string;
|
|
10
|
+
unitCell: UnitCell;
|
|
11
|
+
cellAtoms: CellAtom[];
|
|
12
|
+
atoms: Atom[];
|
|
13
|
+
bonds: Bond[];
|
|
14
|
+
markers: Marker[];
|
|
15
|
+
markersContacts: MarkerContact[];
|
|
16
|
+
private reader;
|
|
17
|
+
private builder;
|
|
18
|
+
private connector;
|
|
19
|
+
private initConnectivity;
|
|
20
|
+
private center;
|
|
21
|
+
private radius;
|
|
22
|
+
constructor();
|
|
23
|
+
load(input: object): void;
|
|
24
|
+
buildConnectivity(): void;
|
|
25
|
+
clear(): void;
|
|
26
|
+
addCellAtom(data: {
|
|
27
|
+
type: string;
|
|
28
|
+
label: string;
|
|
29
|
+
x: number;
|
|
30
|
+
y: number;
|
|
31
|
+
z: number;
|
|
32
|
+
occupancy: number;
|
|
33
|
+
uiso: number;
|
|
34
|
+
assembly: string;
|
|
35
|
+
group: string;
|
|
36
|
+
}): void;
|
|
37
|
+
addAtom(atom: Atom): void;
|
|
38
|
+
/**
|
|
39
|
+
* Rerutn molecule center
|
|
40
|
+
*/
|
|
41
|
+
getCenter(): Vec3;
|
|
42
|
+
getRadius(): number;
|
|
43
|
+
extendByMarker(makers: Marker): void;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=Molecule3D.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Molecule3D.d.ts","sourceRoot":"","sources":["../../src/molecule3d/Molecule3D.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGzC,OAAO,EAAE,MAAM,EAAE,MAAM,aA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IF.js';
|
|
4
|
+
import { MoleculeBuilder } from './MoleculeBuilder.js';
|
|
5
|
+
import { MoleculeConnector } from './MoleculeConnector.js';
|
|
6
|
+
export class Molecule3D {
|
|
7
|
+
title;
|
|
8
|
+
unitCell;
|
|
9
|
+
cellAtoms;
|
|
10
|
+
atoms;
|
|
11
|
+
bonds;
|
|
12
|
+
markers;
|
|
13
|
+
markersContacts;
|
|
14
|
+
reader;
|
|
15
|
+
builder;
|
|
16
|
+
connector;
|
|
17
|
+
initConnectivity;
|
|
18
|
+
center;
|
|
19
|
+
radius;
|
|
20
|
+
constructor() {
|
|
21
|
+
this.reader = new MoleculeReaderJCIF();
|
|
22
|
+
this.title = '';
|
|
23
|
+
this.cellAtoms = [];
|
|
24
|
+
this.atoms = [];
|
|
25
|
+
this.bonds = [];
|
|
26
|
+
this.markers = [];
|
|
27
|
+
this.markersContacts = [];
|
|
28
|
+
this.initConnectivity = false;
|
|
29
|
+
this.builder = new MoleculeBuilder(this);
|
|
30
|
+
this.connector = new MoleculeConnector(this);
|
|
31
|
+
this.center = null;
|
|
32
|
+
this.radius = 0;
|
|
33
|
+
}
|
|
34
|
+
load(input) {
|
|
35
|
+
this.reader.loadMolecule(this, input);
|
|
36
|
+
// Connect atoms
|
|
37
|
+
this.buildConnectivity();
|
|
38
|
+
// Add unique Atoms
|
|
39
|
+
this.builder.addUniqueAtoms();
|
|
40
|
+
}
|
|
41
|
+
buildConnectivity() {
|
|
42
|
+
if (!this.initConnectivity) {
|
|
43
|
+
this.connector.buildConnectivity();
|
|
44
|
+
this.initConnectivity = true;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
clear() {
|
|
48
|
+
this.title = '';
|
|
49
|
+
this.cellAtoms = [];
|
|
50
|
+
this.atoms = [];
|
|
51
|
+
this.bonds = [];
|
|
52
|
+
this.markers = [];
|
|
53
|
+
this.markersContacts = [];
|
|
54
|
+
this.center = null;
|
|
55
|
+
this.radius = 0;
|
|
56
|
+
}
|
|
57
|
+
addCellAtom(data) {
|
|
58
|
+
const o = data;
|
|
59
|
+
o.id = this.cellAtoms.length + 1;
|
|
60
|
+
o.unitCell = this.unitCell;
|
|
61
|
+
const atom = new CellAtom(o);
|
|
62
|
+
this.cellAtoms.push(atom);
|
|
63
|
+
}
|
|
64
|
+
addAtom(atom) {
|
|
65
|
+
this.atoms.push(atom);
|
|
66
|
+
this.center = null;
|
|
67
|
+
this.radius = 0;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Rerutn molecule center
|
|
71
|
+
*/
|
|
72
|
+
getCenter() {
|
|
73
|
+
if (this.center) {
|
|
74
|
+
return this.center;
|
|
75
|
+
}
|
|
76
|
+
if (this.atoms.length === 0) {
|
|
77
|
+
return new Vec3(0, 0, 0);
|
|
78
|
+
}
|
|
79
|
+
if (this.atoms.length === 1) {
|
|
80
|
+
return new Vec3(this.atoms[0].position.x, this.atoms[0].position.y, this.atoms[0].position.z);
|
|
81
|
+
}
|
|
82
|
+
let minX = Infinity;
|
|
83
|
+
let minY = Infinity;
|
|
84
|
+
let maxX = -Infinity;
|
|
85
|
+
let minZ = Infinity;
|
|
86
|
+
let maxY = -Infinity;
|
|
87
|
+
let maxZ = -Infinity;
|
|
88
|
+
for (let i = this.atoms.length - 1; i >= 0; i--) {
|
|
89
|
+
const p = this.atoms[i].position;
|
|
90
|
+
if (minX > p.x) {
|
|
91
|
+
minX = p.x;
|
|
92
|
+
}
|
|
93
|
+
if (minY > p.y) {
|
|
94
|
+
minY = p.y;
|
|
95
|
+
}
|
|
96
|
+
if (minZ > p.z) {
|
|
97
|
+
minZ = p.z;
|
|
98
|
+
}
|
|
99
|
+
if (maxX < p.x) {
|
|
100
|
+
maxX = p.x;
|
|
101
|
+
}
|
|
102
|
+
if (maxY < p.y) {
|
|
103
|
+
maxY = p.y;
|
|
104
|
+
}
|
|
105
|
+
if (maxZ < p.z) {
|
|
106
|
+
maxZ = p.z;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
this.center = new Vec3((minX + maxX) / 2, (minY + maxY) / 2, (minZ + maxZ) / 2);
|
|
110
|
+
return this.center;
|
|
111
|
+
}
|
|
112
|
+
getRadius() {
|
|
113
|
+
if (this.radius !== 0 && this.radius !== undefined) {
|
|
114
|
+
return this.radius;
|
|
115
|
+
}
|
|
116
|
+
this.radius = 0;
|
|
117
|
+
const center = this.getCenter();
|
|
118
|
+
let r2 = 0; // Radius squared
|
|
119
|
+
if (this.atoms.length === 0 || this.atoms.length === 1) {
|
|
120
|
+
return 0;
|
|
121
|
+
}
|
|
122
|
+
for (let i = this.atoms.length - 1; i >= 0; i--) {
|
|
123
|
+
const p = this.atoms[i].position;
|
|
124
|
+
const dx = p.x - center.x;
|
|
125
|
+
const dy = p.y - center.y;
|
|
126
|
+
const dz = p.z - center.z;
|
|
127
|
+
const r1 = dx * dx + dy * dy + dz * dz;
|
|
128
|
+
if (r1 > r2) {
|
|
129
|
+
r2 = r1;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
this.radius = Math.sqrt(r2);
|
|
133
|
+
return this.radius;
|
|
134
|
+
}
|
|
135
|
+
extendByMarker(makers) {
|
|
136
|
+
this.builder.extendByMarker(makers);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=Molecule3D.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Molecule3D.js","sourceRoot":"","sources":["../../src/molecule3d/Molecule3D.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAGvC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAGhE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAG3D,MAAM,OAAO,UAAU;IACd,KAAK,CAAS;IACd,QAA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,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;YACvC,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC;gBACZ,EAAE,GAAG,EAAE,CAAC;YACV,CAAC;QACH,CAAC;QAED,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC5B,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAEM,cAAc,CAAC,MAAc;QAClC,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC;CACF"}
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { Matrix3x4 } from
|
|
2
|
-
import { CellAtom } from
|
|
3
|
-
import { Marker } from
|
|
4
|
-
import { Molecule3D } from
|
|
5
|
-
export declare class MoleculeBuilder {
|
|
6
|
-
private molecule;
|
|
7
|
-
constructor(molecule: Molecule3D);
|
|
8
|
-
/**
|
|
9
|
-
* Add Unique Atoms to Molecule
|
|
10
|
-
*/
|
|
11
|
-
addUniqueAtoms(): void;
|
|
12
|
-
addAtomsBySymetry(symetryList: string[]): void;
|
|
13
|
-
addAtomWithBonds(catom: CellAtom, symetry: Matrix3x4):
|
|
14
|
-
atom: CellAtom;
|
|
15
|
-
symetry: Matrix3x4;
|
|
16
|
-
}
|
|
17
|
-
extendByMarker(marker: Marker): void;
|
|
18
|
-
addMarkers(): void;
|
|
19
|
-
}
|
|
1
|
+
import { Matrix3x4 } from '@chemistry/math';
|
|
2
|
+
import { CellAtom } from './CellAtom.js';
|
|
3
|
+
import { Marker } from './Marker.js';
|
|
4
|
+
import { Molecule3D } from './Molecule3D.js';
|
|
5
|
+
export declare class MoleculeBuilder {
|
|
6
|
+
private molecule;
|
|
7
|
+
constructor(molecule: Molecule3D);
|
|
8
|
+
/**
|
|
9
|
+
* Add Unique Atoms to Molecule
|
|
10
|
+
*/
|
|
11
|
+
addUniqueAtoms(): void;
|
|
12
|
+
addAtomsBySymetry(symetryList: string[]): void;
|
|
13
|
+
addAtomWithBonds(catom: CellAtom, symetry: Matrix3x4): {
|
|
14
|
+
atom: CellAtom;
|
|
15
|
+
symetry: Matrix3x4;
|
|
16
|
+
}[];
|
|
17
|
+
extendByMarker(marker: Marker): void;
|
|
18
|
+
addMarkers(): void;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=MoleculeBuilder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MoleculeBuilder.d.ts","sourceRoot":"","sources":["../../src/molecule3d/MoleculeBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAQ,MAAM,iBAAiB,CAAC;AAGlD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAa;gBAEjB,QAAQ,EAAE,UAAU;IAIhC;;OAEG;IACI,cAAc;IAId,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE;IAavC,gBAAgB,CACrB,KAAK,EAAE,QAAQ,EACf,OAAO,EAAE,SAAS,GACjB;QAAE,IAAI,EAAE,QAAQ,CAAC;QAAC,OAAO,EAAE,SAAS,CAAA;KAAE,EAAE;IA+CpC,cAAc,CAAC,MAAM,EAAE,MAAM;IA+B7B,UAAU;CA8ClB"}
|