Skip to content

Commit

Permalink
composite mapper
Browse files Browse the repository at this point in the history
  • Loading branch information
BotellaA committed Aug 31, 2023
1 parent bf1652a commit 7e7d79c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions vtk_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,22 @@ def create_object_pipeline(self, params):
file_name = params["file_name"]

actor = vtk.vtkActor()
mapper = vtk.vtkDataSetMapper()
actor.SetMapper(mapper)
if ".vtm" in file_name:
reader = vtk.vtkXMLMultiBlockDataReader()
filter = vtk.vtkCompositeDataGeometryFilter()
filter = vtk.vtkGeometryFilter()
filter.SetInputConnection(reader.GetOutputPort())
mapper = vtk.vtkCompositePolyDataMapper()
mapper.SetInputConnection(filter.GetOutputPort())
self.register_object(id, reader, filter, actor, mapper, {})
else:
reader = vtk.vtkXMLGenericDataObjectReader()
mapper = vtk.vtkDataSetMapper()
mapper.SetInputConnection(reader.GetOutputPort())
self.register_object(id, reader, {}, actor, mapper, {})

reader.SetFileName(f"/data/{file_name}")

actor.SetMapper(mapper)
mapper.SetColorModeToMapScalars()
mapper.SetResolveCoincidentTopologyLineOffsetParameters(1, -0.1)
mapper.SetResolveCoincidentTopologyPolygonOffsetParameters(2, 0)
Expand Down

0 comments on commit 7e7d79c

Please sign in to comment.