[RE][vtkusers] scaling of actors while preserving axes - scale.

Kleistereimer kleistereimer at gmx.de
Fri Sep 15 14:55:10 EDT 2006


hi tim,

interesting idea to have two separate actors.

1)
i created a 2nd mapper and a 2nd actor, which should get the axes.
but how to add the axes (a vtkCubeAxesActor2D object) to this actor?
SetInput() certainly wont work.
currently i use Renderer->AddViewProp(axes)

2)
i guess this whole scheme would not work.
the axes need to scale. if i scale the x-data by 800, i want the x-axe
be scaled by 800 to (so the axes still enclose the boundingbox), BUT i
want to keep the labels. (so they still read 0 .. 1 and not 0 .. 800).

picking into the object should reveal the real x- values too. (from 0 .. 1 )



-> i'll reformulate and repost this question..
i hope i get the english right this time.



Tim Thornton wrote:
> Hi,
> I had a similar ptoblem, not scaling but wanting to change the units of
> labels whilst keeping contours the same. I used 2 separate actors. So you
> could use one for your arrows data, which you scale, and another for your
> axes (with no data) that you don't
> Tim


> 
> -----Original Message-----
> From: vtkusers-bounces+tt=smartcomsoftware.com at vtk.org
> [mailto:vtkusers-bounces+tt=smartcomsoftware.com at vtk.org] On Behalf Of
> Kleistereimer
> Sent: 15 September 2006 08:40
> To: vtkusers at vtk.org
> Subject: Re: [RE][vtkusers] scaling of actors while preserving axes - scale.
> 
> hi!
> 
> 
> ok,
> - i could use a vtkSliderWidget, and
> - use the vtkCommand::InteractionEvent to update the x-scaling factor of
> the actor using Actor->SetScale ...
> 
> but this does not solves my current problem.
> 
> i dont have a problem with user-interaction here, i just need some lines
> of code which stretches my actor by , say, 800x in the x direction,
> while keeping the y and z direction intact. This will make my diagram
> wider, but hight and depth remain.
> 
> Actor->SetScale(old_x * 800.0, old_y, old_z)
> 
> will do exactly this, but unfortunately it changes the numbers from the
> coordinate axes too. (which i added to the actor using vtkCubeAxesActor2D.)
> 
> the numbers from the x axis dont read 0 .. 1 anymore, but  0 .. 800
> after the scaling. this is not what i want.
> 
> SetScale seems to transparently scale the actual data, while i just need
> to display it scaled. Axes and picking should show the real x position
> of the data (range 0 .. 1) not the scaled position (range 0 .. 800).
> 
> 
> so my question is: which gearing do i have to use to get visual scaling
> in x direction to work WHILE preserving axis-labels?
> (and while not affecting other actors which might be displayed nearby)
> 
> 1)
> a combination of SetScale and manually overwriting the range displayed
> by the axes (resetting to [0..1])
> 
> 2)
> some other api-function which lets the axes-text frozen
> 
> 3)
> some interactive widged (vtkSliderWidget) (??)
> 
> 
> 
> thank you for your time
> 
> regards
> kl
> 
> 



More information about the vtkusers mailing list