Skip to content

Commit

Permalink
#266: make scalar bars consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
ppebay committed Jun 22, 2022
1 parent 896f129 commit f1cdeb4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/lbaf/IO/lbsMeshBasedVisualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ def create_color_transfer_function(self, attribute_range, scheme=None):
# Return color transfer function
return ctf

def create_scalar_bar_actor(self, mapper, title, width, x, y):
def create_scalar_bar_actor(self, mapper, title, x, y):
""" Create scalar bar with default and custome parameters."""

# Instantiate scalar bar linked to given mapper
Expand All @@ -360,6 +360,7 @@ def create_scalar_bar_actor(self, mapper, title, width, x, y):
scalar_bar_actor.SetOrientationToHorizontal()
scalar_bar_actor.SetNumberOfLabels(2)
scalar_bar_actor.SetHeight(0.08)
scalar_bar_actor.SetWidth(0.4)
scalar_bar_actor.SetLabelFormat("%.3E")
scalar_bar_actor.SetBarRatio(0.3)
scalar_bar_actor.DrawTickLabelsOn()
Expand All @@ -373,7 +374,6 @@ def create_scalar_bar_actor(self, mapper, title, width, x, y):

# Set custom parameters
scalar_bar_actor.SetTitle(title)
scalar_bar_actor.SetWidth(width)
position = scalar_bar_actor.GetPositionCoordinate()
position.SetCoordinateSystemToNormalizedViewport()
position.SetValue(x, y, 0.0)
Expand Down Expand Up @@ -471,7 +471,7 @@ def generate(self, gen_meshes, gen_mulmed):
rank_actor.SetMapper(rank_mapper)
rank_actor.GetProperty().SetOpacity(0.6)
work_actor = self.create_scalar_bar_actor(
rank_mapper, "Rank Work", 0.6, 0.2, 0.9)
rank_mapper, "Rank Work", 0.55, 0.9)
renderer.AddActor(rank_actor)
renderer.AddActor2D(work_actor)

Expand All @@ -497,7 +497,7 @@ def generate(self, gen_meshes, gen_mulmed):
edge_actor.GetProperty().SetLineWidth(10)
edge_actor.GetProperty().SetOpacity(1.0)
volume_actor = self.create_scalar_bar_actor(
edge_mapper, "Inter-Object Volume", 0.4, 0.05, 0.05)
edge_mapper, "Inter-Object Volume", 0.05, 0.05)
renderer.AddActor(edge_actor)
renderer.AddActor2D(volume_actor)

Expand Down Expand Up @@ -562,7 +562,7 @@ def generate(self, gen_meshes, gen_mulmed):

# Create and add unique scalar bar for object time
time_actor = self.create_scalar_bar_actor(
glyph_mapper, "Object Time", 0.4, 0.55, 0.05)
glyph_mapper, "Object Time", 0.55, 0.05)
renderer.AddActor2D(time_actor)

# Create render window
Expand Down

0 comments on commit f1cdeb4

Please sign in to comment.