[vtkusers] Oriented vtkCubeAxesActor issues

David Gobbi david.gobbi at gmail.com
Mon Feb 5 11:54:07 EST 2018


Hi Ignacio,

I've never tried the any of the "BaseFor" or "OrientedBounds" methods for
this class, but I did a quick look through the vtkAxisActor.cxx code and I
can confirm that UserTransform is ignored.  The vtkAxisActor is actually a
collection of other actors (for the text, the ticks, the axis line, etc
etc).  Most attributes of these child actors are not set when you set
attributes of the vtkAxisActor.  That's why the UserTransform is ignored.
It might be tricky to get the UserTransform working properly. The *BaseFor*
methods might way to reorient the axes.

This might also be related why setting Opacity < 1.0 causes the axes to
vanish.  The VTK renderer uses separate render passes for opaque object vs.
translucent objects, and if the pass for the main vtkAxisActor is different
from its children, maybe that messes up the rendering?  It's just a guess,
though.

 - David


On Sun, Feb 4, 2018 at 1:45 AM, Ignacio Fernández Galván via vtkusers <
vtkusers at vtk.org> wrote:

> On 03/02/18, at 19:29, Ignacio Fernández Galván via vtkusers wrote:
>
>> Hi,
>>
>> This was apparently mentioned some time ago (
>> http://vtk.1045678.n5.nabble.com/oriented-vtkCubeAxesActor-
>> issue-td5726648.html), but there was no solution, and I think I'm having
>> the same problem.
>>
>> Basically, I set up a vtkCubeAxesActor with custom range:
>>
>>      axes = vtk.vtkCubeAxesActor()
>>      axes.SetCamera(renderer.GetActiveCamera())
>>      axes.SetAxisBaseForX(1,0,0)
>>      axes.SetAxisBaseForY(0,1,0)
>>      axes.SetAxisBaseForZ(0,0,1)
>>      axes.SetBounds(0,10,0,10,0,10)
>>      axes.SetOrientedBounds(0,10,0,10,0,10)
>>      axes.SetUseOrientedBounds(1)
>>      axes.SetXAxisRange(0,1)
>>      renderer.AddActor(axes)
>>
>> I set the "BaseFor" axes to the Cartesian ones, so the actor should look
>> the same with "UseOrientedBounds" or without. But with oriented bounds I
>> get an X axis labeled from 0 to 10, while without it it's 0 to 1, as I
>> requested.
>>
>> Also, if I use the oriented bounds and do not set the bounds, there is
>> some clipping, as if the renderer didn't notice the actor's real extent.
>>
>> In the thread linked above, it was mentioned that this is done correctly
>> in Paraview. Is it really so? How can I test it?
>>
>> My ultimate goal is to show the outline of a transformed ImageData grid,
>> with ticks marking the gridpoints on the outline. Is there some other way
>> to achieve that? (I have the outline as a transformed box, I'm just missing
>> the ticks. So in fact I would also like to disable the axis line in the
>> vtkCubeAxesActor and leave the ticks...)
>>
>
>
> Going one level down, I tried with vtkAxisActor:
>
> - Like vtkCubeAxesActor, it seems impervious to SetUserTransform.
>
> - Like vtkCubeAxesActor, not setting the bounds results in clipping
> issues, but I guess that's intended.
>
> - I can't set the lines to translucent. Get*Property().SetOpacity(x), for
> any x<1.0 makes the lines disappear, as if the x is interpreted as an
> integer (I'm using the python wrapper, if it matters). SetColor works fine.
>
> I also noticed that the automatic positioning of vtkCubeAxesActor get's
> confused if one used a too distorted frame, or exchanges some axes (with
> the "BaseFor" axes): in some orientations the axes end up in the wrong
> side. It looks like there are some hardcoded assumptions about where x, y
> and z are.
>
> These all look like bugs or limitations to me. Is it worth reporting them
> on gitlab?
>
>
> Ignacio
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensou
> rce/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> https://vtk.org/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://vtk.org/pipermail/vtkusers/attachments/20180205/9f354284/attachment.html>


More information about the vtkusers mailing list