[vtkusers] Problem with vtkLegendActor with VTK 6 Python Wrappings

Gelman, Joshua jgelman at decisionvis.com
Sun Aug 11 08:23:00 EDT 2013


Bill,

That seemed to do the trick!  Thank you *very* much!

--Josh


On Sun, Aug 11, 2013 at 8:02 AM, Bill Lorensen <bill.lorensen at gmail.com>wrote:

> Try
> square.Update()
> before you set the entry.
>
>
>
> On Sun, Aug 11, 2013 at 7:51 AM, Bill Lorensen <bill.lorensen at gmail.com>wrote:
>
>> Josh,
>>
>> Looks like a bug to me. I see the same error with this C++ example:
>> http://vtk.org/Wiki/VTK/Examples/Cxx/Visualization/Legend
>>
>> I'll take a look.
>>
>> Bill
>>
>>
>> On Sun, Aug 11, 2013 at 5:00 AM, Gelman, Joshua <jgelman at decisionvis.com>wrote:
>>
>>> Before I report this as a bug, I was just curious if anyone else could
>>> confirm this or had any other insight.  I'm still not sure if this is a bug
>>> or a problem on my end.  Basically, when I try to use vtkLegendActor in
>>> Python, I get the following error:
>>>
>>> ERROR: In ..\..\..\VTKSrc\Filters\General\vtkTransformPolyDataFilter.cxx, line 84 vtkTransformPolyDataFilter (09ED64F8): No input data
>>>
>>> It doesn't crash my program, but the error shows up in the console as
>>> many number of times as self.legend.SetNumberOfEntries(n) is set.  This
>>> same error does NOT occur with my build of VTK 5.10.1.
>>>
>>> Below is a sample program I threw together that generates the error on
>>> my end.  Any insight would be greatly appreciated.
>>>
>>> Many thanks,
>>>
>>> --Josh
>>>
>>> #################################
>>> import vtk
>>>
>>> square = vtk.vtkCubeSource()
>>> mapper = vtk.vtkPolyDataMapper()
>>> mapper.SetInputData(square.GetOutput())
>>>
>>> legendBox = vtk.vtkLegendBoxActor()
>>> legendBox.SetNumberOfEntries(1)
>>>
>>> legendBox.SetEntry(0, square.GetOutput(), "Test", [1,1,0])
>>>
>>> ren = vtk.vtkRenderer()
>>> renWin = vtk.vtkRenderWindow()
>>> renWin.AddRenderer(ren)
>>> ren.AddActor(legendBox)
>>>
>>> iren = vtk.vtkRenderWindowInteractor()
>>> iren.SetRenderWindow(renWin);
>>>
>>> renWin.Render()
>>> iren.Start()
>>>
>>> #################################
>>>
>>>
>>>
>>> _______________________________________________
>>> 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
>>>
>>>
>>
>>
>> --
>> Unpaid intern in BillsBasement at noware dot com
>>
>
>
>
> --
> Unpaid intern in BillsBasement at noware dot com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130811/c2c5219e/attachment.htm>


More information about the vtkusers mailing list