Skip to content

Commit faaf15d

Browse files
committed
fix(getPrimativeCount): Update mappers with correct getPrimativeCount
1 parent 59fa9a4 commit faaf15d

File tree

4 files changed

+36
-4
lines changed

4 files changed

+36
-4
lines changed

Sources/Interaction/UI/FPSMonitor/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,15 @@ function vtkFPSMonitor(publicAPI, model) {
6262
function updateInformations() {
6363
const infoItems = [];
6464
if (model.renderWindow) {
65+
const realView = model.renderWindow.getViews()[0];
66+
if (realView && realView.getSize) {
67+
infoItems.push(
68+
`<label class="${style.label}">Resolution</label><span class="${
69+
style.value
70+
}">${realView.getSize().join('x')}</span>`
71+
);
72+
}
73+
6574
const stats = model.renderWindow.getStatistics();
6675
const keys = Object.keys(stats);
6776
keys.sort();

Sources/Rendering/Core/Glyph3DMapper/index.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,32 @@ function vtkGlyph3DMapper(publicAPI, model) {
264264
model.buildTime.modified();
265265
}
266266
};
267+
268+
publicAPI.getPrimativeCount = () => {
269+
const glyph = publicAPI.getInputData(1);
270+
const mult =
271+
publicAPI
272+
.getInputData()
273+
.getPoints()
274+
.getNumberOfValues() / 3;
275+
276+
const pcount = {
277+
points: mult * glyph.getPoints().getNumberOfValues() / 3,
278+
verts:
279+
mult *
280+
(glyph.getVerts().getNumberOfValues() -
281+
glyph.getVerts().getNumberOfCells()),
282+
lines:
283+
mult *
284+
(glyph.getLines().getNumberOfValues() -
285+
2 * glyph.getLines().getNumberOfCells()),
286+
triangles:
287+
mult *
288+
(glyph.getPolys().getNumberOfValues() -
289+
3 * glyph.getLines().getNumberOfCells()),
290+
};
291+
return pcount;
292+
};
267293
}
268294

269295
// ----------------------------------------------------------------------------

Sources/Rendering/Core/Mapper/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ function vtkMapper(publicAPI, model) {
504504
publicAPI.getPrimativeCount = () => {
505505
const input = publicAPI.getInputData();
506506
const pcount = {
507-
points: input.getPoints().getNumberOfValues(),
507+
points: input.getPoints().getNumberOfValues() / 3,
508508
verts:
509509
input.getVerts().getNumberOfValues() -
510510
input.getVerts().getNumberOfCells(),

Sources/Rendering/Core/RenderWindow/index.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,6 @@ function vtkRenderWindow(publicAPI, model) {
8282
.map((keyName) => `${keyName}: ${results[keyName]}`)
8383
.join('\n');
8484

85-
if (results.points) {
86-
results.points /= 3;
87-
}
8885
return results;
8986
};
9087

0 commit comments

Comments
 (0)