diff --git a/invesalius/constants.py b/invesalius/constants.py index 8f07b63..37fca9d 100644 --- a/invesalius/constants.py +++ b/invesalius/constants.py @@ -26,7 +26,7 @@ from project import Project #--------------- # VTK text -TEXT_SIZE = 12 +TEXT_SIZE = 14 TEXT_SIZE_LARGE = 18 TEXT_COLOUR = (1,1,1) (X,Y) = (0.03, 0.97) diff --git a/invesalius/data/slice_data.py b/invesalius/data/slice_data.py index ef8aeaa..0c9e48c 100644 --- a/invesalius/data/slice_data.py +++ b/invesalius/data/slice_data.py @@ -34,6 +34,7 @@ class SliceData(object): colour = const.ORIENTATION_COLOUR[self.orientation] text = vu.Text() + text.BoldOn() text.SetColour(colour) text.SetPosition(const.TEXT_POS_LEFT_DOWN_SLC) text.SetSize(const.TEXT_SIZE_LARGE) diff --git a/invesalius/data/vtk_utils.py b/invesalius/data/vtk_utils.py index 9b4fb43..06393c1 100644 --- a/invesalius/data/vtk_utils.py +++ b/invesalius/data/vtk_utils.py @@ -92,31 +92,43 @@ class Text(object): property.SetFontFamilyToArial() property.BoldOff() property.ItalicOff() - property.ShadowOn() + property.ShadowOff() property.SetJustificationToLeft() property.SetVerticalJustificationToTop() property.SetColor(const.TEXT_COLOUR) self.property = property - mapper = vtk.vtkTextMapper() - mapper.SetTextProperty(property) - self.mapper = mapper + #mapper = vtk.vtkTextMapper() + #mapper.SetTextProperty(property) + #self.mapper = mapper x, y = const.TEXT_POSITION - actor = vtk.vtkActor2D() - actor.SetMapper(mapper) + #actor = vtk.vtkActor2D() + #actor.SetMapper(mapper) + #actor.GetPositionCoordinate().SetCoordinateSystemToNormalizedDisplay() + #actor.GetPositionCoordinate().SetValue(x,y) + #self.actor = actor + + actor = vtk.vtkTextActor() actor.GetPositionCoordinate().SetCoordinateSystemToNormalizedDisplay() - actor.GetPositionCoordinate().SetValue(x,y) + actor.GetPositionCoordinate().SetValue(x,y) + actor.GetTextProperty().ShallowCopy(property) self.actor = actor + def BoldOn(self): + self.property.BoldOn() + self.actor.GetTextProperty().ShallowCopy(self.property) + def SetColour(self, colour): self.property.SetColor(colour) + self.actor.GetTextProperty().ShallowCopy(self.property) def SetSize(self, size): self.property.SetFontSize(size) + self.actor.GetTextProperty().ShallowCopy(self.property) def SetValue(self, value): - self.mapper.SetInput(str(value)) + self.actor.SetInput(str(value)) def SetPosition(self, position): self.actor.GetPositionCoordinate().SetValue(position[0], @@ -127,10 +139,11 @@ class Text(object): def SetJustificationToRight(self): self.property.SetJustificationToRight() + self.actor.GetTextProperty().ShallowCopy(self.property) def SetVerticalJustificationToBottom(self): self.property.SetVerticalJustificationToBottom() - + self.actor.GetTextProperty().ShallowCopy(self.property) def Show(self, value=1): if value: -- libgit2 0.21.2