Skip to content
Snippets Groups Projects
Commit 6dd87623 authored by Alexander Rose's avatar Alexander Rose
Browse files

avoid superfluous calls to Loci.isWholeStructure

parent ae2314d7
No related branches found
No related tags found
No related merge requests found
......@@ -12,6 +12,7 @@ Note that since we don't clearly distinguish between a public and private interf
- Hide ``includeParent`` option from gaussian-surface visuals (not particularly useful)
- Improved ``StructureElement.Loci.size`` performance (for marking large cellpack models)
- Fix new ``TransformData`` issues (camera/bounding helper not showing up)
- Improve marking performance (avoid superfluous calls to ``StructureElement.Loci.isWholeStructure``)
## [v2.2.2] - 2021-08-11
......
......@@ -14,7 +14,7 @@ import { getNextMaterialId, GraphicsRenderObject } from '../../mol-gl/render-obj
import { Theme } from '../../mol-theme/theme';
import { Task } from '../../mol-task';
import { PickingId } from '../../mol-geo/geometry/picking';
import { EmptyLoci, Loci, isEveryLoci, isDataLoci } from '../../mol-model/loci';
import { EmptyLoci, Loci, isEveryLoci, isDataLoci, EveryLoci } from '../../mol-model/loci';
import { MarkerAction, MarkerActions } from '../../mol-util/marker-action';
import { Overpaint } from '../../mol-theme/overpaint';
import { StructureParams } from './params';
......@@ -77,6 +77,10 @@ export function ComplexRepresentation<P extends StructureParams>(label: string,
if (!Structure.areRootsEquivalent(loci.structure, _structure)) return false;
// Remap `loci` from equivalent structure to the current `_structure`
loci = Loci.remap(loci, _structure);
if (StructureElement.Loci.is(loci) && StructureElement.Loci.isWholeStructure(loci)) {
// Change to `EveryLoci` to allow for downstream optimizations
loci = EveryLoci;
}
} else if (!isEveryLoci(loci) && !isDataLoci(loci)) {
return false;
}
......
......@@ -15,7 +15,7 @@ import { getNextMaterialId, GraphicsRenderObject } from '../../mol-gl/render-obj
import { Theme } from '../../mol-theme/theme';
import { Task } from '../../mol-task';
import { PickingId } from '../../mol-geo/geometry/picking';
import { Loci, EmptyLoci, isEmptyLoci, isEveryLoci, isDataLoci } from '../../mol-model/loci';
import { Loci, EmptyLoci, isEmptyLoci, isEveryLoci, isDataLoci, EveryLoci } from '../../mol-model/loci';
import { MarkerAction, MarkerActions, applyMarkerAction } from '../../mol-util/marker-action';
import { Overpaint } from '../../mol-theme/overpaint';
import { Transparency } from '../../mol-theme/transparency';
......@@ -196,6 +196,10 @@ export function UnitsRepresentation<P extends StructureParams>(label: string, ct
if (!Structure.areRootsEquivalent(loci.structure, _structure)) return false;
// Remap `loci` from equivalent structure to the current `_structure`
loci = Loci.remap(loci, _structure);
if (StructureElement.Loci.is(loci) && StructureElement.Loci.isWholeStructure(loci)) {
// Change to `EveryLoci` to allow for downstream optimizations
loci = EveryLoci;
}
} else if (!isEveryLoci(loci) && !isDataLoci(loci)) {
return false;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment