[vtkusers] Problem rendering vtkChartXY

Eric E. Monson emonson at cs.duke.edu
Wed Mar 16 09:35:11 EDT 2011


Hey Riku,

Thanks for passing along the SetScaleTiles tip. I'd never noticed that before. On Mac it still gives a bit of a strange result for me, but better than before.

I think the font problem you're seeing is a bug in the VTK FreeType implementation that either hasn't been noticed or just nobody has had time to fix. For me it only happens at really large font sizes, so that may be why you're noticing it and nobody else has.

What I see is part of the string that's being rendered wrapping around from the right side to the beginning of the left side. I'll attach an image (of the number 10000 rendered at 128 pt), but I don't think there is a way to get around it until the bug is fixed. Feel free to file a bug report so it stays on peoples' radar.

Talk to you later,
-Eric

-------------- next part --------------
A non-text attachment was scrubbed...
Name: vtkFT_128pt_10000.png
Type: image/png
Size: 2211 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110316/e4f72e24/attachment.png>
-------------- next part --------------


On Mar 16, 2011, at 6:07 AM, Riku wrote:

> Hi again,
> 
> I've some additional information from my tests that may be
> interesting. By chance I stumbled upon the SetScaleTiles() function of
> vtkContextScene. The documentation suggests it is involved in the
> scaling, so I went ahead to test it. Indeed, turning tile scaling off
> (ScaleTilesOf()) enables the functionality that I was looking for, at
> least for my test cases (on Windows).
> 
> Now, instead, I run into another problem when enlarging the fonts: for
> sizes larger than or equal to 20 the rendered numbers have unwanted
> artefacts. It looks like some graphics problem. The problem exists
> even without the tile scaling and magnification trick, so it seems it
> is a problem of its own.
> 
> Further, to follow up on Marcus' comment before, it would indeed be a
> nice feature to optionally be able to scale all the plot elements (not
> only the font maybe) with the window resize.
> 
> Hoping for some suggestions!
> 
> Thanks.
> 
> Riku
> 
> On 9 March 2011 17:21, Marcus D. Hanwell <marcus.hanwell at kitware.com> wrote:
>> On Mon, Mar 7, 2011 at 9:59 AM, Riku <subs at collab.se> wrote:
>>> Hello,
>>> 
>>> I am presently using the vtkChartXY class (and related) to plot simple
>>> X/Y plots. As I want to hardcopy them, I use the commonly described
>>> method and pass the render window to a window to image filter, and
>>> then on to a PNG writer. This works great for (more complicated)
>>> visualizations I do, but vtkChartXY gives me problems.
>>> 
>>> At a resolution (i.e. render window size) of 600x600, for example, the
>>> resulting image is grainy and generally unsuitable for printing. The
>>> solution I've used is to set the render window size to something like
>>> 2000x2000 instead.
>>> 
>>> The problem: On Windows, I have to use the SetMagnification() trick to
>>> get the image size right (as my screen size is smaller than
>>> 2000x2000), but for some reason I cannot get it to work for the
>>> rendered vtkChartXY plots. The resulting images are broken up, mixed,
>>> skewed and generally weird. What can I do about this?
>>> 
>>> Moreover, If I set the render window size close to my screen's maximum
>>> size, all text scales with the plot and thus becomes too small for the
>>> plot. I cannot find any way to change this behaviour. Is there any
>>> way? For other rendering situations I have not had this issue.
>>> 
>>> The problem can be recreated with the example here:
>>> http://www.vtk.org/Wiki/VTK/Examples/Cxx/Plotting/LinePlot
>>> (Add render window --> window to image filter --> png writer, and set
>>> render window size to something large.)
>>> 
>> I will try to take a look at this, and add a test to the charts. I
>> thought that this would work due to the code in ParaView accomplishing
>> this. The font scaling is something we discussed, but hadn't gotten
>> too. We need a way to determine what is a window resize (font size
>> stays constant), and a magnification where we could just scale the
>> font sizes by the specified amount in the vtkContext2D perhaps.
>> 
>> Marcus
>> 
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers



More information about the vtkusers mailing list