Skip to content

Commit f563622

Browse files
bruyeretfinetjul
authored andcommitted
perf(Mapper): Remove call to modified() in a setter
When creating VBOs, the call to modified() induced by the setter caused a performance hit
1 parent 91a910b commit f563622

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Sources/Rendering/Core/Mapper/index.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@ function vtkMapper(publicAPI, model) {
5353
// make sure we do NOT call modified()
5454
};
5555

56+
publicAPI.setSelectionWebGLIdsToVTKIds = (selectionWebGLIdsToVTKIds) => {
57+
model.selectionWebGLIdsToVTKIds = selectionWebGLIdsToVTKIds;
58+
// make sure we do NOT call modified()
59+
// this attribute is only used when processing a selection made with the hardware selector
60+
// the mtime of the mapper doesn't need to be changed
61+
};
62+
5663
publicAPI.createDefaultLookupTable = () => {
5764
model.lookupTable = vtkLookupTable.newInstance();
5865
};
@@ -630,6 +637,7 @@ export function extend(publicAPI, model, initialValues = {}) {
630637
'colorCoordinates',
631638
'colorMapColors',
632639
'colorTextureMap',
640+
'selectionWebGLIdsToVTKIds',
633641
]);
634642
macro.setGet(publicAPI, model, [
635643
'colorByArrayName',
@@ -642,7 +650,6 @@ export function extend(publicAPI, model, initialValues = {}) {
642650
'renderTime',
643651
'scalarMode',
644652
'scalarVisibility',
645-
'selectionWebGLIdsToVTKIds',
646653
'static',
647654
'useLookupTableScalarRange',
648655
'customShaderAttributes', // point data array names that will be transferred to the VBO

0 commit comments

Comments
 (0)