-
Notifications
You must be signed in to change notification settings - Fork 66
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 #1296 from UV-CDAT/sync_master
Sync master
Showing
29 changed files
with
514 additions
and
105 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
os: | ||
- linux | ||
- osx | ||
# - osx | ||
|
||
language: c++ | ||
|
||
|
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,4 @@ | ||
#!/bin/bash | ||
# source is not portable whereas . is | ||
. "@CMAKE_INSTALL_PREFIX@/bin/setup_runtime.sh" | ||
python@PYVER@ "$@" |
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,16 @@ | ||
import vcs, cdms2, sys | ||
|
||
x = vcs.init() | ||
f = cdms2.open( sys.prefix+"/sample_data/geos5-sample.nc" ) | ||
dv3d = vcs.get3d_vector() | ||
dv3d.VerticalScaling = 4.0 | ||
dv3d.BasemapOpacity = 0.5 | ||
dv3d.ScaleColormap = [50.0, 75.0, 1] | ||
dv3d.ZSlider = [26.0], vcs.on | ||
dv3d.GlyphDensity = 3.0 | ||
dv3d.GlyphSize = 0.6 | ||
dv3d = vcs.get3d_vector() | ||
v0 = f["uwnd"] | ||
v1 = f["vwnd"] | ||
x.plot( v0, v1, dv3d ) | ||
x.interact() |
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
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,20 @@ | ||
import vcs, cdms2, os, sys | ||
src=sys.argv[1] | ||
pth = os.path.join(os.path.dirname(__file__),"..") | ||
sys.path.append(pth) | ||
import checkimage | ||
x=vcs.init() | ||
x.drawlogooff() | ||
|
||
x.setbgoutputdimensions(1200,1091,units="pixels") | ||
x = vcs.init() | ||
f = cdms2.open(os.path.join(vcs.prefix, "sample_data", "clt.nc")) | ||
s = f("clt") | ||
x.meshfill(s,bg=1) | ||
fnm = "test_meshfill_regular_grid.png" | ||
x.png(fnm) | ||
|
||
print "fnm:",fnm | ||
print "src:",src | ||
ret = checkimage.check_result_image(fnm,src,checkimage.defaultThreshold) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import vcs, sys | ||
|
||
passing = False | ||
|
||
|
||
def save_clicked(colormap, color): | ||
if color == 135: | ||
global passing | ||
passing = True | ||
|
||
|
||
picker = vcs.colorpicker.ColorPicker(500, 500, None, None, on_save=save_clicked) | ||
|
||
interactor = picker.render_window.GetInteractor() | ||
interactor.SetEventInformation(250, 260) | ||
picker.clickEvent(None, None) | ||
picker.save(0) | ||
|
||
sys.exit(0 if passing else 1) |
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,29 @@ | ||
import vcs, vtk | ||
|
||
x = vcs.init() | ||
x.open() | ||
x.configure() | ||
|
||
x.backend.renWin.SetSize(814, 303) | ||
x.backend.renWin.Modified() | ||
|
||
fnm = "test_vcs_configurator_resize.png" | ||
|
||
win = x.backend.renWin | ||
win.Render() | ||
out_filter = vtk.vtkWindowToImageFilter() | ||
out_filter.SetInput(win) | ||
|
||
png_writer = vtk.vtkPNGWriter() | ||
png_writer.SetFileName(fnm) | ||
png_writer.SetInputConnection(out_filter.GetOutputPort()) | ||
png_writer.Write() | ||
|
||
import sys, os | ||
if len(sys.argv) > 1: | ||
pth = os.path.join(os.path.dirname(__file__), "..") | ||
sys.path.append(pth) | ||
import checkimage | ||
src = sys.argv[1] | ||
ret = checkimage.check_result_image(fnm, src, checkimage.defaultThreshold) | ||
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,32 @@ | ||
""" | ||
Test button state change | ||
""" | ||
import vcs.vtk_ui | ||
|
||
|
||
from vtk_ui_test import vtk_ui_test | ||
|
||
class test_vtk_ui_button_state_advance(vtk_ui_test): | ||
def do_test(self): | ||
self.win.SetSize(100, 100) | ||
states = [vcs.vtk_ui.ButtonState(label="State %d" % i, fgcolor=(.1 * i + .5, .1 * i + .5, .1 * i + .5), bgcolor=(.5 - .1 * i,.5 - .1 * i,.5 - .1 * i)) for i in range(5)] | ||
|
||
b = vcs.vtk_ui.Button(self.inter, states=states, action=self.pass_me, left=0, top=0) | ||
b.show() | ||
|
||
b.set_state(1) | ||
b.repr.NextState() | ||
b.widget.InvokeEvent("StateChangedEvent") | ||
|
||
|
||
def pass_me(self, state): | ||
if state == 2: | ||
print "Button action executed" | ||
self.passed = 0 | ||
else: | ||
print state, "Action passed inaccurate state" | ||
from sys import exit | ||
sys.exit(1) | ||
|
||
if __name__ == "__main__": | ||
test_vtk_ui_button_state_advance().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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
""" | ||
Test window resizing placing widgets correctly | ||
""" | ||
import vcs.vtk_ui | ||
|
||
from vtk_ui_test import vtk_ui_test | ||
|
||
|
||
class test_vtk_ui_manager_resize(vtk_ui_test): | ||
def do_test(self): | ||
self.win.SetSize(250, 100) | ||
# Due to UV-CDAT/uvcdat#1148, have to render on screen when resizing | ||
self.win.SetOffScreenRendering(0) | ||
|
||
button = vcs.vtk_ui.Button(self.inter, label="Position me", left=10, top=10) | ||
button.place() | ||
button.show() | ||
|
||
self.win.SetSize(200, 50) | ||
|
||
self.win.Modified() | ||
|
||
self.test_file = "test_vtk_ui_manager_resize.png" | ||
|
||
if __name__ == "__main__": | ||
test_vtk_ui_manager_resize().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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
""" | ||
Test toggle_button get text | ||
""" | ||
import vcs.vtk_ui | ||
|
||
|
||
from vtk_ui_test import vtk_ui_test | ||
|
||
class test_vtk_ui_toggle_button_get_text(vtk_ui_test): | ||
def do_test(self): | ||
b = vcs.vtk_ui.ToggleButton(self.inter, "Simple label") | ||
b.set_state(1) | ||
assert b.get_text() == "Simple label" | ||
b.set_state(0) | ||
assert b.get_text() == "Simple label" | ||
self.passed = 0 |
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,24 @@ | ||
""" | ||
Test toolbar placement and basic appearance | ||
""" | ||
import vcs.vtk_ui | ||
|
||
|
||
from vtk_ui_test import vtk_ui_test | ||
|
||
class test_vtk_ui_toolbar_close(vtk_ui_test): | ||
def do_test(self): | ||
self.win.SetSize(200, 100) | ||
|
||
toolbar = vcs.vtk_ui.Toolbar(self.inter, "Test Bar") | ||
toolbar.add_button(["Test Button"]) | ||
toolbar.add_button(["Other Test"]) | ||
toolbar.label.__advance__(1) | ||
toolbar.label.__advance__(0) | ||
assert toolbar.open == False | ||
toolbar.show() | ||
|
||
self.test_file = "test_vtk_ui_toolbar_close.png" | ||
|
||
if __name__ == "__main__": | ||
test_vtk_ui_toolbar_close().test() |
29 changes: 29 additions & 0 deletions
29
testing/vcs/vtk_ui/test_vtk_ui_toolbar_in_toolbar_closed.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,29 @@ | ||
""" | ||
Test toolbar placement inside toolbar | ||
""" | ||
import vcs.vtk_ui | ||
|
||
|
||
from vtk_ui_test import vtk_ui_test | ||
|
||
class test_vtk_ui_toolbar_in_toolbar_closed(vtk_ui_test): | ||
def do_test(self): | ||
self.win.SetSize(200, 250) | ||
|
||
toolbar = vcs.vtk_ui.Toolbar(self.inter, "Test Bar") | ||
tb = toolbar.add_toolbar("Sub-bar") | ||
tb.add_button(["first"]) | ||
tb.add_button(["second"]) | ||
toolbar.add_button(["Test Button"]) | ||
toolbar.add_button(["Other Test"]) | ||
toolbar.show() | ||
|
||
# Open both toolbars | ||
toolbar.label.__advance__(1) | ||
tb.label.__advance__(1) | ||
tb.label.__advance__(0) | ||
|
||
self.test_file = "test_vtk_ui_toolbar_in_toolbar_closed.png" | ||
|
||
if __name__ == "__main__": | ||
test_vtk_ui_toolbar_in_toolbar_closed().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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
""" | ||
Test toolbar placement inside toolbar | ||
""" | ||
import vcs.vtk_ui | ||
|
||
|
||
from vtk_ui_test import vtk_ui_test | ||
|
||
class test_vtk_ui_toolbar_in_toolbar_open(vtk_ui_test): | ||
def do_test(self): | ||
self.win.SetSize(200, 250) | ||
|
||
toolbar = vcs.vtk_ui.Toolbar(self.inter, "Test Bar") | ||
tb = toolbar.add_toolbar("Sub-bar") | ||
tb.add_button(["first"]) | ||
tb.add_button(["second"]) | ||
toolbar.add_button(["Test Button"]) | ||
toolbar.add_button(["Other Test"]) | ||
toolbar.show() | ||
|
||
# Open both toolbars | ||
toolbar.label.__advance__(1) | ||
tb.label.__advance__(1) | ||
|
||
self.test_file = "test_vtk_ui_toolbar_in_toolbar_open.png" | ||
|
||
if __name__ == "__main__": | ||
test_vtk_ui_toolbar_in_toolbar_open().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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
""" | ||
Test toolbar placement and basic appearance | ||
""" | ||
import vcs.vtk_ui | ||
|
||
|
||
from vtk_ui_test import vtk_ui_test | ||
|
||
class test_vtk_ui_toolbar_label(vtk_ui_test): | ||
def do_test(self): | ||
self.win.SetSize(200, 100) | ||
|
||
toolbar = vcs.vtk_ui.Toolbar(self.inter, "Test Bar") | ||
# Should default to closed; these will help make sure | ||
toolbar.add_button(["Test Button"]) | ||
toolbar.add_button(["Other Test"]) | ||
assert toolbar.open == False | ||
toolbar.show() | ||
|
||
self.test_file = "test_vtk_ui_toolbar_label.png" | ||
|
||
if __name__ == "__main__": | ||
test_vtk_ui_toolbar_label().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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
""" | ||
Test toolbar placement and basic appearance | ||
""" | ||
import vcs.vtk_ui | ||
|
||
|
||
from vtk_ui_test import vtk_ui_test | ||
|
||
class test_vtk_ui_toolbar_open(vtk_ui_test): | ||
def do_test(self): | ||
self.win.SetSize(200, 100) | ||
|
||
toolbar = vcs.vtk_ui.Toolbar(self.inter, "Test Bar") | ||
toolbar.add_button(["Test Button"]) | ||
toolbar.add_button(["Other Test"]) | ||
toolbar.label.__advance__(1) | ||
assert toolbar.open == True | ||
toolbar.show() | ||
|
||
|
||
self.test_file = "test_vtk_ui_toolbar_open.png" | ||
|
||
if __name__ == "__main__": | ||
test_vtk_ui_toolbar_open().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