Skip to content

Commit

Permalink
Extract the data in doWrap rather than clip in the mapper.
Browse files Browse the repository at this point in the history
plotContinents pulls the (unclipped) data out of the mapper's input,
bypassing the clipping planes added in setClipPlanes during the
projection.

Now projected datasets will be properly windowed.
  • Loading branch information
David C. Lonie committed Sep 19, 2014
1 parent 0914bdb commit 90a2ff3
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions Packages/vcs/Lib/vcs2vtk.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,17 +597,27 @@ def doWrap(Act,wc,wrap=[0.,360]):
Tpf.Update()
appendFilter.AddInputData(Tpf.GetOutput())
appendFilter.Update()
appendFilter.Update()

# Clip the data to the final window:
clipBox = vtk.vtkBox()
clipBox.SetXMin(xmn, ymn, -1.0)
clipBox.SetXMax(xmx, ymx, 1.0)
clipper = vtk.vtkExtractPolyDataGeometry()
clipper.SetInputConnection(appendFilter.GetOutputPort())
clipper.SetImplicitFunction(clipBox)
clipper.ExtractInsideOn()
clipper.PassPointsOff()
clipper.Update()

Actor = vtk.vtkActor()
Actor.SetProperty(Act.GetProperty())
#Mapper2 = vtk.vtkDataSetMapper()
#Mapper2 = vtk.vtkCompositePolyDataMapper()
Mapper2 = vtk.vtkPolyDataMapper()
Mapper2.SetInputData(appendFilter.GetOutput())
Mapper2.SetInputData(clipper.GetOutput())
Mapper2.SetLookupTable(Mapper.GetLookupTable())
Mapper2.SetScalarRange(Mapper.GetScalarRange())
Mapper2.SetScalarMode(Mapper.GetScalarMode())
setClipPlanes(Mapper2, xmn, xmx, ymn, ymx)
Mapper2.Update()
Actor.SetMapper(Mapper2)
return Actor
Expand Down

0 comments on commit 90a2ff3

Please sign in to comment.