We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 54259b8 + cdf05a4 commit df355f9Copy full SHA for df355f9
Packages/cdms2/Src/Cdunifmodule.c
@@ -1158,7 +1158,7 @@ PyCdunifFile_Open(char *filename, char *mode)
1158
if (mode[0] == 'w') {
1159
Py_BEGIN_ALLOW_THREADS;
1160
acquire_Cdunif_lock();
1161
- ncmode = NC_CLOBBER;
+ ncmode = NC_CLOBBER|NC_64BIT_OFFSET;
1162
#ifndef NONC4
1163
if ((cdms_shuffle!=0) || (cdms_deflate!=0)) {
1164
ncmode = NC_CLOBBER|NC_NETCDF4;
Packages/vcs/Lib/VTKPlots.py
@@ -1032,6 +1032,10 @@ def plot2D(self,data1,data2,tmpl,gm,vtk_backend_grid=None,vtk_backend_geo=None):
1032
mapper.SetScalarModeToUseCellData()
1033
mappers.append([mapper,])
1034
else:
1035
+ if isinstance(gm,vcs.meshfill.Gfm):
1036
+ doCellPointForScalar = True
1037
+ else:
1038
+ doCellPointForScalar = False
1039
for j,color in enumerate(COLS[i]):
1040
mapper = vtk.vtkPolyDataMapper()
1041
lut = vtk.vtkLookupTable()
@@ -1047,7 +1051,7 @@ def plot2D(self,data1,data2,tmpl,gm,vtk_backend_grid=None,vtk_backend_geo=None):
1047
1051
lut.SetTableValue(0,r/100.,g/100.,b/100.)
1048
1052
mapper.SetLookupTable(lut)
1049
1053
mapper.SetScalarRange(l[j],l[j+1])
1050
- luts.append([lut,[l[j],l[j+1],False]])
1054
+ luts.append([lut,[l[j],l[j+1],doCellPointForScalar]])
1055
## Store the mapper only if it's worth it?
1056
## Need to do it with the whole slab min/max for animation purposes
1057
if not(l[j+1]<wmn or l[j]>wmx):
Packages/vcs/Lib/editors/marker.py
@@ -202,10 +202,6 @@ def detach(self):
202
self.tooltip.detach()
203
204
def delete(self):
205
- del self.marker.x[self.index]
206
- del self.marker.y[self.index]
207
- del self.marker.type[self.index]
208
- del self.marker.color[self.index]
209
self.actor.SetVisibility(0)
210
self.configurator.deactivate(self)
211
Packages/vcs/Lib/vtk_ui/manager.py
@@ -103,7 +103,7 @@ def add_widget(self, widget):
103
def remove_widget(self, widget):
104
if widget in self.widgets:
105
self.widgets.remove(widget)
106
- del widget.manager
+ widget.manager = None
107
if len(self.widgets) == 0:
108
del ui_managers[self.interactor]
109
self.detach()
Packages/vcs/Lib/vtk_ui/text.py
@@ -354,7 +354,8 @@ def place(self):
354
pass
355
356
def render(self):
357
- self.manager.queue_render()
+ if self.manager:
358
+ self.manager.queue_render()
359
360
def in_bounds(self, x, y):
361
if x < 1 and y < 1:
Packages/vcs/Lib/vtk_ui/textbox.py
@@ -374,8 +374,10 @@ def stop_editing(self):
374
self.cursor.hide()
375
if self.blank:
376
self.text = ""
377
- self.on_editing_end(self)
378
- self.text = " "
+ if self.on_editing_end:
+ self.on_editing_end(self)
379
+ if self.blank:
380
+ self.text = " "
381
382
def place(self):
383
super(Textbox, self).place()
Packages/vcs/Lib/vtk_ui/widget.py
@@ -7,6 +7,9 @@ def __init__(self, interactor, widget):
7
self.widget = widget
8
self.widget.SetInteractor(interactor)
9
self.repr = widget.GetRepresentation()
10
+ # By default, VTK will map the 'i' key to activating a widget.
11
+ # This was doing weird things and making buttons disappear.
12
+ self.widget.SetKeyPressActivation(False)
13
self.subscriptions = {}
14
self.manager = get_manager(interactor)
15
self.manager.add_widget(self)
@@ -98,6 +101,9 @@ def GetRenderer(self):
98
101
def GetCurrentRenderer(self):
99
102
return self._ren
100
+ def SetKeyPressActivation(self, value):
+ pass
+
def SetCurrentRenderer(self, renderer):
"""
The main cause of all this hubbub; need to use the actor_renderer.
testing/vcs/CMakeLists.txt
@@ -581,6 +581,11 @@ cdat_add_test(vcs_test_taylor_2_quads
581
${BASELINE_DIR}/test_vcs_issue_960_labels_1.png
582
${BASELINE_DIR}/test_vcs_issue_960_labels_2.png
583
)
584
+ cdat_add_test(vcs_test_animate_meshfill
585
+ "${PYTHON_EXECUTABLE}"
586
+ ${cdat_SOURCE_DIR}/testing/vcs/test_animate_meshfill.py
587
+ ${BASELINE_DIR}
588
+ )
589
cdat_add_test(vcs_test_animate_isofill
590
"${PYTHON_EXECUTABLE}"
591
${cdat_SOURCE_DIR}/testing/vcs/test_animate_isofill.py
@@ -636,3 +641,4 @@ cdat_add_test(vcs_test_colorpicker_appearance
636
641
${BASELINE_DIR}/test_vcs_colorpicker_appearance.png
637
642
638
643
add_subdirectory(vtk_ui)
644
+add_subdirectory(editors)
testing/vcs/editors/CMakeLists.txt
@@ -0,0 +1,7 @@
1
+set(BASELINE_DIR "${UVCDAT_GIT_TESTDATA_DIR}/baselines/vcs/editors")
2
+set(TEST_DIR "${cdat_SOURCE_DIR}/testing/vcs/editors")
3
4
+cdat_add_test(vcs_test_editor_marker_delete
5
6
+ ${TEST_DIR}/test_vcs_editor_marker_delete.py
+)
testing/vcs/editors/test_vcs_editor_marker_delete.py
@@ -0,0 +1,57 @@
+import vcs
+import sys
+x = vcs.init()
+x.open()
+m = x.createmarker()
+m.x = .1,
+m.y = .1,
+# enable the configurator
+x.configure()
+# plot in the background
+dp = x.plot(m)
16
17
+# Grab the initialized configurator
18
+c = x.configurator
19
20
+# Make sure the displays are current
21
+c.update()
22
23
+w, h = x.bgX, x.bgY
24
25
+# Retrieve the actor at the specified point
26
+c.interactor.SetEventInformation(int(.1 * w), int(.1 * h))
27
+c.click(None, None)
28
+c.release(None, None)
29
30
+# Make sure we've got the correct editor
31
+editor = c.target
32
+if editor is None:
33
+ print "Did not activate an editor"
34
+ sys.exit(1)
35
+print "Editor activated"
36
+if type(editor) != vcs.editors.marker.MarkerEditor:
37
+ print "Did not activate a marker editor"
38
39
+print "Editor is a marker editor"
40
+if editor.marker != m:
41
+ print "Did not activate the correct marker editor, expected", m.name, "received", editor.marker.name
42
43
+print "Marker editor is editing the correct marker"
44
45
+# Simulate a right click on the marker
46
+editor.right_release()
47
48
+# Make sure the editor has been deactivated
49
+if c.target == editor:
50
+ print "Did not deactivate editor"
51
52
+print "Marker editor deactivated"
53
+# Make sure the marker was deleted
54
+if len(m.x) != len(m.y) != len(m.type) != len(m.color) != 0:
55
+ print "Did not delete all attributes on marker"
56
57
+print "Deleted all attributes on marker"
0 commit comments