# Is it possible to change the labels of vtkCameraOrientationWidget from X,Y,Z to U,V,N?

**URL:** https://discourse.vtk.org/t/is-it-possible-to-change-the-labels-of-vtkcameraorientationwidget-from-x-y-z-to-u-v-n/7620
**Category:** Support
**Created:** [January 12, 2022, 6:33am UTC](https://discourse.vtk.org/t/is-it-possible-to-change-the-labels-of-vtkcameraorientationwidget-from-x-y-z-to-u-v-n/7620 "2022-01-12T06:33:53Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![AlexLuya](https://discourse.vtk.org/user_avatar/discourse.vtk.org/alexluya/32/4036_2.png) [@AlexLuya](https://discourse.vtk.org/u/AlexLuya)
#### Post date: [January 12, 2022, 6:33am UTC](https://discourse.vtk.org/t/is-it-possible-to-change-the-labels-of-vtkcameraorientationwidget-from-x-y-z-to-u-v-n/7620/1 "2022-01-12T06:33:53Z")

</div>

For vtkAxesActor,there is a bunch of methods like:SetXAxisLabelText can be used to change the text.Is there any counterpart for vtkCameraOrientationWidget to do same thing?

---

<div class="post-metadata">

### Author: ![Paulo\_Carvalho](https://discourse.vtk.org/user_avatar/discourse.vtk.org/paulo_carvalho/32/370_2.png) [@Paulo\_Carvalho](https://discourse.vtk.org/u/Paulo_Carvalho)
#### Post date: [January 12, 2022, 6:01pm UTC](https://discourse.vtk.org/t/is-it-possible-to-change-the-labels-of-vtkcameraorientationwidget-from-x-y-z-to-u-v-n/7620/2 "2022-01-12T18:01:04Z")

</div>

Hi, Alex,

Possible it is. But it’s not easy.

The six handle labels are defined as hardcoded `const char*` strings in `vtkCameraOrientationRepresentation` ([https://gitlab.kitware.com/vtk/vtk/-/blob/master/Interaction/Widgets/vtkCameraOrientationRepresentation.h](https://gitlab.kitware.com/vtk/vtk/-/blob/master/Interaction/Widgets/vtkCameraOrientationRepresentation.h) - see member `AxisLabelsText` at line 320) and there is no way to change them via a setter method. So, you’ll likely need to subclass `vtkCameraOrientationRepresentation` to add a constructor that is able to set custom labels.

But this is not over yet. `vtkCameraOrientationWidget` inherits a `SetWidgetRepresentation(vtkCameraOrientationRepresentation*)` which is protected, so it is not public API. Hence, you will also need to subclass `vtkCameraOrientationWidget` to either add a constructor able to set your custom `vtkCameraOrientationRepresentation` subclass or a setter method to change it.

I hope this helps to get you started,

Paulo

---

<div class="post-metadata">

### Author: ![jaswantp](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jaswantp/32/10046_2.png) [@jaswantp](https://discourse.vtk.org/u/jaswantp)
#### Post date: [February 19, 2022, 6:38pm UTC](https://discourse.vtk.org/t/is-it-possible-to-change-the-labels-of-vtkcameraorientationwidget-from-x-y-z-to-u-v-n/7620/3 "2022-02-19T18:38:20Z")

</div>

Hi Alex,

As @Paulo_Carvalho mentioned, the API does not exist yet, but is trivial. It looks like a simple MR.

I’ll extend vtkCameraOrientationRepresentation with these methods…  
`SetXAxisLabelText(const char*)`  
`SetYAxisLabelText(const char*)`  
`SetZAxisLabelText(const char*)`

I just opened a maintenance [MR](https://gitlab.kitware.com/vtk/vtk/-/merge_requests/8862) for the widget and representation. The next MR shall take care of these conveniences.

---

<div class="post-metadata">

### Author: ![amaclean](https://discourse.vtk.org/user_avatar/discourse.vtk.org/amaclean/32/224_2.png) [@amaclean](https://discourse.vtk.org/u/amaclean)
#### Post date: [June 1, 2023, 4:24am UTC](https://discourse.vtk.org/t/is-it-possible-to-change-the-labels-of-vtkcameraorientationwidget-from-x-y-z-to-u-v-n/7620/4 "2023-06-01T04:24:00Z")

</div>

Hi @jaswantp this would be really be nice to have.

> [@jaswantp](#):
>
> I’ll extend vtkCameraOrientationRepresentation with these methods…  
> `SetXAxisLabelText(const char*)`  
> `SetYAxisLabelText(const char*)`  
> `SetZAxisLabelText(const char*)`
