Ideas to implement a view's zoom on a single axis (dimension) [Solved]


I want to add a button to the render view (or elsewhere) that will allow me to zoom on a single axis (X or Y dimension). I have a filter that can output a very long vtkImageData (on the Y axis), and I want to zoom only on the X axis so I can visualize the colours of the long line.

Any suggestions is welcome (class names, etc…)

is it possible to get the vtkProp3D representing the output of a filter and call vtkProp3D::SetScale(double x, double y, double z) on it ?

I found a solution : Properties panel -> Transforming -> Scale (first text field) -> increase the value -> PROFIT ! but I need to found the code that do that job so I can use another way to increase the X scale !

The Transform filter will also do this. You may want to look at that code?


Actually, I have another problem, when I change the X scale, the X axis (representing meters in my case - render view property) also changes (multiplied by the value of the scale) and that’s not what I want (the spatial info is modified).

Transform options change the data, and that’s not what I am looking for, I need to create a custom view where I can change the ratio of the image and where the interaction mode is by default 2-D. Can you please give me some hints ?

The aspect ratio (of a 2-D vtkImageData) can be tuned from the the renderer or the render view ?

I want to share my solution : I created a custom view where I keep track of the representations and the actor associated with them. When an actor scale is modified (Observer pattern), my custom view is notified and I change the scale of the other representation’s actor scale but also the data scale and scale of the vtkPVGridAxes3DActor of the vtkPVRenderView.

It’s not a zoom issue, just a scaling problem !