-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1262 from UV-CDAT/update_master
Update master
- Loading branch information
Showing
14 changed files
with
167 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
set(BASELINE_DIR "${UVCDAT_GIT_TESTDATA_DIR}/baselines/vcs/editors") | ||
set(TEST_DIR "${cdat_SOURCE_DIR}/testing/vcs/editors") | ||
|
||
cdat_add_test(vcs_test_editor_marker_delete | ||
"${PYTHON_EXECUTABLE}" | ||
${TEST_DIR}/test_vcs_editor_marker_delete.py | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
|
||
# Grab the initialized configurator | ||
c = x.configurator | ||
|
||
# Make sure the displays are current | ||
c.update() | ||
|
||
w, h = x.bgX, x.bgY | ||
|
||
# Retrieve the actor at the specified point | ||
c.interactor.SetEventInformation(int(.1 * w), int(.1 * h)) | ||
c.click(None, None) | ||
c.release(None, None) | ||
|
||
# Make sure we've got the correct editor | ||
editor = c.target | ||
if editor is None: | ||
print "Did not activate an editor" | ||
sys.exit(1) | ||
print "Editor activated" | ||
if type(editor) != vcs.editors.marker.MarkerEditor: | ||
print "Did not activate a marker editor" | ||
sys.exit(1) | ||
print "Editor is a marker editor" | ||
if editor.marker != m: | ||
print "Did not activate the correct marker editor, expected", m.name, "received", editor.marker.name | ||
sys.exit(1) | ||
print "Marker editor is editing the correct marker" | ||
|
||
# Simulate a right click on the marker | ||
editor.right_release() | ||
|
||
# Make sure the editor has been deactivated | ||
if c.target == editor: | ||
print "Did not deactivate editor" | ||
sys.exit(1) | ||
print "Marker editor deactivated" | ||
# Make sure the marker was deleted | ||
if len(m.x) != len(m.y) != len(m.type) != len(m.color) != 0: | ||
print "Did not delete all attributes on marker" | ||
sys.exit(1) | ||
print "Deleted all attributes on marker" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import vcs | ||
import cdms2 | ||
import os | ||
import sys | ||
import MV2 | ||
|
||
pth = os.path.join(os.path.dirname(__file__),"..") | ||
sys.path.append(pth) | ||
import checkimage | ||
|
||
f=cdms2.open(os.path.join(vcs.prefix,"sample_data","sampleCurveGrid4.nc")) | ||
s=f("sample") | ||
print s.shape | ||
|
||
s2=MV2.resize(s,(4,32,48)) | ||
t=cdms2.createAxis(range(4)) | ||
t.units="months since 2015" | ||
t.id="time" | ||
t.designateTime() | ||
s2.setAxis(0,t) | ||
s2.setAxis(1,s.getAxis(0)) | ||
s2.setAxis(2,s.getAxis(1)) | ||
s2.setGrid(s.getGrid()) | ||
for i in range(4): | ||
s2[i]=s2[i]*(1+float(i)/10.) | ||
x=vcs.init() | ||
x.drawlogooff() | ||
x.setbgoutputdimensions(1200,1091,units="pixels") | ||
|
||
gm=x.createmeshfill() | ||
x.plot(s2,gm,bg=1) | ||
x.animate.create() | ||
prefix= os.path.split(__file__)[1][:-3] | ||
x.animate.save("%s.mp4"%prefix) | ||
pngs = x.animate.close(preserve_pngs = True) # so we can look at them again | ||
src_pth = sys.argv[1] | ||
pth = os.path.join(src_pth,prefix) | ||
ret = 0 | ||
for p in pngs: | ||
print "Checking:",p | ||
ret += checkimage.check_result_image(p,os.path.join(pth,os.path.split(p)[1]),checkimage.defaultThreshold) | ||
if ret == 0: | ||
os.removedirs(os.path.split(p)[0]) | ||
os.remove("%s.mp4" % prefix) | ||
sys.exit(ret) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
""" | ||
Test that text stays the same when you start/stop editing | ||
""" | ||
import vcs.vtk_ui | ||
import vtk | ||
|
||
from vtk_ui_test import vtk_ui_test | ||
|
||
|
||
class test_vtk_ui_textbox_blank_text(vtk_ui_test): | ||
def do_test(self): | ||
self.win.SetSize(130, 130) | ||
|
||
textbox = vcs.vtk_ui.Textbox(self.inter, "Test String") | ||
textbox.show() | ||
textbox.start_editing() | ||
textbox.stop_editing() | ||
if textbox.text == "Test String": | ||
self.passed = 0 | ||
|
||
if __name__ == "__main__": | ||
test_vtk_ui_textbox_blank_text().test() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters