Skip to content

Commit

Permalink
Merge pull request #12517 from aeslaughter/chigger-improvements
Browse files Browse the repository at this point in the history
Minor improvements to chigger
  • Loading branch information
permcody committed Nov 20, 2018
2 parents ad261b9 + d3b9647 commit 6428422
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
8 changes: 8 additions & 0 deletions python/chigger/RenderWindow.py
Expand Up @@ -12,6 +12,7 @@
import vtk

import base
import annotations
import observers
import misc
import mooseutils
Expand Down Expand Up @@ -63,8 +64,15 @@ def __init__(self, *args, **kwargs):
self._results = [misc.ChiggerBackground()]
self.__active = None

self.__watermark = annotations.ImageAnnotation(filename='chigger_white.png',
width=0.025,
horizontal_alignment='left',
vertical_alignment='bottom',
position=[0, 0])
# Store the supplied result objects
self.append(*args)
if kwargs.pop('chigger', False):
self.append(self.__watermark)

def __contains__(self, item):
"""
Expand Down
6 changes: 4 additions & 2 deletions python/chigger/utils/AxisOptions.py
Expand Up @@ -33,7 +33,7 @@ def get_options():
opt.add('tick_font_size', "The axis tick label font size, in points.", vtype=int)
opt.add('grid', True, "Show/hide the grid lines for this axis.")
opt.add('grid_color', [0.25, 0.25, 0.25], "The color for the grid lines.")
opt.add('precision', 3, "The axis numeric precision.", vtype=int)
opt.add('precision', "The axis numeric precision.", vtype=int)
opt.add('notation', "The type of notation, leave empty to let VTK decide", vtype=str,
allow=['standard', 'scientific', 'fixed', 'printf'])
opt.add('ticks_visible', True, "Control visibility of tickmarks on colorbar axis.")
Expand All @@ -44,6 +44,7 @@ def get_options():
opt.add('axis_point1', [0, 0], 'Starting location of axis, in absolute viewport coordinates.')
opt.add('axis_point2', [0, 0], 'Ending location of axis, in absolute viewport coordinates.')
opt.add('axis_scale', 1, "The axis scaling factor.", vtype=float)
opt.add('axis_factor', 0, "Offset the axis by adding a factor.", vtype=float)
opt.add('zero_tol', 1e-10, "Tolerance for considering limits to be the same.")
return opt

Expand Down Expand Up @@ -83,7 +84,8 @@ def set_options(vtkaxis, opt):
vtkaxis.SetCustomTickPositions(None, None)
vtkaxis.SetBehavior(vtk.vtkAxis.FIXED)
scale = opt['axis_scale']
vtkaxis.SetRange(lim[0] * scale, lim[1] * scale)
factor = opt['axis_factor']
vtkaxis.SetRange(lim[0] * scale + factor, lim[1] * scale + factor)
vtkaxis.RecalculateTickSpacing()
else:
vtkaxis.SetBehavior(vtk.vtkAxis.AUTO)
Expand Down

0 comments on commit 6428422

Please sign in to comment.