Skip to content

Commit

Permalink
Merge pull request #2 from Geode-solutions/fix/pipeline
Browse files Browse the repository at this point in the history
composite mapper
  • Loading branch information
BotellaA authored Aug 31, 2023
2 parents bf1652a + 7e7d79c commit 30c3004
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 30c3004

Please sign in to comment.