From 8e092b03e30a8194b7414817c7816b2e01acf678 Mon Sep 17 00:00:00 2001 From: Scott Wittenburg Date: Wed, 19 Dec 2018 13:05:41 -0700 Subject: [PATCH] Expose a "sparse-dot" stipple option, make sure it gets tested --- tests/test_vcs_line_patterns.py | 4 ++-- vcs/VCS_validation_functions.py | 4 +++- vcs/vcs2vtk.py | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/test_vcs_line_patterns.py b/tests/test_vcs_line_patterns.py index 8321ccfbe..d0bf1686b 100755 --- a/tests/test_vcs_line_patterns.py +++ b/tests/test_vcs_line_patterns.py @@ -9,8 +9,8 @@ def __init__(self, *args, **kwargs): def testVCSLinePatterns(self): s = self.clt('clt') iso = self.x.createisoline() - iso.level = [5, 50, 70, 95] - iso.linetypes = ['dot', 'dash', 'dash-dot', 'long-dash'] + iso.level = [5, 25, 50, 70, 95] + iso.linetypes = ['dot', 'sparse-dot', 'dash', 'dash-dot', 'long-dash'] self.x.plot(s, iso, continents=0, bg=self.bg) name = "test_vcs_line_patterns.png" self.checkImage(name) diff --git a/vcs/VCS_validation_functions.py b/vcs/VCS_validation_functions.py index 95210acee..7f2b25b41 100644 --- a/vcs/VCS_validation_functions.py +++ b/vcs/VCS_validation_functions.py @@ -915,12 +915,14 @@ def checkLineType(self, name, value): hvalue = 'dash-dot' elif value in ('long-dash', 4): hvalue = 'long-dash' + elif value in ('sparse-dot', 5): + hvalue = 'sparse-dot' else: checkedRaise( self, value, ValueError, - 'Expecting ("solid", "dash", "dot", "dash-dot", "long-dash") or (0, 1, 2, 3, 4)') + 'Expecting ("solid", "dash", "dot", "dash-dot", "long-dash", "sparse-dot") or (0, 1, 2, 3, 4, 5)') return hvalue diff --git a/vcs/vcs2vtk.py b/vcs/vcs2vtk.py index 255a6448b..200ffffb1 100644 --- a/vcs/vcs2vtk.py +++ b/vcs/vcs2vtk.py @@ -2011,6 +2011,8 @@ def getStipple(line_type): """ if line_type == 'long-dash': return vtk.vtkPen.DASH_DOT_DOT_LINE + elif line_type == 'sparse-dot': + return vtk.vtkPen.DOT_LINE elif line_type == 'dot': return vtk.vtkPen.DENSE_DOT_LINE elif line_type == 'dash':