Skip to content

Commit 721383f

Browse files
committed
BUG: 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 1a83c8d commit 721383f

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
@@ -1580,16 +1580,16 @@ def __build_ld__():
15801580

15811581
def stippleLine(prop, line_type):
15821582
if line_type == 'long-dash':
1583-
prop.SetLineStipplePattern(int('1111111100000000', 2))
1583+
prop.SetLineStipplePattern(int('0000111111111111', 2))
15841584
prop.SetLineStippleRepeatFactor(1)
15851585
elif line_type == 'dot':
1586-
prop.SetLineStipplePattern(int('1010101010101010', 2))
1586+
prop.SetLineStipplePattern(int('0101010101010101', 2))
15871587
prop.SetLineStippleRepeatFactor(1)
15881588
elif line_type == 'dash':
1589-
prop.SetLineStipplePattern(int('1111000011110000', 2))
1589+
prop.SetLineStipplePattern(int('0001111100011111', 2))
15901590
prop.SetLineStippleRepeatFactor(1)
15911591
elif line_type == 'dash-dot':
1592-
prop.SetLineStipplePattern(int('0011110000110011', 2))
1592+
prop.SetLineStipplePattern(int('0101111101011111', 2))
15931593
prop.SetLineStippleRepeatFactor(1)
15941594
elif line_type == 'solid':
15951595
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
@@ -1017,6 +1017,13 @@ cdat_add_test(test_vcs_boxfill_lambert_crash
10171017
"${BASELINE_DIR}/test_vcs_boxfill_lambert_crash.png"
10181018
"${UVCDAT_GIT_TESTDATA_DIR}/data/NCEP_09_climo.nc"
10191019
)
1020+
1021+
cdat_add_test(test_vcs_line_patterns
1022+
"${PYTHON_EXECUTABLE}"
1023+
${cdat_SOURCE_DIR}/testing/vcs/test_vcs_line_patterns.py
1024+
"${BASELINE_DIR}/test_vcs_line_patterns.png"
1025+
)
1026+
10201027
cdat_add_test(test_vcs_init_open_sizing
10211028
"${PYTHON_EXECUTABLE}"
10221029
${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)