From 90a2ff3b920fa8648d52fc3c9c645de0d8995160 Mon Sep 17 00:00:00 2001 From: "David C. Lonie" Date: Fri, 19 Sep 2014 14:32:20 -0400 Subject: [PATCH] Extract the data in doWrap rather than clip in the mapper. 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. --- Packages/vcs/Lib/vcs2vtk.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Packages/vcs/Lib/vcs2vtk.py b/Packages/vcs/Lib/vcs2vtk.py index 8635f4962d..b4fe3b61b2 100644 --- a/Packages/vcs/Lib/vcs2vtk.py +++ b/Packages/vcs/Lib/vcs2vtk.py @@ -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