Skip to content
Snippets Groups Projects
Commit be6fcbcc authored by Boman Romain's avatar Boman Romain
Browse files

change lookup table

parent b536cc34
No related branches found
No related tags found
No related merge requests found
......@@ -883,7 +883,6 @@ class SurfMesh:
self.polydata = None
self.mapper = None
self.actor = None
self.grid_actor = None
self.__build(nodes, tris, vertices)
def __build(self, nodes, tris, vertices):
......@@ -980,9 +979,21 @@ class Arrows:
mapper.SetInputConnection(glyph.GetOutputPort())
mapper.ScalarVisibilityOn()
lut = vtk.vtkLookupTable()
cs = vtk.vtkColorSeries()
# cs.SetColorScheme(cs.BREWER_DIVERGING_BROWN_BLUE_GREEN_9)
cs.SetColorScheme(cs.BREWER_DIVERGING_SPECTRAL_3)
cs.BuildLookupTable(lut, vtk.vtkColorSeries.ORDINAL)
# lut = vtk.vtkLookupTable()
# lut.SetHueRange(0.667,0.)
mapper.SetLookupTable(lut)
vmin, vmax = polydata.GetPointData().GetVectors().GetRange(-1) # -1=norm
mapper.SetScalarRange(vmin, vmax)
actor = vtk.vtkActor()
actor.SetMapper(mapper)
......@@ -997,7 +1008,8 @@ class Arrows:
class View:
def __init__(self):
self.ren = vtk.vtkRenderer()
self.ren.SetBackground(colors.GetColor3d('cobalt'))
# self.ren.SetBackground(colors.GetColor3d('cobalt'))
self.ren.SetBackground(colors.GetColor3d('white'))
self.win = vtk.vtkRenderWindow()
self.win.SetSize(800, 800)
......@@ -1038,6 +1050,7 @@ class ParaviewAxes:
axes.SetTotalLength(1, 1, 1)
tprop = vtk.vtkTextProperty()
tprop.ItalicOn()
tprop.SetColor(colors.GetColor3d('black')) # for a white background
# tprop.ShadowOn()
# tprop.SetFontFamilyToTimes()
axes.GetXAxisCaptionActor2D().SetCaptionTextProperty(tprop)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment