Skip to content

Commit

Permalink
Expose a "sparse-dot" stipple option, make sure it gets tested
Browse files Browse the repository at this point in the history
  • Loading branch information
scottwittenburg committed Dec 19, 2018
1 parent a640708 commit 8e092b0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tests/test_vcs_line_patterns.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
4 changes: 3 additions & 1 deletion vcs/VCS_validation_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
2 changes: 2 additions & 0 deletions vcs/vcs2vtk.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down

0 comments on commit 8e092b0

Please sign in to comment.