Skip to content

Commit

Permalink
Merge pull request #1983 from UV-CDAT/dotted-line
Browse files Browse the repository at this point in the history
BUG: Fix memory override for vtkContourFiler in isofillpipeline.
  • Loading branch information
danlipsa committed May 24, 2016
2 parents 9593283 + 2027069 commit abebe40
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 5 deletions.
8 changes: 4 additions & 4 deletions Packages/vcs/vcs/vcs2vtk.py
Original file line number Diff line number Diff line change
Expand Up @@ -1581,16 +1581,16 @@ def __build_ld__():

def stippleLine(prop, line_type):
if line_type == 'long-dash':
prop.SetLineStipplePattern(int('1111111100000000', 2))
prop.SetLineStipplePattern(int('0000111111111111', 2))
prop.SetLineStippleRepeatFactor(1)
elif line_type == 'dot':
prop.SetLineStipplePattern(int('1010101010101010', 2))
prop.SetLineStipplePattern(int('0101010101010101', 2))
prop.SetLineStippleRepeatFactor(1)
elif line_type == 'dash':
prop.SetLineStipplePattern(int('1111000011110000', 2))
prop.SetLineStipplePattern(int('0001111100011111', 2))
prop.SetLineStippleRepeatFactor(1)
elif line_type == 'dash-dot':
prop.SetLineStipplePattern(int('0011110000110011', 2))
prop.SetLineStipplePattern(int('0101111101011111', 2))
prop.SetLineStippleRepeatFactor(1)
elif line_type == 'solid':
prop.SetLineStipplePattern(int('1111111111111111', 2))
Expand Down
1 change: 0 additions & 1 deletion Packages/vcs/vcs/vcsvtk/isolinepipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ def _plotInternal(self):

for n in range(numLevels):
cot.SetValue(n, l[n])
cot.SetValue(numLevels, l[-1])
# TODO remove update
cot.Update()

Expand Down
7 changes: 7 additions & 0 deletions testing/vcs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1011,6 +1011,13 @@ cdat_add_test(test_vcs_boxfill_lambert_crash
"${BASELINE_DIR}/test_vcs_boxfill_lambert_crash.png"
"${UVCDAT_GIT_TESTDATA_DIR}/data/NCEP_09_climo.nc"
)

cdat_add_test(test_vcs_line_patterns
"${PYTHON_EXECUTABLE}"
${cdat_SOURCE_DIR}/testing/vcs/test_vcs_line_patterns.py
"${BASELINE_DIR}/test_vcs_line_patterns.png"
)

cdat_add_test(test_vcs_init_open_sizing
"${PYTHON_EXECUTABLE}"
${cdat_SOURCE_DIR}/testing/vcs/test_vcs_init_open_sizing.py
Expand Down
22 changes: 22 additions & 0 deletions testing/vcs/test_vcs_line_patterns.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import vcs
import cdms2
import sys
import os
import testing.regression as regression


pth = os.path.join(os.path.dirname(__file__), "..")
sys.path.append(pth)

import checkimage

x = regression.init(bg=1, geometry=(1620, 1080))

f = cdms2.open(vcs.sample_data + "/clt.nc")
s = f('clt')
iso = x.createisoline()
iso.level=[5, 50, 70, 95]
iso.line = ['dot', 'dash', 'dash-dot', 'long-dash']
x.plot(s,iso,continents=0)
name = "test_vcs_line_patterns.png"
regression.run(x, name)

0 comments on commit abebe40

Please sign in to comment.