Skip to content

Commit 9679fdd

Browse files
committed
fix(RenderWindow): Don't count primitives of not visible props
1 parent f345a47 commit 9679fdd

File tree

1 file changed

+15
-11
lines changed
  • Sources/Rendering/Core/RenderWindow

1 file changed

+15
-11
lines changed

Sources/Rendering/Core/RenderWindow/index.js

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,20 +61,24 @@ function vtkRenderWindow(publicAPI, model) {
6161
};
6262

6363
publicAPI.getStatistics = () => {
64-
const results = { propCount: 0 };
64+
const results = { propCount: 0, invisiblePropCount: 0 };
6565
model.renderers.forEach((ren) => {
6666
const props = ren.getViewProps();
6767
props.forEach((prop) => {
68-
results.propCount += 1;
69-
const mpr = prop.getMapper();
70-
if (mpr && mpr.getPrimativeCount) {
71-
const pcount = mpr.getPrimativeCount();
72-
Object.keys(pcount).forEach((keyName) => {
73-
if (!results[keyName]) {
74-
results[keyName] = 0;
75-
}
76-
results[keyName] += pcount[keyName];
77-
});
68+
if (prop.getVisibility()) {
69+
results.propCount += 1;
70+
const mpr = prop.getMapper();
71+
if (mpr && mpr.getPrimativeCount) {
72+
const pcount = mpr.getPrimativeCount();
73+
Object.keys(pcount).forEach((keyName) => {
74+
if (!results[keyName]) {
75+
results[keyName] = 0;
76+
}
77+
results[keyName] += pcount[keyName];
78+
});
79+
}
80+
} else {
81+
results.invisiblePropCount += 1;
7882
}
7983
});
8084
});

0 commit comments

Comments
 (0)