|
@@ -23,7 +23,7 @@ import { Carbohydrates } from './carbohydrates/data';
|
|
import { computeCarbohydrates } from './carbohydrates/compute';
|
|
import { computeCarbohydrates } from './carbohydrates/compute';
|
|
import { Vec3, Mat4 } from '../../../mol-math/linear-algebra';
|
|
import { Vec3, Mat4 } from '../../../mol-math/linear-algebra';
|
|
import { idFactory } from '../../../mol-util/id-factory';
|
|
import { idFactory } from '../../../mol-util/id-factory';
|
|
-import { Box3D, GridLookup3D } from '../../../mol-math/geometry';
|
|
|
|
|
|
+import { GridLookup3D } from '../../../mol-math/geometry';
|
|
import { UUID } from '../../../mol-util';
|
|
import { UUID } from '../../../mol-util';
|
|
import { CustomProperties } from '../../custom-property';
|
|
import { CustomProperties } from '../../custom-property';
|
|
import { AtomicHierarchy } from '../model/properties/atomic';
|
|
import { AtomicHierarchy } from '../model/properties/atomic';
|
|
@@ -1213,23 +1213,16 @@ namespace Structure {
|
|
|
|
|
|
const lookup = structure.lookup3d;
|
|
const lookup = structure.lookup3d;
|
|
const imageCenter = Vec3();
|
|
const imageCenter = Vec3();
|
|
- const bboxA = Box3D();
|
|
|
|
- const bboxB = Box3D();
|
|
|
|
- const rvec = Vec3.create(maxRadius, maxRadius, maxRadius);
|
|
|
|
|
|
|
|
for (const unitA of structure.units) {
|
|
for (const unitA of structure.units) {
|
|
if (!validUnit(unitA)) continue;
|
|
if (!validUnit(unitA)) continue;
|
|
|
|
|
|
const bs = unitA.boundary.sphere;
|
|
const bs = unitA.boundary.sphere;
|
|
- Box3D.expand(bboxA, unitA.boundary.box, rvec);
|
|
|
|
Vec3.transformMat4(imageCenter, bs.center, unitA.conformation.operator.matrix);
|
|
Vec3.transformMat4(imageCenter, bs.center, unitA.conformation.operator.matrix);
|
|
const closeUnits = lookup.findUnitIndices(imageCenter[0], imageCenter[1], imageCenter[2], bs.radius + maxRadius);
|
|
const closeUnits = lookup.findUnitIndices(imageCenter[0], imageCenter[1], imageCenter[2], bs.radius + maxRadius);
|
|
for (let i = 0; i < closeUnits.count; i++) {
|
|
for (let i = 0; i < closeUnits.count; i++) {
|
|
const unitB = structure.units[closeUnits.indices[i]];
|
|
const unitB = structure.units[closeUnits.indices[i]];
|
|
if (unitA.id >= unitB.id) continue;
|
|
if (unitA.id >= unitB.id) continue;
|
|
-
|
|
|
|
- Box3D.expand(bboxB, unitB.boundary.box, rvec);
|
|
|
|
- if (!Box3D.overlaps(bboxA, bboxB)) continue;
|
|
|
|
if (!validUnit(unitB) || !validUnitPair(unitA, unitB)) continue;
|
|
if (!validUnit(unitB) || !validUnitPair(unitA, unitB)) continue;
|
|
|
|
|
|
if (unitB.elements.length >= unitA.elements.length) callback(unitA, unitB);
|
|
if (unitB.elements.length >= unitA.elements.length) callback(unitA, unitB);
|