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

**URL:** https://discourse.paraview.org/t/ideas-to-implement-a-views-zoom-on-a-single-axis-dimension-solved/430
**Category:** Development
**Created:** [August 14, 2018, 12:49pm UTC](https://discourse.paraview.org/t/ideas-to-implement-a-views-zoom-on-a-single-axis-dimension-solved/430 "2018-08-14T12:49:45Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![embeddedmz](https://discourse.paraview.org/user_avatar/discourse.paraview.org/embeddedmz/32/142_2.png) [@embeddedmz](https://discourse.paraview.org/u/embeddedmz)
#### Post date: [August 14, 2018, 12:49pm UTC](https://discourse.paraview.org/t/ideas-to-implement-a-views-zoom-on-a-single-axis-dimension-solved/430/1 "2018-08-14T12:49:45Z")

</div>

Hello,

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 ?

---

<div class="post-metadata">

### Author: ![embeddedmz](https://discourse.paraview.org/user_avatar/discourse.paraview.org/embeddedmz/32/142_2.png) [@embeddedmz](https://discourse.paraview.org/u/embeddedmz)
#### Post date: [August 14, 2018, 5:31pm UTC](https://discourse.paraview.org/t/ideas-to-implement-a-views-zoom-on-a-single-axis-dimension-solved/430/2 "2018-08-14T17:31:44Z")

</div>

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 !

---

<div class="post-metadata">

### Author: ![wascott](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/w/8e8cbc/32.png) [@wascott](https://discourse.paraview.org/u/wascott)
#### Post date: [August 14, 2018, 6:16pm UTC](https://discourse.paraview.org/t/ideas-to-implement-a-views-zoom-on-a-single-axis-dimension-solved/430/3 "2018-08-14T18:16:34Z")

</div>

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

Alan

---

<div class="post-metadata">

### Author: ![embeddedmz](https://discourse.paraview.org/user_avatar/discourse.paraview.org/embeddedmz/32/142_2.png) [@embeddedmz](https://discourse.paraview.org/u/embeddedmz)
#### Post date: [August 16, 2018, 7:48am UTC](https://discourse.paraview.org/t/ideas-to-implement-a-views-zoom-on-a-single-axis-dimension-solved/430/4 "2018-08-16T07:48:32Z")

</div>

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 ?

---

<div class="post-metadata">

### Author: ![embeddedmz](https://discourse.paraview.org/user_avatar/discourse.paraview.org/embeddedmz/32/142_2.png) [@embeddedmz](https://discourse.paraview.org/u/embeddedmz)
#### Post date: [August 23, 2018, 9:21am UTC](https://discourse.paraview.org/t/ideas-to-implement-a-views-zoom-on-a-single-axis-dimension-solved/430/5 "2018-08-23T09:21:31Z")

</div>

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 !
