diff --git a/src/mol-model/structure/structure/symmetry.ts b/src/mol-model/structure/structure/symmetry.ts index 1b917041444704a539124a1d2800354e8fdebb6e..4f4cfe6f6c6c7058baea70c84c4311fcf37900a8 100644 --- a/src/mol-model/structure/structure/symmetry.ts +++ b/src/mol-model/structure/structure/symmetry.ts @@ -83,7 +83,12 @@ namespace StructureSymmetry { export function areTransformGroupsEquivalent(a: ReadonlyArray<Unit.SymmetryGroup>, b: ReadonlyArray<Unit.SymmetryGroup>) { if (a.length !== b.length) return false for (let i = 0, il = a.length; i < il; ++i) { + const au = a[i].units, bu = b[i].units; + if (au.length !== bu.length) return false; if (a[i].hashCode !== b[i].hashCode) return false + for (let j = 0, _j = au.length; j < _j; j++) { + if (au[j].conformation !== bu[j].conformation) return false; + } } return true } diff --git a/src/mol-repr/structure/units-representation.ts b/src/mol-repr/structure/units-representation.ts index b54a84c252131a13e1af0c16612e026a309a731b..89e7adc7b8f1fecb5075cc92a5e578e3957c5ee4 100644 --- a/src/mol-repr/structure/units-representation.ts +++ b/src/mol-repr/structure/units-representation.ts @@ -65,7 +65,6 @@ export function UnitsRepresentation<P extends UnitsParams>(label: string, ctx: R if (runtime.shouldUpdate) await runtime.update({ message: 'Creating or updating UnitsVisual', current: i, max: _groups.length }) } } else if (structure && !Structure.areEquivalent(structure, _structure)) { - // console.log(label, 'structure not equivalent') // Tries to re-use existing visuals for the groups of the new structure. // Creates additional visuals if needed, destroys left-over visuals. _groups = structure.unitSymmetryGroups; diff --git a/src/mol-repr/structure/units-visual.ts b/src/mol-repr/structure/units-visual.ts index 41b74b4d7bf1dce714566390520c8f44bcd3d735..b657c4a7c620bf953023d953c7b1e4a30d71ea5e 100644 --- a/src/mol-repr/structure/units-visual.ts +++ b/src/mol-repr/structure/units-visual.ts @@ -120,8 +120,12 @@ export function UnitsVisual<G extends Geometry, P extends UnitsParams & Geometry } // check if the conformation of unit.model has changed - if (Unit.conformationId(newStructureGroup.group.units[0]) !== Unit.conformationId(currentStructureGroup.group.units[0])) { + // if (Unit.conformationId(newStructureGroup.group.units[0]) !== Unit.conformationId(currentStructureGroup.group.units[0])) { + if (Unit.conformationId(newStructureGroup.group.units[0]) !== Unit.conformationId(currentStructureGroup.group.units[0]) + // TODO: this needs more attention + || newStructureGroup.group.units[0].conformation !== currentStructureGroup.group.units[0].conformation) { // console.log('new conformation') + updateState.updateTransform = true; updateState.createGeometry = true }