Skip to content

Commit 8fe2da2

Browse files
committed
BUG #1959: Fix memory override for vtkContourFiler in isofillpipeline.
This resulted in vtkStripper to generate double coverage of isocountours which resulted in messed-up patterns. Also adjusted plot patterns to easier to discriminate.
1 parent 7dbe9cc commit 8fe2da2

File tree

4 files changed

+37
-5
lines changed

4 files changed

+37
-5
lines changed

Packages/vcs/vcs/vcs2vtk.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1581,16 +1581,16 @@ def __build_ld__():
15811581

15821582
def stippleLine(prop, line_type):
15831583
if line_type == 'long-dash':
1584-
prop.SetLineStipplePattern(int('1111111100000000', 2))
1584+
prop.SetLineStipplePattern(int('0000111111111111', 2))
15851585
prop.SetLineStippleRepeatFactor(1)
15861586
elif line_type == 'dot':
1587-
prop.SetLineStipplePattern(int('1010101010101010', 2))
1587+
prop.SetLineStipplePattern(int('0101010101010101', 2))
15881588
prop.SetLineStippleRepeatFactor(1)
15891589
elif line_type == 'dash':
1590-
prop.SetLineStipplePattern(int('1111000011110000', 2))
1590+
prop.SetLineStipplePattern(int('0001111100011111', 2))
15911591
prop.SetLineStippleRepeatFactor(1)
15921592
elif line_type == 'dash-dot':
1593-
prop.SetLineStipplePattern(int('0011110000110011', 2))
1593+
prop.SetLineStipplePattern(int('0101111101011111', 2))
15941594
prop.SetLineStippleRepeatFactor(1)
15951595
elif line_type == 'solid':
15961596
prop.SetLineStipplePattern(int('1111111111111111', 2))

Packages/vcs/vcs/vcsvtk/isolinepipeline.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ def _plotInternal(self):
144144

145145
for n in range(numLevels):
146146
cot.SetValue(n, l[n])
147-
cot.SetValue(numLevels, l[-1])
148147
# TODO remove update
149148
cot.Update()
150149

testing/vcs/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,6 +1007,13 @@ cdat_add_test(test_vcs_boxfill_lambert_crash
10071007
"${BASELINE_DIR}/test_vcs_boxfill_lambert_crash.png"
10081008
"${UVCDAT_GIT_TESTDATA_DIR}/data/NCEP_09_climo.nc"
10091009
)
1010+
1011+
cdat_add_test(test_vcs_line_patterns
1012+
"${PYTHON_EXECUTABLE}"
1013+
${cdat_SOURCE_DIR}/testing/vcs/test_vcs_line_patterns.py
1014+
"${BASELINE_DIR}/test_vcs_line_patterns.png"
1015+
)
1016+
10101017
cdat_add_test(test_vcs_init_open_sizing
10111018
"${PYTHON_EXECUTABLE}"
10121019
${cdat_SOURCE_DIR}/testing/vcs/test_vcs_init_open_sizing.py
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import vcs
2+
import cdms2
3+
import sys
4+
import os
5+
6+
7+
pth = os.path.join(os.path.dirname(__file__), "..")
8+
sys.path.append(pth)
9+
10+
import checkimage
11+
12+
x = vcs.init(bg=1, geometry=(1620, 1080))
13+
x.setantialiasing(0)
14+
x.drawlogooff()
15+
16+
f = cdms2.open(vcs.sample_data + "/clt.nc")
17+
s = f('clt')
18+
iso = x.createisoline()
19+
iso.level=[5, 50, 70, 95]
20+
iso.line = ['dot', 'dash', 'dash-dot', 'long-dash']
21+
x.plot(s,iso,continents=0)
22+
name = "test_vcs_line_patterns.png"
23+
24+
src = sys.argv[1]
25+
x.png(name)
26+
ret = checkimage.check_result_image(name, src, checkimage.defaultThreshold)

0 commit comments

Comments
 (0)