[vtkusers] vtkCaptionActor2D not filling its prop correctly

Tiago Nobrega tigarmo at gmail.com
Fri Sep 23 07:27:21 EDT 2016


Hello,

I apologize for not reading the guidelines properly and submitting an issue
on Gitlab before trying the mailing list. Here's my issue:

We are in the process of updating VTK from 6.3 to 7.0 and some of our tests
are failing because text actors are being rendered differently. This
usually happens when we update the library (minor differences are to be
expected) but in this particular case it looks like a regression.

The following code (python):

```python
import vtk

ren1 = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(ren1)
iren = vtk.vtkRenderWindowInteractor()
iren.SetRenderWindow(renWin)

prop_1 = vtk.vtkCaptionActor2D()
prop_1.SetCaption('Hello')
prop_1.SetAttachmentPoint((-0.1, 0.0, 0.0))

prop_1.GetCaptionTextProperty().Modified()

ren1.AddActor(prop_1)
ren1.SetBackground(0, 0, 0)
ren1.GetActiveCamera().SetFocalPoint(0,0,0)
ren1.GetActiveCamera().SetPosition(1,0,0)
ren1.GetActiveCamera().SetViewUp(0,0,1)
ren1.ResetCamera()
renWin.SetSize(500, 500)

iren.Start()
```

... generates two different renderings depending on the version, as shown
on the following image:

http://imgur.com/w8VXM8z

The left side is VTK 6.3, and the right one is 7.0. Both ran on a Windows
10 machine, but the issue was replicated on our Linux boxes too. In all
cases we're still using the old OpenGL backend and not the new OpenGL2 one.
The behavior in version 6.3 seems more "correct" in the sense that the text
is more fully filling up the rectangle, with the default scaling mode being
to scale to the prop. I've investigated the commit history for the classes
that seem relevant - vtkCaptionActor2D, vtkTextActor, vtkTextProperty, etc
- but nothing stood out as possible "culprits".

Let me know if you need further info or clarifications. Thanks.

Tiago Nobrega
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160923/87097891/attachment.html>


More information about the vtkusers mailing list