Skip to content

Commit

Permalink
Merge pull request #2030 from UV-CDAT/vtk-update-leak
Browse files Browse the repository at this point in the history
Vtk update leak
  • Loading branch information
doutriaux1 authored Jun 22, 2016
2 parents 3cf4518 + 8147172 commit 921dd9b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions Packages/vcs/vcs/vcs2vtk.py
Original file line number Diff line number Diff line change
Expand Up @@ -647,9 +647,9 @@ def projectArray(w, projection, wc, geo=None):

for i in range(0, w.GetNumberOfTuples()):
tuple = [0, 0, 0]
w.GetTupleValue(i, tuple)
w.GetTypedTuple(i, tuple)
geo.TransformPoint(tuple, tuple)
w.SetTupleValue(i, tuple)
w.SetTypedTuple(i, tuple)


# Geo projection
Expand Down Expand Up @@ -1296,9 +1296,9 @@ def prepFillarea(renWin, farea, cmap=None):
if opacity is not None:
color[-1] = opacity
color = [int(C / 100. * 255) for C in color]
colors.SetTupleValue(cellId, color)
colors.SetTypedTuple(cellId, color)
else:
color_arr.SetTupleValue(cellId, [255, 255, 255, 0])
color_arr.SetTypedTuple(cellId, [255, 255, 255, 0])

if st != "solid":
# Patterns/hatches support
Expand Down Expand Up @@ -1706,7 +1706,7 @@ def prepLine(renWin, line, cmap=None):
pts.InsertNextPoint(tmpx, tmpy, 0.)
n2 += 1
for j in range(n2):
colors.InsertNextTupleValue(vtk_color)
colors.InsertNextTypedTuple(vtk_color)
l = vtk.vtkLine()
l.GetPointIds().SetId(0, j + point_offset)
l.GetPointIds().SetId(1, j + point_offset + 1)
Expand Down
8 changes: 4 additions & 4 deletions Packages/vcs/vcs/vcsvtk/vectorpipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ def _plotInternal(self):
if self._vtkGeoTransform is not None:
newv = vtk.vtkDoubleArray()
newv.SetNumberOfComponents(3)
newv.InsertTupleValue(0, [lon.min(), lat.min(), 0])
newv.InsertTupleValue(1, [lon.max(), lat.max(), 0])
newv.InsertTypedTuple(0, [lon.min(), lat.min(), 0])
newv.InsertTypedTuple(1, [lon.max(), lat.max(), 0])

vcs2vtk.projectArray(newv, projection, self._vtkDataSetBounds)
dimMin = [0, 0, 0]
dimMax = [0, 0, 0]

newv.GetTupleValue(0, dimMin)
newv.GetTupleValue(1, dimMax)
newv.GetTypedTuple(0, dimMin)
newv.GetTypedTuple(1, dimMax)

maxDimX = max(dimMin[0], dimMax[0])
maxDimY = max(dimMin[1], dimMax[1])
Expand Down

0 comments on commit 921dd9b

Please sign in to comment.