Skip to content

Commit 63a4221

Browse files
authored
Merge pull request #2049 from UV-CDAT/meshfill_leak
BUG #1770: Display meshfill template elements through renderTemplate.
2 parents b3b5576 + 3873bdc commit 63a4221

4 files changed

Lines changed: 17 additions & 12 deletions

File tree

Packages/vcs/vcs/VTKPlots.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -810,10 +810,10 @@ def plotContinents(self, wc, projection, wrap, vp, priority, **kargs):
810810
priority=priority,
811811
create_renderer=True)
812812

813-
def renderTemplate(self, tmpl, data, gm, taxis, zaxis, **kargs):
813+
def renderTemplate(self, tmpl, data, gm, taxis, zaxis, X=None, Y=None, **kargs):
814814
# ok first basic template stuff, let's store the displays
815815
# because we need to return actors for min/max/mean
816-
displays = tmpl.plot(self.canvas, data, gm, bg=self.bg, **kargs)
816+
displays = tmpl.plot(self.canvas, data, gm, bg=self.bg, X=X, Y=Y, **kargs)
817817
returned = {}
818818
for d in displays:
819819
if d is None:

Packages/vcs/vcs/vcsvtk/meshfillpipeline.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -207,21 +207,26 @@ def _plotInternal(self):
207207
create_renderer=True)
208208
actors.append([act, plotting_dataset_bounds])
209209

210+
t = self._originalData1.getTime()
211+
if self._originalData1.ndim > 2:
212+
z = self._originalData1.getAxis(-3)
213+
else:
214+
z = None
210215
self._resultDict["vtk_backend_actors"] = actors
211216
kwargs = {"vtk_backend_grid": self._vtkDataSet,
212217
"dataset_bounds": self._vtkDataSetBounds,
213218
"plotting_dataset_bounds": plotting_dataset_bounds,
214219
"vtk_backend_geo": self._vtkGeoTransform}
215220
if ("ratio_autot_viewport" in self._resultDict):
216221
kwargs["ratio_autot_viewport"] = vp
217-
self._template.plot(self._context().canvas, self._data1, self._gm,
218-
bg=self._context().bg,
219-
X=numpy.arange(min(x1, x2),
220-
max(x1, x2) * 1.1,
221-
abs(x2 - x1) / 10.),
222-
Y=numpy.arange(min(y1, y2),
223-
max(y1, y2) * 1.1,
224-
abs(y2 - y1) / 10.), **kwargs)
222+
self._resultDict.update(self._context().renderTemplate(self._template, self._data1, self._gm,
223+
t, z,
224+
X=numpy.arange(min(x1, x2),
225+
max(x1, x2) * 1.1,
226+
abs(x2 - x1) / 10.),
227+
Y=numpy.arange(min(y1, y2),
228+
max(y1, y2) * 1.1,
229+
abs(y2 - y1) / 10.), **kwargs))
225230

226231
legend = getattr(self._gm, "legend", None)
227232

testing/vcs/test_vcs_meshfill_no_wrapping.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
h = f("heat")
55
x = regression.init()
66
x.plot(h, bg=1)
7-
regression.run(x, "vcs_test_meshfill_no_wrapping.png")
7+
regression.run(x, "test_vcs_meshfill_no_wrapping.png")

testing/vcs/test_vcs_meshfill_regular_grid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
f = cdms2.open(os.path.join(vcs.sample_data, "clt.nc"))
55
s = f("clt")
66
x.meshfill(s, bg=1)
7-
regression.run(x, "test_meshfill_regular_grid.png")
7+
regression.run(x, "test_vcs_meshfill_regular_grid.png")

0 commit comments

Comments
 (0)