diff --git a/src/mol-repr/structure/visual/bond-inter-unit-cylinder.ts b/src/mol-repr/structure/visual/bond-inter-unit-cylinder.ts index a6d46e55220e82c5fdb8b5518d030e1f6c824d63..d9bf85548561a1fb6fcef6264f84f6d843c7fbf6 100644 --- a/src/mol-repr/structure/visual/bond-inter-unit-cylinder.ts +++ b/src/mol-repr/structure/visual/bond-inter-unit-cylinder.ts @@ -133,7 +133,7 @@ function getInterUnitBondCylinderBuilderProps(structure: Structure, theme: Theme const o = edges[edgeIndex].props.order; const f = BitFlags.create(edges[edgeIndex].props.flag); if (BondType.is(f, BondType.Flag.MetallicCoordination) || BondType.is(f, BondType.Flag.HydrogenBond)) { - // show metall coordinations and hydrogen bonds with dashed cylinders + // show metallic coordinations and hydrogen bonds with dashed cylinders return LinkStyle.Dashed; } else if (o === 3) { return LinkStyle.Triple; diff --git a/src/mol-repr/structure/visual/bond-inter-unit-line.ts b/src/mol-repr/structure/visual/bond-inter-unit-line.ts index c78873c88fc7a74bfcd347403a7bc5bd9416c099..f31a7665287a62573b737218320aeaef11b4ccf5 100644 --- a/src/mol-repr/structure/visual/bond-inter-unit-line.ts +++ b/src/mol-repr/structure/visual/bond-inter-unit-line.ts @@ -71,7 +71,7 @@ function createInterUnitBondLines(ctx: VisualContext, structure: Structure, them const o = edges[edgeIndex].props.order; const f = BitFlags.create(edges[edgeIndex].props.flag); if (BondType.is(f, BondType.Flag.MetallicCoordination) || BondType.is(f, BondType.Flag.HydrogenBond)) { - // show metall coordinations and hydrogen bonds with dashed cylinders + // show metallic coordinations and hydrogen bonds with dashed cylinders return LinkStyle.Dashed; } else if (o === 3) { return LinkStyle.Triple; diff --git a/src/mol-repr/structure/visual/bond-intra-unit-cylinder.ts b/src/mol-repr/structure/visual/bond-intra-unit-cylinder.ts index 7aae65c38506e4d340f3732ff5c46f0d0e250488..a53098c30270d139fd18420af02261c418162b76 100644 --- a/src/mol-repr/structure/visual/bond-intra-unit-cylinder.ts +++ b/src/mol-repr/structure/visual/bond-intra-unit-cylinder.ts @@ -16,7 +16,7 @@ import { createLinkCylinderImpostors, createLinkCylinderMesh, LinkBuilderProps, import { UnitsMeshParams, UnitsVisual, UnitsMeshVisual, UnitsCylindersParams, UnitsCylindersVisual } from '../units-visual'; import { VisualUpdateState } from '../../util'; import { BondType } from '../../../mol-model/structure/model/types'; -import { BondCylinderParams, BondIterator, eachIntraBond, getIntraBondLoci, makeIntraBondIgnoreTest } from './util/bond'; +import { BondCylinderParams, BondIterator, eachIntraBond, getIntraBondLoci, ignoreBondType, makeIntraBondIgnoreTest } from './util/bond'; import { Sphere3D } from '../../../mol-math/geometry'; import { IntAdjacencyGraph } from '../../../mol-math/graph'; import { WebGLContext } from '../../../mol-gl/webgl/context'; @@ -33,7 +33,11 @@ function getIntraUnitBondCylinderBuilderProps(unit: Unit.Atomic, structure: Stru const bonds = unit.bonds; const { edgeCount, a, b, edgeProps, offset } = bonds; const { order: _order, flags: _flags } = edgeProps; - const { sizeFactor, sizeAspectRatio, adjustCylinderLength, aromaticBonds } = props; + const { sizeFactor, sizeAspectRatio, adjustCylinderLength, aromaticBonds, includeTypes, excludeTypes } = props; + + const include = BondType.fromNames(includeTypes); + const exclude = BondType.fromNames(excludeTypes); + const ignoreComputedAromatic = ignoreBondType(include, exclude, BondType.Flag.Computed); const vRef = Vec3(), delta = Vec3(); const pos = unit.conformation.invariantPosition; @@ -123,7 +127,7 @@ function getIntraUnitBondCylinderBuilderProps(unit: Unit.Atomic, structure: Stru const o = _order[edgeIndex]; const f = _flags[edgeIndex]; if (isBondType(f, BondType.Flag.MetallicCoordination) || isBondType(f, BondType.Flag.HydrogenBond)) { - // show metall coordinations and hydrogen bonds with dashed cylinders + // show metallic coordinations and hydrogen bonds with dashed cylinders return LinkStyle.Dashed; } else if (o === 3) { return LinkStyle.Triple; @@ -133,7 +137,7 @@ function getIntraUnitBondCylinderBuilderProps(unit: Unit.Atomic, structure: Stru const bR = elementAromaticRingIndices.get(bI); const arCount = (aR && bR) ? arrayIntersectionSize(aR, bR) : 0; - if (arCount || isBondType(f, BondType.Flag.Aromatic)) { + if (isBondType(f, BondType.Flag.Aromatic) || (arCount && !ignoreComputedAromatic)) { if (arCount === 2) { return LinkStyle.MirroredAromatic; } else { diff --git a/src/mol-repr/structure/visual/bond-intra-unit-line.ts b/src/mol-repr/structure/visual/bond-intra-unit-line.ts index f55e7eb0d687f944f1431e07589789c0c6a4b44e..49e9c1bb2f72988f3846401463b5626615de13ec 100644 --- a/src/mol-repr/structure/visual/bond-intra-unit-line.ts +++ b/src/mol-repr/structure/visual/bond-intra-unit-line.ts @@ -14,7 +14,7 @@ import { LinkStyle, createLinkLines, LinkBuilderProps } from './util/link'; import { UnitsVisual, UnitsLinesParams, UnitsLinesVisual } from '../units-visual'; import { VisualUpdateState } from '../../util'; import { BondType } from '../../../mol-model/structure/model/types'; -import { BondIterator, BondLineParams, getIntraBondLoci, eachIntraBond, makeIntraBondIgnoreTest } from './util/bond'; +import { BondIterator, BondLineParams, getIntraBondLoci, eachIntraBond, makeIntraBondIgnoreTest, ignoreBondType } from './util/bond'; import { Sphere3D } from '../../../mol-math/geometry'; import { Lines } from '../../../mol-geo/geometry/lines/lines'; import { IntAdjacencyGraph } from '../../../mol-math/graph'; @@ -36,10 +36,14 @@ function createIntraUnitBondLines(ctx: VisualContext, unit: Unit, structure: Str const elements = unit.elements; const bonds = unit.bonds; const { edgeCount, a, b, edgeProps, offset } = bonds; + if (!edgeCount) return Lines.createEmpty(lines); + const { order: _order, flags: _flags } = edgeProps; - const { sizeFactor, aromaticBonds } = props; + const { sizeFactor, aromaticBonds, includeTypes, excludeTypes } = props; - if (!edgeCount) return Lines.createEmpty(lines); + const include = BondType.fromNames(includeTypes); + const exclude = BondType.fromNames(excludeTypes); + const ignoreComputedAromatic = ignoreBondType(include, exclude, BondType.Flag.Computed); const vRef = Vec3(); const pos = unit.conformation.invariantPosition; @@ -84,7 +88,7 @@ function createIntraUnitBondLines(ctx: VisualContext, unit: Unit, structure: Str const o = _order[edgeIndex]; const f = _flags[edgeIndex]; if (isBondType(f, BondType.Flag.MetallicCoordination) || isBondType(f, BondType.Flag.HydrogenBond)) { - // show metall coordinations and hydrogen bonds with dashed cylinders + // show metallic coordinations and hydrogen bonds with dashed cylinders return LinkStyle.Dashed; } else if (o === 3) { return LinkStyle.Triple; @@ -94,7 +98,7 @@ function createIntraUnitBondLines(ctx: VisualContext, unit: Unit, structure: Str const bR = elementAromaticRingIndices.get(bI); const arCount = (aR && bR) ? arrayIntersectionSize(aR, bR) : 0; - if (arCount || isBondType(f, BondType.Flag.Aromatic)) { + if (isBondType(f, BondType.Flag.Aromatic) || (arCount && !ignoreComputedAromatic)) { if (arCount === 2) { return LinkStyle.MirroredAromatic; } else {