Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vtkMapper.setResolveCoincidentTopologyPolygonOffsetParameters errors #3131

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Sources/Rendering/Core/Mapper/CoincidentTopologyHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ const staticOffsetModel = {
Line: { factor: 1, offset: -1 },
Point: { factor: 0, offset: -2 },
};
const staticOffsetAPI = {};
const noOp = () => undefined;
const staticOffsetAPI = {
modified: noOp,
};

addCoincidentTopologyMethods(
staticOffsetAPI,
Expand Down
38 changes: 38 additions & 0 deletions Sources/Rendering/Core/Mapper/test/testCoincidentTopologyHelper.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import test from 'tape';
import testUtils from 'vtk.js/Sources/Testing/testUtils';

import vtkMapper from 'vtk.js/Sources/Rendering/Core/Mapper';

test('Test calling CoincidentTopologyHelper static functions', async (t) => {
const gc = testUtils.createGarbageCollector(t);

// set back to starting/default values to avoid side effects for other tests
const startingParameters =
vtkMapper.getResolveCoincidentTopologyPolygonOffsetParameters();
vtkMapper.setResolveCoincidentTopologyPolygonOffsetParameters({
factor: -3,
offset: -3,
});
vtkMapper.setResolveCoincidentTopologyPolygonOffsetParameters(
startingParameters
);
const endingParameters =
vtkMapper.getResolveCoincidentTopologyPolygonOffsetParameters();
t.deepEqual(
startingParameters,
endingParameters,
'Initial PolygonOffset parameters after get and set are matching'
);

const startingLineParameters =
vtkMapper.getResolveCoincidentTopologyLineOffsetParameters();
vtkMapper.setResolveCoincidentTopologyLineOffsetParameters(-3, -3);
vtkMapper.setResolveCoincidentTopologyLineOffsetParameters(
startingLineParameters
);

t.ok('rendering', 'CoincidentTopologyHelper functions called without error');

// Free memory, end the test
gc.releaseResources();
});
Loading